A method and device for constructing a high-confidence sample set for optimal power flow data-driven solving, a storage medium and an electronic device

By constructing an optimal power flow model based on power system parameters and searching and merging local and global nonlinear sample sets, the computational error problem of data-driven optimal power flow methods when facing out-of-distribution data is solved, and the computational accuracy and robustness of neural networks are improved.

CN119691452BActive Publication Date: 2026-02-06STATE GRID CHONGQING ELECTRIC POWER CO ELECTRIC POWER RES INST +3
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411827057.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2026-02-06
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

Existing data-driven optimal power flow methods suffer from significant computational errors in neural networks when dealing with out-of-distribution (OOD) data, especially under abnormal load conditions caused by extreme weather, making it difficult to guarantee computational accuracy.

Method used

By establishing an optimal power flow model based on power system parameters, deriving the sensitivity of control variables and load levels, searching for local and global optimal power flow nonlinear sample sets, and merging these sample sets to construct a high-reliability sample set, the learning ability of the neural network is improved.

Benefits of technology

It improves the computational accuracy and robustness of neural networks when dealing with out-of-distribution data, and enhances the credibility of data-driven optimal power flow calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691452B_ABST
    Figure CN119691452B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a high-confidence sample set construction method and device for optimal power flow data-driven solving, a storage medium and an electronic device, and relate to the field of power systems and their automation. The method comprises: establishing a power system optimal power flow model based on power system parameters, and deriving the sensitivity of optimal power flow control variables and load levels of the optimal power flow model; 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; and merging the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set and a basic sample set to obtain an optimal power flow high-confidence sample set. The technical solution of the present application can extract nonlinear samples with strong mapping representation ability for optimal power flow solving through directional extraction, promote neural network learning, and improve the generalization performance of the trained optimal power flow calculation neural network.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power systems and their automation, in particular to a method and device for constructing a high-confidence sample set for data-driven optimal power flow (OPF) solution, a storage medium and an electronic device. BACKGROUND

[0002] Data-driven OPF methods use neural networks as surrogates for OPF computation, which can directly predict the estimated OPF solution without any time-consuming iterative solution. In the context of the global development of renewable energy, in order to cope with the uncertainty of renewable resources, the frequency of OPF computation of power systems will increase, and there is an urgent need for OPF computation methods with fast computation speed. Therefore, data-driven OPF computation methods with higher computation 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 computation mapping, data-driven OPF computation methods usually use a large number of OPF samples to train neural networks. This leads to strong dependence of neural networks on training data. The learning goal of neural networks is to minimize the error between the output results of neural networks and the labels of 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 this type of scenario. Therefore, when the test data and the training data present the same and independent distribution (IID), the neural network can guarantee high computation accuracy. However, when there is out-of-distribution (OOD) data, such as abnormal load caused by extreme weather, the neural network will have a large error. For this reason, some scholars have proposed a robust optimization algorithm to make the neural network training pay more attention to the scenario with the largest error, i.e. OOD data. However, the performance of these methods still depends on historical data or generated training data. How to construct training data that accurately represents the OPF computation mapping is the key to improving the credibility of data-driven OPF computation methods.

[0004] In summary, it is urgent to study a method for constructing a high-confidence sample set for data-driven OPF solution, which searches for training samples that can accurately represent the OPF computation mapping through a physical model, and improves the computation accuracy of data-driven OPF. SUMMARY

[0005] Embodiments of the present application provide a method and device for constructing a high-confidence sample set for data-driven OPF solution, a storage medium and an electronic device to improve the performance of neural networks.

[0006] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0007] According to a first aspect of the embodiments of the present application, a method for constructing a high-confidence sample set of optimal power flow data-driven solution is provided, comprising:

[0008] establishing an optimal power flow model of a power system based on power system parameters, and deriving 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] merging the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set, and a basic sample set to obtain a high-confidence sample set of optimal power flow.

[0012] In some embodiments of the present application, based on the foregoing scheme, the step of establishing an optimal power flow model of a power system based on power system parameters comprises:

[0013] obtaining power system parameters, and establishing an optimal power flow model of the power system by using formulas (1)-(5);

[0014]

