Power probability optimal power flow determination method and device, computer equipment, readable storage medium and program product
By integrating Monte Carlo simulation with a pre-trained deep learning model, the method enhances the efficiency and accuracy of probabilistic optimal power flow calculations, addressing inefficiencies in existing POPF algorithms and supporting stable power system operation with renewables.
Patent Information
- Application Number
- CN202410972669.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-12-03
AI Technical Summary
The existing probabilistic optimal power flow (POPF) solution algorithms, based on Monte Carlo simulation, are inefficient due to the need for numerous samples and repeated solving of non-linear, non-convex optimal power flow problems, making them impractical for real-world applications.
A method combining Monte Carlo simulation with a pre-trained optimal power flow prediction model, utilizing a deep learning approach with stacked autoencoders, to randomly sample and process power system parameters, reducing the need for repeated calculations and enhancing computational efficiency.
This approach significantly improves the efficiency and accuracy of probabilistic optimal power flow determination, providing comprehensive and reliable results for power system operation under uncertainty, especially with high renewable energy integration.
Smart Images

Figure CN119070312A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power flow calculation, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for determining a probabilistic optimal power flow. Background Art
[0002] With the high proportion of renewable energy connected to the grid, uncertainty increases dramatically, bringing many challenges to the operation of power systems. Probabilistic Optimal Power Flow (POPF) has become a powerful and important analytical tool to solve the uncertainty of power system operation.
[0003] The existing POPF solution algorithm is a numerical method. The numerical method is based on Monte Carlo simulation (MCS) and is a relatively accurate probabilistic analysis method. However, it requires a large number of samples and repeatedly solves nonlinear and non-convex optimal power flow (OPF) problems, making the POPF solution efficiency low in practical applications. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for determining probabilistic optimal power flow, which can improve the efficiency of determining probabilistic optimal power flow, in order to address the above technical problems.
[0005] In a first aspect, the present application provides a method for determining a probabilistic optimal power flow, comprising:
[0006] Using the Monte Carlo model, multiple sets of target parameter information are randomly sampled from the power system to be determined;
[0007] Inputting each group of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple groups of power optimal power flow information of the power system to be determined;
[0008] The plurality of groups of optimal power flow results are statistically processed by using a preset statistical method to obtain the power probabilistic optimal power flow information of the power system to be determined.
[0009] In one embodiment, the pre-trained optimal power flow prediction model is trained by the following steps:
[0010] Acquire multiple initial codec models; each initial codec model includes an initial encoder module, an initial decoder module and a preset noise module;
[0011] According to the sample input data, the multiple initial codec models are trained in sequence to obtain a target codec model corresponding to each initial codec model; the target codec model corresponding to each initial codec model includes a target encoder module, a target decoder module and a preset noise module; the sample input data is sample data for predicting optimal power flow information;
[0012] Connect the target encoder modules corresponding to each target encoding and decoding model in sequence, and connect the initial top-level encoding module to obtain a candidate optimal power flow prediction model;
[0013] The candidate optimal power flow prediction model is iteratively trained according to the sample input data and the sample output data to obtain the pre-trained optimal power flow prediction model; the sample output data is the actual power optimal power flow information corresponding to the sample input data.
[0014] In one embodiment, the step of training the multiple initial codec models in sequence according to the sample input data to obtain a target codec model corresponding to each initial codec model includes:
[0015] Determining input information of a current encoding and decoding model among the multiple initial encoding and decoding models according to the sample input data;
[0016] Iteratively training the current codec model according to the input information of the current codec model to obtain a target codec model corresponding to the current codec model;
[0017] The next codec model of the current codec model in the multiple initial codec models is used as the current codec model, and the step of determining the input information of the current codec model in the multiple initial codec models according to the sample input data is jumped to until the target codec model corresponding to each initial codec model is obtained.
[0018] In one embodiment, the step of determining input information of a current codec model among the multiple initial codec models according to the sample input data includes:
[0019] In a case where the current coding model is the first initial coding model, using the sample input data as input information of the current coding model;
[0020] In the case where the current codec model is another initial codec model, the target encoder modules in the target codec model trained before the current codec model are sequentially connected to obtain a pre-coding model; the other initial codec model is an initial codec model other than the first initial codec model among the multiple initial codec models;
[0021] The sample input data is input into the pre-coding model to obtain output information of the pre-coding model as input information of the current coding model.
[0022] In one embodiment, iteratively training the current codec model according to the input information of the current codec model to obtain a target codec model corresponding to the current codec model includes:
[0023] In each iterative training, the input information of the current codec model is input into a preset noise module of the current codec model to obtain target input information after randomly adding noise;
[0024] Processing the target input information sequentially through the encoder module and the decoder module in the current encoding and decoding model to obtain output information of the current encoding and decoding model;
[0025] Determining parameter candidate adjustment information of an encoder module and a decoder module in the current encoding and decoding model respectively according to first difference information between input information of the current encoding and decoding model and output information of the current encoding and decoding model;
[0026] Determining parameter target adjustment information according to a preset momentum learning rate and the parameter candidate adjustment information;
[0027] According to the parameter target adjustment information, the parameters of the encoder module and the decoder module in the current encoding and decoding model are adjusted.
[0028] In one embodiment, iteratively training the candidate optimal power flow prediction model according to the sample input data and the sample output data to obtain the pre-trained optimal power flow prediction model includes:
[0029] In each iterative training, the sample input data is input into the candidate optimal power flow prediction model to obtain training output data;
[0030] Determining second difference information between the training output data and the sample output data;
[0031] According to the second difference information, model parameters of the candidate optimal power flow prediction model are adjusted.
[0032] In a second aspect, the present application also provides a device for determining a probabilistic optimal power flow, comprising:
[0033] A parameter information acquisition module is used to randomly sample and acquire multiple sets of target parameter information from the power system to be determined by using a Monte Carlo model;
[0034] A power flow information acquisition module, used to input each group of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple groups of power optimal power flow information of the power system to be determined;
[0035] The probabilistic power flow acquisition module is used to perform statistical processing on the multiple groups of optimal power flow results in a preset statistical manner to obtain the power probabilistic optimal power flow information of the power system to be determined.
[0036] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0037] Using the Monte Carlo model, multiple sets of target parameter information are randomly sampled from the power system to be determined;
[0038] Inputting each group of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple groups of power optimal power flow information of the power system to be determined;
[0039] The plurality of groups of optimal power flow results are statistically processed by using a preset statistical method to obtain the power probabilistic optimal power flow information of the power system to be determined.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Using the Monte Carlo model, multiple sets of target parameter information are randomly sampled from the power system to be determined;
[0042] Inputting each group of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple groups of power optimal power flow information of the power system to be determined;
[0043] The plurality of groups of optimal power flow results are statistically processed by using a preset statistical method to obtain the power probabilistic optimal power flow information of the power system to be determined.
[0044] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0045] Using the Monte Carlo model, multiple sets of target parameter information are randomly sampled from the power system to be determined;
[0046] Inputting each group of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple groups of power optimal power flow information of the power system to be determined;
[0047] The plurality of groups of optimal power flow results are statistically processed by using a preset statistical method to obtain the power probabilistic optimal power flow information of the power system to be determined.
[0048] The above-mentioned method, device, computer equipment, computer-readable storage medium and computer program product for determining the probabilistic optimal power flow of electric power firstly adopt a Monte Carlo model to randomly sample and obtain multiple groups of target parameter information from the power system to be determined, and obtain a large amount of target parameter information by random sampling, so as to ensure that the obtained data is representative and can fully reflect the operating status of the power system under different conditions, thereby improving the diversity and coverage of the data; then, each group of target parameter information is respectively input into a pre-trained optimal power flow prediction model to obtain multiple groups of optimal power flow information of the power system to be determined, and the pre-trained model is used to quickly calculate multiple groups of optimal power flow information, thereby reducing the need for re-optimization calculation each time, greatly improving the calculation speed and efficiency, and based on the pre-trained model, the accuracy of the calculation results can be ensured while improving the efficiency; finally, a preset statistical method is used to perform statistical processing on multiple groups of optimal power flow results to obtain the probabilistic optimal power flow information of the power system to be determined, and the preset statistical processing can comprehensively analyze multiple groups of optimal power flow results, extract statistical indicators related to the probabilistic optimal power flow information of electric power, and provide a reliable basis for the operation decision of the power system. In the above method, by combining Monte Carlo simulation and pre-trained optimal power flow prediction model, the efficiency of determining the power probabilistic optimal power flow can be improved while maintaining high accuracy, solving the problems of large amount of calculation and long time consumption, making the application of power probabilistic optimal power flow determination more efficient and feasible. At the same time, the results obtained through statistical analysis are more comprehensive and reliable, which helps the power system to better cope with uncertainty challenges and ensure the stability and economy of system operation when a high proportion of renewable energy is connected. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic diagram of a flow chart of a method for determining a probabilistic optimal power flow in one embodiment;
[0051] Figure 2 A schematic diagram of a flow chart of training steps of a pre-trained optimal power flow prediction model in one embodiment;
[0052] Figure 3Schematic diagram of the model structure of an optimal power flow prediction model in one embodiment;
[0053] Figure 4 A schematic diagram of a flow chart of the training steps of a target encoding and decoding model in one embodiment;
[0054] Figure 5 It is a flowchart of a method for determining a probabilistic optimal power flow in another embodiment;
[0055] Figure 6 It is a structural block diagram of a device for determining a probabilistic optimal power flow in one embodiment;
[0056] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] In one embodiment, Figure 1 As shown, a method for determining a probabilistic optimal power flow is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. In this embodiment, the method includes the following steps:
[0059] Step S101 , using a Monte Carlo model, randomly sampling and acquiring multiple sets of target parameter information from the power system to be determined.
[0060] Among them, target parameter information refers to various parameters in the power system that may affect the flow calculation, including but not limited to voltage, power, load, power generation, etc. The target parameter information is obtained through random sampling, which ensures the diversity and representativeness of the data and provides a reliable basis for subsequent analysis.
[0061] Exemplarily, the terminal first determines the target parameter information to be sampled in the actual power system. Then, by monitoring the actual operation of the power system, the terminal uses the Monte Carlo model to randomly sample and obtain multiple sets of target parameter information at different time points and operating states. The sampled target parameter information includes voltage, current, load, power generation, etc., which will be used for subsequent optimal power flow calculation and statistical analysis. In addition, if necessary, Nataf transform and Cholesky decomposition can also be used to deal with the correlation between load and renewable energy.
[0062] Step S102 , inputting each set of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple sets of power optimal power flow information of the power system to be determined.
[0063] Among them, the optimal power flow prediction model can be a deep learning model.
[0064] For example, the terminal first organizes and formats each set of target parameter information sampled from the actual power system into an input form acceptable to the model. Then, the terminal inputs these input data one by one into the pre-trained optimal power flow prediction model. The model uses the system operation rules and characteristics learned during its training process to quickly calculate the corresponding optimal power flow results.
[0065] Step S103 , using a preset statistical method, statistically processing multiple groups of optimal power flow results to obtain power probabilistic optimal power flow information of the power system to be determined.
[0066] Exemplarily, the terminal first performs data analysis and processing on the multiple groups of optimal power flow results obtained in the previous step according to a preset statistical method (such as mean, standard deviation, probability distribution, etc.). The terminal extracts statistical indicators of the power probabilistic optimal power flow information through statistical analysis, comprehensively evaluates the operating status of the power system, and finally generates the probabilistic optimal power flow information of the power system.
[0067] In the above-mentioned method for determining the probabilistic optimal power flow, firstly, a Monte Carlo model is used to randomly sample and obtain multiple groups of target parameter information from the power system to be determined. A large amount of target parameter information is obtained by random sampling to ensure that the obtained data is representative and can fully reflect the operating status of the power system under different conditions, thereby improving the diversity and coverage of the data; then, each group of target parameter information is input into a pre-trained optimal power flow prediction model to obtain multiple groups of power optimal power flow information of the power system to be determined, and the pre-trained model is used to quickly calculate multiple groups of optimal power flow information, thereby reducing the need for re-optimization calculation each time, greatly improving the calculation speed and efficiency, and based on the pre-trained model, the accuracy of the calculation results can be ensured while improving the efficiency; finally, a preset statistical method is used to perform statistical processing on multiple groups of optimal power flow results to obtain the probabilistic optimal power flow information of the power system to be determined. Through the preset statistical processing, multiple groups of optimal power flow results can be comprehensively analyzed, and statistical indicators related to the probabilistic optimal power flow information can be extracted, providing a reliable basis for the operation decision of the power system. In the above method, by combining Monte Carlo simulation and pre-trained optimal power flow prediction model, the efficiency of determining the power probabilistic optimal power flow can be improved while maintaining high accuracy, solving the problems of large amount of calculation and long time consumption, making the application of power probabilistic optimal power flow determination more efficient and feasible. At the same time, the results obtained through statistical analysis are more comprehensive and reliable, which helps the power system to better cope with uncertainty challenges and ensure the stability and economy of system operation when a high proportion of renewable energy is connected.
[0068] In an exemplary embodiment, Figure 2 As shown, the above pre-trained optimal power flow prediction model is trained through the following steps:
[0069] Step S201, obtaining multiple initial encoding and decoding models.
[0070] Each initial codec model includes an initial encoder module, an initial decoder module and a preset noise module.
[0071] Step S202: training a plurality of initial codec models in sequence according to the sample input data to obtain a target codec model corresponding to each initial codec model.
[0072] Among them, the target codec model corresponding to each initial codec model includes a target encoder module, a target decoder module and a preset noise module; the sample input data is sample data for predicting optimal power flow information, that is, sample data for training corresponding to the input of the optimal power flow prediction model.
[0073] Step S203, sequentially connecting the target encoder modules corresponding to each target encoding and decoding model, and connecting the initial top-level encoding module, to obtain a candidate optimal power flow prediction model.
[0074] Step S204, iteratively training the candidate optimal power flow prediction model according to the sample input data and the sample output data to obtain a pre-trained optimal power flow prediction model.
[0075] The sample output data is the actual optimal power flow information corresponding to the sample input data.
[0076] Exemplarily, the terminal first initializes several codec models, each model includes an initial encoder module, an initial decoder module and a preset noise module. The initial codec model is used to learn and extract the features of the input data, and at the same time, the noise module is used to add noise to enhance the robustness of the model. Then, the terminal inputs the sample input data into the initial codec model, and performs multiple unsupervised iterative training on each initial codec model in turn, so that the model learns the features of the input data, gradually optimizes its encoder and decoder modules, and finally obtains the target codec model. Next, the terminal connects the encoder modules of all target codec models in hierarchical order to form a model of a deep stacked encoder, and connects an initial top-level encoding module to form a complete candidate model, that is, the output of the top-level encoding module is the output of the optimal power flow prediction model. Finally, the terminal inputs the sample input data and the corresponding actual optimal power flow information into the candidate model, and optimizes the model parameters through multiple supervised iterations, so that the model can accurately predict the optimal power flow information.
[0077] In a specific example, the input of the optimal power flow prediction model is the injected active power and reactive power of the PQ node in the power system (i.e., the node in the power field where the active power and reactive power are given and the node voltage and phase are the quantities to be determined), then the injected power of all renewable nodes and load nodes is the input data. Constant parameters such as branch resistance and reactance are not selected as input. The output of the optimal power flow prediction model consists of operating costs, node voltages of all nodes, generator output, and power flows of all branches.
[0078] Each initial codec model has four layers: input layer X, noise layer , a single intermediate layer a, and an output layer Z. It can be obtained by randomly setting the value in the input X to zero, that is, randomly adding noise. Then, the middle layer a is composed of Input encoding function Finally, through the decoding function , with the goal of reconstructing X to obtain the output Z. The details are as follows:
[0079]
[0080]
[0081]
[0082] in, Represents the process of adding noise, and the encoding weight matrix W is a The bias vector b is a matrix dimensional vector, the decoding weight matrix W' is a The bias vector b' is a matrix dimensional vector. and are the number of neurons in the input layer and the output layer respectively. s is the activation function.
[0083] The training process is the process of adjusting and optimizing the parameters W and b.
[0084] For the activation function, the sigmoid function It is often widely used because it is biologically reasonable. However, when s is equal to 0 or 1, the gradient vanishing effect will occur due to the nonlinear activation of the sigmoid unit. In addition, if the sigmoid function is determined, the output of the model should be normalized to [0, 1] so that the voltage amplitude and active power of the PV node and other constant outputs can be normalized to 0 or 1. As mentioned earlier, data close to 0 or 1 is not conducive to training. Selecting the rectified linear unit (ReLU) function allows the gradient to flow well. In addition, the calculation speed of ReLU is also faster than the sigmoid function because there is no need to perform exponential functions and division operations during neuron activation.
[0085] like Figure 3 As shown in the figure, it is a schematic diagram of the model structure of the optimal power flow prediction model. By continuously encoding the input X, the output Y is obtained. t :
[0086]
[0087] in, is the l-th encoder module, l = 1, 2, ..., n, n is the number of target codec models, It is the top-level encoding module.
[0088] In order to avoid the unbounded behavior of ReLU, the sample input and output data are normalized to [0, 1] by the minimum-maximum normalization method:
[0089]
[0090] in, and are the minimum and maximum values in the sample input data respectively; and are the minimum and maximum values in the sample output data respectively.
[0091] In this embodiment, a deep stacked autoencoder is constructed by layered training and connecting target encoder modules, which greatly improves the computational efficiency of the model, avoids repeated optimization calculations in traditional numerical methods, and significantly reduces the calculation time. During the model training process, sample input data and corresponding output data of the actual power system are used to iteratively optimize the model parameters, so that the model can accurately capture the complex nonlinear relationship between the input data and the optimal power flow results, thereby improving the prediction accuracy. By introducing a preset noise module and adding noise during the training process, the model can still maintain good performance and stability when facing the inevitable noise and interference in actual operation.
[0092] In an exemplary embodiment, Figure 4 As shown, the above step S202 trains multiple initial codec models in sequence according to the sample input data to obtain a target codec model corresponding to each initial codec model, which can also be achieved by the following steps:
[0093] Step S401, determining input information of a current coding model among a plurality of initial coding models according to sample input data;
[0094] Step S402, iteratively training the current codec model according to the input information of the current codec model to obtain a target codec model corresponding to the current codec model;
[0095] Step S403, taking the next codec model of the current codec model in the multiple initial codec models as the current codec model, and jumping to the step of determining the input information of the current codec model in the multiple initial codec models according to the sample input data, until the target codec model corresponding to each initial codec model is obtained.
[0096] The current codec model is the codec model currently being trained.
[0097] Exemplarily, before training each current codec model, the terminal needs to determine the input information required by the current codec model based on the sample input data, and format this information into a form acceptable to the model. Since each target encoder module is stacked in the optimal power flow prediction model, that is, the input of each target encoder module needs to be determined based on the previous target encoder module, it is necessary to ensure that the training input of the encoder module is consistent with that of the application during the training phase, so as to ensure the effectiveness and accuracy of the optimal power flow prediction model. Then, the terminal uses the input information of the current codec model as the sample input for the training of the current codec model, inputs it into the current codec model, optimizes the model parameters through multiple iterative training, and finally obtains the optimized version of the model, that is, the target codec model. Finally, the terminal uses the next codec model of the current codec model in the multiple initial codec models as the new current codec model, and jumps to step S401 until the target codec model corresponding to each initial codec model is obtained, that is, the terminal updates the current codec model in sequence according to the predetermined order, and repeats the training process of steps S401 and S402 until all initial codec models obtain the corresponding target codec model, and all initial codec models are trained. Since each target encoder module needs to be stacked and connected to obtain the optimal power flow prediction model, and the training of the encoder module requires the use of the corresponding decoder module, the encoder modules need to be trained in sequence to ensure the effectiveness and accuracy of the optimal power flow prediction model.
[0098] In this embodiment, by ensuring the consistency of input of each target encoder module during training and application, the stability and accuracy of the model are improved, and the effectiveness of the final model is ensured. In multiple iterations of training, the current codec model can gradually optimize parameters, improve prediction accuracy and robustness, and eventually form a target codec model with excellent performance. Multiple codec models are updated and trained in sequence to ensure that all models are accurately and effectively optimized, and eventually multiple target codec models with excellent performance are formed, providing a solid foundation for subsequent model connection and overall optimization.
[0099] In an exemplary embodiment, the above-mentioned step S401 determines the input information of the current codec model among multiple initial codec models based on the sample input data, and also includes: when the current codec model is the first initial codec model, using the sample input data as the input information of the current codec model; when the current codec model is other initial codec models, connecting the target encoder modules in the target codec model trained before the current codec model in sequence to obtain a pre-coding model; inputting the sample input data into the pre-coding model to obtain the output information of the pre-coding model as the input information of the current codec model.
[0100] The other initial codec models are initial codec models other than the first initial codec model among the multiple initial codec models.
[0101] Exemplarily, when the current codec model is the first initial codec model, the sample input data is directly used as the input information of the current codec model, because in the application stage of the optimal power flow prediction model, the input of the first target encoder module is the model input of the optimal power flow prediction model. When the current codec model is another initial codec model, first, the target codec modules trained before the current codec model need to be connected in sequence to obtain a pre-coding model; then the sample input data is input into the pre-coding model, and the output information of the pre-coding model obtained is used as the input information of the current codec model to meet the actual input of the current encoder module when the optimal power flow prediction model is in the application stage. Only by ensuring the consistency between the input of the encoder module in training and the input in application can an effective target encoder module be trained. That is, the input information of the first initial codec model is the sample input data, and the input information of other initial codec models is the pre-output information obtained by the pre-coding model based on the sample input data; and the pre-coding model is obtained by connecting the target coding models in the target codec model trained before other initial codec models in sequence.
[0102] In this embodiment, by determining the input information of the current codec model, the consistency of the input of each target encoder module during training and application can be ensured, the stability and accuracy of the model are improved, and the effectiveness of the final model is ensured. In particular, in the training process of multiple initial codec models, connecting and training encoder modules layer by layer helps the model to gradually extract and optimize data features and enhance the prediction performance of the model.
[0103] In an exemplary embodiment, the above-mentioned step 402 iteratively trains the current codec model according to the input information of the current codec model to obtain the target codec model corresponding to the current codec model, and also includes: in each iterative training, the input information of the current codec model is input into the preset noise module of the current codec model to obtain the target input information after randomly adding noise; the target input information is processed by the encoder module and the decoder module in the current codec model in sequence to obtain the output information of the current codec model; according to the first difference information between the input information of the current codec model and the output information of the current codec model, the parameter candidate adjustment information of the encoder module and the decoder module in the current codec model is respectively determined; according to the preset momentum learning rate and the parameter candidate adjustment information, the parameter target adjustment information is determined; according to the parameter target adjustment information, the parameters of the encoder module and the decoder module in the current codec model are adjusted.
[0104] Exemplarily, in each iterative training of the current codec model, the terminal inputs the input information of the current codec model into the preset noise module of the current codec model to obtain the target input information after randomly adding noise. The noise module introduces random noise to enhance the robustness and generalization ability of the model. Then, the terminal processes the target input information in sequence through the encoder module and the decoder module in the current codec model to obtain the output information of the current codec model. The encoder module extracts the feature information of the input information, and the decoder module reconstructs the input information according to these features to obtain the output information. Then, the terminal determines the parameter candidate adjustment information of the encoder module and the decoder module in the current codec model according to the first difference information between the input information and the output information of the current codec model. The difference information is usually calculated by the loss function, which reflects the gap between the model output and the target output. That is, the input information is used to perform unsupervised training on the current codec model based on the encoder module and the decoder module. Further, the parameter target adjustment information is determined according to the preset momentum learning rate and the parameter candidate adjustment information. The momentum learning rate is used to accelerate convergence and avoid local minima. Finally, the parameters of the encoder module and the decoder module in the current encoding and decoding model are adjusted according to the parameter target adjustment information.
[0105] In a specific example, the mean square error function is used as the loss function:
[0106]
[0107] in, is the model output value, y is the reference value. d is the sum of y and The training objective is In this embodiment, y is the input value of the model to achieve unsupervised training.
[0108] In addition, the optimal power flow prediction model is nonlinear and non-convex, which leads to nonlinear correlation between the input and output of the optimal power flow prediction problem. The nonlinear correlation causes the optimal power flow prediction model based on the above model structure to have a deep structure and a large number of training samples. The root mean square propagation (RMSProp) algorithm decomposes the entire training sample into multiple batches, and each batch trains and updates the parameters W and b in turn. This algorithm can reduce the training pressure of the optimal power flow prediction model based on the above model structure and alleviate the local minimum problem. In addition, the root mean square propagation can also adaptively update the learning rate of each connection by maintaining the moving average of the square gradient of each parameter. Therefore, the root mean square propagation training algorithm is used to obtain the optimal parameters of the codec model. For the encoder module in the codec model, the parameter candidate adjustment information of parameters W and b is as follows:
[0109]
[0110] Among them, X and Z are the input and output of the encoding and decoding model respectively; is the weight of the connection between the i-th neuron in the input layer and the j-th neuron in the middle layer of the encoder module in the l-th encoder-decoder model after the T-th training iteration; is the bias value of the jth neuron in the middle layer of the encoder module in the lth encoding and decoding model after the Tth training iteration; is the Hadamard product; is the learning rate; r is the first sequence number in the mini-batch sample, and m is the sample size of the mini-batch sample; is the attenuation factor (usually close to 1, such as 0.99), is a small value to prevent division by zero (usually 10 -8 ).
[0111] in, and are the gradients of the mini-batch samples of the parameters W and b respectively; and are the moving averages of the squared gradients of parameters W and b, respectively.
[0112] In addition, based on the above formula, the parameter candidate adjustment information of parameters W and b is obtained respectively and After that, the momentum learning rate p is introduced to update the parameter candidate adjustment information and obtain the parameter target adjustment information:
[0113]
[0114] Finally, based on the parameter target adjustment information, the adjusted parameters are obtained:
[0115]
[0116] In this embodiment, by combining RMS propagation and momentum learning rate, the model training process becomes more efficient and stable. The small batch training of RMS propagation allows the model to use a part of the data for training in each iteration, reducing memory consumption and improving computational efficiency. By averaging multiple small batches, the model can update parameters more stably, reduce gradient noise, and enhance the generalization ability of the model; the momentum learning rate accelerates the convergence speed and reduces the oscillation by accumulating historical gradient information, so that the model can find the optimal solution more quickly in the face of complex loss surfaces. At the same time, the momentum term can help the model jump out of the local minimum and avoid falling into a bad convergence state. In each iteration, by introducing a noise module and a reasonable gradient update mechanism, the model can gradually optimize its parameters and improve the final prediction accuracy and robustness. It is particularly suitable for processing large-scale, high-dimensional power system data to ensure the reliability and accuracy of the final model in practical applications.
[0117] In an exemplary embodiment, the above-mentioned step S204 iteratively trains the candidate optimal power flow prediction model according to the sample input data and the sample output data to obtain a pre-trained optimal power flow prediction model, and also includes: in each iterative training, inputting the sample input data into the candidate optimal power flow prediction model to obtain the training output data; determining the second difference information between the training output data and the sample output data; and adjusting the model parameters of the candidate optimal power flow prediction model according to the second difference information.
[0118] Exemplarily, in each iterative training of the candidate optimal power flow prediction model, the terminal inputs the sample input data into the candidate optimal power flow prediction model to obtain the training output data; then, the terminal determines the second difference information between the training output data and the sample output data. The second difference information is usually obtained by calculating the loss function value (such as mean square error) between the training output data and the actual sample output data. Finally, the terminal adjusts the model parameters of the candidate optimal power flow prediction model according to the second difference information. The model parameters are gradually adjusted through the back propagation algorithm and optimization methods (such as gradient descent, momentum optimization, etc.) to minimize the loss function value.
[0119] In a specific embodiment, the iterative training of the candidate optimal power flow prediction model adopts a method similar to the iterative training of the codec model. In this embodiment, y in the loss function is the sample output data to achieve supervised training to ensure that the output of the top-level encoding module, that is, the output of the pre-trained optimal power flow prediction model, is the required power optimal power flow information. When training the candidate optimal power flow prediction model, not only the parameters W and b of the initial top-level encoding module are optimized, but also the parameters W and b of the target encoder module are further optimized as a whole.
[0120] In this embodiment, supervised training is performed using sample output data to ensure that the output of the top-level encoding module, that is, the output of the pre-trained optimal power flow prediction model, is the required power optimal power flow information, ensuring that the model can accurately predict the optimal power flow information of the power system and meet the actual application requirements. By optimizing the parameters of the initial top-level encoding module and further optimizing the parameters of the target encoder module as a whole, it is ensured that the parameters of the model at all levels are further effectively adjusted.
[0121] In another exemplary embodiment, Figure 5 As shown, the present application provides a method for determining a probabilistic optimal power flow, the method comprising the following steps:
[0122] Step S501: Acquire training data. Obtain training samples through experiments and simulations.
[0123] Step S502, data preprocessing. The input and output of the training samples are normalized by the minimum-maximum normalization method. Then, according to the number of training samples, the training samples are divided into m batches. Hyper parameters are obtained, including the number of encoding and decoding models, learning rate, momentum learning rate, and the number of neurons in each layer, which can be determined according to the scale of the power system.
[0124] Step S503: Unsupervised training of the codec model: Construct a loss function of the codec model, implement parameter update based on RMS propagation and momentum learning rate, and obtain an optimized target encoder module.
[0125] Step S504: supervised training of the optimal power flow prediction model. Construct a loss function of the optimal power flow prediction model, implement parameter update based on root mean square propagation and momentum learning rate, and obtain an optimized optimal power flow prediction model.
[0126] Step S505, sampling of system operation status. The random variables of the system are randomly sampled by Monte Carlo method. The present application still maintains the analysis framework of numerical method. Therefore, the sampling method can also adopt the improved Monte Carlo method series method. In addition, if necessary, Nataf transformation and Cholesky decomposition can also be used to deal with the correlation between load and renewable energy.
[0127] Step S506, calculate the power probability optimal power flow. All samples obtained are used in the pre-trained optimal power flow prediction model in matrix form, and then the power optimal power flow solution of all samples can be directly obtained. Then, the power optimal power flow information is obtained by denormalization. On this basis, the indicators of the power probability optimal power flow information such as mean, standard deviation, probability density, etc. can be effectively analyzed.
[0128] In this embodiment, the deep structure and reconstruction strategy of the model are used to obtain a pre-trained optimal power flow prediction model to extract the high-level nonlinear correlation between the system operating conditions and the power optimal power flow information. The characteristics of the power optimal power flow information are learned based on a training process. The trained optimal power flow prediction model can be used to conveniently calculate the power optimal power flow information of random samples obtained by the Monte Carlo method without additional calculation. The problem that the existing power probability optimal power flow information solution method is difficult to balance the calculation speed, accuracy and cost is overcome.
[0129] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0130] Based on the same inventive concept, the embodiment of the present application also provides a device for determining a power probability optimal power flow for implementing the power probability optimal power flow determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the device for determining a power probability optimal power flow provided below can refer to the limitations of the power probability optimal power flow determination method above, and will not be repeated here.
[0131] In an exemplary embodiment, Figure 6 As shown, a device for determining a power probabilistic optimal power flow is provided, comprising: a parameter information acquisition module 601, a power flow information acquisition module 602 and a probabilistic power flow acquisition module 603, wherein:
[0132] The parameter information acquisition module 601 is used to adopt a Monte Carlo model to randomly sample and acquire multiple sets of target parameter information from the power system to be determined;
[0133] The power flow information acquisition module 602 is used to input each set of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple sets of power optimal power flow information of the power system to be determined;
[0134] The probabilistic power flow acquisition module 603 is used to perform statistical processing on multiple groups of optimal power flow results in a preset statistical manner to obtain the power probabilistic optimal power flow information of the power system to be determined.
[0135] In one of the embodiments, the above-mentioned power probabilistic optimal power flow determination device also includes a prediction model acquisition module, which is used to obtain multiple initial codec models; each initial codec model includes an initial encoder module, an initial decoder module and a preset noise module; according to the sample input data, the multiple initial codec models are trained in sequence to obtain the target codec model corresponding to each initial codec model; the target codec model corresponding to each initial codec model includes a target encoder module, a target decoder module and a preset noise module; the sample input data is sample data for predicting power optimal power flow information; the target encoder module corresponding to each target codec model is connected in sequence, and the initial top-level encoding module is connected to obtain a candidate optimal power flow prediction model; according to the sample input data and the sample output data, the candidate optimal power flow prediction model is iteratively trained to obtain a pre-trained optimal power flow prediction model; the sample output data is the actual power optimal power flow information corresponding to the sample input data.
[0136] In one of the embodiments, the above-mentioned prediction model acquisition module is also used to determine the input information of the current codec model in multiple initial codec models based on sample input data; iteratively train the current codec model based on the input information of the current codec model to obtain a target codec model corresponding to the current codec model; use the next codec model of the current codec model in the multiple initial codec models as the current codec model, and jump to the step of determining the input information of the current codec model in the multiple initial codec models based on the sample input data until the target codec model corresponding to each initial codec model is obtained.
[0137] In one of the embodiments, the above-mentioned prediction model acquisition module is also used to, when the current codec model is the first initial codec model, use the sample input data as the input information of the current codec model; when the current codec model is other initial codec models, connect the target encoder modules in the target codec model trained before the current codec model in sequence to obtain a pre-coding model; other initial codec models are initial codec models other than the first initial codec model among multiple initial codec models; input the sample input data into the pre-coding model to obtain the output information of the pre-coding model as the input information of the current codec model.
[0138] In one of the embodiments, the above-mentioned prediction model acquisition module is also used to input the input information of the current codec model into the preset noise module of the current codec model in each iterative training to obtain the target input information after randomly adding noise; the target input information is processed by the encoder module and the decoder module in the current codec model in sequence to obtain the output information of the current codec model; according to the first difference information between the input information of the current codec model and the output information of the current codec model, the parameter candidate adjustment information of the encoder module and the decoder module in the current codec model are determined respectively; according to the preset momentum learning rate and the parameter candidate adjustment information, the parameter target adjustment information is determined; according to the parameter target adjustment information, the parameters of the encoder module and the decoder module in the current codec model are adjusted.
[0139] In one of the embodiments, the above-mentioned prediction model acquisition module is also used to input sample input data into the candidate optimal power flow prediction model in each iterative training to obtain training output data; determine the second difference information between the training output data and the sample output data; and adjust the model parameters of the candidate optimal power flow prediction model according to the second difference information.
[0140] Each module in the above-mentioned power probabilistic optimal power flow determination device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0141] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for determining a power probability optimal power flow is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0142] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0143] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0145] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0147] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0148] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0149] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for determining a probabilistic optimal power flow, characterized in that: The method comprises: Using the Monte Carlo model, multiple sets of target parameter information are randomly sampled from the power system to be determined; Inputting each group of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple groups of power optimal power flow information of the power system to be determined; The plurality of groups of optimal power flow results are statistically processed by using a preset statistical method to obtain the power probabilistic optimal power flow information of the power system to be determined.
2. The method according to claim 1, characterized in that The pre-trained optimal power flow prediction model is trained by the following steps: Acquire multiple initial codec models; each initial codec model includes an initial encoder module, an initial decoder module and a preset noise module; According to the sample input data, the multiple initial codec models are trained in sequence to obtain a target codec model corresponding to each initial codec model; the target codec model corresponding to each initial codec model includes a target encoder module, a target decoder module and a preset noise module; the sample input data is sample data for predicting optimal power flow information; Connect the target encoder modules corresponding to each target encoding and decoding model in sequence, and connect the initial top-level encoding module to obtain a candidate optimal power flow prediction model; Iteratively training the candidate optimal power flow prediction model according to the sample input data and the sample output data to obtain the pre-trained optimal power flow prediction model; The sample output data is actual power optimal power flow information corresponding to the sample input data.
3. The method according to claim 2, characterized in that The step of training the multiple initial codec models in sequence according to the sample input data to obtain a target codec model corresponding to each initial codec model includes: Determining input information of a current encoding and decoding model among the multiple initial encoding and decoding models according to the sample input data; Iteratively training the current codec model according to the input information of the current codec model to obtain a target codec model corresponding to the current codec model; The next codec model of the current codec model in the multiple initial codec models is used as the current codec model, and the step of determining the input information of the current codec model in the multiple initial codec models according to the sample input data is jumped to until the target codec model corresponding to each initial codec model is obtained.
4. The method according to claim 3, characterized in that The step of determining input information of a current coding model among the multiple initial coding models according to the sample input data includes: In a case where the current coding model is the first initial coding model, using the sample input data as input information of the current coding model; In the case where the current codec model is another initial codec model, the target encoder modules in the target codec model trained before the current codec model are sequentially connected to obtain a pre-coding model; the other initial codec model is an initial codec model other than the first initial codec model among the multiple initial codec models; The sample input data is input into the pre-coding model to obtain output information of the pre-coding model as input information of the current coding model.
5. The method according to claim 3, characterized in that: The iteratively training the current codec model according to the input information of the current codec model to obtain a target codec model corresponding to the current codec model includes: In each iterative training, the input information of the current codec model is input into a preset noise module of the current codec model to obtain target input information after randomly adding noise; Processing the target input information sequentially through the encoder module and the decoder module in the current encoding and decoding model to obtain output information of the current encoding and decoding model; Determining parameter candidate adjustment information of an encoder module and a decoder module in the current encoding and decoding model respectively according to first difference information between input information of the current encoding and decoding model and output information of the current encoding and decoding model; Determining parameter target adjustment information according to a preset momentum learning rate and the parameter candidate adjustment information; According to the parameter target adjustment information, the parameters of the encoder module and the decoder module in the current encoding and decoding model are adjusted.
6. The method according to claim 2, characterized in that The iterative training of the candidate optimal power flow prediction model according to the sample input data and the sample output data to obtain the pre-trained optimal power flow prediction model includes: In each iterative training, the sample input data is input into the candidate optimal power flow prediction model to obtain training output data; Determining second difference information between the training output data and the sample output data; According to the second difference information, model parameters of the candidate optimal power flow prediction model are adjusted.
7. A device for determining a probabilistic optimal power flow, characterized in that: The device comprises: A parameter information acquisition module is used to randomly sample and acquire multiple sets of target parameter information from the power system to be determined by using a Monte Carlo model; A power flow information acquisition module, used to input each group of target parameter information into a pre-trained optimal power flow prediction model to obtain multiple groups of power optimal power flow information of the power system to be determined; The probabilistic power flow acquisition module is used to perform statistical processing on the multiple groups of optimal power flow results in a preset statistical manner to obtain the power probabilistic optimal power flow information of the power system to be determined.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
