Bearing capacity assessment method based on random forest model

Through the method based on the random forest algorithm, a feature vector containing multiple system features is constructed, which solves the lack of comprehensive problems in the assessment of the carrying capacity of the distributed power supply in the distribution network, and achieves a fast and accurate evaluation effect, providing strong support for the planning and operation of the distribution network.

CN119515201APending Publication Date: 2025-02-25STATE GRID GANSU ELECTRIC POWER CORP DINGXI POWER SUPPLY CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411870524.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art is difficult to effectively evaluate the carrying capacity of distributed power supplies in distribution networks, especially in terms of time, date and climate factors.

Method used

Using a random forest algorithm method, a feature vector containing the characteristics of the power grid system, environmental system and time system is constructed by collecting and preprocessing the basic data of the distribution network, distributed power operation data and environmental factor data, and a random forest model is used to train to evaluate the distributed power bearing capacity of the distribution network.

Benefits of technology

It realizes a rapid and accurate assessment of the carrying capacity of distributed power supply in the distribution network, improves the comprehensiveness and accuracy of the assessment, and provides strong support for the planning and operation of the distribution network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515201A_ABST
    Figure CN119515201A_ABST
Patent Text Reader

Abstract

The invention provides a method and a system for evaluating the bearing capacity of a distributed power supply of a power distribution network based on a random forest algorithm, and aims to comprehensively consider time and date factors, climate factors, power grid basic data and distributed power supply operation data to quickly and accurately evaluate the bearing capacity of the distributed power supply of the power distribution network. The method comprises the steps of data collection and preprocessing, feature selection and extraction, model construction and training, bearing capacity evaluation, result output and the like. A refined evaluation system containing 11 single indexes is constructed, a random forest model is utilized to learn and predict characteristic variables, finally, a bearing capacity evaluation result of the power distribution network on the distributed power supply is output, and whether the bearing capacity is saturated or not is represented by two grades of green and red. According to the method, the comprehensiveness and accuracy of evaluation are effectively improved, and powerful support is provided for planning and operation of the power distribution network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power systems, and in particular to a method and system for evaluating the carrying capacity of distributed power sources in a distribution network based on a random forest algorithm. Background Art

[0002] At present, with the explosive growth of distributed renewable energy grid-connected installed capacity, the traditional grid carrying capacity assessment guidelines have been unable to adapt to the needs of distributed renewable energy development. Therefore, it is urgent to further improve the assessment methods to adapt to the needs of the new situation. Summary of the invention

[0003] In order to solve the above problems, the present invention proposes a method and system for evaluating the carrying capacity of distributed power sources in a distribution network based on a random forest algorithm. The method adds time and date factors and climate factors to the traditional grid carrying capacity evaluation guidelines, so that multiple factors can be comprehensively considered to quickly and accurately evaluate the carrying capacity of distributed power sources in the distribution network.

[0004] The method includes the steps of data collection and preprocessing, feature selection and extraction, model construction and training, carrying capacity assessment and result output. Specifically,

[0005] The present invention proposes a method for evaluating the carrying capacity of distributed power sources in a distribution network based on a random forest algorithm. The method collects basic data of the distribution network, operating data of distributed power sources, and environmental factor data, and after preprocessing, uses a random forest model to perform feature analysis and extraction on these data, comprehensively considers time, date, and climate factors, and realizes a rapid and accurate evaluation of the carrying capacity of distributed power sources in the distribution network, and intuitively displays the evaluation results.

[0006] Preferably, the method comprises:

[0007] S1. Data collection and preprocessing: Collect basic data of the distribution network, operating data of distributed power sources, and environmental factor data; the basic data of the distribution network includes: structural parameters and equipment parameters of the distribution network; the operating data of distributed power sources includes: output and grid-connected status; the environmental factor data includes: wind speed, light intensity, temperature, humidity, and sunshine duration; the time and date factors include: season, and preprocess these data, including data cleaning, missing value processing, and outlier detection and processing to ensure data quality;

