Active power distribution network line loss calculation method, device, equipment and medium
By applying random matrix theory and Stacking integrated learning method in the distribution network, a data-mechanism hybrid drive line loss calculation model is established, and the problems of low line loss calculation accuracy and high dependence on data quality in the existing technology are solved, and a higher accuracy and adaptability line loss calculation is achieved.
Patent Information
- Application Number
- CN202510136047.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-05-30
AI Technical Summary
The existing distribution network wire loss calculation methods have low calculation accuracy and high dependence on data quality, making it difficult to effectively solve these problems in line loss calculation.
The correlation analysis based on random matrix theory is adopted to obtain the line loss characteristics with the strongest correlation with line loss rate, and the causal logic of the mechanism model and the prediction accuracy of the data model are fused through the model stacking Stacking ensemble learning method to establish a line loss calculation model driven by data-mechanism hybrid.
It improves the accuracy of line loss calculation, reduces the dependence on data quality, and can more accurately adapt to the active distribution network line loss calculation after multi-subject access.
Smart Images

Figure CN120067489A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of active distribution networks, and particularly to a method, device, equipment and medium for calculating line losses in an active distribution network. Background Art
[0002] In a new power system, the proportion of new energy generation has increased significantly. A large number of distributed power sources are connected to the distribution network. As the upper-layer leader, the distribution network and the lower-layer followers such as distributed power sources, charging piles, and energy storage power stations carry out games. The distribution network changes the control instructions by adjusting the electricity price and tie-line power, making the distribution network change from a passive network to an active network, resulting in the branch power flow direction changing from single-flow to bi-directional flow, thus making the calculation of line losses in the distribution network more difficult. Accurate calculation of line losses can better understand the actual operating conditions of the distribution network and achieve real-time monitoring and dynamic adjustment of line losses in the distribution network.
[0003] The existing methods for calculating line losses in distribution networks are mainly divided into two categories: mechanism models and data models. The traditional mechanism-driven line loss calculation methods are relatively mature and are still being continuously improved. Although the mechanism-driven line loss calculation methods have strong causal logic and low requirements for data quality, most of them use simplified models and empirical parameters, resulting in low calculation accuracy.
[0004] With the rapid development of data-driven technologies, data-driven line loss calculation methods have gradually been studied and proposed. Although the calculation accuracy of data-driven methods is high, the model parameters completely depend on data, which puts higher requirements on data quality and has a certain generalization risk.
[0005] Therefore, how to solve the problems of low calculation accuracy and high dependence on data quality in line loss calculation is still an urgent problem to be solved.
[0006] The information disclosed in this background art section is only intended to deepen the understanding of the overall background art of the present invention and should not be regarded as an admission or any form of implication that this information constitutes the prior art known to those skilled in the art. Summary of the Invention
[0007] The present invention provides a method, device, equipment and medium for calculating line losses in an active distribution network, thus effectively solving the problems in the background art.
[0008] To achieve the above object, the technical solution adopted by the present invention is: An active distribution network line loss calculation method, comprising the following steps:
[0009] Obtain the operation status data of the distribution network with distributed power sources connected in multiple time dimensions, and perform correlation analysis on the line loss characteristics of the active distribution network after the connection of distributed power sources based on the random matrix theory to obtain the line loss characteristics with the strongest correlation with the line loss rate;
[0010] According to the line loss characteristics, based on the mechanism model and data model of traditional line loss calculation, the causal logic of the mechanism model and the prediction accuracy of the data model are fused by using the model stacking Stacking integrated learning method, and a data-mechanism hybrid-driven line loss calculation model is established;
[0011] Taking the historical data of the active distribution network under the access of different entities as an example, the data-mechanism hybrid-driven line loss calculation model is analyzed, and the calculation accuracy of the model is evaluated using evaluation indicators, and the model parameters are optimized according to the evaluation results;
[0012] The optimized data-mechanism hybrid-driven line loss calculation model is used to calculate the line loss.
[0013] Further, the obtaining of the operation state data of the distribution network with distributed power access in multiple time dimensions further includes the following steps:
[0014] Using the random forest algorithm to fill in the missing values;
[0015] Using the standard Z-score method to detect the outliers in the data;
[0016] Normalizing the data.
[0017] Further, the using of the random forest algorithm to fill in the missing values includes:
[0018] Taking the data where the missing value is located as the target variable to be predicted by the random forest model, and other data as the input variables for prediction;
[0019] Traversing all the data, and starting to fill in from the data with the least missing values;
[0020] After filling in one missing value, retraining the random forest model with the newly filled data, and using the trained model to fill in the next missing value;
[0021] Until all the missing values are filled.
[0022] Further, the using of the standard Z-score method to detect the outliers in the data includes:
[0023]
[0024] where x i is the data point; μ is the mean of all data points; σ is the standard deviation of all data points; |z i | represents the distance between the score within the standard deviation range and the overall mean. When |z i | is greater than the threshold, it is determined as an outlier.
[0025] Further, the normalization processing of the data includes:
[0026]
[0027] where: x is the line loss index; x min is the minimum value in the index; x max is the maximum value in the index; x i ' is the normalized index.
[0028] Further, the correlation analysis of the active distribution network line loss characteristics after the access of distributed power sources based on the random matrix theory includes:
[0029] Select the line loss rate, voltage, current, and power as elements for correlation analysis;
[0030] Construct a random matrix of the four elements of the line loss rate, voltage, current, and power, and obtain the standard line loss characteristic matrix based on the random matrix theory;
[0031] Determine the line loss rate correlation quantification index, and analyze the correlation between the line loss characteristics and the line loss rate according to the quantification index to obtain the correlation magnitude between the line loss characteristics and the line loss rate.
[0032] Further, the obtaining of the standard line loss characteristic matrix based on the random matrix theory includes:
[0033] Assume the matrix is a matrix with N rows and 4 columns, and each element in it is an independently distributed random variable;
[0034]
[0035] where: respectively represent the 96 - moment data of the line loss rate, voltage, current, and power;
[0036] Perform basic transformation processing on the elements of the matrix to obtain the transition matrix
[0037]
[0038] where: is the mean value of the line loss characteristic ; is the standard deviation of the line loss characteristic ; is the mean value of the line loss characteristic and is the line loss characteristic the standard deviation of
[0039] The equivalent matrix of the singular values of the line loss characteristics is
[0040] where: U is the Haar unitary matrix, and for the equivalent matrix of the singular values of the line loss characteristics,
[0041] The equivalent matrix of the singular values of the line loss characteristics is unitized to obtain the standard line loss characteristic matrix
[0042] i = 1, 2,... N;
[0043] When c = N / T is a constant value, and N and T approach infinity, the line loss characteristic matrix The empirical spectral distribution function of the eigenvalues is as follows:
[0044]
[0045] where: c ∈ (0, 1], λ represents the eigenvalue of the established line loss characteristic matrix, and p(λ) represents the empirical spectral distribution function of the eigenvalues, the eigenvalues of are distributed within a ring with an outer ring radius of 1 and an inner ring radius of (1 - c) L / 2 inside the ring.
[0046] Furthermore, the determination of the line loss rate correlation quantization index includes:
[0047] Using the mean spectral radius MSR as the quantization index for line loss rate correlation analysis;
[0048] The average of the moduli of all the eigenvalues of the matrix is defined as the mean spectral radius, which is a statistic of the line loss rate, voltage, current, and power line loss characteristics;
[0049] The formula for the mean spectral radius is as follows:
[0050]
[0051] The correlation between the line loss characteristics and the line loss rate is represented by observing the change in the mean spectral radius.
[0052] Furthermore, the analysis of the correlation between the line loss characteristics and the line loss rate according to the quantization index to obtain the magnitude of the correlation between the line loss characteristics and the line loss rate includes the following steps:
[0053] Analyze the influence of three line loss characteristics, namely voltage, current, and power, on a single line loss rate variable;
[0054] Collect n line loss rate variables within a period of time T and construct a matrix 1 to obtain a line loss feature matrix
[0055] For the line loss feature matrix Z n2 introduce random noise N to obtain matrix Z n3 ;
[0056] Construct an experimental data source matrix A and a comparison data source matrix A N :
[0057]
[0058] Select an N w ×T w data acquisition window to sample the line loss feature data source, and perform continuous sampling processing by window sliding;
[0059] Respectively obtain the standard matrices of the experimental matrix A and the comparison matrix A through the data sampling window and calculate their average spectral radius κ N MSR,A and
[0060] Obtain the average spectral radius function κ MSR,A (t) that changes with time through the movement of the window and MSR,A (t) and Define the correlation change d 1 between n line loss rate variables and n line loss feature variables as: 2 MSR (t) is defined as:
[0061]
[0062] From time t 1 to t 2 , the correlation size s between the line loss feature and the line loss rate is MSR :
[0063]
[0064] Furthermore, introducing random noise N to the line loss feature matrix Z n2 includes:
[0065] Z N3 = Z’ n1 + m×N;
[0066] In the formula: N is a noise matrix of (k×n 1 )×T and follows a normal distribution; m is the noise amplitude;
[0067] To avoid the influence of the magnitude of the noise amplitude on the analysis results, the analysis is carried out in a way of fixing the signal-to-noise ratio, and the definition of the signal-to-noise ratio is as follows:
[0068]
[0069] Further, the obtaining of the line loss feature matrix is followed by:
[0070] When the difference in the number of n 1 and n 2 exceeds the set value, the matrix Z n1 with less data or the line loss feature matrix Z n2 is expanded k times, where k is the largest integer obtained by dividing the larger one of n 1 and n 2 by the other one.
[0071] Further, the utilization of the model stacking Stacking integrated learning method to fuse the causal logic of the mechanism model and the prediction accuracy of the data model includes the following steps:
[0072] Obtain the distribution network topology structure, line parameters and historical loads of each node, and construct a physical model for calculating the active distribution network line loss based on the loop analysis method;
[0073] Construct a data-driven model for calculating the active distribution network line loss based on the error backpropagation BP neural network, select the line loss feature with the largest correlation with the line loss rate as the input data, and calculate the line loss rate of each branch in different time periods through data calculation;
[0074] Take the physical model and the data model as the base learners of the Stacking integration, and input the calculation results of the base learners into the meta-learner for training; after the training is completed, the calculation result of the distribution network line loss is obtained.
[0075] Further, the construction of the physical model for calculating the active distribution network line loss based on the loop analysis method includes:
[0076] Obtain the power supply node voltage V 0 = V 0 E, where: V 0 is the power supply node voltage, and E is an N×1 all-1 matrix;
[0077] Calculate the node injection current i = 1, 2,..., n, where: S i is the power of node i;
[0078] Calculate ΔV k , where ΔV is the voltage difference and k is the number of iterations;
[0079] Calculate Vk = V 0 - ΔV k ;
[0080] Set the calculation accuracy to λ, and repeat the calculation until ΔV k ' = |V k - V k-1 | ≤ λ, output V k , if not satisfied, jump to the step of calculating the injected current at the calculation node;
[0081] The complex power loss of the distribution network is obtained as:
[0082]
[0083] In the formula: respectively represent the conjugate transpose of i b 、i s ; B is an N×N dimensional network path matrix, Z b is the branch impedance matrix, i b is the branch current, i s is the loop current, ∑ = BZ b B T is the loop impedance matrix, T is the number of columns of the matrix.
[0084] Furthermore, the construction of the data-driven model for calculating the line loss of the active distribution network based on the error backpropagation BP neural network includes:
[0085] The data-driven model includes an input layer, a hidden layer, and an output layer;
[0086] The hidden layer uses the least squares method as the activation function, and the number of nodes in the hidden layer is determined by the following formula:
[0087] or l = log 2 n;
[0088] In the formula: The value range of a is 1 - 10, representing the number of neurons in the input layer, and the number of neurons and nodes in the hidden layer are represented by l.
[0089] Furthermore, the step of using the physical model and the data model as the base learners of the Stacking integration and inputting the calculation results of the base learners into the meta-learner for training includes the following steps:
[0090] For a data set S = {(y n , x n ), n = 1,..., N}, where the feature vector of the nth sample is x n , and the predicted value is y n, the number of corresponding features is p, that is, each feature vector is (x 1 , x 2 ,..., x p );
[0091] Randomly divide the data set into K subsets of basically equal size, denoted as S 1 , S 2 ,..., S K , S -k = S - S k , and define S k and S -k as the test set and training set of the k-th fold in k-fold cross-validation;
[0092] For the model of the first layer, it contains K base learners. Train the base model L -k on the training set S k using the k-th algorithm, where the value of k ranges from 1 to K;
[0093] The base learners of the first layer use the physical calculation model and the BP neural network model, and input the calculation results of the base learners into the meta-learner for training;
[0094] The meta-learner uses the least squares method to calculate the calculation results obtained by different base learners, and minimizes the sum of the squares of the residuals between the model calculation value and the input value by adjusting the coefficients.
[0095] The present invention also includes an active distribution network line loss calculation device, which uses the method as described above. The device includes:
[0096] A correlation analysis unit, configured to obtain the operation state data of the distribution network with distributed power generation access in multiple time dimensions, perform correlation analysis on the line loss characteristics of the active distribution network after the access of distributed power generation based on random matrix theory, and obtain the line loss characteristics with the strongest correlation with the line loss rate;
[0097] A modeling unit, configured to establish a data-mechanism hybrid-driven line loss calculation model by using the model stacking Stacking ensemble learning method to fuse the causal logic of the mechanism model and the prediction accuracy of the data model according to the line loss characteristics based on the mechanism model and data model of traditional line loss calculation;
[0098] An evaluation unit, configured to obtain the historical data of the active distribution network under different entity accesses as examples, analyze the data-mechanism hybrid-driven line loss calculation model, evaluate the calculation accuracy of the model using evaluation indicators, and optimize the model parameters according to the evaluation results;
[0099] A calculation unit, configured to calculate the line loss using the optimized data-mechanism hybrid-driven line loss calculation model.
[0100] The present invention further includes a computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned method is implemented.
[0101] The present invention further includes a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned method is implemented.
[0102] The beneficial effects of the present invention are as follows: Based on the multi-time-dimensional line loss correlation analysis and the Stacking ensemble learning algorithm, the present invention solves the problems of low calculation accuracy of the physical model and high dependence of the data model on data quality. At the same time, it combines the causal logic of the physical model and the calculation accuracy of the data model, fits the line loss rate calculation results of all models, obtains the line loss rate curve with the smallest deviation from the actual value, and realizes the accurate calculation of the active distribution network line loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0104] Figure 1 It is a flowchart of the method in Embodiment 1;
[0105] Figure 2 It is a structural schematic diagram of the device in Embodiment 1;
[0106] Figure 3 It is a line topology structure diagram of a 10 kV distribution network with multi-agent access in Embodiment 2;
[0107] Figure 4 It is a data preprocessing flowchart in Embodiment 2;
[0108] Figure 5 It is a distribution network line loss calculation model based on loop analysis method in Embodiment 2;
[0109] Figure 6 It is a structure diagram of a BP neural network model in Embodiment 2;
[0110] Figure 7 It is a schematic diagram of the principle of the ensemble learning method based on Stacking in Embodiment 2;
[0111] Figure 8It is the training flow chart of the data-mechanism hybrid-driven line loss calculation model in Embodiment 2.
[0112] Figure 9 It is the structural schematic diagram of the computer device of the present invention. Specific implementation manners
[0113] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments.
[0114] Embodiment 1:
[0115] As Figure 1 shown: An active distribution network line loss calculation method includes the following steps:
[0116] Obtain the operation status data of the distribution network with distributed power generation access in multiple time dimensions, perform correlation analysis on the line loss characteristics of the active distribution network after the access of distributed power generation based on the random matrix theory, and obtain the line loss characteristics with the strongest correlation with the line loss rate;
[0117] According to the line loss characteristics, based on the mechanism model and data model of traditional line loss calculation, use the model stacking Stacking ensemble learning method to fuse the causal logic of the mechanism model and the prediction accuracy of the data model, and establish a data-mechanism hybrid-driven line loss calculation model;
[0118] Obtain the historical data of the active distribution network under different entity accesses as examples, analyze the data-mechanism hybrid-driven line loss calculation model, and use evaluation indicators to evaluate the calculation accuracy of the model, and optimize the model parameters according to the evaluation results;
[0119] Use the optimized data-mechanism hybrid-driven line loss calculation model to calculate the line loss.
[0120] Based on the correlation analysis of line loss characteristics, obtain the line loss characteristics with the strongest correlation with the line loss rate, and then use the Stacking ensemble learning method to fuse the causal logic of the mechanism model and the prediction accuracy of the data model, and establish a data-mechanism hybrid-driven line loss calculation model. Finally, a line loss calculation model that can better adapt to the active distribution network after multi-entity access is obtained.
[0121] Stacking ensemble learning integrates and fuses two models, calculates the line loss from different perspectives, and maximally exerts the advantages of the mechanism model and the data model itself. It combines the causal logic of the mechanism model and the advantage of high calculation accuracy of the data model, and weakens the disadvantages of poor calculation accuracy of the mechanism model and high data accuracy requirements of the data model, providing more accurate and stable calculation results.
[0122] In this embodiment, obtaining the operation status data of the distribution network with distributed power access further includes the following steps:
[0123] Using the random forest algorithm to fill in the missing values;
[0124] Using the standard Z-score method to detect the outliers in the data;
[0125] Normalizing the data.
[0126] As an optimization of the above embodiment, using the random forest algorithm to fill in the missing values includes:
[0127] Taking the data where the missing value is located as the target variable to be predicted by the random forest model, and other data as the input variables for prediction;
[0128] Traversing all the data and starting to fill in from the data with the least missing values;
[0129] After filling in one missing value, retraining the random forest model with the newly filled data and using the trained model to fill in the next missing value;
[0130] Until all the missing values are filled.
[0131] Using the standard Z-score method to detect the outliers in the data includes:
[0132]
[0133] where x i is the data point; μ is the mean of all data points; σ is the standard deviation of all data points; |z i | represents the distance between the score within the standard deviation range and the overall mean. When |z i | is greater than the threshold, it is determined as an outlier.
[0134] Normalizing the data includes:
[0135]
[0136] where: x is the line loss index; x min is the minimum value in the index; x max is the maximum value in the index; x i ' is the normalized index.
[0137] Performing a correlation analysis on the line loss characteristics of the active distribution network after the access of distributed power based on the random matrix theory, including:
[0138] Selecting the line loss rate, voltage, current, and power as elements for correlation analysis;
[0139] Construct a random matrix regarding four elements of line loss rate, voltage, current and power, and obtain a standard line loss characteristic matrix based on the random matrix theory;
[0140] Determine the quantization index of the line loss rate correlation, and analyze the correlation between the line loss characteristics and the line loss rate according to the quantization index to obtain the correlation magnitude between the line loss characteristics and the line loss rate.
[0141] Among them, obtaining the standard line loss characteristic matrix based on the random matrix theory includes:
[0142] Suppose the matrix is a matrix with N rows and 4 columns, and each element in it is an independently distributed random variable;
[0143]
[0144] In the formula: respectively represent the 96 - moment data of the line loss rate, voltage, current and power;
[0145] Perform basic transformation processing on the elements in the matrix to obtain the transition matrix
[0146] i = 1, 2,... N, j = 1, 2,... T;
[0147] In the formula: is the mean value of the line loss characteristic ; is the standard deviation of the line loss characteristic ; is the mean value of the line loss characteristic and is the standard deviation of the line loss characteristic and
[0148] The equivalent matrix of the singular values of the line loss characteristics is
[0149] In the formula: U is a Haar unitary matrix, and for the equivalent matrix of the singular values of the line loss characteristics, there is
[0150] Perform unitary processing on the equivalent matrix of the singular values of the line loss characteristics to obtain the standard line loss characteristic matrix
[0151] i = 1, 2,... N;
[0152] When \(c = N / T\) is a constant value and both \(N\) and \(T\) approach infinity, the eigenvalue empirical spectral distribution function of the line loss characteristic matrix is as follows:
[0153]
[0154] where: \(c\in(0,1]\), \(\lambda\) represents the eigenvalue of the established line loss characteristic matrix, and \(p(\lambda)\) represents the eigenvalue empirical spectral distribution function of the eigenvalues of are distributed within a ring with an outer ring radius of 1 and an inner ring radius of \((1 - c)\) L / 2 .
[0155] In this embodiment, determining the quantization index of the line loss rate correlation includes:
[0156] Using the mean spectral radius MSR as the quantization index for the line loss rate correlation analysis;
[0157] Defining the average of the moduli of all eigenvalues of the matrix as the mean spectral radius, which is a statistic of the line loss rate, voltage, current, and power line loss characteristics;
[0158] The formula for the mean spectral radius is as follows:
[0159]
[0160] The correlation between the line loss characteristics and the line loss rate is represented by observing the change in the mean spectral radius.
[0161] According to the quantization index, analyzing the correlation between the line loss characteristics and the line loss rate to obtain the magnitude of the correlation between the line loss characteristics and the line loss rate includes the following steps:
[0162] Analyzing the influence of three line loss characteristics of voltage, current, and power on a single line loss rate variable;
[0163] Collecting \(n\) line loss rate variables within a period \(T\) 1 to construct a matrix to obtain the line loss characteristic matrix
[0164] For the line loss characteristic matrix \(Z\) n2 introducing random noise \(N\) to obtain the matrix \(Z\) n3 ;
[0165] Constructing the experimental data source matrix \(A\) and the comparison data source matrix \(A\) N :
[0166]
[0167] Selecting \(N\) w × \(T\) wThe data acquisition window samples the line loss feature data source and performs continuous sampling processing by sliding the window;
[0168] The standard matrices of the experimental matrix A and the comparison matrix A are obtained through the data sampling window respectively, and their average spectral radius κ is calculated N and MSR,A and
[0169] The average spectral radius function κ(t) changing with time is obtained by moving the window MSR,A and Let n 1 line loss rate variables and n 2 line loss feature variables' correlation change d(t) be defined as: MSR During the time from t to t, the correlation magnitude s between the line loss feature and the line loss rate is
[0170]
[0171] t 1 to t 2 : MSR :
[0172]
[0173] As an optimization of the above embodiment, random noise N is introduced into the line loss feature matrix Z, including: n2 Z = Z'+ m×N;
[0174] Z N3 = Z’ n1 + m×N;
[0175] where: N is a noise matrix of (k×n 1 )×T and follows a normal distribution; m is the noise amplitude;
[0176] To avoid the influence of the noise amplitude on the analysis result, the analysis is carried out in the way of a fixed signal-to-noise ratio. The definition of the signal-to-noise ratio is as follows:
[0177]
[0178] where, after obtaining the line loss feature matrix it also includes:
[0179] When the quantity gap between n 1 and n 2 exceeds the set value, the matrix Z with less data n1 or the line loss feature matrix Z n2 is expanded k times, where k is the largest integer not exceeding the quotient of the larger one of n 1 , n 2 divided by the other one.
[0180] In this embodiment, the causal logic of the mechanism model and the prediction accuracy of the data model are fused by using the model stacking Stacking integrated learning method, including the following steps:
[0181] Obtain the distribution network topology structure, line parameters and historical load of each node, and construct a physical model for calculating the line loss of the active distribution network based on the loop analysis method;
[0182] Construct a data-driven model for calculating the line loss of the active distribution network based on the error backpropagation BP neural network, select the line loss feature with the largest correlation with the line loss rate as the input data, and calculate the line loss rate of each branch in different time periods through data calculation;
[0183] Take the physical model and the data model as the base learners of the Stacking integration, and input the calculation results of the base learners into the meta-learner for training; after the training is completed, the calculation result of the distribution network line loss is obtained.
[0184] Construct a physical model for calculating the line loss of the active distribution network based on the loop analysis method, including:
[0185] Obtain the power supply node voltage V 0 = V 0 E, where: V 0 is the power supply node voltage, and E is an N×1 all-ones matrix;
[0186] Calculate the node injection current i = 1, 2,..., n, where: S i is the power of node i;
[0187] Calculate ΔV k , where ΔV is the voltage difference and k is the number of iterations;
[0188] Calculate V k = V 0 -ΔV k ;
[0189] Set the calculation accuracy to λ, and repeat the calculation until ΔV k ' = |V k - V k-1 | ≤ λ, output V k , if not satisfied, jump to the step of calculating the node injection current;
[0190] The complex power loss of the distribution network is obtained as:
[0191]
[0192] where: respectively represent i b 、i sConjugate transpose; B is an N×N dimensional network path matrix, Z b is the branch impedance matrix, i b is the branch current, i s is the loop current, ∑ = BZ b B T is the loop impedance matrix, and T is the number of columns of the matrix.
[0193] Construct a data-driven model for calculating the line loss of an active distribution network based on an error backpropagation BP neural network, including:
[0194] The data-driven model includes an input layer, a hidden layer, and an output layer;
[0195] The hidden layer uses the least squares method as the activation function, and the number of nodes in the hidden layer is determined by the following formula:
[0196] or l = log 2 n;
[0197] Where: The value range of a is 1-10, representing the number of neurons in the input layer, and the number of neurons and nodes in the hidden layer are represented by l.
[0198] As a preference of the above embodiment, the physical model and the data model are used as the base learners of Stacking integration, and the calculation results of the base learners are input into the meta-learner for training, including the following steps:
[0199] For a data set S = {(y n , x n ), n = 1,..., N}, where the feature vector of the nth sample is x n , the predicted value is y n , and the number of corresponding features is p, that is, each feature vector is (x 1 , x 2 ,..., x p );
[0200] Randomly divide the data set into K subsets of approximately equal size, denoted as S 1 , S 2 ,..., S K , S -k = S - S k , and define S k and S -k as the test set and training set of the kth fold in k-fold cross-validation;
[0201] For the first layer of the model, it contains K base learners, and the base model L -k is trained on the training set S k, where the value of k ranges from 1 to K;
[0202] The first-layer base learner uses a physical calculation model and a BP neural network model, and inputs the calculation results of the base learner into the meta-learner for training;
[0203] The meta-learner uses the least squares method to calculate the calculation results obtained by different base learners, and minimizes the sum of squared residuals between the model calculation value and the input value by adjusting the coefficients.
[0204] As Figure 2 shown, this embodiment also includes an active distribution network line loss calculation device, which uses the method as described above. The device includes:
[0205] The correlation analysis unit is used to obtain the operation status data of the distribution network with distributed power access in multiple time dimensions, perform correlation analysis on the line loss characteristics of the active distribution network after the access of distributed power based on the random matrix theory, and obtain the line loss characteristics with the strongest correlation with the line loss rate;
[0206] The modeling unit is used to establish a data-mechanism hybrid-driven line loss calculation model by fusing the causal logic of the mechanism model and the prediction accuracy of the data model using the model stacking Stacking integrated learning method according to the line loss characteristics based on the mechanism model and data model of traditional line loss calculation;
[0207] The evaluation unit is used to obtain the historical data of the active distribution network under different entity accesses as examples, analyze the data-mechanism hybrid-driven line loss calculation model, evaluate the calculation accuracy of the model using evaluation indicators, and optimize the model parameters according to the evaluation results;
[0208] The calculation unit is used to calculate the line loss using the optimized data-mechanism hybrid-driven line loss calculation model.
[0209] Embodiment 2:
[0210] This embodiment takes the Figure 3 shown distribution network line as the background, where nodes 0 and 4 are the access points of distributed power sources, a 630kW electric vehicle charging pile is connected to node 10, and a 300kW / 500Wh energy storage power station is connected to node 16.
[0211] In this embodiment, first, data preprocessing such as missing value filling, outlier processing, and data normalization is performed on the power system operation data to ensure the quality and availability of the data and further improve the accuracy of subsequent analysis.
[0212] The process of data preprocessing is as Figure 4As shown in the figure, data preprocessing is divided into three stages. First, the random forest method is used to fill in the missing values. The feature where the missing value is located will be used as the target variable to be predicted, while other features will be used as the input variables for prediction. Traverse all features and start filling from the one with the least missing values. After filling one missing value, the newly filled data can be used to retrain the random forest model, and this model is used to fill the next missing value until all missing values are filled; then, the Z-score method is used to detect the outliers in the data. The data points exceeding the threshold are marked as outliers and the outliers are treated as missing values for filling; finally, the data is normalized to avoid the influence of the dimension between indicators during the calculation process. By converting the original data into data with the same dimension, each indicator is at the same order of magnitude, which is convenient for comprehensive comparison and evaluation.
[0213] The calculation model of distribution network line loss based on loop analysis method is as Figure 5 shown. This model is based on a simple distribution network. The node current is calculated through the node voltage, and the iteration is performed until the calculation accuracy is within the required range to obtain the voltage of each node in the distribution network and the loss of the entire branch. However, as different entities are connected to the distribution network, the flow direction of the power flow changes from unidirectional to bidirectional, and most of the traditional calculation models of distribution network line loss mechanism adopt simplified physical models and empirical parameters, resulting in low calculation accuracy.
[0214] The calculation model of distribution network line loss based on BP neural network is as Figure 6 shown. The entire model consists of three layers: the input layer is used for sample data, that is, the input of line loss rate and line loss characteristics such as voltage, current, and power. After analysis and processing of the data, the calculated line loss rate is output through the output layer. The hidden layer consists of various calculation functions. These functions are connected through nodes and determine specific data according to the data input and calculation situation. From the analysis of line loss correlation, it can be seen that the correlation between power and line loss rate is the largest. For the calculation accuracy of the line loss model, the line loss characteristics with the largest correlation with the line loss rate are selected as the input data. And to avoid the influence of different dimensions between indicators on the calculation, data normalization is used to standardize the data and convert it into data with the same dimension. Through the above calculation, the calculation result of the line loss rate of the line loss calculation model based on data-driven is obtained. Although the accuracy of this result is high, the model parameters completely depend on the data, which puts higher requirements on the data quality and has a certain generalization risk.
[0215] Aiming at the above problems, this embodiment proposes a data-mechanism hybrid-driven calculation method for distribution network line loss based on the Stacking ensemble learning method, which fully integrates the advantages of data-driven and mechanism-driven, and can calculate the line loss of the distribution network more accurately after the large-scale access of distributed power sources. Figure 7 and Figure 8They are respectively the schematic diagram of the Stacking-based integrated learning method and the training flowchart of the data-mechanism hybrid-driven line loss calculation model. The Stacking integrated learning method is a machine learning method that solves a single problem by integrating multiple learners, which can significantly improve the prediction accuracy and generalization ability of the model. In the Stacking integrated framework, the original data is first divided into several subsets, and then the processing results of each base learner for these subsets are used as primary predictions for further analysis and processing by the meta-learner in the next stage, so as to achieve the purpose of comprehensively utilizing the advantages of multiple models. The first-layer base learners use physical calculation models and BP neural network models. The calculation results of the base learners are input into the meta-learner for training. Since multiple line loss features are essentially calculations of the same line loss data, there may be a problem of multicollinearity in the calculation results obtained by different base learners. The meta-learner uses the least squares method to solve the above problem. By adjusting the coefficients, the sum of the squared residuals between the model calculation value and the input value is minimized. In this way, the optimal parameter calculation value can be obtained, and thus the model that best fits the data can be obtained. The obtained model is the data-mechanism hybrid-driven line loss calculation model.
[0216] First, based on the random matrix theory, the correlation analysis of the line loss characteristics of the active distribution network after the access of distributed power sources is carried out to obtain the line loss characteristics with the strongest correlation with the line loss rate. Then, based on the mechanism model and data model of traditional line loss calculation, the Stacking integrated learning method is used to fuse the causal logic of the mechanism model and the prediction accuracy of the data model, and a data-mechanism hybrid-driven line loss calculation model is established. The method proposed in this embodiment has high calculation accuracy and can better adapt to the line loss calculation of the active distribution network after the access of distributed power sources.
[0217] 1. Data preprocessing;
[0218] (1) Missing value filling;
[0219] The random forest method is a method for filling missing values. When using the random forest to fill missing values, the feature where the missing value is located will be used as the target variable to be predicted, and other features will be used as the input variables for prediction. Traverse all features and start filling from the one with the least missing values. After filling a missing value, the newly filled data can be used to retrain the random forest model, and this model can be used to fill the next missing value until all missing values are filled.
[0220] (2) Outlier processing;
[0221] In this embodiment, the Z-score method is used to detect outliers in the data. The calculation formula is:
[0222]
[0223] Where: x i is a data point; μ is the mean of all data points; σ is the standard deviation of all data points; |z i | represents the distance between the score within the standard deviation range and the overall mean. Generally, the threshold is set to 2.5. When |z i | is greater than the threshold, it is determined as an outlier.
[0224] (3) Data normalization;
[0225] Performing standardization on the data can avoid the influence of the dimension between indicators during the calculation process. By converting the original data into data with the same dimension, each indicator is at the same order of magnitude, thus facilitating comprehensive comparison and evaluation. The calculation formula is:
[0226]
[0227] Where: x is the line loss index; x min is the minimum value in the index; x max is the maximum value in the index; x’ i is the normalized index.
[0228] 2. Basic principle of random matrix;
[0229] Assume the matrix is a matrix with N rows and T columns, and each element in it is an independently distributed random variable. In this embodiment, four independent factors of line loss rate, voltage, current, and power are selected for line loss rate correlation analysis. Therefore, T = 4:
[0230]
[0231] Where: respectively represent the 96 - moment data of line loss rate, voltage, current, and power.
[0232] Perform basic transformation processing on the elements in the matrix to obtain the transition matrix
[0233] i = 1, 2,... N, j = 1, 2,... T (3)
[0234] Where: is the mean of the line loss feature ; is the standard deviation of the line loss feature ; is the mean of the line loss feature and is the line loss feature The standard deviation of
[0235] The equivalent matrix of the singular values of the line loss characteristics is
[0236]
[0237] Where: U is the Haar unitary matrix. And for the equivalent matrix of the singular values of the line loss characteristics, there is
[0238] The equivalent matrix of the singular values of the line loss characteristics is normalized to obtain the standard line loss characteristic matrix
[0239]
[0240] When c = N / T is a constant value, and N and T approach infinity, the line loss characteristic matrix The empirical spectral distribution function of the eigenvalues is as follows:
[0241]
[0242] Where: c ∈ (0, 1], λ represents the eigenvalue of the established line loss characteristic matrix, and p(λ) represents The empirical spectral distribution function of the eigenvalues. Thus, The eigenvalues of are distributed in a ring with an outer ring radius of 1 and an inner ring radius of (1 - c) L / 2 Inside the ring.
[0243] 3. Analysis of the correlation of the line loss rate;
[0244] (1) Quantification index of correlation;
[0245] In this embodiment, the mean spectral radius (MSR) is used as the quantification index for the analysis of the correlation of the line loss rate. The average of the moduli of all the eigenvalues of the matrix is defined as the mean spectral radius, which is a statistic of line loss characteristics such as line loss rate, voltage, current, and power. The calculation formula of the mean spectral radius is as follows:
[0246]
[0247] Although a single eigenvalue cannot accurately describe the properties of the matrix, the statistical characteristics of the matrix can be represented by calculating the mean spectral radius of all the eigenvalues. The mean spectral radius can not only reflect the distribution of the line loss eigenvalues but also reflect the trace of the matrix. According to the law of large numbers and the central limit theorem, the trace of the matrix can reflect the characteristics of the correlation of the line loss characteristics. In this embodiment, the correlation between the line loss characteristics and the line loss rate is revealed by observing the change of the mean spectral radius.
[0248] (2) Analysis steps;
[0249] For n 1 line loss rate variables, analyze the influence of n 2 line loss characteristics on them. In this embodiment, analyze the influence of three line loss characteristics, namely voltage, current, and power, on a single line loss rate variable. The analysis steps are as follows:
[0250] 1) Data source construction;
[0251] Collect n 1 line loss rate variables within a period of time T, and construct a matrix Similarly, obtain the line loss characteristic matrix Generally, n 1 ≠n 2 . When the difference in the number of the two is large, for example, when n 2 is greater than n 1 , in order to avoid the weakening of the role of a certain variable caused by too large a difference in dimensions, expand the one with a smaller number k times
[26] .
[0252]
[0253] In the formula: k is the largest integer not exceeding n 1 / n 2 .
[0254] In order to avoid the influence of data expansion on correlation, introduce random noise to Z' n2 .
[0255] Z N3 =Z’ n1 +m×N (9)
[0256] In the formula: N is the noise matrix of (k×n 1 )×T, and it follows a normal distribution; m is the noise amplitude. In order to avoid the influence of the magnitude of the noise amplitude on the analysis result, analyze in the way of a fixed signal-to-noise ratio. The definition of the signal-to-noise ratio is as follows:
[0257]
[0258] Construct the experimental data source matrix A and the comparison data source matrix A N .
[0259]
[0260] 2) Data acquisition window;
[0261] By selecting N w ×T wThe data acquisition window samples the line loss feature data source. After processing, continuous sampling can be carried out by sliding the window, so that the analysis of historical data and real-time data can be carried out simultaneously.
[0262] 3) Analysis steps;
[0263] Respectively obtain the experimental matrix A and the comparison matrix A through the data sampling window N of the standard matrix and calculate its average spectral radius κ MSR,A and Obtain κ changing with time through the movement of the window MSR,A (t) and Define the change of the correlation between n 1 line loss rate variables and n 2 line loss feature variables as follows:
[0264]
[0265] t 1 to t 2 During this time, the correlation between the line loss feature and the line loss rate is s MSR :
[0266]
[0267] 4. Distribution network line loss calculation model based on loop analysis method;
[0268] In the distribution network, assume there are N + 1 nodes, and each node can be connected to an external circuit, including a power source, a load, or a combination of them. In this embodiment, a directed graph Μ is used to represent this network, where the vertices of the graph represent the nodes in the power grid, and the edges represent the direction of current flow and the branches. Each node corresponds to a vertex, labeled 1,......, N + 1, and the common grounding point is represented by , and its potential value is 0. The voltage of node k is expressed as u k . This directed graph can be divided into two parts, expressed as Μ = c ∪ ε. One part is the internal subgraph c, which is composed of the branches and nodes of the distribution network; the other part is the external subgraph ε, which is composed of nodes and the common ground point, and the external subgraph connects each node of the distribution network to the common ground point For a graph composed entirely of tree branches without branch connections, there are N + 1 nodes and b branches, then b = N.
[0269] Take Figure 5 as an example, the branch impedance matrix is Z b = R b + jX b :
[0270]
[0271] Where: Z b is a diagonal matrix, and Z i is the branch impedance, where i = 1, 2,... b. The real part of the matrix R b is the branch impedance matrix:
[0272]
[0273] Where: r i is the branch resistance, where i = 1, 2,... b.
[0274] All the branches in Μ form the maximum spanning tree of the distribution network. Define as the path from the power source node to the load node, and the edges of ε form a loop. The total number of loops in the whole network is N. Define the loop current as:
[0275]
[0276] Where: i 1 …i N is the node injection current; I 1 , I 2 , …I N is the branch current amplitude; θ 1 …θ N is the current phase angle. B is an N×N dimensional network path matrix, and the matrix element B ij is defined as:
[0277]
[0278] Where: represents the path from the line start to node j passing through branch i (i = 1, 2…b, j = 1, 2…N); represents the path from the line start to node j not passing through branch i.
[0279] Branch current:
[0280]
[0281] Where: i l1 , i l2 …i lb represents the branch current.
[0282] Thus, it can be obtained:
[0283] i b = B T i s (19)
[0284] Through the derivation of the above analysis, we can draw the conclusion that the voltage difference between each node and the power source node at the head of the distribution line can be expressed as the sum of the voltages of all the branches passed from the branch where the node is located to the power source node at the head:
[0285] ΔV = BZ b i b = BZ b B T i s (20)
[0286] Define the path mutual impedance matrix as:
[0287] ∑ = BZ b B T (21)
[0288] Equation (21) is expressed as:
[0289] ΔV = ∑i s (22)
[0290] From this, the calculation steps for the power loss of the distribution network are as follows (k is the number of iterations):
[0291] (1) Take the voltage of the power source node V 0 = V 0 E, where: V 0 is the voltage of the power source node, and E is an N×1 all-ones matrix;
[0292] (2) Calculate the node injection current i = 1, 2, …, n, where: S i is the power of node i;
[0293] (3) Calculate ΔV k ;
[0294] (4) Calculate V k = V 0 -ΔV k ;
[0295] (5) Set the calculation accuracy as λ, and repeat the above steps until ΔV k ' = |V k - V k-1 | ≤ λ, output V k , if not satisfied, jump to (2).
[0296] From Equation (21), the complex power loss of the distribution network is:
[0297]
[0298] Where: respectively represent i b 、is Conjugate transpose; ∑ = BZ b B T is the loop impedance matrix.
[0299] 5. Distribution network line loss calculation model based on BP neural network;
[0300] In the construction of the data model, there are various types of neural networks. In this embodiment, the BP network is selected for use, as Figure 6 shown. The entire model consists of three layers: the input layer is used for sample data, that is, the input of line loss rate and line loss characteristics such as voltage, current, and power. The data after analysis and processing, that is, the calculated line loss rate, is output through the output layer. The hidden layer consists of various calculation functions. These functions are connected by nodes and determine specific data according to the data input and calculation situation.
[0301] The hidden layer and the output layer generally adopt the S-shaped activation function, as shown in the following formula:
[0302]
[0303] The S-shaped activation function can analyze data in (-∞, +∞). These data will be placed in the interval (-1, +1) after being processed by formula (25). Net represents the input value corresponding to each node.
[0304] Although the BP neural network can correct the above shortcomings through the training calculation method using the evolutionary method, compared with the conventional BP neural network, it requires more time for training calculation, and the effect is not as significant as that of the conventional BP neural network. Therefore, based on this theory, this embodiment explores a more excellent algorithm, that is, the ordinary least-squares (OLS) method, to reduce the repetition rate.
[0305] It can be seen from the line loss correlation analysis that the correlation between power and line loss rate is the largest. For the calculation accuracy of the line loss model, the line loss characteristics with the largest correlation with the line loss rate are selected as the input data. And in order to avoid the influence of different dimensions between indicators on the calculation, the data is standardized to convert it into data with the same dimension.
[0306] This embodiment constructs a line loss calculation model based on the BP neural network. This model uses the S-shaped function to process the data between different layers and determines the input data volume according to the dimension of the data. The output data is the line loss rate of the distribution network, and there is only one output layer. In determining the number of intermediate layers, it is determined by relying on the following empirical formula:
[0307] or l = log 2 n(25)
[0308] In the formula: the value range of a is 1 - 10, representing the number of neurons in the input layer. The number of neurons in the hidden layer is represented by l, and the number of hidden layer nodes is also represented by l.
[0309] 6. Data-mechanism hybrid-driven line loss calculation model based on Stacking ensemble learning;
[0310] Ensemble learning method is a machine learning method that solves a single problem by integrating multiple learners. It aims to significantly improve the prediction accuracy and generalization ability of the model by constructing a series of hypotheses and effectively combining them. This method effectively overcomes the disadvantages of single models being easily restricted when facing complex data. Especially in the Stacking ensemble framework, first, the original data is divided into several subsets, and then the processing results of each base learner for these subsets are used as primary predictions for further analysis and processing by the meta-learner in the next stage, so as to achieve the purpose of comprehensively utilizing the advantages of multiple models. In this process, significantly different algorithm models can complement each other because of their different perspectives on data interpretation, greatly enriching the adaptability and robustness of the model. In summary, ensemble learning provides a more refined and efficient path for solving complex calculation problems by integrating multiple algorithms. For more application details of this method, see Figure 7 。
[0311] The specific training method of Stacking ensemble learning is
[16] : First, for a data set S = {(y n , x n ), n = 1,..., N}, where the feature vector of the nth sample is x n , the predicted value is y n , and the number of corresponding features is p, that is, each feature vector is (x 1 , x 2 ,..., x p ). Then, in this embodiment, the data set is randomly divided into K subsets of basically equal size, denoted as S 1 , S 2 ,..., S K , S -k = S - S k . S k and S -k are defined as the test set and training set of the kth fold in k-fold cross-validation. For the models in the first layer, this embodiment includes K base learners, and the base model L -k is trained on the training set S k using the kth algorithm, where the value of k ranges from 1 to K.
[0312] The learning framework selected in this embodiment is 5-fold cross-validation. To improve the computational efficiency, the first-layer base learners use a physical calculation model and a BP neural network model. The calculation results of the base learners are input into the meta-learner for training. Therefore, there are only two sample feature variables input into the meta-learner. Since multiple line loss features are essentially calculations of the same line loss data, there may be a problem of multicollinearity in the calculation results obtained by different base learners. The meta-learner uses the least squares method to solve the above problem. By adjusting the coefficients, the sum of the squared residuals between the model calculated value and the input value is minimized. In this way, the optimal parameter calculated value can be obtained, and thus the model with the best fit to the data can be obtained. This method not only solves the underfitting problem but also effectively improves the generalization ability of the learner, enabling it to effectively avoid the overfitting phenomenon. The training process of the calculation model in this embodiment is as Figure 8 shown. First, data preprocessing is performed on the line loss features. Then, the processed data set is divided into 5 equal parts for training the base learners. The training results of the base learners are input into the meta-learner and trained. After the training is completed, the calculation results of the distribution network line loss are obtained.
[0313] In summary, the active distribution network line loss calculation method based on data-mechanism hybrid drive needs to obtain the line loss feature with the strongest correlation with the line loss rate on the basis of the correlation analysis of line loss features. Then, the causal logic of the mechanism model and the prediction accuracy of the data model are fused by using the Stacking ensemble learning method to establish a data-mechanism hybrid drive line loss calculation model. Finally, a line loss calculation model that can better adapt to the active distribution network after multi-agent access is obtained.
[0314] The specific process is as follows: First, based on the random matrix theory, the correlation analysis of the active distribution network line loss features after the access of distributed power sources is carried out to obtain the line loss feature with the strongest correlation with the line loss rate. Then, based on the mechanism model and data model of traditional line loss calculation, the causal logic of the mechanism model and the prediction accuracy of the data model are fused by using the Stacking ensemble learning method to establish a data-mechanism hybrid drive line loss calculation model. Taking the active distribution network in a certain area under different agent accesses as an example for analysis, and using evaluation indexes such as mean absolute error and root mean square error to evaluate the calculation accuracy of the model.
[0315] Please refer to Figure 9 the structural schematic diagram of the computer device provided by the embodiment of the present application shown. A computer device 400 provided by the embodiment of the present application includes: a processor 410 and a memory 420. The memory 420 stores a computer program executable by the processor 410. When the computer program is executed by the processor 410, the above method is executed.
[0316] An embodiment of the present application further provides a storage medium 430, on which a computer program is stored, and when the computer program is run by a processor 410, the above method is executed.
[0317] Among them, the storage medium 430 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM for short), electrically erasable programmable read-only memory (EEPROM for short), erasable programmable read-only memory (EPROM for short), programmable read-only memory (PROM for short), read-only memory (ROM for short), magnetic memory, flash memory, a magnetic disk or an optical disc.
[0318] In the description of the present invention, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The meaning of "a plurality" is two or more, unless otherwise specifically defined.
[0319] In the present invention, unless otherwise clearly specified and limited, the terms such as "installation", "connection", "connection", "fixation" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection or integrated; it can 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 elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0320] In the description of this specification, the description referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0321] Any process or method description represented in a flowchart or described in other ways herein can be understood to represent a module, segment, or part of code including one or more executable instructions for implementing a specific logical function or process, and the scope of the preferred embodiments of the present invention includes additional implementations, where the functions can be executed in a manner not shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0322] The logic and / or steps represented in a flowchart or described in other ways herein, for example, can be considered as an ordered list of executable instructions for implementing a logical function, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in connection with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.
[0323] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0324] Those of ordinary skill in the art can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing relevant hardware through a program. The said program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0325] The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for calculating line loss in an active distribution network, characterized in that: The steps include: The multi-time dimension operation status data of the distribution network connected to the distributed generation is obtained, and the correlation analysis of the line loss characteristics of the active distribution network after the distributed generation is connected is performed based on the random matrix theory to obtain the line loss characteristics with the strongest correlation with the line loss rate; According to the line loss characteristics, based on the mechanism model and data model of traditional line loss calculation, the model stacking ensemble learning method is used to integrate the causal logic of the mechanism model and the prediction accuracy of the data model, and a data-mechanism hybrid driven line loss calculation model is established; The historical data of active distribution networks under different subject access are obtained as examples, the line loss calculation model driven by data-mechanism hybrid is analyzed, and the calculation accuracy of the model is evaluated using evaluation indicators, and the model parameters are optimized according to the evaluation results; The line loss is calculated using the optimized data-mechanism hybrid driven line loss calculation model.
2. The active power distribution network line loss calculation method according to claim 1, characterized in that: The step of obtaining the multi-time dimension operation status data of the distribution network to which the distributed power source is connected also includes the following steps: Use the random forest algorithm to fill missing values; The standard Z-score method was used to detect outliers in the data; Normalize the data.
3. The active power distribution network line loss calculation method according to claim 2, characterized in that: The random forest algorithm is used to fill the missing values, including: The data with missing values is used as the target variable to be predicted by the random forest model, and the other data is used as the input variable for prediction; Traverse all the data and start filling in the data with the least missing data; After filling a missing value, retrain the random forest model with the newly filled data and use the trained model to fill the next missing value; Until all missing values are filled.
4. The active power distribution network line loss calculation method according to claim 2, characterized in that: The use of the standard Z-score method to detect outliers in the data includes: In the formula, x i is the data point; μ is the mean of all data points; σ is the standard deviation of all data points; |z i | represents the distance between the score within the standard deviation and the population mean. When |z i When it is greater than the threshold, it is considered an outlier.
5. The active power distribution network line loss calculation method according to claim 2, characterized in that: The normalization of the data comprises: Where: x is the line loss index; x min is the minimum value in the index; x max is the maximum value among the indicators; x' i is the normalized index.
6. The active power distribution network line loss calculation method according to claim 1, characterized in that: The correlation analysis of the line loss characteristics of the active distribution network after the distributed power source is connected based on the random matrix theory includes: Line loss rate, voltage, current and power are selected as elements for correlation analysis; Construct a random matrix of line loss rate, voltage, current and power, and obtain the standard line loss characteristic matrix based on random matrix theory. A quantitative index of line loss rate correlation is determined, and the correlation between the line loss characteristics and the line loss rate is analyzed according to the quantitative index to obtain the magnitude of the correlation between the line loss characteristics and the line loss rate.
7. The method for calculating line loss of active power distribution network according to claim 6, characterized in that: Based on the random matrix theory, the standard line loss characteristic matrix is obtained, including: Assumption Matrix is a matrix with N rows and 4 columns, and each element is an independently distributed random variable; Where: Represents the 96-moment data of line loss rate, voltage, current and power respectively; Pair Matrix The elements in are processed by basic transformation to obtain the transition matrix Where: Line loss characteristics The mean of Line loss characteristics The standard deviation of Line loss characteristics The mean of Line loss characteristics The standard deviation of The line loss characteristic singular value equivalent matrix is: Where: U is the Haar unitary matrix, and the equivalent matrix for the line loss characteristic singular value is, The line loss characteristic singular value equivalent matrix is normalized to obtain the standard line loss characteristic matrix When c = N / T is a constant value, and N and T approach infinity, the line loss characteristic matrix The eigenvalue empirical spectral distribution function is shown below: Where: c∈(0,1], λ represents the eigenvalue of the established line loss characteristic matrix, and p(λ) represents The eigenvalue empirical spectral distribution function of The eigenvalues of are distributed in an outer ring with a radius of 1 and an inner ring with a radius of (1-c) L / 2 within the ring.
8. The method for calculating line loss of active power distribution network according to claim 6, characterized in that: The method of determining the quantitative index of line loss rate correlation includes: The mean spectrum radius MSR is used as a quantitative indicator for line loss rate correlation analysis; The average value of all eigenvalue moduli of the matrix is defined as the average spectrum radius, which is the statistic of line loss rate, voltage, current, and power line loss characteristics; The average spectral radius is calculated as follows: The correlation between the line loss characteristics and the line loss rate is expressed by observing the change in the average spectrum radius.
9. The method for calculating line loss of active power distribution network according to claim 8, characterized in that: The step of analyzing the correlation between the line loss feature and the line loss rate according to the quantitative index to obtain the correlation between the line loss feature and the line loss rate comprises the following steps: Analyze the impact of three line loss characteristics, namely voltage, current and power, on a single line loss rate variable; Collect n1 line loss rate variables within a period of time T and construct a matrix Get the line loss characteristic matrix Line loss characteristic matrix Z n2 Introduce random noise N and get the matrix Z n3 ; Construct experimental data source matrix A and comparative data source matrix A N : Select N w ×T w The data acquisition window of the line loss feature data source is sampled and processed, and continuous sampling processing is performed through window sliding; Calculate the experimental matrix A and the comparison matrix A respectively through the data sampling window N The standard matrix and calculate its average spectral radius κ MSR,A and The average spectral radius function κ that varies with time is obtained by moving the window MSR,A (t) and The correlation changes of n1 line loss rate variables and n2 line loss characteristic variables d MSR (t) is defined as: From t1 to t2, the correlation between line loss characteristics and line loss rate is s MSR :
10. The method for calculating line loss of active power distribution network according to claim 9, characterized in that: The line loss characteristic matrix Z n2 Introduce random noise N, including: WITH N3 =Z' n1 +m×N; Where: N is the noise matrix of (k×n1)×T and obeys the normal distribution; m is the noise amplitude; To avoid the influence of noise amplitude on the analysis results, a fixed signal-to-noise ratio is used for analysis. The definition of signal-to-noise ratio is as follows:
11. The method for calculating line loss of active power distribution network according to claim 9, characterized in that: The line loss characteristic matrix is obtained After that, it also includes: When the difference between n1 and n2 exceeds the set value, the matrix Z with less data n1 Or line loss characteristic matrix Z n2 Expand k times, where k is the largest integer that does not exceed the value obtained by dividing the larger of n1 and n2 by the other.
12. The active power distribution network line loss calculation method according to claim 1, characterized in that: The method of using the model stacking ensemble learning method to fuse the causal logic of the mechanism model with the prediction accuracy of the data model includes the following steps: Obtain the distribution network topology, line parameters and historical load of each node, and build a physical model for active distribution network line loss calculation based on loop analysis method; A data-driven model for line loss calculation of active distribution network based on error back propagation BP neural network is constructed. The line loss feature with the greatest correlation with line loss rate is selected as input data. The line loss rate of each branch in different time periods is obtained through data calculation. The physical model and the data model are used as base learners of the stacking integration, and the calculation results of the base learners are input into the meta learner for training; After the training is completed, the calculation results of the distribution network line loss are obtained.
13. The method for calculating line loss of active power distribution network according to claim 12, characterized in that: The physical model for calculating line loss of active distribution network based on loop analysis method is constructed, including: Get the power node voltage V 0 =V0E, where: V 0 is the power node voltage, E is an N×1-order all-1 matrix; Calculate the node injection current Where: S i is the power of node i; Calculate ΔV k , where ΔV is the voltage difference and k is the number of iterations; Calculate V k =V 0 -ΔV k ; Set the calculation accuracy to λ and repeat the calculation until ΔV is satisfied. k '=|V k -V k-1 |≤λ,output V k , if not satisfied, jump to the step of calculating node injection current; The complex power loss of the distribution network is obtained as: Where: Respectively represent i b 、i s The conjugate transpose of; B is the N×N dimensional network path matrix, Z b is the branch impedance matrix, i b is the branch current, i s is the loop current, ∑=BZ b B T is the loop impedance matrix, and T is the number of columns in the matrix.
14. The method for calculating line loss of active power distribution network according to claim 12, characterized in that: The data driven model for active distribution network line loss calculation based on error back propagation BP neural network is constructed, including: The data driven model includes an input layer, a hidden layer and an output layer; The hidden layer uses the least square method as the activation function, and the number of nodes in the hidden layer is determined by the following formula: or l = log2n; Where: a ranges from 1 to 10, indicating the number of neurons in the input layer, and l represents the number of neurons and nodes in the hidden layer.
15. The method for calculating line loss of active power distribution network according to claim 12, characterized in that: The method of using the physical model and the data model as base learners of the stacking integration and inputting the calculation results of the base learners into a meta learner for training comprises the following steps: For a data set S = {(y n ,x n ),n=1,...,N}, where the feature vector of the nth sample is x n , the predicted value is y n , the number of corresponding features is p, that is, each feature vector is (x1,x2,...,x p ); The data set is randomly divided into K subsets of roughly equal size, denoted as S1, S2, …, S K , S -k =SS k , S k and S -k Defined as the test set and training set of the k-th fold in k-fold cross validation; For the first layer model, it contains K base learners, in the training set S -k The base model L is obtained by training with the kth algorithm k , where k ranges from 1 to K; The first-layer base learner uses the physical calculation model and the BP neural network model, and inputs the calculation results of the base learner into the meta learner for training; The meta-learner uses the least squares method to calculate the calculation results obtained by training different base learners, and minimizes the sum of squares of the residuals between the model calculation value and the input value by adjusting the coefficients.
16. An active power distribution network line loss calculation device, characterized in that: Using the method according to any one of claims 1 to 15, the device comprises: A correlation analysis unit is used to obtain the multi-time dimension operation status data of the distribution network to which the distributed power source is connected, and to perform correlation analysis on the line loss characteristics of the active distribution network after the distributed power source is connected based on the random matrix theory, so as to obtain the line loss characteristics with the strongest correlation with the line loss rate; A modeling unit, for establishing a data-mechanism hybrid driven line loss calculation model by using a model stacking ensemble learning method to fuse the causal logic of the mechanism model and the prediction accuracy of the data model according to the line loss characteristics and based on the mechanism model and data model of traditional line loss calculation; An evaluation unit is used to obtain historical data of active distribution networks under different subject access as calculation examples, analyze the data-mechanism hybrid driven line loss calculation model, evaluate the calculation accuracy of the model using evaluation indicators, and optimize the model parameters according to the evaluation results; A calculation unit is used to calculate the line loss using the optimized data-mechanism hybrid driven line loss calculation model.
17. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 15 is implemented.
18. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 15 is implemented.