Electric power system operation state identification and prediction method, device and equipment based on multiple tasks and self-attention

By adopting multi-task and self-attention methods in the power system and combining the self-attention mechanism network, the problems of single task limitation and low computing efficiency in the existing technology are solved, and efficient state prediction and transient stability evaluation of the power system are realized.

CN120163056APending Publication Date: 2025-06-17ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510284969.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The prior art has a single task limitation in the transient stability evaluation and state prediction of power systems, and it is impossible to perform stability evaluation and state prediction at the same time, the calculation efficiency is low, it is difficult to meet real-time requirements and the prediction accuracy is low.

Method used

The operation state identification and prediction method of power system based on multitasking and self-attention is adopted. The identification and prediction model is constructed through multitasking combined with the self-attention mechanism network, and the feature matrix and adjacency matrix are used for processing to achieve state prediction and transient stability evaluation at the same time.

Benefits of technology

It realizes the simultaneous prediction of power system state and transient stability evaluation, improves calculation efficiency and prediction accuracy, and meets the real-time requirements of power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120163056A_ABST
    Figure CN120163056A_ABST
Patent Text Reader

Abstract

The invention relates to an electric power system operation state identification and prediction method, device and equipment based on multiple tasks and self-attention, and the method comprises the steps: obtaining electric power data of electric power system operation state identification and prediction, and constructing a feature matrix and an adjacent matrix according to the electric power data; constructing an identification and prediction model by adopting a multi-task combined self-attention mechanism network, and inputting the feature matrix and the adjacent matrix into the identification and prediction model for processing to obtain prediction and evaluation data; and determining a state prediction result and a transient stability evaluation result of the power system according to the prediction and evaluation data. According to the method, an identification and prediction model is constructed by combining multiple tasks with a self-attention mechanism network, so that two key and important tasks of state identification and state prediction of the power system can be processed at the same time, state prediction and transient stability evaluation of the power system are realized at the same time, and the efficiency and prediction precision are improved; and the real-time requirement of a power system is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power systems, and particularly to a method, device and equipment for identifying and predicting the operating state of a power system based on multi-task and self-attention. Background Art

[0002] With the transformation of the energy structure and the promotion of sustainable development, the penetration rate of renewable energy in the power system has increased significantly. However, due to the intermittency and volatility of renewable energy such as wind energy and solar energy, the stability of the power grid faces severe challenges. In addition, the development of smart grids has made the dispatching and control of power systems more complex and uncertain. Therefore, transient stability assessment (TSA) and state prediction (SP) have become key tasks in the power grid energy management system (EMS) to ensure the safe and stable operation of the power system.

[0003] Traditional transient stability assessment methods include time-domain simulation methods, direct methods and frequency-domain methods. Among them, the time-domain simulation method calculates the dynamic equations of the power system through numerical integration, which can accurately capture the nonlinear dynamic behavior, but has a large amount of calculation and is difficult to apply to large-scale power systems. The direct method (such as the energy function method) does not rely on time-domain simulation and has high calculation efficiency, but the construction of the energy function is relatively complex. The frequency-domain method (such as modal analysis) is suitable for small-disturbance stability analysis, but it is difficult to effectively evaluate the stability of the power system under large-disturbance conditions.

[0004] In recent years, the development of artificial intelligence (AI) technology has provided new ideas for transient stability assessment and state prediction of power systems. For example, deep learning (Deep Learning) and graph neural network (Graph Neural Network, GNN) have gradually been applied to the state analysis tasks of power systems because they can process complex spatio-temporal data. For example, the method based on the GMDH (Group Method of Data Handling) neural network has achieved good results in fault detection and load prediction, and the method based on CNN (such as convolutional neural network) has realized the real-time detection of transient unstable states through a hierarchical strategy. In addition, some frameworks combining GCN (graph convolutional network) and RNN (recurrent neural network) have performed well in transient stability assessment by capturing the topological information and temporal characteristics of the power grid. However, these methods generally have single-task limitations and cannot perform transient stability assessment and state prediction simultaneously, resulting in limited performance of the transient stability assessment and state prediction models of power systems in dealing with the complexity of actual power grids.

[0005] With the development of technology, the existing methods for transient stability assessment of power systems include power system state analysis methods based on GCN and LSTM, data-driven transient stability assessment methods based on Deep Forest, power system state prediction methods based on RNN and deep learning, and methods based on numerical simulation (such as time-domain simulation). The power system state analysis method based on GCN and LSTM uses the graph convolutional network GCN to extract power grid topology information, and combines LSTM for time series modeling to propose a recursive graph convolutional network based on GCN-LSTM. The bus status and topology information are processed by the graph convolutional network GCN, and then LSTM is used to capture time dependence; however, the power system state analysis method based on GCN and LSTM adopts a fixed-depth network structure, resulting in excessive computational complexity for simple samples and possible insufficiency for complex samples. In addition, the power system state analysis method based on GCN and LSTM is limited to single-task scenarios and is difficult to perform state prediction and stability assessment simultaneously. The data-driven transient stability assessment method based on Deep Forest uses Deep Forest for data-driven stability analysis and combines an active learning strategy to enhance the adaptability and robustness of the model; the advantage of the data-driven transient stability assessment method based on Deep Forest is that it does not require a large amount of labeled data and is suitable for power grid scenarios with dynamically changing data; however, Deep Forest mainly relies on decision tree structures and is difficult to fully capture the spatio-temporal characteristics of the power grid, and its generalization ability is limited in complex scenarios. The power system state prediction method based on RNN and deep learning uses the recurrent neural network RNN for voltage time series prediction and can better learn long-term non-linear dependence relationships; however, the power system state prediction method based on RNN and deep learning ignores the important spatial relationships between different buses and only relies on time features for prediction, so its accuracy is limited in large-scale power grid scenarios. The method based on numerical simulation (such as time-domain simulation) has high computational accuracy and can accurately capture complex dynamic behaviors, but the computational complexity is huge and it is difficult to meet the requirements of real-time assessment. Especially in a large-scale power grid environment, the computational efficiency is low.

[0006] Although existing methods for transient stability assessment of power systems, namely transient stability assessment (TSA) and state prediction (SP) methods based on graph convolutional networks (GCN) and other AI technologies, have improved the intelligent analysis ability of power systems to a certain extent, there are still defects: on the one hand, there is a single-task limitation, and it is impossible to perform transient stability assessment (TSA) and state prediction (SP) simultaneously. For example, existing methods are usually single-task models, either focusing on the transient stability assessment of the power grid or used for state prediction, and cannot complete the two tasks simultaneously in a unified framework; this leads to the need to train and maintain multiple models separately, increasing the consumption of computing resources and possibly causing the problem of insufficient information utilization. The second aspect is low computational efficiency, which is difficult to meet the real-time requirements; for example, many existing solutions use neural networks with fixed depths, and all input samples need to go through the complete calculation path, and even simple samples cannot skip redundant calculations, resulting in unnecessary computational overhead; in large-scale power grid scenarios, the computational cost is too high to meet the requirements of real-time online analysis. The third aspect is that the existing decoder structure has limited prediction accuracy for key power grid variables; for example, when predicting key variables such as bus voltage amplitude, phase angle, active power, and reactive power, existing methods often use traditional MLP or simple RNN structures, lacking effective feature extraction capabilities, resulting in limited prediction accuracy; especially in complex power grid environments, traditional decoders are difficult to capture long-term dependencies, affecting the stability of state prediction. Summary of the Invention

[0007] This application provides a method, device, and equipment for identifying and predicting the operating state of a power system based on multi-task and self-attention, which are used to solve the technical problems that existing methods for transient stability assessment and state prediction of power systems have single-task limitations, cannot perform stability assessment and state prediction simultaneously, have low computational efficiency, are difficult to meet real-time requirements, and have low prediction accuracy.