[0008] S2. Feature selection and extraction, constructing feature vectors: extracting characteristic variables related to the distributed power generation capacity of the distribution network from the preprocessed data, and establishing an evaluation system consisting of the power grid system, environmental system, and time system;

[0009] S3. Use a detailed evaluation system containing 11 individual indicators to construct a random forest model: randomly divide the preprocessed and feature-extracted data set into a training set and a test set; use the feature variables constructed in step S2 as input and the carrying capacity of the distributed power generation of the distribution network as output to construct a random forest model;

[0010] S4. Model training and optimization: Use historical data to train the random forest model and optimize the model through cross-validation method to improve the prediction accuracy and generalization ability of the model, and further select and optimize the feature variables as needed;

[0011] S5. Output the final result: Input the data to be evaluated into the trained random forest model to obtain the model output bearing capacity prediction value.

[0012] Preferably, the step S1 comprises:

[0013] Data preprocessing includes the processing of missing values ​​and outliers, as well as data normalization to standardize and normalize the data;

[0014] First, missing values ​​and outliers are processed, and outliers are treated as missing values. The local mean filling method is used. The calculation formula of the local mean filling method is:

[0015]

[0016] Where x m is the missing data value, k is the number of existing data values ​​around the missing data; m represents the index of the current missing value, χ j Represents the value corresponding to index j;

[0017] The data normalization method uses Min-Max normalization, and the calculation is shown in the following formula:

[0018]

[0019] In the formula, x is the current data value; x min and x max are the minimum and maximum values ​​in the vector where x is located; norm is the normalized value.

[0020] Preferably, step S2 comprises:

[0021] The grid system characteristics include: reverse load rate λ, independent installable capacity P m , short circuit current I m , voltage deviation δU, harmonic deviation H d ; Environmental system characteristics include: temperature T, humidity H, light intensity I light, duration of illumination D light , wind speed W; time system characteristics include: season code S;

[0022] Combining these features into a feature vector can be expressed as:

[0023] X=[λ,P m ,I m ,δU,H d ,T,H,I light ,D light ,W,S]

[0024] This feature vector x will be used as the input feature matrix for subsequent random forest model training and prediction.

[0025] Preferably, step S3 comprises:

[0026] For each decision tree T in the random forest i (x), receives an input sample x: x is a feature vector extracted from the above input feature matrix X, and outputs a predicted value;

[0027] When the entire input feature matrix X is input into the random forest model, the model will make a prediction for each sample in X and output a prediction result vector This prediction result vector is the average of the prediction results of all decision trees for the same sample; the random forest prediction is expressed as:

[0028]

[0029] n is the total number of decision trees;

[0030] The output target variable is expressed as:

[0031] Y=C

[0032] Where C represents the carrying capacity of distributed power sources in the distribution network.

[0033] Preferably, the step S4 comprises:

[0034] S41: Data Preparation

[0035] Take the historical data set (X train ,Y train )

[0036] Input feature matrix X train :Assume that it is an N×p matrix X train , where N is the number of samples, p = 11 is the number of features, including power grid system features, environmental system features and time system features; label vector: an N × 1 vector Y train, representing the carrying capacity label of the distribution network distributed power source corresponding to each sample.

[0037] S42: Initialize the random forest model

[0038] The random forest consists of multiple decision trees. For each tree, a sample set is drawn with replacement from the training set

[0039] X train and Y train to train the tree;

[0040] S43: Random forest model training and optimization

[0041] S43.1: Node initialization: Starting from the root node of the decision tree, at this time the node contains all training samples X train and the corresponding label Y train ;

[0042] S43.2: Feature selection: Randomly select m features (m < p) from the p features of X train as the candidate splitting features of the current node;

[0043] S43.3: Information gain calculation: For each candidate splitting feature X j (j = 1, 2,..., m), calculate its information gain IG(X j , Y);

[0044] S43.4: Select the optimal feature: Among all candidate splitting features, select the feature with the largest information gain as the splitting feature of the current node;

