A power grid operation risk detection method and device based on a graph neural network, a terminal device, and a storage medium

By generating power grid scenario data and constructing feature vectors based on graph neural networks, the problem of the huge computation time required for power grid risk assessment in existing technologies is solved, enabling fast and reliable risk detection and improving the efficiency of power grid operation risk detection.

CN123183976APending Publication Date: 2026-11-27POWER DISPATCHING CONTROL CENT OF GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611388619.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-27

Smart Images

  • Figure CN123183976A_ABST
    Figure CN123183976A_ABST
Patent Text Reader

Abstract

The application discloses a power grid operation risk detection method and device based on a graph neural network, terminal equipment and a storage medium, and belongs to the technical field of power grid operation risk detection. The method is as follows: current actual load data, actual output data and static physical property data of each node of a power grid are acquired; then, predicted load data and predicted output data under a plurality of future scenarios are generated based on a Markov chain; a node feature vector and a heterogeneous adjacency matrix are constructed for each to-be-evaluated scenario; the node feature vector and the heterogeneous adjacency matrix are input into a preset thermal power generation prediction model, a preset load reduction prediction model and a preset branch power flow prediction model constructed based on a graph neural network, so that predicted thermal power generation, predicted load reduction and predicted branch active power flow are obtained; and finally, a risk detection result of the power grid is calculated and determined according to the prediction result. Through implementation of the application, the problem of long time consumption of risk detection calculation in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power grid operation risk detection technology, and in particular to a power grid operation risk detection method, device, terminal equipment and storage medium based on graph neural network. Background Technology

[0002] With the increasing prevalence of renewable energy sources (RES), plug-in devices, and flexible loads, the power grid is undergoing a significant transformation. While this shift is driving the future of energy towards sustainability and diversification, it also introduces substantial uncertainty in electricity supply and demand due to the volatility of renewable energy. To effectively address this challenge and quantify the associated operational risks (such as insufficient reserves and load shedding), grid operators urgently need advanced optimization technologies and rigorous risk quantification methods.

[0003] Existing technologies typically assess risk by directly solving complex decision problems such as security-constrained unit commitment (SCUC). However, these traditional algorithms, such as stochastic programming and chance-constrained optimization, have limited coverage when facing high uncertainties in power supply and demand. Furthermore, due to the numerous uncertain scenarios, it is necessary to repeatedly solve deterministic security-constrained unit commitment (SCUC), resulting in extremely high computational time and thus low efficiency in detecting grid operation risks. Summary of the Invention

[0004] This invention provides a method, device, terminal equipment, and storage medium for power grid operation risk detection based on graph neural networks. It can solve the problem of huge computation time in the existing technology of risk assessment by directly solving complex decision-making problems such as safety constraint unit combination.

[0005] An embodiment of the present invention provides a power grid operation risk detection method based on graph neural networks, comprising: Obtain the current actual load data, actual output data, and static physical attribute data of each node in the power grid; Based on Markov chains, actual load data, and actual output data, predictive load data and predictive output data are generated for several future scenarios to be evaluated. For each scenario to be evaluated, based on the static physical attribute data, as well as the predicted load data and predicted output data corresponding to the current scenario to be evaluated, a node feature vector and a heterogeneous adjacency matrix are constructed. The node feature vector and heterogeneous adjacency matrix are input to the preset thermal power generation prediction model, preset load reduction prediction model and preset branch power flow prediction model constructed based on graph neural network, respectively, to obtain the predicted thermal power generation, predicted load reduction and predicted branch active power flow. The risk detection results of the power grid are determined based on the predicted thermal power generation, predicted load reduction, and predicted active power flow of all scenarios to be evaluated.

[0006] Furthermore, based on Markov chains, actual load data, and actual output data, predicted load data and predicted output data for several future scenarios to be evaluated are generated, including: Based on a preset edge probability distribution function, the quantiles of the actual load data and the actual output data are calculated respectively; wherein, the preset edge probability distribution function is constructed based on the historical load data and historical output data of each node of the power grid; The quantiles are mapped using the inverse cumulative distribution function of the standard normal distribution to obtain the standard normal variables of each node; The initial state vector of the Markov chain is obtained by solving the standard normal variables of all nodes and the preset lower triangular matrix. Based on different random variable matrices that follow a standard Gaussian distribution, a Markov chain random walk is performed on the initial state vector to generate several standard normal variables corresponding to each scenario to be evaluated; wherein, each random variable matrix corresponds to a scenario to be evaluated. For each scenario to be evaluated, the standard normal variables corresponding to the current scenario to be evaluated are mapped based on the preset lower triangular matrix to obtain normal variables with spatiotemporal correlation. Based on the inverse cumulative distribution function, physical quantity mapping is performed on the normal variables with spatiotemporal correlation to obtain a random variable matrix; Based on a preset static distribution factor, the random variable matrix is ​​distributed to each node to obtain the predicted load data and predicted output data for each node under each scenario to be evaluated.

[0007] Furthermore, the nodes include: generator bus nodes that contain only generator sets, power load bus nodes that contain only loads, and hybrid nodes that contain both generator sets and loads. Based on the static physical attribute data, and the predicted load data and predicted output data corresponding to the current scenario to be evaluated, a node feature vector and a heterogeneous adjacency matrix are constructed, including: Obtain the connection topology of the power grid; An adjacency matrix is ​​generated based on the connection topology, and the adjacency matrix is ​​used as the heterogeneous adjacency matrix; Based on the static physical attribute data, construct the node static feature vector for each node; Based on the predicted output data, the first node dynamic prediction sequence vector of the generator bus node is constructed. Based on the predicted load data, a second node dynamic prediction sequence vector for the power load bus node is constructed. Based on the predicted output data and predicted load data, a dynamic prediction sequence vector of the third node of the hybrid node is constructed. For any node, if the current node is a pure generator bus node, then the node static feature vector corresponding to the current node and the dynamic prediction sequence vector of the first node are concatenated to obtain the node feature vector of the current node. If the current node is a pure power load bus node, then the node static feature vector corresponding to the current node and the dynamic prediction sequence vector of the second node are concatenated to obtain the node feature vector of the current node. If the current node is a hybrid node, then the static feature vector of the current node and the dynamic prediction sequence vector of the third node are concatenated to obtain the node feature vector of the current node.

[0008] Furthermore, the training of the preset thermal power generation prediction model, the preset load reduction prediction model, and the preset branch power flow prediction model includes: The Markov chain state matrix is ​​initialized to 0, and random walks and node assignments are performed based on the initialized Markov chain state matrix to generate several training scenarios and load data samples and output data samples of each node corresponding to each training scenario. Based on the load data samples and output data samples, node feature vector samples and heterogeneous adjacency matrix samples for each training scenario are generated. For each training scenario, based on the load data samples and output data samples, a first operation optimization model and corresponding first constraints are constructed with the goal of minimizing the overall operating cost. Under the constraints, the operation optimization model is solved to obtain the optimal unit start-up and shutdown state, optimal total load reduction, optimal thermal power generation, and optimal branch power flow corresponding to the current training scenario. Using the optimal unit start-up and shutdown state as a quantitative measure, and based on the load data sample and output data sample, with the goal of minimizing the load reduction penalty cost and generator output adjustment cost, a second operation optimization model and corresponding second constraints are constructed. Solve the second operational optimization model under the second constraint to obtain the optimal non-congestion reduction amount; The difference between the optimal total load reduction and the optimal non-congestion reduction is used as the true label of the preset load reduction prediction model for the corresponding training scenario; the optimal thermal power generation is used as the true label of the preset thermal power generation prediction model for the corresponding training scenario; and the optimal branch power flow is used as the true label of the preset branch power flow prediction model for the corresponding training scenario. Based on each real label, the node feature vector samples of the corresponding training scenario, and the heterogeneous adjacency matrix samples, training samples for the preset thermal power generation prediction model, the preset load reduction prediction model, and the preset branch power flow prediction model are generated respectively. Based on the training samples, the thermal power generation prediction model, load reduction prediction model, and branch power flow prediction model to be trained are trained to obtain the preset thermal power generation prediction model, preset load reduction prediction model, and preset branch power flow prediction model.

