Power line loss calculation and prediction method based on deep learning and error correction

By combining convolutional neural network (CNN), support vector regression (SVR) and bidirectional long and short-term memory network (BiLSTM), the problem of complex and inefficient traditional line loss calculation methods is solved, and efficient and accurate line loss is achieved calculate.

CN119438750APending Publication Date: 2025-02-14TAIAN POWER SUPPLY CO OF STATE GRID SHANDONG ELECTRIC POWER CO +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411462968.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-20
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Traditional linear loss calculation methods rely on a large number of electrical parameters, the calculation process is complex and the accuracy is not high, and the existing machine learning-based methods are relatively inefficient.

Method used

The linear loss calculation model combining CNN, SVR and BiLSTM is used to improve the accuracy and efficiency of the calculation through feature extraction, model construction, error correction and hyperparameter optimization of power data.

Benefits of technology

Efficient and accurate line loss calculations are realized, the complexity and inefficiency of traditional methods are overcome, and the robustness and calculation accuracy of the model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119438750A_ABST
    Figure CN119438750A_ABST
Patent Text Reader

Abstract

The invention discloses a power line loss calculation and prediction method based on deep learning and error correction, and relates to the technical field of power line loss calculation, and the method specifically comprises the steps of power data information collection, data cleaning and preprocessing, data feature extraction, model building, error correction and precision improvement, and hyper-parameter optimization. According to the method, the advantages of support vector regression and a bidirectional long short-term memory network are fused, and a CNN-BiLSTM-SVR calculation model with high robustness is constructed through deep mining and effective utilization of related data in a power system; the problems of complexity and low efficiency of the traditional line loss calculation method in processing large-scale data are solved by introducing a deep learning technology, especially BiLSTM; error correction is carried out on the preliminary calculation result of the model through SVR, the accuracy of line loss calculation is further improved, the efficiency of line loss calculation is improved, the accuracy of the calculation result is ensured, and powerful technical support is provided for optimization management of a power system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a power line loss calculation technology, and in particular to a power line loss calculation and prediction method based on deep learning and error correction. Background Art

[0002] Power line loss refers to the energy loss and loss generated in various links such as power transmission, transformation, distribution and marketing. These losses specifically include active power loss, reactive power loss and voltage loss. Power line loss is mainly caused by the need for current to overcome the resistance and magnetic field of the conductor during transmission, such as lines and transformer copper wire windings, which results in energy loss. These losses are dissipated in the form of heat energy and are inevitable energy losses in the power grid. In the field of power systems, line loss calculation, as an important link in the operation and management of power systems, is of great significance for optimizing resource allocation, improving economic benefits and ensuring the stable operation of power systems. To this end, a method is needed to quickly and accurately calculate line loss in a short period of time.

[0003] At present, line loss calculation is still mainly based on traditional calculation methods, which often rely on a large number of electrical parameters. The calculation process is complicated and cumbersome, and there are deficiencies in data processing accuracy and efficiency. In recent years, with the development of artificial intelligence technology, especially the application of deep learning methods, new ideas have been provided for solving complex problems in line loss calculation. Long short-term memory network (LSTM) has been widely used in many fields such as power load forecasting due to its advantages in processing time series data. However, a single LSTM model still has certain limitations when processing line loss calculation, especially in capturing local features and dealing with nonlinear problems. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a line loss calculation model combining CNN, SVR and BiLSTM to ensure the accuracy and efficiency of the calculation, in view of the problems faced by traditional calculation methods and existing machine learning-based calculation methods, such as reliance on a large number of electrical parameters, low accuracy and low efficiency.

[0005] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0006] A method for calculating and predicting power line loss based on deep learning and error correction, the steps of which include (1) power data information collection; (2) data cleaning and preprocessing; (3) data feature extraction; (4) model building; (5) error correction and accuracy improvement; (6) hyperparameter optimization; (1) power data information collection; (2) data cleaning and preprocessing; In order to achieve the above purpose, the measures taken by the present invention are:

[0007] 1) Power data information collection: mainly through the sensors and measuring equipment installed in substations, distribution cabinets and switch stations, transmission lines, power plants and other nodes to monitor the current and voltage parameters in real time, and use data acquisition systems, wired / wireless communication technologies and cloud platforms to collect, process and transmit data. Smart meters are also important equipment to realize the real-time collection of user electricity consumption information, together forming a complete power data collection system.