[0015] wherein a i , b i , and c i are cost coefficients of the i-th unit; P G,i and Q G,i are active and reactive power outputs of the i-th unit; and * respectively represent upper and lower limits of variables; S G and S B are serial number sets of units and nodes respectively; P D,i and Q D,i are active and reactive loads of the i-th node; G ij and B ij are i-th row and j-th column elements in an admittance matrix and a conductance matrix respectively; P L,ij and Q L,ij represent active and reactive power flows of a line connected with nodes i and j; and S ij represent upper and lower limits of apparent power of the line connected with nodes i and j.

[0016] In some embodiments of the present application, based on the foregoing scheme, the step of deriving sensitivity of optimal power flow control variables of the optimal power flow model to load levels comprises:

[0017] performing formula conversion on the optimal power flow model;

[0018] deriving KKT conditions of the optimal power flow model after formula conversion;

[0019] determining sensitivity of optimal power flow control variables and load levels of the optimal power flow model based on the KKT conditions.

[0020] In some embodiments of the present application, based on the foregoing scheme, searching for a local optimal power flow nonlinear sample set based on the optimal power flow model comprises:

[0021] extracting a large number of system states according to the distribution of system load, and solving the optimal power flow model to obtain sample labels, and constructing a basic sample set based on the sample labels;

[0022] constructing an optimal power flow solving neural network, and training the optimal power flow solving neural network using the basic sample set to obtain an optimal power flow calculation pre-training neural network;

[0023] using the optimal power flow calculation pre-training neural network to calculate the basic sample set, finding K samples with the largest error as the search starting point of the local optimal power flow nonlinear sample, and calculating the sensitivity matrix of the output input feature of the optimal power flow calculation pre-training neural network;

[0024] searching for the input feature of the local optimal power flow nonlinear sample according to the sensitivity matrix of the output input feature of the optimal power flow calculation pre-training neural network and the sensitivity of the output input of the optimal power flow model;

[0025] updating the input feature of the local optimal power flow nonlinear sample according to the upper and lower limit constraints of the system state, and calculating the optimal power flow solution under the corresponding power system state to obtain the local optimal power flow nonlinear sample;

[0026] obtaining a local optimal power flow nonlinear sample set based on the local optimal power flow nonlinear sample.

[0027] In some embodiments of the present application, based on the foregoing scheme, searching for a global optimal power flow nonlinear sample set based on the optimal power flow model comprises:

[0028] For the sample set of the optimal power flow calculation pre-training neural network and the training neural network, K samples with the largest error are found as the search starting point of the global optimal power flow nonlinear sample, and the sensitivity matrix of the output input feature of the optimal power flow calculation pre-training neural network is calculated;

[0029] iteratively searching for the local optimal power flow nonlinear sample until the active constraint of the local optimal power flow nonlinear sample changes, obtaining the local optimal power flow nonlinear sample before the active constraint changes and the local optimal power flow nonlinear sample after the active constraint changes;

[0030] performing a physics model guided gradient calculation on the local optimal power flow nonlinear sample after the active constraint change, and calculating a normalized gradient thereof;

[0031] updating the power system state after the active constraint change according to the local optimal power flow nonlinear sample position before the active constraint change and the normalized gradient, and calculating an optimal power flow solution corresponding thereto by using an interior point method to obtain a global optimal power flow nonlinear sample;

[0032] obtaining a global optimal power flow nonlinear sample set based on the global optimal power flow nonlinear sample.

[0033] According to a second aspect of the embodiments of the present application, there is provided an optimal power flow data-driven solution high-confidence sample set construction device, comprising:

[0034] a building unit configured to build an optimal power flow model of a power system based on power system parameters;

[0035] a derivation unit configured to derive sensitivities of optimal power flow control variables and load levels of the optimal power flow model;

[0036] a first searching unit configured to search for a local optimal power flow nonlinear sample set based on the optimal power flow model;

[0037] a second searching unit configured to search for a global optimal power flow nonlinear sample set based on the optimal power flow model;

[0038] a merging unit configured to merge the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set, and a basic sample set to obtain an optimal power flow high-confidence sample set.