[0008] To achieve the above object, this application provides the following technical solutions:

[0009] On the one hand, a method for identifying and predicting the operating state of a power system based on multi-task and self-attention is provided, including the following steps:

[0010] Obtain the power data for identifying and predicting the operating state of the power system, and construct a feature matrix and an adjacency matrix according to the power data. The power data includes power grid nodes, node connection relationships, operating duration, and the voltage amplitude, phase angle, active power, and reactive power of each node;

[0011] Use a multi-task combined with self-attention mechanism network to construct an identification and prediction model, input the feature matrix and the adjacency matrix into the identification and prediction model for processing, and obtain prediction and evaluation data;

[0012] Determine the state prediction result and transient stability evaluation result of the power system according to the prediction and evaluation data.

[0013] Preferably, the identification and prediction model includes a backbone network module, a decoder module connected to the backbone network module, and a multi-output module;

[0014] The backbone network module is used to extract features from the feature matrix and the adjacency matrix to obtain feature data, and the feature data includes time features and spatial features at each level;

[0015] The decoder module is used to process the feature data by using a U-shaped residual decoder and output state prediction data;

[0016] The multi-output module is used to process the feature data by using a multi-output mechanism and output classification evaluation data;

[0017] Among them, the prediction and evaluation data includes state prediction data and classification evaluation data.

[0018] Preferably, the backbone network module includes at least N first spatio-temporal graph convolutional units and (N - 2) self-attention mechanisms, and the corresponding U-shaped residual decoder includes (N - 1) second spatio-temporal graph convolutional units connected in sequence; the N first spatio-temporal graph convolutional units are connected in series in sequence and then respectively connected to the input ends of the decoder module and the multi-output module, and the output ends of the first (N - 2) first spatio-temporal graph convolutional units are all connected to the output ends of the corresponding first (N - 2) second spatio-temporal graph convolutional units through one self-attention mechanism; where N is a natural number not less than 3.

[0019] Preferably, the self-attention mechanism is used to calculate the correlation data between the positions of the feature data output by the first spatio-temporal graph convolutional units in pairs; the first (N - 2) second spatio-temporal graph convolutional units are used to automatically focus on and extract the time features crucial for state prediction from the input feature data; the last second spatio-temporal graph convolutional unit is used to predict the operating state of the power system based on the extracted crucial time features to obtain state prediction data.

[0020] Preferably, the first spatio-temporal graph convolutional unit includes a first time-domain convolutional layer, a graph convolutional layer, and a second time-domain convolutional layer connected in sequence. The first time-domain convolutional layer is used to compress and refine the input feature matrix in the time dimension to obtain a first matrix of key information; the graph convolutional layer is used to extract features and propagate information according to the first matrix and the input adjacency matrix to obtain a second matrix of learned neighbor information; the second time-domain convolutional layer compresses and refines the second matrix in the time dimension to obtain feature data.

[0021] Preferably, the multi-exit mechanism includes several evaluation sub-modules connected in sequence to form multiple levels. Each evaluation sub-module includes a third spatio-temporal graph convolution unit and an output channel connected to the third spatio-temporal graph convolution unit. The output channel is used to output classification evaluation data, and a confidence threshold is set on the output channel; wherein, the numerical values of the confidence threshold in the first evaluation sub-module to the last evaluation sub-module are set from small to large; the multi-exit mechanism is used to classify and evaluate the input feature data through the evaluation sub-module until the classification confidence reaches the confidence threshold, and then output the classification evaluation data.

[0022] Preferably, in the process of constructing the identification and prediction model by using the multi-task combined with the self-attention mechanism network, the method includes: optimizing the output state prediction data of the identification and prediction model by using the mean square error; and / or, optimizing the output classification evaluation data of the identification and prediction model by using a weighted combination method of cross-entropy loss and focal loss.

[0023] On the other hand, a power system operation state identification and prediction device based on multi-task and self-attention is provided, including a data acquisition module, a model construction and data processing module, and a result determination module;

[0024] The data acquisition module is used to acquire power data for power system operation state identification and prediction, construct a feature matrix and an adjacency matrix according to the power data. The power data includes power grid nodes, node connection relationships, operation duration, and the voltage amplitude, phase angle, active power, and reactive power of each node;

[0025] The model construction and data processing module is used to construct an identification and prediction model by using a multi-task combined with a self-attention mechanism network, input the feature matrix and the adjacency matrix into the identification and prediction model for processing, and obtain prediction and evaluation data;

[0026] The result determination module is used to determine the state prediction result and transient stability evaluation result of the power system according to the prediction and evaluation data.

[0027] Preferably, the identification and prediction model includes a backbone network module, a decoder module, and a multi-exit module connected to the backbone network module;

[0028] The backbone network module is used to extract features from the feature matrix and the adjacency matrix to obtain feature data, and the feature data includes time features and space features at each level;

[0029] The decoder module is used to process the feature data by using a U-shaped residual decoder and output state prediction data; the prediction and evaluation data includes state prediction data and classification evaluation data;

[0030] The multi-exit module is used to process the feature data by using a multi-exit mechanism and output classification evaluation data;

[0031] The backbone network module includes at least N first spatio-temporal graph convolutional units and (N - 2) self-attention mechanisms, and the corresponding decoder module includes (N - 1) second spatio-temporal graph convolutional units connected in sequence; the N first spatio-temporal graph convolutional units are connected in series in sequence and then respectively connected to the input ends of the decoder module and the multi-exit module, and the output ends of the first (N - 2) first spatio-temporal graph convolutional units are all connected to the output ends of the corresponding first (N - 2) second spatio-temporal graph convolutional units through one of the self-attention mechanisms; N is a natural number not less than 3; the self-attention mechanism is used to calculate the correlation data between the positions of the pairwise feature data output by the first spatio-temporal graph convolutional unit; the first (N - 2) second spatio-temporal graph convolutional units are used to automatically focus on and extract the time features crucial for state prediction from the input feature data; the last second spatio-temporal graph convolutional unit is used to predict the operating state of the power system based on the extracted crucial time features to obtain state prediction data;

[0032] The multi-exit mechanism includes several evaluation sub-modules connected in sequence to form multiple levels. Each evaluation sub-module includes a third spatio-temporal graph convolutional unit and an output channel connected to the third spatio-temporal graph convolutional unit. The output channel is used to output classification evaluation data, and a confidence threshold is set on the output channel; among them, the numerical values of the confidence thresholds in the first evaluation sub-module to the last evaluation sub-module are set from small to large; the multi-exit mechanism is used to classify and evaluate the input feature data through the evaluation sub-modules until the output classification confidence reaches the confidence threshold, and then output the classification evaluation data.

[0033] On the other hand, a terminal device is provided, including a processor and a memory;

[0034] The memory is used to store program codes and transmit the program codes to the processor;

[0035] The processor is used to execute the above-mentioned method for identifying and predicting the operating state of a power system based on multi-task and self-attention according to the instructions in the program codes.

[0036] The method, device and equipment for identifying and predicting the operating state of a power system based on multi-task and self-attention. The method for identifying and predicting the operating state of a power system based on multi-task and self-attention includes obtaining power data for identifying and predicting the operating state of the power system, constructing a feature matrix and an adjacency matrix according to the power data. The power data includes power grid nodes, node connection relationships, operating duration, and the voltage amplitude, phase angle, active power and reactive power of each node; using a multi-task combined with self-attention mechanism network to construct an identification and prediction model, inputting the feature matrix and the adjacency matrix into the identification and prediction model for processing, and obtaining prediction and evaluation data; determining the state prediction result and transient stability evaluation result of the power system according to the prediction and evaluation data.