[0008] The power data includes: substation static data and operation data, specifically: substation capacity, substation age, number of users in the substation, total capacity of users in the substation, number of low-voltage residential users in the substation, power supply, daily average active power, daily average reactive power, power factor, and line loss rate.

[0009] 2) Data cleaning and preprocessing: In the obtained substation power data, select the substations with line loss rates in a reasonable range to avoid poor model training results due to substation selection problems. Then, in the selected substations, use the mean filling method to handle missing values ​​in the data, and choose to use the median of each column to replace abnormal data points.

[0010] 3) Data feature extraction: First, the convolutional neural network (CNN) is used to perform preliminary feature extraction on the data. The convolution layer of the CNN is responsible for extracting local features from the power data, and the maximum pooling layer is used for downsampling, thereby reducing the data dimension, retaining key features, and reducing the risk of overfitting.

[0011] As a deep learning model, CNN has the ability to automatically extract hierarchical features. It reduces the number of parameters in the neural network through the use of convolution kernels, effectively avoids overfitting, and improves computational efficiency. The structure of CNN mainly includes convolution layer, pooling layer, fully connected layer, input layer and output layer. Figure 1 shown.

[0012] 1D-CNN (one-dimensional convolutional neural network) is often applied to fixed-length data segments to perform feature extraction tasks. During the prediction process, the model effectively captures the local feature information of time series data through its combination of one-dimensional convolutional layers and pooling layers. This structure makes 1D-CNN very suitable for analyzing and processing data that needs to focus on local temporal patterns or sequence characteristics.

[0013] In the convolution layer, the convolution kernel slides along the input data and performs weighted summation on the local area to extract feature information. In order to maintain the spatial dimension of the data, padding techniques are usually used and bias terms are introduced. This process often uses activation functions such as ReLU to increase nonlinearity, allowing the model to learn more complex features.

[0014] After the data passes through the convolution layer, it is sent to the pooling layer for pooling operation. Pooling operation reduces the amount of calculation by reducing the spatial dimension of the data and controls the risk of overfitting. This method uses maximum pooling, that is, the maximum value in a local area is selected as the representative value of the area. This processing not only retains important feature information, but also simplifies the data structure.

[0015] The pooling operation reduces the amount of computation by reducing the spatial dimension of the data and controls the risk of overfitting. This method uses maximum pooling, which selects the maximum value in a local area as the representative value of the area. This processing not only retains important feature information but also simplifies the data structure.

[0016] 4) Model selection and construction: In the line loss calculation method of the present invention, model selection and construction are the core links, aiming to accurately calculate the line loss in the power system through machine learning technology. Considering the nonlinearity, dynamic change characteristics and long-term and short-term dependencies of time series data, LSTM is preferred.

[0017] LSTM is a special recurrent neural network (RNN) that uses a gating mechanism to solve the gradient vanishing and gradient exploding problems in long sequence training and effectively capture long-term dependencies. The structure of LSTM mainly consists of three gates: input gate i t 、Forget gate t and output gate O t , and a memory unit C t The LSTM unit structure is as follows Figure 2 shown.

[0018] LSTM units can deeply explore the relationship between the previous and next items in sequence data, and are very suitable for processing time series data. Its calculation steps include updating the input state, gate state, memory state, and output state. The formula is as follows:

[0019] a) Input status.

[0020] g t =tanh(W ig x t +b ig +W hc h t-1 +b hg ) (1)

[0021] b) Gating state.

[0022] i t =σ(W ij x t +b ii +W hi h t-1 +b hi ) (2)

[0023] f t =σ(W if x t +b if +W hf h t-1 +b hf ) (3)

[0024] O t =σ(W io x t +b io +W ho h t-1 +b ho ) (4)

[0025] c) Memory status.

[0026] C t =f t ×C t-1 +i t ×g t (5)

[0027] d) Output status.

[0028] h t =O t ×tanh(C t ) (6)

[0029] Where: tanh(·) represents the hyperbolic tangent function; W is the gate weight vector; b is the bias term. From equations (1)-(6), it can be seen that LSTM considers the correlation between data while making regression predictions, and makes full use of the nonlinear effects of data object analysis, so the prediction effect is usually ideal.

[0030] Although LSTM performs well in regression prediction, it mainly focuses on historical information to predict the future. In order to consider both the previous and next information, BiLSTM is introduced.