[0009] Furthermore, based on the predicted thermal power generation, predicted load shedding, and predicted branch active power flow for all scenarios to be evaluated, the risk detection results of the power grid are determined, including: Based on the predicted thermal power generation, the regional thermal power unit supply margin is calculated. Based on the predicted load reduction amounts for all scenarios to be evaluated, the overall future load reduction risk value is calculated. If the overall load reduction risk value exceeds a preset load reduction risk threshold, or if the regional thermal power unit supply margin is less than a preset reserve threshold, a load reduction risk is determined to exist. Based on the predicted active power flow of all scenarios to be evaluated, the independent overload probability of each branch at each evaluation time and the overall branch overload risk value are calculated. If the overall branch overload risk value exceeds the preset branch overload risk threshold, or if the independent overload probability of any branch at any evaluation time exceeds the preset independent overload probability threshold, it is determined that there is a branch overload risk.

[0010] Furthermore, the calculation of the overall future load reduction risk value based on the predicted load reduction amounts for all scenarios to be evaluated includes: The preset load reduction amount for each scenario to be evaluated is compared with the preset load reduction threshold, and the load reduction indicator variable value for the scenario to be evaluated is determined based on the comparison results. Based on the load reduction indicator variable value and the preset consequence cost penalty function, the multi-step load reduction risk and independent load reduction risk of each scenario to be evaluated are calculated; The overall load reduction risk value is calculated based on the multi-step load reduction risk and independent load reduction risk of all scenarios to be evaluated.

[0011] Furthermore, based on the predicted active power flow of all scenarios to be evaluated, the independent overload probability of each branch at each evaluation time and the overall branch overload risk value are calculated, including: Get the maximum allowed physical power flow limit of the branch; Based on the predicted active power flow of the branch and the maximum allowable physical power flow limit of the branch, the actual branch overload is calculated, and based on the relationship between the actual branch overload and the preset overload threshold, the overload indicator variable of each branch is determined. Based on the overload indicator variables of all scenarios to be evaluated, the independent overload probability, inter-branch spatial condition overload probability, and multi-step spatial condition overload probability of each branch at each evaluation time are calculated. Based on the actual branch overload, independent overload probability, spatial condition overload probability, and multi-step spatial condition overload probability, the overall branch overload risk value is calculated.

[0012] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments; This invention provides a power grid operation risk detection device based on graph neural networks, comprising: The module includes a data acquisition module, a scenario generation module, a feature construction module, a model prediction module, and a risk detection module. The data acquisition module is used to acquire the current actual load data, actual output data and static physical attribute data of each node in the power grid; The scenario generation module is used to generate predicted load data and predicted output data for several future scenarios to be evaluated, based on Markov chains, actual load data and actual output data. The feature construction module is used to construct a node feature vector and a heterogeneous adjacency matrix for each scenario to be evaluated, based on the static physical attribute data and the predicted load data and predicted output data corresponding to the current scenario to be evaluated. The model prediction module is used to input the node feature vector and the heterogeneous adjacency matrix into the preset thermal power generation prediction model, the preset load reduction prediction model and the preset branch power flow prediction model constructed based on the graph neural network, respectively, to obtain the predicted thermal power generation, the predicted load reduction and the predicted branch active power flow. The risk detection module is used to determine the risk detection result of the power grid based on the predicted thermal power generation, predicted load reduction, and predicted active power flow of all scenarios to be evaluated.

[0013] Based on the above method embodiments, the present invention provides a corresponding terminal device embodiment; The present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the above-described power grid operation risk detection method based on a graph neural network according to any embodiment of the present invention.

[0014] Based on the above method embodiments, the present invention provides a corresponding storage medium embodiment; The present invention provides a storage medium including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the above-described power grid operation risk detection method based on a graph neural network according to any embodiment of the present invention.

[0015] The embodiments of the present invention have the following beneficial effects: This invention provides a method, device, terminal equipment, and storage medium for power grid operation risk detection based on graph neural networks. The method acquires current actual load data, actual output data, and static physical attribute data of each node in the power grid, providing a precise starting point and physical boundary of the power grid for generating numerous scenarios covering uncertainties. Subsequently, based on Markov chains, actual load data, and actual output data, predicted load data and predicted output data for several future scenarios to be evaluated are generated. Since Markov chains are a powerful random sampling method, they can perform random walks starting from the current actual values, generating hundreds or thousands of output and load scenarios for future periods. These scenarios are not generated arbitrarily, but rather naturally capture the temporal inertia and uncertainty of renewable energy output and load demand through state transitions, thereby covering a large number of physically possible combinations of prediction errors and greatly expanding the coverage density of the uncertainty space. Then, for each scenario to be evaluated, based on the static physical attribute data and the predicted load and output data corresponding to the current scenario, node feature vectors and heterogeneous adjacency matrices are constructed. These node feature vectors and heterogeneous adjacency matrices are then input into a preset thermal power generation prediction model, a preset load reduction prediction model, and a preset branch power flow prediction model, all constructed based on graph neural networks, to obtain predicted thermal power generation, predicted load reduction, and predicted branch active power flow. Using three pre-trained graph neural network models, forward propagation calculations are performed in milliseconds to directly output the thermal power generation, load reduction, and branch power flow for each scenario. This process completely bypasses the iterative optimization process of mathematical programming calculations, drastically reducing the computation time for physical evaluation of thousands of scenarios from hours to seconds. Finally, based on the predicted thermal power generation, predicted load reduction, and predicted branch active power flow for all scenarios to be evaluated, the risk detection result of the power grid is determined. By aggregating the rapid assessment results of several scenarios into statistically reliable risk quantification indicators, a risk detection result is ultimately formed, providing theoretical support for subsequent decision-making. At the same time, the entire process only involves one iteration of SCUC during the offline model training stage, and does not involve any iteration of SCUC during the formal application stage. Therefore, the computation time is greatly reduced and the efficiency of risk calculation and detection is improved. Attached Figure Description

[0016] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1This is a flowchart illustrating a power grid operation risk detection method based on graph neural networks, provided in an embodiment of the present invention.

[0018] Figure 2 This is a schematic diagram of a power grid operation risk detection device based on a graph neural network according to an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0021] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0022] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0023] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0024] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0025] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0026] See Figure 1 To address the problem of excessive computational time in existing risk assessment methods that rely on directly solving complex decision-making problems such as safety-constrained unit combinations, an embodiment of the present invention provides a power grid operation risk detection method based on graph neural networks, comprising: Step S1: Obtain the current actual load data, actual output data, and static physical attribute data of each node in the power grid; Specifically, the aforementioned static physical attribute data includes: node location coordinates, the region to which the node belongs, the voltage level of the node, and the basic load requirements of the node.