[0045] S43.5: Node splitting: According to the value of the selected splitting feature, divide the sample set of the current node into several subsets, each subset corresponding to a child node. For each child node, repeat steps 2 to 5 until the set stop condition is met.

[0046] S44: Model optimization

[0047] S44.1 Cross - validation

[0048] K - fold cross - validation: Divide the data set into K parts, and take turns using K - 1 parts as the training set and 1 part as the validation set; For each training set, train the random forest model and calculate the MSE on the corresponding validation set; Calculate the average MSE of the K - fold cross - validation to evaluate the overall performance of the model;

[0049]

[0050] where N is the number of training set samples, Y i is the actual carrying capacity label of the i - th sample, is the carrying capacity of the i-th sample predicted by the model. In random forests, is the average of all decision tree predictions;

[0051] S44.2 Parameter Tuning

[0052] Search for the optimal parameter combination in the parameter space. For each parameter combination, perform cross validation and calculate the average MSE. Select the parameter combination with the smallest average MSE as the optimal parameter and retrain the random forest model using the optimal parameters.

[0053] Preferably, the step S5 comprises:

[0054] Prepare the data to be evaluated X new , which contains the same type of features as the training data; X new Input into the trained random forest model, and the model outputs the predicted carrying capacity value Represents the predicted carrying capacity of distributed generation in the distribution network.

[0055] Preferably, two thresholds are set to classify the bearing capacity levels, as follows:

[0056] When the predicted bearing capacity value is less than the first threshold value T1, it means that the bearing capacity is far from saturated and the grade is excellent; when the evaluation value is between the first threshold value T1 and the second threshold value T2, it means that the bearing capacity is close to saturation or has a certain margin, and the grade is ordinary; when the evaluation value is greater than or equal to the second threshold value T2, it means that the bearing capacity is already saturated or overloaded, and the grade is poor.

[0057] The present invention effectively improves the comprehensiveness and accuracy of the evaluation and provides strong support for the planning and operation of the distribution network. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation on the embodiments of the present invention;

[0059] Figure 1 A flowchart of a method according to the present invention;

[0060] Figure 2 FIG. 4 is a block diagram of a random forest model according to the present invention. DETAILED DESCRIPTION

[0061] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0062] The present invention proposes a method and system for evaluating the carrying capacity of distributed power sources in a distribution network based on a random forest algorithm. The method adds time and date factors and climate factors to the traditional power grid carrying capacity evaluation guidelines, so that multiple factors can be comprehensively considered to quickly and accurately evaluate the carrying capacity of distributed power sources in the distribution network.

[0063] The method includes steps such as data collection and preprocessing, feature selection and extraction, model construction and training, carrying capacity assessment and result output, which are described in detail as follows:

[0064] Reference Figure 1-2 As shown, the method specifically comprises the following steps:

[0065] S1. Collect and preprocess data.

[0066] Collect basic data of the distribution network, operating data of distributed power sources, and environmental factor data, and pre-process these data to ensure data quality and consistency.

[0067] The basic data include the structural parameters and equipment parameters of the distribution network, etc. The operating data of the distributed power source include the output, grid connection status, etc. The environmental factor data include wind speed, light intensity, temperature, etc.

[0068] The preprocessing of the data includes processing of missing values ​​and outliers, and normalization of the data, so as to standardize and normalize the data. The processed data is input into the data set for data training.

[0069] First, missing values ​​and outliers are processed: outliers are regarded as missing values, and the local mean filling method is used to process missing values. The calculation formula of the local mean filling method is:

[0070]

[0071] Where x m is the missing data value, k is the number of existing data values ​​around the missing data; m represents the index of the current missing value, χ j Represents the value corresponding to index j; the data normalization method uses Min-Max normalization, and the calculation is shown in the following formula:

[0072]

[0073] In the formula, x is the current data value; x min and x max are the minimum and maximum values ​​in the vector where x is located; norm is the normalized value.

[0074] S2. Construct feature vector.