[0031] The BiLSTM structure is as follows Figure 3As shown in the figure, its structure contains two LSTM layers running in parallel: one advances forward along the positive time axis, and the other processes the time series in reverse. The two operate independently but make collaborative predictions. The LSTM layers in these two directions feed into the final output layer together, so that the model can integrate all the temporal features of the past (early information of the sequence) and the future (later information of the sequence). The first layer of LSTM is responsible for parsing the forward time order features of the sequence, while the second layer of LSTM traverses the same data sequence in reverse order to capture dependencies in another dimension. More importantly, each layer of LSTM units not only passes its internal state (hidden state) to the adjacent units on the time axis, but also affects the input of the subsequent LSTM layer, thereby building an efficient communication mechanism between different levels that not only includes sequence dynamics but also integrates bidirectional information.

[0032] 5) Error correction and accuracy improvement: In order to further reduce the calculation error, the support vector regression (SVR) model is combined to correct the errors of the BiLSTM calculation results.

[0033] SVR has significant advantages in dealing with nonlinearity and non-stationarity of data. It maps data to high-dimensional space through kernel functions to find the inherent laws and relationships between data. SVR has excellent generalization ability and is robust to outliers, so it has high prediction accuracy.

[0034] SVR transforms the nonlinear model into a high-dimensional linear regression model and optimizes the model through the principle of structural risk minimization. In the high-dimensional feature space, the inner product operation is implemented through the kernel function. The SVR used in this case adopts the radial basis kernel function.

[0035] In summary, the calculation model of the present invention uses CNN, SVR, and BiLSTM. The model is divided into two parts. The first part is the CNN-BiLSTM model, and the second part is the SVR model. The first part preliminarily calculates the line loss, and the second part corrects the error of the calculated value. The model structure diagram is shown in Figure 4 .

[0036] 6) Hyperparameter optimization: In the process of calculating the line loss of training data, grid search is applied to find suitable parameters to optimize the calculation effect of the model.

[0037] Grid Search is a search algorithm for hyperparameter optimization that systematically enumerates the specified parameter values ​​to find the optimal hyperparameter combination. The principle is mainly the following four steps: a) Define the parameter grid: First, you need to define a parameter range or a set of candidate values ​​for each hyperparameter to be optimized. The combination of these parameter ranges and candidate values ​​will form a parameter grid. b) Traverse the parameter grid: The grid search method will traverse each set of hyperparameter combinations in the parameter grid. For each set of hyperparameters, a model will be trained and its performance will be evaluated on the validation set. c) Evaluate model performance: Evaluate the performance of the model on the validation set, usually using some evaluation indicator (the present invention uses negative mean square error as an indicator) to measure. d) Select the optimal hyperparameters: Select the hyperparameter combination corresponding to the model with the best performance on the validation set as the optimal hyperparameter.

[0038] The final model uses the grid search method to determine the hyperparameters, which can make the model achieve a better effect.

[0039] 7) Model verification and evaluation: Import the data set, calculate the line loss using the hyperparameters after model grid search, and demonstrate the model effect through comparison charts of true values ​​and calculated values ​​and evaluation indicators (mean absolute error, root mean square error, and degree of fit).

[0040] Mean absolute error It is used to measure the average difference between the predicted value and the true value. The smaller the MAE, the better the model performance. It reflects the error size in the model prediction. The smaller the RMSE, the more accurate the model. Indicates the model's ability to explain the data, R 2 The closer it is to 1, the better the model fit is and the smaller the difference between the predicted and observed values ​​is.

[0041] This study also compares the single model with the proposed comprehensive model to verify the performance advantage of model fusion. Through this comparative analysis, we can prove the performance improvement of the fused model in calculating line loss.

[0042] 8) Ablation Experiments: In order to confirm the effectiveness of each component in the model, we also implemented ablation experiments to show the specific contribution of each module to the overall performance.

[0043] In step 2 above, all collected data are organized into an Excel table, and the mean filling method is used to deal with missing values ​​in the data. The median of each column is selected to replace abnormal data points. In order to eliminate the differences caused by different data dimensions and reduce the adverse effects of data with large numerical spans on the training process, the original data is normalized. The normalization formula used is as follows:

[0044]

[0045] In the formula, x is the data before normalization; x * Represents the data after normalization of the sample; x max is the maximum value of the sample; x min is the sample minimum value.

[0046] The beneficial effects of the present invention are:

[0047] The present invention provides a new line loss calculation method, which combines the advantages of support vector regression and bidirectional long short-term memory network, and constructs a highly robust CNN-BiLSTM-SVR calculation model by deeply mining and effectively utilizing relevant data in the power system; solves the limitations of traditional methods: by introducing deep learning technology, especially BiLSTM, overcomes the complexity and inefficiency of traditional line loss calculation methods when processing large-scale data; improves calculation accuracy: uses SVR to correct errors in the preliminary calculation results of the model to further improve the accuracy of line loss calculation; enhances model robustness: by integrating the spatial feature extraction capability of CNN and the time series processing capability of BiLSTM, a robust calculation model is constructed; optimizes model parameters: uses the grid search method to optimize hyperparameters to ensure the optimal performance of the model under different conditions. This model not only improves the efficiency of line loss calculation, but also ensures the accuracy of the calculation results, providing strong technical support for the optimization management of the power system. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a convolutional neural network structure;

[0049] Figure 2 Schematic diagram of LSTM unit structure;

[0050] Figure 3 This is a schematic diagram of the BiLSTM network structure;

[0051] Figure 4 It is the model structure diagram;

[0052] Figure 5 Display of line loss calculation results;

[0053] Figure 5 middle:

[0054] (a) SVR calculation results (b) BiLSTM calculation results

[0055] (c) CNN-BiLSTM calculation results (d) The calculation results of the present invention DETAILED DESCRIPTION

[0056] The present invention will be further described below in conjunction with the accompanying drawings:

[0057] The process of the method of the present invention simply comprises the following steps:

[0058] 1) Acquisition of power data information; 2) Data cleaning and preprocessing; 3) Building a computational model; 4) Hyperparameter optimization; 5) Results and evaluation; 6) Ablation experiment.

[0059] The specific implementation process of this method is as follows:

[0060] Step 1: Obtaining power data information; the power data includes: static data and operation data of the substation, specifically: substation capacity, substation age, number of users in the substation, total capacity of users in the substation, number of low-voltage residential users in the substation, power supply, daily average active power, daily average reactive power, power factor, line loss rate, etc.

[0061] Step 2: Data cleaning and preprocessing; All data are organized into an Excel table, and the mean filling method is used to deal with missing values ​​in the data. The median of each column is selected to replace abnormal data points. In order to eliminate the differences caused by different data dimensions and reduce the adverse effects of data with large numerical spans on the training process, the original data is normalized. The normalization formula used is as follows:

[0062]

[0063] In the formula, x is the data before normalization; x* represents the data after the sample is normalized; x max is the maximum value of the sample; x min is the sample minimum value.

[0064] Step 3: Build the CNN-BiLSTM-SVR model; the model structure diagram is as follows Figure 4 As shown. The normalized two-dimensional data array is converted into a three-dimensional array. This conversion is to meet the specific requirements of BiLSTM in sequence data processing later, ensuring that the model can correctly handle time series prediction tasks. After that, the data set is divided into training set, validation set and test set in a ratio of 7:1:2. The training set data is imported into the calculation model, and the line loss is calculated using the model default parameters.

[0065] a) Extraction of data features

[0066] The first thing to build is the CNN module, which performs preliminary feature extraction on the data. The convolution layer of CNN is responsible for extracting local features from the power data, and downsampling is performed using the maximum pooling layer to reduce the data dimension, retain key features, and reduce the risk of overfitting.

[0067] In the CNN model, data is first input into the convolutional layer, which uses the convolution kernel to perform convolution operations on the data to extract feature information. In this process, the filter slides along the input data at a set step size and performs a weighted summation on the local area it covers. In order to maintain the spatial dimension of the data, padding techniques are often used, and bias terms are usually introduced to further adjust the output of the convolutional layer. The calculation is as follows:

[0068] C h =f(W h X c +b) (9)

[0069] Where: W h is the weight matrix for convolution, i.e., the convolution kernel; X c is the data feature matrix; b is the added bias; f is the activation function, generally the ReLU function, and the feature matrix extracted after convolution is C h .

[0070] After the data passes through the convolution layer, it is sent to the pooling layer for pooling operation. Pooling operation reduces the amount of calculation by reducing the spatial dimension of the data and controls the risk of overfitting. This method uses maximum pooling, that is, the maximum value in a local area is selected as the representative value of the area. This processing not only retains important feature information, but also simplifies the data structure.

[0071] b) Preliminary calculation model

[0072] Then build the BiLSTM module and input the data processed by CNN into it, and perform the following calculations:

[0073] g t =tanh(W ig x t +b ig +W hc h t-1 +b hg ) (10)

[0074] i t =σ(W ij x t +b ii +W hi h t-1 +b hi ) (11)

[0075] f t =σ(W if x t +b if +W hf h t-1 +b hf ) (12)

[0076] O t =σ(W io x t +b io +W ho h t-1 +b ho ) (13)