[0039] According to a third aspect of the embodiments of the present application, there is provided a computer readable storage medium, the storage medium storing computer instructions, the computer instructions causing the computer to execute the method of the first aspect when the computer instructions are run on the computer.

[0040] According to a fourth aspect of the embodiments of the present application, there is provided an electronic device, comprising a memory and a processor.

[0041] The memory is configured to store computer instructions.

[0042] The processor is configured to invoke the computer instructions stored in the memory, so that the electronic device executes the method of the first aspect.

[0043] The technical solution of the present application can extract nonlinear samples with strong mapping representation ability for optimal power flow solution by directional extraction, promote neural network learning, and improve the generalization performance of the trained optimal power flow calculation neural network.

[0044] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application, as claimed. BRIEF DESCRIPTION OF DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and serve to explain the principles of the application. It is readily apparent to one skilled in the art that the following figures are merely some embodiments of the present application and other figures can be obtained by one of ordinary skill in the art without any creative work under the premise that the following description of the figures is merely illustrative and explanatory. In the drawings:

[0046] Figure 1 Fig. 1 shows a flow diagram of a method for constructing a high-confidence sample set driven by optimal power flow data according to an embodiment of the present application;

[0047] Figure 2 Fig. 4 shows a diagram of average absolute error of searching samples in different methods according to an embodiment of the present application;

[0048] Figure 3 Fig. 5 shows a diagram of load curves of a certain area and test error corresponding to different methods according to an embodiment of the present application;

[0049] Figure 4 Fig. 6 shows a block diagram of a device for constructing a high-confidence sample set driven by optimal power flow data according to an embodiment of the present application;

[0050] Figure 5 Fig. 7 shows a block diagram of an electronic device according to an embodiment of the present application;

[0051] Figure 6 Fig. 8 shows a structural diagram of a computer system of an electronic device suitable for implementing embodiments of the present application. DETAILED DESCRIPTION

[0052] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art.

[0053] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the application can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In other instances, well-known structures, devices, implementations, and operations have not been shown or described in detail to avoid obscuring aspects of the application.

[0054] The block diagrams in the drawings show only the functionality of the features and can not imply that the functions must be implemented in the particular order presented or by independent circuits or integrated circuits. These are functional block diagrams, and implementation of the described functionality can be performed with software, with hardware such as circuitry, with a combination of hardware and software, or with one or more hardware components or integrated circuits formed using standard integrated circuit design processes.

[0055] The flow diagrams shown in the drawings are examples only and are not necessarily to scale. Also, the flow diagrams can not include all of the steps or options discussed or the flow of operations can not necessarily follow the order discussed. For instance, some operations can be performed in parallel or in different order than discussed. Also, some operations can be combined or omitted.

[0056] It is noted that the terms "first", "second", and the like, used in the description and the claims of the present application as well as above-described drawings, are used to distinguish between similar objects and are not necessarily used to describe a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than described or illustrated herein.

[0057] In order to make the objects, technical solutions and advantages of the present application clearer, the following will be combined with the drawings of the embodiments of the present application to make a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0058] The embodiments of the present application will be described in detail below with reference to the drawings. The following embodiments and features in the embodiments can be combined with each other without conflict.

[0059] Referring to Figure 1 Fig. 1 shows a flow diagram of a method for constructing a high-confidence sample set according to an embodiment of the present application.

[0060] As Figure 1As shown, a high-confidence sample set construction method for optimal power flow data-driven solution is shown, which specifically includes steps S100 to S400.

[0061] Reference Figure 1 , step S100, based on the power system parameters, an optimal power flow model of the power system is established, and the sensitivity of the optimal power flow control variable of the optimal power flow model to the load level is derived.

[0062] In some feasible embodiments, based on the foregoing scheme, the power system optimal power flow model is established based on the power system parameters, which includes:

[0063] The power system parameters are obtained, and the power system optimal power flow model is established by using formulas (1)-(5);

[0064]

[0065]

[0066] Wherein, 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 power output of the i-th unit; and * respectively represent the upper limit and lower limit 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 load of the i-th 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 represent the active and reactive power flow of the line connected with nodes i and j; and S ij represent the upper limit and lower limit of the apparent power of the line connected with nodes i and j.