[0037] From the above technical solutions, it can be seen that the present application has the following advantages: The method for identifying and predicting the operating state of a power system based on multi-task and self-attention uses a multi-task combined with self-attention mechanism network to construct an identification and prediction model, which can simultaneously process two key and important tasks of state identification and state prediction of the power system, realize simultaneous state prediction and transient stability evaluation of the power system, improve efficiency and prediction accuracy, and meet the real-time requirements of the power system; it solves the technical problems that the existing methods for transient stability evaluation and state prediction of power systems have single-task limitations, cannot perform stability evaluation and state prediction simultaneously, have low computational efficiency, are difficult to meet the real-time requirements, and have low prediction accuracy.

[0038] The device for identifying and predicting the operating state of a power system based on multi-task and self-attention can simultaneously perform transient stability evaluation and state prediction of the power system through a data acquisition module, a model construction and data processing module, and a result determination module; through the identification and prediction model with a shared encoder, it uniformly extracts grid topology and time series features, realizing a more comprehensive analysis of the power system state. Description of the Drawings

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0040] Figure 1 It is a flowchart of the steps of the method for identifying and predicting the operating state of a power system based on multi-task and self-attention described in the embodiments of the present application;

[0041] Figure 2 It is a schematic diagram of the framework of the identification and prediction model in the method for identifying and predicting the operating state of a power system based on multi-task and self-attention described in the embodiments of the present application;

[0042] Figure 3 Schematic diagram of the framework of the power system operation state identification and prediction device based on multi-task and self-attention according to the embodiments of the present application;

[0043] Figure 4 Schematic diagram of the terminal device according to the embodiments of the present application. Detailed implementation manners

[0044] To make the objectives, features, and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the embodiments described below are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0045] In the description of the embodiments of the present application, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, "a plurality" means two or more, unless otherwise specifically defined.

[0046] In the embodiments of the present application, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed", etc. shall be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or integrated; it may be a mechanical connection or an electrical connection; it may be directly connected, or indirectly connected through an intermediate medium, and it may be the internal connection of two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific situations.

[0047] Explanation of the patent terms of the present application:

[0048] A graph neural network is a connection relationship between nodes. Through the information transmission and aggregation mechanism, the feature representation of the nodes is continuously updated, so as to learn and understand the complex relationships, patterns, and rules in the graph structure data.

[0049] A multi-task network can simultaneously identify the power system state and predict its state in the next time period, and complete multiple tasks through one network, improving efficiency and prediction accuracy.

[0050] Self-attention mechanism: It calculates the relationships between various features in the graph sequence data to dynamically adjust its representation, enabling the model to focus on the most relevant information in the input, thereby improving the learning efficiency and representation ability.

[0051] U-shaped network architecture: A deep learning model commonly used in image segmentation tasks, with a symmetric encoder-decoder structure. Its characteristic is that after gradually extracting data features through downsampling, it restores the spatial resolution of the image through upsampling. At the same time, low-level feature information is transmitted to high-level through skip connections between the encoder and the decoder to assist in the extraction of detailed features to improve the model performance.

[0052] Long Short-Term Memory (LSTM) is a type of recurrent neural network, which is specifically designed to solve the long-term dependence problem existing in general Recurrent Neural Networks (RNNs). All RNNs have a chain-like form of repeating neural network modules.

[0053] ‌MLP (Multilayer Perceptron)‌ is a feedforward artificial neural network model that maps multiple input data sets to a single output data set. The basic structure of MLP includes an input layer, a hidden layer, and an output layer. The different layers are fully connected, that is, any neuron in the upper layer is connected to all neurons in the lower layer.

[0054] The embodiments of this application provide a method, device, and equipment for identifying and predicting the operating state of a power system based on multi-task and self-attention, which solve the technical problems that the existing methods for transient stability assessment and state prediction of power systems have single-task limitations, cannot perform stability assessment and state prediction simultaneously, have low computational efficiency, are difficult to meet real-time requirements, and have low prediction accuracy. The method, device, and equipment for identifying and predicting the operating state of a power system based on multi-task and self-attention introduce a multi-task mechanism and adopt a U-shaped self-attention mechanism network structure. The multi-task mechanism plays a crucial role in the method, device, and equipment for identifying and predicting the operating state of a power system based on multi-task and self-attention. Multiple tasks do not exist in isolation, but are interrelated and mutually promoting. In this embodiment, taking the two main tasks of power system state identification and future parameter prediction as examples, the real-time state information of the power system obtained during the state identification process provides accurate current basic data for future parameter prediction. By accurately grasping the real-time state, the prediction task can more reasonably infer the change trend of future parameters and improve the prediction accuracy.

[0055] Embodiment 1:

[0056] Figure 1This is the flowchart of the steps of the power system operation state identification and prediction method based on multi-task and self-attention according to the embodiments of the present application.

[0057] As Figure 1 shown, the embodiments of the present application provide a power system operation state identification and prediction method based on multi-task and self-attention, including the following steps:

[0058] S1. Obtain the power data for power system operation state identification and prediction, and construct a feature matrix and an adjacency matrix according to the power data. The power data includes grid nodes, node connection relationships, operation duration, and the voltage amplitude, phase angle, active power, and reactive power of each node.

[0059] It should be noted that the power system operation state identification and prediction method based on multi-task and self-attention represents the state of the power system in the form of a feature matrix and an adjacency matrix. Let the node set in the nodes be , and the edge set be . The entire power system can be modeled as graph data, that is, . For transient analysis, it is necessary to determine several electrical elements, such as the power data obtained in step S1, to provide data for subsequent steps. In this embodiment, the adjacency matrix adopts the line connection relationship of the power grid, that is, the direct connection situation between substations or generators. If the nodes are connected, it is 1, otherwise it is 0; the feature matrix is constructed using the operation states of each node in the power grid.

[0060] In the embodiments of the present application, the operation duration of the power system is set to T, and the sampling period is . It can be divided into several time slots T = { 2 ,..., |T|}. Therefore, the electrical elements of the power system are represented in the form of a state matrix as , and can also be expressed as: , where , (·) T is the transpose of the matrix, is the number of nodes in the power system, T is the total operation duration of the power system, |V i,t | is the voltage amplitude collected at the i-th node at time t, is the voltage phase angle collected at the i-th node at time t, P i,t is the active power collected at the i-th node at time t, and Q i,t is the reactive power collected at the i-th node at time t. In particular, the local power inflow is closely related to the power generation scheduling. The feature matrix G of the power system can be expressed as:

[0061]

[0062] The adjacency matrix A can be expressed as , where is the number of nodes. The elements of the adjacency matrix A are defined as:

[0063]

[0064] Self-loops are usually added to the adjacency matrix, that is, an edge connecting a node to itself is added to each node to obtain a new adjacency matrix , where I is the identity matrix. In order to balance the contribution of each node to aggregating neighbor information and prevent nodes with large degrees from having too much influence, it is necessary to normalize the adjacency matrix. The definition of the degree-normalized adjacency matrix is , and the degree matrix is used to represent the total number of connections of each node, including the degree value after adding self-loops.

[0065] In the embodiments of the present application, considering the spatial structure and time dependence of the power system, the state prediction task is defined as a spatio-temporal prediction task. Given the feature matrix and adjacency matrix obtained through step S1, the spatio-temporal prediction task can be expressed by related problem one, and the expression of related problem one is:

[0066]

[0067] In the formula, H is the length of the prediction time step, and f(·) is the prediction function.

[0068] In the embodiments of the present application, considering the spatial structure and time dependence of the power system, the state identification task of the power system is defined as a multi-exit spatio-temporal binary classification task, and the output is the classification results of multiple exits (output channels), and each exit is for a classification task with different complex features. Suppose there are a total of K exits, then the spatio-temporal binary classification task can be expressed by related problem two, and the expression of related problem two is:

[0069]

[0070] In the formula, f i (·) is the classification function of the i-th output channel.

[0071] S2. Use a multi-task combined with self-attention mechanism network to construct an identification and prediction model, input the feature matrix and adjacency matrix into the identification and prediction model for processing, and obtain prediction and evaluation data.

[0072] It should be noted that in step S2, first, a recognition and prediction model is constructed by using a multi-task combined with a self-attention mechanism network. Second, the feature matrix and adjacency matrix obtained in step S1 are input into the recognition and prediction model for processing, and prediction and evaluation data including state prediction data and classification evaluation data are output. In this embodiment, the method for identifying and predicting the operating state of a power system based on multi-task and self-attention closely cooperates with a U-shaped self-attention mechanism network structure to construct a recognition and prediction model. While identifying the state of the power system, by sharing the backbone network parameters, the future parameters of the power system are accurately predicted using the self-attention mechanism network structure. The self-attention mechanism network structure uses a self-attention U-shaped residual decoder to fully utilize global and local information in the decoding stage, improving the prediction accuracy of key variables such as voltage, phase angle, active power, and reactive power. The self-attention mechanism network structure can focus on key features at different network levels, enhance the ability to capture complex spatio-temporal features, and improve the interpretability and accuracy of predictions.

[0073] S3. Determine the state prediction result and transient stability evaluation result of the power system according to the prediction and evaluation data.

[0074] It should be noted that in step S3, the state prediction result and transient stability evaluation result of the power system are determined according to the prediction and evaluation data obtained in step S2. In this embodiment, the prediction and evaluation data include state prediction data and classification evaluation data. The state prediction data contains the state prediction value of the power system. The classification evaluation data contains the classification confidence of the operating state of the power system. According to whether the classification confidence meets a pre-set confidence threshold, the current operating state is judged. If the set confidence threshold is met, the result of the transient stability evaluation can be determined to be stable or unstable. The classification evaluation data also contains classification loss.

[0075] In the embodiment of the present application, the method for identifying and predicting the operating state of a power system based on multi-task and self-attention overcomes the limitations of existing methods through designs such as multi-task learning and advanced decoding structures, significantly improving the accuracy and computational efficiency of transient stability evaluation and state prediction, and providing an efficient and reliable state analysis solution for modern smart grids.

[0076] A method for identifying and predicting the operating state of a power system based on multi-task and self-attention includes obtaining power data for identifying and predicting the operating state of the power system, constructing a feature matrix and an adjacency matrix based on the power data, where the power data includes power grid nodes, node connection relationships, operating duration, and the voltage amplitude, phase angle, active power, and reactive power of each node; constructing an identification and prediction model using a multi-task combined with a self-attention mechanism network, inputting the feature matrix and the adjacency matrix into the identification and prediction model for processing to obtain prediction and evaluation data; and determining the state prediction result and transient stability evaluation result of the power system according to the prediction and evaluation data. The method for identifying and predicting the operating state of a power system based on multi-task and self-attention constructs an identification and prediction model using a multi-task combined with a self-attention mechanism network, which can simultaneously process two key and important tasks of state identification and state prediction of the power system, realize simultaneous state prediction and transient stability evaluation of the power system, improve efficiency and prediction accuracy, and meet the real-time requirements of the power system; it solves the technical problems that the existing methods for transient stability evaluation and state prediction of power systems have single-task limitations, cannot perform stability evaluation and state prediction simultaneously, have low computational efficiency, are difficult to meet the real-time requirements, and have low prediction accuracy.

[0077] It should be noted that the method for identifying and predicting the operating state of a power system based on multi-task and self-attention can be applied to the analysis of multiple tasks. The multiple tasks promote and enhance each other, increasing the feature extraction ability of the multi-task network. By deeply mining and fully utilizing the topological structure information of the power grid through the multi-task network, a more comprehensive and meticulous analysis of the power system state is achieved. The method for identifying and predicting the operating state of a power system based on multi-task and self-attention greatly improves the computational efficiency by optimizing the inference process while ensuring the identification accuracy. This dual guarantee of high efficiency and accuracy gives the method for identifying and predicting the operating state of a power system based on multi-task and self-attention stronger competitiveness and practical value in the field of power system state identification. Since the method for identifying and predicting the operating state of a power system based on multi-task and self-attention can handle various state identification tasks in complex power systems and has high flexibility and scalability, it has a wide range of application prospects. The method for identifying and predicting the operating state of a power system based on multi-task and self-attention can also be applied to the analysis of aspects such as real-time monitoring, fault warning, and efficient operation and maintenance of power systems.

[0078] Figure 2 It is a schematic diagram of the framework of the identification and prediction model in the method for identifying and predicting the operating state of a power system based on multi-task and self-attention described in the embodiments of the present application.

[0079] As Figure 2As shown, in one embodiment of the present application, the identification and prediction model includes a backbone network module 100, a decoder module 200 connected to the backbone network module 100, and a multi-exit module 300;

[0080] The backbone network module 100 is used to extract features from the feature matrix and the adjacency matrix to obtain feature data, where the feature data includes temporal features and spatial features at each level;

[0081] The decoder module 200 is used to process the feature data using a U-shaped residual decoder and output state prediction data;

[0082] The multi-exit module 300 is used to process the feature data using a multi-exit mechanism and output classification evaluation data;

[0083] Among them, the prediction and evaluation data includes state prediction data and classification evaluation data.

[0084] It should be noted that in the shared backbone network module 100, first, spatio-temporal graph convolution operations are used to extract temporal and spatial features from the temporal graph data composed of the feature matrix and the adjacency matrix. To better capture feature changes, a learnable feature matrix is constructed to learn the adaptive weights of different features. In addition, the multi-exit module 300 also uses spatio-temporal graph convolution for spatio-temporal feature extraction, but introduces a multi-exit mechanism, allowing the identification and prediction model to output classification results at multiple intermediate layers. When the classification confidence reaches the confidence threshold, the calculation can be terminated early, thereby improving the inference efficiency. The decoder module 200 adopts a Unet architecture and uses the hierarchical features extracted from the shared backbone network to reconstruct the future graph state. Through the design of the backbone network module, the decoder module, and the multi-exit module, the identification and prediction model realizes the efficient fusion of multiple tasks. The state prediction task and the graph data classification task of the identification and prediction model share the underlying spatio-temporal feature representation, which not only ensures the prediction accuracy but also improves the classification efficiency. The method for identifying and predicting the operating state of a power system based on multi-task and self-attention is a multi-task learning method, enabling the identification and prediction model to complete complex power grid data analysis without increasing additional computational costs. In this embodiment, in the embodiment of the present application, the identification and prediction model is used to perform state prediction and transient stability assessment in the power system on the temporal graph data composed of the feature matrix and the adjacency matrix. The identification and prediction model effectively captures the inherent spatio-temporal dynamic characteristics in the temporal graph and simultaneously solves the temporal graph data prediction and classification tasks through the shared backbone network module 100. In the prediction task, the identification and prediction model adopts a U-shaped network architecture of a U-shaped residual decoder to predict the future state of the power system; in the classification task, the multi-exit module 300 using the multi-exit mechanism realizes efficient and reliable graph data classification.

[0085] In the embodiments of the present application, after passing through multiple levels of second spatio-temporal graph convolutional units, the decoder module 200 outputs a prediction result. In the multi-exit module 300, as the number of third spatio-temporal graph convolutional units passed through increases, the depth of the network and the computing power consumed also increase. A deeper network layer can learn more complex power grid conditions, while for easily distinguishable power grid conditions, a shallow network can achieve state identification. Different output channels can set confidence thresholds from small to large to adapt to different power grid conditions and reasonably allocate resources. The classification result is stable / unstable, and the deeper the exit, the higher the accuracy rate.

