CN113904786B - False data injection attack identification method based on line topology analysis and tide characteristics - Google Patents
False data injection attack identification method based on line topology analysis and tide characteristics Download PDFInfo
- Publication number
- CN113904786B CN113904786B CN202110729263.6A CN202110729263A CN113904786B CN 113904786 B CN113904786 B CN 113904786B CN 202110729263 A CN202110729263 A CN 202110729263A CN 113904786 B CN113904786 B CN 113904786B
- Authority
- CN
- China
- Prior art keywords
- data
- power flow
- line
- node
- power
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1441—Countermeasures against malicious traffic
- H04L63/1466—Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J3/00—Circuit arrangements for AC mains or AC distribution networks
- H02J3/04—Circuit arrangements for AC mains or AC distribution networks for connecting networks of the same frequency but supplied from different sources
- H02J3/06—Controlling transfer of power between connected networks; Controlling sharing of load between connected networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/12—Discovery or management of network topologies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/16—Threshold monitoring
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J2203/00—Indexing scheme relating to details of circuit arrangements for AC mains or AC distribution networks
- H02J2203/10—Power transmission or distribution systems management focussing at grid-level, e.g. load flow analysis, node profile computation, meshed network optimisation, active network management or spinning reserve management
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y04—INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
- Y04S—SYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
- Y04S40/00—Systems for electrical power generation, transmission, distribution or end-user application management characterised by the use of communication or information technologies, or communication or information technology specific aspects supporting them
- Y04S40/20—Information technology specific aspects, e.g. CAD, simulation, modelling, system security
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computer Hardware Design (AREA)
- Power Engineering (AREA)
- Supply And Distribution Of Alternating Current (AREA)
Abstract
本发明公开一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,步骤包括:1)获取电力系统历史潮流数据和原始拓扑结构;2)得到电力系统转换拓扑结构;3)在历史潮流数据中注入若干攻击数据,得到存在虚假数据的潮流样本数据;4)提取潮流样本数据的潮流特征值,并打上是否存在攻击数据的标签;5)基于潮流样本数据的潮流特征值,建立用于判断电力系统是否被攻击的图卷积网络模型;6)获取电力系统当前潮流数据,并提取当前潮流数据的潮流特征值;将当前潮流数据的潮流特征值输入到所述图卷积网络模型中,判断电力系统线路是否被攻击、被攻击线路的位置。本发明利用图注意力机制神经网络实现虚假数据攻击位置的确定。
The invention discloses a false data injection attack identification method based on line topology analysis and power flow characteristics. The steps include: 1) obtaining the historical power flow data and original topology structure of the power system; Inject some attack data into the data to obtain the power flow sample data with false data; 4) Extract the power flow characteristic value of the power flow sample data, and label whether there is attack data; 5) Based on the power flow characteristic value of the power flow sample data, establish a A graph convolutional network model for judging whether the power system is attacked; 6) Obtaining the current power flow data of the power system, and extracting the power flow eigenvalues of the current power flow data; inputting the power flow eigenvalues of the current power flow data into the graph convolutional network model , to determine whether the power system line is attacked and the location of the attacked line. The invention utilizes the graph attention mechanism neural network to realize the determination of the false data attack position.
Description
技术领域Technical Field
本发明涉及电力系统网络信息安全问题领域,具体是一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法。The invention relates to the field of power system network information security issues, and in particular to a false data injection attack identification method based on line topology analysis and power flow characteristics.
背景技术Background Art
随着工业4.0的发展,越来越多的产业通过融合更多的信息化技术,逐步实现产业的智能化。电力系统是世界上最大的人工系统,也是较早融合信息技术和自动化技术的工业系统,构成了可实时感知、动态控制和信息决策相融合的电力信息物理系统。然而,该系统的构建对电网的脆弱性产生了新的影响。攻击者在信息交互过程中通过重放攻击、虚假数据注入攻击(False Data Injection Attacks,FDIAs)等手段破坏电力系统的网络信息安全,使控制中心误以为系统仍在正常运行中,误导控制中心做出错误决策,导致系统中一次设备退出运行或者关键线路断开引发交互连锁故障。因此,对电力系统中的FDIAs进行检测和辨识对保障电力系统的安全稳定运行十分重要。With the development of Industry 4.0, more and more industries are gradually realizing the intelligence of industries by integrating more information technologies. The power system is the largest artificial system in the world and also an industrial system that integrates information technology and automation technology earlier. It constitutes a power information-physical system that can integrate real-time perception, dynamic control and information decision-making. However, the construction of this system has a new impact on the vulnerability of the power grid. During the information interaction process, attackers use replay attacks, false data injection attacks (FDIAs) and other means to destroy the network information security of the power system, making the control center mistakenly believe that the system is still operating normally, misleading the control center to make wrong decisions, causing the primary equipment in the system to exit operation or the key line to be disconnected, causing interactive chain failures. Therefore, it is very important to detect and identify FDIAs in the power system to ensure the safe and stable operation of the power system.
现有研究方法中,通常考虑单一时间断面下的系统数据,结合数据的空间特征进行FDIAs的检测。然而,攻击者构造的虚假数据通常符合电力系统运行规律,在连续时间断面下仅考虑数据的空间特征难以实现FDIAs的有效检测。在对虚假数据注入攻击进行辨识时,现有方法通常基于传统的拓扑结构,即以一次设备为节点,传输线为边构成电力系统的拓扑结构,由于攻击者通过篡改线路量测数据实现虚假数据的攻击,该结构难以实现攻击位置的准确定位。In existing research methods, system data under a single time section is usually considered, and the spatial characteristics of the data are combined to detect FDIAs. However, the false data constructed by the attacker usually conforms to the operating rules of the power system. It is difficult to effectively detect FDIAs by only considering the spatial characteristics of the data under continuous time sections. When identifying false data injection attacks, existing methods are usually based on traditional topological structures, that is, the topological structure of the power system is composed of primary devices as nodes and transmission lines as edges. Since the attacker implements false data attacks by tampering with line measurement data, this structure is difficult to accurately locate the attack location.
发明内容Summary of the invention
本发明的目的是提供一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,包括以下步骤:The purpose of the present invention is to provide a false data injection attack identification method based on line topology analysis and power flow characteristics, comprising the following steps:
1)获取电力系统历史潮流数据和原始拓扑结构。1) Obtain the historical power flow data and original topology of the power system.
2)对电力系统原始拓扑结构进行转换,得到电力系统转换拓扑结构。2) Convert the original topology of the power system to obtain a converted topology of the power system.
建立转换拓扑结构图的步骤如下:The steps to create a conversion topology diagram are as follows:
2.1)建立用于表征电力系统原始拓扑结构的邻接矩阵AG,即:2.1) Establish the adjacency matrix AG used to characterize the original topological structure of the power system, that is:
根据复杂网络理论和图论的概念,对于一个具有N个节点,M条边的拓扑结构图而言,可以用N*N的节点邻接矩阵AG表示图网络结构,其中矩阵中的元素aij表示为According to the concepts of complex network theory and graph theory, for a topological graph with N nodes and M edges, the graph network structure can be represented by an N*N node adjacency matrix AG , where the elements aij in the matrix are represented as
AG=[aij]N×N AG =[ aij ] N×N
式中,aij表示节点邻接矩阵AG中的元素。vi、vj表示图网络第i个、第j个节点。Where aij represents the elements in the node adjacency matrix AG . vi and vj represent the i-th and j-th nodes in the graph network.
2.2)提取出节点邻接矩阵AG中每个节点的邻接节点数目,并写入元胞数组Acell中。2.2) Extract the number of adjacent nodes of each node in the node adjacency matrix AG and write it into the cell array Acell .
2.3)确定电力系统传统拓扑图中线路的邻接线路,并构建基于线路拓扑结构的元胞数组Ecell。2.3) Determine the adjacent lines of the lines in the traditional topology diagram of the power system and construct a cell array E cell based on the line topology structure.
2.4)以线路作为拓扑结构图的节点,寻找每个线路的邻接线路,从而建立线路邻接矩阵AG’。2.4) Taking the lines as nodes of the topological structure graph, find the adjacent lines of each line, so as to establish the line adjacency matrix AG '.
2.5)根据线路邻接矩阵AG’,建立以线路为节点、线路间联接关系为边的电力系统转换拓扑结构。2.5) According to the line adjacency matrix AG ', a power system conversion topology is established with the lines as nodes and the connection relationships between lines as edges.
3)在历史潮流数据中注入若干攻击数据,得到存在虚假数据的潮流样本数据。3) Inject some attack data into the historical flow data to obtain flow sample data containing false data.
攻击数据a如下所示:The attack data a is as follows:
a=Hc (2)a=Hc (2)
式中,c=[c1,c2,...,cn]T为任意的非零向量。c∈Rn×1。n为状态数量。H为表征电力系统拓扑结构的雅克比矩阵。。Where, c = [c 1 ,c 2 ,..., cn ] T is an arbitrary non-zero vector. c∈R n×1 . n is the number of states. H is the Jacobian matrix that characterizes the topological structure of the power system.
4)提取潮流样本数据的潮流特征值,并为潮流特征值打上是否存在攻击数据的标签。4) Extract the power flow characteristic value of the power flow sample data, and label the power flow characteristic value with whether there is attack data.
潮流特征值包括电气介数和潮流偏移系数指标。The power flow characteristic values include electrical intermediate value and power flow deviation coefficient index.
所述电气介数Be(m,n)如下所示:The electrical intermediate number Be (m,n) is as follows:
式中,L和G分别为电网中的负荷节点与发电节点的集合。Wi和Wj分别表示发电机输出的有功功率和节点负荷值。Iij(m,n)表示在电源节点i和负荷节点j之间接上单位电流源后,线路(m,n)之间的电流变化量。Where L and G are the sets of load nodes and generation nodes in the power grid. Wi and Wj represent the active power output of the generator and the node load value, respectively. Iij (m,n) represents the current change between lines (m,n) after a unit current source is connected between power node i and load node j.
潮流偏移系数指标Mi如下所示:The power flow deviation coefficient index Mi is as follows:
式中,Pi0和Pj0分别表示线路i和线路j的初始有功功率。L为电网中所有输电线路的集合。ΔPji为由于线路i断开引起线路j有功功率的变化量。Where P i0 and P j0 represent the initial active power of line i and line j respectively. L is the set of all transmission lines in the power grid. ΔP ji is the change in active power of line j caused by disconnection of line i.
潮流特征值是经过了预处理的数据。所述预处理包括对数据进行z-score标准化。标准化后x'的数据如下所示:The power flow characteristic value is preprocessed data. The preprocessing includes z-score standardization of the data. The standardized x' data is as follows:
式中,xμ和xσ分别为样本均值和标准差。x表征预处理前的数据。Where xμ and xσ are the sample mean and standard deviation respectively. x represents the data before preprocessing.
5)基于潮流样本数据的潮流特征值,建立用于判断电力系统是否被攻击的图卷积网络模型。5) Based on the power flow characteristic values of the power flow sample data, a graph convolutional network model is established to determine whether the power system is attacked.
建立用于判断电力系统是否被攻击的图卷积网络模型的步骤包括:The steps of establishing a graph convolutional network model for determining whether the power system is attacked include:
5.1)将潮流样本数据的潮流特征值随机划分为测试集和训练集。5.1) Randomly divide the tidal characteristic values of tidal sample data into a test set and a training set.
5.2)搭建图卷积网络。所述图卷积网络模型包括输入层、若干隐藏层和输出层。5.2) Build a graph convolutional network. The graph convolutional network model includes an input layer, several hidden layers and an output layer.
5.3)利用训练集对所述图卷积网络进行训练,得到训练后的图卷积网络。5.3) Using the training set to train the graph convolutional network to obtain a trained graph convolutional network.
5.4)利用测试集对训练后的图卷积网络进行测试,若图卷积网络输出结果精确率大于预设阈值,则完成图卷积网络模型的建立,否则重新获取潮流样本数据及潮流特征值,并返回步骤1)。5.4) Use the test set to test the trained graph convolutional network. If the accuracy of the graph convolutional network output result is greater than the preset threshold, the graph convolutional network model is established. Otherwise, the flow sample data and flow characteristic values are re-obtained and return to step 1).
图卷积网络模型任意两层节点特征值之间的特征学习关系如下所示:The feature learning relationship between the feature values of any two layers of nodes in the graph convolutional network model is as follows:
式中,l表示节点所在的层数。s表示节点vi的邻接节点数量。表示第l层中第ni个节点的特征值。ni为节点i邻居节点的编号。g(·)表示激活函数。为网络权重。为节点i在第l+1层的特征值。Where l represents the layer number of the node. s represents the number of adjacent nodes of node vi . represents the eigenvalue of the ni-th node in the l-th layer. ni is the number of the neighboring node of node i. g( · ) represents the activation function. is the network weight. is the eigenvalue of node i at the l+1th layer.
所述图卷积网络模型的输出特征h'如下所示:The output feature h' of the graph convolutional network model is as follows:
式中,αij为注意力系数,W为可共享的网络参数。Where α ij is the attention coefficient and W is the shareable network parameter.
获取注意力系数αij的步骤包括:The steps of obtaining the attention coefficient α ij include:
a)记电力系统转换拓扑结构中全部线路节点的M维特征输入集合为输出特征集合为 a) The M-dimensional feature input set of all line nodes in the power system conversion topology is The output feature set is
b)计算线路节点之间的相互影响程度eij,即:b) Calculate the mutual influence degree e ij between line nodes, that is:
式中,W为可共享参数。[·||·]表示拼接。共享注意力机制a(·)用于将拼接后的特征映射到相关系数eij上,完成节点i和节点j之间相关性的学习。Where W is a sharable parameter. [ · || · ] represents concatenation. The shared attention mechanism a( · ) is used to map the concatenated features to the correlation coefficient e ij to complete the learning of the correlation between node i and node j.
c)利用非线性激活函数Leaky ReLU单层前馈神经网络进行拼接特征的映射,更新相互影响程度eij如下:c) Use the nonlinear activation function Leaky ReLU single-layer feedforward neural network to map the splicing features and update the mutual influence degree e ij as follows:
其参数为权重向量则相关系数的计算公式可以表示为Its parameter is the weight vector The calculation formula of the correlation coefficient can be expressed as
式中,表示权重向量。表示输入。In the formula, represents the weight vector. Represents input.
d)利用softmax函数对相互影响程度eij进行归一化处理,得当注意力系数αij,即:d) Use the softmax function to normalize the mutual influence degree e ij and obtain the appropriate attention coefficient α ij , that is:
图卷积网络模型的激活函数为ELUs函数。表示输入。The activation function of the graph convolutional network model is the ELUs function. Represents input.
ELUs函数如下所示:The ELUs function is as follows:
式中,α为调整参数。x为输入数据。g(x)为输出数据。In the formula, α is the adjustment parameter, x is the input data, and g(x) is the output data.
6)获取电力系统当前潮流数据,并提取当前潮流数据的潮流特征值。将当前潮流数据的潮流特征值输入到所述图卷积网络模型中,判断电力系统线路是否被攻击、受攻击线路。6) Obtaining the current power flow data of the power system and extracting the power flow characteristic value of the current power flow data. Inputting the power flow characteristic value of the current power flow data into the graph convolutional network model to determine whether the power system line is attacked and the attacked line.
本发明的技术效果是毋庸置疑的,本发明对传统拓扑结构进行转换,利用图注意力机制神经网络,提出了考虑支路潮流特征的图神经网络FDIAs辨识方法,通过线路的潮流值计算代表各条支路潮流特征的特征向量,并利用线路之间的连接关系和拓扑结构上的神经网络,挖掘数据深层特征,实现虚假数据攻击位置的确定。本发明通过在不同的攻击程度下,与其他辨识方法进行比较,确定了该方法的辨识精度和准确度。The technical effect of the present invention is unquestionable. The present invention transforms the traditional topological structure, uses the graph attention mechanism neural network, and proposes a graph neural network FDIAs identification method that considers the branch flow characteristics. The characteristic vector representing the flow characteristics of each branch is calculated by the flow value of the line, and the connection relationship between the lines and the neural network on the topological structure are used to mine the deep characteristics of the data to determine the attack location of the false data. The present invention determines the identification precision and accuracy of this method by comparing it with other identification methods under different attack levels.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是考虑支路潮流特征的图神经网络FDIAs辨识方法流程图;FIG1 is a flow chart of the graph neural network FDIAs identification method considering branch power flow characteristics;
图2是进行拓扑转换后的IEEE39标准系统线路连接关系;FIG2 is a diagram showing the line connection relationship of the IEEE39 standard system after topology conversion;
图3是图卷积网络和图注意力机制的损失函数下降过程。Figure 3 shows the loss function descent process of the graph convolutional network and graph attention mechanism.
具体实施方式DETAILED DESCRIPTION
下面结合实施例对本发明作进一步说明,但不应该理解为本发明上述主题范围仅限于下述实施例。在不脱离本发明上述技术思想的情况下,根据本领域普通技术知识和惯用手段,做出各种替换和变更,均应包括在本发明的保护范围内。The present invention is further described below in conjunction with the embodiments, but it should not be understood that the above subject matter of the present invention is limited to the following embodiments. Without departing from the above technical ideas of the present invention, various substitutions and changes are made according to the common technical knowledge and customary means in the art, which should all be included in the protection scope of the present invention.
实施例1:Embodiment 1:
参见图1至图3,一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,包括以下步骤:Referring to FIG. 1 to FIG. 3 , a false data injection attack identification method based on line topology analysis and power flow characteristics includes the following steps:
1)获取电力系统历史潮流数据和原始拓扑结构。1) Obtain the historical power flow data and original topology of the power system.
2)对电力系统原始拓扑结构进行转换,得到电力系统转换拓扑结构。2) Convert the original topology of the power system to obtain a converted topology of the power system.
建立转换拓扑结构图的步骤如下:The steps to create a conversion topology diagram are as follows:
2.1)建立用于表征电力系统原始拓扑结构的邻接矩阵AG,即:2.1) Establish the adjacency matrix AG used to characterize the original topological structure of the power system, that is:
根据复杂网络理论和图论的概念,对于一个具有N个节点,M条边的拓扑结构图而言,可以用N*N的节点邻接矩阵AG表示图网络结构,其中矩阵中的元素aij表示为According to the concepts of complex network theory and graph theory, for a topological graph with N nodes and M edges, the graph network structure can be represented by an N*N node adjacency matrix AG , where the elements aij in the matrix are represented as
AG=[aij]N×N AG =[ aij ] N×N
式中,aij表示节点邻接矩阵AG中的元素。vi、vj表示图网络第i个、第j个节点。Where aij represents the elements in the node adjacency matrix AG . vi and vj represent the i-th and j-th nodes in the graph network.
2.2)提取出节点邻接矩阵AG中每个节点的邻接节点数目,并写入元胞数组Acell中。2.2) Extract the number of adjacent nodes of each node in the node adjacency matrix AG and write it into the cell array Acell .
2.3)确定电力系统传统拓扑图中线路的邻接线路,并构建基于线路拓扑结构的元胞数组Ecell。2.3) Determine the adjacent lines of the lines in the traditional topology diagram of the power system and construct a cell array E cell based on the line topology structure.
2.4)以线路作为拓扑结构图的节点,寻找每个线路的邻接线路,从而建立线路邻接矩阵AG’。2.4) Taking the lines as nodes of the topological structure graph, find the adjacent lines of each line, so as to establish the line adjacency matrix AG '.
2.5)根据线路邻接矩阵AG’,建立以线路为节点、线路间联接关系为边的电力系统转换拓扑结构。2.5) According to the line adjacency matrix AG ', a power system conversion topology is established with the lines as nodes and the connection relationships between lines as edges.
3)在历史潮流数据中注入若干攻击数据,得到存在虚假数据的潮流样本数据。3) Inject some attack data into the historical flow data to obtain flow sample data containing false data.
攻击数据a如下所示:The attack data a is as follows:
a=Hc (2)a=Hc (2)
式中,c=[c1,c2,...,cn]T为任意的非零向量。c∈Rn×1。n为状态数量。H为表征电力系统拓扑结构的雅克比矩阵。。Where, c = [c 1 ,c 2 ,..., cn ] T is an arbitrary non-zero vector. c∈R n×1 . n is the number of states. H is the Jacobian matrix that characterizes the topological structure of the power system.
4)提取潮流样本数据的潮流特征值,并为潮流特征值打上是否存在攻击数据的标签。4) Extract the power flow characteristic value of the power flow sample data, and label the power flow characteristic value with whether there is attack data.
潮流特征值包括电气介数和潮流偏移系数指标。The power flow characteristic values include electrical intermediate value and power flow deviation coefficient index.
所述电气介数Be(m,n)如下所示:The electrical intermediate number Be (m,n) is as follows:
式中,L和G分别为电网中的负荷节点与发电节点的集合。Wi和Wj分别表示发电机输出的有功功率和节点负荷值。Iij(m,n)表示在电源节点i和负荷节点j之间接上单位电流源后,线路(m,n)之间的电流变化量。Where L and G are the sets of load nodes and generation nodes in the power grid. Wi and Wj represent the active power output of the generator and the node load value, respectively. Iij (m,n) represents the current change between lines (m,n) after a unit current source is connected between power node i and load node j.
潮流偏移系数指标Mi如下所示:The power flow deviation coefficient index Mi is as follows:
式中,Pi0和Pj0分别表示线路i和线路j的初始有功功率。L为电网中所有输电线路的集合。ΔPji为由于线路i断开引起线路j有功功率的变化量。Where P i0 and P j0 represent the initial active power of line i and line j respectively. L is the set of all transmission lines in the power grid. ΔP ji is the change in active power of line j caused by disconnection of line i.
潮流特征值是经过了预处理的数据。所述预处理包括对数据进行z-score标准化。标准化后x'的数据如下所示:The power flow characteristic value is preprocessed data. The preprocessing includes z-score standardization of the data. The standardized x' data is as follows:
式中,xμ和xσ分别为样本均值和标准差。x表征预处理前的数据。Where xμ and xσ are the sample mean and standard deviation respectively. x represents the data before preprocessing.
5)基于潮流样本数据的潮流特征值,建立用于判断电力系统是否被攻击的图卷积网络模型。5) Based on the power flow characteristic values of the power flow sample data, a graph convolutional network model is established to determine whether the power system is attacked.
建立用于判断电力系统是否被攻击的图卷积网络模型的步骤包括:The steps of establishing a graph convolutional network model for determining whether the power system is attacked include:
5.1)将潮流样本数据的潮流特征值随机划分为测试集和训练集。5.1) Randomly divide the tidal characteristic values of tidal sample data into a test set and a training set.
5.2)搭建图卷积网络。所述图卷积网络模型包括输入层、若干隐藏层和输出层。5.2) Build a graph convolutional network. The graph convolutional network model includes an input layer, several hidden layers and an output layer.
5.3)利用训练集对所述图卷积网络进行训练,得到训练后的图卷积网络。5.3) Using the training set to train the graph convolutional network to obtain a trained graph convolutional network.
5.4)利用测试集对训练后的图卷积网络进行测试,若图卷积网络输出结果精确率大于预设阈值,则完成图卷积网络模型的建立,否则重新获取潮流样本数据及潮流特征值,并返回步骤1)。5.4) Use the test set to test the trained graph convolutional network. If the accuracy of the graph convolutional network output result is greater than the preset threshold, the graph convolutional network model is established. Otherwise, the flow sample data and flow characteristic values are re-obtained and return to step 1).
图卷积网络模型任意两层节点特征值之间的特征学习关系如下所示:The feature learning relationship between the feature values of any two layers of nodes in the graph convolutional network model is as follows:
式中,l表示节点所在的层数。s表示节点vi的邻接节点数量。表示第l层中第ni个节点的特征值。ni为节点i邻居节点的编号。g(·)表示激活函数。w为网络权重。为节点i在第l+1层的特征值。Where l represents the layer number of the node. s represents the number of adjacent nodes of node vi . represents the eigenvalue of the ni-th node in the l-th layer. ni is the number of the neighboring node of node i. g( · ) represents the activation function. w is the network weight. is the eigenvalue of node i at the l+1th layer.
所述图卷积网络模型的输出特征h'如下所示:The output feature h' of the graph convolutional network model is as follows:
式中,αij为注意力系数,W为可共享的网络参数。Where α ij is the attention coefficient and W is the shareable network parameter.
获取注意力系数αij的步骤包括:The steps of obtaining the attention coefficient α ij include:
a)记电力系统转换拓扑结构中全部线路节点的M维特征输入集合为输出特征集合为 a) The M-dimensional feature input set of all line nodes in the power system conversion topology is The output feature set is
b)计算线路节点之间的相互影响程度eij,即:b) Calculate the mutual influence degree e ij between line nodes, that is:
式中,W为可共享参数。[·||·]表示拼接。共享注意力机制a(·)用于将拼接后的特征映射到相关系数eij上,完成节点i和节点j之间相关性的学习。表示输入。Where W is a sharable parameter. [ · || · ] represents concatenation. The shared attention mechanism a( · ) is used to map the concatenated features to the correlation coefficient e ij to complete the learning of the correlation between node i and node j. Represents input.
c)利用非线性激活函数Leaky ReLU单层前馈神经网络进行拼接特征的映射,更新相互影响程度eij如下:c) Use the nonlinear activation function Leaky ReLU single-layer feedforward neural network to map the splicing features and update the mutual influence degree e ij as follows:
其参数为权重向量则相关系数的计算公式可以表示为Its parameter is the weight vector The calculation formula of the correlation coefficient can be expressed as
式中,表示权重向量。In the formula, represents the weight vector.
d)利用softmax函数对相互影响程度eij进行归一化处理,得当注意力系数αij,即:d) Use the softmax function to normalize the mutual influence degree e ij and obtain the appropriate attention coefficient α ij , that is:
图卷积网络模型的激活函数为ELUs函数。表示输入。The activation function of the graph convolutional network model is the ELUs function. Represents input.
ELUs函数如下所示:The ELUs function is as follows:
式中,α为调整参数。x为输入数据。g(x)为输出数据。In the formula, α is the adjustment parameter, x is the input data, and g(x) is the output data.
6)获取电力系统当前潮流数据,并提取当前潮流数据的潮流特征值。将当前潮流数据的潮流特征值输入到所述图卷积网络模型中,判断电力系统线路是否被攻击、受攻击线路。6) Obtaining the current power flow data of the power system and extracting the power flow characteristic value of the current power flow data. Inputting the power flow characteristic value of the current power flow data into the graph convolutional network model to determine whether the power system line is attacked and the attacked line.
实施例2:Embodiment 2:
一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,其步骤如下:A false data injection attack identification method based on line topology analysis and power flow characteristics, the steps are as follows:
1)对电力系统传统拓扑结构进行转换,获取电力系统线路间的拓扑结构。1) Convert the traditional topological structure of the power system to obtain the topological structure between the power system lines.
2)利用电力系统支路潮流数据,基于虚假数据的构造方法给潮流数据注入攻击数据,计算电气介数和潮流偏移系数指标作为线路的潮流特征,并对数据是否存在攻击进行标记。2) Using the power system branch flow data, the attack data is injected into the flow data based on the false data construction method, the electrical intermediate number and flow deviation coefficient indicators are calculated as the flow characteristics of the line, and the data is marked whether there is an attack.
3)选取恰当的图注意力机制激活函数和损失函数,构建基于注意力机制的图神经网络模型。3) Select appropriate graph attention mechanism activation function and loss function, and build a graph neural network model based on the attention mechanism.
4)使用z-score方法对线路潮流特征进行归一化处理,得到量纲一致的节点特征数据集。将归一化的数据集分为训练样本集和测试样本集。4) Use the z-score method to normalize the line flow characteristics and obtain a node feature data set with consistent dimensions. The normalized data set is divided into a training sample set and a test sample set.
5)训练样本集用于图神经网络的参数更新和寻优,测试集用于验证所提方法能够准确辨识被攻击线路,实现虚假数据注入攻击的辨识。5) The training sample set is used for parameter updating and optimization of the graph neural network, and the test set is used to verify that the proposed method can accurately identify the attacked lines and realize the identification of false data injection attacks.
实施例3:Embodiment 3:
一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,主要步骤参见实施例2,其中,建立转换拓扑结构图的主要步骤如下:A false data injection attack identification method based on line topology analysis and power flow characteristics, the main steps of which are shown in Example 2, wherein the main steps of establishing a conversion topology diagram are as follows:
1)根据复杂网络理论和图论的概念,对于一个具有N个节点,M条边的拓扑结构图而言,可以用N*N的邻接矩阵AG表示图网络结构,其中矩阵中的元素aij表示为1) According to the concepts of complex network theory and graph theory, for a topological graph with N nodes and M edges, the graph network structure can be represented by an N*N adjacency matrix AG , where the elements aij in the matrix are represented as
2)根据邻接矩阵AG可知道每个节点的邻接节点数目,在邻接矩阵的行中,取值为1的数目即与该节点相邻的节点数目,从而确定元胞数组中的元素。换言之,aij=1时,即表示两节点相连。使用元胞数组Acell表示。2) According to the adjacency matrix AG , we can know the number of adjacent nodes of each node. In the row of the adjacency matrix, the number of 1s is the number of nodes adjacent to the node, thus determining the elements in the cell array. In other words, when aij = 1, it means that the two nodes are connected. It is represented by the cell array A cell .
3)由于转换后的拓扑图以线路为节点,线路间连接关系为边,需要对电力系统传统拓扑图中的线路进行编号,用以寻找线路的邻接线路构成相应的元胞数组。3) Since the converted topology graph uses lines as nodes and the connection relationship between lines as edges, it is necessary to number the lines in the traditional topology graph of the power system to find the adjacent lines of the lines to form the corresponding cell array.
4)当线路作为拓扑结构图的节点时,寻找每个线路的邻接线路。根据线路编号构成的数组,与对应线路首尾节点相连的线路即支路的邻接矩阵。4) When the line is used as a node in the topological structure diagram, find the adjacent lines of each line. According to the array composed of line numbers, the lines connected to the first and last nodes of the corresponding line are the adjacency matrix of the branch.
5)基于线路拓扑结构的元胞数组Ecell可以建立相应的基于线路的邻接表达矩阵AG’。5) Based on the cell array E cell of the circuit topology structure, the corresponding circuit-based adjacency expression matrix AG ' can be established.
6)以线路邻接矩阵AG’为依据,绘制以线路为节点,线路间联接关系为边的电力系统拓扑图结构。6) Based on the line adjacency matrix AG ', draw the power system topology structure with the lines as nodes and the connection relationships between lines as edges.
7)完成对于电力系统拓扑结构转换模型图的构造。7) Complete the construction of the power system topology transformation model diagram.
实施例4:Embodiment 4:
一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,主要步骤参见实施例2,其中,根据电力系统中各条支路的潮流数据,按照虚假数据的构造方式给原始潮流数据注入攻击量,从而建立各个支路节点的特征矩阵。建立考虑支路潮流的特征矩阵主要包括以下两个方面:A method for identifying false data injection attacks based on line topology analysis and power flow characteristics, the main steps of which are shown in Example 2, wherein, according to the power flow data of each branch in the power system, the attack amount is injected into the original power flow data in accordance with the construction method of false data, thereby establishing a characteristic matrix of each branch node. Establishing a characteristic matrix considering branch power flow mainly includes the following two aspects:
1)虚假数据的构造方式1) How to construct false data
在已知电力系统拓扑结构的情况下,攻击者向测量系统中注入攻击向量a,其满足Given a known power system topology, the attacker injects an attack vector a into the measurement system that satisfies
a=Hc (2)a=Hc (2)
其中,c=[c1,c2,...,cn]T为任意的非零向量,c∈Rn×1,n为状态数量,则量测值变为za=z+a后,状态估计值为Where c = [c 1 ,c 2 ,..., cn ] T is an arbitrary non-zero vector, c∈R n×1 , and n is the number of states. After the measured value becomes za = z+a, the state estimate is
相应地,残差方程变为Accordingly, the residual equation becomes
由式(4)可以看出,在量测数据中存在FDIAs时,残差仍保持在阈值允许的范围内,从而绕过不良数据模块的检测和辨识,成功对电力系统发起攻击。It can be seen from formula (4) that when FDIAs exist in the measurement data, the residual remains within the range allowed by the threshold, thereby bypassing the detection and identification of the bad data module and successfully launching an attack on the power system.
2)考虑支路潮流数据的节点特征值2) Consider the node characteristic value of branch flow data
2.1)电气介数2.1) Electrical dielectric constant
电力系统中的电能由发电机输出,经由线路传输至负荷节点进行功率消耗,且潮流的传播符合基尔霍夫定律。换言之,潮流的大小受支路阻抗大小的影响,在潮流传输过程中,往往流过阻抗值最小的线路。因此,在同时考虑电力拓扑结构和潮流的情况下,以电气介数作为线路节点的特征之一,体现负荷的分布和消耗、发电量的大小与电力系统拓扑结构间的耦合关系,反映了电源和负荷对各条输电线路的使用情况。其计算公式为:The electric energy in the power system is output by the generator and transmitted to the load node through the line for power consumption, and the propagation of the power flow conforms to Kirchhoff's law. In other words, the size of the power flow is affected by the size of the branch impedance. During the power flow transmission process, it often flows through the line with the smallest impedance value. Therefore, while considering the power topology and power flow at the same time, the electrical intermediate number is used as one of the characteristics of the line node, reflecting the distribution and consumption of the load, the size of the power generation and the coupling relationship between the topology of the power system, and reflecting the use of each transmission line by the power source and the load. The calculation formula is:
其中,L和G分别为电网中的负荷节点与发电节点的集合;Wi和Wj分别表示发电机输出的有功功率和节点负荷值;Iij(m,n)表示在电源节点i和负荷节点j之间接上单位电流源后,线路(m,n)之间的电流变化量,也就是单位功率变化值。Among them, L and G are the sets of load nodes and power generation nodes in the power grid respectively; Wi and Wj represent the active power output of the generator and the node load value respectively; Iij (m,n) represents the current change between the lines (m,n) after a unit current source is connected between the power node i and the load node j, that is, the unit power change value.
2.2)潮流偏移系数指标2.2) Flow deviation coefficient index
在考虑电力系统运行状态时,必须需要考虑的因素是潮流在线路间的传输和分布情况。根据电力系统N-1安全原则,当系统中某条线路退出运行时,系统通过潮流的重新分配实现自我调节。如果在自我调节过程中,潮流分配不平衡,比如某些线路承担的潮流量相对较小,而某些线路承担的潮流量过大,使该线路因过载而退出运行,从而产生电力系统连锁故障。潮流偏移系数指标可用于表示某条线路中潮流的变化对整个系统中潮流的影响,定量分析系统中线路间的相互影响。因此使用潮流偏移系数指标作为反应电力系统中潮流的特征之一。该指标的计算公式如下:When considering the operating status of the power system, the factors that must be considered are the transmission and distribution of power flow between lines. According to the N-1 safety principle of the power system, when a line in the system is out of operation, the system achieves self-regulation through the redistribution of power flow. If the power flow distribution is unbalanced during the self-regulation process, for example, some lines bear relatively small amounts of power flow, while some lines bear too much power flow, causing the line to be out of operation due to overload, resulting in a chain failure of the power system. The power flow deviation coefficient index can be used to indicate the impact of changes in power flow in a certain line on the power flow in the entire system, and to quantitatively analyze the mutual influence between lines in the system. Therefore, the power flow deviation coefficient index is used as one of the characteristics of power flow in the power system. The calculation formula of this index is as follows:
式中Pi0和Pj0分别表示线路i和线路j的初始有功功率,L为电网中所有输电线路的集合,ΔPji为由于线路i断开引起线路j有功功率的变化量。Where P i0 and P j0 represent the initial active power of line i and line j respectively, L is the set of all transmission lines in the power grid, and ΔP ji is the change in active power of line j caused by the disconnection of line i.
实施例5:Embodiment 5:
一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,主要步骤参见实施例2,其中,基于注意力机制的卷积神经网络函数选取方式如下:A false data injection attack identification method based on line topology analysis and power flow characteristics, the main steps are shown in Example 2, wherein the convolutional neural network function selection method based on the attention mechanism is as follows:
1)图卷积网络的求解方式1) How to solve graph convolutional networks
图中的节点进行卷积操作时,两个神经单元层的节点特征值之间的特征学习关系为When the nodes in the figure are convolved, the feature learning relationship between the node feature values of the two neural unit layers is
其中,l表示节点所在的层数,s表示节点vi的邻接节点数量,表示第l层中第ni个节点的特征值,ni为节点i邻居节点的编号,在图卷积网络中,节点i在第l+1层的特征值只与其在第l层的邻接节点相关。g(·)表示激活函数,用于对数据特征进行非线性学习,w为网络权重,在训练过程中不断更新。Among them, l represents the layer number of the node, s represents the number of adjacent nodes of node vi , It represents the eigenvalue of the nith node in the lth layer, ni is the number of the neighboring node of node i. In the graph convolutional network, the eigenvalue of node i in the l+1th layer is only related to its neighboring nodes in the lth layer. g( · ) represents the activation function, which is used for nonlinear learning of data features. w is the network weight, which is continuously updated during the training process.
针对由图中节点特征组成的矩阵输入信号x,x∈Rn的图傅里叶变换定义为F(x)=UTx,相应地,傅里叶变换的逆定义为其中表示输入信号经由傅里叶变换后的频域信号结果。变换信号中的元素正是以Laplacian矩阵的特征向量为基的正交空间中图信号的坐标,从而完成将原始输入投影到相应图中的任务。因此,输入信号可转化为其恰好为傅里叶变换的逆。因此,结合卷积神经网络计算公式和谱图理论可得图卷积操作的计算公式为For a matrix input signal x consisting of node features in the graph, the graph Fourier transform of x∈Rn is defined as F(x)= UTx . Correspondingly, the inverse Fourier transform is defined as in It represents the frequency domain signal result after Fourier transform of the input signal. The elements in are the coordinates of the graph signal in the orthogonal space based on the eigenvectors of the Laplacian matrix, thus completing the task of projecting the original input into the corresponding graph. Therefore, the input signal can be converted into It is exactly the inverse of Fourier transform. Therefore, combining the convolutional neural network calculation formula and spectral graph theory, the calculation formula for graph convolution operation is:
其中为输入信号,fl为输入信号的层数,为卷积网络进行更新的参数。in is the input signal, fl is the number of layers of the input signal, Update the parameters of the convolutional network.
在电力信息物理系统中,基于各个支路的导纳矩阵和线路连接情况,每条支路对系统的重要性程度不同,即转换后的拓扑图中边的权值不同。除此之外,各条支路会根据运行需求的不同进行开断,而传统图卷积网络的训练和测试阶段需要使用结构相同的拓扑图,且伴随拓扑结构规模的增长计算成本也随之加大,无法处理动态图问题。为解决这些问题,引入图注意力机制通过网络学习邻接节点的特征权重,对邻接节点特征加权求和,完成图神经网络的卷积操作。In the power cyber-physical system, based on the admittance matrix and line connection of each branch, the importance of each branch to the system is different, that is, the weights of the edges in the converted topology graph are different. In addition, each branch will be disconnected according to different operating requirements, and the training and testing phases of the traditional graph convolutional network require the use of topological graphs with the same structure. The computational cost increases with the growth of the topological structure scale, and it is unable to handle dynamic graph problems. To solve these problems, the graph attention mechanism is introduced to learn the feature weights of adjacent nodes through the network, weighted sum the features of adjacent nodes, and complete the convolution operation of the graph neural network.
2)图注意力机制的函数选取方法2) Function selection method for graph attention mechanism
图注意力机制在图谱卷积神经网络的基础上,根据邻接节点的连接关系和节点特征,计算节点间的连接系数,为其分配不同的权重,以此作为每个节点的差异性考量。对于一个有N条线路的电力系统,转换拓扑结构中全部线路节点的M维特征输入集合表示为其输出特征集合为对于特定节点i,逐个计算邻接节点及自身与其的相关系数,即线路节点之间的相互影响程度,公式如下Based on the graph convolutional neural network, the graph attention mechanism calculates the connection coefficient between nodes according to the connection relationship and node features of adjacent nodes, and assigns different weights to them as a consideration of the difference between each node. For a power system with N lines, the M-dimensional feature input set of all line nodes in the conversion topology is expressed as Its output feature set is For a specific node i, the correlation coefficients of the adjacent nodes and itself with it are calculated one by one, that is, the degree of mutual influence between the line nodes. The formula is as follows
通过可共享参数W的线性变换对原始输入特征进行增强表示并进行拼接[·||·],共享注意力机制a(·)把拼接后的特征映射到相关系数eij上,完成节点i和节点j之间相关性的学习。通常在图注意力机制中,使用负半轴斜率为0.2的非线性激活函数LeakyReLU单层前馈神经网络进行拼接特征的映射,其参数为权重向量则相关系数的计算公式可以表示为The original input features are enhanced and concatenated through the linear transformation of the shared parameter W [ · || · ], and the shared attention mechanism a( · ) maps the concatenated features to the correlation coefficient e ij to complete the learning of the correlation between node i and node j. Usually in the graph attention mechanism, a nonlinear activation function LeakyReLU single-layer feedforward neural network with a negative semi-axis slope of 0.2 is used to map the concatenated features, and its parameters are the weight vector The calculation formula of the correlation coefficient can be expressed as
由于相关系数的量纲不同,通常使用softmax函数对公式(4.5)计算出来的节点间相关系数进行归一化处理,以更好地分配节点之间的权重,求得注意力系数。Due to the different dimensions of the correlation coefficient, the softmax function is usually used to normalize the node correlation coefficient calculated by formula (4.5) to better distribute the weights between nodes and obtain the attention coefficient.
根据归一化后节点间的注意力系数,与图卷积网络相似,将每个节点特征进行加权求和,获得节点的输出特征h'。According to the normalized attention coefficient between nodes, similar to the graph convolutional network, the features of each node are weighted and summed to obtain the output feature h' of the node.
其中,αij为归一化后的注意力系数,W为可共享的网络参数。Among them, α ij is the normalized attention coefficient, and W is the shareable network parameter.
图注意力机制利用注意力系数反应线路节点之间的相关程度,并聚合邻接节点的特征,摆脱了传统图卷积网络对拓扑结构的依赖,适用于拓扑不断变化的系统。对于电力系统而言,由于断路器的开断和线路容量的不同,拓扑结构具有动态特征。在对FDIAs进行辨识时,更适合使用图注意力机制网络进行特征学习和支路遭受攻击与否的判断。The graph attention mechanism uses the attention coefficient to reflect the correlation between line nodes and aggregates the features of adjacent nodes, getting rid of the dependence of traditional graph convolutional networks on topological structures and being suitable for systems with constantly changing topologies. For power systems, the topological structure has dynamic characteristics due to the different opening and closing of circuit breakers and line capacities. When identifying FDIAs, it is more appropriate to use the graph attention mechanism network for feature learning and judging whether the branch is under attack or not.
3)激活函数的选取方法3) Method for selecting activation function
本发明将引入一种新型激活函数:ELUs函数,用于图注意力机制中两个神经单元层中特征的映射,ELUs函数基于ReLU激活函数做出一些改进。ReLU激活函数将负值统一视为0,对正值进行线性输出,因此,该函数的输出值没有负值,对输出进行均值计算时结果大于0,容易对下层产生偏置,产生均值偏移,在对较深的网络进行训练时会出现不收敛的问题。ELUs函数通过引入负值激活函数,有效解决了这一问题,其计算公式如下This invention will introduce a new activation function: ELUs function, which is used to map features in two neural unit layers in the graph attention mechanism. The ELUs function makes some improvements based on the ReLU activation function. The ReLU activation function treats negative values as 0 and outputs positive values linearly. Therefore, the output value of this function has no negative values. When the output is averaged, the result is greater than 0, which is easy to bias the lower layer and produce mean shift. When training deeper networks, there will be non-convergence problems. The ELUs function effectively solves this problem by introducing a negative value activation function. Its calculation formula is as follows
式中的α为调整参数,控制ELUs激活函数的负值部分达到饱和的位置。The α in the formula is an adjustment parameter that controls the position where the negative part of the ELUs activation function reaches saturation.
本发明在使用图注意力机制对电力系统拓扑图进行训练学习时,由于节点数量较多,且支路的断开会改变拓扑结构,因此选用噪声鲁棒性强的ELUs作为激活函数,避免训练不收敛的问题。When the present invention uses the graph attention mechanism to train and learn the power system topology graph, due to the large number of nodes and the disconnection of branches will change the topology structure, ELUs with strong noise robustness are selected as the activation function to avoid the problem of non-convergence of training.
实施例6:Embodiment 6:
一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,主要步骤参见实施例2,其中,为使节点特征的量纲保持一致,需对数据进行预处理,处理方法如下:A false data injection attack identification method based on line topology analysis and power flow characteristics, the main steps are shown in Example 2, wherein, in order to make the dimension of the node characteristics consistent, the data needs to be preprocessed, and the processing method is as follows:
常见的min-max归一化方法基于样本中最大值和最小值的差值对数据进行处理。对本发明实际应用的电力系统场景而言,考虑到输电线路断线对拓扑结构的影响(如因为线路退出运行到时功率为0),样本中可能会出现少量偏离样本均值的数据点。传统方法中基于最大值或最小值对数据进行预处理,可能会受偏离数据的影响。因此,本发明选择了考虑样本整体信息的z-score标准化方法对数据进行预处理,该方法选取样本标准差和均值对原始数据进行处理,有效解决了少量偏离数据对数据归一化的影响,又保证了原有数据的分布特征,有利于特征提取。其计算公式为The common min-max normalization method processes the data based on the difference between the maximum and minimum values in the sample. For the power system scenario in which the present invention is actually applied, considering the impact of transmission line disconnection on the topology (such as because the power is 0 when the line is out of operation), a small number of data points that deviate from the sample mean may appear in the sample. The traditional method pre-processes the data based on the maximum or minimum value, which may be affected by the deviated data. Therefore, the present invention selects the z-score normalization method that considers the overall information of the sample to pre-process the data. This method selects the sample standard deviation and mean to process the original data, which effectively solves the impact of a small amount of deviated data on data normalization, and ensures the distribution characteristics of the original data, which is conducive to feature extraction. Its calculation formula is
其中,xμ和xσ分别为样本均值和标准差。Where xμ and xσ are the sample mean and standard deviation respectively.
实施例7:Embodiment 7:
一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,主要步骤参见实施例2,其中,使用训练数据样本和测试数据样本对所提方法进行参数调整和寻优的过程如下:A false data injection attack identification method based on line topology analysis and power flow characteristics, the main steps of which are shown in Example 2, wherein the process of adjusting parameters and optimizing the proposed method using training data samples and test data samples is as follows:
读取电力系统的线路导纳矩阵和历史运行负荷数据,获取节点邻接矩阵,构造以线路为节点,线路间连接关系为边的转换拓扑结构图。Read the line admittance matrix and historical operating load data of the power system, obtain the node adjacency matrix, and construct a conversion topology diagram with lines as nodes and connection relationships between lines as edges.
基于历史符合数据,使用牛拉法计算线路中的潮流数据,利用虚假数据构造方法,给历史潮流注入虚假数据,构建存在虚假数据的潮流样本。基于现有潮流数据,计算考虑潮流运行特征的节点特征矩阵,作为图注意力机制神经网络的输入,进行被攻击线路的判定。Based on historical data, the Newton method is used to calculate the flow data in the line. The false data construction method is used to inject false data into the historical flow to construct a flow sample with false data. Based on the existing flow data, the node feature matrix considering the flow operation characteristics is calculated as the input of the graph attention mechanism neural network to determine the attacked line.
将计算完备的节点特征数据按照归一化公式进行预处理,并分为测试样本和训练样本。训练样本数据用于调整基于图注意力机制的卷积网络的参数,构造一个以节点是否被攻击为最终目的的图卷积网络模型。测试样本用于验证FDIAs辨识方法的有效性,对具体被攻击的线路进行判定;如果不存在FDIAs,辨识流程结束。The calculated node feature data is preprocessed according to the normalization formula and divided into test samples and training samples. The training sample data is used to adjust the parameters of the convolutional network based on the graph attention mechanism and construct a graph convolutional network model with the ultimate goal of whether the node is attacked. The test sample is used to verify the effectiveness of the FDIAs identification method and determine the specific attacked line; if there is no FDIAs, the identification process ends.
实施例8:Embodiment 8:
一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法的实验,主要步骤如下:An experiment of a false data injection attack identification method based on line topology analysis and power flow characteristics. The main steps are as follows:
1)对电力系统传统拓扑结构进行转换,获取电力系统线路间的拓扑结构。使用Pytorch深度学习框架对IEEE39节点标准算例线路间的相关关系进行绘制,共有46条线路。需要注意的是,Python运行过程中,编号的初始值为0,因此,图中编号取值为0-45。本拓扑结构图中的线路编号基于PowerWorld潮流仿真计算的结果,最终的拓扑结构转换结果见图2。1) Convert the traditional topology of the power system to obtain the topology between the power system lines. Use the Pytorch deep learning framework to draw the correlation between the lines of the IEEE39 node standard example, with a total of 46 lines. It should be noted that during the Python running process, the initial value of the number is 0, so the number in the figure is 0-45. The line numbering in this topology diagram is based on the results of the PowerWorld power flow simulation calculation. The final topology conversion result is shown in Figure 2.
2)利用电力系统支路潮流数据,基于虚假数据的构造方法给潮流数据注入攻击数据,计算电气介数和潮流偏移系数指标作为线路的潮流特征,并对数据是否存在攻击进行标记。给IEEE39节点接入国内某地区变电站一周内的连续时间负荷,按照IEEE39节点的负荷数据进行处理,获得负荷数据的标幺值,带入IEEE39系统中获取潮流数据。最终的节点特征计算结果见表1。2) Using the power system branch flow data, based on the construction method of false data, the attack data is injected into the flow data, the electrical intermediate number and flow deviation coefficient index are calculated as the flow characteristics of the line, and the data is marked whether there is an attack. The IEEE39 node is connected to the continuous time load of a substation in a certain area of the country within a week, and the load data of the IEEE39 node is processed to obtain the per-unit value of the load data, which is brought into the IEEE39 system to obtain the flow data. The final node feature calculation results are shown in Table 1.
表1各节点特征值Table 1 Eigenvalues of each node
从表1可以明显看出,线路的电气介数大小与拓扑图中各个节点之间的度存在一定的关系,在充分考虑拓扑结构的基础上,反映了各个节点(即各条线路)潮流的分布状态。对于不同的线路节点,部分指标数值偏差较大且各项指标量纲不同,为保障检测模型正常工作,实现对被攻击线路的辨识,按照z-score归一化的方法将节点特征矩阵中的各项指标进行归一化处理,作为基于图注意力机制的神经网络的节点矩阵进行后续的计算。It can be clearly seen from Table 1 that there is a certain relationship between the size of the electrical betweenness of the line and the degree between each node in the topological diagram. On the basis of fully considering the topological structure, it reflects the distribution state of the power flow of each node (i.e., each line). For different line nodes, the numerical deviation of some indicators is large and the dimensions of each indicator are different. In order to ensure the normal operation of the detection model and realize the identification of the attacked line, the indicators in the node feature matrix are normalized according to the z-score normalization method, and used as the node matrix of the neural network based on the graph attention mechanism for subsequent calculations.
3)选取恰当的图注意力机制激活函数和损失函数,构建基于注意力机制的图神经网络模型。本发明选择ELUs作为激活函数,选择交叉熵作为损失函数,在对注意力机制进行更新的过程中,通过使用LeakyReLU激活函数和激活函数的映射,确定转换拓扑结构图中各节点的权重系数。其中,该神经网路的收敛过程对比见图3,检测性能见表2。3) Select appropriate graph attention mechanism activation function and loss function to construct a graph neural network model based on the attention mechanism. The present invention selects ELUs as the activation function and cross entropy as the loss function. In the process of updating the attention mechanism, the weight coefficient of each node in the conversion topology diagram is determined by using the LeakyReLU activation function and the mapping of the activation function. The convergence process of the neural network is compared in Figure 3, and the detection performance is shown in Table 2.
表2基于IEEE39标准系统的算例性能指标结果Table 2 Performance index results of the example based on the IEEE39 standard system
4)使用z-score方法对线路潮流特征进行归一化处理,得到量纲一致的节点特征数据集。将归一化的数据集分为训练样本集和测试样本集。按照z-score的归一化方程计算表1中各节点特征的归一化结果,并带入步骤3)确定的图注意力机制卷积网络中进行结算。4) Use the z-score method to normalize the line flow characteristics to obtain a node feature data set with consistent dimensions. The normalized data set is divided into a training sample set and a test sample set. According to the z-score normalization equation, the normalized results of each node feature in Table 1 are calculated and brought into the graph attention mechanism convolutional network determined in step 3) for settlement.
5)训练样本集用于图神经网络的参数更新和寻优,测试集用于验证所提方法能够准确辨识被攻击线路,实现虚假数据注入攻击的辨识。在不同幅值扰动σ下,其中幅值扰动分别设置为0.005,0.05和0.1,与其他虚假数据辨识方法进行对比,最终结果见表3。5) The training sample set is used for parameter update and optimization of the graph neural network, and the test set is used to verify that the proposed method can accurately identify the attacked lines and realize the identification of false data injection attacks. Under different amplitude perturbations σ, where the amplitude perturbations are set to 0.005, 0.05 and 0.1 respectively, compared with other false data identification methods, the final results are shown in Table 3.
表3不同方法辨识结果对比分析Table 3 Comparative analysis of identification results of different methods
从表3中的数据来看,基于传统拓扑结构的图卷积网络、卷积神经网络与不良数据融合的算法和本发明所提出的基于线路拓扑结构图的卷积网络,在精度和召回率上没有太大差别。然而,当状态值的幅值扰动增大时,前两种方法的准确率和精度不断下降,而本发明所提方法的检测精度和召回率在小范围内逐步上升,保持平稳水平。这是因为前两种方法都在原始拓扑结构的基础上,对节点的状态估计值进行辨识分析,当系统中出现幅值扰动时,扰动幅值越大,正常数据被误判的可能性越大,导致检测性能有所下降。本发明所提的方法,考虑线路之间的连接关系和潮流数据特征,以线路为基础,当系统中出现扰动时更能反应系统特征。From the data in Table 3, there is not much difference in accuracy and recall between the graph convolutional network based on the traditional topology structure, the algorithm of convolutional neural network and bad data fusion, and the convolutional network based on the line topology structure graph proposed in the present invention. However, when the amplitude disturbance of the state value increases, the accuracy and precision of the first two methods continue to decrease, while the detection accuracy and recall rate of the method proposed in the present invention gradually increase within a small range and maintain a stable level. This is because the first two methods identify and analyze the state estimation value of the node on the basis of the original topology structure. When the amplitude disturbance occurs in the system, the larger the disturbance amplitude, the greater the possibility of misjudgment of normal data, resulting in a decrease in detection performance. The method proposed in the present invention takes into account the connection relationship between the lines and the characteristics of the flow data, and is based on the line, which can better reflect the system characteristics when disturbance occurs in the system.
实施例9:Embodiment 9:
参见图1,一种基于线路拓扑分析和潮流特性的虚假数据注入攻击辨识方法,主要包括以下步骤:Referring to FIG1 , a false data injection attack identification method based on line topology analysis and power flow characteristics mainly includes the following steps:
1)对电力系统传统拓扑结构进行转换,获取电力系统线路间的拓扑结构。1) Convert the traditional topological structure of the power system to obtain the topological structure between the power system lines.
对电力系统传统拓扑结构进行转换的主要步骤如下:The main steps to convert the traditional topology of the power system are as follows:
1.1)根据复杂网络理论和图论的概念,对于一个具有N个节点,M条边的拓扑结构图而言,可以用N*N的邻接矩阵AG表示图网络结构,其中矩阵中的元素aij表示为1.1) According to the concepts of complex network theory and graph theory, for a topological graph with N nodes and M edges, the graph network structure can be represented by an N*N adjacency matrix AG, where the element aij in the matrix is represented as
1.2)根据邻接矩阵AG可知道每个节点的邻接节点数目,在邻接矩阵的行中,取值为1的数目即与该节点相邻的节点数目,从而确定元胞数组中的元素。换言之,aij=1时,即表示两节点相连。使用元胞数组Acell表示。1.2) According to the adjacency matrix AG, we can know the number of adjacent nodes of each node. In the row of the adjacency matrix, the number of 1s is the number of nodes adjacent to the node, thus determining the elements in the cell array. In other words, when aij=1, it means that the two nodes are connected. It is represented by the cell array Acell.
1.3)由于转换后的拓扑图以线路为节点,线路间连接关系为边,需要对电力系统传统拓扑图中的线路进行编号,用以寻找线路的邻接线路构成相应的元胞数组。1.3) Since the converted topology graph uses lines as nodes and the connection relationship between lines as edges, it is necessary to number the lines in the traditional topology graph of the power system to find the adjacent lines of the lines to form the corresponding cell array.
1.4)当线路作为拓扑结构图的节点时,寻找每个线路的邻接线路。根据线路编号构成的数组,与对应线路首尾节点相连的线路即支路的邻接矩阵。1.4) When the line is used as a node in the topological structure diagram, find the adjacent lines of each line. According to the array composed of line numbers, the lines connected to the first and last nodes of the corresponding line are the adjacency matrix of the branch.
1.5)基于线路拓扑结构的元胞数组Ecell可以建立相应的基于线路的邻接表达矩阵AG’。1.5) Based on the cell array Ecell of the circuit topology structure, the corresponding circuit-based adjacency expression matrix AG’ can be established.
1.6)以线路邻接矩阵AG’为依据,绘制以线路为节点,线路间联接关系为边的电力系统拓扑图结构。1.6) Based on the line adjacency matrix AG’, draw the power system topology structure with the lines as nodes and the connection relationships between lines as edges.
1.7)完成对于电力系统拓扑结构转换模型图的构造。1.7) Complete the construction of the power system topology transformation model diagram.
2)利用电力系统支路潮流数据,基于虚假数据的构造方法给潮流数据注入攻击数据,计算电气介数和潮流偏移系数指标作为线路的潮流特征,并对数据是否存在攻击进行标记。2) Using the power system branch flow data, the attack data is injected into the flow data based on the false data construction method, the electrical intermediate number and flow deviation coefficient indicators are calculated as the flow characteristics of the line, and the data is marked whether there is an attack.
根据电力系统中各条支路的潮流数据,按照虚假数据的构造方式给原始潮流数据注入攻击量,从而建立各个支路节点的特征矩阵。建立考虑支路潮流的特征矩阵主要包括以下两个方面:According to the flow data of each branch in the power system, the attack amount is injected into the original flow data according to the construction method of false data, so as to establish the characteristic matrix of each branch node. The establishment of the characteristic matrix considering the branch flow mainly includes the following two aspects:
2.1)虚假数据的构造方式2.1) How to construct fake data
在已知电力系统拓扑结构的情况下,攻击者向测量系统中注入攻击向量a,其满足Given a known power system topology, the attacker injects an attack vector a into the measurement system that satisfies
a=Hc (2)a=Hc (2)
其中,c=[c1,c2,...,cn]T为任意的非零向量,c∈Rn×1,n为状态数量,则量测值变为za=z+a后,状态估计值为Where c = [c 1 ,c 2 ,..., cn ] T is an arbitrary non-zero vector, c∈R n×1 , and n is the number of states. After the measured value becomes za = z+a, the state estimate is
相应地,残差方程变为Accordingly, the residual equation becomes
由式(4)可以看出,在量测数据中存在FDIAs时,残差仍保持在阈值允许的范围内,从而绕过不良数据模块的检测和辨识,成功对电力系统发起攻击。It can be seen from formula (4) that when FDIAs exist in the measurement data, the residual remains within the range allowed by the threshold, thereby bypassing the detection and identification of the bad data module and successfully launching an attack on the power system.
2.2)考虑支路潮流数据的节点特征值2.2) Considering the node characteristic values of branch flow data
2.2.1)电气介数2.2.1) Electrical dielectric constant
电力系统中的电能由发电机输出,经由线路传输至负荷节点进行功率消耗,且潮流的传播符合基尔霍夫定律。换言之,潮流的大小受支路阻抗大小的影响,在潮流传输过程中,往往流过阻抗值最小的线路。因此,在同时考虑电力拓扑结构和潮流的情况下,以电气介数作为线路节点的特征之一,体现负荷的分布和消耗、发电量的大小与电力系统拓扑结构间的耦合关系,反映了电源和负荷对各条输电线路的使用情况。其计算公式为:The electric energy in the power system is output by the generator and transmitted to the load node through the line for power consumption, and the propagation of the power flow conforms to Kirchhoff's law. In other words, the size of the power flow is affected by the size of the branch impedance. During the power flow transmission process, it often flows through the line with the smallest impedance value. Therefore, while considering the power topology and power flow at the same time, the electrical intermediate number is used as one of the characteristics of the line node, reflecting the distribution and consumption of the load, the size of the power generation and the coupling relationship between the topology of the power system, and reflecting the use of each transmission line by the power source and the load. The calculation formula is:
其中,L和G分别为电网中的负荷节点与发电节点的集合;Wi和Wj分别表示发电机输出的有功功率和节点负荷值;Iij(m,n)表示在电源节点i和负荷节点j之间接上单位电流源后,线路(m,n)之间的电流变化量,也就是单位功率变化值。Among them, L and G are the sets of load nodes and power generation nodes in the power grid respectively; Wi and Wj represent the active power output of the generator and the node load value respectively; Iij (m,n) represents the current change between the lines (m,n) after a unit current source is connected between the power node i and the load node j, that is, the unit power change value.
2.2.2)潮流偏移系数指标2.2.2) Flow deviation coefficient index
在考虑电力系统运行状态时,必须需要考虑的因素是潮流在线路间的传输和分布情况。根据电力系统N-1安全原则,当系统中某条线路退出运行时,系统通过潮流的重新分配实现自我调节。如果在自我调节过程中,潮流分配不平衡,比如某些线路承担的潮流量相对较小,而某些线路承担的潮流量过大,使该线路因过载而退出运行,从而产生电力系统连锁故障。潮流偏移系数指标可用于表示某条线路中潮流的变化对整个系统中潮流的影响,定量分析系统中线路间的相互影响。因此使用潮流偏移系数指标作为反应电力系统中潮流的特征之一。该指标的计算公式如下:When considering the operating status of the power system, the factors that must be considered are the transmission and distribution of power flow between lines. According to the N-1 safety principle of the power system, when a line in the system is out of operation, the system achieves self-regulation through the redistribution of power flow. If the power flow distribution is unbalanced during the self-regulation process, for example, some lines bear relatively small amounts of power flow, while some lines bear too much power flow, causing the line to be out of operation due to overload, resulting in a chain failure of the power system. The power flow deviation coefficient index can be used to indicate the impact of changes in power flow in a certain line on the power flow in the entire system, and to quantitatively analyze the mutual influence between lines in the system. Therefore, the power flow deviation coefficient index is used as one of the characteristics of power flow in the power system. The calculation formula of this index is as follows:
式中Pi0和Pj0分别表示线路i和线路j的初始有功功率,L为电网中所有输电线路的集合,ΔPji为由于线路i断开引起线路j有功功率的变化量。Where P i0 and P j0 represent the initial active power of line i and line j respectively, L is the set of all transmission lines in the power grid, and ΔP ji is the change in active power of line j caused by the disconnection of line i.
3)选取恰当的图注意力机制激活函数和损失函数,构建基于注意力机制的图神经网络模型。3) Select appropriate graph attention mechanism activation function and loss function, and build a graph neural network model based on the attention mechanism.
图注意力机制激活函数和损失函数的选取方法如下:The method for selecting the activation function and loss function of the graph attention mechanism is as follows:
3.1)图卷积网络的求解方式3.1) Graph Convolutional Network Solution
图中的节点进行卷积操作时,两个神经单元层的节点特征值之间的特征学习关系为When the nodes in the figure are convolved, the feature learning relationship between the node feature values of the two neural unit layers is
其中,l表示节点所在的层数,s表示节点vi的邻接节点数量,表示第l层中第ni个节点的特征值,ni为节点i邻居节点的编号,在图卷积网络中,节点i在第l+1层的特征值只与其在第l层的邻接节点相关。g(·)表示激活函数,用于对数据特征进行非线性学习,w为网络权重,在训练过程中不断更新。Among them, l represents the layer number of the node, s represents the number of adjacent nodes of node vi , It represents the eigenvalue of the nith node in the lth layer, ni is the number of the neighboring node of node i. In the graph convolutional network, the eigenvalue of node i in the l+1th layer is only related to its neighboring nodes in the lth layer. g( · ) represents the activation function, which is used for nonlinear learning of data features. w is the network weight, which is continuously updated during the training process.
针对由图中节点特征组成的矩阵输入信号x,x∈Rn的图傅里叶变换定义为F(x)=UTx,相应地,傅里叶变换的逆定义为其中表示输入信号经由傅里叶变换后的频域信号结果。变换信号中的元素正是以Laplacian矩阵的特征向量为基的正交空间中图信号的坐标,从而完成将原始输入投影到相应图中的任务。因此,输入信号可转化为其恰好为傅里叶变换的逆。因此,结合卷积神经网络计算公式和谱图理论可得图卷积操作的计算公式为For a matrix input signal x consisting of node features in the graph, the graph Fourier transform of x∈Rn is defined as F(x)= UTx . Correspondingly, the inverse Fourier transform is defined as in It represents the frequency domain signal result after Fourier transform of the input signal. The elements in are the coordinates of the graph signal in the orthogonal space based on the eigenvectors of the Laplacian matrix, thus completing the task of projecting the original input into the corresponding graph. Therefore, the input signal can be converted into It is exactly the inverse of Fourier transform. Therefore, combining the convolutional neural network calculation formula and spectral graph theory, the calculation formula for graph convolution operation is:
其中为输入信号,fl为输入信号的层数,为卷积网络进行更新的参数。in is the input signal, fl is the number of layers of the input signal, Update the parameters of the convolutional network.
在电力信息物理系统中,基于各个支路的导纳矩阵和线路连接情况,每条支路对系统的重要性程度不同,即转换后的拓扑图中边的权值不同。除此之外,各条支路会根据运行需求的不同进行开断,而传统图卷积网络的训练和测试阶段需要使用结构相同的拓扑图,且伴随拓扑结构规模的增长计算成本也随之加大,无法处理动态图问题。为解决这些问题,引入图注意力机制通过网络学习邻接节点的特征权重,对邻接节点特征加权求和,完成图神经网络的卷积操作。In the power cyber-physical system, based on the admittance matrix and line connection of each branch, the importance of each branch to the system is different, that is, the weights of the edges in the converted topology graph are different. In addition, each branch will be disconnected according to different operating requirements, and the training and testing phases of the traditional graph convolutional network require the use of topological graphs with the same structure. The computational cost increases with the growth of the topological structure scale, and it is unable to handle dynamic graph problems. To solve these problems, the graph attention mechanism is introduced to learn the feature weights of adjacent nodes through the network, weighted sum the features of adjacent nodes, and complete the convolution operation of the graph neural network.
3.2)图注意力机制的函数选取方法3.2) Function Selection Method for Graph Attention Mechanism
图注意力机制在图谱卷积神经网络的基础上,根据邻接节点的连接关系和节点特征,计算节点间的连接系数,为其分配不同的权重,以此作为每个节点的差异性考量。对于一个有N条线路的电力系统,转换拓扑结构中全部线路节点的M维特征输入集合表示为其输出特征集合为对于特定节点i,逐个计算邻接节点及自身与其的相关系数,即线路节点之间的相互影响程度,公式如下Based on the graph convolutional neural network, the graph attention mechanism calculates the connection coefficient between nodes according to the connection relationship and node features of adjacent nodes, and assigns different weights to them as a consideration of the difference between each node. For a power system with N lines, the M-dimensional feature input set of all line nodes in the conversion topology is expressed as Its output feature set is For a specific node i, the correlation coefficients of the adjacent nodes and itself with it are calculated one by one, that is, the degree of mutual influence between the line nodes. The formula is as follows
通过可共享参数W的线性变换对原始输入特征进行增强表示并进行拼接[·||·],共享注意力机制a(·)把拼接后的特征映射到相关系数eij上,完成节点i和节点j之间相关性的学习。通常在图注意力机制中,使用负半轴斜率为0.2的非线性激活函数LeakyReLU单层前馈神经网络进行拼接特征的映射,其参数为权重向量则相关系数的计算公式可以表示为The original input features are enhanced and concatenated through the linear transformation of the shared parameter W [ · || · ], and the shared attention mechanism a( · ) maps the concatenated features to the correlation coefficient e ij to complete the learning of the correlation between node i and node j. Usually in the graph attention mechanism, a nonlinear activation function LeakyReLU single-layer feedforward neural network with a negative semi-axis slope of 0.2 is used to map the concatenated features, and its parameters are the weight vector The calculation formula of the correlation coefficient can be expressed as
由于相关系数的量纲不同,通常使用softmax函数对公式(4.5)计算出来的节点间相关系数进行归一化处理,以更好地分配节点之间的权重,求得注意力系数。Due to the different dimensions of the correlation coefficient, the softmax function is usually used to normalize the node correlation coefficient calculated by formula (4.5) to better distribute the weights between nodes and obtain the attention coefficient.
根据归一化后节点间的注意力系数,与图卷积网络相似,将每个节点特征进行加权求和,获得节点的输出特征h'。According to the normalized attention coefficient between nodes, similar to the graph convolutional network, the features of each node are weighted and summed to obtain the output feature h' of the node.
其中,αij为归一化后的注意力系数,W为可共享的网络参数。Among them, α ij is the normalized attention coefficient, and W is the shareable network parameter.
图注意力机制利用注意力系数反应线路节点之间的相关程度,并聚合邻接节点的特征,摆脱了传统图卷积网络对拓扑结构的依赖,适用于拓扑不断变化的系统。对于电力系统而言,由于断路器的开断和线路容量的不同,拓扑结构具有动态特征。在对FDIAs进行辨识时,更适合使用图注意力机制网络进行特征学习和支路遭受攻击与否的判断。The graph attention mechanism uses the attention coefficient to reflect the correlation between line nodes and aggregates the features of adjacent nodes, getting rid of the dependence of traditional graph convolutional networks on topological structures and being suitable for systems with constantly changing topologies. For power systems, the topological structure has dynamic characteristics due to the different opening and closing of circuit breakers and line capacities. When identifying FDIAs, it is more appropriate to use the graph attention mechanism network for feature learning and judging whether the branch is under attack or not.
3.3)激活函数的选取方法3.3) Method for selecting activation function
本发明将引入一种新型激活函数:ELUs函数,用于图注意力机制中两个神经单元层中特征的映射,ELUs函数基于ReLU激活函数做出一些改进。ReLU激活函数将负值统一视为0,对正值进行线性输出,因此,该函数的输出值没有负值,对输出进行均值计算时结果大于0,容易对下层产生偏置,产生均值偏移,在对较深的网络进行训练时会出现不收敛的问题。ELUs函数通过引入负值激活函数,有效解决了这一问题,其计算公式如下This invention will introduce a new activation function: ELUs function, which is used to map features in two neural unit layers in the graph attention mechanism. The ELUs function makes some improvements based on the ReLU activation function. The ReLU activation function treats negative values as 0 and outputs positive values linearly. Therefore, the output value of this function has no negative values. When the output is averaged, the result is greater than 0, which is easy to bias the lower layer and produce mean shift. When training deeper networks, there will be non-convergence problems. The ELUs function effectively solves this problem by introducing a negative value activation function. Its calculation formula is as follows
式中的α为调整参数,控制ELUs激活函数的负值部分达到饱和的位置。The α in the formula is an adjustment parameter that controls the position where the negative part of the ELUs activation function reaches saturation.
本发明在使用图注意力机制对电力系统拓扑图进行训练学习时,由于节点数量较多,且支路的断开会改变拓扑结构,因此选用噪声鲁棒性强的ELUs作为激活函数,避免训练不收敛的问题。When the present invention uses the graph attention mechanism to train and learn the power system topology graph, due to the large number of nodes and the disconnection of branches will change the topology structure, ELUs with strong noise robustness are selected as the activation function to avoid the problem of non-convergence of training.
4)使用z-score方法对线路潮流特征进行归一化处理,得到量纲一致的节点特征数据集。将归一化的数据集分为训练样本集和测试样本集。4) Use the z-score method to normalize the line flow characteristics and obtain a node feature data set with consistent dimensions. The normalized data set is divided into a training sample set and a test sample set.
常见的min-max归一化方法基于样本中最大值和最小值的差值对数据进行处理。对本发明实际应用的电力系统场景而言,考虑到输电线路断线对拓扑结构的影响(如因为线路退出运行到时功率为0),样本中可能会出现少量偏离样本均值的数据点。传统方法中基于最大值或最小值对数据进行预处理,可能会受偏离数据的影响。因此,本发明选择了考虑样本整体信息的z-score标准化方法对数据进行预处理,该方法选取样本标准差和均值对原始数据进行处理,有效解决了少量偏离数据对数据归一化的影响,又保证了原有数据的分布特征,有利于特征提取。其计算公式为The common min-max normalization method processes the data based on the difference between the maximum and minimum values in the sample. For the power system scenario in which the present invention is actually applied, considering the impact of transmission line disconnection on the topology (such as because the power is 0 when the line is out of operation), a small number of data points that deviate from the sample mean may appear in the sample. The traditional method pre-processes the data based on the maximum or minimum value, which may be affected by the deviated data. Therefore, the present invention selects the z-score normalization method that considers the overall information of the sample to pre-process the data. This method selects the sample standard deviation and mean to process the original data, which effectively solves the impact of a small amount of deviated data on data normalization, and ensures the distribution characteristics of the original data, which is conducive to feature extraction. Its calculation formula is
其中,xμ和xσ分别为样本均值和标准差。Where xμ and xσ are the sample mean and standard deviation respectively.
5)训练样本集用于图神经网络的参数更新和寻优,测试集用于验证所提方法能够准确辨识被攻击线路,实现虚假数据注入攻击的辨识。5) The training sample set is used for parameter updating and optimization of the graph neural network, and the test set is used to verify that the proposed method can accurately identify the attacked lines and realize the identification of false data injection attacks.
使用训练数据样本和测试数据样本对所提方法进行参数调整和寻优的过程如下:The process of adjusting and optimizing the parameters of the proposed method using training data samples and test data samples is as follows:
5.1)读取电力系统的线路导纳矩阵和历史运行负荷数据,获取节点邻接矩阵,构造以线路为节点,线路间连接关系为边的转换拓扑结构图。5.1) Read the line admittance matrix and historical operating load data of the power system, obtain the node adjacency matrix, and construct a conversion topology diagram with lines as nodes and the connection relationships between lines as edges.
5.2)基于历史符合数据,使用牛拉法计算线路中的潮流数据,利用虚假数据构造方法,给历史潮流注入虚假数据,构建存在虚假数据的潮流样本。基于现有潮流数据,计算考虑潮流运行特征的节点特征矩阵,作为图注意力机制神经网络的输入,进行被攻击线路的判定。5.2) Based on the historical data, the Newton method is used to calculate the flow data in the line. The false data construction method is used to inject false data into the historical flow to construct a flow sample with false data. Based on the existing flow data, the node feature matrix considering the flow operation characteristics is calculated as the input of the graph attention mechanism neural network to determine the attacked line.
5.3)将计算完备的节点特征数据按照归一化公式进行预处理,并分为测试样本和训练样本。训练样本数据用于调整基于图注意力机制的卷积网络的参数,构造一个以节点是否被攻击为最终目的的图卷积网络模型。测试样本用于验证FDIAs辨识方法的有效性,对具体被攻击的线路进行判定;如果不存在FDIAs,辨识流程结束。5.3) The calculated node feature data is preprocessed according to the normalization formula and divided into test samples and training samples. The training sample data is used to adjust the parameters of the convolutional network based on the graph attention mechanism and construct a graph convolutional network model with the ultimate goal of whether the node is attacked. The test sample is used to verify the effectiveness of the FDIAs identification method and determine the specific attacked line; if there is no FDIAs, the identification process ends.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110729263.6A CN113904786B (en) | 2021-06-29 | 2021-06-29 | False data injection attack identification method based on line topology analysis and tide characteristics |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110729263.6A CN113904786B (en) | 2021-06-29 | 2021-06-29 | False data injection attack identification method based on line topology analysis and tide characteristics |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113904786A CN113904786A (en) | 2022-01-07 |
CN113904786B true CN113904786B (en) | 2023-05-30 |
Family
ID=79187535
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110729263.6A Expired - Fee Related CN113904786B (en) | 2021-06-29 | 2021-06-29 | False data injection attack identification method based on line topology analysis and tide characteristics |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113904786B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114050975B (en) * | 2022-01-10 | 2022-04-19 | 苏州浪潮智能科技有限公司 | Heterogeneous multi-node interconnection topology generation method and storage medium |
CN114527651B (en) * | 2022-01-21 | 2025-03-11 | 深圳市三旺通信股份有限公司 | Control system attack detection method, detection system, device and storage medium |
CN114615042B (en) * | 2022-03-08 | 2023-04-07 | 中国矿业大学 | Attack defense method for power generator to maliciously attack power grid to gain profit |
CN114865638B (en) * | 2022-03-22 | 2024-11-08 | 武汉大学 | A low-voltage load shedding emergency control method for power grid based on graph deep reinforcement learning |
CN114757502B (en) * | 2022-03-25 | 2025-03-07 | 国网浙江省电力有限公司温州供电公司 | A method for determining the importance of power grid nodes based on active power flow and node classification |
CN114978586B (en) * | 2022-04-12 | 2023-07-04 | 东北电力大学 | Power grid attack detection method and system based on attack genes and electronic equipment |
CN114861874B (en) * | 2022-04-19 | 2025-05-06 | 重庆大学 | Model-driven graph convolutional neural network power flow calculation method |
CN115021226A (en) * | 2022-06-22 | 2022-09-06 | 中国电力科学研究院有限公司 | Method, device, equipment and medium for judging the weak degree of power grid lines |
CN115144695B (en) * | 2022-06-29 | 2023-09-19 | 国网北京市电力公司 | Methods, devices, equipment and media for finding fault lines in small current grounding systems |
CN115426168A (en) * | 2022-08-31 | 2022-12-02 | 东北大学秦皇岛分校 | False data injection attack positioning detection method and system based on graph convolution network |
CN116304621B (en) * | 2023-03-01 | 2024-06-04 | 浙江大学 | Smart grid false data injection attack positioning method based on frequency spectrum domain data driving |
CN119728453B (en) * | 2025-02-25 | 2025-06-06 | 南京邮电大学 | An emergency control method and medium for information-physical cross-space collaboration under false data injection attacks |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108234492A (en) * | 2018-01-02 | 2018-06-29 | 国网四川省电力公司信息通信公司 | Consider the power information physics concerted attack analysis method of load data falseness injection |
CN110035090A (en) * | 2019-05-10 | 2019-07-19 | 燕山大学 | A kind of smart grid false data detection method for injection attack |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110929989B (en) * | 2019-10-29 | 2023-04-18 | 重庆大学 | N-1 safety checking method with uncertainty based on deep learning |
AU2020103195A4 (en) * | 2020-11-03 | 2021-01-14 | East China University Of Science And Technology | A Method for Detecting Vulnerability of Large-scale Power Grid Based On Complex Network |
-
2021
- 2021-06-29 CN CN202110729263.6A patent/CN113904786B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108234492A (en) * | 2018-01-02 | 2018-06-29 | 国网四川省电力公司信息通信公司 | Consider the power information physics concerted attack analysis method of load data falseness injection |
CN110035090A (en) * | 2019-05-10 | 2019-07-19 | 燕山大学 | A kind of smart grid false data detection method for injection attack |
Also Published As
Publication number | Publication date |
---|---|
CN113904786A (en) | 2022-01-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113904786B (en) | False data injection attack identification method based on line topology analysis and tide characteristics | |
Tonelli‐Neto et al. | Fuzzy based methodologies comparison for high‐impedance fault diagnosis in radial distribution feeders | |
CN108234492A (en) | Consider the power information physics concerted attack analysis method of load data falseness injection | |
CN116318754A (en) | Multi-terminal collaborative dynamic security analysis method and system for distributed power | |
CN114118150A (en) | A method and system for line selection of single-phase grounding fault in distribution network | |
CN104616061A (en) | Island detection method based on wavelet packet logarithmic energy entropy and genetic algorithm optimization | |
CN109767352A (en) | A Security Situation Assessment Method for Power Cyber-Physics Fusion System | |
CN118941098B (en) | Power system situation awareness method based on Chebyshev diagram neural network | |
CN114154766B (en) | Vulnerability early warning method and system of power grid under lightning dynamic prediction | |
CN103366062A (en) | Method for constructing core backbone grid structure based on BBO algorithm and power grid survivability | |
CN110570016A (en) | A Disaster Resistant Backbone Grid Optimization Method Considering Multi-stage Performance | |
CN108462180A (en) | A method of probability optimal load flow is determined based on vine copula functions | |
CN110783913B (en) | Group-based optimal power grid topology online optimization method considering expected accident set | |
CN118858834A (en) | Distribution network line fault diagnosis method, system, equipment and medium based on graph neural network | |
Ye et al. | Single Pole‐to‐Ground Fault Location Method for MMC‐HVDC System Using Wavelet Decomposition and DBN | |
CN119494023B (en) | A method and system for locating faults in a smart power distribution network | |
CN117077342A (en) | A power communication network topology optimization method based on complex network theory | |
Zhang et al. | CNN‐LSTM based power grid voltage stability emergency control coordination strategy | |
CN119583182A (en) | A power grid network attack detection method and system based on deep learning | |
CN119071031A (en) | A method for detecting false data injection attacks in power CPS based on graph neural network | |
Jiang et al. | Application of a hybrid model of big data and BP network on fault diagnosis strategy for microgrid | |
CN118777782A (en) | A submarine cable sheath status early warning and fault location monitoring method and system | |
Wang et al. | A Graph Deep Learning-Based Fault Detection and Positioning Method for Internet Communication Networks | |
CN110391935B (en) | Measurement evaluation method and system considering cyber-physical coupling characteristics and information disturbance | |
CN117744020A (en) | Power distribution network power outage range identification method based on multi-source heterogeneous data fusion |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20230530 |