[0077] C t =f t ×C t-1 +i t ×g t (14)

[0078] h t =O t ×tanh(C t ) (15)

[0079] Where: tanh(·) represents the hyperbolic tangent function; W is the gate weight vector; b is the bias term.

[0080] The structure of BiLSTM is as follows Figure 3 As shown in the figure, it consists of two LSTM layers connected in parallel: one layer advances forward along the time series, and the other layer processes backward. Although the two layers operate independently, they work together to provide information for the final output layer. This design enables the model to fully integrate the early and late information of the sequence, thereby capturing the time series characteristics more accurately. The forward LSTM layer is responsible for extracting the characteristics of the sequence from the past to the present, while the reverse LSTM layer analyzes the characteristics from the present to the past. Together, the two reveal the dual dependency of the data sequence. Each LSTM unit not only passes the hidden state to the neighboring units on the timeline, but also affects the input of the subsequent LSTM layer, forming an efficient information exchange mechanism that not only includes the dynamic changes of the sequence, but also integrates the two-way information flow.

[0081] c) Error correction and accuracy improvement

[0082] After the above process, a preliminary line loss calculation value is obtained. In the experiment, it is found that there is still a certain error between the calculation result of the BiLSTM model and the actual value, so SVR is introduced to correct the error of the calculation result of the BiLSTM model and further reduce the calculation error.

[0083] The difference sequence between the BiLSTM model line loss calculation value and the actual value is selected as the SVR training data to correct the error term in each unit time and train a model with a higher degree of fit, so as to make the result more accurate.

[0084] In SVR, the nonlinear model is mapped to a high-dimensional space through a kernel function and converted into a linear regression model. The expression of this conversion can be expressed as:

[0085]

[0086] Where: ω and b are model parameters.

[0087] According to the principle of structural risk minimization, we constructed a risk function, which is expressed as follows:

[0088]

[0089] Where: l is the loss function; ||ω|| 2 is structural risk; i is the output vector; c is the penalty coefficient.

[0090] To find the minimum of the risk function, we use the following formula:

[0091]

[0092] Where: i and is the slack variable; ε is the loss coefficient.

[0093] In high-dimensional feature space, the inner product operation can be implemented through the kernel function. In order to facilitate the calculation, the Lagrangian function is introduced to transform the original problem into a dual problem, and the nonlinear function can be obtained as follows:

[0094]

[0095] Where: α i and is the Lagrange multiplier; K(x i ,x) is the kernel function. The kernel function maps the low-dimensional nonlinear function to the high-dimensional space, so that the original nonlinear problem becomes a linear problem in the high-dimensional space. Choosing a suitable kernel function can avoid the curse of dimensionality. The SVR used in this case uses the radial basis kernel function, which is expressed as

[0096]

[0097] Where: g is the width of the radial basis kernel function.

[0098] After the SVR model, the error correction value and the BiLSTM calculation result are integrated to obtain the final line loss calculation value.

[0099] Step 4: Hyperparameter optimization: During the line loss calculation of the training data, grid search is applied to find suitable parameters to optimize the calculation effect of the model.

[0100] Grid search is a hyperparameter optimization technique that is used to search for the optimal combination of model hyperparameters. This method trains the model by defining a search range for each hyperparameter and exhaustively enumerating all possible parameter combinations within these ranges, and finally selects the parameter combination that optimizes the model performance. The detailed steps are as follows:

[0101] a) Selecting hyperparameters for optimization: First, determine the hyperparameters to be optimized. The hyperparameters to be optimized in the present invention include convolution kernel size, number of filters, number of units in the LSTM layer, batch size, number of training rounds, penalty parameters, and coefficients of the kernel function.

[0102] b) Determine the hyperparameter search range: Define a search range for each hyperparameter. The convolution kernel size range is [3, 5, 7], the number of filters range is [32, 64, 128], there are two LSTM layers, the number of units are [128, 256] and [32, 64] respectively, the batch size is [32, 64, 128], the number of training rounds is [400, 600, 800, 1000], the penalty parameter is [0.1, 10, 100], and the kernel function coefficient is [0.001, 0.01, 0.1].

[0103] c) Initialize the grid: Based on the defined hyperparameter search range, create a grid where each grid point represents a set of hyperparameter combinations.

