基于图Transformer的电力系统暂态稳定判别

熊学侨, 田芳, 黄彦浩, 李东琦, 张海岩, 马辰宇

电力建设 ›› 2026, Vol. 47 ›› Issue (7) : 129-140.

PDF(16864 KB)
PDF(16864 KB)
电力建设 ›› 2026, Vol. 47 ›› Issue (7) : 129-140. DOI: 10.12204/j.issn.1000-7229.2026.07.010
调度运行

基于图Transformer的电力系统暂态稳定判别

作者信息 +

Transient Stability Assessment of Power Systems Based on Graph Transformer

Author information +
文章历史 +

摘要

【目的】 针对传统电力系统暂态稳定判别方法难以处理高维非线性动态行为、效率与泛化能力不足的问题,提出基于图Transformer的电力系统暂态稳定智能判别方法。【方法】 融合短路故障起始时刻电气量与故障信息构建节点输入特征;采用图神经网络建模电网拓扑关系,结合拉普拉斯位置编码注入结构信息,利用Transformer多头自注意力机制挖掘节点间全局复杂依赖关系;通过PSASP平台生成多拓扑、多故障场景样本,采用最大池化聚合节点特征完成模型构建,并在IEEE 39节点与某区域1947节点系统开展试验验证。【结果】 IEEE 39节点特征消融实验表明,故障持续时间是影响暂态稳定判别最主要的因素;在1947节点系统验证集上,模型准确率达98.33%、召回率达97.36%,综合性能优于传统机器学习与主流深度学习对比模型;在电网拓扑变化场景下,模型各项性能指标波动小于0.25%,能够保持稳定且优异的判别效果。【结论】 所提方法兼具图神经网络拓扑建模与Transformer全局特征捕捉优势,在高维数据处理、复杂扰动适应与拓扑泛化方面性能突出,判别准确、鲁棒性强,可为电力系统紧急控制与安全防御提供可靠的决策依据。

Abstract

[Objective] Traditional methods for transient stability assessment of power systems often struggle to handle high-dimensional nonlinear dynamic behaviors, exhibiting insufficient efficiency and generalization ability. An intelligent transient stability assessment method based on Graph Transformer is proposed. [Methods] Node input features are constructed by fusing electrical quantities and fault information at the initial moment of short-circuit faults. A graph neural networks is employed to model the grid topology, augmented with Laplacian position encoding to inject structural information. The Transformer multi-head self-attention is adopted to capture global complex dependencies among nodes. Multi-topology and multi-fault samples are generated through the PSASP platform. The model is built with max-pooling for feature aggregation and verified on the IEEE 39-bus system and a regional 1947-bus system. [Results] Feature ablation experiments on the IEEE 39-bus system show that fault duration is the most important factor affecting transient stability assessment. On the 1947-bus validation set, the model achieves 98.33% accuracy and 97.36% recall, outperforming traditional machine learning and mainstream deep learning models. Under variations in grid topology, the model's performance indicators fluctuate by less than 0.25%, demonstrating stable and excellent results. [Conclusions] The proposed method integrates the advantages of graph neural network topology modeling and Transformer global feature capture. It exhibits outstanding performance in high-dimensional data processing, adapting to complex disturbances and generalizing across topological changes. With high accuracy and strong robustness, the method provides reliable decision support for power system emergency control and security defense.

关键词

电力系统 / 暂态稳定判别 / 图Transformer / 自注意力机制

Key words

power systems / transient stability assessment / graph Transformer / self-attention mechanism

引用本文

导出引用
熊学侨, 田芳, 黄彦浩, . 基于图Transformer的电力系统暂态稳定判别[J]. 电力建设. 2026, 47(7): 129-140 https://doi.org/10.12204/j.issn.1000-7229.2026.07.010
XIONG Xueqiao, TIAN Fang, HUANG Yanhao, et al. Transient Stability Assessment of Power Systems Based on Graph Transformer[J]. Electric Power Construction. 2026, 47(7): 129-140 https://doi.org/10.12204/j.issn.1000-7229.2026.07.010
中图分类号: TM712   

附录A

对于任意节点对(ij),注意力分数αij表示节点j对节点i的影响权重,计算如下:

${\alpha }_{ij}=\mathrm{s}\mathrm{o}\mathrm{f}\mathrm{t}\mathrm{m}\mathrm{a}{\mathrm{x}}_{j}\left({\mathit{e}}_{ij}\right)=\mathrm{s}\mathrm{o}\mathrm{f}\mathrm{t}\mathrm{m}\mathrm{a}{\mathrm{x}}_{j}\left(\frac{{\mathit{Q}}_{i}{\mathit{K}}_{j}^{\mathrm{T}}}{\sqrt{{d}_{k}}}\right)$

式中:softmax操作将节点间原始注意力分数eij转换为物理可解释的影响权重;dk是查询向量和键向量的维度;QiKj是节点i和节点j的查询向量和键向量。定义为:

${\mathit{Q}}_{i}={\mathit{h}}_{i}^{\text{'}}{\mathit{W}}_{q},{\mathit{K}}_{j}={\mathit{h}}_{j}^{\text{'}}{\mathit{W}}_{k}$

式中: ${\mathit{W}}_{q}\mathrm{、}{\mathit{W}}_{k}\in {\mathbb{R}}^{d\times {d}_{k}}$是可学习的线性变换矩阵。

节点的值向量Vj计算如下:

${\mathit{V}}_{j}={\mathit{h}}_{j}^{\text{'}}{\mathit{W}}_{v}$

式中: ${\mathit{W}}_{v}\in {\mathbb{R}}^{d\times {d}_{v}}$是可学习线性变换矩阵;dv是值向量的维度。

附录B

节点i的平均有功功率通量定义为:

${\Phi }_{i}^{P}=\frac{1}{2}\left(\sum _{j\in {\mathcal{N}}_{\mathrm{i}\mathrm{n}}}\left|{P}_{ji}\right|+\sum _{k\in {\mathcal{N}}_{out}}|{P}_{ik}|\right)$

式中:Pji表示从节点j流向节点i的有功功率;Pik表示从节点i流向节点k的有功功率; ${\mathcal{N}}_{\mathrm{i}\mathrm{n}}$表示输入邻居节点集合; ${\mathcal{N}}_{\mathrm{o}\mathrm{u}\mathrm{t}}$表示输出节点集合。

节点i的平均无功功率通量 ${\Phi }_{i}^{Q}$同理定义为:

${\Phi }_{i}^{Q}=\frac{1}{2}\left(\sum _{j\in {\mathcal{N}}_{in}}|{Q}_{ji}|+\sum _{k\in {\mathcal{N}}_{out}}|{Q}_{ik}|\right)$

式中:Qji表示从节点j流向节点i的无功功率;Qik表示从节点i流向节点k的无功功率。

附录C

1)平均池化。

平均池化将所有节点的特征进行平均,认为所有节点对全局表示的贡献是相等的,对于每个特征维度,计算该列上所有元素的平均值:

${\mathit{h}}_{\mathrm{G}}=\mathrm{M}\mathrm{e}\mathrm{a}\mathrm{m}\mathrm{P}\mathrm{o}\mathrm{o}\mathrm{l}\left({\mathit{H}}^{\left(L\right)}\right)=\frac{1}{N}\sum _{i=1}^{N}{\mathit{h}}_{i}$

2)求和池化。

求和池化通过累加所有节点的特征信号,捕捉电网中特征分布的总体强度或规模信息。对于每个特征维度,将该列上所有元素进行加和:

${\mathit{h}}_{\mathrm{G}}=\mathrm{S}\mathrm{u}\mathrm{m}\mathrm{P}\mathrm{o}\mathrm{o}\mathrm{l}\left({\mathit{H}}^{\left(L\right)}\right)=\sum _{i=1}^{N}{\mathit{h}}_{i}$

附录D

1)召回率:

${\lambda }_{\mathrm{R}\mathrm{e}\mathrm{c}\mathrm{a}\mathrm{l}\mathrm{l}}^{}=\frac{{N}_{\mathrm{T}\mathrm{P}}}{{N}_{\mathrm{T}\mathrm{P}}+{N}_{\mathrm{F}\mathrm{N}}}$

召回率用来衡量模型对失稳样本的识别覆盖率,高召回率代表几乎无失稳漏判,能最大程度避免因漏判失稳引发的系统崩溃、大停电等严重事故,是暂态稳定判别最核心的安全指标。