[0067] In some feasible embodiments, based on the foregoing scheme, the sensitivity of the optimal power flow control variable of the optimal power flow model to the load level is derived, which includes:

[0068] The optimal power flow model is converted by formula;

[0069] The KKT condition of the optimal power flow model after formula conversion is derived;

[0070] Based on the KKT condition, the sensitivity of the optimal power flow control variable of the optimal power flow model to the load level is determined.

[0071] For example, this step is specifically as follows:

[0072] First, the optimal power flow model (1)-(5) is uniformly expressed as (6)-(8).

[0073]

[0074] wherein represents the optimization variables in the optimal power flow model, including unit active power output, unit reactive power output and node voltage, etc.; n represents the number of nodes of 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 (9):

[0076]

[0077] wherein z and w represent the Lagrange multipliers of the equality constraints and the active inequality constraints; D represents the operation of constructing a diagonal matrix.

[0078] The main purpose of the optimal power flow problem is to determine the generator scheme with the minimum cost according to a specific load distribution. Therefore, in (6)-(8), x0 represents the constant load that remains unchanged throughout the entire solving algorithm. However, when dealing with various optimal power flow problems involving fluctuating load conditions, it is converted into a differentiable continuous variable x. By taking the derivative of the input characteristic variable x, the output characteristic variable y, and the Lagrange multipliers z and w in (9), (10) is obtained.

[0079]

[0080] Then, (10) is converted into matrix form, and (11) can be obtained.

[0081]

[0082] wherein,

[0083]

[0084] Finally, dx=I is brought into (11), and (11) is solved to calculate the sensitivity matrix dy between y and x.

[0085] With reference to Figure 1, step S200, searching for a local optimal power flow nonlinear sample set based on the optimal power flow model.

[0086] In some possible embodiments, based on the foregoing scheme, the searching for a local optimal power flow nonlinear sample set based on the optimal power flow model comprises:

[0087] extracting a large number of system states according to the distribution of system load, and solving the optimal power flow model to obtain sample labels, and constructing a basic sample set based on the sample labels;

[0088] constructing an optimal power flow solving neural network, and training the optimal power flow solving neural network using the basic sample set to obtain an optimal power flow calculation pre-training neural network;

[0089] calculating the basic sample set using the optimal power flow calculation pre-training neural network, finding K samples with the largest errors as a search starting point of the local optimal power flow nonlinear sample, and calculating a sensitivity matrix of output input features of the optimal power flow calculation pre-training neural network;

[0090] searching for input features of the local optimal power flow nonlinear sample according to the sensitivity matrix of output input features of the optimal power flow calculation pre-training neural network and the sensitivity of the optimal power flow model output input;

[0091] updating the input features of the local optimal power flow nonlinear sample according to the system state upper and lower limit constraints, and calculating the optimal power flow solution under the corresponding power system state to obtain the local optimal power flow nonlinear sample;

[0092] obtaining a local optimal power flow nonlinear sample set based on the local optimal power flow nonlinear sample.

[0093] For example, this step is specifically as follows:

[0094] First, a large number of system states are extracted according to the distribution of system load, and sample labels are obtained by solving the optimal power flow model (1)-(5), and the basic local optimal power flow nonlinear sample set construction is completed.

[0095] Then, an optimal power flow solving neural network is constructed, and the neural network is trained using the basic local optimal power flow nonlinear sample set to obtain an optimal power flow calculation pre-training neural network ψ.

[0096] Secondly, the basic sample set is calculated using the optimal power flow calculation pre-training neural network, K samples with the largest errors are found as a search starting point of the local optimal power flow nonlinear sample, and a sensitivity matrix of output input features is calculated.

[0097] Again, the input features of the local optimal power flow nonlinear sample are searched according to the sensitivity matrix of the neural network output input features and the sensitivity of the optimal power flow model output input. The gradient calculation of the neural network output input features for the search starting point (x0, y0) is as shown in formula (13).

[0098]

[0099] Finally, the system state upper and lower limit constraints are updated according to the system state upper and lower limit constraints, as shown in formulas (14) and (15).

