Line loss electric quantity prediction method based on improved sparrow search algorithm
By improving the sparrow search algorithm to preprocess and select features from multi-source historical measurement data, and combining it with the least squares support vector machine model, the accuracy and robustness issues of line loss prediction in existing technologies have been solved. This has enabled efficient and accurate prediction and anomaly analysis of line loss in distribution networks, reducing power loss and improving the management level of power companies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-04-07
AI Technical Summary
Existing methods for predicting line loss power generation suffer from several drawbacks, including insufficient data cleaning and isolation, inadequate missing value repair and outlier identification, limited feature selection, reliance on human experience for prediction model parameters, difficulty in accurately predicting future trends in line loss power generation, and a lack of uncertainty assessment for prediction results, especially given the context of high-proportion renewable energy integration, complex topology, and data noise.
An improved sparrow search algorithm is used to preprocess multi-source historical measurement data, including denoising, smoothing, missing point repair, outlier handling, and normalization. The correlation of features is evaluated by combining Pearson and Spearman correlation coefficients and the maximum information coefficient. A least squares support vector machine model based on the improved sparrow search algorithm is established, and the parameters are optimized to find and construct an efficient line loss prediction model.
It enables efficient and accurate prediction of power loss in distribution networks, identifies anomalies, analyzes the causes, clarifies loss reduction measures, reduces power consumption, and improves the economic efficiency of distribution network operation.
Smart Images

