Optimal power flow data driven solution high-reliability sample set construction method and device, storage medium and electronic equipment
By constructing a high-confidence optimal flow sample set, the problem of low calculation accuracy when facing data-driven optimal flow method is solved, and higher calculation accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202411827057.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-12
AI Technical Summary
The existing data-driven optimal flow method has low calculation accuracy when facing data outside the distribution, making it difficult to effectively deal with abnormal load scenarios such as extreme weather.
By establishing the optimal flow model based on power system parameters, derive the sensitivity of control variables and load levels, and searching for local and global optimal flow nonlinear sample sets, combining these sample sets and basic sample sets, and building high-confidence sample sets to improve the performance of neural networks.
The calculation accuracy and robustness of the data-driven optimal flow calculation method are improved, and the out-of-distributed data and extreme load scenarios can be better handled.
Smart Images

Figure CN119691452A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power systems and automation thereof, and in particular to a method, device, storage medium and electronic device for constructing a high-confidence sample set for optimal power flow data-driven solution. Background Art
[0002] Data-driven optimal power flow (OPF) methods use neural networks as an agent for approximate OPF calculations, which can directly predict the estimated OPF solution without any time-consuming iterative solution. In the context of the global vigorous development of renewable energy, in order to cope with the uncertainty of renewable resources, the frequency of OPF calculations in power systems will increase, and there is an urgent need for OPF calculation methods with fast calculation speed. Therefore, data-driven OPF calculation methods with higher computational efficiency have attracted widespread attention from academia and industry, and have gradually become a research hotspot in recent years.
[0003] In order to learn the OPF calculation mapping, data-driven OPF calculation methods usually use a large number of OPF samples to train neural networks. This leads to a strong dependence of neural networks on training data. The learning goal of neural networks is to minimize the error between the output results of the neural network and the labels of the training data. When a certain type of scenario has a high probability in the training data set, the neural network will pay more attention to such scenarios. Therefore, when the test data and the training data present the same and independent distribution (IID), the neural network can guarantee high calculation accuracy. However, when out-of-distribution (OOD) data appears, such as abnormal loads caused by extreme weather, the neural network will have a large error. To this end, some scholars have proposed a robust optimization algorithm to make neural network training pay more attention to the scenario with the largest error, that is, OOD data. However, the performance of these methods still depends on historical data or generated training data. How to construct training data that accurately characterizes the OPF calculation mapping is the key to improving the credibility of data-driven OPF calculation methods.
[0004] In summary, it is urgent to study the method of constructing a high-confidence sample set for data-driven solution of optimal power flow, and to improve the calculation accuracy of data-driven optimal power flow by searching for training samples that can accurately characterize the optimal power flow calculation mapping through physical models. Summary of the invention
[0005] The embodiments of the present application provide a method, device, storage medium and electronic device for constructing a high-confidence sample set by driving an optimal power flow data solution to improve the performance of a neural network.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to a first aspect of an embodiment of the present application, a method for constructing a high-confidence sample set by driving optimal power flow data is provided, comprising:
[0008] Establishing an optimal power flow model of the power system based on power system parameters, and deriving the sensitivity of optimal power flow control variables of the optimal power flow model to load levels;
[0009] Searching for a local optimal power flow nonlinear sample set based on the optimal power flow model;
[0010] Searching for a global optimal power flow nonlinear sample set based on the optimal power flow model;
[0011] The local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set and the basic sample set are combined to obtain an optimal power flow high-confidence sample set.
[0012] In some embodiments of the present application, based on the aforementioned solution, the step of establishing an optimal power flow model of the power system based on power system parameters includes:
[0013] Obtain power system parameters and establish the power system optimal power flow model using formulas (1)-(5);
[0014]
[0015] Among them, a i , b i , c i is the cost coefficient of the i-th unit; P G,i , Q G,i is the active and reactive output of the i-th unit; and * respectively represent the upper and lower limits of the variable *; S G , S B are the serial number sets of the units and nodes respectively; P D,i , Q D,i is the active and reactive loads of the ith node; G ij , B ij are the i-th row and j-th column elements in the conductance matrix and the susceptance matrix respectively; P L,ij and Q L,ij represents the active and reactive power flows of the lines connected to nodes i and j; and S ij Represents the upper and lower limits of the apparent power of the lines connected to nodes i and j.
[0016] In some embodiments of the present application, based on the above solution, the deriving of the sensitivity of the optimal power flow control variables of the optimal power flow model to the load level includes:
[0017] Convert the optimal power flow model into a formula;
[0018] Derive the KKT conditions of the optimal power flow model after formula conversion;
[0019] The sensitivity of the optimal power flow control variables of the optimal power flow model to the load level is determined based on the KKT condition.
[0020] In some embodiments of the present application, based on the above solution, searching for a local optimal power flow nonlinear sample set based on the optimal power flow model includes:
[0021] A large number of system states are extracted according to the distribution of system loads, and the optimal power flow model is solved to obtain sample labels, and a basic sample set is constructed based on the sample labels;
[0022] Constructing an optimal power flow solving neural network, and using the basic sample set to train the optimal power flow solving neural network to obtain an optimal power flow calculation pre-trained neural network;
[0023] Using the optimal power flow calculation pre-trained neural network to calculate the basic sample set, find K samples with the largest errors as the search starting point of the local optimal power flow nonlinear sample, and calculate the sensitivity matrix of the output and input characteristics of the optimal power flow calculation pre-trained neural network;
[0024] Searching for input features of local optimal power flow nonlinear samples based on the sensitivity matrix of the output and input features of the pre-trained neural network calculated according to the optimal power flow and the sensitivity of the output and input of the optimal power flow model;
[0025] The input characteristics of the local optimal power flow nonlinear sample are updated according to the upper and lower limit constraints of the system state, and the optimal power flow solution under the corresponding power system state is calculated to obtain the local optimal power flow nonlinear sample;
[0026] A local optimal power flow nonlinear sample set is obtained based on the local optimal power flow nonlinear sample.
[0027] In some embodiments of the present application, based on the aforementioned solution, searching for a global optimal power flow nonlinear sample set based on the optimal power flow model includes:
[0028] For the sample sets of the optimal power flow calculation pre-trained neural network and the training neural network, the K samples with the largest calculation errors are used as the search starting points for the global optimal power flow nonlinear samples, and the sensitivity matrix of the output and input characteristics of the optimal power flow calculation pre-trained neural network is calculated;
[0029] Iteratively searching for the local optimal power flow nonlinear sample until the effective constraint of the local optimal power flow nonlinear sample changes, and obtaining the local optimal power flow nonlinear sample before the effective constraint changes and the local optimal power flow nonlinear sample after the effective constraint changes;
[0030] Performing physical model-guided gradient calculation on the local optimal power flow nonlinear samples after the active constraints are changed, and calculating the standardized gradient;
[0031] According to the position and normalized gradient of the local optimal power flow nonlinear sample before the active constraint changes, the power system state after the active constraint changes is updated, and the corresponding optimal power flow solution is calculated by the interior point method to obtain the global optimal power flow nonlinear sample;
[0032] A global optimal power flow nonlinear sample set is obtained based on the global optimal power flow nonlinear sample.
[0033] According to a second aspect of an embodiment of the present application, there is provided a device for constructing a high-confidence sample set by driving optimal power flow data, comprising:
[0034] An establishing unit, for establishing an optimal power flow model of the power system based on power system parameters;
[0035] A derivation unit, used for deriving the sensitivity of the optimal power flow control variables of the optimal power flow model to the load level;
[0036] A first search unit, configured to search for a local optimal power flow nonlinear sample set based on the optimal power flow model;
[0037] A second search unit, configured to search for a global optimal power flow nonlinear sample set based on the optimal power flow model;
[0038] The merging unit is used to merge the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set and the basic sample set to obtain an optimal power flow high-confidence sample set.
[0039] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the method according to the first aspect.
[0040] According to a fourth aspect of an embodiment of the present application, there is provided an electronic device, including: a memory and a processor;
[0041] The memory is used to store computer instructions;
[0042] The processor is used to call the computer instructions stored in the memory so that the electronic device executes the method described in the first aspect.
[0043] The technical solution of the present application can promote neural network learning and improve the generalization performance of the trained optimal power flow calculation neural network by directional extraction of nonlinear samples with strong mapping representation ability for optimal power flow solution.
[0044] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0046] Figure 1 A schematic diagram of a process of constructing a high-confidence sample set by optimal power flow data-driven solution according to an embodiment of the present application is shown;
[0047] Figure 2 A schematic diagram showing the mean absolute error of searching samples in different methods according to an embodiment of the present application is shown;
[0048] Figure 3 A load curve of a certain area and a schematic diagram of test errors corresponding to different methods according to an embodiment of the present application are shown;
[0049] Figure 4 A block diagram of a device for constructing a high-confidence sample set for optimal power flow data-driven solution according to an embodiment of the present application is shown;
[0050] Figure 5 A block diagram of an electronic device according to an embodiment of the present application is shown;
[0051] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0052] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0053] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0054] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0055] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0056] 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 sequence. It should be understood that the objects used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those shown or described.
[0057] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0059] See also Figure 1 , shows a flow chart of a method for constructing a high-confidence sample set driven by optimal power flow data according to an embodiment of the present application.
[0060] like Figure 1As shown, a method for constructing a high-confidence sample set for optimal power flow data-driven solution is presented, which specifically includes steps S100 to S400.
[0061] refer to Figure 1 , step S100, establishing an optimal power flow model of the power system based on the power system parameters, and deriving the sensitivity of the optimal power flow control variables of the optimal power flow model to the load level.
[0062] In some feasible embodiments, based on the above solution, the step of establishing an optimal power flow model of the power system based on power system parameters includes:
[0063] Obtain power system parameters and establish the power system optimal power flow model using formulas (1)-(5);
[0064]
[0065]
[0066] Among them, a i , b i , c i is the cost coefficient of the i-th unit; P G,i , Q G,i is the active and reactive output of the i-th unit; and * Respectively represent the upper and lower limits of the variable*; S G , S B are the serial number sets of the units and nodes respectively; P D,i , Q D,i is the active and reactive loads of the ith node; G ij , B ij are the i-th row and j-th column elements in the conductance matrix and the susceptance matrix respectively; P L,ij and Q L,ij represents the active and reactive power flows of the lines connected to nodes i and j; and S ij Represents the upper and lower limits of the apparent power of the lines connected to nodes i and j.
[0067] In some feasible embodiments, based on the above solution, deriving the sensitivity of the optimal power flow control variables of the optimal power flow model to the load level includes:
[0068] Convert the optimal power flow model into a formula;
[0069] Derive the KKT conditions of the optimal power flow model after formula conversion;
[0070] The sensitivity of the optimal power flow control variables of the optimal power flow model to the load level is determined based on the KKT condition.
[0071] Exemplarily, the steps are as follows:
[0072] First, the optimal power flow models (1)-(5) are unified into equations (6)-(8).
[0073]
[0074] in represents the optimization variables in the optimal power flow model, including the active output of the unit, the reactive output of the unit and the node voltage, etc.; n represents the number of nodes in the power system; n g represents the number of generators; x0 represents the state of the power system, including active load and reactive load; h(x0,y) and g(y) represent the equality constraints and inequality constraints in the optimal power flow model respectively; f(y) is the objective function in the optimal power flow model.
[0075] Then, the KKT condition of the optimal power flow model (6)-(8) is derived as shown in formula (9):
[0076]
[0077] where z and w represent the Lagrange multipliers that act on the equality constraints and the inequality constraints; and D represents the operation of constructing a diagonal matrix.
[0078] The main purpose of the optimal power flow problem is to determine the generator solution with the lowest cost based on a specific load distribution. Therefore, in equations (6)-(8), x0 represents a constant load that remains unchanged throughout the solution algorithm. However, when dealing with various optimal power flow problems involving fluctuating load conditions, it is converted to a differentiable continuous variable x. By differentiating the input characteristic variable x, output characteristic variable y, and Lagrange multipliers z and w in equation (9), equation (10) is obtained.
[0079]
[0080] Then, converting equation (10) into a matrix form, we can get equation (11).
[0081]
[0082] in,
[0083]
[0084] Finally, by substituting dx=I into equation (11) and solving equation (11), the sensitivity matrix dy between y and x can be calculated.
[0085] Continue to refer Figure 1, step S200, searching for a local optimal power flow nonlinear sample set based on the optimal power flow model.
[0086] In some feasible embodiments, based on the above solution, searching for a local optimal power flow nonlinear sample set based on the optimal power flow model includes:
[0087] A large number of system states are extracted according to the distribution of system loads, and the optimal power flow model is solved to obtain sample labels, and a basic sample set is constructed based on the sample labels;
[0088] Constructing an optimal power flow solving neural network, and using the basic sample set to train the optimal power flow solving neural network to obtain an optimal power flow calculation pre-trained neural network;
[0089] Using the optimal power flow calculation pre-trained neural network to calculate the basic sample set, find K samples with the largest errors as the search starting point of the local optimal power flow nonlinear sample, and calculate the sensitivity matrix of the output and input characteristics of the optimal power flow calculation pre-trained neural network;
[0090] Searching for input features of local optimal power flow nonlinear samples based on the sensitivity matrix of the output and input features of the pre-trained neural network calculated according to the optimal power flow and the sensitivity of the output and input of the optimal power flow model;
[0091] The input characteristics of the local optimal power flow nonlinear sample are updated according to the upper and lower limit constraints of the system state, and the optimal power flow solution under the corresponding power system state is calculated to obtain the local optimal power flow nonlinear sample;
[0092] A local optimal power flow nonlinear sample set is obtained based on the local optimal power flow nonlinear sample.
[0093] Exemplarily, the steps are as follows:
[0094] Firstly, a large number of system states are extracted according to the distribution of system loads, and the optimal power flow model equations (1)-(5) are solved to obtain sample labels, thus completing the construction of the basic local optimal power flow nonlinear sample set.
[0095] Then, an optimal power flow solving neural network is constructed, and the basic local optimal power flow nonlinear sample set is used to train the neural network to obtain the optimal power flow calculation pre-trained neural network ψ.
[0096] Secondly, the optimal power flow calculation pre-trained neural network is used to calculate the basic sample set, find the K samples with the largest error as the search starting point for the local optimal power flow nonlinear sample, and calculate the sensitivity matrix of its output and input characteristics
[0097] Again, the input features of the local optimal power flow nonlinear sample are searched based on the sensitivity matrix of the neural network output and input features and the sensitivity of the optimal power flow model output and input. The gradient calculation of the neural network output and input features at the search starting point (x0, y0) is as shown in formula (13).
[0098]
[0099] Finally, the system state is updated according to the upper and lower limit constraints, as shown in equations (14) and (15).
[0100] And calculate the corresponding system state The optimal power flow solution under Obtain the local optimal power flow nonlinear sample.
[0101]
[0102] Among them, ε represents the step size of the search; x max and x min Indicates the upper and lower limits of the system status.
[0103] refer to Figure 1 , step S300, searching for a global optimal power flow nonlinear sample set based on the optimal power flow model.
[0104] In some feasible embodiments, based on the above solution, searching for a global optimal power flow nonlinear sample set based on the optimal power flow model includes:
[0105] For the optimal power flow calculation pre-trained neural network and the basic sample set, the K samples with the largest calculation errors are used as the search starting points for the global optimal power flow nonlinear samples, and the sensitivity matrix of the output and input characteristics of the optimal power flow calculation pre-trained neural network is calculated;
[0106] Iteratively searching for the local optimal power flow nonlinear sample until the effective constraint of the local optimal power flow nonlinear sample changes, and obtaining the local optimal power flow nonlinear sample before the effective constraint changes and the local optimal power flow nonlinear sample after the effective constraint changes;
[0107] Performing physical model-guided gradient calculation on the local optimal power flow nonlinear samples after the active constraints are changed, and calculating the standardized gradient;
[0108] According to the position and normalized gradient of the local optimal power flow nonlinear sample before the active constraint changes, the power system state after the active constraint changes is updated, and the corresponding optimal power flow solution is calculated by the interior point method to obtain the global optimal power flow nonlinear sample;
[0109] A global optimal power flow nonlinear sample set is obtained based on the global optimal power flow nonlinear sample.
[0110] Exemplarily, the specific process of this step is as follows:
[0111] Step a: For a given optimal power flow calculation pre-trained neural network and basic sample set, calculate the K samples with the largest error as the search starting point for the global optimal power flow nonlinear sample, and calculate the sensitivity matrix of its output and input features
[0112] Step b: Iterate the search for the local optimal power flow nonlinear sample until the effective constraint of the local optimal power flow nonlinear sample changes, and obtain the local optimal power flow nonlinear sample before the effective constraint changes (x f,s ,y f,s ) and the nonlinear sample of the local optimal power flow after the active constraint changes (x to,s ,y to,s ).
[0113] Step c: Perform the physical model-guided gradient calculation formula (13) on the local optimal power flow nonlinear sample after the active constraint changes, and calculate its standardized gradient J nor , such as (16):
[0114]
[0115] Step d: Based on the nonlinear sample position and normalized gradient of the local optimal power flow before the active constraint changes, update the system state after the active constraint changes, update the formula as (17), and use the interior point method to calculate the corresponding optimal power flow solution y to,s+1 , obtain the global optimal power flow nonlinear sample (x to,s+1 ,y to,s+1 ).
[0116] x to,s+1 =x to,s +α(x f,s -x to,s )+βJ nor ; (17)
[0117] Among them, α and β represent the search coefficients respectively.
[0118] Step e: Finally, perform multiple iterations of step d to ensure that sufficient local optimal power flow nonlinear samples are extracted in the linear region to obtain the global optimal power flow nonlinear sample set.
[0119] refer to Figure 1 , step S400, merging the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set and the basic sample set to obtain an optimal power flow high-confidence sample set.
[0120] It can be understood that the basic sample set is obtained by random sampling based on the optimal power flow model.
[0121] It should be noted that when the number of basic sample sets is small, steps S100 to S400 are repeated to extract sufficient local optimal power flow nonlinear samples to ensure high credibility of the local optimal power flow nonlinear sample set.
[0122] Several specific examples are provided below.
[0123] Example 1
[0124] This example is tested in an IEEE 14-node system. For the system settings, this example adds wind farms and photovoltaic systems to the standard IEEE 14-node system to simulate the uncertainty of renewable energy, where the wind speed follows a Weibull distribution with λ=5.089, k=2.016, and the solar irradiance follows a β distribution with α=2.06, β=2.5. The wind farms are randomly connected to different nodes so that the renewable energy penetration rate of the system reaches 20%. It is assumed that the load fluctuation follows a normal distribution with a mean value equal to the default value of the system and a standard deviation of 0.3. This example uses the PYPOWER library to generate a basic sample set and a test sample set on a PC with an Intel Core i7-10700K CPU @ 3.80GHz, 3.80GHz, 16GB RAM, and NIVIDIA GeForce RTX 2080Ti, and performs neural network training. The basic sample set contains 50,000 samples and the test sample set contains 10,000 samples. The neural network uses a fully connected neural network with three hidden layers, each containing 200 neurons. This example uses probability accuracy and relative error to evaluate the performance of the neural network, such as:
[0125]
[0126] Where T and are the predicted value and true value of the neural network respectively; σ represents the threshold; e ref Indicates the reference value of the corresponding variable.
[0127] In this example, five methods for constructing sample sets are tested. M0 is a method for constructing a local optimal power flow nonlinear sample set by random sampling; M1 is a fast gradient sign method based on M0, which adds adversarial samples on the basis of M0; M2 is a projected gradient sign method, which mainly improves the gradient update method on the basis of M1. M3 is a projected gradient sign method considering momentum, which further considers momentum on the basis of the gradient update of M2; M4 is the proposed local optimal power flow nonlinear sample collection method; M5 is the proposed global optimal power flow nonlinear sample collection method.
[0128] Firstly, the effectiveness of the proposed method for optimal power flow red nonlinear sample collection is verified in an IEEE 14-node system. The fully connected neural network is trained using the basic sample set. Then, the trained fully connected neural network is used as a pre-trained neural network to search for adversarial samples using M1-M5. Figure 2 The mean absolute error of the search samples in different methods is given. It can be seen that the adversarial samples searched by M4 and M5 have obvious errors compared with other search methods. The mean absolute error of the active output of the unit even reaches 5MW on average, which shows that the basic sample set cannot accurately characterize the OPF mapping. Although the test error or accuracy index is acceptable, the trained OPF neural network is not robust enough for practical applications. If samples with large errors are added to the basic sample set, the learning of the neural network can be forced to pay more attention to these areas, thereby improving the robustness of the neural network.
[0129] Therefore, this example further adds samples to the basic sample set and fine-tunes the neural network to test different methods to increase the robustness of the neural network. This time, different methods are used to expand 5,000 samples on the 50,000 basic samples, and then the neural network is fine-tuned 200 times. Finally, M0-M5 is used to search for samples, and the calculation accuracy of the search samples is counted. The results are shown in Table 1.
[0130] Table 1 Accuracy of fine-tuning neural network after expanding 5000 samples using different methods
[0131]
[0132] As can be seen from Table 1, the accuracy rate decreased when different adversarial sample search algorithms were used for testing. For example, when the 5000 samples searched by M0 were added to the basic sample set and the fine-tuned neural network was evaluated with M1, the accuracy rates of PG and VG dropped from 99.97% and 99.12% to 97.78% and 94.40%, respectively. When M5 was used for testing, the accuracy rate even plummeted to 29% and 51.5%. Overall, the average decreases of PG and VG were 20.77% and 21.34%, respectively. Therefore, expanding the training set by random sampling cannot effectively deal with adversarial samples. When the training set was expanded using conventional adversarial attacks (M1-M3) and fine-tuned neural networks, the test accuracy rate was improved. However, when the local and global adversarial samples searched by M4 and M5 were used to attack the neural network, the test accuracy rate was still below 90%, especially for the voltage amplitude, the accuracy rate of the global adversarial sample was less than 80%. This phenomenon shows that the training data generated by simply considering the probability of input features cannot guarantee the performance of the neural network in the sampled area, and there are still some areas where the neural network fails to learn accurately. However, with the expansion of training data in M4 and M5, the representation ability of training data has been improved, so that the performance of the fine-tuned neural network under different attacks is still greater than 97%.
[0133] In summary, the optimal power flow global and local nonlinear sample collection method proposed in this example can accurately find samples / feature spaces that are insufficiently learned by the neural network. By adding such samples to the sample set, the performance of the neural network can be further enhanced, verifying the effectiveness of the proposed optimal power flow high-confidence sample set construction method.
[0134] Example 2
[0135] This example is tested in IEEE 39-node system, 118-node system and 2383-node system. For the above system settings, this example adds wind farms and photovoltaic systems to each system to simulate the uncertainty of renewable energy, where the wind speed follows the Weibull distribution, where λ=5.089, k=2.016, and the solar irradiance follows the β distribution, where α=2.06, β=2.5. The wind farms are randomly connected to different nodes so that the renewable energy penetration rate of the system reaches 20%. It is assumed that the load fluctuation follows a normal distribution, with the mean value equal to the default value of the system and the standard deviation of 0.3. This example uses the PYPOWER library to generate the basic sample set and the test sample set on a PC with Intel Core i7-10700K CPU@3.80GHz, 3.80GHz, 16GB RAM and NIVIDIA GeForce RTX 2080Ti, and performs neural network training. The basic sample set contains 50,000 samples and the test sample set contains 10,000 samples. The neural network uses a fully connected neural network with three hidden layers, each containing 200 neurons. This example uses probability accuracy and relative error to evaluate the performance of the neural network, such as:
[0136]
[0137] Where T and are the predicted value and true value of the neural network respectively; σ represents the threshold; e ref Indicates the reference value of the corresponding variable.
[0138] In this example, five methods for constructing sample sets are tested. M0 is a method for constructing a local optimal power flow nonlinear sample set by random sampling; M1 is a fast gradient sign method based on M0, which adds adversarial samples on the basis of M0; M2 is a projected gradient sign method, which mainly improves the gradient update method on the basis of M1. M3 is a projected gradient sign method considering momentum, which further considers momentum on the basis of the gradient update of M2; M4 is the proposed local optimal power flow nonlinear sample collection method; M5 is the proposed global optimal power flow nonlinear sample collection method.
[0139] The optimal power flow calculation pre-trained neural network is trained by using the basic sample set, and then 5000 samples are expanded through M1-M5, and samples are added to the basic sample set, and the neural network is fine-tuned, and then different methods are tested to increase the robustness of the neural network by adding samples. From Example 1, it can be seen that the samples with the largest calculation errors of the neural network are mainly local and global nonlinear samples. Therefore, in this example, local nonlinear samples and global nonlinear samples are mainly used for testing, which are represented as S1 and S2 respectively. The test results are shown in Table 2.
[0140] Table 2 Test accuracy of different methods in different power systems
[0141]
[0142] As can be seen from Table 2, when using S1 and S2 for testing, the accuracy of M0-M3 also decreases to a certain extent, but the accuracy of M4 and M5 can still reach 95%. It is worth noting that in the 2383-node system, the accuracy of VG is around 4%-20%, but the accuracy of M4 and M5 has even increased to 90%. Therefore, the local and global nonlinear sample collection method proposed in this application can well improve the generalization ability of the neural network, making it adaptable to the testing of nonlinear samples, verifying the effectiveness of the method proposed in this application.
[0143] Example 3
[0144] Based on Example 2, this example adds the load of a certain region on January 1, 2022 in equal proportion to the IEEE 39-node system to test the generalization ability of the optimal power flow calculation neural network trained in Example 2. The test results are as follows Figure 3 shown.
[0145] Depend on Figure 3 It can be seen that the test errors of different methods vary at different times as the system load changes. It is worth noting that the error of PG in DCOPF is about 6MW, while all data-driven optimal power flow calculation methods expanded by training data show lower test errors compared with the DCOPF method. In most cases, the test error of the data-driven method is below 1MW. However, in scenarios with low power load demand, the test error will increase due to the scarcity of training samples for such scenarios, such as at the 4th, 5th and 23rd moments. Expanding samples by random sampling (M0) or searching for local nonlinear samples (M4) does not effectively enhance the robustness of the neural network. On the contrary, the use of global nonlinear sampling methods can significantly improve the robustness of the neural network in such challenging scenarios. However, even in these cases, our proposed method ensures that the test error of PG remains below 1MW. The above results fully demonstrate the effectiveness of the proposed method in enhancing the robustness of the optimal power flow calculation neural network, and illustrate the high credibility of the local optimal power flow nonlinear sample set constructed in this application.
[0146] The following describes an apparatus embodiment of the present application, which can be used to execute an optimal power flow data-driven solution high-confidence sample set construction method in the above embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above method embodiment of the present application.
[0147] Reference Figure 4As shown, according to an embodiment of the present application, a device 400 for constructing a high-confidence sample set for optimal power flow data-driven solution includes: . . .
[0148] An establishing unit 401 is used to establish an optimal power flow model of the power system based on power system parameters;
[0149] A derivation unit 402, used for deriving the sensitivity of the optimal power flow control variables of the optimal power flow model to the load level;
[0150] A first searching unit 403, configured to search for a local optimal power flow nonlinear sample set based on the optimal power flow model;
[0151] A second search unit 404 is used to search for a global optimal power flow nonlinear sample set based on the optimal power flow model;
[0152] The merging unit 405 is used to merge the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set and the basic sample set to obtain an optimal power flow high-confidence sample set.
[0153] like Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 510 and executable on the processor. When the processor 520 executes the computer program 511, the steps of the above-mentioned optimal power flow data-driven solution to the high-confidence sample set construction method are implemented.
[0154] Since the electronic device introduced in this embodiment is a device used to implement an optimal power flow data-driven solution to a high-confidence sample set construction device in an embodiment of the present application, based on the method introduced in the embodiment of the present application, technical personnel in this field can understand the specific implementation mode of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present application is not introduced in detail here. As long as the equipment used by technical personnel in this field to implement the method in the embodiment of the present application is within the scope of protection of this application.
[0155] During the specific implementation process, when the computer program 511 is executed by a processor, any implementation method in the embodiments corresponding to the first aspect can be implemented.
[0156] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0157] It should be noted that Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0158] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603, such as executing the method described in the above embodiment. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0159] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.
[0160] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.
[0161] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0162] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0163] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0164] As another aspect, the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes a method for constructing a high-confidence sample set for optimal power flow data-driven solution as described in the above embodiment.
[0165] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements a method for constructing a high-confidence sample set driven by optimal power flow data as described in the above embodiment.
[0166] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0167] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0168] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. It should be understood that the present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for constructing a high-confidence sample set for optimal power flow data-driven solution, characterized in that: include: Establishing an optimal power flow model of the power system based on power system parameters, and deriving the sensitivity of optimal power flow control variables of the optimal power flow model to load levels; Searching for a local optimal power flow nonlinear sample set based on the optimal power flow model; Searching for a global optimal power flow nonlinear sample set based on the optimal power flow model; The local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set and the basic sample set are combined to obtain an optimal power flow high-confidence sample set.
2. The method according to claim 1, characterized in that The method of establishing an optimal power flow model of the power system based on power system parameters includes: Obtain power system parameters and establish the power system optimal power flow model using formulas (1)-(5); Among them, a i , b i , c i is the cost coefficient of the i-th unit; P G,i , Q G,i is the active and reactive output of the i-th unit; and * respectively represent the upper and lower limits of the variable *; S G , S B are the serial number sets of the units and nodes respectively; P D,i , is the active and reactive loads of the ith node; G ij , B ij are the i-th row and j-th column elements in the conductance matrix and the susceptance matrix respectively; P L,ij and Q L,ij represents the active and reactive power flows of the lines connected to nodes i and j; and S ij Represents the upper and lower limits of the apparent power of the lines connected to nodes i and j.
3. The method according to claim 2, characterized in that The step of deriving the sensitivity of the optimal power flow control variables of the optimal power flow model to the load level includes: Convert the optimal power flow model into a formula; Derive the KKT conditions of the optimal power flow model after formula conversion; The sensitivity of the optimal power flow control variables of the optimal power flow model to the load level is determined based on the KKT condition.
4. The method according to claim 3, characterized in that The searching for a local optimal power flow nonlinear sample set based on the optimal power flow model comprises: A large number of system states are extracted according to the distribution of system loads, and the optimal power flow model is solved to obtain sample labels, and a basic sample set is constructed based on the sample labels; Constructing an optimal power flow solving neural network, and using the basic sample set to train the optimal power flow solving neural network to obtain an optimal power flow calculation pre-trained neural network; Using the optimal power flow calculation pre-trained neural network to calculate the basic sample set, find K samples with the largest errors as the search starting point of the local optimal power flow nonlinear sample, and calculate the sensitivity matrix of the output and input characteristics of the optimal power flow calculation pre-trained neural network; Searching for input features of local optimal power flow nonlinear samples based on the sensitivity matrix of the output and input features of the pre-trained neural network calculated according to the optimal power flow and the sensitivity of the output and input of the optimal power flow model; The input characteristics of the local optimal power flow nonlinear sample are updated according to the upper and lower limit constraints of the system state, and the optimal power flow solution under the corresponding power system state is calculated to obtain the local optimal power flow nonlinear sample; A local optimal power flow nonlinear sample set is obtained based on the local optimal power flow nonlinear sample.
5. The method according to claim 4, characterized in that The searching for a global optimal power flow nonlinear sample set based on the optimal power flow model comprises: For the optimal power flow calculation pre-trained neural network and the basic sample set, the K samples with the largest calculation errors are used as the search starting points for the global optimal power flow nonlinear samples, and the sensitivity matrix of the output and input characteristics of the optimal power flow calculation pre-trained neural network is calculated; Iteratively searching for the local optimal power flow nonlinear sample until the effective constraint of the local optimal power flow nonlinear sample changes, and obtaining the local optimal power flow nonlinear sample before the effective constraint changes and the local optimal power flow nonlinear sample after the effective constraint changes; Performing physical model-guided gradient calculation on the local optimal power flow nonlinear samples after the active constraints are changed, and calculating the standardized gradient; According to the position and normalized gradient of the local optimal power flow nonlinear sample before the active constraint changes, the power system state after the active constraint changes is updated, and the corresponding optimal power flow solution is calculated by the interior point method to obtain the global optimal power flow nonlinear sample; A global optimal power flow nonlinear sample set is obtained based on the global optimal power flow nonlinear sample.
6. An optimal power flow data driven solution to a high-confidence sample set construction device, characterized in that: include: An establishing unit, for establishing an optimal power flow model of the power system based on power system parameters; A derivation unit, used for deriving the sensitivity of the optimal power flow control variables of the optimal power flow model to the load level; A first search unit, configured to search for a local optimal power flow nonlinear sample set based on the optimal power flow model; A second search unit, configured to search for a global optimal power flow nonlinear sample set based on the optimal power flow model; The merging unit is used to merge the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set and the basic sample set to obtain an optimal power flow high-confidence sample set.
7. A computer-readable storage medium, characterized in that: The storage medium stores computer instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 5.
8. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer instructions; The processor is used to call the computer instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Tidal velocity prediction method based on fractal theory and improved least square support vector machine
CN108694482A
Online dictionary learning probability optimal power flow method under source-charge interaction electric power market
CN108960485A
Alternating current optimal power flow calculation method, system and equipment of power system and storage medium
CN114421481A
Data-driven opportunity constraint power flow control method considering AGC affine control
CN116646937A
Cited By
Voltage stability domain analysis method based on network information active sampling
CN120237661A