Power grid cascading failure defense method and system based on physical information neural network

CN122509715BActive Publication Date: 2026-10-23STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611000030.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-10-23
Estimated Expiration
2046-07-07

AI Technical Summary

Technical Problem

[0005]本发明针对现有技术中纯数据驱动方法缺乏物理可解释性、极端工况下易错误外推,传统机理仿真方法计算复杂度高且难以处理不确定性,以及无法自适应动态拓扑变化、预警机制依赖固定阈值的技术问题,提供一种基于物理信息神经网络的电网级联失效防御方法及系统

Benefits of technology

相较于现有技术,本发明首先将多源异构运行数据与实时物理连通性融合,构建综合多模态特征张量和动态拓扑掩码矩阵,使模型能够感知电网拓扑的瞬态变化。其次,将基尔霍夫定律、潮流方程等物理机理嵌入神经网络训练过程,通过物理-数据双驱动损失函数约束模型输出,确保极端工况下的推演结果符合客观物理规律,避免了纯数据驱动模型的盲目外推。再次,输出关键节点的连续状态概率密度分布,并基于极值理论构建随工况动态浮动的极端风险阈值,实现了风险边界的自适应量化。当脆弱性状态值超过阈值时触发分级预警并生成防御指令,形成了从态势感知到主动阻断的完整防御链条。本发明解决了物理可解释性差、动态拓扑适应性不足及预警机制僵化的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122509715B_ABST
    Figure CN122509715B_ABST
Patent Text Reader

Abstract

The application discloses a power grid cascading failure defense method and system based on a physical information neural network, and relates to the technical field of smart grids. The method comprises the following steps: collecting multi-source heterogeneous operation data of a cross-region power grid to construct a comprehensive multi-modal feature tensor, and generating a dynamic topological mask matrix according to real-time physical connectivity; constructing an initial prediction network based on the physical mechanism of a power system and a deep neural network, training a cascading failure prediction plug-in by combining a physical-data dual-driven loss function, obtaining the continuous state probability density distribution of key nodes, extracting a vulnerability state value and constructing an extreme risk threshold; and triggering an early warning signal and generating a defense instruction when the vulnerability state value exceeds the extreme risk threshold. The application solves the problems in the prior art, such as poor physical interpretability, easy error extrapolation of extreme working conditions and the incapability of static topologies to adapt to power grid connectivity transients, and realizes physical consistency and topological adaptive cascading failure active defense.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart grid technology, and more specifically to a method and system for preventing cascading failures in power grids based on physical information neural networks. Background Technology

[0002] In inter-regional power grids, local disturbances in the sending-end power grid can easily spread across regions to the receiving-end distribution network, causing voltage over-limit and reactive power backfeed failures.

[0003] Existing technologies mainly employ either data-driven deep learning-based fault diagnosis methods or traditional mechanistic simulation analysis methods. Data-driven methods predict faults by mining statistical correlations between electrical quantities, but lack physical interpretability and are prone to erroneous extrapolation under extreme conditions where fault samples are missing. Traditional mechanistic simulation methods have high computational complexity, making it difficult to meet real-time requirements and handle the uncertainty of renewable energy output. Furthermore, existing methods typically treat the power grid topology as a static structure, failing to adapt to the transient changes in network connectivity caused by circuit breaker tripping during cascading failures; early warning mechanisms often rely on manually set fixed safety boundaries, making it difficult to quantify extreme risks that dynamically fluctuate with operating conditions.

[0004] Therefore, there is an urgent need for a cascading failure defense method that integrates physical mechanisms and artificial intelligence, adapts to dynamic topological changes, and has statistical boundaries. Summary of the Invention

[0005] This invention addresses the technical problems of existing technologies, such as the lack of physical interpretability and erroneous extrapolation under extreme conditions in purely data-driven methods, the high computational complexity and difficulty in handling uncertainties in traditional mechanism simulation methods, and the inability to adapt to dynamic topology changes and the reliance of early warning mechanisms on fixed thresholds. It provides a power grid cascade failure defense method and system based on physical information neural networks.

[0006] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: In a first aspect, the present invention provides a power grid cascading failure prevention method based on physical information neural networks, comprising: Multi-source heterogeneous operation data of cross-regional power grids are collected to construct a comprehensive multimodal feature tensor, and a dynamic topology mask matrix is ​​generated based on the real-time physical connectivity of the cross-regional power grids. An initial prediction network is constructed based on the physical mechanism of power system and deep neural network. The initial prediction network is trained by combining the physical-data dual-drive loss function to generate a cascaded failure prediction plug-in. The integrated multimodal feature tensor and dynamic topology mask matrix are input into the cascaded failure prediction plugin, which outputs the continuous state probability density distribution of key nodes in the cross-regional power grid. Vulnerability state values ​​are extracted from the continuous state probability density distribution, and extreme risk thresholds are constructed. When the vulnerability status value exceeds the extreme risk threshold, an early warning signal is triggered and a defense command is generated.

[0007] Secondly, the present invention provides a power grid cascade failure prevention system based on physical information neural networks, comprising: The feature construction module is used to collect multi-source heterogeneous operation data of cross-regional power grids to construct a comprehensive multimodal feature tensor, and generate a dynamic topology mask matrix based on the real-time physical connectivity of the cross-regional power grids. The dual-drive training module is used to construct an initial prediction network based on the fusion of the physical mechanism of the power system and a deep neural network, and to train the initial prediction network by combining the physical-data dual-drive loss function to generate a cascaded failure prediction plug-in. The vulnerability assessment module is used to input the integrated multimodal feature tensor and dynamic topology mask matrix into the cascaded failure prediction plugin, output the continuous state probability density distribution of key nodes in the cross-regional power grid, extract vulnerability state values ​​from the continuous state probability density distribution, and construct extreme risk thresholds. The early warning module is used to trigger an early warning signal and generate a defense command when the vulnerability status value exceeds the extreme risk threshold.

[0008] The beneficial effects of this invention are: Compared to existing technologies, this invention first integrates multi-source heterogeneous operational data with real-time physical connectivity to construct a comprehensive multimodal feature tensor and a dynamic topology mask matrix, enabling the model to perceive transient changes in the power grid topology. Secondly, it embeds physical mechanisms such as Kirchhoff's laws and power flow equations into the neural network training process, constraining the model output through a physics-data dual-driven loss function. This ensures that the extrapolation results under extreme conditions conform to objective physical laws, avoiding the blind extrapolation of purely data-driven models. Thirdly, it outputs the continuous state probability density distribution of key nodes and constructs an extreme risk threshold that dynamically fluctuates with operating conditions based on extreme value theory, achieving adaptive quantification of the risk boundary. When the vulnerability state value exceeds the threshold, a tiered early warning is triggered and a defense command is generated, forming a complete defense chain from situational awareness to proactive blocking. This invention solves the technical problems of poor physical interpretability, insufficient adaptability to dynamic topology, and rigid early warning mechanisms. Attached Figure Description

[0009] Figure 1 A flowchart illustrating the power grid cascade failure prevention method based on physical information neural network provided by this invention; Figure 2 This is a schematic diagram of the structure of the power grid cascade failure prevention system based on physical information neural network provided by the present invention.

[0010] In the attached diagram, the components represented by each number are as follows: Feature construction module 11, dual-drive training module 12, vulnerability assessment module 13, and early warning module 14. Detailed Implementation

[0011] Example 1, as Figure 1 As shown, this embodiment of the invention provides a power grid cascading failure prevention method based on a physical information neural network, including: S10: Collect multi-source heterogeneous operation data of cross-regional power grids to construct a comprehensive multimodal feature tensor, and generate a dynamic topology mask matrix based on the real-time physical connectivity of the cross-regional power grids; First, collect multi-source heterogeneous operation data of inter-regional power grids. Inter-regional power grids refer to cross-regional power systems formed by connecting sending-end and receiving-end power grids through tie lines. The receiving-end power grid is usually located in the core area of ​​a city and is highly dependent on power from outside the region.

[0012] The multi-source heterogeneous operational data originates from different data acquisition systems, including power flow data from inter-regional power transmission lines, internal operating status data of the distribution network, photovoltaic meteorological and environmental data, and traffic flow and load data of electric vehicles. This multi-source heterogeneous operational data is used to comprehensively characterize the real-time operating status and environmental driving conditions of the inter-regional power grid in three dimensions: source, grid, and load, providing a multimodal data foundation for subsequent cascade failure risk simulation.

[0013] A comprehensive multimodal feature tensor is constructed based on multi-source heterogeneous operation data. This comprehensive multimodal feature tensor is a high-dimensional tensor formed by splicing together the power flow data of cross-regional sending-end interconnection lines, the internal operation status data of the distribution network, the photovoltaic meteorological environment data, and the traffic flow and load data of electric vehicles in the channel dimension after multimodal feature extraction and unified spatiotemporal resolution processing. It is used to provide a unified input feature representation that integrates electrical quantities, meteorological quantities, and load quantities for subsequent physical information neural networks.

[0014] Simultaneously, a dynamic topology mask matrix is ​​generated based on the real-time physical connectivity of the inter-regional power grid. The real-time physical connectivity of the inter-regional power grid refers to the real-time state of the electrical connections between nodes, as described by the node admittance matrix. During the cascading failure evolution process, equipment actions such as circuit breaker tripping can cause branch disconnections, leading to transient changes in the network topology. Since static graph structures cannot perceive these dynamic changes, the initial node admittance matrix needs to be corrected in real-time based on the branch connectivity state vector to generate a dynamic node admittance matrix. A dynamic topology mask matrix is ​​then generated based on this dynamic node admittance matrix, ensuring that the information propagation path of the subsequent neural network remains consistent with the real-time electrical connectivity of the underlying power grid.

[0015] Specifically, a comprehensive multimodal feature tensor is constructed by collecting multi-source heterogeneous operation data from inter-regional power grids, and a dynamic topology mask matrix is ​​generated based on the real-time physical connectivity of the inter-regional power grids, including: The active and reactive power time series of the cross-regional sending-end connection line, the voltage amplitude and voltage phase angle of each monitoring node in the distribution network, the active and reactive power flow of each branch, the solar irradiance, temperature, humidity and wind speed meteorological elements in the receiving-end area, the real-time load power of charging stations in the area and the charging demand aggregation based on traffic flow prediction are collected as multi-source heterogeneous operation data. Multimodal feature extraction and spatiotemporal resolution unification processing are performed on the multi-source heterogeneous operating data, and the processed multi-class feature vectors are concatenated in the channel dimension to generate a comprehensive multimodal feature tensor. The initial node admittance matrix is ​​corrected in real time based on the branch connectivity state vector. The mutual admittance elements corresponding to the branches in the open state are set to zero, and the self-admittance elements of the nodes at both ends of the branches are updated accordingly to generate a dynamic node admittance matrix. A dynamic topology mask matrix is ​​generated based on the dynamic node admittance matrix. Each element in the dynamic topology mask matrix represents the real-time electrical connection state between two corresponding nodes. In the step of generating the dynamic topology mask matrix, for any off-diagonal element in the dynamic topology mask matrix, when there is a direct electrical physical connection between the two corresponding nodes and the corresponding branch is in a closed state, the value of the off-diagonal element is set to a positive number associated with the mutual admittance value between the two corresponding nodes; when there is no direct electrical physical connection between the two corresponding nodes or the corresponding branch is in an open state, the value of the off-diagonal element is set to zero.