[0075] The characteristic variables related to the carrying capacity of distributed power generation in the distribution network are extracted from the preprocessed data to comprehensively reflect the operation status of the power grid, the processing characteristics of distributed power generation and the impact of environmental factors on the power grid, and establish a new evaluation system. The evaluation system consists of three systems, namely the power grid system, the environmental system and the time system.

[0076] The grid system characteristics include: reverse load rate λ, independent installable capacity P m , short circuit current I m , voltage deviation δU, harmonic deviation H d ; Environmental system characteristics include: temperature T, humidity H, light intensity I light , duration of illumination D light , wind speed W; time system characteristics include: season code S (1 represents spring, 2 represents summer, 3 represents autumn, and 4 represents winter).

[0077] Grid system characteristics:

[0078] F grid ={λ,P m ,I m ,δU,H d}

[0079] Environmental system characteristics:

[0080] F env ={T,H,I light ,D light ,W}

[0081] Time system features:

[0082] F time ={S}

[0083] Combining these features into a feature vector can be expressed as:

[0084] X=[λ,P m ,I m ,δU,H d ,T,H,I light ,D light ,W,S]

[0085] This feature vector x will be used as input information for subsequent random forest model training and prediction.

[0086] S3. Use the above evaluation system to build a random forest model.

[0087] A detailed evaluation system containing 11 individual indicators is used to construct a random forest model. The preprocessed and feature-extracted dataset is divided into a training set and a test set, with a ratio of 80% training set and 20% test set. Random forest model: A random forest is an integrated model consisting of n decision trees, each tree T i (x) are trained based on a randomly selected subset of features and independently make predictions for the input sample x.

[0088] Decision Tree Model:

[0089] For each decision tree T in the random forest i (x), which receives an input sample x (here, x is the feature vector extracted from the input feature matrix X) and outputs a predicted value. In a random forest, the weights α of all decision trees are i Usually equal, that is Where n is the total number of decision trees. Therefore, the decision tree model can be expressed as:

[0090]

[0091] Random Forest Prediction:

[0092] When we input the entire input feature matrix X into the random forest model, the model will make a prediction for each sample in X and output a prediction result vector This prediction vector is the average of all decision trees’ predictions for the same sample. Therefore, the random forest prediction can be expressed as:

[0093]

[0094] The present invention uses the characteristic variables extracted in step S2 as input and the carrying capacity of the distributed power source of the distribution network as output to construct a random forest model.

[0095] The output target variable is expressed as:

[0096] Y=C

[0097] Where C represents the carrying capacity of distributed power sources in the distribution network.

[0098] Specifically, the present invention constructs a random forest model including:

[0099] 1) Data preparation: Take historical data sets (X train ,Y train )

[0100] Input feature matrix: Assume it is an N×p matrix X train , where N is the number of samples, p = 11 is the number of features, including power grid system features, environmental system features, and time system features.train The refined evaluation system containing 11 single indicators constructed for step S2.

[0101] Label vector: A vector Y of N×1 train , representing the bearing capacity label of the distributed power source in the distribution network corresponding to each sample.

[0102] 2) Construction of the random forest model

[0103] Random forest: Composed of multiple decision trees. Suppose T decision trees are to be constructed, then the T decision trees form the random forest model of the present invention.

[0104] Sampling with replacement: For each tree, a sample set is drawn with replacement from the training set X train and Y train to train the tree.

[0105] 3) Construction of the decision tree, including:

[0106] 3.1 Node initialization

[0107] Starting from the root node, at this time the node contains all training samples X train and the corresponding label Y train

[0108] 3.2 Feature selection:

[0109] Randomly select m features (m < p) from the p features of X train as the candidate splitting features X j (j = 1, 2,..., m);

[0110] 3.3 Information gain calculation: For each of the candidate splitting features X j (j =

[0111] 1, 2,..., m), calculate its information gain IG(X j , Y).

[0112] The calculation formula for the information gain is:

[0113] IG(X j , Y) = H(Y) - H(Y|X j )

[0114] H (entropy): A metric used to represent the uncertainty, impurity, or degree of chaos of a data set or random variable. The larger the value of entropy, the higher the uncertainty of the data set or random variable, that is, the more chaotic the data; conversely, the smaller the value of entropy, the lower the uncertainty of the data set or random variable, that is, the more ordered the data.

[0115] H(Y) (entropy of label Y) represents the impurity or chaos of the dataset.

[0116]

[0117] Among them, p i is the probability that label Y takes the value of the i-th category. The specific calculation steps are as follows:

[0118] The number of samples n for each category in the statistical data set i (i=1,2,...,k), where k is the total number of categories.

[0119] Calculate the probability p of each category i =n i / N, where N is the total number of samples.

[0120] The probability p of each category i Substituting it into the entropy formula for calculation, we get H(Y).

[0121] H(Y|X j )(Given feature X j The conditional entropy of the label Y after the feature X j The remaining impurity or confusion of the data set after the value of is determined.

[0122] H(Y|X j )=∑p(X j =v)H(Y|X j =v)

[0123] Among them, p(X j =v) is the feature X j The probability of taking the value v, H(Y|X j =v) is in the feature X j The entropy of label Y under the condition of value v. The specific calculation steps are as follows:

[0124] Step 1. For feature X j For each value v of , count the number of samples n of each category under this value i v

[0125] (i=1,2,...,k)

[0126] Step 2. Calculate the probability p of each category under this value i v=n i v / n v , where n v It is feature X j The value is the total number of samples of v.

[0127] Step 3. Calculate the entropy H(Y|X) of label Y under this valuej =v) = -∑p i vlog2(p i v)

[0128] Step 4. Calculate feature X j The weight p(X j =v)=n v / N

[0129] Step 5. The conditional entropy H(Y|X j =v) and its weight p(X j =v) and sum to get H(Y|X j )

[0130] 3.4 Selecting the best features

[0131] Among all candidate split features, the feature with the largest information gain is selected as the split feature of the current node.

[0132] 3.5 Node Split

[0133] According to the value of the selected split feature, the sample set of the current node is divided into several subsets, each of which corresponds to a child node. For example, if the feature "season" is selected, the algorithm will traverse all samples in the current node and assign them to the corresponding subsets according to the value of "season" in each sample. For example, all samples with "season" of spring will be assigned to one subset, all samples with "season" of summer will be assigned to another subset, and so on.

[0134] For each child node, repeat steps 2 to 5 until the stopping condition is met:

[0135] i) The number of samples in the node is less than the minimum sample limit.

[0136] ii) The depth of the tree reaches the maximum depth limit.

[0137] iii) The sample set of the current node is already pure (i.e., all samples have the same label).

[0138] iv) The information gain is less than a certain threshold, indicating that further splitting will not significantly improve the performance of the model.

[0139] Loss function calculation

[0140]

[0141] For the random forest model, we use mean squared error (MSE) as the loss function to evaluate the model performance: where N is the number of training set samples, Y is the i is the actual carrying capacity label of the ith sample, is the carrying capacity of the i-th sample predicted by the model. In random forests, is the average of all decision tree predictions.

[0142] S4: Model training and optimization.

[0143] The random forest model is trained using historical data and optimized through cross-validation to improve the model's prediction accuracy and generalization ability. During the training process, feature variables can be further selected and optimized as needed to improve the model's interpretability and practicality.

[0144] S41: Cross Validation

[0145] K-fold cross validation: Divide the dataset into K parts, and use K-1 parts as training sets and 1 part as validation sets in turn. For each training set, train the random forest model and calculate the MSE on the corresponding validation set. Calculate the average MSE of the K-fold cross validation to evaluate the overall performance of the model.

[0146] For each iteration, the MSE calculation formula on the validation set is:

[0147]