[0027] Step S2: Based on the Markov chain, actual load data, and actual output data, generate predicted load data and predicted output data for several future scenarios to be evaluated; Specifically, in the formal application phase, it is necessary to generate a set of prediction scenarios to be evaluated that are anchored to the current actual operating state of the power grid and can fully cover the future uncertainty space. Unlike the offline training phase, which involves unconstrained synthetic sampling from a zero initial state, the scenario generation in the application phase must strictly start from the current real-time measurement information, so that the generated set of prediction scenarios can not only reflect the current operation continuity of the power grid, but also characterize the statistical distribution of future prediction errors.

[0028] In a preferred embodiment, based on the Markov chain, actual load data, and actual output data, predicted load data and predicted output data for several future scenarios to be evaluated are generated, including: Based on a preset edge probability distribution function, the quantiles of the actual load data and the actual output data are calculated respectively; wherein, the preset edge probability distribution function is constructed based on the historical load data and historical output data of each node of the power grid; Specifically, this invention treats both actual load data and actual output data as variables. Therefore, by directly substituting the variables into the preset marginal probability distribution function, the quantile of each variable in its own distribution can be calculated. This is existing technology and will not be elaborated here.

[0029] The quantiles are mapped using the inverse cumulative distribution function of the standard normal distribution to obtain the standard normal variables of each node; Specifically, by substituting the quantiles into the inverse cumulative distribution function, the standard normal variables of each node can be calculated. This is the existing technology and will not be elaborated further here.

[0030] The initial state vector of the Markov chain is obtained by solving the standard normal variables of all nodes and the preset lower triangular matrix. Specifically, the initial state vector is calculated based on the product of the inverse of the preset lower triangular matrix and the standard normal variable.

[0031] Based on different random variable matrices that follow a standard Gaussian distribution, a Markov chain random walk is performed on the initial state vector to generate several standard normal variables corresponding to each scenario to be evaluated; wherein, each random variable matrix corresponds to a scenario to be evaluated. Specifically, in order to reflect the smooth transition and time inertia characteristics of variables in continuous time steps, this invention uses Markov chains to perform random walks to capture time correlations and generate several standard normal variables.

[0032] Specifically, for each time step within the look-ahead period, the state update model is constructed as follows: In the formula, Let represent the random walk state matrix at time t. Let represent the random walk state matrix at time t-1. Let represent a matrix of random variables that follow a standard Gaussian distribution, and The random variable matrix corresponding to each scenario to be evaluated is different. This represents a standard Gaussian distribution.

[0033] Specifically, after obtaining the random walk state matrix, uncorrelated standard normal random variables that have eliminated the effects of time scale scaling are extracted from it, i.e., the aforementioned standard normal variables: In the formula, Let represent the standard normal variable at time t.

[0034] For each scenario to be evaluated, the standard normal variables corresponding to the current scenario to be evaluated are mapped based on the preset lower triangular matrix to obtain normal variables with spatiotemporal correlation. Specifically, the normal variable with spatiotemporal correlation is calculated using the following formula: In the formula, Let represent a normally distributed variable that exhibits spatiotemporal correlation at time t. This represents a lower triangular matrix.

[0035] Based on the inverse cumulative distribution function, physical quantity mapping is performed on the normal variables with spatiotemporal correlation to obtain a random variable matrix; Specifically, firstly, based on the cumulative distribution function corresponding to the inverse cumulative distribution function, the cumulative distribution function matrix corresponding to the normal variable is calculated: In the formula, express The cumulative distribution function matrix at time, The cumulative distribution function representing the standard normal distribution is expressed as follows: In the formula, This represents the cumulative probability value of a standard normal distribution at point z. This represents the integral variable.

[0036] Then, for each element in the cumulative distribution function matrix, the inverse cumulative distribution function is used for mapping, precisely mapping these elements to the specified marginal distribution, resulting in a matrix of random variables: In the formula, Let d be a random variable with the d-th marginal distribution at time t. Indicates the first marginal distribution The inverse cumulative distribution function, Let represent a matrix of random variables. Here, d represents the index of the marginal distribution (the dimension of the random variable).

[0037] It should be noted that the generated random variable matrix is ​​essentially the aggregated predicted load data and aggregated predicted output data of macroscopic region a.

[0038] Based on a preset static distribution factor, the random variable matrix is ​​distributed to each node to obtain the predicted load data and predicted output data for each node under each scenario to be evaluated.

[0039] Specifically, to provide high-resolution bus node-level input features to the underlying graph neural network surrogate model, this invention employs a static distribution factor mechanism to finely allocate regional aggregate values ​​to each independent load bus and wind turbine physical node. The allocation formula is as follows: In the formula, This represents the predicted load of the b-th load bus within region a. Indicates the first The constant distribution ratio factor of each load bus to the total load of the corresponding area. This represents the aggregated predicted load data for region a. This indicates the total number of load buses contained within the area. Indicates the region Inner Predicted output of typhoon turbines Indicates the first The constant distribution ratio factor of typhoon-powered generators to the aggregated wind power output of the corresponding region. This represents the aggregated predicted power output data for region 'a'. Here, 'a' represents the region index, 'b' represents the load bus index within the region, and 'k' represents the wind turbine index within the region.

[0040] Preferably, in actual power system operation, high-dimensional, high-quality real historical data covering all future extreme probability predictions is often extremely scarce. This invention, by meticulously fusing spatial correlation (covariance matrix dimensionality reduction constraints) and temporal correlation (Markov evolution model) within a rigorous mathematical framework, can automatically and massively generate synthetic power grid prediction datasets that highly approximate real physical conditions. This not only breaks through the bottleneck caused by "data scarcity," but this scenario generation method also provides a high-quality data foundation for the robust training and generalization improvement of subsequent GNN surrogate models.

[0041] In this preferred embodiment, based on the Markov chain, actual load data, and actual output data, predicted load data and predicted output data for several future scenarios to be evaluated are generated.

[0042] Step S3: For each scenario to be evaluated, based on the static physical attribute data, as well as the predicted load data and predicted output data corresponding to the current scenario to be evaluated, construct a node feature vector and a heterogeneous adjacency matrix. Specifically, after generating the predicted load and output data for all scenarios to be evaluated, the power grid operating state under each scenario needs to be converted into a standardized graph data structure that can be directly processed by a graph neural network. Since each scenario has different predicted load and output, node feature vectors need to be constructed independently for each scenario; however, the physical topology of the power grid remains unchanged under normal operating conditions, so all scenarios can share the same heterogeneous adjacency matrix.

[0043] In a preferred embodiment, the node includes: a generator bus node containing only generator sets, a power load bus node containing only loads, and a hybrid node containing both generator sets and loads. Based on the static physical attribute data, and the predicted load data and predicted output data corresponding to the current scenario to be evaluated, a node feature vector and a heterogeneous adjacency matrix are constructed, including: Obtain the connection topology of the power grid; An adjacency matrix is ​​generated based on the connection topology, and the adjacency matrix is ​​used as the heterogeneous adjacency matrix; Specifically, the distribution of power flow at the underlying physical level of the power grid is strictly governed by Kirchhoff's laws. To enable neural networks to effectively perceive and learn the spatial transfer characteristics of power flow and network congestion patterns, an adjacency matrix representing the topology of the power grid connection must be introduced. This invention physically models all actual power transmission lines as a set of edges in a graph network, models the aforementioned nodes as graph vertices, and constructs a heterogeneous adjacency matrix.