[0016] First, the active power time series and reactive power time series of the cross-regional sending-end connection line, the voltage amplitude and voltage phase angle of each monitoring node in the distribution network, the active power flow and reactive power flow of each branch, the solar irradiance, temperature, humidity and wind speed meteorological elements in the receiving-end area, the real-time load power of charging stations in the area and the charging demand aggregation based on traffic flow prediction are collected as multi-source heterogeneous operation data.

[0017] The aforementioned data originate from different data acquisition systems. Data from inter-regional sending-end interconnection lines reflects the power characteristics injected into the receiving-end grid from the upper-level power grid; data from the internal operation of the distribution network reflects the real-time electrical status of each node and branch of the grid; meteorological data reflects the environmental driving conditions for renewable energy output; and charging station load data reflects the uncertainties on the load side. By collecting these four types of data, the source-grid-load operation status of the inter-regional power grid can be comprehensively characterized.

[0018] Secondly, multimodal feature extraction and spatiotemporal resolution unification processing are performed on the multi-source heterogeneous operational data. The processed feature vectors of various types are then concatenated along the channel dimension to generate a comprehensive multimodal feature tensor. Since data from different sources have different temporal resolutions and sampling frequencies—for example, meteorological data may be sampled at the hourly level, electrical quantity data at the minute level, and charging station load data at the 15-minute level—it is necessary to unify all types of data to the same time granularity. This is achieved through linear interpolation or resampling methods, such as 15 minutes.

[0019] Specifically, the steps for unifying spatiotemporal resolution processing are as follows: First, determine the unified target time resolution, for example, set it to 15 minutes. For data sources with a time resolution lower than the target resolution, use linear interpolation for upsampling. Taking meteorological data as an example, the original resolution is 1 hour, i.e., one data point every 60 minutes, and the target resolution is 15 minutes. Then, three interpolation points are inserted at equal intervals between two adjacent original data points. The values ​​of the interpolation points are obtained by linear calculation based on the line connecting the two original data points. For data sources with a time resolution higher than the target resolution, use downsampling for aggregation. For example, if the original resolution of electrical quantity data is 5 minutes and the target resolution is 15 minutes, then the average of every three consecutive data points is used as the sampling value at the 15-minute granularity.

[0020] Simultaneously, feature extraction is performed on meteorological and load data, mapping them to the same time dimension as the power grid's electrical quantities. Complex nonlinear relationships exist between meteorological data elements such as solar irradiance, temperature, humidity, and wind speed and photovoltaic output. A multi-layer fully connected network is used to extract high-dimensional feature representations of these meteorological elements. For example, the structure of this multi-layer fully connected network is as follows: the input layer receives the original meteorological data vector, with the vector dimension being the number of meteorological element types multiplied by the time step; two fully connected layers are set, the first containing 128 neurons and the second containing 64 neurons, each followed by a ReLU activation function to introduce nonlinear transformation capability; the output layer maps the features to a vector space with the same feature dimension as the power grid's electrical quantities, with the output dimension set to 32. This network is pre-trained using supervised learning, with photovoltaic output as the supervised target, to learn the mapping relationship between meteorological elements and the electrical quantity feature space.

[0021] The real-time load power and charging demand aggregation in the charging station load data are also mapped to a unified time dimension through a feature extraction network. The feature extraction network for charging station load data adopts the same multi-layer fully connected network architecture. The input layer receives the charging station load data vector and consists of two fully connected layers: the first layer contains 128 neurons, and the second layer contains 64 neurons. The output layer dimension is also set to 32, consistent with the electrical quantity feature dimension. This network is trained using historical load data to learn the mapping from charging station load features to the electrical quantity feature space.

[0022] All the aforementioned feature extraction networks are trained jointly with the main network during the training phase, or pre-trained separately before the main network. After training, meteorological data and load data are input into the corresponding feature extraction networks, which output feature vectors with the same time and feature dimensions as the power grid electrical quantities. This facilitates subsequent concatenation with the electrical quantity features at the channel dimension. The output dimension of the feature extraction network is consistent with the feature dimension of the power grid electrical quantity data, which also facilitates subsequent concatenation.

[0023] Furthermore, the processed multi-class feature vectors are concatenated along the channel dimension to form a three-dimensional tensor. The dimension is the time step multiplied by the number of nodes multiplied by the number of feature channels, which serves as the unified input to the neural network. Specifically, let the time step be T, the number of nodes in the inter-regional power grid be N, and the number of feature channels obtained after extracting each type of feature be F1, F2, F3, and F4, respectively. Then, the total number of feature channels after concatenation along the channel dimension is F1 + F2 + F3 + F4. The final generated comprehensive multimodal feature tensor has a dimension of T × N × F, where F is the total number of feature channels. This comprehensive multimodal feature tensor will serve as the input to the subsequent physical information neural network, enabling the model to simultaneously utilize information from three dimensions—electrical quantities, meteorological quantities, and load quantities—to perform cascade failure risk simulation.

[0024] Furthermore, the initial node admittance matrix is ​​corrected in real time based on the branch connectivity state vector. The mutual admittance elements corresponding to branches in the open state are set to zero, and the self-admittance elements of the nodes at both ends of the branch are updated accordingly to generate a dynamic node admittance matrix. The initial node admittance matrix is ​​a complex square matrix pre-established based on the line impedance and ground admittance parameters of the power grid. Its dimension is equal to the total number of nodes in the power grid and it is used to describe the electrical connection relationship and line parameters of the power grid in the initial state. Among them, the diagonal elements in the node admittance matrix are self-admittances, which are equal to the sum of the admittances of all branches connected to that node plus the ground admittance of that node; the off-diagonal elements are mutual admittances, which are equal to the negative of the admittances of the branches connecting the corresponding two nodes.

[0025] During the cascading failure evolution process, when a circuit breaker trips and causes a branch to break, the initial node admittance matrix needs to be corrected in real time. Specifically, let the branch connect nodes i and j, and its branch admittance be y. ijWhen the branch is closed, the mutual admittance element Y ij and Y ji All are -y ij Self-guided nanoelement Y ii and Y jj Increase y respectively ij When a circuit breaker trips, causing the branch to open, the corresponding mutual admittance element Y of that branch is... ij and Y ji Set it to zero, and simultaneously set the self-admittance element Y of the nodes at both ends of the branch to zero. ii Subtract y ij Y jj Subtract y ij If a branch disconnection is due to the operation of a circuit breaker on the i-th or j-th side, only the contribution of that branch to the self-admittance of that side of the node is removed. The specific correction is based on the disconnected side identified in the branch connectivity state vector. The branch connectivity state vector is a binary vector of length equal to the total number of branches. Each element represents the connectivity state of the corresponding branch: 1 indicates closure, and 0 indicates disconnection. By traversing the branch connectivity state vector and performing the above correction operation sequentially on all branches in the disconnected state, the dynamic node admittance matrix is ​​obtained.

[0026] This dynamic node admittance matrix is ​​updated in real time with changes in the power grid topology to reflect the transient changes in electrical connections caused by equipment actions during cascading failures. For example, when a critical tie line trips due to overload, the mutual admittance element corresponding to that branch in the dynamic node admittance matrix is ​​immediately set to zero, and the self-admittance of the nodes at both ends decreases accordingly. Subsequent power flow calculations and physical constraints will be based on the updated admittance matrix, ensuring that the model can accurately track the impact of topology changes on the propagation path of cascading failures. Through this real-time correction mechanism, the dynamic node admittance matrix can accurately reflect the current electrical connection status of the power grid, providing a physical basis for the generation of the subsequent dynamic topology mask matrix.

[0027] Furthermore, a dynamic topology mask matrix is ​​generated based on the dynamic node admittance matrix. The dynamic topology mask matrix is ​​a square matrix with the same dimension as the dynamic node admittance matrix, and its dimension is equal to the total number of nodes in the power grid. Each element in the matrix is ​​used to represent the real-time electrical connection state between two corresponding nodes, serving as a hard constraint on physical connectivity in the subsequent neural network attention mechanism.

[0028] In the step of generating the dynamic topology mask matrix, for any off-diagonal element in the dynamic topology mask matrix, let its row index be i and its column index be j, corresponding to the connection state between node i and node j. When there is a direct electrical physical connection between node i and node j and the corresponding branch is in a closed state, the value of this off-diagonal element is set to a positive number associated with the mutual admittance between the two corresponding nodes. Specifically, it can be set to the absolute value of the mutual admittance, or set to 1. For example, if there is a closed branch between node i and node j, its mutual admittance is y. ij Then the element M in the i-th row and j-th column of the mask matrix ij Set to |y ij | or 1. When there is no direct electrical connection between node i and node j, or the corresponding branch is in an open state, the value of the off-diagonal element is set to zero. For diagonal elements, that is, elements whose row index equals column index, they are uniformly set to 1, indicating that the node's own characteristic information is always retained.

[0029] The generation process of the dynamic topological mask matrix can be formally represented as: M ij =|Y ij |If there is a closed branch between node i and node j, otherwise M ij =0; M ii =1. Where Y ij M represents the mutual admittance elements in the dynamic node admittance matrix. Taking a three-node system as an example, assuming there is a closed branch between node 1 and node 2, an open branch between node 2 and node 3, and no direct connection between node 1 and node 3, the generated dynamic topology mask matrix is ​​a 3×3 square matrix, where M... 11 =1,M 22 =1,M 33 =1,M 12 and M 21 Set as |Y 12 |,M 13 M 31 M 23 M 32 All are 0.

[0030] This dynamic topology mask matrix will be used in the subsequent neural network attention mechanism. Through matrix addition, it is superimposed on the attention weight calculation process, forcing the attention weights between physically non-adjacent nodes to zero, ensuring that the information propagation path remains consistent with the underlying electrical connectivity of the power grid. Specifically, through these steps, the model can perceive and adapt to dynamic changes in the power grid topology in real time, effectively overcoming the problem that static graph structures cannot track transient changes in network connectivity during cascading failures.