[0104] d) Cross-validation: For each point on the grid (i.e., each set of hyperparameter combinations), use cross-validation (the present invention uses 5-fold cross-validation) to evaluate model performance. Specifically, the data set is divided into 5 folds, and then 4 folds are used as training sets, and the remaining fold is used as a validation set to train the model and evaluate its performance. Repeat this process 5 times, each time selecting a different fold as a validation set, and calculate the average of the 5 evaluation results as the model performance of this set of hyperparameter combinations.

[0105] e) Selecting the optimal parameter combination: Compare the model performance of all hyperparameter combinations, and select the parameter combination with the best performance (the present invention uses negative mean square error as an indicator) as the optimal parameter combination.

[0106] f) Evaluate the optimal model: Using the selected optimal parameter combination, train the model again (usually on the entire dataset, not just on the training set), and use an independent test set to evaluate the generalization performance of the model.

[0107] g) Apply the model: Finally, the trained optimal model can be used to make predictions or analyze new data.

[0108] The final parameter settings are shown in the following table:

[0109] Parameter name Parameter Value Convolution Kernel 3 filter 64 LSTM cell 1 256 LSTM Cell 2 64 Batch size 64 Number of training rounds 800 Penalty Parameters 0.1 Kernel function coefficients 0.001

[0110] Step 5: Results and evaluation: Import the data set and use the hyperparameter values ​​determined in step 4 to calculate the line loss. The effect of the model is presented through a comparison chart between the true value and the calculated value and evaluation indicators (mean absolute error, root mean square error, and degree of fit).

[0111] Mean absolute error It is used to measure the average difference between the predicted value and the true value. The smaller the MAE, the better the model performance. It reflects the error size in the model prediction. The smaller the RMSE, the more accurate the model. Indicates the model's ability to explain the data, R 2 The closer it is to 1, the better the model fit is and the smaller the difference between the predicted and observed values ​​is.

[0112] Figure 5 Figure (c) shows the calculation results of the CNN-BiLSTM in the first stage of the present invention (test set serial number 401-500). It can be observed that in the first stage, the training results of the CNN-BiLSTM model have converged, but there is still a certain deviation between the calculation results and the actual values, especially in the peak part of the test set, showing the limitations of CNN-BiLSTM in computing power. Therefore, it is necessary to carry out the work of the second stage to improve and supplement the deficiencies in the first stage.

[0113] In the second stage, a difference sequence is obtained by subtracting the actual line loss value from the output of the first stage model, and then the second stage data set is constructed. Subsequently, the support vector regression (SVR) is used to correct the data set, and the final result is the output of the CNN-LSTM-SVR model. Figure 5 Figure (d) shows the comparison between the calculation results of the CNN-LSTM-SVR model on the test set (serial number 401-500) and the real data. It can be clearly observed from the figure that the calculation results of the CNN-LSTM-SVR model are significantly more accurate than those of the CNN-BiLSTM model.

[0114] In addition, in order to verify the advantages of model fusion, this study conducted a comparative analysis between the single model and the proposed comprehensive model to demonstrate the performance improvement of the fused model. Figure 5 Figures (a) and (b) are the comparisons between the calculation results of the SVR and BiLSTM single models (test set numbers 401-500) and the real data. The following table compares the effects of the single model and the model of the present invention:

[0115] Model MAE RMSE <![CDATA[R 2 ]]> SVR 1.2606 1.8225 0.6843 BiLSTM 0.9216 1.5447 0.7732 Model of the present invention 0.7158 1.2945 0.8413

[0116] According to the data in the above table, in terms of the calculation results of the test set, compared with the deep learning BiLSTM model, the mean absolute error MAE of the model of the present invention is reduced by 0.2058, the root mean square error RMSE is reduced by 0.2502, and the degree of fit R 2 In addition, compared with the SVR model, the mean absolute error MAE decreased by 0.5448, the root mean square error RMSE decreased by 0.528, and the degree of fit R 2 It has increased by 0.157. Combined with the comparison Figure 5 Figures (a), (b) and (d) show that the model of the present invention has smaller error, higher fit, more precise calculation results and higher accuracy in calculating line loss compared with a single model.

[0117] Next, in order to confirm the effectiveness of each component in the model, we also implemented an ablation experiment to show the specific contribution of each module to the overall performance. The following table compares the model effects under the ablation experiment:

[0118] Model MAE RMSE R2 CNN-BiLSTM 0.8228 1.4307 0.8054 BiLSTM-SVR 0.8483 1.3926 0.8171 Model of the present invention 0.7158 1.2945 0.8413