2)预测精度:

${\lambda }_{\mathrm{P}\mathrm{r}\mathrm{e}\mathrm{c}\mathrm{i}\mathrm{s}\mathrm{i}\mathrm{o}\mathrm{n}}=\frac{{N}_{\mathrm{T}\mathrm{P}}}{{N}_{\mathrm{T}\mathrm{P}}+{N}_{\mathrm{F}\mathrm{P}}}$

预测精度用来衡量模型判失稳的精准度,高精确率可减少稳定样本误判为失稳的情况,避免不必要的紧急控制措施,兼顾电网运行的经济性。

3)F1分数:

${F}_{1}=\frac{2\times {\lambda }_{\mathrm{P}\mathrm{r}\mathrm{e}\mathrm{c}\mathrm{i}\mathrm{s}\mathrm{i}\mathrm{o}\mathrm{n}}\times {\lambda }_{\mathrm{R}\mathrm{e}\mathrm{c}\mathrm{a}\mathrm{l}\mathrm{l}}}{{\lambda }_{\mathrm{P}\mathrm{r}\mathrm{e}\mathrm{c}\mathrm{i}\mathrm{s}\mathrm{i}\mathrm{o}\mathrm{n}}+{\lambda }_{\mathrm{R}\mathrm{e}\mathrm{c}\mathrm{a}\mathrm{l}\mathrm{l}}}$

F1分数兼顾失稳识别覆盖率与判失稳精准度的平衡指标,解决样本不平衡场景下准确率的片面性问题。

4)准确率:

${\lambda }_{\mathrm{A}\mathrm{c}\mathrm{c}\mathrm{u}\mathrm{r}\mathrm{a}\mathrm{c}\mathrm{y}}=\frac{{N}_{\mathrm{T}\mathrm{P}}+{N}_{\mathrm{T}\mathrm{N}}^{}}{{N}_{\mathrm{T}\mathrm{P}}+{N}_{\mathrm{T}\mathrm{N}}^{}+{N}_{\mathrm{F}\mathrm{P}}+{N}_{\mathrm{F}\mathrm{N}}}$

准确率用来衡量模型对稳定、失稳样本的整体判别性能,反映模型的综合识别能力。

5)特异度:

${\lambda }_{\mathrm{S}\mathrm{p}\mathrm{e}\mathrm{c}\mathrm{i}\mathrm{f}\mathrm{i}\mathrm{c}\mathrm{i}\mathrm{t}\mathrm{y}}=\frac{{N}_{\mathrm{T}\mathrm{N}}}{{N}_{\mathrm{T}\mathrm{N}}+{N}_{\mathrm{F}\mathrm{P}}}$

高特异度可减少稳定误报,降低不必要的控制成本,保障电网供电可靠性。

6)马修斯相关系数:

${\lambda }_{\mathrm{M}\mathrm{C}\mathrm{C}}=\frac{{N}_{\mathrm{T}\mathrm{P}}\times {N}_{\mathrm{T}\mathrm{N}}-{N}_{\mathrm{F}\mathrm{P}}\times {N}_{\mathrm{F}\mathrm{N}}}{\sqrt{({N}_{\mathrm{T}\mathrm{P}}+{N}_{\mathrm{F}\mathrm{P}})({N}_{\mathrm{T}\mathrm{P}}+{N}_{\mathrm{F}\mathrm{N}})({N}_{\mathrm{T}\mathrm{N}}+{N}_{\mathrm{F}\mathrm{P}})({N}_{\mathrm{T}\mathrm{N}}+{N}_{\mathrm{F}\mathrm{N}})}}$

马修斯相关系数是类别不平衡电网稳定/失稳数据集下鲁棒性最优的综合评价指标,对失稳漏判和稳定误报两类错误均高度敏感,能客观反映模型在复杂工况下的真实性能。

参考文献