[0031] S20: Construct an initial prediction network based on the physical mechanism of the power system and the fusion of deep neural networks, train the initial prediction network by combining the physical-data dual-drive loss function, and generate a cascaded failure prediction plug-in. Furthermore, an initial prediction network is constructed based on the fusion of power system physical mechanisms and deep neural networks. Power system physical mechanisms refer to the physical equations describing the operating laws of the power grid, including Kirchhoff's current law, Kirchhoff's voltage law, and AC power flow equations.

[0032] Kirchhoff's Current Law states that the sum of the currents flowing into any node equals the sum of the currents flowing out of that node, while Kirchhoff's Voltage Law states that the sum of voltage drops in any closed loop is zero. The AC power flow equations describe the nonlinear relationship between node voltage, phase angle, and injected power. Deep neural networks employ the Transformer architecture, using a self-attention mechanism to capture the complex nonlinear coupling relationships between multi-source heterogeneous data. Integrating physical mechanisms with neural networks means embedding these physical equations as constraints into the network structure or loss function during the design and training of the neural network, ensuring that the network output not only fits the statistical laws of the data but also satisfies the objective physical constraints of the power system.

[0033] Specifically, an initial prediction network is constructed based on the fusion of power system physical mechanisms and deep neural networks, including: The Transformer network is used as the basic network architecture. A dynamic topology masking mechanism constrained by a real-time physical admittance matrix is ​​designed, and the dynamic topology masking matrix is ​​embedded in the attention mechanism of the Transformer network to ensure that the attention information propagation path of the initial prediction network is consistent with the underlying electrical connectivity of the inter-regional power grid.

[0034] First, the Transformer network is adopted as the basic network architecture. The Transformer network is a deep learning model based on a self-attention mechanism, with its core components being a multi-head attention layer and a feedforward neural network layer. In the task of predicting cascaded failures in power grids, the Transformer network can capture long-distance dependencies and complex nonlinear coupling characteristics between multi-source heterogeneous data. Specifically, this Transformer network has the advantages of strong parallel computing capabilities and the ability to directly model the dependencies between any two positions in a sequence, making it suitable for handling complex spatiotemporal correlations between sources, grids, and loads in inter-regional power grids.

[0035] Secondly, a dynamic topology masking mechanism constrained by the real-time physical admittance matrix is ​​designed, and the dynamic topology masking matrix is ​​embedded in the attention mechanism of the Transformer network to ensure that the attention information propagation path of the initial prediction network is consistent with the underlying electrical connectivity of the cross-regional power grid.

[0036] Specifically, the attention mechanism of the standard Transformer network adopts a fully connected structure, allowing information interaction between any two positions in the sequence; that is, the attention weight of each node can be assigned to all other nodes. However, in the scenario of power grid cascade failure prediction, this fully connected structure is fundamentally in conflict with the objective physical characteristics of the power system. The propagation of electrical quantities in the power system is strictly constrained by the physical topology. Only adjacent nodes with direct electrical connections and closed branches have direct electrical coupling relationships, while the electrical influence between non-adjacent nodes must be transmitted step by step through intermediate nodes, and there is no direct cross-node information interaction. If the standard attention mechanism is directly applied to power grid cascade failure prediction, it will lead to irrational direct information associations between physically non-adjacent nodes, causing the model to learn false characteristics that violate the actual operating rules of the power grid, reducing the physical credibility of the prediction results. Therefore, it is necessary to introduce the physical connectivity of the power grid as a hard constraint into the attention mechanism to ensure that the information propagation path is consistent with the underlying electrical topology.

[0037] The dynamic topology masking mechanism is implemented as follows: In the multi-head attention layer of the Transformer network, the dot product of the query matrix and the key matrix, after scaling, is added to the dynamic topology mask matrix. The dynamic topology mask matrix is ​​a square matrix obtained by transforming the real-time node admittance matrix generated in step S10, and its dimension is equal to the total number of nodes in the power grid. For node pairs with direct electrical connections and closed branches, the value at the corresponding position in the mask matrix is ​​set to 0; for node pairs without direct electrical connections or with open branches, the value at the corresponding position in the mask matrix is ​​set to a very large negative number, such as -1e9. The mask matrix is ​​added to the scaled dot product result and then input into the Softmax function for normalization. For positions with extremely negative mask values, the exponential function value approaches zero, making the attention weight of the corresponding node approach zero, thereby forcibly cutting off the information propagation path between physically disconnected nodes; for positions with a mask value of 0, the attention weight is calculated normally.

[0038] Through the aforementioned dynamic topology masking mechanism, the attention information propagation path of the Transformer network remains strictly consistent with the real-time electrical connectivity of the power grid. When a circuit breaker trips during a cascading failure, causing a topology change, the dynamic node admittance matrix is ​​updated accordingly, and the mask matrix changes synchronously. The attention mechanism automatically masks the information interaction between the nodes at both ends of the newly opened branch. Specifically, this mechanism enables the neural network to perceive and adapt to dynamic changes in the power grid topology in real time, overcoming the shortcomings of traditional graph neural networks that rely on static graph structures and cannot track transient changes in network connectivity, thereby improving the physical consistency and topology adaptability of cascading failure inference.

[0039] Furthermore, the initial prediction network is trained using a physics-data dual-drive loss function. This function is a combined loss function that includes a data fitting term and a physical constraint term. The data fitting term measures the difference between the network's predicted output and the actual observed samples, ensuring the network can learn the statistical relationships between electrical quantities from historical data. The physical constraint term includes an AC power flow physical residual penalty term and an inter-regional tie-line boundary condition constraint term. The former penalizes the degree to which the network's predicted voltage magnitude and phase angle violate Kirchhoff's laws and power flow equations, while the latter penalizes the mismatch between the network's deduced equivalent power at the receiving-end grid root node and the actual injected power from the upstream transmission network.

[0040] By minimizing this combined loss function, the initial prediction network is guided by both data-driven and physical mechanisms during training, ensuring both prediction accuracy and the physical plausibility of the prediction results.

[0041] Specifically, the initial prediction network is trained using a physics-data dual-driven loss function to generate a cascaded failure prediction plugin, including: Construct a data fitting loss term, which is used to measure the difference between the probability density distribution of the prediction output of the initial prediction network and the actual observed samples; An AC power flow physical residual penalty term is constructed, which is based on Kirchhoff's current law and is used to penalize the deviation of the voltage amplitude and phase angle of the initial prediction network's predicted output from violating the AC power flow equation. The weight coefficient of the AC power flow physical residual penalty term is a dynamically adjusted weight, which is adaptively updated in each backpropagation iteration based on the ratio of the gradient norm of the data fitting loss term to the gradient norm of the physical residual loss term. A boundary condition constraint term for inter-regional interconnection is constructed, which is used to penalize the mismatch between the equivalent power of the root node of the receiving-end power grid in the initial prediction network deduction and the actual injected power of the upstream transmission network. The data fitting loss term, the AC power flow physical residual penalty term, and the cross-regional tie line boundary condition constraint term are respectively configured with corresponding weight coefficients, and the three weighted terms are added together to obtain the physical-data dual-drive loss function. During each backpropagation iteration of the initial prediction network, the gradient of the physical-data dual-driven loss function with respect to the network parameters is calculated, and the network parameters are updated according to the gradient until the network converges, generating a cascaded failure prediction plugin.

[0042] First, a data fitting loss term is constructed. This term measures the difference between the probability density distribution of the initial prediction network's output and the actual observed samples. Since the network output is presented in Gaussian parameterized form, containing a predicted mean vector and a predicted variance vector, the data fitting loss term can use the negative log-likelihood loss function. For each predicted sample, the negative log-likelihood loss equals the logarithm of the predicted variance plus the square of the difference between the predicted and actual values ​​divided by the predicted variance, multiplied by half. This data fitting loss term ensures that the initial prediction network can learn the statistical relationships between electrical quantities from historical data, making the predicted mean as close as possible to the actual observed values, while reasonably estimating the uncertainty of the prediction.

[0043] Secondly, an AC power flow physical residual penalty term is constructed. This term, based on Kirchhoff's current law, penalizes deviations in the voltage magnitude and phase angle of the initial prediction network output that violate the AC power flow equations. Specifically, for each unbalanced node in the power grid, based on the network-predicted voltage magnitude and phase angle of that node and those of adjacent nodes, and combining the conductance and susceptance elements in the dynamic node admittance matrix, the theoretical active power injection and theoretical reactive power injection of that node are calculated. These are then compared with the actual net active power injection and net reactive power injection of that node to calculate the squares of the active and reactive power imbalances. The summation and averaging of the active and reactive power imbalances of all unbalanced nodes yields the AC power flow physical residual penalty term. This term forces the voltage distribution output by the initial prediction network to satisfy Kirchhoff's laws, ensuring the prediction results are physically reasonable.

[0044] Specifically, the steps for constructing the physical residual penalty term for AC power flow include: Identify all unbalanced nodes in the inter-regional power grid to form a set of unbalanced nodes; For each unbalanced node in the set of unbalanced nodes, based on the voltage amplitude and phase angle of the unbalanced node predicted by the initial prediction network, as well as the voltage amplitude and phase angle of each neighboring node directly connected to the unbalanced node, and combined with the conductance and susceptance elements in the dynamic node admittance matrix, the theoretical active power injection and theoretical reactive power injection of the unbalanced node are calculated. Calculate the square of the active power imbalance between the theoretical active power injection power and the actual net active power injection power at the unbalanced node, and calculate the square of the reactive power imbalance between the theoretical reactive power injection power and the actual net reactive power injection power at the unbalanced node. The average of the squares of the active power imbalance and the squares of the reactive power imbalance of all unbalanced nodes in the set of unbalanced nodes is used to obtain the AC power flow physical residual penalty term.

[0045] First, all unbalanced nodes in the inter-regional power grid are identified, forming the unbalanced node set. In power system flow calculations, nodes are functionally classified into slack nodes, PV nodes, and PQ nodes. Slack nodes are used to balance the power of the entire network, and their voltage amplitude and phase angle are known; the active power and voltage amplitude of PV nodes are known quantities; the active power and reactive power of PQ nodes are known quantities. Unbalanced nodes refer to all nodes other than slack nodes, i.e., PV nodes and PQ nodes. The voltage amplitude and phase angle of unbalanced nodes are predicted by the network and need to be verified through physical constraints. The size of the unbalanced node set is equal to the total number of nodes in the power grid minus one.

[0046] Secondly, for each unbalanced node in the set of unbalanced nodes, based on the voltage amplitude and phase angle of the unbalanced node predicted by the initial prediction network, as well as the voltage amplitude and phase angle of each neighboring node directly connected to the unbalanced node, and combined with the conductance and susceptance elements in the dynamic node admittance matrix, the theoretical active power injection and theoretical reactive power injection of the unbalanced node are calculated.