[0148] Among them, MSE i is the MSE value of the i-th iteration, n i is the number of samples in the validation set at the i-th iteration, y j,i is the true value of the jth sample in the validation set in the i-th iteration, is the model's prediction for the jth sample in the validation set at the i-th iteration.

[0149] In each iteration of K-fold cross validation, an MSE (mean square error) value is calculated to evaluate the performance of the model on the corresponding validation set. For the i-th iteration, the MSE value is calculated in the following way: First, determine the number of samples in the validation set of this iteration, denoted as n i ; Then, traverse each sample in the validation set, and for the jth sample, calculate its true value y j,i With the model prediction value Finally, sum the squares of these differences and divide them by the number of samples in the validation set n i , and get the MSE value of the i-th iteration. This MSE value reflects the prediction accuracy of the model on the i-th iteration validation set.

[0150] S42: Parameter Tuning

[0151] Grid search / random search: Search for the best parameter combination in the parameter space. For each parameter combination, perform cross validation and calculate the average MSE. Select the parameter combination with the smallest average MSE as the optimal parameter and retrain the random forest model using the optimal parameters.

[0152] Through the above steps, we can build a random forest model with excellent performance to predict the carrying capacity of distributed power sources in the distribution network.

[0153] S5: Evaluation and prediction

[0154] S51: Data preparation: prepare the data to be evaluated X new ,It contains the same types of features as the training data.

[0155] S52: Input model:

[0156] X new Input to the trained random forest model.

[0157] S53: Get the predicted value:

[0158] Model output bearing capacity prediction value

[0159]

[0160] Output predicted value Represents the predicted carrying capacity of distributed generation in the distribution network

[0161] Load-bearing capacity level or range:

[0162] Based on the evaluation value, we set two thresholds to divide the bearing capacity level, as follows:

[0163] When the evaluation value is less than the first threshold (T1), it means that the carrying capacity is far from saturation and the grade is excellent (green).

[0164] When the evaluation value is between the first threshold (T1) and the second threshold (T2), it means that the bearing capacity is close to saturation or has a certain margin but requires attention, and the grade is normal (yellow).

[0165] When the evaluation value is greater than or equal to the second threshold (T2), it means that the bearing capacity is saturated or overloaded, and the grade is poor (red).

[0166] In this way, we can divide the carrying capacity into three levels according to the evaluation value: excellent (green), ordinary (yellow) and poor (red).

[0167] Preferably, the method for determining a threshold value of the present invention comprises:

[0168] 1) Preliminary division:

[0169] We can first make preliminary observations and statistics on the predicted values ​​of carrying capacity based on historical data and model prediction results. We try to divide the predicted values ​​into three parts, corresponding to the three levels of excellent, ordinary and poor.

[0170] 2) Initial setting of threshold:

[0171] Based on the results of the preliminary division, two preliminary thresholds T1 and T2 are set.

[0172] T1 is used to distinguish between excellent and ordinary grades, and T2 is used to distinguish between ordinary and poor grades.

[0173] 3) Verification and adjustment:

[0174] Use the validation set data to verify the thresholds that are initially set. Based on the validation results, observe the evaluation accuracy of the model at different thresholds. If the accuracy is insufficient, the values ​​of T1 and T2 can be gradually adjusted until an optimal threshold combination is found.

[0175] 4) Consider the evaluation criteria:

[0176] In the process of adjusting the threshold, the comprehensive evaluation system and evaluation criteria should be fully considered. For example, if the reverse load rate in a certain area is generally low, the threshold of the excellent level can be adjusted higher accordingly.

[0177] 5) Finalization:

[0178] After multiple verifications and adjustments, the final thresholds T1 and T2 are determined to ensure that the two thresholds can accurately map the predicted values ​​to the three evaluation levels of excellent, ordinary and poor. Table 1 shows a comprehensive evaluation index system and evaluation criteria for carrying capacity according to an embodiment of the present invention.

[0179] Table 1 Comprehensive evaluation index system and evaluation criteria for bearing capacity

[0180]

[0181]

[0182]