[0086] As Figure 2 shown, in an embodiment of the present application, the backbone network module 100 includes at least N first spatio-temporal graph convolutional units and (N - 2) self-attention mechanisms, and the corresponding U-shaped residual decoder includes (N - 1) second spatio-temporal graph convolutional units connected in sequence; the N first spatio-temporal graph convolutional units are connected in series in sequence and then respectively connected to the input ends of the decoder module and the multi-exit module, and the output ends of the first (N - 2) first spatio-temporal graph convolutional units are all connected to the output ends of the corresponding first (N - 2) second spatio-temporal graph convolutional units through a self-attention mechanism; wherein, N is a natural number not less than 3; the multi-exit mechanism includes several evaluation sub-modules connected in sequence to form multiple levels, each evaluation sub-module includes a third spatio-temporal graph convolutional unit and an output channel connected to the third spatio-temporal graph convolutional unit, and the output channel is used to output classification evaluation data, and a confidence threshold is set on the output channel; wherein, the numerical values of the confidence thresholds in the first evaluation sub-module to the last evaluation sub-module are set from small to large; the multi-exit mechanism is used to classify and evaluate the input feature data through the evaluation sub-module until the output classification confidence reaches the confidence threshold, and then output the classification evaluation data;

[0087] The self-attention mechanism is used to calculate the correlation data between the positions of pairwise feature data output by the first spatio-temporal graph convolutional unit; the first (N - 2) second spatio-temporal graph convolutional units are used to automatically focus on and extract the time features crucial for state prediction from the input feature data according to the input correlation data; the last second spatio-temporal graph convolutional unit is used to predict the operating state of the power system according to the extracted crucial time features to obtain state prediction data.

[0088] It should be noted that in order to achieve accurate state prediction, a decoder module 200, which is also composed of second spatio-temporal graph convolutional units, is constructed on top of the backbone network module 100. This decoder module 200 is combined with the backbone network module 100 to form a classic U-shaped architecture (Unet). In the U-shaped architecture, the encoder part (such as the backbone network module 100) extracts the complex spatio-temporal features of power grid data layer by layer through a series of first spatio-temporal graph convolutional units; it can capture the spatial correlation between nodes in the power grid and the dynamic patterns that change over time. The decoder part (such as the decoder module 200) then uses the features at each level extracted by the encoder to generate through second spatio-temporal graph convolutional units and adaptive pooling, and finally is used for accurate state prediction. Between the encoder and the decoder, a self-attention mechanism is introduced as a skip connection. The self-attention mechanism skip connection establishes a direct connection between the corresponding encoder and decoder layers, and can efficiently transmit multi-scale information between features at different levels. Specifically, the self-attention mechanism enables the model to automatically focus on the nodes and time segments that are most critical for state prediction by calculating the correlation between positions in the feature map. This means that the identification and prediction model can dynamically adjust the attention to different regions and moments, so as to more accurately capture the key spatio-temporal features; this self-attention mechanism skip connection not only improves the effectiveness of feature transmission, but also enhances the robustness and generalization ability of the identification and prediction model. By establishing associations between features at different scales, the identification and prediction model can better understand the multi-level structure of power grid data and avoid information loss during transmission. Based on the backbone network module 100, a multi-exit module 300 with a multi-exit mechanism is designed, which is specifically used for the transient stability assessment of power systems. The multi-exit module 300 sets multiple output channels at different depths of the network, enabling the identification and prediction model to dynamically decide when to output the results during the inference process. Specifically, when the classification confidence of a certain layer reaches a preset confidence threshold, the identification and prediction model can exit the subsequent calculation process in advance and directly output the current prediction result. This design strategy effectively balances the inference speed and accuracy. On the one hand, for simple or feature-obvious samples, the identification and prediction model can obtain high-confidence predictions at a shallow layer without going through complex calculations at a deep layer, thus greatly reducing the computational overhead. This not only improves the inference efficiency of the identification and prediction model, but also meets the requirements of real-time monitoring of power systems. On the other hand, for complex or uncertain samples, the identification and prediction model will automatically continue to perform in-depth calculations until a sufficient confidence threshold is reached, ensuring the accuracy of the evaluation results. The core of the multi-exit mechanism lies in setting appropriate confidence thresholds for each exit. These confidence thresholds can be adjusted from performance indicators according to requirements, aiming to optimize the overall performance of the identification and prediction model.Through this multi - exit mechanism, the identification and prediction model can adaptively adjust the calculation depth according to the difficulty of the input samples. For example, in transient stability assessment, some fault modes may have obvious characteristics, and the identification and prediction model can quickly identify them; while for complex fault situations, the identification and prediction model requires deeper feature extraction and analysis. In this embodiment, the identification and prediction model is based on multiple tasks sharing the same backbone network module 100. During the operation of the identification and prediction model, the adjacency matrix and the feature matrix are input into the backbone network module 100, thereby starting the joint training process of multiple tasks. Among them, the prediction task is based on the decoder module 20, and uses the U - shaped self - attention mechanism network structure to deeply mine and analyze the input data. On this basis, the prediction loss is calculated to measure the deviation between the state prediction data and the actual value. The classification task is based on the multi - exit module 300, and calculates the classification loss according to the output results of different output channels through the output channels of the multi - exit, so as to evaluate the accuracy of classification.

[0089] In the embodiment of the present application, the U - shaped architecture consists of an encoder (such as the backbone network module 100) and a decoder (such as the decoder module 200). The core idea is to extract features layer by layer and restore key information through the self - attention mechanism skip connection. The encoder consists of multiple first spatio - temporal graph convolutional units, which gradually extract the spatio - temporal features of the power grid data. The resolution is reduced through downsampling to extract high - level abstract features. The decoder gradually upsamples to restore the original resolution and performs feature fusion by combining the features of the encoder. The self - attention mechanism skip connection directly connects the symmetric layers of the encoder and the decoder, preventing information loss and accelerating the training convergence.

[0090] It should be noted that the skip connection part of the U - shaped architecture adopts the self - attention mechanism, which is used to dynamically allocate attention weights and improve the feature expression ability. The input feature map X undergoes three projections of Query, Key, and Value, and then calculates the attention weights and the feature representation after attention weighting; finally, it is fused with the original feature through a residual connection. The input data usually includes the time - series data of the operation state of the power system, which is mainly composed of topological information (used to construct the adjacency matrix) and physical measurement data (used to construct the feature matrix). In this embodiment, as Figure 2As shown, if N is 5 and the evaluation sub-module is set to 4, the output end of the 5th first spatio-temporal graph convolutional unit is connected to the input end of the third spatio-temporal graph convolutional unit of the first evaluation sub-module. The output end of the third first spatio-temporal graph convolutional unit is connected to the output end of the first second spatio-temporal graph convolutional unit through a self-attention mechanism. The output end of the second first spatio-temporal graph convolutional unit is connected to the output end of the second second spatio-temporal graph convolutional unit through a self-attention mechanism. The output end of the first first spatio-temporal graph convolutional unit is connected to the output end of the third second spatio-temporal graph convolutional unit through a self-attention mechanism. The output end of the fourth second spatio-temporal graph convolutional unit outputs state prediction data. Among them, the adjacency matrix is used to describe the connection relationship between generators, substations, and transmission lines in the power system, and can usually be constructed based on power system topology data. The feature matrix is used to describe the operating state of the power grid at different time steps, and usually includes the time-series physical measurement data of generators, buses, and transmission lines.