[0047] Specifically, for the unbalanced node i, let its predicted voltage amplitude be V. i The predicted phase angle is δ i The predicted voltage amplitude of its directly connected neighbor node j is V. j The predicted phase angle is δ j The voltage phase angle difference between node i and node j is θ. ij =δ i -δ j In the dynamic nodal admittance matrix, the conductance between node i and node j is G. ij The susceptance is B ij According to the AC power flow equation, the theoretical active power injection P at node i is... ic equals V i Multiply by all neighboring nodes V j Multiply by (G) ij Multiply by cosθ ij Add B ij Multiply by sinθ ij The summation of ) ; the theoretical reactive power injection Q at node i. ic equals V i Multiply by all neighboring nodes V j Multiply by (G) ij Multiply by sinθ ij Subtract B ij Multiply by cosθ ij Summation of 1 / 2.

[0048] Furthermore, the square of the active power imbalance between the theoretical active power injection power and the actual net active power injection power of the unbalanced node is calculated, and the square of the reactive power imbalance between the theoretical reactive power injection power and the actual net reactive power injection power of the unbalanced node is also calculated.

[0049] Specifically, the actual net active power injection P ia It is the difference between the active power output of the generator connected to node i and the active power of the load, obtained from multi-source operating data; the actual net reactive power injection Q. ia Similarly, the active power imbalance ΔP i equals P ic Subtract P ia Reactive power imbalance ΔQ i equals Q ic Subtract Q ia Calculate ΔP respectively. i The sum of squares of ΔQ i The square of.

[0050] Furthermore, the average of the squares of the active power imbalance and the squares of the reactive power imbalance of all unbalanced nodes in the unbalanced node set is summed to obtain the AC power flow physical residual penalty term. The specific calculation formula is: the AC power flow physical residual penalty term equals the sum of the squares of ΔPi and ΔQi of all unbalanced nodes divided by the number of unbalanced nodes. The smaller the value of this AC power flow physical residual penalty term, the more the voltage distribution predicted by the network satisfies Kirchhoff's current law and the power flow equations, and the higher the physical consistency of the prediction results; the larger the value of this AC power flow physical residual penalty term, the more severely the voltage distribution predicted by the network violates physical laws, requiring a penalty to be imposed through the loss function during training to guide the network parameters towards optimization in a direction that satisfies physical constraints.

[0051] By constructing the aforementioned physical residual penalty term for power flow, the underlying physical laws of the power system can be explicitly embedded into the training process of the neural network, enabling the model to still output deduction results that conform to physical theory even under extreme operating conditions where fault samples are missing.

[0052] Furthermore, a boundary condition constraint term for the inter-regional tie line is constructed. This term penalizes the mismatch between the equivalent power of the root node of the receiving-end grid in the initial prediction network and the actual injected power from the upstream transmission network. Specifically, the receiving-end grid is highly dependent on power from other regions, and the power injected into the receiving-end grid by the upstream transmission network is a known boundary condition. Based on the voltage magnitude and phase angle of the boundary nodes predicted by the network, combined with the dynamic node admittance matrix, the equivalent injected power of the boundary nodes is calculated in reverse, and the square of the difference between this equivalent injected power and the actual injected power is calculated. The average of this square value for all boundary nodes yields the boundary condition constraint term for the inter-regional tie line. This term ensures that inter-regional power transfer satisfies energy conservation, matching the receiving-end grid state in the initial prediction network with the power supply capacity of the upstream grid.

[0053] Specifically, the steps for constructing the boundary condition constraints for cross-regional connecting lines include: Identify the boundary nodes of the tie lines used to connect the sending-end grid and the receiving-end grid in the inter-regional power grid, forming a boundary node set. For each boundary node in the boundary node set, obtain the actual active power injected into the boundary node by the upstream transmission network. Based on the voltage amplitude and phase angle of the boundary nodes predicted by the initial prediction network, and combined with the conductance and susceptance elements in the dynamic node admittance matrix, the equivalent injected power of the boundary nodes is calculated in reverse. The square of the difference between the actual active power and the equivalent injected power of the boundary nodes is calculated. The squares of the differences of all boundary nodes in the set of boundary nodes are summed and averaged to obtain the boundary condition constraint terms of the cross-regional tie line.

[0054] First, the boundary nodes of the tie lines connecting the sending and receiving power grids in the inter-regional power grid are identified, forming a boundary node set. In the inter-regional power grid structure, the sending power grid transmits power to the receiving power grid through several tie lines, and the connection points between the tie lines and the receiving power grid are the boundary nodes. Boundary nodes are the power exchange interface between the sending and receiving power grids, and their power injection is determined by the operating status of the upstream transmission network. The size of the boundary node set is equal to the number of tie lines. Simultaneously, for each boundary node, the actual active power injected into that node by the upstream transmission network is obtained from multi-source operational data. This actual active power reflects the actual power supply capacity of the sending power grid to the receiving power grid.

[0055] Secondly, for each boundary node in the set of boundary nodes, based on the voltage magnitude and phase angle of the boundary node predicted by the initial prediction network, and combined with the conductance and susceptance elements in the dynamic node admittance matrix, the equivalent injected power of the boundary node is calculated in reverse.

[0056] Specifically, let the predicted voltage amplitude of boundary node k be V. kThe predicted phase angle is δ k The predicted voltage amplitude of its directly connected receiving-end power grid neighbor node j is V. j The predicted phase angle is δ j The voltage phase angle difference is θ kj =δ k -δ j Based on the AC power flow equations, the equivalent active power injection P at boundary node k, calculated from the receiving-end grid side, is... kc equals V k Multiply by V of all neighboring nodes j j Multiply by (G) kj Multiply by cosθ kj Add B kj Multiply by sinθ kj The summation of ) . This equivalent injected power represents the active power that the boundary nodes need to absorb from the sending-end grid in order to maintain the predicted voltage distribution within the receiving-end grid.

[0057] Subsequently, the square of the difference between the actual active power and the equivalent injected power at the boundary nodes is calculated. Actual active power P ka This is the actual power injected into the boundary nodes from the upstream transmission network, obtained from operational data. The difference ΔP k equals P kc Subtract P ka The square of the value reflects the degree of mismatch between the network-predicted internal state of the receiving-end grid and the actual injected power from the upstream grid. When the network-predicted voltage distribution is accurate, the equivalent injected power should be close to the actual injected power, and the square of the difference should approach zero; when the network prediction is flawed, there is a large difference between the equivalent injected power and the actual injected power, and the square of the difference increases.

[0058] Then, the average of the squared differences between all boundary nodes in the boundary node set is summed to obtain the boundary condition constraint term for the cross-regional connecting line. The specific calculation formula is: the boundary condition constraint term for the cross-regional connecting line equals the sum of the squared differences between all boundary nodes (ΔP). k The sum of the squares of the boundary nodes divided by the number of boundary nodes.

[0059] The inter-regional tie-line boundary condition constraint term penalizes the mismatch between the equivalent power of the root node of the receiving-end grid in the network simulation and the actual injected power of the upstream transmission network, ensuring that inter-regional power transfer satisfies energy conservation. Through this constraint term, the neural network is guided during training to output a receiving-end grid voltage distribution that matches the power supply capacity of the upstream grid, avoiding physical contradictions where the voltage distribution within the receiving-end grid is reasonable but the required injected power far exceeds the actual power supply capacity of the upstream grid. Simultaneously, this constraint term also implicitly constrains the amplitude and phase angle of the node voltages within the receiving-end grid, ensuring consistency with the boundary conditions, thereby improving the physical consistency and accuracy of the entire inter-regional grid cascade failure simulation.

[0060] Finally, corresponding weight coefficients are assigned to the data fitting loss term, the AC power flow physical residual penalty term, and the inter-regional tie line boundary condition constraint term, respectively. The three weighted terms are then summed to obtain the physical-data dual-driven loss function. The initial weight coefficients can be set according to the magnitude of each loss term; for example, the weight of the data fitting loss term is 1.0, the weight of the AC power flow physical residual penalty term is 0.1, and the weight of the inter-regional tie line boundary condition constraint term is 0.05.

[0061] The weight coefficient of the physical residual penalty term in the AC power flow calculation is a dynamically adjusted weight. This dynamically adjusted weight is adaptively updated during each backpropagation iteration based on the ratio of the gradient norm of the data fitting loss term to the gradient norm of the physical residual loss term. Specifically, the gradient norms of the data fitting loss term and the physical residual loss term relative to the network parameters are calculated. When the gradient norm of the physical residual loss term is relatively small compared to the gradient norm of the data fitting loss term, it indicates that the physical constraints are not contributing sufficiently to the network parameter updates, and the network may be ignoring physical laws. In this case, the dynamically adjusted weight is increased to enhance the influence of the physical constraints. When the gradient norm of the physical residual loss term is relatively large compared to the gradient norm of the data fitting loss term, it indicates that the physical constraints may be dominating the parameter updates, leading to insufficient data fitting. In this case, the dynamically adjusted weight is decreased to balance the relationship between data-driven and physical constraints. The update rule for the dynamically adjusted weight can be expressed as the new weight equal to the original weight multiplied by the ratio of the two gradient norms, or an exponential moving average can be used for smooth updates.

[0062] Specifically, during each backpropagation iteration of the initial prediction network, the gradient of the physics-data dual-driven loss function with respect to the network parameters is calculated, and the network parameters are updated according to the gradient until the network converges, generating the cascaded failure prediction plugin. Through the above dynamic weight adjustment mechanism, the initial prediction network can adaptively balance the trade-off between data fitting and physical constraints throughout the entire training cycle, avoiding local minima or physical constraint failure caused by fixed weights, and ensuring that the finally generated cascaded failure prediction plugin has both high-precision data fitting capabilities and meets the objective physical laws of the power system.

[0063] The final cascading failure prediction plugin is a trained deep neural network model capable of mapping multimodal input features to a continuous state probability density distribution of key nodes in a cross-regional power grid. This plugin integrates a dynamic topology masking mechanism, which adaptively adjusts the propagation path of attention weights based on the real-time admittance matrix, ensuring that information flow is transmitted only between nodes with consistent physical connectivity to the power grid. Specifically, this plugin enables real-time, physically consistent probabilistic extrapolation of cascading failure risks, providing a foundation for subsequent vulnerability assessment and early warning.