Figure CN121808233A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for predicting power grid line loss. Background Technology
[0002] With the rapid development of the national economy, the high proportion of new energy grid connection, the explosive growth of electric vehicles and distributed energy storage, the 10kV distribution network has transformed from a passive network into an active network with deep coupling of "source-grid-load-storage". Electricity is a clean energy source and the most widely used secondary energy source. In the process of power generation, transmission, conversion and distribution, electricity inevitably suffers losses. Increased losses not only reduce power efficiency, but also have an adverse impact on power quality and grid operation. Line loss rate is an important economic indicator of the power system. Accurate analysis and management of line loss rate can effectively improve the technical and management level of power supply companies and achieve energy conservation and efficiency improvement.
[0003] The distribution network is a crucial component of the power system. The ever-increasing demand for electricity has led to a gradual increase in the structural complexity of distribution networks. In recent years, the automation level of distribution networks has been comprehensively improved, with the emergence of various automatic data acquisition devices. While providing reliable data for calculating distribution network line loss rates, this has also brought enormous challenges to data processing and efficient application. Although the accuracy of data acquisition and line loss rate calculation has improved, it is still impossible to accurately predict the future trend of line loss rates. Therefore, researchers in related fields have conducted extensive research on line loss and line loss rate prediction methods. Due to the complexity of the current distribution network structure and the numerous factors affecting line loss, existing line loss prediction methods are still insufficient in the face of high... When predicting line loss in 10kV distribution networks under conditions of proportional new energy access, complex topology, and data noise, the following shortcomings are commonly observed: the data cleaning process is isolated and fragmented, missing value repair and outlier identification are not fully utilized, and the temporal and spatial correlation information of distribution business leads to the loss of effective samples; the feature selection method is singular, and indicators such as linear correlation coefficient and information gain are difficult to simultaneously measure nonlinear, non-monotonic, and higher-order interaction relationships, easily omitting key features or introducing spurious features; the prediction model parameters rely on manual experience or brute-force grid search, resulting in a prominent contradiction between training time and accuracy; and there is a lack of quantitative assessment of the uncertainty of the prediction results, making it difficult to support the subsequent closed loop of line loss anomaly diagnosis and loss reduction decision-making. Summary of the Invention
[0004] The purpose of this invention is to address the problems of poor accuracy and robustness in existing line loss power prediction methods, and to propose a line loss power prediction method based on an improved sparrow search algorithm.
[0005] The line loss power prediction method based on the improved sparrow search algorithm described in this invention includes the following steps:
[0006] Obtain multi-source historical measurement data of the transformer area to be predicted and its upstream lines;
[0007] The multi-source historical measurement data is preprocessed to generate processed historical data;
[0008] The processed historical data is used to select characteristic factors, and the line loss characteristic data is selected to form the basic dataset;
[0009] A line loss prediction model based on an improved sparrow search algorithm was established, and the line loss prediction model was trained using a basic dataset to obtain an optimized line loss prediction model.
[0010] Input a subset of key features for the date to be predicted into the optimized line loss prediction model, and output the predicted line loss power for that date.
[0011] Furthermore, the multi-source historical measurement data includes historical line loss, historical active load, historical reactive load voltage quality indicators, harmonic content, meteorological information, holiday tags, distributed renewable energy output, and topology parameters.
[0012] Furthermore, the preprocessing of the multi-source historical measurement data includes:
[0013] Denoising and smoothing of multi-source historical measurement data;
[0014] Missing points in multi-source historical measurement data are repaired in both vertical and horizontal directions;
[0015] Outlier handling and repair for multi-source historical measurement data;
[0016] Normalization processing of multi-source historical measurement data.
[0017] Furthermore, for discontinuous missing points, the specific formula for horizontal repair is as follows:
[0018]
[0019] in, The missing data is what we are looking for; This is the data preceding the missing point; This is a data point following the missing point; Data from the same time point the day before the missing data point; This refers to data from the same time point one day after the missing data point.
[0020] Furthermore, for consecutive missing points, the specific formula for repairing them vertically is as follows:
[0021]
[0022] in, The missing data is what we are looking for; Data from the same time point two days prior to the missing point; Data from the same time point the day before the missing data point; Data at the same time point one day after the missing points; Data from the same time point two days after the missing point.
[0023] Furthermore, the formula for identifying outliers in multi-source historical measurement data is as follows:
[0024]
[0025] in, This refers to the data of each point to be determined in the multi-source historical measurement data.
[0026] Furthermore, the specific formula for normalizing multi-source historical measurement data is as follows:
[0027]
[0028] in, The data is after normalization; This is the original data; The maximum value in the original data; This is the minimum value in the original data.
[0029] Furthermore, the specific steps for selecting characteristic factors from the processed historical data include:
[0030] The Pearson correlation coefficient is used to measure the linear correlation between characteristic variables;
[0031] Spearman correlation coefficient is used to measure the nonlinear correlation between feature variables;
[0032] The maximum information coefficient method is used to assess the correlation between variables by calculating their joint probability.
[0033] Compared with the prior art, the present invention has the following advantages:
[0034] This invention enables efficient and accurate prediction of power loss in distribution networks, improves the robustness of prediction, identifies and analyzes the causes of anomalies, clarifies and implements technical and management measures to reduce losses, reduces power loss in distribution networks, and improves the economic efficiency of distribution network operation. It is of great significance to the management of power companies and the economic benefits of the company. Attached Figure Description
[0035] Figure 1 This is a flowchart of a line loss power prediction method based on an improved sparrow search algorithm, as described in Specific Implementation Method 1. Detailed Implementation
[0036] Specific Implementation Method 1: Combination Figure 1 This embodiment describes a method for predicting line loss power based on an improved sparrow search algorithm, which includes the following steps:
[0037] Obtain multi-source historical measurement data of the transformer area to be predicted and its upstream lines;
[0038] The multi-source historical measurement data is preprocessed to generate processed historical data;
[0039] The processed historical data is used to select characteristic factors, and the line loss characteristic data is selected to form the basic dataset;
[0040] A line loss prediction model based on an improved sparrow search algorithm was established, and the line loss prediction model was trained using a basic dataset to obtain an optimized line loss prediction model.
[0041] Input a subset of key features for the date to be predicted into the optimized line loss prediction model, and output the predicted line loss power for that date.
[0042] In this embodiment, multi-source historical measurement data of the transformer area to be predicted and its upstream lines are obtained; in order to meet the prediction accuracy requirements, the multi-source historical measurement data needs to have a sufficient time span, such as 30 days or more before the prediction date.
[0043] The multi-source historical measurement data is preprocessed;
[0044] This method, through case analysis, calculates that the most influential characteristic factors are historical line loss, historical active power load, and holiday factors.
[0045] Establish a prediction model based on the least squares support vector machine (LSSVM) of the improved sparrow search;
[0046] The classification prediction performance of Least Squares Support Vector Machine (LSSVM) is penalized by the initial parameters in the model. With kernel parameters The impact is significant, and it is difficult to find accurate parameter values through manual trial and error. In this implementation, SSA is used to find the optimal parameters of the model.
[0047] Parameter initialization; determine the size of the sparrow population, the maximum number of iterations, the number of sparrows that can sense danger; warning value and the ratio of discoverers to joiners.
[0048] SSA is a relatively stable group optimization algorithm, but the initial population in the original Sparrow Search algorithm is randomly generated and may be unevenly distributed in space, thus affecting the optimization effect of the algorithm. Sobol sequence can generate a uniform, low-discrepancy, high-quality distribution in a very short time. This method uses Sobol sequence to generate the initial population and maps it to the actual value range.
[0049] Set a fitness function and calculate the fitness values. Sort the fitness values from smallest to largest, corresponding to the increasingly worse position of the sparrow in the population; the minimum value corresponds to... The maximum value corresponds to ;
[0050] Using formula Update the discoverer's location;
[0051] in, The maximum number of iterations, For the first A sparrow Time of the first Dimensional information; It is a 1×d matrix of all 1s; These are random coefficients; This means that the surroundings are safe, and the sparrows can safely search for food. This means that if individual sparrows discover a predator, all sparrows need to leave the area and choose a new area to forage.
[0052] Using formula Update the location of the new members.
[0053] in, It is the optimal position occupied by the discoverer. It is currently the worst position in the entire system. It is a 1×d dimensional matrix randomly assigned the value 1 or -1. , This indicates that the sparrow with the worst fitness value cannot find food;
[0054] Once the danger is realized, the formula can be used. Perform position updates and calculate fitness values.
[0055] in, This represents the current best position in the population. It is an extremely small constant, used to ensure that the denominator in the formula is not zero. It is a random number and [-1,1]; This is the current fitness value of the individual sparrow. It is the optimal fitness value in the current population. It is the worst fitness value in the current population.
[0056] This paper utilizes the tournament selection algorithm to address the local convergence problem caused by population decline in the later stages of the SSA (Spoken Sparrow Algorithm) computation. Assume the initial sparrow population size is... After one calculation, the number of remaining individuals is A fixed number of individuals are randomly selected from the remaining individuals. Each individual is evaluated, and its fitness value is calculated. Keep the individual with the best fitness value and repeat the above steps. At this point, the sparrow population size remains the same as initially.
[0057] Using formula The current population is mutated, and the fitness values of individuals in the mutated population are calculated. Individuals with better fitness values are retained.
[0058] Record the current optimal solution in the loop and determine whether to stop; if the stopping condition is not met, start the search again until the condition is met and the optimal parameter value is obtained;
[0059] The pre-base dataset is divided into a training set, a validation set, and a test set. The training set is used to determine the parameters of the least squares support vector machine prediction model. The validation set is used to test the prediction performance of the least squares support vector machine prediction model. The model is then calibrated to obtain the optimal prediction model. The test set is used to predict line loss power.
[0060] Construct the optimal decision function in a high-dimensional space. ,in As a mapping function, it maps the original training set data. Mapped to a higher-dimensional space; The weight vector determines the direction of the decision boundary in high-dimensional space; The bias term determines the position of the decision boundary in high-dimensional space;
[0061] The constraints are as follows: , ,in For penalty parameters;
[0062] By solving for the weights and biases using the Larrange multiplier method, a nonlinear approximation function for the LSSVM on the training dataset is obtained. , where kernel function To satisfy Mercer's arbitrary symmetric functions, For Lagrange multipliers;
[0063] The optimized line loss prediction model is obtained;
[0064] The test set data is input into the optimal prediction model to perform error analysis and evaluation on the prediction results, and the model prediction performance evaluation index is used.
[0065] Using mean absolute percentage error Root mean square error Two evaluation metrics are used to assess the model's predictive performance, among which, To predict the number of samples, for The predicted value at any given time; for The true value of a moment;
[0066] The optimized line loss prediction model is used to predict line loss power consumption.
[0067] The line loss prediction method based on the improved sparrow search algorithm described in this embodiment can efficiently and accurately predict the line loss of the distribution network, identify the causes of anomalies, clarify and implement technical and management loss reduction measures, reduce the power loss of the distribution network, and improve the economic efficiency of the distribution network operation. It is of great significance to the management of power companies and the economic benefits of the company.
[0068] Specific Implementation Method Two: This implementation method further defines the line loss power prediction method based on the improved sparrow search algorithm described in Specific Implementation Method One. In this implementation method, the multi-source historical measurement data includes historical line loss, historical active load, historical reactive load voltage quality index, harmonic content, meteorological information, holiday tags, distributed renewable energy output, and topology parameters.
[0069] Specific Implementation Method Three: This implementation method further defines the line loss power prediction method based on the improved sparrow search algorithm described in Specific Implementation Method One. In this implementation method, the preprocessing of the multi-source historical measurement data includes:
[0070] Denoising and smoothing of multi-source historical measurement data;
[0071] Missing points in multi-source historical measurement data are repaired in both vertical and horizontal directions;
[0072] Outlier handling and repair for multi-source historical measurement data;
[0073] Normalization processing of multi-source historical measurement data.
[0074] In this embodiment, multi-source historical measurement data sequences are used. Decomposed into One intrinsic mode function (IMF). , To ensure that each decomposed sequence is a modal component with a finite bandwidth and a center frequency, and that the sum of the estimated bandwidths of all modes is minimized, with the constraint that the sum of all modes is equal to the original signal, the VMD constrained variational model is as follows:
[0075] ;
[0076] in, For each modal function, The center frequency of each modal function; It is the Diclave function
[0077] The optimal solution is found using the Lagrange method, with a quadratic penalty factor introduced. and Lagrange multipliers We construct an augmented Lagrangian function to transform the above constrained variational problem into an unconstrained variational problem;
[0078] The optimal solution of the Lagrange augmented function is obtained by using the alternating direction multiplier algorithm (fixing two other variables and updating one of them), thereby decomposing the input raw historical data into... One IMF component;
[0079]
[0080] Based on the equivalence of the Fourier transform, the above equation is transformed into the frequency domain, and the Parseval theorem is used to solve it in the frequency domain.
[0081]
[0082] Differentiating the above equation, we get:
[0083]
[0084] Similarly, using the center frequency expression, the center of the current modal power spectrum can be obtained as:
[0085]
[0086] After decomposing the input historical data sequence, the correlation between each mode and the source data is determined, and irrelevant modes are removed as noise.
[0087] A combined horizontal and vertical approach is used to process missing data points in multi-source historical measurement data caused by abnormal line maintenance or sensor malfunctions.
[0088] Specific Implementation Method Four: This implementation method further defines the line loss power prediction method based on the improved sparrow search algorithm described in Specific Implementation Method Three. In this implementation method, the specific formula for horizontal repair of discontinuous missing points is as follows:
[0089]
[0090] in, The missing data is what we are looking for; This is the data preceding the missing point; This is a data point following the missing point; Data from the same time point the day before the missing data point; This refers to data from the same time point one day after the missing data point.
[0091] Specific Implementation Method Five: This implementation method further defines the line loss power prediction method based on the improved sparrow search algorithm described in Specific Implementation Method Three. In this implementation method, the specific formula for vertical repair of consecutive missing points is as follows:
[0092]
[0093] in, The missing data is what we are looking for; Data from the same time point two days prior to the missing point; Data from the same time point the day before the missing data point; Data at the same time point one day after the missing points; Data from the same time point two days after the missing point.
[0094] In this embodiment, a vertical processing method is used for consecutive missing points, and the weighted average of line loss power at the same time several days before and after the missing point is used to replace the missing point data.
[0095] Specific Implementation Method Six: This implementation method further defines the line loss power prediction method based on the improved sparrow search algorithm described in Specific Implementation Method Five. In this implementation method, the outlier judgment formula for multi-source historical measurement data is:
[0096]
[0097] in, This refers to the data of each point to be determined in the multi-source historical measurement data.
[0098] In this embodiment, an empirical threshold is set to filter suspected abnormal data in multi-source historical measurement data. Data exceeding 1.2 times the average of the same time point of the four days before and after is considered suspected abnormal data, and data less than 0.8 times the average of the same time point of the four days before and after is considered suspected abnormal data. The difference in load between two adjacent sampling points other than the suspected abnormal data point on the same day is calculated and recorded as the difference sequence. If the load difference between a suspected abnormal data point and the two points before and after it is greater than any value in the difference sequence, then the data at that point is determined to be abnormal; the data determined to be abnormal are removed, and vertical or horizontal methods are used for repair.
[0099] Specific Implementation Method Seven: This implementation method further defines the line loss power prediction method based on the improved sparrow search algorithm described in Specific Implementation Method Three. In this implementation method, the specific formula for normalizing multi-source historical measurement data is as follows:
[0100]
[0101] in, The data is after normalization; This is the original data; The maximum value in the original data; This is the minimum value in the original data.
[0102] Specific Implementation Method Eight: This implementation method further defines the line loss power prediction method based on the improved sparrow search algorithm described in Specific Implementation Method Three. In this implementation method, the specific steps for selecting characteristic factors from the processed historical data include:
[0103] The Pearson correlation coefficient is used to measure the linear correlation between characteristic variables;
[0104] Spearman correlation coefficient is used to measure the nonlinear correlation between feature variables;
[0105] The maximum information coefficient method is used to assess the correlation between variables by calculating their joint probability.
[0106] In this implementation, the Pearson correlation coefficient is used to measure the linear correlation between the feature variables:
[0107]
[0108] in It is the number of samples; Representative characteristics; Represents the target variable; Representative sample The average value; Represents the target variable The average value; Pearson correlation coefficient The range is from -1 to 1; the larger the absolute value of the correlation coefficient, the stronger the correlation between the variables; the smaller the absolute value, the weaker the correlation.
[0109] Spearman correlation coefficient is used to measure the nonlinear correlation between variables;
[0110]
[0111] in, It is the sample size; first, consider the two variables. and The data is sorted by size. Spearman correlation coefficient is the difference in ranks between two groups of variables after sorting from smallest to largest. The range is from -1 to 1; the larger the absolute value of the correlation coefficient, the stronger the correlation between the variables; the smaller the absolute value, the weaker the correlation.
[0112] The maximum information coefficient (MIC) method is used to assess the correlation between variables by calculating the joint probability of the variables.
[0113] To familiarize ourselves with the sample features, we use an m x n grid to partition the data space and calculate... and The probability distribution in each grid, even if it falls on the th grid. The frequency of data points in the grid is used as The estimate makes it fall into the first place. The frequency of data points in a row as Similarly, the estimate is obtained. The estimation process involves calculating the mutual information of random variables X and Y, then using a normalization factor to transform the mutual information values to the (0,1) interval. Finally, the grid resolution that maximizes the normalized mutual information is found and used as the metric for the MIC.
[0114] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for predicting line loss power consumption based on an improved sparrow search algorithm, characterized in that, Includes the following steps: Obtain multi-source historical measurement data of the transformer area to be predicted and its upstream lines; The multi-source historical measurement data is preprocessed to generate processed historical data; The processed historical data is used to select characteristic factors, and the line loss characteristic data is selected to form the basic dataset; A line loss prediction model based on an improved sparrow search algorithm was established, and the line loss prediction model was trained using a basic dataset to obtain an optimized line loss prediction model. Input a subset of key features for the date to be predicted into the optimized line loss prediction model, and output the predicted line loss power for that date.
2. The method for predicting line loss power consumption based on an improved sparrow search algorithm according to claim 1, characterized in that, The multi-source historical measurement data includes historical line loss, historical active load, historical reactive load voltage quality indicators, harmonic content, meteorological information, holiday tags, distributed renewable energy output, and topology parameters.
3. The method for predicting line loss power based on an improved sparrow search algorithm according to claim 1, characterized in that, Preprocessing of the multi-source historical measurement data includes: Denoising and smoothing of multi-source historical measurement data; Missing points in multi-source historical measurement data are repaired in both vertical and horizontal directions; Outlier handling and repair for multi-source historical measurement data; Normalization processing of multi-source historical measurement data.
4. The method for predicting line loss power based on an improved sparrow search algorithm according to claim 3, characterized in that, For discontinuous missing points, the specific formula for horizontal repair is as follows: in, The missing data is what we are looking for; This is the data preceding the missing point; This is a data point following the missing point; Data from the same time point the day before the missing data point; This refers to data from the same time point one day after the missing data point.
5. The method for predicting line loss power based on an improved sparrow search algorithm according to claim 3, characterized in that, For consecutive missing points, the specific formula for repairing them in the vertical direction is as follows: in, The missing data is what we are looking for; Data from the same time point two days prior to the missing point; Data from the same time point the day before the missing data point; Data at the same time point one day after the missing points; Data from the same time point two days after the missing point.
6. The method for predicting line loss power based on an improved sparrow search algorithm according to claim 5, characterized in that, The formula for identifying outliers in multi-source historical measurement data is as follows: in, This refers to the data of each point to be determined in the multi-source historical measurement data.
7. The method for predicting line loss power based on an improved sparrow search algorithm according to claim 3, characterized in that, The specific formula for normalizing multi-source historical measurement data is as follows: in, The data is after normalization; This is the original data; The maximum value in the original data; This is the minimum value in the original data.
8. The method for predicting line loss power based on an improved sparrow search algorithm according to claim 1, characterized in that, The specific steps for selecting characteristic factors from processed historical data include: The Pearson correlation coefficient is used to measure the linear correlation between characteristic variables; Spearman correlation coefficient is used to measure the nonlinear correlation between feature variables; The maximum information coefficient method is used to assess the correlation between variables by calculating their joint probability.