[0044] Based on the static physical attribute data, construct the node static feature vector for each node; Specifically, for the generator bus node, its static feature vector is represented as follows: In the formula, This represents the static feature vector of the generator bus node. The x-coordinate represents the location of the generator busbar node. The vertical coordinate represents the location of the generator busbar node. Indicates the region to which the generator bus node belongs. This indicates the voltage level at the generator bus node. Indicates the unit upper limit of active power output and Indicates the unit The lower limit of meritorious contribution, This represents the normalized initial operating state characteristics of the unit nodes, where the actual start-up and shutdown values ​​are taken as 0 or 1 during the training phase, and 0.5 for thermal units and 1 for wind turbine units during the online prediction phase. Indicates the unit The marginal cost of generating electricity per unit of active power output.

[0045] Specifically, for a power load bus node, its static feature vector includes the node's location coordinates, the region to which the node belongs, the node's voltage level, and the node's basic load requirements.

[0046] Based on the predicted output data, the first node dynamic prediction sequence vector of the generator bus node is constructed. Specifically, within the look-ahead time window, the randomness of the environment is represented by multi-time-step prediction sequences. For each node, its prediction distribution is extracted, and a dynamic prediction sequence vector with a feature dimension equal to the number of future time steps is constructed. For the generator bus node, its dynamic prediction sequence vector is: In the formula, This represents the dynamic prediction sequence vector of the first node of the generator bus node. This indicates the predicted output of this generator bus node at each future time step.

[0047] Based on the predicted load data, a second node dynamic prediction sequence vector for the power load bus node is constructed. Specifically, for the load bus node, its node dynamic prediction sequence vector is: In the formula, This represents the second node dynamic prediction sequence vector of the load bus node. This indicates the predicted load of this load bus node at each future time step.

[0048] It should be noted that, in order to unify the underlying input format of thermal power generators and wind power generators (renewable energy sources), for thermal power generators, all elements in their node dynamic prediction sequence are initialized to 0; simultaneously, in their node static feature vector, the initial value of their binary start-stop state variable subject to operator scheduling is set to 0.5 (representing a soft initial state where the system is undetermined / to be optimized). In contrast, for wind power generators, which have no fuel costs and are prioritized for grid connection, their start-stop state variable is forcibly set to 1 by hard physical constraints (representing continuous grid-connected operation).

[0049] Based on the predicted output data and predicted load data, a dynamic prediction sequence vector of the third node of the hybrid node is constructed. Specifically, by combining the predicted output of the generator bus node at each future time step with the predicted load of the load bus node at each future time step, the dynamic prediction sequence vector of the third node can be obtained.

[0050] For any node, if the current node is a pure generator bus node, then the node static feature vector corresponding to the current node and the dynamic prediction sequence vector of the first node are concatenated to obtain the node feature vector of the current node. Specifically, if the current node is a pure generator bus node, then the corresponding node's static feature vector and the first node's dynamic prediction sequence vector are directly concatenated as follows: In the formula, This represents the node feature vector of node j.

[0051] If the current node is a pure power load bus node, then the node static feature vector corresponding to the current node and the dynamic prediction sequence vector of the second node are concatenated to obtain the node feature vector of the current node. Specifically, if the current node is a pure power load bus node, then the static feature vector of the current node and the dynamic prediction sequence vector of the second node are concatenated as follows: In the formula, This represents the static feature vector of the node corresponding to the power load bus node.

[0052] If the current node is a hybrid node, then the static feature vector of the current node and the dynamic prediction sequence vector of the third node are concatenated to obtain the node feature vector of the current node.

[0053] Specifically, if the current node is a very common hybrid node that includes both generator sets and load consumption, then the node feature vector obtained by cascading all feature attributes is represented as follows: Specifically, the node feature vectors of all bus nodes in the entire network are combined and stacked to form one of the final input data for the three GNNs to process.

[0054] In this preferred embodiment, node feature vectors and heterogeneous adjacency matrices are constructed based on static physical attribute data, as well as predicted load data and predicted output data corresponding to the current scenario to be evaluated.

[0055] Step S4: Using the node feature vector and heterogeneous adjacency matrix as inputs, input them into the preset thermal power generation prediction model, preset load reduction prediction model and preset branch power flow prediction model constructed based on graph neural network, respectively, to obtain the predicted thermal power generation, predicted load reduction and predicted branch active power flow. Specifically, since each node has three significantly different underlying physical attribute types (pure generator node, pure load node, and hybrid node), their underlying feature distribution spaces differ fundamentally. Therefore, this invention innovatively adopts a heterogeneous graph neural network (GNN) architecture to adapt to this multimodal topology. In this heterogeneous topology network, the adjacency information of different types of nodes is independently encoded in the message passing mechanism, and different types of nodes are placed in independent embedding spaces to perform graph information aggregation and state updates.

[0056] Specifically, through the dual mechanism of differential feature vector concatenation and heterogeneous graph adjacency matrix, the model distortion caused by node dimensional heterogeneity is perfectly shielded. This not only enables the neural network to capture both "static physical topology constraints" and "dynamic random temporal fluctuations" from the same input tensor matrix, but also cleverly provides the subsequent network with great freedom in implicitly inferring the evolution strategy of the unit.

[0057] In a preferred embodiment, the training of the preset thermal power generation prediction model, the preset load reduction prediction model, and the preset branch power flow prediction model includes: The Markov chain state matrix is ​​initialized to 0, and random walks and node assignments are performed based on the initialized Markov chain state matrix to generate several training scenarios and load data samples and output data samples of each node corresponding to each training scenario. Specifically, the principle for generating load data samples is the same as that for predicting load data, and the principle for generating output data samples is the same as that for predicting output data, so it will not be repeated here.

[0058] Based on the load data samples and output data samples, node feature vector samples and heterogeneous adjacency matrix samples for each training scenario are generated. Specifically, the node feature vector samples and node feature vectors are constructed in the same way, and the heterogeneous adjacency matrix samples and heterogeneous adjacency matrices are constructed in the same way, which will not be repeated here.

[0059] For each training scenario, based on the load data samples and output data samples, a first operation optimization model and corresponding first constraints are constructed with the goal of minimizing the overall operating cost. Specifically, the objective function of the first running optimization model is: In the formula, This represents the total operating cost of all generator units in the entire network over a future period. This represents the generator set index for the entire network, and ,in This represents the total number of generators in the entire network. Let be the core discrete decision variable of the model, representing the th The generator is in the first The start / stop state at each time step is a binary variable; a value of 1 represents on, and a value of 0 represents off. Let be the core continuous decision variable of the model, representing the th The generator is in the first Active power dispatch output (in MW) at each time step. Indicates the first The startup cost of a generator Indicates the first The downtime cost of a generator Indicates the first The generator is in the first The active power production cost function for each time step.

[0060] Preferably, VOLL·Σ_bψ_{b,t} can be added to the above objective function as a load reduction penalty term to ensure that reduction only occurs when physical constraints cannot be met.

[0061] Specifically, the first constraint includes: node / system power balance constraint: In the formula, This represents the set of conventionally dispatchable generator sets connected to the node corresponding to load bus b. This represents the set of renewable energy generation units connected to the node corresponding to load bus b. Describing a scenario Next-node level renewable energy unit During the period of efforts, Describing a scenario The node corresponding to the load bus b during the time period The load, This indicates the node corresponding to load bus b during the time period. Load reduction slack variables, Indicates a branch During the period The meritorious trend, This represents the set of branches connected to the node corresponding to load bus b.

[0062] Load reduction boundary constraints: Unit output upper and lower limit constraints: In the formula, Indicates the unit The minimum active power output allowed when the unit is powered on. Indicates the unit The maximum active power output allowed when the machine is powered on.