[0119] The data analysis of the above two tables shows that the fusion of CNN layer and SVR significantly improves the calculation accuracy of the model. Compared with the CNN-BiLSTM model, the model of the present invention reduces the mean absolute error MAE by 0.107, the root mean square error RMSE by 0.1362, and the goodness of fit R 2 This result shows that the introduction of SVR effectively corrects the error and reduces the impact of the inherent error of the data on the calculation results, thereby improving the calculation accuracy of the model. Furthermore, when the model of the present invention is compared with the BiLSTM-SVR model, the mean absolute error MAE is reduced by 0.1325, the root mean square error RMSE is reduced by 0.0981, and the degree of fit R 2 It has increased by 0.0242. These data show that the addition of the CNN layer not only enhances the model's ability to process time series data and improves the accuracy of calculations, but also optimizes the overall performance and stability of the model. In general, it is precisely because of the addition of the CNN layer and SVR that the BiLSTM-based model has been significantly improved in terms of error rate, fit, and accuracy, thereby verifying the rationality and effectiveness of the model design of the present invention.

Claims

1. A method for calculating and predicting power line losses based on deep learning and error correction, characterized in that: The steps include (1) power data information collection; (2) data cleaning and preprocessing; (3) data feature extraction; (4) model construction; (5) error correction and accuracy improvement; (6) hyperparameter optimization; (1) Power data information collection: mainly through the sensors and measuring equipment installed in substations, distribution cabinets and switch stations, transmission lines, power plants and other nodes to monitor the current and voltage parameters in real time, and use the data acquisition system, wired / wireless communication technology and cloud platform to collect, process and transmit data; smart meters are also important equipment to realize the real-time collection of user electricity consumption information, together forming a complete power data collection system; (2) Data cleaning and preprocessing: In the obtained substation power data, select the substations with line loss rates in a reasonable range to avoid poor model training results due to substation selection problems. Then, in the selected substations, use the mean filling method to handle missing values ​​in the data and use the median of each column to replace abnormal data points. (3) Data feature extraction: First, the convolutional neural network (CNN) is used to perform preliminary feature extraction on the data. The convolutional layer of the CNN is responsible for extracting local features from the power data and downsampling using the maximum pooling layer, thereby reducing the data dimension, retaining key features, and reducing the risk of overfitting. (4) Model selection and construction: Use machine learning technology to accurately calculate the line loss in the power system. Considering the nonlinearity, dynamic change characteristics, and long-term and short-term dependencies of time series data, build a BiLSTM module and input the CNN-processed data into it; (5) Error correction and accuracy improvement: To further reduce the calculation error, the support vector regression (SVR) model is combined to correct the error of the BiLSTM calculation results; (6) Hyperparameter optimization: In the process of calculating the line loss of training data, the grid search method is used to find suitable parameters to optimize the calculation effect of the model; Find the optimal hyperparameter combination by systematically trying the specified parameter values.

2. The method for calculating and predicting power line loss based on deep learning and error correction according to claim 1, characterized in that: The power data described in step 1) includes: static data and operation data of the substation, specifically: substation capacity, substation age, number of users in the substation, total capacity of users in the substation, number of low-voltage residential users in the substation, power supply, daily average active power, daily average reactive power, power factor, and line loss rate.

3. The power line loss calculation and prediction method based on deep learning and error correction according to claim 1, characterized in that: In step 2 above, all collected data are organized into an Excel table, and the mean filling method is used to deal with missing values ​​in the data. The median of each column is selected to replace abnormal data points. In order to eliminate the differences caused by different data dimensions and reduce the adverse effects of data with large numerical spans on the training process, the original data is normalized. The normalization formula used is as follows: In the formula, x is the data before normalization; x * Represents the data after normalization of the sample; x max is the maximum value of the sample; x min is the sample minimum value.

4. The method for calculating and predicting power line loss based on deep learning and error correction according to claim 1, characterized in that: The BiLSTM structure consists of two LSTM layers running in parallel: one advances forward along the positive time axis, and the other processes the time series in reverse. The two operate independently but make collaborative predictions. The LSTM layers in these two directions feed into the final output layer together. In this way, the model can integrate all the temporal features of the early information of the sequence and the late information of the sequence. The first layer of LSTM is responsible for parsing the forward time order features of the sequence, while the second layer of LSTM traverses the same data sequence in reverse order to capture the dependency of another dimension.

5. The method for calculating and predicting power line loss based on deep learning and error correction according to claim 1, characterized in that: The calculation model of the present invention uses CNN, SVR, and BiLSTM. The model is divided into two parts. The first part is a CNN-BiLSTM model, and the second part is an SVR model. The first part preliminarily calculates the line loss, and the second part corrects the error of the calculated value.