[0091] In the actual example of this application, the working principle of the U-shaped architecture is as follows: receive the input of the time-series features (such as the adjacency matrix and the feature matrix) of the power system, extract key spatio-temporal features through the self-attention mechanism of the U-shaped architecture, and then combine with the decoder to output the predicted value of the power grid state at future moments.

[0092] In the example of this application, the multiple classification losses output by the identification and prediction model do not exist in isolation, but cooperate and influence each other during the joint training process. The state prediction data and the classification losses act together. During the process of optimizing the model parameters, they continuously improve the execution capabilities of their respective tasks, achieve the coordinated progress between multiple tasks, and enable the power system operating state identification and prediction method based on multi-task and self-attention to exhibit more powerful performance in power system state identification and future parameter prediction.

[0093] It should be noted that the multi-task mechanism of the power system operating state identification and prediction method based on multi-task and self-attention is not a simple task stacking, but realizes deep integration. The power system state identification task and the future parameter prediction task are closely linked and complement each other. State identification can provide real-time and accurate basic data of the current power system state for the prediction task. These data are like the cornerstone of the prediction model, ensuring the accuracy and reliability of the prediction direction.

[0094] In the embodiment of this application, in the encoder stage (such as the backbone network module 100), through a series of first spatio-temporal graph convolutional units, the complex spatio-temporal features of the power grid data are gradually explored in depth. The decoder part (such as the decoder module 200) further optimizes the prediction of the future graph state. Combining the feature information captured at different levels of the encoder, the decoder can consider the historical state and current changes of the power system more comprehensively, achieve more accurate prediction of future parameters, and enhance the reliability and interpretability of the prediction results.

[0095] In one embodiment of the present application, the first spatio-temporal graph convolutional unit includes a first time-domain convolutional layer, a graph convolutional layer, and a second time-domain convolutional layer connected in sequence. The first time-domain convolutional layer is used to compress and refine the input feature matrix in the time dimension to obtain a first matrix of key information. The graph convolutional layer is used to perform feature extraction and information propagation according to the first matrix and the input adjacency matrix to obtain a second matrix that has learned neighbor information. The second time-domain convolutional layer compresses and refines the second matrix in the time dimension to obtain feature data.

[0096] It should be noted that, as Figure 2 shown, the working principle of the first spatio-temporal graph convolutional unit is as follows: the input feature matrix will first pass through the first time-domain convolutional layer, which mainly extracts features from the time dimension of the feature matrix. After extraction, the feature matrix will be compressed in the time dimension to obtain the first matrix of key information. The first matrix and the adjacency matrix are sent into the graph convolutional layer together. The graph convolutional layer (Graph Convolutional Layer, GCN) is a neural network layer for feature extraction and information propagation on graph data. Its core idea is to let each node aggregate information from its neighbor nodes, so as to learn a richer representation. The information propagation of GCN can be understood as each node collecting information from itself and its neighbors. After passing through multiple layers of GCN, the node can obtain the influence of farther neighbors, so as to learn global information. What is obtained after passing through the graph convolutional layer is the second matrix that has learned neighbor information. The second time-domain convolutional layer performs another time-domain convolution operation on the second matrix to deepen the feature extraction in the time dimension. Multiple first spatio-temporal graph convolutional units in the backbone network module perform multiple repeated operations on the input feature matrix and adjacency matrix, which is the main content of the backbone network / encoder. The encoder and the decoder are connected by a self-attention mechanism using skip connections to improve the expression ability of key features.

[0097] In one embodiment of the present application, in the process of constructing an identification and prediction model using a multi-task combined with a self-attention mechanism network, the method includes: optimizing the output state prediction data of the identification and prediction model using mean squared error; and / or optimizing the output classification evaluation data of the identification and prediction model using a weighted combination method of cross-entropy loss and focal loss.

[0098] It should be noted that after constructing the identification and prediction model, it is necessary to optimize the identification and prediction model to improve the accuracy of the identification and prediction model. In this embodiment, during the process of optimizing the identification and prediction model, first, calculate the error between the predicted state data and the actual value, and use the mean squared error (MSE) as the loss function to measure the prediction accuracy; use gradient descent to optimize the parameters of the identification and prediction model to continuously reduce the loss of the predicted state data and improve the prediction ability; after training and optimizing the identification and prediction model, it can predict new input data and output the future power grid state; second, it uses a weighted combination method based on cross-entropy loss and focal loss as the cross-entropy loss rule to determine the accuracy of classification. Cross-entropy loss measures the matching degree between the predicted class distribution and the true class. If the predicted probability is close to the true class, the loss is small, otherwise the loss is large. Among them, during the process of optimizing the identification and prediction model, the weights of the predicted state value and the classification loss are set to 1 and 1 respectively, and the weights of the four output channels with confidence thresholds from small to large are set to 0.1, 0.2, 0.3, and 0.4 in sequence. The network parameters are optimized by minimizing the composite loss function using the Adam optimizer, and the learning rate gradually decreases from 2×10 -4 to 1×10 -6 using the cosine annealing method.

[0099] In the embodiments of the present application, different loss functions are designed for different tasks to ensure that the identification and prediction model can effectively learn and optimize. For the state prediction task, the mean squared error (MSE) is used as the loss function. For the transient stability estimation task, the goal of this task is to determine whether the power system can return to a stable state after being disturbed, which belongs to a binary classification problem. Since there is a class imbalance in the dataset (the unstable state is the minority class), directly using the standard cross-entropy loss may cause the model to be biased towards the majority class; for this reason, a weighted combination method of cross-entropy loss and focal loss is used as the loss function. Among them, the expression of the mean squared error is: , where loss pred is the loss of the state prediction task, y i is the state prediction data, is the actual value. The expression of the weighted combination method of cross-entropy loss and focal loss is:

[0100]

[0101] where loss cls is the classification loss, is the hyperparameter for adjusting the attention of easy and hard samples, Y i is the classification confidence, is the confidence threshold, As a sample coefficient, by weighted-combining these two loss functions, our model can take into account both the overall classification accuracy and the recognition ability for minority-class samples. The cross-entropy loss ensures the correct classification of most samples by the model, while the focal loss makes the model pay more attention to those difficult-to-classify and imbalanced minority-class samples, improving the detection performance for unstable states of the power grid.

[0102] In the embodiment of the present application, the power system operation state identification and prediction method based on multi-task and self-attention inputs the adjacency matrix and feature matrix of the power system at a certain time point into the constructed identification and prediction model, extracts time-series dependent features through the spatio-temporal graph convolution of the backbone network module 100, and analyzes them in the identification and prediction model; finally, the classification result is output, returning stable or unstable. If the classification result is "unstable", emergency control measures can be taken for the power system to avoid large-scale failures.

[0103] It should be noted that since the multi-tasks of the constructed identification and prediction model are based on the same backbone network module 100, only one set of data (such as the adjacency matrix and feature matrix) needs to be input to complete state identification and state prediction, and they share the underlying data (such as the feature data output by the backbone network module 100). After inputting the power grid state data in the past period of time, the identification and prediction model outputs the predicted values of key variables such as voltage and power in a certain future period through its U-shaped self-attention mechanism. If an abnormal future state (such as voltage and frequency fluctuations) is predicted, the load distribution can be adjusted in advance or reactive power compensation can be increased to improve the stability of the power system, realizing a more comprehensive analysis of the power system state.