[0063] Climbing constraints: In the formula, Indicates the unit The maximum allowable power reduction between two adjacent scheduling periods Indicates the unit The maximum allowable power increase between two adjacent scheduling periods.

[0064] Minimum start-up and stop time constraints: In the formula, Indicates the unit After startup, the system must maintain a minimum continuous operating time. Indicates the unit After a shutdown, the minimum continuous shutdown duration must be maintained. Indicates the unit During the period Start-stop state variables, Indicates the unit During the period The start / stop status.

[0065] Reserve capacity constraints and line power flow constraints: In the formula, Indicates time period The system's reserve capacity requirement can be determined by preset quantiles of load forecasting error and renewable energy forecasting error. Indicates the unit The maximum contribution, Indicates the unit During the period The actual dispatching has active power output.

[0066] Under the constraints, the operation optimization model is solved to obtain the optimal unit start-up and shutdown state, optimal total load reduction, optimal thermal power generation, and optimal branch power flow corresponding to the current training scenario. Using the optimal unit start-up and shutdown state as a quantitative measure, and based on the load data sample and output data sample, with the goal of minimizing the load reduction penalty cost and generator output adjustment cost, a second operation optimization model and corresponding second constraints are constructed. Specifically, the objective function corresponding to the second running optimization model is: In the formula, This represents the load reduction penalty factor, with a value range of [value missing]. to Yuan / MWh, in this embodiment, is taken as Yuan / MWh, and satisfy Not less than 10 times the maximum marginal cost of all generating units; After indicating the fixed start / stop status of the generating units and relaxing the line power flow constraints, the node corresponding to load bus b in the time period The amount of load reduction; In the second operation optimization model, the unit During the period The active power output decision variables.

[0067] Specifically, in the second constraint condition, the unit start-stop state variable U_tilde(g,t)=U_star(g,t,ω) is first fixed, and the node or system power balance constraints, unit output upper and lower limit constraints, ramping constraints, and load reduction boundary constraints are retained. The line power flow constraints are replaced with relaxed branch power flow upper and lower limit constraints, and the relaxed power flow upper limit is significantly greater than the original maximum allowable power flow of the branch, or the line power flow constraint is directly cancelled. The sum of the load reduction amounts of each node obtained in this way is used to characterize the load reduction amount caused by non-congestion factors.

[0068] Solve the second operational optimization model under the second constraint to obtain the optimal non-congestion reduction amount; Preferably, conventional operational risk assessment methods can only obtain a coarse-grained label of "total system load reduction," failing to perceive the deep physical mechanisms that trigger such adverse events. The core innovative advantage of this invention lies in providing a cause-aware control variable decoupling mechanism, which can semantically separate load reduction caused by insufficient online installed capacity or ramp-up obstacles from network congestion load reduction caused by limited physical network cross-sections through solving two optimization models.

[0069] Specifically, for the first optimization model solution, the unit start-up and shutdown status and generator output are jointly used as decision variables for unified and coordinated optimization. Under this condition, the dynamic physical constraints related to the unit start-up and shutdown status jointly affect the scheduling decision. If the solver recommends load reduction at this time, it is recorded as the optimal total load reduction amount at that time step.

[0070] For the second optimization model solution, while keeping the power load and renewable energy forecast inputs completely unchanged under the current scenario, the start-stop binary variables of all generators in the entire network are forcibly frozen and locked to the optimal state baseline solution obtained in the first optimization calculation. At this time, the online adjustable installed capacity and unit reserve margin of the entire network are completely predetermined. Therefore, the second solution calculation is not a repetition of the first model under the exact same objective function and constraints, but rather a fixed solution. This leads to a continuous power rescheduling model. In this state, by relaxing or removing the upper limit constraint on line power flow, if load reduction still exists, this reduction is mainly caused by insufficient online unit capacity, output limit, and ramping capability; the output reduction amount is recorded as the optimal non-congestion reduction amount.

[0071] The difference between the optimal total load reduction and the optimal non-congestion reduction is used as the true label of the preset load reduction prediction model for the corresponding training scenario; the optimal thermal power generation is used as the true label of the preset thermal power generation prediction model for the corresponding training scenario; and the optimal branch power flow is used as the true label of the preset branch power flow prediction model for the corresponding training scenario. Based on each real label, the node feature vector samples of the corresponding training scenario, and the heterogeneous adjacency matrix samples, training samples for the preset thermal power generation prediction model, the preset load reduction prediction model, and the preset branch power flow prediction model are generated respectively. Specifically, after the aforementioned dual scheduling and decoupling computation, the state feature quantities (i.e., node feature vector samples and heterogeneous adjacency matrix samples) corresponding to each scenario sample are structurally aligned and integrated into a standard high-quality expert dataset. In this embodiment, a total of 1000 SCUC benchmark refinement solutions containing complete decoupling labels are generated as the total sample library. To ensure the generalization performance of the subsequent graph neural network model and to implement strict overfitting prevention monitoring, the total sample library is randomly divided according to a preset ratio: 70% of the sample observations are divided into the supervised training set during the training phase (i.e., the aforementioned training samples), used to drive the gradient backpropagation optimization of the GNN model parameters; 10% of the sample observations are divided into an independent validation set, used for systematic hyperparameter tuning and shutdown determination during the training process; and the remaining 20% ​​of the sample observations are divided into a strictly isolated test set, used to finally evaluate the direct test accuracy and computational speedup ratio of the trained surrogate model under completely new and unseen conditions.

[0072] Based on the training samples, the thermal power generation prediction model, load reduction prediction model, and branch power flow prediction model to be trained are trained to obtain the preset thermal power generation prediction model, preset load reduction prediction model, and preset branch power flow prediction model.

[0073] Specifically, when making advanced predictions of power grid operation status, different types of real labels exhibit significant differences in physical distribution and dynamic response. To avoid feature interference that may arise in multi-task learning and to achieve optimal prediction accuracy under constantly evolving unit combinations, this invention innovatively constructs three independent and parallel GNN surrogate models: a preset thermal power generation prediction model, a preset load reduction prediction model, and a preset branch power flow prediction model.

[0074] Specifically, the thermal power generation prediction model is used to predict regional or system-level aggregated thermal power generation, the load shedding prediction model is used to predict regional or system-level aggregated load shedding, and the branch power flow prediction model is used to predict the branch physical power flow of critical transmission lines.

[0075] Specifically, all three models adopt a three-stage deep learning topology architecture: "Encoder - Graph Neural Network Layers - Decoder". The encoder and decoder each consist of two fully connected neural network layers (Multilayer Perceptron, MLP), and a ReLU activation function is added after each neural network layer except the last one to introduce non-linear expressive power.

[0076] The encoder aims to perform high-dimensional mapping on the training samples constructed through the aforementioned process, generating feature embeddings rich in deep semantics. Through a two-layer MLP structure, the encoder performs high-dimensional transformation of the features. This high-dimensional mapping effectively captures the inherent complex nonlinear patterns and relationships in the input data (network topology, generator physical constraints, dynamic random sequence prediction, etc.), preparing a high-quality initial node state space for subsequent graph network message passing.