[0100] And the optimal power flow solution under the corresponding system state is obtained.

[0101]

[0102] Wherein, ε represents the step of search; x max and x min represent the upper and lower limit boundaries of the system state.

[0103] Referring to Figure 1 , in step S300, a global optimal power flow nonlinear sample set is searched based on the optimal power flow model.

[0104] In some feasible embodiments, based on the foregoing scheme, the searching of the global optimal power flow nonlinear sample set based on the optimal power flow model comprises:

[0105] For optimal power flow calculation, the pre-trained neural network is calculated with the basic sample set, the K samples with the largest error are calculated as the search starting point of the global optimal power flow nonlinear sample, and the sensitivity matrix of the pre-trained neural network output input features is calculated;

[0106] The local optimal power flow nonlinear sample search is iterated until the active constraint of the local optimal power flow nonlinear sample changes, and the local optimal power flow nonlinear sample before the active constraint changes and the local optimal power flow nonlinear sample after the active constraint changes are obtained;

[0107] The gradient calculation guided by the physical model is performed on the local optimal power flow nonlinear sample after the active constraint changes, and the normalized gradient is calculated;

[0108] According to the position of the local optimal power flow nonlinear sample before the active constraint changes and the normalized gradient, the power system state after the active constraint changes is updated, and the optimal power flow solution corresponding thereto is calculated by using the interior point method, so as to obtain the global optimal power flow nonlinear sample;

[0109] Based on the global optimal power flow nonlinear sample, a global optimal power flow nonlinear sample set is obtained.

[0110] For example, the specific process of this step is as follows:

[0111] Step a: For a given optimal power flow calculation, pre-train the neural network with the basic sample set, calculate the K samples with the largest error as the starting point for searching the global optimal power flow nonlinear sample, and calculate the sensitivity matrix of the output input feature

[0112] Step b: Iteratively search for local optimal power flow nonlinear samples until the active constraints of the local optimal power flow nonlinear sample change, obtaining the local optimal power flow nonlinear sample (x f,s , y f,s ) before the active constraint changes and the local optimal power flow nonlinear sample (x to,s , y to,s ) after the active constraint changes.

[0113] Step c: Perform gradient calculation guided by the physical model on the local optimal power flow nonlinear sample after the active constraint changes, formula (13), and calculate its normalized gradient J nor , as shown in equation (16):

[0114]

[0115] Step d: Update the system state after the active constraint changes according to the position of the local optimal power flow nonlinear sample before the active constraint changes and the normalized gradient, the update formula is as shown in equation (17), and the interior point method is used to calculate the corresponding optimal power flow solution y to,s+1 , and 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] Wherein, α, β respectively represent the search coefficients.

[0118] Step e: Finally, perform multiple iteration step d to ensure that sufficient local optimal power flow nonlinear samples are extracted in the linear region, and obtain the global optimal power flow nonlinear sample set.

[0119] Referring 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 the 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 setting of the system, this example adds a wind farm and a photovoltaic system in the standard IEEE 14-node system to simulate the uncertainty of renewable energy, where the wind speed obeys the Weibull distribution, and λ = 5.089, k = 2.016, the solar irradiance obeys the beta distribution, and α = 2.06, β = 2.5. The wind farm is randomly connected to different nodes to make the renewable energy penetration rate of the system reach 20%. And assume that the load fluctuation obeys the normal distribution, the average value is equal to the default value of the system, and the standard deviation is 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 NVIDIA GeForce RTX 2080Ti, and trains the neural network. 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, as follows:

[0125]

[0126] where T and are the predicted value and the true value of the neural network respectively; σ represents the threshold; e ref represents the reference value of the corresponding variable.