[0104] In an embodiment of the present application, the method for identifying and predicting the operating status of a power system based on multi-task and self-attention realizes the parallel execution of two tasks through the multi-task GCN framework of the constructed identification and prediction model, and simultaneously performs transient stability assessment TSA and state prediction SP, thereby avoiding the problem that traditional methods need to construct separate models for different tasks and improving computational efficiency. The multi-task and self-attention based power system operation state identification and prediction method uses a shared encoder (such as the backbone network module 100) of the constructed identification and prediction model, uses GCN as a unified encoder to extract the grid topology information and timing characteristics of the power system, and performs stability assessment and state prediction respectively through different decoders; the identification and prediction model also uses a U-shaped residual decoder combined with a jump connection self-attention mechanism to enhance the fusion of features of different scales, retain key details of state variables (such as bus voltage, phase angle, etc.), and improve prediction accuracy; it can also accurately predict data, including the voltage amplitude and phase angle of the bus node, which enables accurate transient stability assessment by capturing the complex dynamic behavior of the power system; at the same time, residual connections are added in the decoding process, which fuse jump connections and residual connections to enhance deep feature extraction, and also combine the self-attention mechanism (Self-Attention) to strengthen the key variable modeling capability, effectively avoiding gradient disappearance.

[0105] In an embodiment of the present application, the method for identifying and predicting the operating state of a power system based on multi-task and self-attention further enhances the advantages of the identification and prediction model through the multi-task mechanism and U-shaped structure of the identification and prediction model. The parameters of the backbone network module 100 shared by multiple tasks effectively reduce parameter redundancy and improve the learning efficiency of the identification and prediction model. The encoder part of the U-shaped structure can deeply explore the complex spatiotemporal characteristics of the power system with the help of the spatiotemporal graph convolution layer; the self-attention mechanism can focus on key features, so that the identification and prediction model can accurately perform state identification and future parameter prediction at the same time.

[0106] It should be noted that taking the analysis of power system faults as an example, the identification and prediction model can not only quickly and accurately identify the fault state, but also predict the development trend of the fault based on the rich features learned, which cannot be achieved by a single-task model, greatly improving the comprehensiveness and accuracy of the state analysis of complex power systems. In this embodiment, the identification and prediction model can also feedback the results of future parameter prediction to the state identification task. When it is predicted that some parameters will change abnormally, this will prompt the state identification module to pay more attention to the power system state features related to it, so as to be more sensitive to the judgment of the current state and further optimize the results of state identification. This mutual cooperation between multiple tasks forms a virtuous cycle, continuously improving the understanding and analysis ability of the operation status of the power system. The multi-task network effectively extracts the grid topology features by sharing the underlying graph neural network (GCN) encoder, and shares the representation information between multiple tasks, improving the calculation efficiency and prediction accuracy, not only reducing the consumption of computing resources, but also making full use of the grid information.

[0107] Embodiment 2:

[0108] Figure 3 It is a schematic framework diagram of the power system operation state identification and prediction device based on multi-task and self-attention according to the embodiment of the present application.

[0109] As Figure 3 shown, the embodiment of the present application provides a power system operation state identification and prediction device based on multi-task and self-attention, including a data acquisition module 10, a model construction and data processing module 20, and a result determination module 30;

[0110] The data acquisition module 10 is used to acquire the power data for power system operation state identification and prediction, construct a feature matrix and an adjacency matrix according to the power data, and the power data includes grid nodes, node connection relationships, operation duration, and the voltage amplitude, phase angle, active power, and reactive power of each node;

[0111] The model construction and data processing module 20 is used to construct an identification and prediction model by using a multi-task combined with a self-attention mechanism network, input the feature matrix and the adjacency matrix into the identification and prediction model for processing, and obtain prediction and evaluation data;

[0112] The result determination module 30 is used to determine the state prediction result and transient stability evaluation result of the power system according to the prediction and evaluation data.

[0113] It should be noted that the content of the modules in the device of the second embodiment has been described in the steps of the method of the first embodiment, and the content of the modules of the power system operation state identification and prediction device based on multi-task and self-attention will not be repeated in this embodiment. In this embodiment, the power system operation state identification and prediction device based on multi-task and self-attention can simultaneously perform transient stability assessment and state prediction of the power system through a data acquisition module, a model construction and data processing module, and a result determination module; through the identification and prediction model with a shared encoder, the grid topology and time series features are uniformly extracted, realizing a more comprehensive analysis of the power system state.

[0114] In the embodiment of the present application, the identification and prediction model includes a backbone network module, a decoder module connected to the backbone network module, and a multi-exit module;

[0115] The backbone network module is used to extract features from the feature matrix and the adjacency matrix to obtain feature data, and the feature data includes time features and spatial features at each level;

[0116] The decoder module is used to process the feature data by using a U-shaped residual decoder and output state prediction data; the prediction and evaluation data includes state prediction data and classification evaluation data;

[0117] The multi-exit module is used to process the feature data by using a multi-exit mechanism and output classification evaluation data;

[0118] The backbone network module includes at least N first spatio-temporal graph convolutional units and (N - 2) self-attention mechanisms. Correspondingly, the decoder module includes (N - 1) second spatio-temporal graph convolutional units connected in sequence; the N first spatio-temporal graph convolutional units are connected in series in sequence and then respectively connected to the input ends of the decoder module and the multi-exit module, and the output ends of the first (N - 2) first spatio-temporal graph convolutional units are all connected to the output ends of the corresponding first (N - 2) second spatio-temporal graph convolutional units through a self-attention mechanism; where N is a natural number not less than 3; the self-attention mechanism is used to calculate the correlation data between the positions of the pairwise feature data output by the first spatio-temporal graph convolutional unit; the first (N - 2) second spatio-temporal graph convolutional units are used to automatically focus on and extract the time features crucial for state prediction from the input feature data; the last second spatio-temporal graph convolutional unit is used to predict the operation state of the power system based on the extracted crucial time features to obtain state prediction data;

[0119] The multi - exit mechanism includes several evaluation sub - modules connected in sequence to form multiple levels. Each evaluation sub - module includes a third spatio - temporal graph convolution unit and an output channel connected to the third spatio - temporal graph convolution unit. The output channel is used to output classification evaluation data, and a confidence threshold is set on the output channel. Among them, the numerical values of the confidence thresholds in the first evaluation sub - module to the last evaluation sub - module are set from small to large. The multi - exit mechanism is used to classify and evaluate the input feature data through the evaluation sub - modules until the output classification confidence reaches the confidence threshold, and then output the classification evaluation data.

[0120] Embodiment Three:

[0121] Figure 4 It is a schematic diagram of the terminal device described in the embodiments of the present application.

[0122] As Figure 4 shown, the embodiments of the present application provide a terminal device, including a processor and a memory;

[0123] The memory is used to store program codes and transmit the program codes to the processor;

[0124] The processor is used to execute the above - mentioned power system operating state identification and prediction method based on multi - task and self - attention according to the instructions in the program codes.

[0125] It should be noted that the processor is used to execute the steps in the above - mentioned embodiment of a power system operating state identification and prediction method based on multi - task and self - attention according to the instructions in the program codes. Or, when the processor executes the computer program, it realizes the functions of each module / unit in the above - mentioned system / device embodiments.

[0126] Exemplarily, the computer program can be divided into one or more modules / units. One or more modules / units are stored in the memory and executed by the processor to complete the present application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the terminal device.

[0127] The terminal device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that it does not constitute a limitation to the terminal device, and it may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, a bus, etc.

[0128] The so-called processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0129] The memory may be an internal storage unit of the terminal device, such as the hard disk or memory of the terminal device. The memory may also be an external storage device of the terminal device, such as a plug-in hard disk equipped on the terminal device, a SmartMedia Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory may also include both the internal storage unit of the terminal device and the external storage device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory may also be used to temporarily store data that has been output or is to be output.

[0130] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0131] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other may be through some interfaces, and the indirect couplings or communication connections of the devices or units may be in electrical, mechanical, or other forms.