[0077] The high-dimensional node embeddings processed by the encoder are fed into the core graph neural network layer. This embodiment preferably uses the GraphSAGE architecture to assimilate the global topology and local operating state of the entire network. Its core message passing mechanism consists of two sub-steps: aggregation and update. In the formula, This represents the local power grid operation characteristics extracted and aggregated from the sampled neighbor node set. This indicates the sampling neighbor node's first... Layer embedding performs the function of mean aggregation. Represents a node In the Feature embedding in each network layer Represents a node The set of one-hop neighbor nodes, This indicates the updated next-level node embedding. This indicates that after concatenating the node's own embedding with the aggregated message, the update function for the next layer of embedding is obtained through a trainable linear transformation and ReLU activation. Represents a node In the Layer feature embedding.

[0078] Preferably, the core technological advantage of the GraphSAGE architecture in this invention lies in its ability to overcome the computational bottleneck of traditional GCNs, which require loading the entire large-scale power grid graph into computer memory for each aggregation and update. Specifically, GraphSAGE performs targeted sampling of the local fixed-size neighborhood of each node and executes feature aggregation based on mean pooling. In the formula, CONCAT means concatenating the node's current features with the aggregated features of its neighbors along the feature dimension; This represents the set of neighboring nodes sampled from the one-hop neighborhood of node u; Indicates the number of neighboring nodes sampled; This represents the feature embedding of node v at the k-th layer.

[0079] Specifically, the decoder receives the enhanced node representations from the GNN layer output, which have fully incorporated spatiotemporal topology information, and translates them back to the desired power grid physical operating space format. Depending on the specific application scenario, the decoders of the three discrete models reduce and compress their respective high-dimensional features, ultimately directly outputting the future physical state characteristics under uncertain scenarios, namely, predicted sample values ​​for thermal power generation, load shedding, and branch power flow. This process completely bypasses the underlying nonlinear or mixed-integer mathematical optimization calculations.

[0080] Specifically, supervised learning methods are employed during the offline training phase of the model. To ensure that the graph neural network's output predictions strictly conform to the safe operation rules of the power system even without any explicit physical equation constraints, this invention constructs a comprehensive loss function that integrates prior physical knowledge. This loss function consists of two parts: In the formula, This represents the total loss for network backpropagation optimization. Mean squared error is used to quantify the absolute numerical deviation between the model's predicted value and the corresponding true label. The regularization term specifically designed for this invention is used to hard-penalize and limit the prediction output of the surrogate model, ensuring that all model output predictions are strictly within the reasonable upper and lower bound threshold ranges of the power grid's physical operation. Regularization weighting coefficients are used to balance prediction accuracy and physical limit penalties.

[0081] Preferably, the GraphSAGE architecture, which integrates physical constraint regularization, not only ensures that the model still has extremely high prediction accuracy and extremely low memory overhead when facing a large number of nodes (such as the Case2848rte network with more than 2800 nodes), but also enables millisecond-level end-to-end direct measurement across iterative solver mechanisms, making the model truly have large-scale industrial-grade practicality under dynamic unit combination evolution conditions.

[0082] Step S5: Determine the risk detection results of the power grid based on the predicted thermal power generation, predicted load reduction, and predicted branch active power flow for all scenarios to be evaluated.

[0083] Specifically, in order to comprehensively and accurately measure the operation of the power grid in the next few hours, this invention innovatively uses the model's predictive output to conduct a multi-dimensional quantitative assessment of the reliability and risk of two core fault modes: load reduction and branch overload, from two dimensions: an independent perspective (for a specific future single moment) and a multi-step composite perspective (for a continuous future time period).

[0084] In a preferred embodiment, the risk detection result of the power grid is determined based on the predicted thermal power generation, predicted load shedding, and predicted branch active power flow for all scenarios to be evaluated, including: Based on the predicted thermal power generation, the regional thermal power unit supply margin is calculated. Specifically, the regional net load, regional thermal power unit supply margin, and ramp-up margin are calculated based on the following formulas: In the formula, Represents the power grid area index. Indicates the index of the scenario to be evaluated. Describing a scenario Lower region During the period Net load, Indicates the total load of the region. Indicates the total output of renewable energy in the region. Indicates the supply margin of regional heating units. Indicates the region Internal heating unit assembly, This indicates the change in net load in the region. This indicates the area's upward slope margin.

[0085] Preferably, when the regional net load is greater than the preset net load threshold, the regional thermal unit supply margin is less than the preset standby threshold, and the regional uphill margin is less than 0, it is determined that there is a thermal supply margin risk in the current scenario to be evaluated.

[0086] Based on the predicted load reduction amounts for all scenarios to be evaluated, the overall future load reduction risk value is calculated. If the overall load reduction risk value exceeds a preset load reduction risk threshold, or if the regional thermal power unit supply margin is less than a preset reserve threshold, a load reduction risk is determined to exist. Based on the predicted active power flow of all scenarios to be evaluated, the independent overload probability of each branch at each evaluation time and the overall branch overload risk value are calculated. If the overall branch overload risk value exceeds the preset branch overload risk threshold, or if the independent overload probability of any branch at any evaluation time exceeds the preset independent overload probability threshold, it is determined that there is a branch overload risk.

[0087] In this preferred embodiment, the risk detection results of the power grid are calculated and determined based on the predicted thermal power generation, the predicted load reduction, and the predicted active power flow of the branches.

[0088] In another preferred embodiment, the calculation of the future overall load reduction risk value based on the predicted load reduction amounts for all scenarios to be evaluated includes: The preset load reduction amount for each scenario to be evaluated is compared with the preset load reduction threshold, and the load reduction indicator variable value for the scenario to be evaluated is determined based on the comparison results. Specifically, at the time step If the preset load reduction amount is greater than the preset load reduction threshold, it indicates that a load reduction event has occurred, and the load reduction indicator variable value is 1; otherwise, the value is 0.

[0089] Based on the load reduction indicator variable value and the preset consequence cost penalty function, the multi-step load reduction risk and independent load reduction risk of each scenario to be evaluated are calculated; The overall load reduction risk value is calculated based on the multi-step load reduction risk and independent load reduction risk of all scenarios to be evaluated.

[0090] Specifically, for a continuous load reduction event from time t to ΔT future time steps, a multi-step conditional load reduction probability is defined for the Δt-th future time step. for: In the formula, Describing a scenario During the period Load reduction indicator variable, Describing a scenario During the period Load reduction indicator variable, This indicates the total number of scenarios to be evaluated. Describing a scenario The probability of occurrence, when sampling with equal probability, is taken , To prevent positive numbers with a denominator of 0, this embodiment takes... .

[0091] Subsequently, an economic penalty is introduced to quantify the consequences of load reduction. Let... For the context During the period The actual load reduction is calculated using a marginal consequence cost function that increases linearly with the reduction amount. ,in and The result of load reduction is... Defined as: in, The basic loss factor for unit load reduction can be taken as the lost load value (VOLL). This is a severity scaling factor that increases with the scale of load reduction. Based on the above load reduction consequence values ​​and multi-step conditional load reduction probabilities, the risks of independent load reduction and multi-step load reduction are calculated respectively.

[0092] Specifically, the risks of independent load shedding, multi-stage load shedding, and overall load shedding are calculated using the following formulas: In the formula, This indicates the independent load shedding risk for time period t. This indicates the risk of multi-step load reduction within ΔT time steps starting from time period t. β represents the overall load reduction risk value, and β represents the time discount factor, which satisfies 0 < β ≤ 1. In this embodiment, it is taken as 0.95.

[0093] In this preferred embodiment, the overall future load reduction risk value is calculated based on the predicted load reduction amounts for all scenarios to be evaluated.