[0127] In this example, five sample set construction methods are tested. M0 is a local optimal power flow nonlinear sample set construction method based on random sampling; M1 is a fast gradient sign method based on M0, which adds adversarial samples based on M0; M2 is a projected gradient sign method, which mainly improves the gradient update method based on M1. M3 is a projected gradient sign method considering momentum, which mainly further considers momentum based on 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 non-linear sample collection is verified in 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, and the M1-M5 search is used to search for the adversarial samples. Figure 2 The average 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 average absolute error of the size of the unit active power output even reaches 5MW, which shows that the basic sample set cannot accurately represent the OPF mapping. Although the test error or precision index is acceptable, the trained OPF neural network is not robust enough for practical application. If the sample with large error is 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, the present example further increases the samples on the basic sample set and fine-tunes the neural network, tests the improvement of the robustness of the neural network by increasing the samples in different methods. This time, 5000 samples are further expanded using different methods on the basis of 50000 basic samples, and the neural network is fine-tuned for 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-tuned neural network after expanding 5000 samples using different methods

[0131]

[0132] As can be seen from Table 1, the accuracy rate decreases when different adversarial sample search algorithms are used for testing. For example, when 5000 samples searched by M0 are added to the basic sample set, and then M1 is used to evaluate the fine-tuned neural network, the accuracy rates of PG and VG decrease from 99.97% and 99.12% to 97.78% and 94.40%, respectively. When M5 is used for testing, the accuracy rates even drop to 29% and 51.5%. Overall, the average decrease of PG and VG is 20.77% and 21.34%, respectively. Therefore, expanding the training set by random sampling cannot effectively deal with adversarial samples. When the conventional adversarial attack (M1-M3) and the fine-tuned neural network are used to expand the training set, the test accuracy rate increases. However, when the local and global adversarial samples searched by M4 and M5 are used to attack the neural network, the test accuracy rate is still below 90%, especially for the voltage amplitude, the accuracy rate of the global adversarial sample is less than 80%. This phenomenon shows that the training data considering only the probability generation of input features cannot guarantee the performance of the neural network in the sampling region, and there are still some regions where the neural network has not been accurately learned. However, with the expansion of the training data by M4 and M5, the representation ability of the training data is improved, and 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 the samples / feature space that the neural network has not learned well, and by increasing such samples in the resample set, the performance of the neural network can be further enhanced, which verifies the effectiveness of the proposed optimal power flow high-confidence sample set construction method.

[0134] Example Two

[0135] This example is tested in IEEE 39-bus system, 118-bus system and 2383-bus system. For the setting of the above systems, this example adds wind farms and photovoltaic systems in each system to simulate the uncertainty of renewable energy, where the wind speed obeys Weibull distribution with λ = 5.089, k = 2.016, and the solar irradiance obeys β distribution with α = 2.06, β = 2.5. The wind farms are randomly connected to different nodes to make the renewable energy penetration of the system reach 20%. And it is assumed that the load fluctuation obeys normal distribution, the mean value is equal to the default value of the system, and the standard deviation is 0.3. This example uses the PYPOWER library to generate the base 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 trains the neural network. The base 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, as follows:

[0136]

[0137] where T and are the predicted value and the true value of the neural network, respectively; σ represents the threshold; e ref represents the reference value of the corresponding variable.

[0138] In this example, five sample set construction methods are tested. M0 is a local optimal power flow nonlinear sample set construction method based on 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 mainly 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-training neural network is trained using the base sample set, and then 5,000 samples are expanded by M1-M5, and the samples are added to the base sample set, and the neural network is fine-tuned, and then the ability of the neural network to improve the robustness is tested by increasing the samples. As can be seen from Example 1, the samples with the largest neural network calculation error 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 denoted 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 shown in Table 2, when using S1 and S2 for testing, the accuracy of M0-M3 also decreased to some extent, but the accuracy of M4 and M5 could still reach 95%. It is worth noting that in the 2383-node system, the accuracy of VG was around 4%-20%, but the accuracy of M4 and M5 improved by as much as 90%. Therefore, the local and global nonlinear sample collection method proposed in this application can effectively improve the generalization ability of neural networks, enabling them to adapt to nonlinear sample testing, thus verifying the effectiveness of the proposed method.

[0143] Example 3

[0144] This example, building upon Example 2, proportionally adds the load of a certain region on January 1, 2022, 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 As shown.