6. The power line loss calculation and prediction method based on deep learning and error correction according to claim 1, characterized in that: In step (4), a BiLSTM module is constructed and the data processed by CNN is input into it. The calculation steps include updating the input state, gate state, memory state and output state. The formula is as follows: a) Input status g t =tanh(W ig x t +b ig +W hc h t-1 +b hg ) b) Gating state i t =σ(W ij x t +b ii +W hi h t-1 +b hi ) f t =σ(W if x t +b if +W hf h t-1 +b hf ) O t =σ(W io x t +b io +W ho h t-1 +b ho ) c) Memory status C t =f t ×C t-1 +i t ×g t d) Output status h t =O t ×tanh(C t ) Where: tanh(·) represents the hyperbolic tangent function; W is the gate weight vector; b is the bias term.

7. The method for calculating and predicting power line loss based on deep learning and error correction according to claim 1, characterized in that: In step (5), the difference sequence between the BiLSTM model line loss calculation value and the actual value is selected as the SVR training data to correct the error term in each unit time and train a model with a higher degree of fit, thereby making the result more accurate.

8. The method for calculating and predicting power line loss based on deep learning and error correction according to claim 7, characterized in that: In SVR, the nonlinear model is mapped to a high-dimensional space through a kernel function and converted into a linear regression model. The expression of this conversion can be expressed as: Where: ω and b are model parameters; According to the principle of structural risk minimization, we constructed a risk function, which is expressed as follows: Where: l is the loss function; ||ω|| 2 is structural risk; i is the output vector; c is the penalty coefficient; To find the minimum of the risk function, we use the following formula: Where: i and is the slack variable; ε is the loss coefficient; In high-dimensional feature space, the inner product operation can be implemented by the kernel function. In order to facilitate the calculation, the Lagrangian function is introduced to transform the original problem into a dual problem, and the nonlinear function can be obtained as follows: Where: α i and is the Lagrange multiplier; K(x i ,x) is the kernel function. The kernel function maps the low-dimensional nonlinear function to the high-dimensional space, so that the original nonlinear problem becomes a linear problem in the high-dimensional space. Choosing a suitable kernel function can avoid the dimensionality curse. The SVR used in this case uses the radial basis kernel function, which is expressed as Where: g is the width of the radial basis kernel function, After the SVR model, the error correction value and the BiLSTM calculation result are integrated to obtain the final line loss calculation value.

9. The method for calculating and predicting power line loss based on deep learning and error correction according to claim 1, characterized in that: In step (6), the detailed steps are as follows: a) Selecting hyperparameters for optimization: First, determine the hyperparameters to be optimized. The hyperparameters to be optimized in the present invention include convolution kernel size, number of filters, number of units in the LSTM layer, batch size, number of training rounds, penalty parameter, and coefficient of the kernel function; b) Determine the hyperparameter search range: Define a search range for each hyperparameter. The convolution kernel size range is [3, 5, 7], the number of filters range is [32, 64, 128], there are two LSTM layers, the number of units are [128, 256] and [32, 64] respectively, the batch size is [32, 64, 128], the number of training rounds is [400, 600, 800, 1000], the penalty parameter is [0.1, 10, 100], and the kernel function coefficient is [0.001, 0.01, 0.1]; c) Initialize the grid: Based on the defined hyperparameter search range, create a grid where each grid point represents a set of hyperparameter combinations; d) Cross-validation: For each set of hyperparameter combinations on the grid, 5-fold cross-validation is used to evaluate the model performance. Specifically, the dataset is divided into 5 folds, and then 4 folds are used as training sets and the remaining fold is used as a validation set to train the model and evaluate its performance. This process is repeated 5 times, each time a different fold is selected as the validation set, and the average of the 5 evaluation results is calculated as the model performance of this set of hyperparameter combinations; e) Select the optimal parameter combination: compare the model performance of all hyperparameter combinations and select the parameter combination with the best performance as the optimal parameter combination; f) Evaluate the optimal model: Use the selected optimal parameter combination to train the model again and use an independent test set to evaluate the generalization performance of the model; g) Apply the model: Finally, the trained optimal model can be used to make predictions or analyze new data.

Citation Information

Cited By

  • Method and device for generating sand and dust weather assimilation data by fusing AI algorithm re-optimization

    CN121479664A

  • Sand-dust weather assimilation data generation method and device based on fusion of AI algorithm re-optimization

    CN121479664B