[0064] S30: Input the integrated multimodal feature tensor and dynamic topology mask matrix into the cascaded failure prediction plugin, output the continuous state probability density distribution of key nodes in the cross-regional power grid, extract vulnerability state values ​​from the continuous state probability density distribution, and construct extreme risk thresholds. Furthermore, the integrated multimodal feature tensor and the dynamic topology mask matrix generated in the aforementioned steps are jointly input into the trained cascaded failure prediction plugin. During the model's forward propagation, the integrated multimodal feature tensor serves as the input feature, and the dynamic topology mask matrix is ​​superimposed onto the dot product of the query matrix and key matrix of the Transformer attention mechanism through matrix addition. This ensures that the calculation of attention weights is performed only between node pairs that are physically connected to the power grid; the attention weights between physically non-adjacent nodes are forcibly set to zero.

[0065] The cascaded failure prediction plugin can output the continuous state probability density distribution of key nodes in inter-regional power grids. Key nodes refer to nodes in the inter-regional power grid that have a significant impact on system stability, including voltage-weak nodes, power transmission critical nodes, and tie-line boundary nodes. Continuous state refers to continuously changing electrical quantities such as node voltage amplitude, voltage phase angle, branch active power flow, and branch reactive power flow. The probability density distribution is output in Gaussian parameterized form, with each key node corresponding to a prediction mean and a prediction variance at each prediction time step. The prediction mean characterizes the central predicted value of the electrical quantity, and the prediction variance characterizes the uncertainty confidence interval of the prediction result.

[0066] Furthermore, vulnerability state values ​​are extracted from the continuous state probability density distribution. These vulnerability state values ​​characterize the degree of voltage over-limit risk or power flow overload risk of critical nodes at the prediction time. Specifically, the larger the vulnerability state value, the higher the risk of voltage over-limit or power flow overload at the prediction time, and the greater the likelihood of node instability. By extracting these vulnerability state values, the continuous state probability density distribution can be transformed into a single risk quantification indicator, facilitating subsequent threshold comparisons and early warning triggering.

[0067] Specifically, the integrated multimodal feature tensor and dynamic topology mask matrix are input into the cascaded failure prediction plugin, which outputs the continuous state probability density distribution of key nodes in the inter-regional power grid. Vulnerability state values ​​are extracted from the continuous state probability density distribution, including: The integrated multimodal feature tensor and the dynamic topology mask matrix are input together into the cascaded failure prediction plugin. The cascaded failure prediction plugin extracts spatiotemporal features from the integrated multimodal feature tensor through an attention mechanism. During the calculation of attention weights, the dynamic topology mask matrix is ​​superimposed on the dot product of the query matrix and the key matrix through matrix addition. The superimposed result is then input into the normalized exponential function for activation calculation, so as to force the attention weights between physically non-adjacent nodes to be set to zero. The cascaded failure prediction plugin outputs the probability density distribution parameters of the predicted electrical quantities of key nodes in the inter-regional power grid. The probability density distribution parameters of the predicted electrical quantities include a prediction mean vector and a prediction variance vector. The prediction mean vector is used to characterize the predicted center value of the electrical quantity, and the prediction variance vector is used to characterize the uncertainty confidence interval of the prediction result. The vulnerability state value of each critical node is extracted from the probability density distribution parameters of the electrical quantity prediction values. The vulnerability state value is used to characterize the degree of voltage over-limit risk or power flow overload risk of the critical node at the prediction time.

[0068] First, the integrated multimodal feature tensor and the dynamic topology mask matrix are input into the cascaded failure prediction plugin. The cascaded failure prediction plugin is a deep prediction model built on a physical information neural network, with the Transformer network architecture at its core. The integrated multimodal feature tensor, as the input feature, contains multi-source information including electrical quantities, meteorological quantities, and load quantities; the dynamic topology mask matrix serves as a physical constraint, used to limit the information propagation range of the attention mechanism.

[0069] The cascaded failure prediction plugin extracts spatiotemporal features from a comprehensive multimodal feature tensor using an attention mechanism. Specifically, in calculating the attention weights, the input feature tensor is first mapped to a query matrix, key matrix, and value matrix through a linear transformation. The dot product of the query matrix and key matrix is ​​calculated to obtain the original attention score matrix. The dot product result is then scaled by dividing by the square root of the key matrix dimension. Subsequently, a dynamic topology mask matrix is ​​superimposed onto the scaled dot product result using matrix addition. In the dynamic topology mask matrix, for node pairs with direct electrical connections and closed branches, the mask value is 0, and the addition result remains unchanged. For node pairs without direct electrical connections or with open branches, the mask value is a very large negative number, and the addition result becomes a very large negative number. Finally, the superimposed result is input into a normalized exponential function for activation calculation. For positions with very large negative mask values, the exponential function value approaches zero, forcing the corresponding attention weight to zero; for positions with a mask value of 0, the attention weight is calculated normally. Through the above operations, the attention weight between physically non-adjacent nodes is forced to be set to zero, ensuring that the information propagation path is consistent with the electrical connectivity of the underlying power grid.

[0070] The cascaded failure prediction plugin outputs the probability density distribution parameters of the predicted electrical quantities at key nodes in the inter-regional power grid. Specifically, the predicted electrical quantities include node voltage amplitude, node voltage phase angle, branch active power flow, and branch reactive power flow. The probability density distribution parameters are output in Gaussian distribution form, with each key node corresponding to a prediction mean and a prediction variance at each prediction time step. The prediction mean vector is used to characterize the predicted central value of the electrical quantity, i.e., the most likely estimate of that electrical quantity by the model; the prediction variance vector is used to characterize the uncertainty confidence interval of the prediction result. The larger the variance, the more uncertain the model is about the value of the electrical quantity at that prediction time, and the greater the possibility that the actual value deviates from the predicted mean.

[0071] Finally, the vulnerability state value of each critical node is extracted from the probability density distribution parameters of the electrical quantity predictions. This vulnerability state value is used to characterize the degree of voltage over-limit risk or power flow overload risk of the critical node at the prediction time.

[0072] Specifically, for voltage amplitude, based on the predicted mean and variance, assuming the voltage amplitude follows a normal distribution, the probability of the voltage amplitude exceeding the upper limit threshold or falling below the lower limit threshold for safe operation is calculated, and this probability value is used as the vulnerability state value. For example, if the upper limit threshold is 1.05 per unit, the predicted mean is 1.03, and the predicted standard deviation is 0.02, then the probability of the voltage exceeding 1.05 can be calculated. The higher the voltage limit, the higher the probability and the larger the vulnerability state value, indicating a higher risk of voltage instability at that node. For branch power flow, the probability of the active power flow exceeding the thermal stability limit is calculated, and this probability value is also used as the vulnerability state value.

[0073] By extracting vulnerability state values, the probability density distribution can be transformed into a single quantitative risk indicator, which facilitates subsequent comparison with extreme risk thresholds and early warning triggering.

[0074] Furthermore, an extreme risk threshold is constructed. This extreme risk threshold is a critical value used to determine whether the vulnerability state value has reached a dangerous level. This step uses extreme value theory to construct an extreme risk threshold that dynamically floats with the real-time operating conditions of the power grid. This overcomes the shortcomings of traditional fixed thresholds, which are difficult to accurately capture tail-end extreme risks under high-proportion renewable energy access and cross-regional power flow fluctuations. This enables adaptive and accurate early warning of cascading failure risks, avoiding frequent false alarms due to overly strict thresholds or missed catastrophic cascading failures due to overly broad thresholds.

[0075] Specifically, extreme risk thresholds are constructed, including: Extract a continuous vulnerability index sequence from the continuous state probability density distribution, and set an initial basic high threshold for the current moment based on the sliding mean and sliding standard deviation of the continuous vulnerability index sequence within the current sliding time window. Extract all samples that exceed the initial baseline high threshold from the continuous vulnerability index sequence, and calculate the overshoot of each sample relative to the initial baseline high threshold to form an overshoot sequence. The tail features of the overshoot sequence are fitted with a generalized Pareto distribution, and the shape and scale parameters of the generalized Pareto distribution are updated online. At a given confidence level, a dynamic extreme risk threshold is derived in reverse based on the initial basic high threshold, the shape and scale parameters after online rolling updates, the total number of samples in the continuous vulnerability index sequence, and the number of samples in the overshoot sequence. This dynamic extreme risk threshold is then used as the extreme risk threshold.

[0076] First, a continuous vulnerability index sequence is extracted from the continuous state probability density distribution. The continuous vulnerability index sequence refers to a sequence of vulnerability state values ​​arranged in chronological order, with each vulnerability state value corresponding to a prediction time step, reflecting the risk level of critical nodes in the power grid at that moment.

[0077] Secondly, based on the moving mean and moving standard deviation of the continuous vulnerability index sequence within the current sliding time window, an initial baseline high threshold is set for the current moment. The sliding time window refers to a historical data window used to calculate the moving mean and moving standard deviation; its length can be set according to the rate of change of the power grid's operating characteristics, for example, 100 time steps. This sliding time window scrolls forward with the current moment, incorporating the most recent vulnerability state values ​​and removing the oldest, ensuring that the window always contains risk data from the most recent period.

[0078] Specifically, the initial baseline high threshold is calculated as: the moving average plus a multiple multiplied by the moving standard deviation, where the multiple can be set according to the business's sensitivity to risk, for example, 3. This initial baseline high threshold changes gradually as the sliding window moves, reflecting the normal risk fluctuation range under recent operating conditions.

[0079] Furthermore, all samples exceeding the initial baseline high threshold are extracted from the continuous vulnerability index sequence, and the overshoot of each exceeding sample relative to the initial baseline high threshold is calculated to form an overshoot sequence. The overshoot equals the vulnerability state value of the exceeding sample minus the initial baseline high threshold, reflecting the magnitude of the risk exceeding the threshold. The overshoot sequence only includes extreme event samples exceeding the baseline threshold, excluding samples within the normal fluctuation range, for use in tail modeling in subsequent extreme value analysis.

[0080] Furthermore, a generalized Pareto distribution is used to fit the probability density of the tail features of the overshoot sequence, and the shape and scale parameters of the generalized Pareto distribution are updated online. The generalized Pareto distribution is a probability distribution model in extreme value theory used to describe the distribution of overshoot exceeding a certain high threshold. Its cumulative distribution function is determined by the shape and scale parameters. The shape parameter controls the thickness of the distribution tail; the larger the shape parameter, the higher the probability of extreme events occurring. The scale parameter controls the magnitude range of the overshoot. For example, the initial value of the shape parameter k can be set to 0.1, and the initial value of the scale parameter σ can be set to the sample standard deviation of the overshoot sequence.

[0081] Specifically, the maximum likelihood estimation method is used to estimate the shape and scale parameters based on the overshoot sequence within the current sliding time window. The basic principle of the maximum likelihood estimation method is to find a set of parameter values ​​that maximizes the probability of observing the sample under the current overshoot sample.