[0145] Depend on Figure 3 It is evident that the test errors of different methods vary with system load at different times. Notably, the error of the PG in DCOPF is approximately 6 MW, while all data-driven optimal power flow calculation methods augmented with training data exhibit lower test errors compared to the DCOPF method. In most cases, the test errors of the data-driven methods are below 1 MW. However, in scenarios with low power load demand, the test error increases due to the scarcity of training samples, for example, at times 4, 5, and 23. Augmenting the samples through random sampling (M0) or searching for local nonlinear samples (M4) does not effectively enhance the robustness of the neural network. Conversely, employing a global nonlinear sampling method 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 the PG remains below 1 MW. These results fully demonstrate the effectiveness of the proposed method in enhancing the robustness of the optimal power flow calculation neural network, illustrating the high reliability of the locally optimal power flow nonlinear sample set constructed in this application.

[0146] The following describes an embodiment of the apparatus described in this application, which can be used to execute a method for constructing a high-confidence sample set based on optimal power flow data-driven solutions as described in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in the above embodiments of this application.

[0147] Reference Figure 4As shown, the optimal power flow data-driven high-confidence sample set construction apparatus 400 according to one embodiment of the present application comprises:

[0148] The establishing unit 401 is configured to establish an optimal power flow model of a power system based on power system parameters;

[0149] The deriving unit 402 is configured to derive the sensitivity of optimal power flow control variables and load levels of the optimal power flow model;

[0150] The first searching unit 403 is configured to search for a local optimal power flow nonlinear sample set based on the optimal power flow model;

[0151] The second searching unit 404 is configured to search for a global optimal power flow nonlinear sample set based on the optimal power flow model;

[0152] The merging unit 405 is configured to merge the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set and a basic sample set to obtain an optimal power flow high-confidence sample set.

[0153] As shown, the present application also provides an electronic device 500, which comprises a memory 510, a processor 520 and a computer program 511 stored in the memory 510 and executable on the processor, and the processor 520 implements the steps of the above-mentioned optimal power flow data-driven high-confidence sample set construction method when executing the computer program 511. Figure 5

[0154] Since the electronic device introduced in the present embodiment is the device used to implement the optimal power flow data-driven high-confidence sample set construction apparatus in the present application, the specific implementation of the electronic device of the present embodiment and its various forms can be understood by those skilled in the art based on the method introduced in the present application, so the implementation of the method in the present application by the electronic device will not be described in detail, and any device used to implement the method in the present application belongs to the scope of protection of the present application.

[0155] In the specific implementation process, the computer program 511 can implement any embodiment in the first aspect when executed by the processor.

[0156] Figure 6 The structure of the computer system of the electronic device suitable for implementing 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 limit the functions and use range 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 based on programs stored in Read-Only Memory (ROM) 602 or programs loaded from Storage Unit 608 into Random Access Memory (RAM) 603, such as performing the methods described in the above embodiments. The RAM 603 also stores various programs and data required for system operation. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An Input / Output (I / O) interface 605 is also connected to the bus 604.

[0159] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, 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, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0160] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs various functions defined in the system of this application.

[0161] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, transmit, propagate or transport a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.

[0162] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0163] The units described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware, and the described units can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.

[0164] As another aspect, the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the optimal power flow data-driven high-confidence sample set construction method described in the above embodiments.

[0165] As another aspect, the present application also provides a computer readable medium, which can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, enable the electronic device to implement the optimal power flow data-driven high-confidence sample set construction method described in the above embodiments.

[0166] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a 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. Conversely, the features and functions of one module or unit described above can be further divided into several modules or units.

[0167] From the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments 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, U disk, mobile hard disk, etc.) or network, and includes several instructions to enable a computing device (which can be a personal computer, server, touch terminal, or network device, etc.) to perform the methods according to the embodiments of the present application.

[0168] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. It is intended that the application embrace any and all variations of the application that fall within the scope of the general description herein. It is to be understood that the application is not to be limited to the specific examples, methods, and procedures described herein, and that specific examples are to be considered as illustrative only. It is further understood that the application can encompass all such variations as fall within the scope of the application. It is intended that the scope of the application encompass all techniques capable of approximating the teachings provided herein.

Claims

