Incremental learning method and device for continuous updating of power grid transient stability evaluation model
Through incremental learning method, the grid transient stability evaluation model is updated using electrical graph features and historical sample playback data, solving the problem of 'catastrophic forgetting' caused by grid topology changes and data set accumulation, ensuring the stability of the model in the new topology Evaluate accuracy and fast update capability.
Patent Information
- Application Number
- CN202411265789.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
The existing grid transient stability evaluation model is prone to the problem of ‘catastrophic forgetting’ under the conditions of grid topology changes and data set accumulation, resulting in a decrease in the model's stable evaluation accuracy in the new operating topology.
The incremental learning method is adopted to update the grid transient stability evaluation model by obtaining the electrical graph characteristics and historical sample playback data at the current moment, and combining the importance of model parameters to ensure the stable evaluation accuracy of the model in the new topology.
It effectively avoids the model's 'catastrophic forgetting' under the conditions of grid topology changes and data set accumulation, ensures stable evaluation accuracy in the new operating topology, and reduces the calculation cost of model updates.
Smart Images

Figure CN119134315A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of incremental learning for continuous updating of a transient stability assessment model for a power grid, and in particular to an incremental learning method, device, storage medium and electronic device for continuous updating of a transient stability assessment model for a power grid. Background Art
[0002] The transient stability of a power system usually refers to the ability of the generator to maintain synchronous and stable operation during transient processes under specific operating modes and fault conditions. In the actual operation of the power system, operators use time-domain simulation methods to calculate the dynamic response of the generator and then evaluate the transient stability of the system. However, the time-domain simulation method requires the establishment and solution of high-dimensional, multi-time-step differential-algebraic equations, and the computational complexity is very high. With the massive access to renewable energy generation and power electronics equipment, the operating topology of modern power systems is changeable and the transient mechanism is complex. The number of faults evaluated by the time-domain simulation method in a short period is very limited, and it is impossible to fully check the possible instability risk points of the system.
[0003] In order to achieve rapid transient stability assessment, a large number of studies have constructed data-driven transient stability assessment models, such as shallow machine learning models such as decision trees and support vector machines, and deep learning models such as convolutional neural networks, long short-term memory networks, and graph convolutional networks, which can directly evaluate the stability of the system based on the operating characteristics of the power system. However, existing studies rarely consider scenarios where the model incrementally learns multiple data sets. During the operation of the power system, the power grid operating topology changes frequently due to planned maintenance and fault outage events, so the model needs to be continuously updated to ensure its stable assessment accuracy in the new operating topology. However, when the model learns new data, it is easy to perform poorly on the old data that has been learned, which is the "catastrophic forgetting" problem. Summary of the invention
[0004] The main purpose of the present application is to provide an incremental learning method, device, storage medium and electronic device for continuously updating a power grid transient stability assessment model, so as to at least solve the problem of catastrophic forgetting caused by the model continuously learning multiple different data sets under the conditions of constantly changing power grid topology and constantly accumulating data sets.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, there is provided an incremental learning method for continuously updating a power grid transient stability assessment model, comprising: obtaining a first data set of the power grid system at the current moment, wherein the first data set comprises multiple groups of data, any group of the data comprises electrical diagram features, and stability labels corresponding to the electrical diagram features, the electrical diagram features are determined according to the transient response of each node of the power grid system, the stability labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stability labels are used to characterize whether the nodes are stable; obtaining historical sample playback data and first parameter importance data in a playback sample pool, wherein the first parameter importance data is the importance data of each layer of network parameters of the power grid transient stability assessment model at the previous moment; using the first data set, the historical sample playback data, and the first parameter importance data to perform incremental learning and update on the power grid transient stability assessment model at the previous moment, to obtain the power grid transient stability assessment model after the incremental learning and update at the current moment.
[0006] Optionally, after obtaining the power grid transient stability assessment model updated by incremental learning at the current moment, the method further includes: determining the second parameter importance data of the power grid transient stability assessment model updated by incremental learning at the current moment based on the first data set, and determining the sample playback data at the current moment based on the first data set; and storing the sample playback data at the current moment in the playback sample pool.
[0007] Optionally, determining the second parameter importance data of the power grid transient stability assessment model updated by the incremental learning at the current moment according to the first data set includes: according to a first formula: Determine the cross entropy loss L of the power grid transient stability assessment model after the incremental learning update at the current moment CE (X, Y), where x is the electrical diagram feature, y is the stable label, n is the number of data in the first data set, and p i is the stability prediction probability of the model for the i-th data in the first data set; according to the second formula: Determine the importance of each layer of network parameters of the power grid transient stability assessment model after incremental learning update at the current moment, where θ i is the i-th layer network parameter of the power grid transient stability assessment model, is the gradient differential, ω i is the network parameter importance of the i-th layer network parameter; the network parameter importance of each layer of the power grid transient stability assessment model after the incremental learning update at the current moment is normalized to obtain the second parameter importance data.
[0008] Optionally, determining the sample playback data at the current moment according to the first data set includes:
[0009] According to the third formula: Determine the uncertainty score of each of the data in the first data set, where, is the uncertainty score of the ith data, p i is the stability prediction probability of the model for the i-th data in the first data set; according to the fourth formula: Determine a diversity score for each of the data in the first data set, wherein: is the diversity score of the i-th data, x i is the i-th data of the first data set, x j is the jth historical sample playback data in the playback sample pool, x i,k is the characteristic scalar of the kth dimension of the i-th data feature vector, x j,k is the characteristic scalar of the kth dimension of the jth historical sample playback data, s k is the standard deviation of the kth dimension of the i-th data feature vector and the j-th historical sample playback data; according to the fifth formula: Determine the total score of each of the data in the first data set, where s i is the total score of the i-th data in the first data set, and α is a weighting parameter; the total scores of the data in the first data set are arranged in reverse order, and the first preset number of the data are selected as the sample playback data at the current moment.
[0010] Optionally, the first data set, the historical sample playback data, and the first parameter importance data are used to perform incremental learning and updating on the power grid transient stability assessment model at the previous moment, including: calculating the first cross entropy loss of the power grid transient stability assessment model at the previous moment according to the first data set, calculating the second cross entropy loss of the power grid transient stability assessment model at the previous moment according to the historical sample playback data, and calculating the parameter regularization loss of the power grid transient stability assessment model at the previous moment according to the first parameter importance data; determining an incremental learning loss function according to the first cross entropy loss, the second cross entropy loss and the parameter regularization loss; and performing incremental learning and updating on the power grid transient stability assessment model at the previous moment according to the incremental learning loss function.
[0011] Optionally, after obtaining the power grid transient stability assessment model updated by the incremental learning at the current moment, the method further comprises: performing transient stability assessment on the power grid system by using the power grid transient stability assessment model updated by the incremental learning at the current moment.
[0012] Optionally, the power grid transient stability assessment model includes an upstream network and a downstream network, the upstream network is composed of a second preset number of graph attention networks and a third preset number of hierarchical pooling modules cross-connected in series, and the downstream network includes a stability classifier composed of multiple layers of fully connected layers.
[0013] According to another aspect of the present application, an incremental learning device for continuously updating a power grid transient stability assessment model is provided, comprising: a first acquisition unit, for acquiring a first data set of a power grid system at a current moment, wherein the first data set comprises a plurality of groups of data, any group of the data comprises electrical diagram features, and stability labels corresponding to the electrical diagram features, the electrical diagram features are determined according to transient responses of each node of the power grid system, the stability labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stability labels are used to characterize whether the nodes are stable; a second acquisition unit, for acquiring historical sample playback data and first parameter importance data in a playback sample pool, wherein the first parameter importance data is importance data of network parameters of each layer of the power grid transient stability assessment model at a previous moment; an update unit, for performing incremental learning update on the power grid transient stability assessment model at a previous moment using the first data set, the historical sample playback data, and the first parameter importance data, to obtain the power grid transient stability assessment model after the incremental learning update at the current moment.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the incremental learning methods for continuously updating the transient stability assessment model of the power grid.
[0015] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include an incremental learning method for continuously updating any one of the power grid transient stability assessment models.
[0016] Apply the technical solution of the present application to obtain the first data set of the power grid system at the current moment, wherein the first data set includes multiple groups of data, any group of data includes electrical diagram features, and stable labels corresponding to the electrical diagram features, the electrical diagram features are determined according to the transient response of each node of the power grid system, the stable labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stable labels are used to characterize whether the node is stable; obtain the historical sample playback data and the first parameter importance data in the playback sample pool, wherein the first parameter importance data is the importance data of each layer of the network parameters of the power grid transient stability assessment model at the previous moment; use the first data set, the historical sample playback data, and the first parameter importance data to incrementally learn and update the power grid transient stability assessment model at the previous moment, and obtain the power grid transient stability assessment model after incremental learning and updating at the current moment. Incremental learning and updating of the model according to the historical sample playback data, the importance of the model parameters, and the current data ensures the stable evaluation accuracy of the updated model in the new operating topology, and solves the problem of catastrophic forgetting caused by the model continuously learning multiple different data sets under the conditions of the continuous change of the power grid topology and the continuous accumulation of data sets. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A hardware structure block diagram of a mobile terminal for performing an incremental learning method for continuously updating a power grid transient stability assessment model provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic flow chart of an incremental learning method for continuously updating a power grid transient stability assessment model provided in accordance with an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram of an incremental learning framework of a power grid transient stability assessment model provided according to an embodiment of the present application is shown;
[0021] Figure 4 A structural block diagram of a power grid transient stability assessment model provided according to an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of the topology structure of an IEEE 39-node system provided according to an embodiment of the present application is shown;
[0023] Figure 6 A schematic diagram showing the accuracy of the power grid transient stability assessment model provided in an embodiment of the present application in each data set;
[0024] Figure 7 A structural block diagram of an incremental learning device for continuously updating a power grid transient stability assessment model provided in accordance with an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] As introduced in the background technology, in the prior art, under the conditions of constantly changing power grid topology and constantly accumulating data sets, the model continuously learns multiple different data sets and causes catastrophic forgetting. In order to solve the problem of catastrophic forgetting caused by the model continuously learning multiple different data sets under the conditions of constantly changing power grid topology and constantly accumulating data sets, the embodiments of the present application provide an incremental learning method, device, storage medium and electronic device for continuously updating a power grid transient stability assessment model.
[0029] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0030] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 11 is a hardware structure block diagram of a mobile terminal of an incremental learning method for continuously updating a power grid transient stability assessment model according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0031] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the incremental learning method for continuously updating the transient stability assessment model of the power grid in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] In this embodiment, an incremental learning method for continuously updating a power grid transient stability assessment model running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0033] Figure 2 1 is a flow chart of an incremental learning method for continuously updating a power grid transient stability assessment model according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0034] Step S201, obtaining a first data set of the power grid system at the current moment, wherein the first data set includes multiple groups of data, any group of data includes electrical diagram features, and stability labels corresponding to the electrical diagram features, the electrical diagram features are determined according to transient responses of each node of the power grid system, the stability labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stability labels are used to characterize whether the nodes are stable;
[0035] Among them, the maximum power angle difference of the generator refers to the maximum value of the power angle difference between any two generators in the system. The power angle difference refers to the phase angle difference between the two generators, which represents the relative phase relationship between the generators in the system. The electrical diagram characteristics are obtained from the transient response curve of the power grid system.
[0036] Specifically, the stability tag usually refers to the stability of the system. The stability tag of the maximum power angle difference of the generator means that the maximum power angle difference between the generators in the system can maintain the stable operation of the system within a certain range. If the maximum power angle difference exceeds the stability range of the system, the system may become unstable, causing power grid failure or even large-scale power outages. Therefore, monitoring and controlling the maximum power angle difference of the generator to ensure the stable operation of the system is a very important task in the operation and management of the power system. Through reasonable control strategies and equipment, the stability of the system can be effectively maintained and the reliability and safety of the power grid can be improved.
[0037] Step S202, obtaining historical sample playback data and first parameter importance data in the playback sample pool, wherein the first parameter importance data is the importance data of each layer of network parameters of the power grid transient stability assessment model at the previous moment;
[0038] Specifically, the importance of model parameters is calculated based on the gradient of the classification loss of the dataset to the model parameters, and the model parameter importance is used to update the model in the incremental learning update module. A replay sample pool is constructed from the complete dataset based on the uncertainty and diversity of the samples, and the replay sample pool is used to update the model in the incremental learning update module.
[0039] Among them, incremental learning is a continuous learning method that can update the model while continuously receiving new data, so that the model keeps the latest information and knowledge. After learning the data set using the incremental learning update module, an intelligent and stable evaluation model can be obtained, which is able to make predictions and evaluations based on the latest data.
[0040] Step S203, using the first data set, the historical sample playback data, and the first parameter importance data to perform incremental learning and updating on the power grid transient stability assessment model at the previous moment, to obtain the power grid transient stability assessment model after incremental learning and updating at the current moment.
[0041] Specifically, the model is updated through incremental learning based on historical sample playback data, model parameter importance, and current data, ensuring the stable evaluation accuracy of the updated model in the new operating topology. This enables rapid model updates in scenarios where the power system operating topology changes frequently, and avoids the problem of "catastrophic forgetting" of the model.
[0042] Through this embodiment, the first data set of the power grid system at the current moment is obtained, wherein the first data set includes multiple groups of data, any group of data includes electrical diagram features, and stable labels corresponding to the electrical diagram features, the electrical diagram features are determined according to the transient response of each node of the power grid system, the stable labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stable labels are used to characterize whether the node is stable; the historical sample playback data and the first parameter importance data in the playback sample pool are obtained, wherein the first parameter importance data is the importance data of each layer of the network parameters of the power grid transient stability assessment model at the previous moment; the power grid transient stability assessment model at the previous moment is incrementally learned and updated using the first data set, the historical sample playback data, and the first parameter importance data, to obtain the power grid transient stability assessment model after incremental learning and updating at the current moment. The model is incrementally learned and updated according to the historical sample playback data, the model parameter importance, and the current data, so as to ensure the stable evaluation accuracy of the updated model in the new operating topology, and solve the problem of catastrophic forgetting caused by the model continuously learning multiple different data sets under the conditions of the continuous change of the power grid topology and the continuous accumulation of data sets.
[0043] During the specific implementation process, after obtaining the power grid transient stability assessment model that has been incrementally learned and updated at the current moment, the method also includes: determining the second parameter importance data of the power grid transient stability assessment model that has been incrementally learned and updated at the current moment based on the first data set, and determining the sample playback data at the current moment based on the first data set; and storing the sample playback data at the current moment in the playback sample pool.
[0044] After obtaining the updated power grid transient stability assessment model, the method continues to calculate the model parameter importance of the updated power grid transient stability assessment model, and determines the sample playback data at the current moment based on the data in the current data set; and uses the model parameter importance of the updated power grid transient stability assessment model and the sample playback data at the current moment to perform incremental learning and update the power grid transient stability assessment model at the next moment.
[0045] Specifically, determining the second parameter importance data of the power grid transient stability assessment model after incremental learning update at the current moment according to the first data set includes: according to the first formula: Determine the cross entropy loss L of the power grid transient stability assessment model after incremental learning update at the current moment CE (X,Y), where x is the electrical diagram feature, y is the stable label, n is the number of data in the first data set, and p i is the model's predicted probability of stability for the i-th data in the first data set; according to the second formula: Determine the importance of each layer of network parameters of the power grid transient stability assessment model after incremental learning update at the current moment, where θ i is the i-th layer network parameter of the power grid transient stability assessment model, is the gradient differential, ω i is the network parameter importance of the i-th layer network parameter; the importance of each layer of the network parameter of the power grid transient stability assessment model after incremental learning and update at the current moment is normalized to obtain the second parameter importance data.
[0046] This method proposes a model parameter importance identification method based on classification loss, which uses the gradient of the model's classification loss on the model parameters on the historical data set to express the influence of model parameter changes on the model evaluation accuracy, and accurately identifies the importance of model parameters to the learned old knowledge.
[0047] More specifically, determining the sample playback data at the current moment according to the first data set includes: according to the third formula: Determine the uncertainty score of each data in the first data set, where is the uncertainty score of the i-th data, p i is the stability prediction probability of the model for the i-th data in the first data set; according to the fourth formula: Determine the diversity score of each data in the first data set, where: is the diversity score of the i-th data, x i is the i-th data of the first data set, x j is the playback data of the jth historical sample in the playback sample pool, x i,kis the characteristic scalar of the kth dimension of the i-th data feature vector, x j,k is the characteristic scalar of the kth dimension of the jth historical sample playback data, s k is the standard deviation of the kth dimension of the i-th data feature vector and the j-th historical sample playback data; according to the fifth formula: Determine the total score of each data in the first data set, where s i is the total score of the i-th data of the first data set, and α is a weighting parameter; the total scores of the data of the first data set are arranged in reverse order, and the first preset number of data are selected as the sample playback data at the current moment.
[0048] Among them, the first preset number is related to the size of the constructed sample replay pool, and can be set to other values such as 10, 50, 100, etc.
[0049] This method proposes a method for constructing a playback sample pool based on sample uncertainty and diversity. Considering the uncertainty and diversity of samples, historical key samples close to the model classification boundary and widely covering the feature space are selected to construct a playback sample pool. Since there is no need to store all historical samples, huge storage resources are saved.
[0050] Furthermore, the first data set, the historical sample playback data, and the first parameter importance data are used to perform incremental learning and updating on the power grid transient stability assessment model at the previous moment, including: calculating the first cross entropy loss of the power grid transient stability assessment model at the previous moment according to the first data set, calculating the second cross entropy loss of the power grid transient stability assessment model at the previous moment according to the historical sample playback data, and calculating the parameter regularization loss of the power grid transient stability assessment model at the previous moment according to the first parameter importance data; determining the incremental learning loss function according to the first cross entropy loss, the second cross entropy loss and the parameter regularization loss; and performing incremental learning and updating on the power grid transient stability assessment model at the previous moment according to the incremental learning loss function.
[0051] This method uses the new data set, the playback sample pool of the old data set, and the importance of model parameters to update the stable evaluation model. In order to ensure that the model can still maintain the accuracy on the old data set after learning the new data set, the playback samples are sampled from the playback sample pool of the old data set based on class balanced sampling, and then the playback samples are trained using cross entropy loss. At the same time, the model parameter regularization loss is constructed to limit the parameter changes of the model during update.
[0052] Furthermore, after obtaining the power grid transient stability assessment model updated by incremental learning at the current moment, the method further includes: using the power grid transient stability assessment model updated by incremental learning at the current moment to perform transient stability assessment on the power grid system.
[0053] The method adopts an updated power grid transient stability assessment model to perform transient stability assessment on the power grid system, so that the steady-state assessment result of the power grid system obtained is more accurate.
[0054] Specifically, the power grid transient stability assessment model includes an upstream network and a downstream network. The upstream network is composed of a second preset number of graph attention networks and a third preset number of hierarchical pooling modules cross-connected in series, and the downstream network includes a stability classifier composed of multiple layers of fully connected layers.
[0055] Among them, the second preset number can be set to 3, and the third preset number can be set to 3.
[0056] The upstream network of the model of this method is composed of three graph attention networks and three hierarchical pooling modules connected in series, which input electrical graph features x and graph adjacency matrix A and output high-level graph features. The downstream network of the model contains a stability classifier composed of multiple fully connected layers, which inputs high-level graph features and outputs the predicted system stability probability p.
[0057] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the incremental learning method for continuously updating the power grid transient stability assessment model of the present application will be described in detail below in combination with specific embodiments.
[0058] This embodiment relates to a specific incremental learning method for continuously updating a transient stability assessment model for a power grid, which can solve the catastrophic forgetting problem caused by the model continuously learning multiple different data sets under the conditions of constantly changing power grid topology and constantly accumulating data sets, and at the same time, the computational cost required for model updating each time a new data set is learned is very small. Specifically, it includes the following contents:
[0059] 1) A method for constructing a playback sample pool based on sample uncertainty and diversity. The uncertainty of a sample is evaluated based on the information entropy of its stable prediction probability, and the diversity is evaluated based on the standardized Euclidean distance of the sample in the feature space. On this basis, key samples are selected from the old data set that has been learned to construct a playback sample pool.
[0060] 2) Model parameter importance identification method based on classification loss. The deep learning framework is used to automatically differentiate the function to calculate the gradient of the model's classification loss on the historical data set to the model parameters, and then the importance of the model parameters to the historical data is calculated based on the normalized gradient.
[0061] 3) Incremental learning update method based on class-balanced sampling replay and model parameter regularization. Sample label-class-balanced replay samples from the replay sample pool of the historical data set, and then use the cross-entropy loss to review the historical data. Construct the model parameter regularization loss based on the importance of the model parameters, and differentially limit the degree of change of different parameters during the model update process.
[0062] In general, the advantage of the incremental learning framework proposed in the present invention is that it can ensure the accuracy of the model on old data after learning new data, and the model update speed is very fast.
[0063] Compared with the prior art, the main technical advantages of this application include:
[0064] 1) The proposed method for constructing a playback sample pool based on sample uncertainty and diversity considers the uncertainty and diversity of samples and selects historical key samples that are close to the model classification boundary and widely cover the feature space to construct a playback sample pool. Since there is no need to store all historical samples, huge storage resources are saved.
[0065] 2) The proposed model parameter importance identification method based on classification loss uses the gradient of the model's classification loss on the model parameters on the historical data set to express the impact of model parameter changes on the model evaluation accuracy, and accurately identifies the importance of model parameters to the learned old knowledge.
[0066] 3) The proposed incremental learning update method based on class-balanced sampling playback and model parameter regularization. The class-balanced sampling mechanism can prevent the model from tilting the classification boundary of historical samples toward the majority class, thereby improving the playback effect of historical samples. The model parameter regularization loss based on parameter importance can use parameters with high importance to protect old knowledge, while using parameters with low importance to learn new knowledge, so that the model can maintain high-precision performance in both new and old data.
[0067] This embodiment proposes a new framework for incremental learning and updating of intelligent stability evaluation models, which mainly includes modules such as intelligent stability evaluation model, model parameter importance identification, playback sample pool construction, and incremental learning and updating. The logical relationship between them is as follows: Figure 3 The framework's workflow steps are as follows:
[0068] 1) First, assume that the current time is t, and the grid topology will change at the next time t+1. At the current time t, there is a data set D t . Use incremental learning to update the module to learn the dataset D t After that, we get the intelligent stability evaluation model M t Based on this, the playback sample pool P is established using the playback sample pool construction module. t , and use the model parameter importance identification module to calculate the model parameter importance I t .
[0069] 2) Then, at the next time t+1, there is a data set D t+1 The incremental learning update module uses the replay sample pool P t, model parameter importance I t and dataset D t+1 Update the model and get model M t+1 Based on this, the playback sample pool P is established using the playback sample pool construction module. t+1 , and use the model parameter importance identification module to calculate the model parameter importance I t+1 .
[0070] 3) As the grid operation cycle progresses and the grid topology changes, steps 1) and 2) are repeated.
[0071] Several core modules in this embodiment, including the intelligent stability evaluation model, model parameter importance identification, playback sample pool construction, and incremental learning update, will be introduced in detail below.
[0072] 1. Intelligent transient stability assessment model:
[0073] The incremental learning framework proposed in this embodiment has strong versatility for data-driven models and can be applied to intelligent transient stability assessment models with different network structures. In order to test the actual application effect of the proposed incremental learning framework, the model structure design specifically adopted in this embodiment is as follows: Figure 4 As shown in Figure 2, the upstream network of the model consists of three graph attention networks and three hierarchical pooling modules connected in series, which input electrical graph features x and graph adjacency matrix A and output high-level graph features. The downstream network of the model contains a stability classifier consisting of multiple fully connected layers, which inputs high-level graph features and outputs the predicted system stability probability p.
[0074] The electrical diagram characteristics x of the model input are taken as the grid operation characteristics before the system fault, immediately after the fault occurs, and immediately after the fault is cleared, including the node voltage amplitude and phase angle, load active and reactive power, generator active and reactive power, etc. of each node in the grid.
[0075] The stable state of the system is determined based on the stability probability p output by the model. That is, when p>0.5, the system is stable, otherwise it is unstable.
[0076] 2. Identification of model parameter importance based on classification loss:
[0077] This module calculates the importance of model parameters based on the gradient of the classification loss of the dataset to the model parameters. The importance of model parameters is used to update the model in the incremental learning update module. Assume that there is a dataset and the corresponding label set Where n is the number of samples and y is the true sample label. The model parameter set is defined as Where L is the number of layers of the neural network in the model. This module contains the following steps:
[0078] 1) Calculate the cross entropy loss L of the model on the dataset X and label set Y CE (X,Y):
[0079]
[0080] 2) For the i-th layer parameter θ in the model i , using L CE (X,Y) vs. θ i The gradient of the calculation of its importance ω i :
[0081]
[0082] 3) Considering the numerical differences in the importance of parameters in different neural network layers, ω i Normalize by network layer:
[0083]
[0084] The model parameter importance set is expressed as
[0085] 3. Construction of playback sample pool based on sample uncertainty and diversity:
[0086] This module builds a replay sample pool from the complete dataset based on the uncertainty and diversity of the samples. The replay sample pool is used to update the model in the incremental learning update module. Assume that there is a dataset X and a scale of N is defined. M The playback sample pool M is initialized This module contains the following steps:
[0087] 1) Calculate the scores of all samples in dataset X considering the uncertainty and diversity of the samples.
[0088] For all x i ∈X, first calculate its uncertainty score based on information entropy
[0089]
[0090] Then, calculate x i and replay all samples x in the sample pool j ∈M standard Euclidean distance, from which the smallest distance is selected as the sample x i Diversity score
[0091]
[0092] where dist(·,·) represents the calculation function of the standard Euclidean distance, x k andk Respectively represent the characteristic scalar and standard deviation of the k-th dimension of the sample feature vector x. but
[0093] Finally, by setting a trade-off parameter α, the sample x is calculated by comprehensively considering uncertainty and diversity. i Total score i :
[0094] 2) Add the sample with the highest total score in the dataset X and its label to the playback sample pool M;
[0095]
[0096] 3) Repeat steps 1) and 2) until the number of samples in the playback sample pool M reaches N. M .
[0097] 4. Incremental learning update based on class-balanced sampling playback and model parameter regularization:
[0098] This module uses the new data set, the playback sample pool of the old data set, and the importance of the model parameters to update the stable evaluation model. In order to ensure that the model can still maintain the accuracy on the old data set after learning the new data set, this module samples playback samples from the playback sample pool of the old data set based on class-balanced sampling, and then trains the playback samples using cross-entropy loss. At the same time, the model parameter regularization loss is constructed to limit the parameter changes of the model during the update.
[0099] Assume that the model has learned t old data sets and corresponding label sets There is a playback sample pool Model parameter importance set The model needs to learn new datasets and label sets (X t+1 ,Y t+1 ), in each iteration of model training, construct the incremental learning loss L CL Update the model, which contains the following parts:
[0100] 1) Cross entropy loss of small batch samples of new dataset. Set the batch size to N B , sample N from the new dataset B Samples X B and the corresponding label Y B , construct its cross entropy loss as L CE (X B ,Y B ).
[0101] 2) Cross entropy loss of replay samples of old data set. In the transient stable sample data set, stable samples are far more than unstable samples. To avoid the model being biased towards the majority class in the replay sample pool, samples are selected from the replay sample pool based on the class balance sampling strategy. Set the replay sample size of each category to N R , respectively, from the playback sample pool of the old dataset Sampling N R stable samples and N R unstable samples, which constitute the playback sample set X R and the corresponding label set Y R , construct its cross entropy loss as L CE (X R ,Y R ).
[0102] 3) Model parameter regularization loss. The model parameter importance set of the old dataset Calculate the comprehensive importance of model parameters
[0103]
[0104] Then based on the comprehensive importance of model parameters Calculate the model parameter regularization loss L PR :
[0105]
[0106] in, and are the i-th layer network parameters before and after the model is updated, respectively.
[0107] Finally, by setting the trade-off parameters β and γ, the loss L is considered comprehensively. CE (X B ,Y B )、L CE (X R ,Y R ) and L PR , incremental learning loss function L CL Expressed as: L CL =L CE (X B ,Y B )+βL CE (X R ,Y R )+γL PR .
[0108] 5. Example analysis:
[0109] 1) Example settings:
[0110] Test system: The complete topology of the IEEE39 node system is used as the initial operation topology, such as Figure 5 Considering the shutdown of busbars, transmission lines, and generators, three other topologies are obtained. In each operating topology, the expected faults are simulated to generate sample data sets. The topological structures and data set compositions are shown in Table 1, where the sample size ratio of the training set and the test set is 8:2.
[0111] Table 1
[0112] Dataset Topology Sample size Training set Test Set D1 Initial system 6600 5280 1320 D2 Node 5 is down 4800 3840 960 D3 Generator 32 and line 4-14 out of service 6400 5120 1280 D4 Generator 35 out of service 6600 5280 1320
[0113] Dataset generation: Based on the reference power, the load power and the power generation are randomly fluctuated to obtain 100 different power flow operation modes. Consider that the three permanent faults occur at the head and end of the transmission line, and the fault lasts for 0.1 seconds. The electrical diagram feature x is obtained from the transient response curve of the system, and the stable label y is obtained from the maximum power angle difference of the generator. The two constitute the data set.
[0114] Evaluation indicators: When the model learns multiple incremental data sets, its performance is evaluated by accuracy (Acc) and average accuracy (MA). The Acc indicator is the classification accuracy of the model on a single data set. The MA indicator is the average value of the Acc of the model in multiple historical data sets. When the model learns t incremental data sets, its MA indicator is calculated as:
[0115]
[0116] Training settings: The number of epochs for data set training is 200, and the batch size in each training iteration is N. B = 256. Playback sample pool size N M =1000, playback sample size N R = 2. The parameters in the loss function are α = 0.5, β = 1, and γ = 10.
[0117] 2) Anti-forgetting ability and training efficiency test:
[0118] Compare the method of this embodiment with the joint training and fine-tuning training strategies.
[0119] Joint training: When learning a new dataset, the model is trained jointly using the new dataset and all historical datasets.
[0120] Fine-tuning: When learning a new dataset, the model is only fine-tuned using the new dataset and no longer learns from historical data.
[0121] Table 2 shows the MA index of the model in the incremental learning scenario, and Table 3 shows the model training time under different training strategies. As shown in Tables 2 and 3, the MA index and model update time of different methods in the multi-dataset learning process are compared. The joint training method gives the model the strongest anti-forgetting ability, but the training time is much longer than other methods. The fine-tuning method has the fastest training time, but the model's anti-forgetting ability is very weak. The method in this paper gives the model an anti-forgetting ability comparable to the joint training method, and the model update time is only slightly longer than the fine-tuning method.
[0122] Table 2
[0123] method (T1)→T2 →T3 →T4 average Joint training 0.9917 0.9909 0.9888 0.9905 Fine-tuning 0.9568 0.9665 0.9499 0.9577 This article 0.9909 0.9910 0.9875 0.9898
[0124] Table 3
[0125] method (T1)→T2 →T3 →T4 Total time Joint training 192 268 364 824(+207%) This article 74 102 108 284(+6%) Fine-tuning 72 96 100 268
[0126] like Figure 6 As shown, (a)-(d) further show the changes in the Acc index of the model on data sets D1-D4. It can be seen that when the model is updated using the fine-tuning strategy, the performance of the model on the historical data set will continue to deteriorate, while the method of the present invention enables the model to still have a high accuracy on all learned historical data sets.
[0127] The method for constructing a playback sample pool based on sample uncertainty and diversity proposed in this embodiment considers the uncertainty and diversity of samples and selects historical key samples close to the model classification boundary and widely covering the feature space to construct a playback sample pool. Since there is no need to store all historical samples, huge storage resources are saved. The model parameter importance identification method based on classification loss proposed in this embodiment uses the gradient of the model parameter on the model parameter of the classification loss of the model on the historical data set to express the degree of influence of the model parameter change on the model evaluation accuracy, and accurately identifies the importance of the model parameter to the learned old knowledge. The incremental learning update method based on class-balanced sampling playback and model parameter regularization proposed in this embodiment. The class-balanced sampling mechanism can avoid the model's classification boundary of historical samples from tilting toward the majority class, thereby improving the playback effect of historical samples. The model parameter regularization loss based on parameter importance can use parameters with high importance to protect old knowledge, while using parameters with low importance to learn new knowledge, so that the model can maintain high-precision performance in both new and old data.
[0128] The embodiment of the present application also provides an incremental learning device for continuously updating a power grid transient stability assessment model. It should be noted that the incremental learning device for continuously updating a power grid transient stability assessment model of the embodiment of the present application can be used to execute the incremental learning method for continuously updating a power grid transient stability assessment model provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and conceivable.
[0129] The following introduces an incremental learning device for continuously updating a power grid transient stability assessment model provided in an embodiment of the present application.
[0130] Figure 7 Schematic diagram of an incremental learning device for continuously updating a power grid transient stability assessment model according to an embodiment of the present application. Figure 7 As shown, the device includes: a first acquisition unit 71, a second acquisition unit 72 and a first updating unit 73.
[0131] A first acquisition unit 71 is used to acquire a first data set of the power grid system at a current moment, wherein the first data set includes multiple groups of data, and any group of data includes electrical diagram features and stability labels corresponding to the electrical diagram features, the electrical diagram features are determined according to transient responses of each node of the power grid system, the stability labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stability labels are used to characterize whether the nodes are stable;
[0132] Specifically, the stability tag usually refers to the stability of the system. The stability tag of the maximum power angle difference of the generator means that the maximum power angle difference between the generators in the system can maintain the stable operation of the system within a certain range. If the maximum power angle difference exceeds the stability range of the system, the system may become unstable, causing power grid failure or even large-scale power outages. Therefore, monitoring and controlling the maximum power angle difference of the generator to ensure the stable operation of the system is a very important task in the operation and management of the power system. Through reasonable control strategies and equipment, the stability of the system can be effectively maintained and the reliability and safety of the power grid can be improved.
[0133] The second acquisition unit 72 is used to acquire the historical sample playback data and the first parameter importance data in the playback sample pool, wherein the first parameter importance data is the importance data of each layer of the network parameter of the power grid transient stability assessment model at the previous moment;
[0134] Specifically, the importance of model parameters is calculated based on the gradient of the classification loss of the dataset to the model parameters, and the model parameter importance is used to update the model in the incremental learning update module. A replay sample pool is constructed from the complete dataset based on the uncertainty and diversity of the samples, and the replay sample pool is used to update the model in the incremental learning update module.
[0135] The first updating unit 73 is used to perform incremental learning update on the power grid transient stability assessment model at the previous moment by using the first data set, historical sample playback data, and first parameter importance data to obtain the power grid transient stability assessment model after incremental learning update at the current moment.
[0136] Specifically, the model is updated through incremental learning based on historical sample playback data, model parameter importance, and current data, ensuring the stable evaluation accuracy of the updated model in the new operating topology. This enables rapid model updates in scenarios where the power system operating topology changes frequently, and avoids the problem of "catastrophic forgetting" of the model.
[0137] In this embodiment, the first acquisition unit is used to acquire the first data set of the power grid system at the current moment, wherein the first data set includes multiple groups of data, any group of data includes electrical diagram features, and stable labels corresponding to the electrical diagram features, the electrical diagram features are determined according to the transient response of each node of the power grid system, the stable labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stable labels are used to characterize whether the node is stable; the second acquisition unit is used to acquire the historical sample playback data and the first parameter importance data in the playback sample pool, wherein the first parameter importance data is the importance data of each layer of the network parameters of the power grid transient stability assessment model at the previous moment; the first update unit is used to use the first data set, the historical sample playback data, and the first parameter importance data to perform incremental learning and update on the power grid transient stability assessment model at the previous moment, and obtain the power grid transient stability assessment model after incremental learning and update at the current moment. Incremental learning and updating of the model according to the historical sample playback data, the model parameter importance and the current data ensures the stable evaluation accuracy of the updated model in the new operating topology, and solves the problem of catastrophic forgetting caused by the model continuously learning multiple different data sets under the conditions of continuous changes in the power grid topology and continuous accumulation of data sets.
[0138] As an optional scheme, the device also includes a first determination unit and a storage unit; the first determination unit is used to determine the second parameter importance data of the power grid transient stability assessment model after incremental learning and updating at the current moment according to the first data set after obtaining the power grid transient stability assessment model after incremental learning and updating at the current moment, and determine the sample playback data at the current moment according to the first data set; the storage unit is used to store the sample playback data at the current moment in the playback sample pool.
[0139] Specifically, after obtaining the updated power grid transient stability assessment model, continue to calculate the model parameter importance of the updated power grid transient stability assessment model, and determine the sample playback data at the current moment based on the data in the current data set; use the model parameter importance of the updated power grid transient stability assessment model and the sample playback data at the current moment to perform incremental learning and update the power grid transient stability assessment model at the next moment.
[0140] In an optional solution, the first determination unit includes a first determination module, a second determination module and a processing module; the first determination module is used to determine the value of the first determination module according to the first formula: Determine the cross entropy loss L of the power grid transient stability assessment model after incremental learning update at the current moment CE (X,Y), where x is the electrical diagram feature, y is the stable label, n is the number of data in the first data set, and p i is the stability prediction probability of the model for the i-th data in the first data set; the second determination module is used to determine the stability of the i-th data according to the second formula: Determine the importance of each layer of network parameters of the power grid transient stability assessment model after incremental learning update at the current moment, where θ i is the i-th layer network parameter of the power grid transient stability assessment model, is the gradient differential, ω i is the network parameter importance of the i-th layer network parameter; the processing module is used to normalize the importance of each layer of the network parameter of the power grid transient stability assessment model after incremental learning and update at the current moment to obtain the second parameter importance data.
[0141] Specifically, the proposed model parameter importance identification method based on classification loss uses the gradient of the model's classification loss on historical data sets to express the impact of model parameter changes on model evaluation accuracy, and accurately identifies the importance of model parameters to the learned old knowledge.
[0142] In an optional solution, the first determination unit further includes a third determination module, a fourth determination module, a fifth determination module and a selection module; the third determination module is used to determine the value of the third determination module according to the third formula: Determine the uncertainty score of each data in the first data set, where is the uncertainty score of the i-th data, p i is the stability prediction probability of the model for the i-th data in the first data set; the fourth determination module is used to determine the probability according to the fourth formula: Determine the diversity score of each data in the first data set, where: is the diversity score of the i-th data, x i is the i-th data of the first data set, x jis the playback data of the jth historical sample in the playback sample pool, x i,k is the characteristic scalar of the kth dimension of the i-th data feature vector, x j,k is the characteristic scalar of the kth dimension of the jth historical sample playback data, s k is the standard deviation of the kth dimension of the i-th data feature vector and the j-th historical sample playback data; the fifth determination module is used to determine the standard deviation of the k-th dimension of the j-th historical sample playback data according to the fifth formula: Determine the total score of each data in the first data set, where s i is the total score of the i-th data in the first data set, and α is a weighting parameter; the selection module is used to arrange the total scores of each data in the first data set in reverse order, and select the first preset number of data as the sample playback data at the current moment.
[0143] Specifically, considering the uncertainty and diversity of samples, historical key samples close to the model classification boundary and widely covering the feature space are selected to construct the playback sample pool. Since there is no need to store all historical samples, huge storage resources are saved.
[0144] An optional solution, the device also includes a calculation unit, a second determination unit and a second update unit; the calculation unit is used to calculate the first cross entropy loss of the power grid transient stability assessment model at the previous moment according to the first data set, calculate the second cross entropy loss of the power grid transient stability assessment model at the previous moment according to the historical sample playback data, and calculate the parameter regularization loss of the power grid transient stability assessment model at the previous moment according to the first parameter importance data; the second determination unit is used to determine the incremental learning loss function according to the first cross entropy loss, the second cross entropy loss and the parameter regularization loss; the second update unit is used to perform incremental learning update on the power grid transient stability assessment model at the previous moment according to the incremental learning loss function.
[0145] Specifically, the new dataset, the playback sample pool of the old dataset, and the importance of the model parameters are used to update the stable evaluation model. In order to ensure that the model can still maintain the accuracy on the old dataset after learning the new dataset, the playback samples are sampled from the playback sample pool of the old dataset based on class-balanced sampling, and then the playback samples are trained using the cross-entropy loss. At the same time, the model parameter regularization loss is constructed to limit the parameter changes of the model during the update.
[0146] In an optional solution, the device also includes an evaluation unit, which is used to perform transient stability evaluation on the power grid system using the power grid transient stability evaluation model updated by incremental learning at the current moment after obtaining the power grid transient stability evaluation model updated by incremental learning at the current moment.
[0147] Specifically, the updated power grid transient stability assessment model is used to perform transient stability assessment on the power grid system, so that the steady-state assessment result of the power grid system obtained is more accurate.
[0148] An optional solution, a power grid transient stability assessment model includes an upstream network and a downstream network, the upstream network is composed of a second preset number of graph attention networks and a third preset number of hierarchical pooling modules cross-connected in series, and the downstream network includes a stability classifier composed of multiple layers of fully connected layers.
[0149] Specifically, the upstream network of the model consists of three graph attention networks and three hierarchical pooling modules connected in series, which input electrical graph features x and graph adjacency matrix A and output high-level graph features. The downstream network of the model contains a stability classifier composed of multiple fully connected layers, which inputs high-level graph features and outputs the predicted system stability probability p.
[0150] The incremental learning device for continuously updating the transient stability assessment model of the power grid includes a processor and a memory, wherein the first acquisition unit, the second acquisition unit, the first update unit, etc. are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The above modules are all located in the same processor; or, the above modules are located in different processors in any combination.
[0151] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to solve the problem of catastrophic forgetting caused by the model continuously learning multiple different data sets under the conditions of constantly changing power grid topology and constantly accumulating data sets.
[0152] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0153] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute an incremental learning method for continuously updating the transient stability assessment model of the power grid.
[0154] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes an incremental learning method for continuously updating the power grid transient stability assessment model when running.
[0155] An embodiment of the present invention provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0156] Step S201, obtaining a first data set of the power grid system at the current moment, wherein the first data set includes multiple groups of data, any group of data includes electrical diagram features, and stability labels corresponding to the electrical diagram features, the electrical diagram features are determined according to transient responses of each node of the power grid system, the stability labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stability labels are used to characterize whether the nodes are stable;
[0157] Step S202, obtaining historical sample playback data and first parameter importance data in the playback sample pool, wherein the first parameter importance data is the importance data of each layer of network parameters of the power grid transient stability assessment model at the previous moment;
[0158] Step S203, using the first data set, the historical sample playback data, and the first parameter importance data to perform incremental learning and updating on the power grid transient stability assessment model at the previous moment, to obtain the power grid transient stability assessment model after incremental learning and updating at the current moment.
[0159] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0160] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0161] Step S201, obtaining a first data set of the power grid system at the current moment, wherein the first data set includes multiple groups of data, any group of data includes electrical diagram features, and stability labels corresponding to the electrical diagram features, the electrical diagram features are determined according to transient responses of each node of the power grid system, the stability labels are determined according to the maximum power angle difference of the generators of each node of the power grid system, and the stability labels are used to characterize whether the nodes are stable;
[0162] Step S202, obtaining historical sample playback data and first parameter importance data in the playback sample pool, wherein the first parameter importance data is the importance data of each layer of network parameters of the power grid transient stability assessment model at the previous moment;
[0163] Step S203, using the first data set, the historical sample playback data, and the first parameter importance data to perform incremental learning and updating on the power grid transient stability assessment model at the previous moment, to obtain the power grid transient stability assessment model after incremental learning and updating at the current moment.
[0164] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0165] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0166] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0167] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0168] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0169] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0170] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0171] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0172] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0173] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An incremental learning method for continuously updating the transient stability assessment model of power grid, It is characterized in that include: Acquire a first data set of the power grid system at the current moment, wherein the first data set includes multiple groups of data, any group of the data includes electrical diagram features and stability labels corresponding to the electrical diagram features, the electrical diagram features are determined according to transient responses of each node of the power grid system, the stability labels are determined according to maximum power angle differences of generators of each node of the power grid system, and the stability labels are used to characterize whether the node is stable; Acquire historical sample playback data and first parameter importance data in the playback sample pool, wherein the first parameter importance data is the importance data of each layer of network parameters of the power grid transient stability assessment model at the previous moment; The first data set, the historical sample playback data, and the first parameter importance data are used to perform incremental learning and updating on the power grid transient stability assessment model at the previous moment to obtain the power grid transient stability assessment model after the incremental learning and updating at the current moment.
2. The method according to claim 1, It is characterized in that After obtaining the power grid transient stability assessment model updated by the incremental learning at the current moment, the method further includes: Determining second parameter importance data of the power grid transient stability assessment model updated by the incremental learning at the current moment according to the first data set, and determining sample playback data at the current moment according to the first data set; The sample playback data at the current moment is stored in the playback sample pool.
3. The method according to claim 2, It is characterized in that Determining second parameter importance data of the power grid transient stability assessment model updated by the incremental learning at the current moment according to the first data set includes: According to the first formula: Determine the cross entropy loss L of the power grid transient stability assessment model after the incremental learning update at the current moment CE (X, Y), where x is the electrical diagram feature, y is the stable label, n is the number of data in the first data set, and p i is the predicted probability of stability of the model for the i-th data in the first data set; According to the second formula: Determine the importance of each layer of network parameters of the power grid transient stability assessment model after incremental learning update at the current moment, where θ i is the i-th layer network parameter of the power grid transient stability assessment model, is the gradient differential, ω i is the network parameter importance of the i-th layer network parameter; The importance of the network parameters of each layer of the power grid transient stability assessment model updated by the incremental learning at the current moment is normalized to obtain the second parameter importance data.
4. The method according to claim 2, It is characterized in that Determining sample playback data at a current moment according to the first data set includes: According to the third formula: Determine the uncertainty score of each of the data in the first data set, where, is the uncertainty score of the i-th data, and pi is the stability prediction probability of the model for the i-th data in the first data set; According to the fourth formula: Determine a diversity score for each of the data in the first data set, wherein: is the diversity score of the i-th data, x i is the i-th data of the first data set, x j is the jth historical sample playback data in the playback sample pool, x i,k is the characteristic scalar of the kth dimension of the i-th data feature vector, x j,k is the characteristic scalar of the kth dimension of the jth historical sample playback data, s k is the standard deviation of the kth dimension of the i-th data feature vector and the j-th historical sample playback data; According to the fifth formula: Determine the total score of each of the data in the first data set, where s i is the total score of the i-th data of the first data set, and α is a weighting parameter; The total scores of the data in the first data set are arranged in reverse order, and the first first preset number of the data are selected as the sample playback data at the current moment.
5. The method according to claim 1, It is characterized in that Using the first data set, the historical sample playback data, and the first parameter importance data to incrementally learn and update the power grid transient stability assessment model at the previous moment, including: Calculating a first cross entropy loss of the power grid transient stability assessment model at a previous moment according to the first data set, calculating a second cross entropy loss of the power grid transient stability assessment model at a previous moment according to the historical sample playback data, and calculating a parameter regularization loss of the power grid transient stability assessment model at a previous moment according to the first parameter importance data; Determining an incremental learning loss function according to the first cross entropy loss, the second cross entropy loss, and the parameter regularization loss; The power grid transient stability assessment model at the previous moment is incrementally learned and updated according to the incremental learning loss function.
6. The method according to claim 1, It is characterized in that After obtaining the power grid transient stability assessment model updated by the incremental learning at the current moment, the method further includes: The power grid transient stability assessment model updated by the incremental learning at the current moment is used to perform transient stability assessment on the power grid system.
7. The method according to claim 1, It is characterized in that The power grid transient stability assessment model includes an upstream network and a downstream network, the upstream network is composed of a second preset number of graph attention networks and a third preset number of hierarchical pooling modules cross-connected in series, and the downstream network includes a stability classifier composed of multiple layers of fully connected layers.
8. An incremental learning device for continuously updating a power grid transient stability assessment model, It is characterized in that include: a first acquisition unit, configured to acquire a first data set of the power grid system at a current moment, wherein the first data set includes multiple groups of data, any group of the data includes electrical diagram features, and stability labels corresponding to the electrical diagram features, the electrical diagram features are determined according to transient responses of each node of the power grid system, the stability labels are determined according to maximum power angle differences of generators of each node of the power grid system, and the stability labels are used to characterize whether the node is stable; A second acquisition unit is used to acquire historical sample playback data and first parameter importance data in the playback sample pool, wherein the first parameter importance data is the importance data of each layer of network parameters of the power grid transient stability assessment model at the previous moment; The first updating unit is used to use the first data set, the historical sample playback data, and the first parameter importance data to perform incremental learning and update on the power grid transient stability assessment model at the previous moment, so as to obtain the power grid transient stability assessment model after the incremental learning and update at the current moment.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the incremental learning method for continuously updating the power grid transient stability assessment model as described in any one of claims 1 to 7.
10. An electronic device, It is characterized in that include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include an incremental learning method for continuously updating the power grid transient stability assessment model as described in any one of claims 1 to 7.