[0132] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0133] In addition, each functional unit in various embodiments of the present invention may be integrated into a processing unit, may exist physically separately for each unit, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0134] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs, and other various media that can store program codes.

[0135] As described above, the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims

1. A method for identifying and predicting the operation status of a power system based on multi-task and self-attention, characterized in that: The following steps are involved: Acquire power data for identifying and predicting the operation status of the power system, and construct a feature matrix and an adjacency matrix based on the power data, wherein the power data includes power grid nodes, node connection relationships, operation time, and voltage amplitude, phase angle, active power, and reactive power of each node; A multi-task combined with a self-attention mechanism network is used to construct an identification and prediction model, and the feature matrix and the adjacency matrix are input into the identification and prediction model for processing to obtain prediction and evaluation data; The state prediction result and transient stability evaluation result of the power system are determined according to the prediction and evaluation data.

2. The method for identifying and predicting the operation status of a power system based on multi-task and self-attention according to claim 1 is characterized in that: The identification and prediction model includes a backbone network module and a decoder module and a multi-export module connected to the backbone network module; The backbone network module is used to extract features from the feature matrix and the adjacency matrix to obtain feature data, wherein the feature data includes time features and spatial features at each level; The decoder module is used to process the feature data using a U-shaped residual decoder and output state prediction data; The multi-export module is used to process the feature data using a multi-export mechanism and output classification evaluation data; The prediction and evaluation data include state prediction data and classification evaluation data.

3. The method for identifying and predicting the operation status of a power system based on multi-task and self-attention according to claim 2 is characterized in that: The backbone network module includes at least N first spatiotemporal graph convolution units and (N-2) self-attention mechanisms, and the corresponding U-shaped residual decoder includes (N-1) second spatiotemporal graph convolution units connected in sequence; the N first spatiotemporal graph convolution units are connected in series in sequence and are respectively connected to the input ends of the decoder module and the multi-export module, and the output ends of the first (N-2) first spatiotemporal graph convolution units are all connected to the output ends of the corresponding first (N-2) second spatiotemporal graph convolution units through one of the self-attention mechanisms; wherein N is a natural number not less than 3.

4. The method for identifying and predicting the operation status of a power system based on multi-task and self-attention according to claim 3 is characterized in that: The self-attention mechanism is used to calculate the correlation data between the positions of the feature data output by the first spatiotemporal graph convolution unit; the first (N-2) second spatiotemporal graph convolution units are used to automatically focus on extracting time features that are key to state prediction from the input feature data based on the input correlation data; and the last second spatiotemporal graph convolution unit is used to predict the operating state of the power system based on the extracted key time features to obtain state prediction data.

5. The method for identifying and predicting the operation status of a power system based on multi-task and self-attention according to claim 3 is characterized in that: The first spatiotemporal graph convolution unit includes a first time domain convolution layer, a graph convolution layer, and a second time domain convolution layer connected in sequence. The first time domain convolution layer is used to compress and refine the input feature matrix in the time dimension to obtain a first matrix of key information; the graph convolution layer is used to perform feature extraction and information propagation based on the first matrix and the input adjacency matrix to obtain a second matrix that has learned neighbor information; the second time domain convolution layer compresses and refines the second matrix in the time dimension to obtain feature data.

6. The method for identifying and predicting the operation status of a power system based on multi-task and self-attention according to claim 2 is characterized in that: The multi-export mechanism includes several evaluation sub-modules connected in sequence to form multiple levels, each of the evaluation sub-modules includes a third spatiotemporal graph convolution unit and an output channel connected to the third spatiotemporal graph convolution unit, the output channel is used to output classification evaluation data, and a confidence threshold is set on the output channel; wherein, the numerical values ​​of the confidence thresholds in the first to the last evaluation sub-modules are set from small to large; the multi-export mechanism is used to perform classification evaluation on the input feature data through the evaluation sub-modules, and output the classification evaluation data until the output classification confidence reaches the confidence threshold.

7. The method for identifying and predicting the operation status of a power system based on multi-task and self-attention according to claim 1 is characterized in that: In the process of constructing an identification and prediction model using a multi-task combined with a self-attention mechanism network, the method includes: using mean square error to optimize the output state prediction data of the identification and prediction model; and / or, using a weighted combination of cross entropy loss and focal loss to optimize the classification evaluation data output by the identification and prediction model.

8. A device for identifying and predicting the operation status of a power system based on multi-task and self-attention, characterized in that: include: Data acquisition module, model building and data processing module and result determination module; The data acquisition module is used to acquire power data for identifying and predicting the operation status of the power system, and to construct a feature matrix and an adjacency matrix based on the power data, wherein the power data includes power grid nodes, node connection relationships, operation time, and voltage amplitude, phase angle, active power, and reactive power of each node; The model building and data processing module is used to use a multi-task combined with a self-attention mechanism network to build an identification and prediction model, input the feature matrix and the adjacency matrix into the identification and prediction model for processing, and obtain prediction and evaluation data; The result determination module is used to determine the state prediction result and transient stability assessment result of the power system according to the prediction and assessment data.

9. The power system operation state identification and prediction device based on multi-task and self-attention according to claim 8 is characterized in that: The identification and prediction model includes a backbone network module and a decoder module and a multi-export module connected to the backbone network module; The backbone network module is used to extract features from the feature matrix and the adjacency matrix to obtain feature data, wherein the feature data includes time features and spatial features at each level; The decoder module is used to process the feature data using a U-shaped residual decoder and output state prediction data; the prediction and evaluation data include state prediction data and classification evaluation data; The multi-export module is used to process the feature data using a multi-export mechanism and output classification evaluation data; The backbone network module includes at least N first spatiotemporal graph convolution units and (N-2) self-attention mechanisms, and the corresponding decoder module includes (N-1) second spatiotemporal graph convolution units connected in sequence; the N first spatiotemporal graph convolution units are connected in series in sequence and are respectively connected to the input ends of the decoder module and the multi-export module, and the output ends of the first (N-2) first spatiotemporal graph convolution units are connected to the output ends of the corresponding first (N-2) second spatiotemporal graph convolution units through a self-attention mechanism; N is a natural number not less than 3; the self-attention mechanism is used to calculate the correlation data between the positions of the feature data output by the first spatiotemporal graph convolution unit; the first (N-2) second spatiotemporal graph convolution units are used to automatically focus on extracting the time features that are key to state prediction from the input feature data according to the input correlation data; the last second spatiotemporal graph convolution unit is used to predict the operating state of the power system according to the extracted key time features to obtain state prediction data; The multi-export mechanism includes several evaluation sub-modules connected in sequence to form multiple levels, each of the evaluation sub-modules includes a third spatiotemporal graph convolution unit and an output channel connected to the third spatiotemporal graph convolution unit, the output channel is used to output classification evaluation data, and a confidence threshold is set on the output channel; wherein, the numerical values ​​of the confidence thresholds in the first to the last evaluation sub-modules are set from small to large; the multi-export mechanism is used to perform classification evaluation on the input feature data through the evaluation sub-modules, and output the classification evaluation data until the output classification confidence reaches the confidence threshold.

10. A terminal device, characterized in that: including a processor and a memory; The memory is used to store program codes and transmit the program codes to the processor; The processor is used to execute the power system operation status identification and prediction method based on multi-tasking and self-attention as described in any one of claims 1-7 according to the instructions in the program code.

Citation Information

Cited By

  • Heat supply pipe network operation efficiency evaluation method based on data prediction

    CN120524305A

  • A method for evaluating the operation efficiency of heating pipe networks based on data prediction

    CN120524305B

  • Grid voltage stability margin online prediction method based on graph structure

    CN121980970A

  • Power grid voltage stability margin online prediction method based on graph structure

    CN121980970B