[0094] In another preferred embodiment, the calculation of the independent overload probability of each branch and the overall branch overload risk value at each assessment time based on the predicted active power flow of all scenarios to be evaluated includes: Get the maximum allowed physical power flow limit of the branch; Based on the predicted active power flow of the branch and the maximum allowable physical power flow limit of the branch, the actual branch overload is calculated, and based on the relationship between the actual branch overload and the preset overload threshold, the overload indicator variable of each branch is determined. Specifically, the actual branch overload is calculated using the following formula: In the formula, Describing a scenario Lower branch road During the period Risk of overload This represents the active power flow output by the preset branch power flow prediction model. This represents the branch safety threshold proportionality coefficient, with a value ranging from 0.80 to 1.00. In this embodiment, it is set to 0.85. Indicates a branch The maximum allowable physical power flow limit.

[0095] Subsequently, the branch overload indicator variable is determined based on the aforementioned risk overload amount: Based on the overload indicator variables of all scenarios to be evaluated, the independent overload probability, inter-branch spatial condition overload probability, and multi-step spatial condition overload probability of each branch at each evaluation time are calculated. Specifically, the above three types of overload probabilities are calculated using scenario probability weighted frequency, and their expressions are as follows: In the formula, This represents the independent overload probability of branch l in time period t, and is used as a comparison object for a preset independent overload probability threshold. This represents the spatial conditional probability that branch h is also overloaded under the condition that branch l is overloaded in time period t. This represents the multi-step spatial conditional probability of branch h being overloaded in time period t+Δt under the condition that branch l is overloaded in time period t. This represents the overload indicator variable for branch l under scenario ω. Let l represent the overload indicator variable for branch h under scenario ω. Here, l and h both represent branch indices, and l ≠ h is taken when calculating the conditional probability.

[0096] Preferably, since the power flow distribution in the power network is strictly constrained by Kirchhoff's laws, an overload in one branch usually causes a power flow shift, leading to subsequent overloads in other related branches. Therefore, a spatial conditional overload probability between branches is introduced. The introduction of this conditional probability greatly enhances the dispatcher's situational awareness of potential "cascading power outages."

[0097] Based on the actual branch overload, independent overload probability, spatial condition overload probability, and multi-step spatial condition overload probability, the overall branch overload risk value is calculated.

[0098] Specifically, the consequences of branch overload are first calculated using the following formula: In the formula, Describing a scenario Lower branch road During the period The overload consequence value; This represents the marginal economic cost function for the degree of branch overload; This represents the overload loss coefficient of the branch road foundation. This represents the severity increment coefficient as the overload level increases. Both coefficients can be pre-calibrated based on the branch voltage level, power supply load size, and criticality level.

[0099] Finally, the expected consequences of overload for each branch are calculated first, and then the independent overload risk, spatial condition overload risk, and multi-step spatial condition overload risk are combined to obtain the overall system-level branch overload risk value: In the formula, This indicates the number of branches included in the risk assessment. Indicates a branch During the period The expected consequences of overload The weighting coefficients representing spatial condition risk. The weighting coefficients represent the multi-step conditional risks, and both range from 0 to 1; in this embodiment, both are set to 1. This represents the overall branch overload risk value.

[0100] In this preferred embodiment, based on the predicted active power flow of all scenarios to be evaluated, the independent overload probability, spatial condition overload probability, multi-step spatial condition overload probability, and overall branch overload risk value of each branch in the future are calculated.

[0101] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.

[0102] like Figure 2 As shown, an embodiment of the present invention provides a power grid operation risk detection device based on a graph neural network, comprising: The system includes a data acquisition module 101, a scenario generation module 102, a feature construction module 103, a model prediction module 104, and a risk detection module 105. The data acquisition module 101 is used to acquire the current actual load data, actual output data and static physical attribute data of each node in the power grid. The scenario generation module 102 is used to generate predicted load data and predicted output data for several future scenarios to be evaluated based on Markov chains, actual load data and actual output data. The feature construction module 103 is used to construct a node feature vector and a heterogeneous adjacency matrix for each scenario to be evaluated, based on the static physical attribute data and the predicted load data and predicted output data corresponding to the current scenario to be evaluated. The model prediction module 104 is used to input the node feature vector and the heterogeneous adjacency matrix into the preset thermal power generation prediction model, the preset load reduction prediction model and the preset branch power flow prediction model constructed based on the graph neural network, respectively, to obtain the predicted thermal power generation, the predicted load reduction and the predicted branch active power flow. The risk detection module 105 is used to determine the risk detection result of the power grid based on the predicted thermal power generation, predicted load reduction, and predicted active power flow of all scenarios to be evaluated.

[0103] It should be noted that the device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without creative effort. The above schematic diagrams are merely examples of a power grid operation risk detection device based on graph neural networks and do not constitute a limitation on a power grid operation risk detection device based on graph neural networks. It may include more or fewer components than illustrated, or combine certain components, or use different components.

[0104] Based on the above method embodiments, the present invention provides corresponding terminal device embodiments.

[0105] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power grid operation risk detection method based on graph neural network described in any embodiment of the present invention.

[0106] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the device. The aforementioned terminal devices may be computing devices such as desktop computers, laptops, handheld computers, and cloud servers. These devices may include, but are not limited to, processors and memory. The processor can be a Central Processing Unit (CPU), or 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. A general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the device, connecting various parts of the device via various interfaces and lines. The aforementioned memory can be used to store the aforementioned computer programs and / or modules. The aforementioned processor implements various functions of the aforementioned device by running or executing the computer programs and / or modules stored in the aforementioned memory, and by calling data stored in the memory. The aforementioned memory may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0107] Based on the above method embodiments, the present invention provides corresponding storage medium embodiments.

[0108] Another embodiment of the present invention provides a storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute the power grid operation risk detection method based on graph neural network described in any embodiment of the present invention.

[0109] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0110] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for detecting power grid operation risks based on graph neural networks, characterized in that, include: Obtain the current actual load data, actual output data, and static physical attribute data of each node in the power grid; Based on Markov chains, actual load data, and actual output data, predictive load data and predictive output data are generated for several future scenarios to be evaluated. For each scenario to be evaluated, based on the static physical attribute data, as well as the predicted load data and predicted output data corresponding to the current scenario to be evaluated, a node feature vector and a heterogeneous adjacency matrix are constructed. The node feature vector and heterogeneous adjacency matrix are input to the preset thermal power generation prediction model, preset load reduction prediction model and preset branch power flow prediction model constructed based on graph neural network, respectively, to obtain the predicted thermal power generation, predicted load reduction and predicted branch active power flow. The risk detection results of the power grid are determined based on the predicted thermal power generation, predicted load reduction, and predicted active power flow of all scenarios to be evaluated.

2. The power grid operation risk detection method based on graph neural networks according to claim 1, characterized in that, Based on Markov chains, actual load data, and actual power output data, predicted load data and predicted power output data for several future scenarios to be evaluated are generated, including: Based on a preset edge probability distribution function, the quantiles of the actual load data and the actual output data are calculated respectively; wherein, the preset edge probability distribution function is constructed based on the historical load data and historical output data of each node of the power grid; The quantiles are mapped using the inverse cumulative distribution function of the standard normal distribution to obtain the standard normal variables of each node; The initial state vector of the Markov chain is obtained by solving the standard normal variables of all nodes and the preset lower triangular matrix. Based on different random variable matrices that follow a standard Gaussian distribution, a Markov chain random walk is performed on the initial state vector to generate several standard normal variables corresponding to each scenario to be evaluated; wherein, each random variable matrix corresponds to a scenario to be evaluated. For each scenario to be evaluated, the standard normal variables corresponding to the current scenario to be evaluated are mapped based on the preset lower triangular matrix to obtain normal variables with spatiotemporal correlation. Based on the inverse cumulative distribution function, physical quantity mapping is performed on the normal variables with spatiotemporal correlation to obtain a random variable matrix; Based on a preset static distribution factor, the random variable matrix is ​​distributed to each node to obtain the predicted load data and predicted output data for each node under each scenario to be evaluated.