[1]
GB 38755—2019 电力系统安全稳定导则[S].
GB 38755—2019 Code on security and stability for power system[S].
[2]
Gan G X, Zhu Z X, Geng G C, et al. An efficient parallel sequential approach for transient stability emergency control of large-scale power system[J]. IEEE Transactions on Power Systems, 2018, 33(6): 5854-5864.
[3]
Ciechanowicz D, Pelzer D, Bartenschlager B, et al. A modular power system planning and power flow simulation framework for generating and evaluating power network models[J]. IEEE Transactions on Power Systems, 2017, 32(3): 2214-2224.
[4]
范士雄, 赵泽宁, 郭剑波, 等. 数据驱动的电力系统暂态稳定评估方法综述[J]. 中国电机工程学报, 2024, 44(9): 3408-3429.
Fan Shixiong, Zhao Zening, Guo Jianbo, et al. Review on data-driven power system transient stability assessment technology[J]. Proceedings of the CSEE, 2024, 44(9): 3408-3429.
[5]
黄丹, 陈树勇, 张一驰. 基于广域测量系统响应时间序列的电力系统暂态稳定在线判别[J]. 电网技术, 2019, 43(3): 1016-1025.
Huang Dan, Chen Shuyong, Zhang Yichi. Online assessment for transient stability based on response time series of wide-area measurement system[J]. Power System Technology, 2019, 43(3): 1016-1025.
[6]
Phadke A G, BI T S. Phasor measurement units, WAMS, and their applications in protection and control of power systems[J]. Journal of Modern Power Systems and Clean Energy, 2018, 6(4): 619-629.
[7]
Poulose A, Kim S. Direct transient stability assessment of grid-connected voltage source converters: a transient energy functions perspective[J]. IEEE Access, 2024, 12: 133545-133556.
[8]
Al-masri A N, Ab Kadir M Z A, HIZAM H, et al. A novel implementation for generator rotor angle stability prediction using an adaptive artificial neural network application for dynamic security assessment[J]. IEEE Transactions on Power Systems, 2013, 28(3): 2516-2525.
[9]
Bahbah A G, Girgis A A. New method for generators' angles and angular velocities prediction for transient stability assessment of multimachine power systems using recurrent artificial neural network[J]. IEEE Transactions on Power Systems, 2004, 19(2): 1015-1022.
[10]
Zhang J W, Jia H Y, Zhang N. Alternate support vector machine decision trees for power systems rule extractions[J]. IEEE Transactions on Power Systems, 2023, 38(1): 980-983.
[11]
石访, 张林林, 胡熊伟, 等. 基于多属性决策树的电网暂态稳定规则提取方法[J]. 电工技术学报, 2019, 34(11): 2364-2374.
Shi Fang, Zhang Linlin, Hu Xiongwei, et al. Power system transient stability rules extraction based on multi-attribute decision tree[J]. Transactions of China Electrotechnical Society, 2019, 34(11): 2364-2374.
[12]
黄彦浩, 于之虹, 史东宇, 等. 基于海量在线历史数据的大电网快速判稳策略[J]. 中国电机工程学报, 2016, 36(3): 596-603.
Huang Yanhao, Yu Zhihong, Shi Dongyu, et al. Strategy of huge electric power system stability quick judgment based on massive historical online data[J]. Proceedings of the CSEE, 2016, 36(3): 596-603.
[13]
田芳, 周孝信, 于之虹. 基于支持向量机综合分类模型和关键样本集的电力系统暂态稳定评估[J]. 电力系统保护与控制, 2017, 45(22): 1-8.
Tian Fang, Zhou Xiaoxin, Yu Zhihong. Power system transient stability assessment based on comprehensive SVM classification model and key sample set[J]. Power System Protection and Control, 2017, 45(22): 1-8.
[14]
刘颂凯, 龚潇, 杨超, 等. 结合更新机制的电力系统暂态稳定评估研究[J]. 电力科学与技术学报, 2025, 40(2): 1-9.
Liu Songkai, Gong Xiao, Yang Chao, et al. Transient stability assessment of power system in combination with update mechanism[J]. Journal of Electric Power Science and Technology, 2025, 40(2): 1-9.
[15]
Yan R, Geng G C, Jiang Q Y, et al. Fast transient stability batch assessment using cascaded convolutional neural networks[J]. IEEE Transactions on Power Systems, 2019, 34(4): 2802-2813.
[16]
兰宇田, 姚伟, 张文栋, 等. 基于CatBoost的新型电力系统两阶段轻量化暂稳智能评估方法[J]. 山东电力技术, 2024, 51(2): 1-10.
Lan Yutian, Yao Wei, Zhang Wendong, et al. Two-stage lightweight transient stability intelligent assessment method for new type power systems based on CatBoost[J]. Shandong Electric Power, 2024, 51(2): 1-10.
[17]
Shao Z H, Wang Q C, Cao Y Z, et al. A novel data-driven LSTM-SAF model for power systems transient stability assessment[J]. IEEE Transactions on Industrial Informatics, 2024, 20(7): 9083-9097.
[18]
刘颂凯, 党喜, 崔梓琪, 等. 针对样本类不平衡的深度残差网络电力系统暂态稳定评估方法[J]. 智慧电力, 2024, 52(1): 116-123.
Liu Songkai, Dang Xi, Cui Ziqi, et al. Transient stability evaluation method for power systems with deep residual network considering class imbalance of samples[J]. Smart Power, 2024, 52(1): 116-123.
[19]
Umbereen S, Weiss X, Rolander A, et al. Investigating the performance of MLE and CNN for transient stability assessment in power systems[J]. IEEE Access, 2024, 12: 125095-125107.
[20]
王铮澄, 周艳真, 郭庆来, 等. 考虑电力系统拓扑变化的消息传递图神经网络暂态稳定评估[J]. 中国电机工程学报, 2021, 41(7): 2341-2350.
Wang Zhengcheng, Zhou Yanzhen, Guo Qinglai, et al. Transient stability assessment of power system considering topological change: a message passing neural network-based approach[J]. Proceedings of the CSEE, 2021, 41(7): 2341-2350.
[21]
Zhou X M, Guan X, Sun D, et al. Transient stability assessment based on gated graph neural network with imbalanced data in Internet of energy[J]. IEEE Internet of Things Journal, 2022, 9(12): 9320-9331.
[22]
向川, 陈鎏凯, 陈勇, 等. 基于深层级联残差图卷积的暂态稳定评估模型及其实际电网应用[J]. 广东电力, 2024, 37(6): 62-69.
Xiang Chuan, Chen Liukai, Chen Yong, et al. Application of transient stability assessment model based on deep cascading residual graph convolution network in real world power grids[J]. Guangdong Electric Power, 2024, 37(6): 62-69.
[23]
刘颂凯, 曹俊, 吴宇恒, 等. 基于改进深度信念网络的暂态电压稳定评估[J]. 电网与清洁能源, 2025, 41(8): 55-65.
Liu Songkai, Cao Jun, Wu Yuheng, et al. Transient voltage stability assessment based on improved deep belief network[J]. Power System and Clean Energy, 2025, 41(8): 55-65.
[24]
朱乔木, 陈金富, 李弘毅, 等. 基于堆叠自动编码器的电力系统暂态稳定评估[J]. 中国电机工程学报, 2018, 38(10): 2937-2946, 3144.
Zhu Qiaomu, Chen Jinfu, Li Hongyi, et al. Transient stability assessment based on stacked autoencoder[J]. Proceedings of the CSEE, 2018, 38(10): 2937-2946, 3144.
[25]
Rolander A, Ter Vehn A, Eriksson R, et al. Real-time transient stability early warning system using Graph Attention Networks[J]. Electric Power Systems Research, 2024, 235: 110786.
[26]
徐焕, 夏凡, 陈铈, 等. 基于GCN-LSTM的电力系统暂态电压稳定评估[J]. 高压电器, 2025, 61(1): 104-111, 144.
Xu Huan, Xia Fan, Chen Shi, et al. Transient voltage stability assessment of power system based on GCN-LSTM[J]. High Voltage Apparatus, 2025, 61(1): 104-111, 144.
[27]
卢梁宇宸, 周艳真, 曾泓泰, 等. 考虑分布偏移的电力系统稳定评估神经网络训练方法[J]. 智慧电力, 2025, 53(10): 1-7.
Lu Liangyuchen, Zhou Yanzhen, Zeng Hongtai, et al. Neural network training method for power system stability assessment considering distribution shifts[J]. Smart Power, 2025, 53(10): 1-7.
[28]
张诗熠, 王怀远, 李剑, 等. 基于失稳模式自适应捕捉的暂态稳定评估方法[J]. 电力系统保护与控制, 2024, 52(18): 35-44.
Zhang Shiyi, Wang Huaiyuan, Li Jian, et al. Transient stability assessment method based on adaptive capture of instability patterns[J]. Power System Protection and Control, 2024, 52(18): 35-44.
[29]
李楠, 张帅, 胡禹先, 等. 一种基于深度自适应网络迁移的暂稳评估模型更新框架[J]. 电力系统保护与控制, 2024, 52(14): 25-35.
Li Nan, Zhang Shuai, Hu Yuxian, et al. An updating framework of a model for transient stability assessment based on a deep adaptive network transfer[J]. Power System Protection and Control, 2024, 52(14): 25-35.
[30]
房佳姝, 刘崇茹, 苏晨博, 等. 基于自注意力Transformer编码器的多阶段电力系统暂态稳定评估方法[J]. 中国电机工程学报, 2023, 43(15): 5745-5759.
Fang Jiashu, Liu Chongru, Su Chenbo, et al. Multi-stage transient stability assessment of power system based on self-attention transformer encoder[J]. Proceedings of the CSEE, 2023, 43(15): 5745-5759.
[31]
刘文胜, 荣娜, 李宏伟, 等. 基于SCSC-Swin Transformer的电力系统暂态稳定预测方法[J]. 电子测量技术, 2024, 47(22): 120-128.
Liu Wensheng, Rong Na, Li Hongwei, et al. Power system transient stability prediction method based on SCSC-Swin Transformer[J]. Electronic Measurement Technology, 2024, 47(22): 120-128.
[32]
Dwivedi V P, Bresson X. A generalization of transformer networks to graphs[PP/OL]. ArXiv(2021-01-24)[2026-01-02]. https://arxiv.org/abs/2012.09699.
[33]
赵晨浩, 焦在滨, 李程昊, 等. 基于双塔Transformer的电力系统暂态稳定评估[J]. 全球能源互联网, 2024, 7(5): 521-529.
Zhao Chenhao, Jiao Zaibin, Li Chenghao, et al. Power system transient stability assessment based on two-tower transformer model[J]. Journal of Global Energy Interconnection, 2024, 7(5): 521-529.
[34]
Shi F B, Li D, Wang X G, et al. TGformer: a graph transformer framework for knowledge graph embedding[J]. IEEE Transactions on Knowledge and Data Engineering, 2025, 37(1): 526-541.
[35]
Han K, Wang Y H, Chen H T, et al. A survey on vision transformer[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023, 45(1): 87-110.
[36]
An J L, Dai L L, Wang M Z, et al. SPGFormer: structure perception graph transformer with Laplacian position encoding for hyperspectral image classification[J]. IEEE Transactions on Geoscience and Remote Sensing, 2025, 63: 5521517.
[37]
Hinterreiter A, Ruch P, Stitz H, et al. ConfusionFlow: a model-agnostic visualization for temporal analysis of classifier confusion[J]. IEEE Transactions on Visualization and Computer Graphics, 2022, 28(2): 1222-1236.
[38]
GB/T 40587—2021 电力系统安全稳定控制系统技术规范[S].
GB/T 40587—2021 Technical specification for power system security and stability control system[S].

脚注

利益冲突声明(Conflict of Interests): 所有作者声明不存在利益冲突。

作者贡献声明(Authors' Contributions): 熊学侨提出基于图Transformer的电力系统暂态稳定判别核心概念、基本框架,提出研究方向,设计论文整体框架,进行实验,开展对比实验,完成实验数据整理与分析;田芳设计研究思路、研究方案,开展研究方案可行性调查分析,实施核心研究过程;黄彦浩确定研究对象范围(39节点系统、1947节点区域电网),收集仿真数据,完成数据采集、清洗与分析;李东琦承担图Transformer模型相关技术开发;张海岩绘制模型原理图、训练结果图等核心图谱;马辰宇负责文献调研与整理。所有作者均阅读并同意了论文终稿内容。

基金

智能电网国家科技重大专项(2030)(2024ZD0802900)

编辑: 张小飞
PDF(16864 KB)

Accesses

Citation

Detail

相关文章
AI小编
你好!我是《电力建设》AI小编,有什么可以帮您的吗?

/