Method for power flow calculation of variable topology network based on meta-transfer learning
Patent Information
- Application Number
- CN202310560555.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-05-18
AI Technical Summary
然而,现有的基于数值计算的潮流计算方法需要在算法内部进行多次迭代,需要耗费较多计算时间;现有的基于数据驱动的潮流计算方法仅适用于固定拓扑结构下的网络,对变拓扑网络的适应度较差
[0019]本发明的有益效果是:针对电力系统N-k故障情况下的系统安全稳定性分析,需要大量的样本对N-k故障情况进行统计。本方法采用元迁移学习技术,通过训练元学习器,指导基学习器快速适应不同拓扑条件,能够有效提高电力系统在不同拓扑及运行状态下的潮流计算速度,为快速统计分析N-k故障提供了保障。
Smart Images

Figure CN116432359B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system technology and relates to a fast power flow calculation method using a data-driven approach when the topology of a power system changes, particularly a variable topology network power flow calculation method based on meta-transfer learning. Background Technology
[0002] With the increasing scale and size of power systems, their topologies are becoming increasingly large and complex, making changes in grid topology due to natural and man-made disasters unavoidable. Power flow calculation, as the foundation of power system operation analysis, requires rapid calculation and analysis of the power system's operating status when the topology changes, providing a reference for fault repair and recovery. However, existing numerical calculation-based power flow calculation methods require multiple iterations within the algorithm, consuming significant computation time; existing data-driven methods are only applicable to networks with fixed topologies and have poor adaptability to variable topologies. Therefore, it is crucial to develop a rapid response mechanism to topology changes, adapt to new topological conditions, achieve fast power flow calculation, and ensure the safe and stable operation of the power system. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a method for calculating the power flow of a variable topology network based on meta-transfer learning. This method uses a deep neural network to construct a mapping relationship between the input and output of the power flow from historical data and simulation data, and uses a meta-learner to perceive changes in the network topology and update the structural parameters of the base learner.
[0004] Therefore, the present invention adopts the following technical solution:
[0005] A method for calculating power flow in variable topology networks based on meta-transfer learning includes:
[0006] Obtain the changes in the current power system topology relative to the original topology and the operating status data of each node in the current power system;
[0007] The network topology changes are input into the trained meta-learner to obtain the network structure parameters of the base learner.
[0008] The base learner is updated based on the obtained network structure parameters. The operating status data of each node in the current power system is input into the updated base learner, and the power flow calculation results are output.
[0009] The training method for the trained meta-learner includes the following steps:
[0010] (1) Construct a second dataset for training the meta-learner, including the following sub-steps:
[0011] (1.1) Collect and obtain the first dataset, which includes L sub-datasets under different topological network structures. Each sample of the sub-dataset under each topological network structure includes the operating status data of each node of the power system under the corresponding topological network structure and the true value of the power flow calculation result.
[0012] (1.2) Construct L base learners that correspond one-to-one with L types of topological network structures. Each base learner takes the running state data in each sample of the corresponding sub-dataset under the topological network structure as input and the predicted power flow calculation result as output. It is trained by minimizing the first loss function. After training, L trained base learners are obtained.
[0013] (1.3) Extract the network structure parameters of L trained base learners to construct a second dataset for training meta learners; each sample in the second dataset for training meta learners includes the network topology changes of the topology network relative to the original topology network and the network structure parameters of the corresponding trained base learners.
[0014] (2) Construct the neural network structure of the meta-learner, and take the change of the network topology structure of each sample in the second dataset relative to the original topology structure as input, and the predicted base learner network structure parameters as output. Train the meta-learner by minimizing the second loss function. After training, the trained meta-learner is obtained.
[0015] Furthermore, the neural network structure of the meta-learner includes an embedding layer, a multi-head attention mechanism layer, and multiple fully connected layers connected in sequence.
[0016] Furthermore, the neural network structure of the base learner is a fully connected layer neural network, a graph neural network, etc.
[0017] Furthermore, the first loss function is the mean square error between the output of the base learner and the true value of the power flow calculation result.
[0018] Furthermore, the second loss function is the mean square error between the output of the meta-learner and the neural network structure parameters of the corresponding trained base learner.
[0019] The beneficial effects of this invention are as follows: For system security and stability analysis under Nk fault conditions in power systems, a large number of samples are needed for statistical analysis of Nk fault scenarios. This method employs meta-transfer learning technology, which trains a meta-learner to guide the base learner to quickly adapt to different topology conditions. This effectively improves the power flow calculation speed of power systems under different topologies and operating states, providing a guarantee for rapid statistical analysis of Nk faults. Attached Figure Description
[0020] Figure 1 The neural network structure diagram of the base learner designed for this patent;
[0021] Figure 2 This is a diagram of the meta-learner neural network structure involved in this patent;
[0022] Figure 3 The IEEE 39-node system architecture diagram used in the example;
[0023] Figure 4 A graph showing the change of mean squared error during the training process of the base learner;
[0024] Figure 5 This is a graph showing the change in the mean square error index during the training process of the meta-learner.
[0025] Figure 6 A comparison table of prediction errors for meta-transfer learning on different training and test sets; Detailed Implementation
[0026] The present invention will be further described below with reference to the accompanying drawings.
[0027] This invention provides a method for calculating power flow in variable topology networks based on meta-transfer learning. It utilizes a deep neural network to construct a mapping relationship between power flow input and output from historical and simulation data using a base learner, and updates the base learner's structural parameters by sensing changes in network topology through a meta-learner. Specifically, it includes the following steps:
[0028] a. Obtain the changes in the current power system topology relative to the original topology and the operating status data of each node in the current power system;
[0029] b. Input the network topology changes into the trained meta-learner to obtain the network structure parameters of the base learner;
[0030] c. Update the base learner based on the obtained structural parameters, input the current operating status data of each node in the power system into the updated base learner, and output the power flow calculation results.
[0031] The training method for the trained meta-learner includes the following steps:
[0032] (1) Use feature engineering techniques to characterize and digitize the collected historical and simulated power system operation data under different topologies, divide the data into subsets under specific topologies, and construct a second dataset for training the meta-learner; including the following sub-steps:
[0033] (1.1) Collect and obtain the first dataset. Specifically, firstly, digitize the historical operating data and simulation data of the system under different topologies:
[0034] The set of different topologies of power systems is Including L types of network topologies, in a specific topology Below, M sets of data are collected from historical operating data and simulation data of the power system, with each set of data having a data d m as follows:
[0035]
[0036] in, Let N represent the voltage amplitude, voltage phase angle, active power injected into the node, and reactive power injected into the node at node i in the m-th set of measurement or simulation data, respectively; N is the number of nodes in the system, m∈[1,M].
[0037] Further partitioning the dataset under a specific topology to obtain a subset:
[0038] Based on a specific topology The collected m sets of data are divided into subsets. as follows:
[0039]
[0040]
[0041]
[0042]
[0043] in, Data taken from measurement or simulation d m .
[0044] (1.2) In the offline process, multiple deep neural networks with the same network structure under different topologies are constructed as base learners. The dataset divided in step one is used as training data, and gradient descent is used to train each network.
[0045] First, L base learners are constructed, each corresponding one-to-one with one of the L types of network topologies. The deep neural networks used as base learners in this invention can employ various conventional neural networks, such as fully connected neural networks and graph neural networks. The structure of a fully connected neural network is as follows: Figure 1 As shown, the training dataset for each base learner is a subset of the dataset corresponding to the topology k. The inputs and outputs are respectively
[0046] The input-output relationship of the i-th layer of the fully connected neural network is shown in the figure below:
[0047] h i =σ(W i h i-1 +b i )
[0048] Where: h i h is the output of the i-th layer; i-1 W is the output of the (i-1)th layer, which is the input of the i-th layer; i ,b i Let be the weight matrix and bias matrix of the i-th layer, and be the neural network structure parameters; σ is the activation function.
[0049] Then, using the obtained input and output data, each base learner takes the running state data of each sample in the corresponding subset of the topological network structure as input, the predicted power flow calculation result as output, and minimizes the first loss function as the objective. The trainable parameters of the neural network are trained using the gradient descent method to obtain L trained base learners. The first loss function can be the mean squared error, absolute average error, etc. In this embodiment, it is specifically the mean squared error between the output of the base learner and the true value of the power flow calculation result.
[0050] (1.3) Extract the neural network structure parameters to construct a second dataset for training the meta-learner;
[0051] Extracting the neural network structure parameters φ after training k as follows:
[0052]
[0053]
[0054] in, W is the weight matrix and bias matrix of the l-th layer of the neural network. i ,b i The expanded row vector, l is the layer number of the base learner neural network, where u and v are the input and output dimensions of the l-th layer of the neural network, respectively, and W i It is a matrix with u rows and v columns, ω ij (l) W represents the weight matrix of the l-th layer of the neural network. i The coefficient in the i-th row and j-th column.
[0055] By training and extracting the neural network structure parameters of the base learner under L topologies, and combining the network topology changes of the corresponding topology network structure relative to the original topology network, we can better understand the network topology changes. Network topology changes, ΔA = [ΔA1, ..., ΔA] k], which can construct a second dataset Φ, where ΔA k ,φ k ∈Φ.
[0056] (2) Design a deep neural network that senses changes in network topology as a meta-learner. The meta-learner takes the changes in network topology as input and the network parameters of the base learner as output, and is trained by gradient descent.
[0057] (2.1) Constructing a meta-learner deep neural network
[0058] The meta-learner in this invention is used to perceive changes in network topology and can employ a conventional neural network. The neural network structure used in this embodiment is as follows: Figure 2 As shown, it includes an embedding layer, a multi-head attention mechanism layer, and multiple fully connected layers connected in sequence; the input of the meta-learner is the network topology change. in Given the original topology network, the output is the base learner network structure parameters φ. k .
[0059] The meta-learner in this embodiment works as follows:
[0060] Embedding layer: The sparse network topology matrix is transformed into a dense form through the embedding layer. The specific relationship is as follows:
[0061] ΔA k·emb =σ(W emb ·ΔA k +b emb )
[0062] Among them, W emb b emb Let ΔA and ΔB represent the weight matrix and bias matrix of the embedding layer, respectively. k·emb This represents the output of the embedding layer.
[0063] Multi-head attention mechanism layer: Attention mimics human attention patterns through a multi-head attention mechanism, enhancing the observation of local parts of the data sequence. The multi-head attention mechanism operates multiple attention mechanisms in parallel, thus strengthening the observation capabilities of multiple local parts. Its specific expression is as follows:
[0064] MultiHead(Q,K,V)=Concat(x1,x2,...,x n W O
[0065]
[0066] x i =Attention(QW iQ ,KW i K VW i V )
[0067] Where Q, K, and V are the query matrix, key matrix, and value matrix, respectively, calculated based on the output of the embedding layer; dim k It is the dimension of K and V; W O W Q W K W V is a trainable matrix. n represents the number of multi-head attention layers, and softmax is the activation function.
[0068] Multi-layer fully connected layers: Similarly, the input-output relationships between fully connected layers are as follows:
[0069] h i =σ(W i h i-1 +b i )
[0070] Where: h i h is the output of the i-th layer; i-1 W is the output of the (i-1)th layer, which is the input of the i-th layer, where the input of the first fully connected layer is the output MultiHead(Q,K,V) of the multi-head attention mechanism layer; i ,b i Let be the weight matrix and bias matrix of the i-th layer, and be the neural network structure parameters; σ is the activation function.
[0071] (2.2) Training of meta-learners
[0072] The meta-learner takes the network structure topology changes in each sample of the second dataset as input, the network parameters of the base learner as output, and minimizes the second loss function as its objective. It uses gradient descent to train the trainable parameters of the neural network to obtain the trained meta-learner. The second loss function can be mean squared error, absolute average error, etc. In this embodiment, it is specifically the mean squared error between the output of the meta-learner and the corresponding trained neural network structure parameters of the base learner.
[0073] By utilizing a trained meta-learner and inputting network topology change parameters relative to the original topology of the current power system, the network topology change can be detected, and base learner network structure parameters for a specific topology can be returned. The returned base learner structure parameters update the base learner, and power flow calculation results for a specific network structure are output based on the power flow parameters input to the base learner. The topology network structure set in this invention... It can be a set of different normal topology network structures, or a set of normal topology network structures and topology network structures under fault conditions. For the set of normal topology network structures and topology network structures under fault conditions, the normal topology network structure is the original topology network. In this case, the method of the present invention can quickly calculate the power flow under different fault conditions, providing an effective way for the system security and stability analysis of the power system under Nk fault conditions.
[0074] The effects of the present invention will be further explained below with reference to specific embodiments.
[0075] Example 1
[0076] like Figure 3 As shown, this embodiment uses an IEEE 39-node system and an IEEE 300-node system to simulate and verify the effectiveness of the method of the present invention. In this embodiment, for each topology, 1200 different topologies are taken as the dataset, of which 1000 are used as training data and 200 are used as validation data. For each specific topology, 500 power flow calculation results are taken as the dataset, of which 450 are used as the first dataset for training and 50 are used as validation data; the network structure of the base learner is as follows. Figure 1 As shown, the loss function is the mean squared error, and the training iterations are 500. Figure 4 This represents the change in the mean squared error metric during the training process of a base learner. The network structure of the meta-learner is as follows: Figure 2 As shown, the loss function used is mean squared error, and the number of training iterations is 1200. Figure 5 This refers to the change in the mean squared error index during the training process of the meta-learner.
[0077] The power flow calculation method for variable topology networks based on meta-transfer learning, constructed according to the above method, has the following dataset:
[0078] Dataset A: The original network without topological changes;
[0079] Dataset B: Randomly disconnecting 2 lines, i.e., scenario N-2;
[0080] Dataset C: Randomly disconnecting 3 lines, i.e., scenario N-3;
[0081] Dataset D: A dataset consisting of a mixture of N-2 and N-3 faults.
[0082] Test set E: A dataset consisting of N-2 and N-3 faults, which does not participate in any training process.
[0083] A power flow calculation method for variable topology networks based on meta-transfer learning was tested on the above dataset, and the test error is as follows: Figure 6As shown, the time consumed by each test group is less than 30ms, which meets the calculation speed requirements.
[0084] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for calculating power flow in variable topology networks based on meta-transfer learning, characterized in that, include: Obtain the changes in the current power system topology relative to the original topology and the operating status data of each node in the current power system; The network topology changes are input into the trained meta-learner to obtain the network structure parameters of the base learner. The base learner is updated based on the obtained network structure parameters. The operating status data of each node in the current power system is input into the updated base learner, and the power flow calculation results are output. The training method for the trained meta-learner includes the following steps: (1) Construct a second dataset for training the meta-learner, including the following sub-steps: (1.1) Collect and obtain the first dataset, which includes L sub-datasets under different topological network structures. Each sample of the sub-dataset under each topological network structure includes the operating status data of each node of the power system under the corresponding topological network structure and the true value of the power flow calculation result. (1.2) Construct L base learners that correspond one-to-one with L types of topological network structures. Each base learner takes the running state data in each sample of the corresponding sub-dataset under the topological network structure as input and the predicted power flow calculation result as output. It is trained by minimizing the first loss function. After training, L trained base learners are obtained. (1.3) Extract the network structure parameters of L trained base learners to construct a second dataset for training meta learners; each sample in the second dataset for training meta learners includes the network topology changes of the topology network relative to the original topology network and the network structure parameters of the corresponding trained base learners. (2) Construct the neural network structure of the meta-learner, and take the change of the network topology structure of each sample in the second dataset relative to the original topology structure as input, and the predicted base learner network structure parameters as output. Train the meta-learner by minimizing the second loss function. After training, the trained meta-learner is obtained.
2. The method according to claim 1, characterized in that, The neural network structure of the meta-learner includes an embedding layer, a multi-head attention mechanism layer, and multiple fully connected layers connected in sequence.
3. The method according to claim 1, characterized in that, The neural network structure of the base learner is a fully connected layer neural network or a graph neural network.
4. The method according to claim 1, characterized in that, The first loss function is the mean square error between the output of the base learner and the true value of the power flow calculation result.
5. The method according to claim 2, characterized in that, The second loss function is the mean square error or absolute average error of the network structure parameters of the corresponding trained base learner and the output of the meta-learner.
Citation Information
Patent Citations
Power system transient stability adaptive evaluation method based on transfer learning
CN110879917A
Transient stability adaptive evaluation method and device of power system
CN114662989A