1. A method for constructing a high-reliability sample set for optimal power flow data-driven solution, characterized in that, include: An optimal power flow model for the power system is established based on power system parameters, and the sensitivity of the optimal power flow control variables and load level of the optimal power flow model is derived. Based on the optimal power flow model, a local optimal power flow nonlinear sample set is searched; Search for a globally optimal nonlinear power flow sample set based on the aforementioned optimal power flow model; By merging the local optimal power flow nonlinear sample set, the global optimal power flow nonlinear sample set, and the basic sample set, an optimal power flow high-confidence sample set is obtained; The establishment of the optimal power flow model based on power system parameters includes: Obtain the power system parameters and establish the optimal power flow model of the power system using formulas (1)-(5); ;(1) ;(2) ;(3) ;(4) ;(5) in, , , It is the first Cost coefficient of the unit; , It is the first The active and reactive power output of the generator set; and These represent the upper and lower limits of the variable *, respectively. , These are the sets of serial numbers for the generator units and nodes, respectively. , It is the first Active and reactive loads of each node; , These are the first two elements in the conductance matrix and the susceptance matrix, respectively. OK Column elements; and Represents nodes and The active and reactive power flow of connected lines; and Represents nodes and The upper and lower limits of the apparent power of the connected lines; The derivation of the sensitivity of the optimal power flow control variables and load level of the optimal power flow model includes: Transform the optimal power flow model into a formula; Derive the KKT conditions for the optimal power flow model after formula transformation; Based on the KKT conditions, determine the sensitivity of the optimal power flow control variables and load level of the optimal power flow model; The search for a local optimal nonlinear power flow sample set based on the optimal power flow model includes: A large number of system states are extracted based on the distribution of system load, and the optimal power flow model is solved to obtain sample labels. A basic sample set is then constructed based on the sample labels. Construct an optimal power flow solution neural network, and train the optimal power flow solution neural network using the aforementioned basic sample set to obtain an optimal power flow calculation pre-trained neural network. The optimal power flow calculation pre-trained neural network is used to calculate the basic sample set, and the K samples with the largest errors are found as the starting point for searching local optimal power flow nonlinear samples. The sensitivity matrix of the output and input features of the optimal power flow calculation pre-trained neural network is also calculated. Based on the optimal power flow, calculate the sensitivity matrix of the pre-trained neural network output and input features and search for the input features of the local optimal power flow nonlinear samples based on the sensitivity of the optimal power flow model output and input. The input characteristics of the local optimal power flow nonlinear sample are updated according to the upper and lower 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 set of local optimal power flow nonlinear samples is obtained based on the local optimal power flow nonlinear samples.

2. The method according to claim 1, characterized in that, The search for the global optimal power flow nonlinear sample set based on the optimal power flow model includes: 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 starting point for searching the global optimal power flow nonlinear samples, and the sensitivity matrix of the input and output features of the optimal power flow calculation pre-trained neural network is calculated. Iteratively search for local optimal power flow nonlinear samples until the effective constraints of the local optimal power flow nonlinear samples change, thus obtaining the local optimal power flow nonlinear samples before and after the change of effective constraints. For the local optimal power flow nonlinear sample after the change of the effective constraint, perform gradient calculation guided by the physical model and calculate its normalized gradient; Based on the location and normalized gradient of the local optimal power flow nonlinear sample before the change of the effective constraint, the power system state after the change of the effective constraint is updated, and the corresponding optimal power flow solution is calculated using the interior point method to obtain the global optimal power flow nonlinear sample. The global optimal power flow nonlinear sample set is obtained based on the global optimal power flow nonlinear sample.

3. A data-driven optimal power flow solution for constructing a high-reliability sample set, applied to the method described in claim 1, characterized in that, include: Establishment unit, used to establish optimal power flow model of power system based on power system parameters; The derivation unit is used to derive the sensitivity of the optimal power flow control variables and load level of the optimal power flow model. The first search unit is used to search for a local optimal nonlinear power flow sample set based on the optimal power flow model. The second search unit is used to search for the 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 the optimal power flow high-confidence sample set.

4. A computer-readable storage medium, characterized in that, The storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-2.

5. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer instructions; The processor is configured to invoke computer instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 1-2.

Citation Information

Patent Citations

  • Alternating current optimal power flow calculation method, system and equipment of power system and storage medium

    CN114421481A