[0183] The determination process fully considers the actual conditions and differences in different regions, as well as the impact of different seasons on the stable operation of the power grid and the output of distributed power sources.

[0184] The thresholds are updated and adjusted regularly to adapt to the development and changes of the power grid and distributed power sources.

[0185] The present invention is based on the random forest algorithm, and aims to comprehensively consider the time date, climate factors and the basic operating data of the power grid and distributed power sources, so as to realize the rapid and accurate evaluation of the carrying capacity of the distribution network. The method includes four core steps: data collection and preprocessing, feature selection and extraction, model construction and training, and carrying capacity evaluation and result output. By constructing a refined evaluation system containing 11 single indicators, and using the random forest model to learn and predict the characteristic variables, the distribution network's carrying capacity evaluation results for distributed power sources are finally output, and the carrying capacity status is intuitively displayed in three levels of green (excellent), yellow (ordinary), and red (poor). The advantage is that it comprehensively considers a variety of influencing factors, improves the comprehensiveness and accuracy of the evaluation, and at the same time, through the application of the random forest algorithm, effectively improves the prediction accuracy and generalization ability, and provides a new solution for the carrying capacity evaluation of the distribution network.

[0186] The method proposed in the present invention is simple and easy to implement, has high reliability and strong adaptability, does not require any hardware equipment investment, and has good economy and practicality. According to different actual engineering needs, combined with actual data, the operation data information can be further explored to increase attention to abnormal data.

[0187] The above are only preferred embodiments of the present invention, but do not limit the patent scope of the present invention. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features with equivalent ones. Any equivalent structure made by using the contents of the present invention specification and drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present invention.

Claims

1. A method for evaluating the carrying capacity of distributed power sources in a distribution network based on a random forest algorithm, characterized in that: This method collects basic data of distribution network, distributed power supply operation data and environmental factor data, and after preprocessing, uses random forest model to analyze and extract features of these data, comprehensively considers time, date and climate factors, realizes rapid and accurate assessment of the carrying capacity of distributed power supply in distribution network, and intuitively displays the assessment results.

2. The method according to claim 1, characterized in that The method comprises: S1. Data collection and preprocessing: Collect basic data of the distribution network, operating data of distributed power sources, and environmental factor data; the basic data of the distribution network includes: structural parameters and equipment parameters of the distribution network; the operating data of distributed power sources includes: output and grid-connected status; the environmental factor data includes: wind speed, light intensity, temperature, humidity, and sunshine duration; the time and date factors include: season, and preprocess these data, including data cleaning, missing value processing, and outlier detection and processing to ensure data quality; S2. Feature selection and extraction, constructing feature vectors: extracting characteristic variables related to the distributed power generation capacity of the distribution network from the preprocessed data, and establishing an evaluation system consisting of the power grid system, environmental system, and time system; S3. Use a detailed evaluation system containing 11 individual indicators to construct a random forest model: randomly divide the preprocessed and feature-extracted data set into a training set and a test set; use the feature variables constructed in step S2 as input and the carrying capacity of the distributed power generation of the distribution network as output to construct a random forest model; S4. Model training and optimization: Use historical data to train the random forest model and optimize the model through cross-validation method to improve the prediction accuracy and generalization ability of the model, and further select and optimize the feature variables as needed; S5. Output the final result: Input the data to be evaluated into the trained random forest model to obtain the model output bearing capacity prediction value.

3. The method according to claim 2, characterized in that The step S1 comprises: Data preprocessing includes the processing of missing values ​​and outliers, as well as data normalization to standardize and normalize the data; First, missing values ​​and outliers are processed, and outliers are treated as missing values. The local mean filling method is used. The calculation formula of the local mean filling method is: Where Y N is the missing data value, k is the number of existing data values ​​around the missing data; m is the index of the current missing value, x j Represents the value corresponding to index j; The data normalization method uses Min-Max normalization, and the calculation is shown in the following formula: In the formula, x is the current data value; x min and x max are the minimum and maximum values ​​in the vector where x is located; norm is the normalized value.