[0082] Let the overshoot sequence be z1, z2, ..., z m There are m samples in total. The probability density function of the generalized Pareto distribution is: when the shape parameter k is not equal to 0, F(z) = 1 - (1 + kz / σ)^ -1 / k When the shape parameter k equals 0, F(z) = 1 - e^(-k / k). -z / σ Where z is the overshoot, k is the shape parameter, and σ is the scale parameter, and z ≥ 0, z is any non-negative number when k ≥ 0, and 0 ≤ z ≤ -σ / k when k < 0. The corresponding probability density function is: when k is not equal to 0, f(z) = (1 / σ) × (1 + kz / σ)^ -(1 / k+1) When k equals 0, f(z) = (1 / σ) × e^(-k / k) -z / σThe likelihood function L is equal to the product of the probability density functions of all samples, i.e., L = f(z1) × f(z2) × ... × f(z... m Taking the natural logarithm of the likelihood function, we obtain the log-likelihood function l = lnL = Σlnf(z). i ).

[0083] Taking the partial derivatives of the shape parameter k and the scale parameter σ with respect to each, and setting the partial derivatives to zero, yields a system of likelihood equations. Since this system of equations has no analytical solution, a numerical optimization algorithm, such as the Newton-Raphson method or the BFGS algorithm, is used to iteratively solve for the maximum likelihood estimates of the shape parameter k and the scale parameter σ. Taking the Newton-Raphson method as an example, given initial parameter values, the first-order derivative vector and the second-order derivative matrix of the log-likelihood function are calculated. The updated parameter estimate is the current estimate minus the inverse of the second-order derivative matrix multiplied by the first-order derivative vector. This iteration is repeated until the parameter change is less than a preset convergence threshold. The preset convergence threshold is set based on the accuracy requirements of the parameter estimation and computational efficiency; for example, it can be set to 1e-6, meaning that when the absolute value of the parameter change between two consecutive iterations is less than 0.000001, the iteration is considered converged, and the update stops. Through the above estimation, the shape and scale parameters of the generalized Pareto distribution followed by the overshoot sequence within the current sliding time window are obtained, which are used for subsequent calculation of the dynamic extreme risk threshold.

[0084] Furthermore, at each time step or each scheduling cycle, the maximum likelihood estimation described above is re-executed based on the overshoot sequence within the current sliding time window to obtain updated shape and scale parameters. The specific process of online rolling updates is as follows: when a new vulnerability state value arrives, the sliding time window is updated, the new overshoot is included in the sequence, and old overshoots that exceed the window range are removed; the shape and scale parameters are re-estimated based on the updated overshoot sequence; and the estimation results are used to calculate the dynamic extreme risk threshold for the next time step.

[0085] Through online rolling updates, shape and scale parameters can respond in real time to dynamic changes in grid operating conditions. For example, when increased fluctuations in renewable energy output lead to more extreme events, shape parameters automatically increase, raising the threshold accordingly; when the system stabilizes, shape parameters decrease, lowering the threshold accordingly. This mechanism ensures that the extreme risk threshold always matches the tail risk characteristics of the current operating condition.

[0086] Finally, at a given confidence level, the dynamic extreme risk threshold is derived in reverse, based on the initial baseline high threshold, the shape and scale parameters updated online, the total number of samples in the continuous vulnerability index sequence, and the number of samples in the overshoot sequence. The confidence level can be set according to the business's stringent risk aversion requirements, for example, 99%. The formula for calculating the dynamic extreme risk threshold is: Where μ is the initial baseline high threshold, σ is the scale parameter, k is the shape parameter, N is the total number of samples in the continuous vulnerability index sequence, n is the number of samples in the overshoot sequence, and q is the confidence level. This formula, based on the overthreshold peak method in extreme value theory, constructs a statistically rigorous risk assessment boundary.

[0087] The calculated dynamic extreme risk threshold is used as the final extreme risk threshold. This extreme risk threshold can adaptively scale with fluctuations in new energy output and changes in cross-regional power flow. When system uncertainty increases, the threshold increases accordingly, and when the system tends to stabilize, the threshold decreases accordingly, avoiding the problem of frequent false alarms or missed alarms under strong random fluctuations caused by fixed thresholds.

[0088] S40: When the vulnerability status value exceeds the extreme risk threshold, a warning signal is triggered and a defense command is generated.

[0089] Finally, the vulnerability state values ​​extracted in the preceding steps are compared with the constructed extreme risk threshold. The vulnerability state values ​​reflect the degree of voltage over-limit risk or power flow overload risk of critical nodes at the prediction time, while the extreme risk threshold is a statistical risk boundary dynamically constructed based on extreme value theory.

[0090] When the vulnerability status value is less than or equal to the extreme risk threshold, the system is considered to be in a no-warning state, does not trigger a warning signal, and continues to monitor the vulnerability status value at the next moment. When the vulnerability status value is greater than the extreme risk threshold, the system is considered to be in a risk exceeding the limit state, and triggers a warning signal.

[0091] Specifically, when the vulnerability status value exceeds the extreme risk threshold, an early warning signal is triggered and a defense command is generated, including: When the vulnerability status value is less than or equal to the extreme risk threshold, it is determined to be a no-warning state and no warning signal is triggered; When the vulnerability status value is greater than the extreme risk threshold, an early warning signal is triggered. The level of the early warning signal is determined according to the degree to which the vulnerability status value exceeds the extreme risk threshold. The levels of the early warning signal include Level 1, Level 2, and Level 3, wherein Level 1 corresponds to the smallest degree of exceedance, and Level 3 corresponds to the largest degree of exceedance. When any level of early warning signal is triggered, the voltage over-limit probability or power flow overload probability is calculated based on the continuous state probability density distribution. The voltage over-limit probability or the power flow overload probability is input into the intelligent auxiliary decision-making module, which automatically generates a structured pre-disaster blocking plan as a defense instruction. The defense instruction is then sent to the corresponding field execution terminal to complete the pre-disaster proactive blocking.

[0092] Specifically, when the vulnerability status value is less than or equal to the extreme risk threshold, it is determined to be in a no-warning state, and no warning signal is triggered. At this time, the system risk is within an acceptable range, and no defensive measures are required. The cascading failure prediction plugin continues to monitor the vulnerability status value at the next moment.

[0093] Furthermore, an early warning signal is triggered when the vulnerability status value exceeds the extreme risk threshold. The level of the early warning signal is determined based on the degree to which the vulnerability status value exceeds the extreme risk threshold. The early warning signal levels include Level 1, Level 2, and Level 3. Level 1 corresponds to the smallest degree of exceedance, indicating that the risk has exceeded the normal range but is still within a controllable stage, requiring close monitoring; Level 2 corresponds to a moderate degree of exceedance, indicating a significantly increased risk, requiring contingency measures; and Level 3 corresponds to the largest degree of exceedance, indicating an extremely high risk, requiring immediate intervention.

[0094] The threshold for each level of exceedance can be set according to business needs. For example, when the exceedance level is greater than 0 and less than or equal to 0.1, it is a Level 1 warning; when it is greater than 0.1 and less than or equal to 0.3, it is a Level 2 warning; and when it is greater than 0.3, it is a Level 3 warning.

[0095] Specifically, when any level of early warning signal is triggered, the probability of voltage exceeding limits or power flow overload is calculated based on the continuous state probability density distribution. The probability of voltage exceeding limits is equal to the probability that the predicted voltage amplitude distribution exceeds the upper limit threshold or falls below the lower limit threshold for safe operation, and can be calculated using the cumulative distribution function. The probability of power flow overload is equal to the probability that the predicted active power flow distribution exceeds the thermal stability limit. These probability values ​​quantify the likelihood of risk occurrence and provide a quantitative basis for subsequent defense decisions.

[0096] Finally, the voltage over-limit probability or power flow overload probability is input into the intelligent auxiliary decision-making module, which automatically generates a structured pre-disaster disruption plan as a defense instruction. The intelligent auxiliary decision-making module is a decision support unit built on a rule base or optimization algorithm. Based on a preset defense rule base or a real-time optimization algorithm, this module matches corresponding control measures and generates a structured pre-disaster disruption plan according to the input risk type, warning level, and risk probability.

[0097] The defense rule base stores predefined combinations of control instructions for different risk scenarios, while the optimization algorithm dynamically calculates the optimal control strategy with the goal of minimizing risk impact or maximizing defense effectiveness. Through the intelligent decision-making auxiliary module, risk quantification results can be automatically converted into executable defense instructions, avoiding the delays and uncertainties of manual decision-making.

[0098] Preferably, the pre-disaster disruption plan includes at least one of the following control instructions: First, virtual power plant invocation commands are used to specify the reduction in active power output or the amount of reactive power support in a virtual power plant. When the risk of voltage exceeding limits is high, the virtual power plant is invoked to increase reactive power support and improve voltage stability; when the risk of power flow overload is high, the virtual power plant is invoked to reduce active power output and lower line load.

[0099] Second, flexible load shedding instructions are used to specify the priority and amount of interruptible load reduction. When the load-side risk is high, interruptible loads are reduced sequentially according to a pre-set priority order to lower electricity demand. The pre-set priority order is a ranking list based on a comprehensive assessment of the impact of interruptible loads on users' production and daily life, as well as the speed of interruption response. This priority order is set based on the compensation cost agreed in the load interruption agreement and the user's importance level. For example, non-critical industrial loads are set as the first priority, commercial air conditioning loads as the second priority, and residential loads as the third priority. Loads with less impact on users and lower compensation costs are reduced first, minimizing the impact on electricity consumption of important users and critical production activities.

[0100] Third, the reactive power compensation device operation command is used to specify the number of static var compensators or parallel capacitor banks to be engaged and the switching time. When the risk of voltage exceeding the limit is high, the reactive power compensation device is engaged to provide reactive power support and regulate the voltage to a safe range.

[0101] Fourth, energy storage system charging and discharging commands are used to specify the charging and discharging power and duration of the energy storage system. When risk prediction indicates that there may be a power shortage in the future, the energy storage system is instructed to discharge to replenish power; when there may be a power surplus, the energy storage system is instructed to charge to absorb power.

[0102] Fifth, network reconfiguration commands are used to specify the opening and closing sequence of tie switches to achieve fault isolation and load transfer. When a line is at risk of overload, some load is transferred to adjacent lines by opening and closing tie switches to achieve load balancing.

[0103] Finally, the generated defense commands are sent to the corresponding field execution terminals, including virtual power plant controllers, load control terminals, reactive power compensation device controllers, energy storage system controllers, and switch controllers. These field execution terminals then perform the appropriate actions to complete proactive pre-disaster prevention. In summary, through the aforementioned tiered early warning and intelligent decision-making mechanism, targeted prevention measures can be proactively taken before risks escalate into actual failures, reducing the probability and scope of cascading failures.