3. The power grid operation risk detection method based on graph neural networks according to claim 2, characterized in that, The nodes include: generator bus nodes that contain only generator sets, power load bus nodes that contain only loads, and hybrid nodes that contain both generator sets and loads. Based on the static physical attribute data, and the predicted load data and predicted output data corresponding to the current scenario to be evaluated, a node feature vector and a heterogeneous adjacency matrix are constructed, including: Obtain the connection topology of the power grid; An adjacency matrix is ​​generated based on the connection topology, and the adjacency matrix is ​​used as the heterogeneous adjacency matrix; Based on the static physical attribute data, construct the node static feature vector for each node; Based on the predicted output data, the first node dynamic prediction sequence vector of the generator bus node is constructed. Based on the predicted load data, a second node dynamic prediction sequence vector for the power load bus node is constructed. Based on the predicted output data and predicted load data, a dynamic prediction sequence vector of the third node of the hybrid node is constructed. For any node, if the current node is a pure generator bus node, then the node static feature vector corresponding to the current node and the dynamic prediction sequence vector of the first node are concatenated to obtain the node feature vector of the current node. If the current node is a pure power load bus node, then the node static feature vector corresponding to the current node and the dynamic prediction sequence vector of the second node are concatenated to obtain the node feature vector of the current node. If the current node is a hybrid node, then the static feature vector of the current node and the dynamic prediction sequence vector of the third node are concatenated to obtain the node feature vector of the current node.

4. The power grid operation risk detection method based on graph neural networks according to claim 3, characterized in that, The training of the preset thermal power generation prediction model, the preset load reduction prediction model, and the preset branch power flow prediction model includes: The Markov chain state matrix is ​​initialized to 0, and random walks and node assignments are performed based on the initialized Markov chain state matrix to generate several training scenarios and load data samples and output data samples of each node corresponding to each training scenario. Based on the load data samples and output data samples, node feature vector samples and heterogeneous adjacency matrix samples for each training scenario are generated. For each training scenario, based on the load data samples and output data samples, a first operation optimization model and corresponding first constraints are constructed with the goal of minimizing the overall operating cost. Under the constraints, the operation optimization model is solved to obtain the optimal unit start-up and shutdown state, optimal total load reduction, optimal thermal power generation, and optimal branch power flow corresponding to the current training scenario. Using the optimal unit start-up and shutdown state as a quantitative measure, and based on the load data sample and output data sample, with the goal of minimizing the load reduction penalty cost and generator output adjustment cost, a second operation optimization model and corresponding second constraints are constructed. Solve the second operational optimization model under the second constraint to obtain the optimal non-congestion reduction amount; The difference between the optimal total load reduction and the optimal non-congestion reduction is used as the true label of the preset load reduction prediction model for the corresponding training scenario; the optimal thermal power generation is used as the true label of the preset thermal power generation prediction model for the corresponding training scenario; and the optimal branch power flow is used as the true label of the preset branch power flow prediction model for the corresponding training scenario. Based on each real label, the node feature vector samples of the corresponding training scenario, and the heterogeneous adjacency matrix samples, training samples for the preset thermal power generation prediction model, the preset load reduction prediction model, and the preset branch power flow prediction model are generated respectively. Based on the training samples, the thermal power generation prediction model, load reduction prediction model, and branch power flow prediction model to be trained are trained to obtain the preset thermal power generation prediction model, preset load reduction prediction model, and preset branch power flow prediction model.

5. The power grid operation risk detection method based on graph neural networks according to claim 4, characterized in that, Based on the predicted thermal power generation, predicted load shedding, and predicted branch active power flow for all scenarios to be evaluated, determine the risk detection results for the power grid, including: Based on the predicted thermal power generation, the regional thermal power unit supply margin is calculated. Based on the predicted load reduction amounts for all scenarios to be evaluated, the overall future load reduction risk value is calculated. If the overall load reduction risk value exceeds a preset load reduction risk threshold, or if the regional thermal power unit supply margin is less than a preset reserve threshold, a load reduction risk is determined to exist. Based on the predicted active power flow of all scenarios to be evaluated, the independent overload probability of each branch at each evaluation time and the overall branch overload risk value are calculated. If the overall branch overload risk value exceeds the preset branch overload risk threshold, or if the independent overload probability of any branch at any evaluation time exceeds the preset independent overload probability threshold, it is determined that there is a branch overload risk.

6. The power grid operation risk detection method based on graph neural networks according to claim 5, characterized in that, The overall future load reduction risk value is calculated based on the predicted load reduction amounts for all scenarios to be evaluated, including: The preset load reduction amount for each scenario to be evaluated is compared with the preset load reduction threshold, and the load reduction indicator variable value for the scenario to be evaluated is determined based on the comparison results. Based on the load reduction indicator variable value and the preset consequence cost penalty function, the multi-step load reduction risk and independent load reduction risk of each scenario to be evaluated are calculated; The overall load reduction risk value is calculated based on the multi-step load reduction risk and independent load reduction risk of all scenarios to be evaluated.

7. The power grid operation risk detection method based on graph neural networks according to claim 6, characterized in that, The predicted active power flow of the branches based on all scenarios to be evaluated calculates the independent overload probability of each branch at each evaluation time and the overall branch overload risk value, including: Get the maximum allowed physical power flow limit of the branch; Based on the predicted active power flow of the branch and the maximum allowable physical power flow limit of the branch, the actual branch overload is calculated, and based on the relationship between the actual branch overload and the preset overload threshold, the overload indicator variable of each branch is determined. Based on the overload indicator variables of all scenarios to be evaluated, the independent overload probability, inter-branch spatial condition overload probability, and multi-step spatial condition overload probability of each branch at each evaluation time are calculated. Based on the actual branch overload, independent overload probability, spatial condition overload probability, and multi-step spatial condition overload probability, the overall branch overload risk value is calculated.

8. A power grid operation risk detection device based on graph neural networks, characterized in that, include: The module includes a data acquisition module, a scenario generation module, a feature construction module, a model prediction module, and a risk detection module. The data acquisition module is used to acquire the current actual load data, actual output data and static physical attribute data of each node in the power grid; The scenario generation module is used to generate predicted load data and predicted output data for several future scenarios to be evaluated, based on Markov chains, actual load data and actual output data. The feature construction module is used to construct a node feature vector and a heterogeneous adjacency matrix for each scenario to be evaluated, based on the static physical attribute data and the predicted load data and predicted output data corresponding to the current scenario to be evaluated. The model prediction module is used to input the node feature vector and the heterogeneous adjacency matrix into the preset thermal power generation prediction model, the preset load reduction prediction model and the preset branch power flow prediction model constructed based on the graph neural network, respectively, to obtain the predicted thermal power generation, the predicted load reduction and the predicted branch active power flow. The risk detection module is used to determine the risk detection result of the power grid based on the predicted thermal power generation, predicted load reduction, and predicted active power flow of all scenarios to be evaluated.

9. A terminal device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a power grid operation risk detection method based on a graph neural network as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the storage medium is located to execute a power grid operation risk detection method based on a graph neural network as described in any one of claims 1 to 7.