4. The method according to claim 3, characterized in that The step S2 comprises: The grid system characteristics include: reverse load rate λ, independent installable capacity P m , short circuit current I m , voltage deviation δU, harmonic deviation H d ; Environmental system characteristics include: temperature T, humidity H, light intensity I light , duration of illumination D light , wind speed W; time system characteristics include: season code S; Combining these features into a feature vector can be expressed as: X=[λ,P m ,AND m ,δU,H d ,T,H,I light ,D light ,W,S] This feature vector x will be used as the input feature matrix for subsequent random forest model training and prediction.

5. The method according to claim 4, characterized in that The step S3 comprises: For each decision tree T in the random forest i (x), receives an input sample x: x is a feature vector extracted from the above input feature matrix X, and outputs a predicted value; When the entire input feature matrix X is input into the random forest model, the model will make a prediction for each sample in X and output a prediction result vector This prediction result vector is the average of the prediction results of all decision trees for the same sample; the random forest prediction is expressed as: n is the total number of decision trees; The output target variable is expressed as: Y=C Where C represents the carrying capacity of distributed power sources in the distribution network.

6. The method according to claim 5, characterized in that The step S4 comprises: S41: Data Preparation Take the historical data set (X train ,Y train ) Input feature matrix X train :Assume that it is an N×p matrix X train , where N is the number of samples, p = 11 is the number of features, including power grid system features, environmental system features and time system features; label vector: an N × 1 vector Y train , which represents the carrying capacity label of the distributed generation in the distribution network corresponding to each sample. S42: Initialize the random forest model A random forest consists of multiple decision trees. For each tree, X train and Y train A sample set is extracted with replacement to train the tree; S43: Random Forest Model Training and Optimization S43.1: Node initialization: Starting from the root node of the decision tree, the node contains all training samples X train and the corresponding label Y train ; S43.2: Feature Selection: Randomly select m features (m < p) from the p features of X train as the candidate splitting features for the current node; S43.3: Information gain calculation: For each candidate split feature X j (j=1,2,…,m), calculate its information gain IG(X j ,Y); S43.4: Select the best feature: Among all candidate split features, select the feature with the largest information gain as the split feature of the current node; S43.5: Node splitting: According to the value of the selected splitting feature, the sample set of the current node is divided into several subsets, each subset corresponds to a child node, and for each child node, steps 2 to 5 are repeated until the set stop condition is met. S44: Model Optimization S44.1 Cross-validation K-fold cross validation: Divide the dataset into K parts, use K-1 parts as training sets and 1 part as validation sets in turn; for each training set, train the random forest model and calculate the MSE on the corresponding validation set; calculate the average MSE of the K-fold cross validation to evaluate the overall performance of the model; Where N is the number of samples in the training set, Y i is the actual carrying capacity label of the ith sample, is the carrying capacity of the i-th sample predicted by the model. In random forests, is the average of all decision tree predictions; S44.2 Parameter Tuning Search for the optimal parameter combination in the parameter space. For each parameter combination, perform cross validation and calculate the average MSE. Select the parameter combination with the smallest average MSE as the optimal parameter and retrain the random forest model using the optimal parameters.

7. The method according to claim 6, characterized in that The step S5 comprises: Prepare the data to be evaluated X new , which contains the same type of features as the training data; X new Input into the trained random forest model, and the model outputs the predicted carrying capacity value Represents the predicted carrying capacity of distributed generation in the distribution network.

8. The method according to claim 7, characterized in that Two thresholds are set to classify the bearing capacity levels, as follows: When the predicted bearing capacity value is less than the first threshold value T1, it means that the bearing capacity is far from saturated and the grade is excellent; when the evaluation value is between the first threshold value T1 and the second threshold value T2, it means that the bearing capacity is close to saturation or has a certain margin, and the grade is ordinary; when the evaluation value is greater than or equal to the second threshold value T2, it means that the bearing capacity is already saturated or overloaded, and the grade is poor.