[0104] In summary, the embodiments of this application have at least the following technical effects: This invention first constructs a comprehensive multimodal feature tensor by collecting multi-source heterogeneous operational data from inter-regional power grids, and generates a dynamic topology mask matrix based on real-time physical connectivity, achieving unified representation of multi-source data and real-time perception of dynamic changes in power grid topology. Secondly, an initial prediction network is constructed based on the fusion of power system physical mechanisms and deep neural networks. This network is trained using a physics-data dual-driven loss function, explicitly embedding underlying physical laws such as Kirchhoff's laws and power flow equations into the neural network training process. This allows the model to output theoretically sound predictions even under extreme conditions with missing fault samples, improving the physical reliability and generalization ability of the predictions.

[0105] Furthermore, this invention outputs the continuous state probability density distribution of key nodes through a cascaded failure prediction plugin, extracts vulnerability state values, and constructs extreme risk thresholds, achieving a dynamically floating risk quantification boundary that fluctuates with the real-time operating conditions of the power grid. Finally, when the vulnerability state value exceeds the extreme risk threshold, an early warning signal is triggered and a defense command is generated, completing a closed-loop defense system from risk perception to proactive blocking. This invention solves the problems of insufficient physical interpretability, erroneous extrapolation under extreme conditions, inability to adapt to dynamic topology changes, and reliance on fixed thresholds in existing technologies.

[0106] Example 2, as Figure 2 As shown, based on the same inventive concept as the power grid cascade failure prevention method based on physical information neural networks provided in Embodiment 1, this embodiment of the invention also provides a power grid cascade failure prevention system based on physical information neural networks, including: The feature construction module 11 is used to collect multi-source heterogeneous operation data of cross-regional power grids to construct a comprehensive multimodal feature tensor, and generate a dynamic topology mask matrix based on the real-time physical connectivity of the cross-regional power grids. Dual-drive training module 12 is used to construct an initial prediction network based on the fusion of power system physical mechanism and deep neural network, and to train the initial prediction network by combining physical-data dual-drive loss function to generate cascaded failure prediction plug-in; The vulnerability assessment module 13 is used to input the integrated multimodal feature tensor and dynamic topology mask matrix into the cascaded failure prediction plug-in, output the continuous state probability density distribution of key nodes in the cross-regional power grid, extract vulnerability state values ​​from the continuous state probability density distribution, and construct extreme risk thresholds. The early warning module 14 is used to trigger an early warning signal and generate a defense command when the vulnerability status value exceeds the extreme risk threshold.

[0107] Specifically, the feature construction module 11 is used for: Specifically, a comprehensive multimodal feature tensor is constructed by collecting multi-source heterogeneous operation data from inter-regional power grids, and a dynamic topology mask matrix is ​​generated based on the real-time physical connectivity of the inter-regional power grids, including: The active and reactive power time series of the cross-regional sending-end connection line, the voltage amplitude and voltage phase angle of each monitoring node in the distribution network, the active and reactive power flow of each branch, the solar irradiance, temperature, humidity and wind speed meteorological elements in the receiving-end area, the real-time load power of charging stations in the area and the charging demand aggregation based on traffic flow prediction are collected as multi-source heterogeneous operation data. Multimodal feature extraction and spatiotemporal resolution unification processing are performed on the multi-source heterogeneous operating data, and the processed multi-class feature vectors are concatenated in the channel dimension to generate a comprehensive multimodal feature tensor. The initial node admittance matrix is ​​corrected in real time based on the branch connectivity state vector. The mutual admittance elements corresponding to the branches in the open state are set to zero, and the self-admittance elements of the nodes at both ends of the branches are updated accordingly to generate a dynamic node admittance matrix. A dynamic topology mask matrix is ​​generated based on the dynamic node admittance matrix. Each element in the dynamic topology mask matrix represents the real-time electrical connection state between two corresponding nodes. In the step of generating the dynamic topology mask matrix, for any off-diagonal element in the dynamic topology mask matrix, when there is a direct electrical physical connection between the two corresponding nodes and the corresponding branch is in a closed state, the value of the off-diagonal element is set to a positive number associated with the mutual admittance value between the two corresponding nodes; when there is no direct electrical physical connection between the two corresponding nodes or the corresponding branch is in an open state, the value of the off-diagonal element is set to zero.

[0108] The dual-drive training module 12 is specifically used for: First, an initial prediction network is constructed based on the fusion of the physical mechanisms of the power system and deep neural networks, including: The Transformer network is used as the basic network architecture. A dynamic topology masking mechanism constrained by a real-time physical admittance matrix is ​​designed, and the dynamic topology masking matrix is ​​embedded in the attention mechanism of the Transformer network to ensure that the attention information propagation path of the initial prediction network is consistent with the underlying electrical connectivity of the inter-regional power grid.

[0109] Furthermore, the initial prediction network is trained using a physics-data dual-driven loss function to generate a cascaded failure prediction plugin, including: Construct a data fitting loss term, which is used to measure the difference between the probability density distribution of the prediction output of the initial prediction network and the actual observed samples; An AC power flow physical residual penalty term is constructed, which is based on Kirchhoff's current law and is used to penalize the deviation of the voltage amplitude and phase angle of the initial prediction network's predicted output from violating the AC power flow equation. The weight coefficient of the AC power flow physical residual penalty term is a dynamically adjusted weight, which is adaptively updated in each backpropagation iteration based on the ratio of the gradient norm of the data fitting loss term to the gradient norm of the physical residual loss term. A boundary condition constraint term for inter-regional interconnection is constructed, which is used to penalize the mismatch between the equivalent power of the root node of the receiving-end power grid in the initial prediction network deduction and the actual injected power of the upstream transmission network. The data fitting loss term, the AC power flow physical residual penalty term, and the cross-regional tie line boundary condition constraint term are respectively configured with corresponding weight coefficients, and the three weighted terms are added together to obtain the physical-data dual-drive loss function. During each backpropagation iteration of the initial prediction network, the gradient of the physical-data dual-driven loss function with respect to the network parameters is calculated, and the network parameters are updated according to the gradient until the network converges, generating a cascaded failure prediction plugin.

[0110] Specifically, the steps for constructing the physical residual penalty term for AC power flow include: Identify all unbalanced nodes in the inter-regional power grid to form a set of unbalanced nodes; For each unbalanced node in the set of unbalanced nodes, based on the voltage amplitude and phase angle of the unbalanced node predicted by the initial prediction network, as well as the voltage amplitude and phase angle of each neighboring node directly connected to the unbalanced node, and combined with the conductance and susceptance elements in the dynamic node admittance matrix, the theoretical active power injection and theoretical reactive power injection of the unbalanced node are calculated. Calculate the square of the active power imbalance between the theoretical active power injection power and the actual net active power injection power at the unbalanced node, and calculate the square of the reactive power imbalance between the theoretical reactive power injection power and the actual net reactive power injection power at the unbalanced node. The average of the squares of the active power imbalance and the squares of the reactive power imbalance of all unbalanced nodes in the set of unbalanced nodes is used to obtain the AC power flow physical residual penalty term.

[0111] Specifically, the steps for constructing the boundary condition constraints for cross-regional connecting lines include: Identify the boundary nodes of the tie lines used to connect the sending-end grid and the receiving-end grid in the inter-regional power grid, forming a boundary node set. For each boundary node in the boundary node set, obtain the actual active power injected into the boundary node by the upstream transmission network. Based on the voltage amplitude and phase angle of the boundary nodes predicted by the initial prediction network, and combined with the conductance and susceptance elements in the dynamic node admittance matrix, the equivalent injected power of the boundary nodes is calculated in reverse. The square of the difference between the actual active power and the equivalent injected power of the boundary nodes is calculated. The squares of the differences of all boundary nodes in the set of boundary nodes are summed and averaged to obtain the boundary condition constraint terms of the cross-regional tie line.

[0112] Specifically, the vulnerability assessment module 13 is used for: Specifically, the integrated multimodal feature tensor and dynamic topology mask matrix are input into the cascaded failure prediction plugin, which outputs the continuous state probability density distribution of key nodes in the inter-regional power grid. Vulnerability state values ​​are extracted from the continuous state probability density distribution, including: The integrated multimodal feature tensor and the dynamic topology mask matrix are input together into the cascaded failure prediction plugin. The cascaded failure prediction plugin extracts spatiotemporal features from the integrated multimodal feature tensor through an attention mechanism. During the calculation of attention weights, the dynamic topology mask matrix is ​​superimposed on the dot product of the query matrix and the key matrix through matrix addition. The superimposed result is then input into the normalized exponential function for activation calculation, so as to force the attention weights between physically non-adjacent nodes to be set to zero. The cascaded failure prediction plugin outputs the probability density distribution parameters of the predicted electrical quantities of key nodes in the inter-regional power grid. The probability density distribution parameters of the predicted electrical quantities include a prediction mean vector and a prediction variance vector. The prediction mean vector is used to characterize the predicted center value of the electrical quantity, and the prediction variance vector is used to characterize the uncertainty confidence interval of the prediction result. The vulnerability state value of each critical node is extracted from the probability density distribution parameters of the electrical quantity prediction values. The vulnerability state value is used to characterize the degree of voltage over-limit risk or power flow overload risk of the critical node at the prediction time.

[0113] Furthermore, extreme risk thresholds are constructed, including: Extract a continuous vulnerability index sequence from the continuous state probability density distribution, and set an initial basic high threshold for the current moment based on the sliding mean and sliding standard deviation of the continuous vulnerability index sequence within the current sliding time window. Extract all samples that exceed the initial baseline high threshold from the continuous vulnerability index sequence, and calculate the overshoot of each sample relative to the initial baseline high threshold to form an overshoot sequence. The tail features of the overshoot sequence are fitted with a generalized Pareto distribution, and the shape and scale parameters of the generalized Pareto distribution are updated online. At a given confidence level, a dynamic extreme risk threshold is derived in reverse based on the initial basic high threshold, the shape and scale parameters after online rolling updates, the total number of samples in the continuous vulnerability index sequence, and the number of samples in the overshoot sequence. This dynamic extreme risk threshold is then used as the extreme risk threshold.

[0114] The early warning module 14 is specifically used for: When the vulnerability status value exceeds the extreme risk threshold, an early warning signal is triggered and a defense command is generated, including: When the vulnerability status value is less than or equal to the extreme risk threshold, it is determined to be a no-warning state and no warning signal is triggered; When the vulnerability status value is greater than the extreme risk threshold, an early warning signal is triggered. The level of the early warning signal is determined according to the degree to which the vulnerability status value exceeds the extreme risk threshold. The levels of the early warning signal include Level 1, Level 2, and Level 3, wherein Level 1 corresponds to the smallest degree of exceedance, and Level 3 corresponds to the largest degree of exceedance. When any level of early warning signal is triggered, the voltage over-limit probability or power flow overload probability is calculated based on the continuous state probability density distribution. The voltage over-limit probability or the power flow overload probability is input into the intelligent auxiliary decision-making module, which automatically generates a structured pre-disaster blocking plan as a defense instruction. The defense instruction is then sent to the corresponding field execution terminal to complete the pre-disaster proactive blocking.

