Line loss prediction method and device of power distribution network, terminal equipment and storage medium
By modal decomposing the distribution network line loss data and using long and short-term memory neural networks, the problem of low prediction accuracy of downline loss for high proportion distributed photovoltaic access is solved, and higher prediction accuracy is achieved.
Patent Information
- Application Number
- CN202510184502.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-07-01
AI Technical Summary
The existing linear loss prediction methods are difficult to adapt to nonlinearity and volatility in distribution networks with high proportion distributed photovoltaic access, resulting in low prediction accuracy and cannot meet the needs of modern power grid management.
By modal decomposing historical line loss data, a modal component data set is generated, and a line loss prediction model is constructed using long and short-term memory neural networks, and training is combined with the weather factor sequence in the distributed photovoltaic area to improve prediction accuracy.
It effectively reduces the adverse impact of the nonlinearity and volatility of line loss data on the prediction results, improves the overall accuracy of the line loss prediction model, and adapts to the challenges brought by distributed photovoltaic access.
Smart Images

Figure CN120235282A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of line loss prediction, and particularly to a line loss prediction method, device, terminal device and storage medium for a distribution network. Background Art
[0002] Line loss, that is, line loss, refers to the loss phenomenon of electric energy during the transmission process due to reasons such as resistance heat loss, induced electromagnetic wave loss, and capacitive current loss generated when current passes through a wire in the processes of power transmission, transformation, distribution, and power consumption. Therefore, currently, by predicting the line loss, the operation of the power grid is optimized, the loss of ineffective energy is reduced, the power transmission efficiency is improved, and the operation cost is reduced. The research on line loss can be divided into two major categories from the research methods: traditional methods and artificial intelligence methods. Traditional methods require less data volume and mainly include the root mean square current method, loss factor method, average current method, etc. With the complexity of the power grid structure, the diversification of involved entities, and the diversification of management objectives, the traditional line loss calculation methods have low accuracy and poor timeliness, and are not applicable to the management mode of feedforward control.
[0003] However, with the continuous increase in the access of distributed photovoltaic, the time series of the line loss of the distribution network is affected by the access of distributed photovoltaic, and the characteristics of nonlinearity and volatility are more significant. Under the condition of high proportion of distributed photovoltaic access, the distribution network changes from a traditional passive single network to an active bidirectional network, resulting in a change in the power flow direction and thus affecting the line loss. The output of photovoltaic is affected by weather and has strong nonlinearity and volatility. Traditional line loss prediction methods are difficult to adapt to the new form of the distribution network with the gradual access of distributed photovoltaic. Summary of the Invention
[0004] The embodiments of the present invention provide a line loss prediction method, device, terminal device and storage medium for a distribution network, which reduce the adverse impact of the nonlinearity and volatility of line loss data on the accuracy of the model prediction result by performing modal decomposition on historical line loss data, and also utilize the advantage of the long short-term memory neural network in capturing the long-term dependence relationship of sequences, effectively improving the overall prediction accuracy of the line loss prediction model.
[0005] An embodiment of the present invention provides a line loss prediction method for a distribution network, including:
[0006] Obtain the weather factor sequence of each area where distributed photovoltaic is located in the distribution network;
[0007] Input the weather factor sequence into a preset line loss prediction model, so that the line loss prediction model predicts and outputs the line loss data of the distribution network in a future time period according to the weather factor sequence;
[0008] Wherein, the construction process of the line loss prediction model includes:
[0009] Obtain the historical weather factor sequences of the regions where each of the distributed photovoltaics is located in a number of historical time periods, and the historical line loss data of the distribution network in each historical time period;
[0010] Perform modal decomposition on the historical line loss data to generate a modal component data set of each of the historical line loss data;
[0011] Construct a training data set according to the historical weather factor sequences and the modal component data set;
[0012] Construct an initial line loss prediction model to be trained based on a long short-term memory neural network;
[0013] Train the initial line loss prediction model according to the training data set, and during the training process, determine the prediction accuracy of the initial line loss prediction model according to the prediction results output by the initial line loss prediction model. When the prediction accuracy reaches a preset threshold, end the training to generate the line loss prediction model.
[0014] Further, the obtaining the historical weather factor sequences of the regions where each of the distributed photovoltaics is located in a number of historical time periods, and the historical line loss data of the distribution network in each historical time period includes:
[0015] Obtain the weather data of several types of weather factors in the regions where each of the distributed photovoltaics is located in a number of historical time periods, and the historical line loss data of the distribution network in each historical time period;
[0016] Adopt the random forest method to determine the feature importance of each type of weather factor according to the weather data and the historical line loss data;
[0017] Determine several types of weather factors with feature importance greater than a preset threshold as target weather factors;
[0018] Construct the historical weather factor sequences according to the weather data of the target weather factors.
[0019] Further, the adopting the random forest method to determine the feature importance of each type of weather factor according to the weather data and the historical line loss data includes:
[0020] Traverse each type of weather factor, and randomly divide the weather data of several types of weather factors into a training set and out-of-bag data;
[0021] Construct a decision tree using the training set, and use the decision tree to predict the first line loss data in the corresponding time period according to the out-of-bag data;
[0022] Compare the first line loss data with the historical line loss data in the corresponding time period, and record the number of the first samples with correct predictions;
[0023] Perturb the weather data of the currently traversed weather factor in the out-of-bag data to generate perturbed out-of-bag data;
[0024] Use the decision tree to predict the second line loss data for the corresponding time period according to the perturbed out-of-bag data;
[0025] Compare the second line loss data with the historical line loss data for the corresponding time period, and record the number of correct second samples in the prediction;
[0026] Calculate the feature importance of the currently traversed weather factor according to the first sample number and the second sample number;
[0027] When the traversal is completed, obtain the feature importance of various weather factors.
[0028] Further, perform modal decomposition on the historical line loss data to generate a modal component data set of each historical line loss data, including:
[0029] Construct a variational problem according to the historical line loss data, and construct a variational model with the minimum sum of the bandwidths of all modal components as the goal according to the variational problem;
[0030] Use the quadratic penalty factor and the Lagrange multiplier to construct the extended Lagrangian expression of the variational model;
[0031] Use the multiplicative operator alternating direction method to iteratively solve the extended Lagrangian expression, and calculate the residual of the variational model during the iterative solution process. When the residual is less than the preset discrimination accuracy, stop the iteration and determine the target number of modes;
[0032] According to the target number of modes, perform modal decomposition on the historical line loss data to generate a modal component data set of each historical line loss data.
[0033] Further, the variational model is:
[0034]
[0035] Among them, f(t) is the historical line loss data, {u k} = {u1(t), u2(t), …, u K (t)} is the set of modal components, K is the number of modes, {ω k} = {ω1, ω2, …, ω K} is the set of center frequencies, ω k is the center frequency corresponding to the modal component u k (t), t is time, is the partial derivative of the function with respect to time t, and δ(t) is the unit impulse function. It is the vector representation of the center frequency on the complex plane.
[0036] Furthermore, determining the prediction accuracy of the initial line loss prediction model according to the prediction result output by the initial line loss prediction model includes:
[0037] Calculating the mean absolute error, root mean square error, and goodness of fit according to the prediction result output by the initial line loss prediction model and the corresponding historical line loss data;
[0038] Determining the prediction accuracy of the initial line loss prediction model according to the mean absolute error, root mean square error, and goodness of fit.
[0039] Another embodiment of the present invention provides a line loss prediction device for a distribution network, including:
[0040] A data acquisition module for acquiring the weather factor sequences in the regions where each distributed photovoltaic in the distribution network is located;
[0041] A line loss prediction module for inputting the weather factor sequences into a preset line loss prediction model, so that the line loss prediction model predicts and outputs the line loss data of the distribution network in a future time period according to the weather factor sequences;
[0042] Wherein, the construction process of the line loss prediction model includes:
[0043] Acquiring the historical weather factor sequences in the regions where each distributed photovoltaic is located in a plurality of historical time periods, and the historical line loss data of the distribution network in each historical time period;
[0044] Performing modal decomposition on the historical line loss data to generate a modal component data set of each historical line loss data;
[0045] Constructing a training data set according to the historical weather factor sequences and the modal component data set;
[0046] Constructing an initial line loss prediction model to be trained according to a long short-term memory neural network;
[0047] Training the initial line loss prediction model according to the training data set, and during the training process, determining the prediction accuracy of the initial line loss prediction model according to the prediction result output by the initial line loss prediction model, and ending the training when the prediction accuracy reaches a preset threshold to generate the line loss prediction model.
[0048] Furthermore, the data acquisition module acquires the historical weather factor sequences in the regions where each distributed photovoltaic is located in a plurality of historical time periods, and the historical line loss data of the distribution network in each historical time period, including:
[0049] Obtain the weather data of several types of weather factors in the regions where each of the distributed photovoltaics is located for several historical periods, and the historical line loss data of the distribution network for each historical period;
[0050] Using the random forest method, determine the feature importance of various weather factors based on the weather data and the historical line loss data;
[0051] Determine several types of weather factors with feature importance greater than a preset threshold as target weather factors;
[0052] Construct the historical weather factor sequence based on the weather data of the target weather factors.
[0053] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a line loss prediction method for a distribution network as described in any one of the above embodiments.
[0054] Another embodiment of the present invention provides a storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the storage medium is located to execute a line loss prediction method for a distribution network as described in any one of the above embodiments.
[0055] By implementing the present invention, the following beneficial effects are achieved:
[0056] The present invention discloses a line loss prediction method, device, terminal device, and storage medium for a distribution network. The method constructs an initial line loss prediction model according to a long short-term memory neural network, and uses the historical weather factor sequence in the regions where each distributed photovoltaic in the distribution network is located for several historical periods, and the modal component dataset of the historical line loss data of the distribution network for each historical period to train the initial line loss prediction model to obtain a line loss prediction model. And using the line loss prediction model, according to the current weather factor sequence in the regions where each distributed photovoltaic is located, predict the line loss data of the distribution network in the future period. Therefore, the present invention decomposes the historical line loss data by modal decomposition, decomposes the original sequence with strong volatility and randomness into multiple more stable modal components, and these modal components can more accurately reflect the internal laws and patterns of the line loss data, reducing the adverse effects of the nonlinearity and volatility of the original line loss data on the accuracy of the model prediction results. It also constructs a line loss prediction model by using a long short-term memory neural network, taking advantage of the long short-term memory neural network's ability to capture long-term dependencies in sequences, effectively improving the overall prediction accuracy of the line loss prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1It is a schematic flow chart of a line loss prediction method for a distribution network provided by an embodiment of the present invention.
[0058] Figure 2 It is a schematic structural diagram of a line loss prediction device for a distribution network provided by an embodiment of the present invention. Detailed implementation manners
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are some but not all of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art without making creative efforts based on the embodiments in this application belong to the scope of protection of this application.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion.
[0061] In the description of the embodiments of this application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order, or primary-secondary relationship of the indicated technical features. In the description of the embodiments of this application, "a plurality of" means two or more unless otherwise specifically defined.
[0062] Referring to "embodiments" herein means that specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of this application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0063] In the description of the embodiments of this application, the term "and / or" is only a description of the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0064] In the description of the embodiments of the present application, the term "plurality" refers to two or more (including two). Similarly, "multiple groups" refers to two or more groups (including two groups), and "multiple pieces" refers to two or more pieces (including two pieces).
[0065] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installation", "connection", "connection", "fixation", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can also be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific situations.
[0066] See Figure 1 , which is a schematic flowchart of a line loss prediction method for a distribution network provided by an embodiment of the present invention, including:
[0067] S1. Obtain the weather factor sequences in the regions where each distributed photovoltaic in the distribution network is located;
[0068] S2. Input the weather factor sequences into a preset line loss prediction model, so that the line loss prediction model predicts and outputs the line loss data of the distribution network in the future time period according to the weather factor sequences;
[0069] In a preferred embodiment of the present invention, as Figure 1 (a) shows, with a 1-hour collection period, six factor sequences of direct solar irradiance intensity, temperature, humidity, wind speed, atmospheric pressure, and wind direction are collected from the meteorological stations in the regions where each distributed photovoltaic is located as the weather factor sequences. Input the weather factor sequences into the LSTM line loss prediction model for line loss prediction. It can be understood that the long short-term memory network (LSTM) is based on the RNN, adds a memory module to the hidden layer, and introduces a gating unit in the network topology to control the deletion or addition of data by the memory cells, thereby overcoming the problems of gradient disappearance and gradient explosion in the backpropagation process.
[0070] Among them, the construction process of the line loss prediction model includes:
[0071] S01. Obtain the historical weather factor sequences in the regions where each distributed photovoltaic is located in several historical time periods, and the historical line loss data of the distribution network in each historical time period;
[0072] In a preferred embodiment of the present invention, as Figure 1As shown in (b), with a collection cycle of 1 hour, the six factor sequences of direct solar radiation intensity, temperature, humidity, wind speed, atmospheric pressure and wind direction in several historical time periods are obtained from the meteorological stations in the areas where each distributed photovoltaic is located, and the historical weather factor sequence is constructed. The historical line loss data in the corresponding historical time period is collected from the monitoring system of the distribution network.
[0073] Preferably, the obtaining of the historical weather factor sequences of the distributed photovoltaic areas in several historical time periods, and the historical line loss data of the distribution network in each historical time period, includes:
[0074] S011. Obtain weather data of several types of weather factors in the areas where the distributed photovoltaics are located in several historical periods, and historical line loss data of the distribution network in each historical period;
[0075] In a preferred embodiment of the present invention, various weather factors, including: direct solar radiation intensity, temperature, humidity, wind speed, atmospheric pressure, wind direction, precipitation, cloud cover, etc., obtain weather data of several types of weather factors from the meteorological stations in the areas where the distributed photovoltaics are located. As we all know, photovoltaic power generation is affected by weather factors. If the data of all weather factors are used to train the model, irrelevant factors or low-correlation factors will lead to prediction errors, and too much input data will also lead to low prediction efficiency of the model. Therefore, this embodiment obtains multiple types of weather factors for feature screening to improve the accuracy and efficiency of line loss prediction.
[0076] It should be further explained that in order to ensure data accuracy and improve the accuracy of subsequent model training results, taking into account observation errors and communication failures in the actual operation of the system, the collected data needs to be cleaned. First, the abnormal data should be eliminated, and then the missing data and the eliminated abnormal data should be filled by interpolation.
[0077] S012. Using the random forest method, according to the weather data and the historical line loss data, determine the characteristic importance of various weather factors;
[0078] In a preferred embodiment of the present invention, in order to minimize the dimension of input data, reduce prediction errors caused by irrelevant or low-correlated factors, and improve prediction efficiency, the random forest method (RF) is used to analyze the correlation between external factors such as weather and line loss time series data, screen key features, and reduce data redundancy.
[0079] Preferably, the random forest method is used to determine the characteristic importance of various weather factors according to the weather data and the historical line loss data, including:
[0080] S0121. Traverse each type of weather factor, and randomly divide the weather data of several types of weather factors into a training set and out-of-bag data;
[0081] S0122. Construct a decision tree using the training set, and use the decision tree to predict the first line loss data for the corresponding time period according to the out-of-bag data;
[0082] S0123. Compare the first line loss data with the historical line loss data for the corresponding time period, and record the number of correctly predicted first samples;
[0083] S0124. Perturb the weather data of the currently traversed weather factor in the out-of-bag data to generate perturbed out-of-bag data;
[0084] S0125. Use the decision tree to predict the second line loss data for the corresponding time period according to the perturbed out-of-bag data;
[0085] S0126. Compare the second line loss data with the historical line loss data for the corresponding time period, and record the number of correctly predicted second samples;
[0086] S0127. Calculate the feature importance of the currently traversed weather factor according to the number of the first samples and the number of the second samples;
[0087] S0128. When the traversal is completed, obtain the feature importance of each type of weather factor.
[0088] S013. Determine several types of weather factors with feature importance greater than a preset threshold as target weather factors;
[0089] S014. Construct the historical weather factor sequence according to the weather data of the target weather factors.
[0090] In a preferred embodiment of the present invention, first randomly select weather factors from d weather factors; then, based on the principle of maximizing the Gini gain, determine the splitting attribute as the attribute with the most significant classification ability; finally, divide the data of the node into new child nodes. The commonly used Gini calculates the purity of the data set D, that is:
[0091]
[0092] where p k is the proportion of the kth weather factor in the data. |y| is the number of value types of the weather factor. Gini(D) is the probability that the categories of two samples selected in the data set D (the set formed by the weather data) are different. It can be obtained that the size of Gini(D) is inversely proportional to the purity of the data set D. The Gini gain of the data set D after splitting by the weather factor a is as follows:
[0093]
[0094] Among them, V is the number of value types of a, and |D v | is the number of samples corresponding to the v-th value. The principle of maximizing the Gini gain is to calculate the Gini gain of all attributes of the node, and select the attribute with the largest Gini gain as the splitting attribute. Its characteristics include the highest purity of the child node dataset, the best classification performance, and the greatest importance in the feature set. The importance of the feature is often measured by the division of the decision tree node.
[0095] Specifically, when the random forest selects samples, it requires double randomness. Therefore, the importance of the feature cannot be simply represented by the frequency of occurrence of the attribute in the decision tree.
[0096] 1. Let k = 1, use Bagging to generate the training set and OOB data, and build the decision tree T on this basis k .
[0097] 2. Use T k to predict and classify the OOB data, and record the number of correctly classified samples as R k .
[0098] 3. Perturb the value of the feature f in the OOB data to obtain a new OOB sample set, and repeat T k for the classification prediction of the new OOB sample set, and record the number of correctly classified samples as R k '.
[0099] 4. Let k = 2, 3,..., K, and repeat steps 1 - 3.
[0100] 5. Finally, obtain the importance of the feature f:
[0101]
[0102] If the difference in the classification accuracy rate before and after perturbing the value of the feature f is small, it indicates that the feature f has little impact on the classification, and the value of R k - R k ' is very small. Therefore, IMP(f) is positively correlated with the classification performance of the feature f.
[0103] It should be noted that by using the RF method, the influence degree ranking of different weather factors on the line loss of the photovoltaic-connected distribution network system is output. Initial important thresholds are set as 0.8, 0.9, 0.1, 0.11, 0.12, etc., and environmental factors with importance lower than the threshold are excluded. It should be further noted that the important threshold can also be dynamically adjusted according to the prediction accuracy during the subsequent model training process. That is, during the training process of the model, if the prediction accuracy cannot reach the preset accuracy threshold, the important threshold can be adjusted, the historical weather factor sequence can be reconstructed, and the model can be retrained to improve the model accuracy.
[0104] S02. Perform modal decomposition on the historical line loss data to generate a modal component data set for each piece of the historical line loss data;
[0105] In a preferred embodiment of the present invention, the line loss data of the distribution network under high-proportion distributed photovoltaic access has characteristics such as randomness and strong nonlinearity. At a certain time point, it may contain multiple fluctuation modes, including a large number of false signals and a large amount of noise. VMD is a new type of non-recursive variational mode signal decomposition method that can adaptively decompose a non-stationary sequence into a finite number of intrinsic mode functions (IMFs) with different frequencies according to the characteristics of the data sequence, greatly reducing the residual noise problem in the IMF components.
[0106] Preferably, the performing modal decomposition on the historical line loss data to generate a modal component data set for each piece of the historical line loss data includes:
[0107] S021. According to the historical line loss data, construct a variational problem, and according to the variational problem, construct a variational model with the goal of minimizing the sum of the bandwidths of all modal components;
[0108] Preferably, the variational model is:
[0109]
[0110] where f(t) is the historical line loss data, {u k} = {u1(t), u2(t), …, u K (t)} is the set of modal components, K is the number of modes, {ω k} = {ω1, ω2, …, ω K} is the set of center frequencies, ω k is the center frequency corresponding to the modal component u k (t), t is time, is the partial derivative of the function with respect to time t, δ(t) is the unit impulse function, is the vector representation of the center frequency in the complex plane.
[0111] In a preferred embodiment of the present invention, a variational problem is constructed. The constraint condition of the model is to ensure that the sum of the bandwidths of all IMFs is minimized, and the sum of each IMF is equal to the input signal. Assume that the time series signal to be decomposed is f(t), and it is decomposed into K IMFs, each IMF is represented as u k (t), where k = 1, 2,..., K. The model is expressed as follows:
[0112]
[0113] In the formula, ω k is the central frequency corresponding to u k (t); {u k} = {u1(t), u2(t),..., u K (t)} is a set of mode functions; {ω k} = {ω1, ω2,..., ω K} is a set of central frequencies corresponding to the mode functions {u k}; t refers to time; represents the partial derivative of the function with respect to time t; δ(t) is the unit impulse function; is the vector representation of the central frequency in the complex plane.
[0114] S022. A quadratic penalty factor and a Lagrange multiplier are used to construct an extended Lagrangian expression of the variational model;
[0115] In a preferred embodiment of the present invention, to find the optimal solution of the above variational model, a Lagrangian expression is constructed using the quadratic penalty factor α and the Lagrange multiplier λ, and the constrained variational model is transformed into an unconstrained variational model, which is expressed as follows:
[0116]
[0117] Among them, α can be used to limit the bandwidth to ensure the reconstruction accuracy of the signal.
[0118] S023. The alternating direction method of multipliers is used to iteratively solve the extended Lagrangian expression. During the iterative solution process, the residual of the variational model is calculated. When the residual is less than the preset discrimination accuracy, the iteration is stopped, and the target number of modes is determined;
[0119] In a preferred embodiment of the present invention, the alternating direction method of multipliers (ADMM) is used to solve the extended Lagrangian expression. First, initialize λ 1 , n; then execute the loop: n = n + 1; finally, update {u k}, {ω k} and λ:
[0120]
[0121] S024. Decompose the historical line loss data according to the target number of modes to generate a modal component data set for each of the historical line loss data.
[0122] In a preferred embodiment of the present invention, the convergence condition is set as follows:
[0123]
[0124] ε is the discrimination accuracy, which is used to control the relative error. If the residual is less than the discrimination accuracy, stop updating; otherwise, continue to update {u k}, {ω k}, and λ until the convergence condition is met.
[0125] It can be understood that variational mode decomposition (VMD) is an adaptive and completely non - recursive method for modal variation and signal processing. The commonly used method of VMD is to determine the number of modes by observing the center frequency. Therefore, the selected value of the number of modes will have a greater impact on the decomposition effect. When the selected value of the mode is small, some important information in the original signal will be removed, which will have an adverse effect on the prediction accuracy; on the contrary, the closer the center frequencies of adjacent modal components are, the more likely modal repetition or additional noise will occur. The difference between each mode is the difference in its center frequency. Therefore, an appropriate modal value can be selected according to the distribution of the center frequencies under different numbers of modes. In this embodiment, the number of modes generally takes values from 2 to 6. By determining different numbers of modes N and using the VMD algorithm, the historical line loss data can be decomposed into N IMF components, and an appropriate number of modes can be selected in combination with the accuracy of the prediction model.
[0126] S03. Construct a training data set according to the historical weather factor sequence and the modal component data set;
[0127] S04. Construct an initial line loss prediction model to be trained based on a long - short - term memory neural network;
[0128] S05. Train the initial line loss prediction model according to the training data set, and during the training process, determine the prediction accuracy of the initial line loss prediction model according to the prediction results output by the initial line loss prediction model. When the prediction accuracy reaches a preset threshold, end the training to generate the line loss prediction model.
[0129] In a preferred embodiment of the present invention, the long - short - term memory network (LSTM) is based on the RNN. A memory module is added to the hidden layer, and a gating unit is introduced into the network topology to control the deletion or addition of data by the memory cell, thereby overcoming the problems of gradient disappearance and gradient explosion that occur during the backpropagation process.
[0130] The LSTM neural network includes an input layer, an output layer, and a hidden layer. It is recursively connected by multiple recurrent units, and each neuron is regarded as a memory cell. Each memory module includes an input gate, an output gate, and a forget gate.
[0131] The input gate is used to control the data x flowing into the network, as follows: t The amount flowing into the memory cell is as follows:
[0132]
[0133] The forget gate is used to control the selection or forgetting of information, determining which information in the historical information is discarded, that is, judging the influence of the information in the previous memory cell C on the current memory cell C, as follows: t-1 on the current memory cell C t as follows:
[0134] f t = σ(W1 f ·x t + W h f ·h t-1 + b f );
[0135] C t = tanh(W1 C ·x t + W h C ·h t-1 + b C );
[0136] C t = i t ·Ct + f t ·C t-1 ;
[0137] The output gate is used to control the influence of the memory cell C on the current output value h, that is, at time t, it controls which part of the memory cell will output, as follows: t on the current output value h t as follows:
[0138] o t = σ(W1 o ·x t + W h o ·h t-1 + b o );
[0139] h t = o t ×tanh(C t );
[0140] where it and f t and o t are the input gate, forget gate, and output gate respectively; W1 i and W1 f and W1 o and W1 C are the weight matrices of the input gate, forget gate, output gate, and tuple input for communication with the tuple respectively; W h i and W h f and W h o and W h C are the weight matrices of the input gate, forget gate, output gate, and tuple input for connection with the tuple respectively; b i and b f and b o and b C are the bias variables of the input gate, forget gate, output gate, and tuple input respectively; σ is the sigmoid activation function.
[0141] Preferably, determining the prediction accuracy of the initial line loss prediction model according to the prediction result output by the initial line loss prediction model includes:
[0142] S051. Calculate the mean absolute error, root mean square error, and goodness of fit according to the prediction result output by the initial line loss prediction model and the corresponding historical line loss data;
[0143] S052. Determine the prediction accuracy of the initial line loss prediction model according to the mean absolute error, root mean square error, and goodness of fit.
[0144] In a preferred embodiment of the present invention, the mean absolute error (MAE), root mean square error (RMSE), and goodness of fit (R2) are selected as the prediction model accuracy indicators. When the MAE and RMSE are small, the accuracy of the model is high; the closer the value of R2 is to 1, the higher the prediction accuracy.
[0145]
[0146] where y i is the true value of the line loss data; y i is the predicted value of the line loss data; is the mean of the true values of the line loss data; m is the number of the test sample set.
[0147] This embodiment provides a method for predicting line losses in a distribution network. An initial line loss prediction model is constructed based on a long short-term memory neural network, and the historical weather factor sequences of the regions where each distributed photovoltaic in the distribution network is located in a number of historical time periods are used, together with the modal component dataset of the historical line loss data of the distribution network in each historical time period, to train the initial line loss prediction model to obtain the line loss prediction model. Subsequently, the line loss prediction model is used to predict the line loss data of the distribution network in future time periods according to the current weather factor sequences of the regions where each distributed photovoltaic is located. Therefore, the present invention reduces the adverse effects of the nonlinearity and volatility of the line loss data on the accuracy of the model prediction results by performing modal decomposition on the historical line loss data, and also utilizes the advantage of the long short-term memory neural network in capturing long-term dependence relationships in sequences, effectively improving the overall prediction accuracy of the line loss prediction model.
[0148] See Figure 2 , which is a schematic structural diagram of a line loss prediction device for a distribution network provided by an embodiment of the present invention, including:
[0149] A data acquisition module for acquiring the weather factor sequences of the regions where each distributed photovoltaic in the distribution network is located;
[0150] A line loss prediction module for inputting the weather factor sequences into a preset line loss prediction model, so that the line loss prediction model predicts and outputs the line loss data of the distribution network in future time periods according to the weather factor sequences;
[0151] Among them, the construction process of the line loss prediction model includes:
[0152] Acquiring the historical weather factor sequences of the regions where each distributed photovoltaic is located in a number of historical time periods, and the historical line loss data of the distribution network in each historical time period;
[0153] Performing modal decomposition on the historical line loss data to generate a modal component dataset of each historical line loss data;
[0154] Constructing a training dataset according to the historical weather factor sequences and the modal component dataset;
[0155] Constructing an initial line loss prediction model to be trained based on a long short-term memory neural network;
[0156] Training the initial line loss prediction model according to the training dataset, and during the training process, determining the prediction accuracy of the initial line loss prediction model according to the prediction results output by the initial line loss prediction model. When the prediction accuracy reaches a preset threshold, the training is ended to generate the line loss prediction model.
[0157] Further, the data acquisition module acquires historical weather factor sequences of the regions where each of the distributed photovoltaics is located in a plurality of historical periods, and historical line loss data of the distribution network in each historical period, including:
[0158] Acquire weather data of several types of weather factors in the regions where each of the distributed photovoltaics is located in a plurality of historical periods, and historical line loss data of the distribution network in each historical period;
[0159] Adopt the random forest method to determine the feature importance of each type of weather factor according to the weather data and the historical line loss data;
[0160] Determine several types of weather factors with feature importance greater than a preset threshold as target weather factors;
[0161] Construct the historical weather factor sequence according to the weather data of the target weather factors.
[0162] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the attached drawings of the device embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement without creative work.
[0163] Those skilled in the art can clearly understand that for the convenience and conciseness, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiments, and will not be elaborated here.
[0164] Another preferred embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a line loss prediction method for a distribution network as described in any one of the above embodiments.
[0165] The terminal device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory.
[0166] The so-called processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and connects various parts of the entire terminal device through various interfaces and lines.
[0167] The memory can be used to store the computer program. By running or executing the computer program stored in the memory, and invoking the data stored in the memory, the processor realizes various functions of the terminal device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, memory, plug-in hard disks, Smart Media Cards (SMCs), Secure Digital (SD) cards, Flash Cards, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
[0168] Another preferred embodiment of the present invention provides a storage medium, which is a computer-readable storage medium. The computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, the steps of the above various method embodiments can be realized. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0169] The above are the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.
Claims
1. A method for predicting line loss in a distribution network, characterized in that: include: Obtain the weather factor sequence of each distributed photovoltaic area in the distribution network; Inputting the weather factor sequence into a preset line loss prediction model, so that the line loss prediction model predicts and outputs line loss data of the distribution network in a future period according to the weather factor sequence; The construction process of the line loss prediction model includes: Obtaining a sequence of historical weather factors in the areas where the distributed photovoltaics are located in several historical periods, and historical line loss data of the distribution network in each historical period; Performing modal decomposition on the historical line loss data to generate modal component data sets of each of the historical line loss data; Constructing a training data set according to the historical weather factor sequence and the modal component data set; An initial line loss prediction model to be trained is constructed based on a long short-term memory neural network; The initial line loss prediction model is trained according to the training data set, and during the training process, the prediction accuracy of the initial line loss prediction model is determined according to the prediction results output by the initial line loss prediction model. When the prediction accuracy reaches a preset threshold, the training is terminated to generate the line loss prediction model.
2. A method for predicting line loss in a distribution network according to claim 1, characterized in that: The obtaining of the historical weather factor sequences of the regions where the distributed photovoltaic systems are located in several historical periods, and the historical line loss data of the distribution network in each historical period, includes: Obtain weather data of several types of weather factors in the areas where the distributed photovoltaics are located in several historical periods, and historical line loss data of the distribution network in each historical period; Using the random forest method, the characteristic importance of various weather factors is determined based on the weather data and the historical line loss data; Several types of weather factors whose characteristic importance is greater than a preset threshold are determined as target weather factors; The historical weather factor sequence is constructed according to the weather data of the target weather factor.
3. A method for predicting line loss in a distribution network according to claim 2, characterized in that: The random forest method is used to determine the characteristic importance of various weather factors based on the weather data and the historical line loss data, including: Traverse each type of weather factor and randomly divide the weather data of several types of weather factors into training sets and out-of-bag data; A decision tree is constructed using the training set, and the decision tree is used to predict the first line loss data in the corresponding time period according to the out-of-bag data; Compare the first line loss data with the historical line loss data in the corresponding period, and record the number of first samples that are correctly predicted; Disturbing the weather data of the currently traversed weather factor in the out-of-bag data to generate disturbed out-of-bag data; Using the decision tree to predict the second line loss data in the corresponding time period according to the disturbance out-of-bag data; Compare the second line loss data with the historical line loss data in the corresponding period, and record the number of second samples that are correctly predicted; Calculating the feature importance of the currently traversed weather factor according to the first sample number and the second sample number; When the traversal is completed, the characteristic importance of each weather factor is obtained.
4. A method for predicting line loss in a distribution network according to claim 1, characterized in that: The performing modal decomposition on the historical line loss data to generate a modal component data set of each of the historical line loss data includes: According to the historical line loss data, a variational problem is constructed, and according to the variational problem, a variational model with the minimum bandwidth of all modal components as the goal is to construct; Using a quadratic penalty factor and a Lagrangian multiplier, an extended Lagrangian expression of the variational model is constructed; Iteratively solving the extended Lagrangian expression using a multiplication operator alternating direction method, and calculating the residual of the variational model during the iterative solution process, stopping the iteration when the residual is less than a preset discrimination accuracy, and determining the target modal number; According to the target modal number, the historical line loss data is modally decomposed to generate a modal component data set of each historical line loss data.
5. A method for predicting line loss in a distribution network according to claim 4, characterized in that: The variational model is: Among them, f(t) is the historical line loss data, {u k }={u1(t),u2(t),…,u K (t)} is the set of modal components, K is the number of modes, {ω k }={ω1,ω2,…,ω K } is the set of center frequencies, ω k is the modal component u k (t) corresponds to the center frequency, t is time, is the partial derivative of the function with respect to time t, δ(t) is the unit pulse function, is the vector representation of the center frequency in the complex plane.
6. A method for predicting line loss in a distribution network according to claim 1, characterized in that: Determining the prediction accuracy of the initial line loss prediction model according to the prediction result output by the initial line loss prediction model includes: Calculate the mean absolute error, the root mean square error, and the goodness of fit according to the prediction result output by the initial line loss prediction model and the corresponding historical line loss data; The prediction accuracy of the initial line loss prediction model is determined according to the mean absolute error, the root mean square error, and the goodness of fit.
7. A line loss prediction device for a distribution network, characterized in that: include: A data acquisition module is used to obtain the weather factor sequence of each distributed photovoltaic area in the distribution network; A line loss prediction module, used for inputting the weather factor sequence into a preset line loss prediction model, so that the line loss prediction model predicts and outputs the line loss data of the distribution network in a future period according to the weather factor sequence; The construction process of the line loss prediction model includes: Obtaining a sequence of historical weather factors in the areas where the distributed photovoltaics are located in several historical periods, and historical line loss data of the distribution network in each historical period; Performing modal decomposition on the historical line loss data to generate modal component data sets of each of the historical line loss data; Constructing a training data set according to the historical weather factor sequence and the modal component data set; An initial line loss prediction model to be trained is constructed based on a long short-term memory neural network; The initial line loss prediction model is trained according to the training data set, and during the training process, the prediction accuracy of the initial line loss prediction model is determined according to the prediction results output by the initial line loss prediction model. When the prediction accuracy reaches a preset threshold, the training is terminated to generate the line loss prediction model.
8. A line loss prediction device for a distribution network as claimed in claim 7, characterized in that: The data acquisition module acquires the historical weather factor sequences of the regions where the distributed photovoltaic systems are located in several historical periods, and the historical line loss data of the distribution network in each historical period, including: Obtain weather data of several types of weather factors in the areas where the distributed photovoltaics are located in several historical periods, and historical line loss data of the distribution network in each historical period; Using the random forest method, the characteristic importance of various weather factors is determined based on the weather data and the historical line loss data; Several types of weather factors whose characteristic importance is greater than a preset threshold are determined as target weather factors; The historical weather factor sequence is constructed according to the weather data of the target weather factor.
9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, a line loss prediction method for a distribution network as claimed in any one of claims 1 to 6 is implemented.
10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute a line loss prediction method for a distribution network as claimed in any one of claims 1 to 6.