Claims

1. A power grid cascade failure prevention method based on physical information neural networks, characterized in that, include: A comprehensive multimodal feature tensor is constructed by collecting multi-source heterogeneous operation data from inter-regional power grids, and a dynamic topology mask matrix is ​​generated based on the real-time physical connectivity of the inter-regional power grids, including: The active and reactive power time series of the cross-regional sending-end connection line, the voltage amplitude and voltage phase angle of each monitoring node in the distribution network, the active and reactive power flow of each branch, the solar irradiance, temperature, humidity and wind speed meteorological elements in the receiving-end area, the real-time load power of charging stations in the area and the charging demand aggregation based on traffic flow prediction are collected as multi-source heterogeneous operation data. Multimodal feature extraction and spatiotemporal resolution unification processing are performed on the multi-source heterogeneous operating data, and the processed multi-class feature vectors are concatenated in the channel dimension to generate a comprehensive multimodal feature tensor. The initial node admittance matrix is ​​corrected in real time based on the branch connectivity state vector. The mutual admittance elements corresponding to the branches in the open state are set to zero, and the self-admittance elements of the nodes at both ends of the branches are updated accordingly to generate a dynamic node admittance matrix. Based on the dynamic node admittance matrix, a dynamic topology mask matrix is ​​generated. Each element in the dynamic topology mask matrix represents the real-time electrical connection state between two corresponding nodes. In the step of generating the dynamic topology mask matrix, for any off-diagonal element in the dynamic topology mask matrix, when there is a direct electrical physical connection between the two corresponding nodes and the corresponding branch is in a closed state, the value of the off-diagonal element is set to a positive number associated with the mutual admittance value between the two corresponding nodes; when there is no direct electrical physical connection between the two corresponding nodes or the corresponding branch is in an open state, the value of the off-diagonal element is set to zero. An initial prediction network is constructed based on the fusion of power system physical mechanisms and deep neural networks. This initial prediction network is then trained using a dual-drive loss function (physical-data), generating a cascaded failure prediction plugin, including: Construct a data fitting loss term, which is used to measure the difference between the probability density distribution of the prediction output of the initial prediction network and the actual observed samples; An AC power flow physical residual penalty term is constructed, which is based on Kirchhoff's current law and is used to penalize the deviation of the voltage amplitude and phase angle of the initial prediction network's predicted output from violating the AC power flow equation. The weight coefficient of the AC power flow physical residual penalty term is a dynamically adjusted weight, which is adaptively updated in each backpropagation iteration based on the ratio of the gradient norm of the data fitting loss term to the gradient norm of the physical residual loss term. A boundary condition constraint term for inter-regional interconnection is constructed, which is used to penalize the mismatch between the equivalent power of the root node of the receiving-end power grid in the initial prediction network deduction and the actual injected power of the upstream transmission network. The data fitting loss term, the AC power flow physical residual penalty term, and the cross-regional tie line boundary condition constraint term are respectively configured with corresponding weight coefficients, and the three weighted terms are added together to obtain the physical-data dual-drive loss function. During each backpropagation iteration of the initial prediction network, the gradient of the physical-data dual-drive loss function with respect to the network parameters is calculated, and the network parameters are updated according to the gradient until the network converges, generating a cascaded failure prediction plugin. The integrated multimodal feature tensor and dynamic topology mask matrix are input into the cascaded failure prediction plugin, which outputs the continuous state probability density distribution of key nodes in the inter-regional power grid. Vulnerability state values ​​are extracted from the continuous state probability density distribution, and extreme risk thresholds are constructed, including: The integrated multimodal feature tensor and the dynamic topology mask matrix are input together into the cascaded failure prediction plugin. The cascaded failure prediction plugin extracts spatiotemporal features from the integrated multimodal feature tensor through an attention mechanism. During the calculation of attention weights, the dynamic topology mask matrix is ​​superimposed on the dot product of the query matrix and the key matrix through matrix addition. The superimposed result is then input into the normalized exponential function for activation calculation, so as to force the attention weights between physically non-adjacent nodes to be set to zero. The cascaded failure prediction plugin outputs the probability density distribution parameters of the predicted electrical quantities of key nodes in the inter-regional power grid. The probability density distribution parameters of the predicted electrical quantities include a prediction mean vector and a prediction variance vector. The prediction mean vector is used to characterize the predicted center value of the electrical quantity, and the prediction variance vector is used to characterize the uncertainty confidence interval of the prediction result. The vulnerability state value of each critical node is extracted from the probability density distribution parameters of the electrical quantity prediction values. The vulnerability state value is used to characterize the degree of voltage over-limit risk or power flow overload risk of the critical node at the prediction time. Among them, constructing extreme risk thresholds includes: Extract a continuous vulnerability index sequence from the continuous state probability density distribution, and set an initial basic high threshold for the current moment based on the sliding mean and sliding standard deviation of the continuous vulnerability index sequence within the current sliding time window. Extract all samples that exceed the initial baseline high threshold from the continuous vulnerability index sequence, and calculate the overshoot of each sample relative to the initial baseline high threshold to form an overshoot sequence. The tail features of the overshoot sequence are fitted with a generalized Pareto distribution, and the shape and scale parameters of the generalized Pareto distribution are updated online. At a given confidence level, the dynamic extreme risk threshold is derived in reverse based on the initial basic high threshold, the shape and scale parameters after online rolling updates, the total number of samples in the continuous vulnerability index sequence, and the number of samples in the overshoot sequence. The dynamic extreme risk threshold is then used as the extreme risk threshold. When the vulnerability status value exceeds the extreme risk threshold, an early warning signal is triggered and a defense command is generated.

2. The power grid cascade failure prevention method based on physical information neural network according to claim 1, characterized in that, An initial prediction network is constructed based on the fusion of power system physical mechanisms and deep neural networks, including: The Transformer network is used as the basic network architecture. A dynamic topology masking mechanism constrained by a real-time physical admittance matrix is ​​designed, and the dynamic topology masking matrix is ​​embedded in the attention mechanism of the Transformer network to ensure that the attention information propagation path of the initial prediction network is consistent with the underlying electrical connectivity of the inter-regional power grid.

3. The power grid cascade failure prevention method based on physical information neural network according to claim 1, characterized in that, The steps to construct the physical residual penalty term for AC power flow include: Identify all unbalanced nodes in the inter-regional power grid to form a set of unbalanced nodes; For each unbalanced node in the set of unbalanced nodes, based on the voltage amplitude and phase angle of the unbalanced node predicted by the initial prediction network, as well as the voltage amplitude and phase angle of each neighboring node directly connected to the unbalanced node, and combined with the conductance and susceptance elements in the dynamic node admittance matrix, the theoretical active power injection and theoretical reactive power injection of the unbalanced node are calculated. Calculate the square of the active power imbalance between the theoretical active power injection power and the actual net active power injection power at the unbalanced node, and calculate the square of the reactive power imbalance between the theoretical reactive power injection power and the actual net reactive power injection power at the unbalanced node. The average of the squares of the active power imbalance and the squares of the reactive power imbalance of all unbalanced nodes in the set of unbalanced nodes is used to obtain the AC power flow physical residual penalty term.

4. The power grid cascade failure prevention method based on physical information neural network according to claim 1, characterized in that, The steps for constructing boundary condition constraints for cross-regional connecting lines include: Identify the boundary nodes of the tie lines used to connect the sending-end grid and the receiving-end grid in the inter-regional power grid, forming a boundary node set. For each boundary node in the boundary node set, obtain the actual active power injected into the boundary node by the upstream transmission network. Based on the voltage amplitude and phase angle of the boundary nodes predicted by the initial prediction network, and combined with the conductance and susceptance elements in the dynamic node admittance matrix, the equivalent injected power of the boundary nodes is calculated in reverse. The square of the difference between the actual active power and the equivalent injected power of the boundary nodes is calculated. The squares of the differences of all boundary nodes in the set of boundary nodes are summed and averaged to obtain the boundary condition constraint terms of the cross-regional tie line.

5. The power grid cascade failure prevention method based on physical information neural network according to claim 1, characterized in that, When the vulnerability status value exceeds the extreme risk threshold, an early warning signal is triggered and a defense command is generated, including: When the vulnerability status value is less than or equal to the extreme risk threshold, it is determined to be a no-warning state and no warning signal is triggered; When the vulnerability status value is greater than the extreme risk threshold, an early warning signal is triggered. The level of the early warning signal is determined according to the degree to which the vulnerability status value exceeds the extreme risk threshold. The levels of the early warning signal include Level 1, Level 2, and Level 3, wherein Level 1 corresponds to the smallest degree of exceedance, and Level 3 corresponds to the largest degree of exceedance. When any level of early warning signal is triggered, the voltage over-limit probability or power flow overload probability is calculated based on the continuous state probability density distribution. The voltage over-limit probability or the power flow overload probability is input into the intelligent auxiliary decision-making module, which automatically generates a structured pre-disaster blocking plan as a defense instruction. The defense instruction is then sent to the corresponding field execution terminal to complete the pre-disaster proactive blocking.

6. A power grid cascaded failure prevention system based on physical information neural networks, characterized in that, The method for implementing the power grid cascade failure prevention method based on physical information neural networks as described in any one of claims 1-5 includes: The feature construction module is used to collect multi-source heterogeneous operation data of cross-regional power grids to construct a comprehensive multimodal feature tensor, and generate a dynamic topology mask matrix based on the real-time physical connectivity of the cross-regional power grids. The dual-drive training module is used to construct an initial prediction network based on the fusion of the physical mechanism of the power system and a deep neural network, and to train the initial prediction network by combining the physical-data dual-drive loss function to generate a cascaded failure prediction plug-in. The vulnerability assessment module is used to input the integrated multimodal feature tensor and dynamic topology mask matrix into the cascaded failure prediction plugin, output the continuous state probability density distribution of key nodes in the cross-regional power grid, extract vulnerability state values ​​from the continuous state probability density distribution, and construct extreme risk thresholds. The early warning module is used to trigger an early warning signal and generate a defense command when the vulnerability status value exceeds the extreme risk threshold.

Citation Information

Patent Citations

  • Low-voltage distribution network change risk research and judgment and intelligent early warning method and system

    CN120494472A

  • Power grid topology toughness enhancement method based on pre-disaster prediction of graph neural network

    CN120806384A