County load short-term prediction method considering differentiated social development level and dynamic power utilization characteristics of large users
Through Pearson correlation analysis and K-Means algorithm, strongly related social indicators were screened, combined with the improved stochastic forest algorithm, the problem of insufficient integration of social and economic development and large users' power consumption characteristics in county power load prediction was solved, and the prediction accuracy and reliability were improved.
Patent Information
- Application Number
- CN202510558306.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-08
AI Technical Summary
Traditional county power load prediction methods are difficult to effectively integrate the coupling relationship between social and economic development indicators, large users' power consumption characteristics and power load, resulting in insufficient prediction accuracy, especially when processing high-dimensional, multi-source heterogeneous data, there is a risk of overfitting.
The Pearson correlation analysis method is used to screen strongly related social indicators as input variables, combine the K-Means algorithm for user clustering, and use the improved random forest algorithm for load prediction, integrate the level of social development and the power consumption characteristics of large users to optimize the prediction model.
It improves the accuracy and reliability of county power load prediction, accurately identify the leading factors affecting county load changes, captures dynamic changes in large users' electricity consumption behavior, and supports the scientific planning and efficient operation of the power system.
Smart Images

Figure CN120454039A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power load forecasting, and in particular to a method for short-term county load forecasting that takes into account differentiated social development levels and dynamic electricity consumption characteristics of large users. Background Art
[0002] With the rapid development of my country's socio-economic development and the acceleration of rural electrification, county-level power load forecasting plays a vital role in power system planning and operation. Accurate load forecasting not only guides the efficient allocation of power resources but also improves the stability and economic efficiency of the power grid.
[0003] On the one hand, uneven socioeconomic development across counties leads to diverse electricity demand. Significant differences in economic scale, industrial structure, and consumption levels across counties profoundly impact electricity load. On the other hand, large consumers, the primary source of growth in county electricity load, exhibit highly dynamic electricity consumption characteristics. With new installations and capacity increases, user equipment is gradually upgrading to larger capacities and higher parameters, increasing load demand and exerting a growing impact on county load. Against this backdrop, traditional forecasting methods struggle to achieve ideal prediction results. They risk overfitting when processing high-dimensional, multi-source, heterogeneous data and fail to effectively integrate the coupled relationships between socioeconomic development indicators, large consumer electricity consumption characteristics, and electricity load.
[0004] To address the above problems, we designed a county load short-term forecasting method that takes into account the level of social development and dynamic electricity consumption characteristics to solve the above problems. Summary of the Invention
[0005] The purpose of the present invention is to solve the limitations and shortcomings of the existing technology, such as insufficient correlation mining of differentiated social development levels in counties, ignoring the mutation and dominance of large users' electricity consumption behavior, and insufficient algorithm adaptability. A county load short-term forecasting method that takes into account differentiated social development levels and dynamic electricity consumption characteristics of large users is proposed. Considering the development of large users as the main growth point of county load, the load characteristics of large users are introduced for load forecasting, which can significantly improve the forecast accuracy of county-level power load, break through the structural defects of traditional models, and provide a new solution for short-term load forecasting.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for short-term county load forecasting that considers differentiated social development levels and dynamic electricity consumption characteristics of large users includes the following steps:
[0008] Step S1: construct a social development level index system and a county load characteristic index system, and based on the Pearson correlation analysis method, screen and extract the strongly correlated social indicators that dominate the county load development as input variables;
[0009] Step S2: Using the K-Means algorithm, cluster large users with similar electricity consumption characteristics, and extract load characteristic contour curves of multiple user groups representing the typical electricity consumption level characteristics of each type of user;
[0010] Step S3: Based on the historical data of county-level unit power load and large users, combined with the business expansion registration information of large users and the load characteristic contour curves of various users, an improved random forest algorithm is used to perform load forecasting.
[0011] Further preferably, in step S1, the social development level index system consists of a criterion layer and an indicator layer. The criterion layer is divided into the overall economic development level, the social production and consumption level, and the future social development momentum. The indicator layer includes GDP, per capita GDP, local general public budget, industrial added value, total retail sales of consumer goods, total exports, the absolute value of actual use of foreign capital, GDP growth rate, total fixed investment, industrial added value above designated size, various deposit balances of financial institutions, and per capita disposable income of residents.
[0012] Further preferably, in step S1, the county load characteristic indicator system includes the maximum load value, minimum load value, average load value, peak-to-valley difference, load rate, maximum load utilization hours and 5% peak load duration of the specified time series load data.
[0013] Further preferably, based on the Pearson correlation analysis method, the method of screening and extracting the strongly correlated social indicators that dominate the development of county load is as follows:
[0014] By calculating the Pearson correlation coefficient between the social development level index and the county load characteristic index, the correlation relationship is obtained, and the strongly correlated social indicators that dominate the county load characteristics are extracted and used as the input of the improved random forest algorithm. Let the variables be x and y, and each group of samples is represented by r xy , then the Pearson correlation coefficient calculation formula is as follows:
[0015]
[0016] in,
[0017]
[0018] (x i ,y i ) represents the sample point, represents the sample mean;
[0019] Variables with an absolute value of correlation coefficient greater than or equal to 0.6 with any load characteristic indicator are defined as strongly correlated social indicators. A specified number of strongly correlated social indicators that dominate county load development are screened and extracted as input variables of the improved random forest algorithm.
[0020] Further preferably, step S2 uses a K-Means algorithm to cluster large users with similar electricity consumption characteristics, and extracts load characteristic contour curves of multiple user groups representing typical electricity consumption characteristics of each type of user, including:
[0021] Step S21, using the K-Means algorithm to cluster the time series load curves of large users with similar electricity consumption characteristics, includes the following steps:
[0022] Step S211: Collect historical load data of large users, record them at the same time interval, process missing values and outliers, align the load data and record the time, normalize and standardize the load data to obtain time series data to be clustered;
[0023] Step S212 , inputting pre-processed time series data, where the time series data represents a sample data set of a load curve of a large user;
[0024] Step S213, randomly selecting K different samples from the load curve sample data set of large users as initial cluster centers of the K-Means algorithm;
[0025] Step S214: Calculate the distance between the load data point and the cluster center, and divide each sample into the cluster with the closest center point. The Euclidean distance of the time series of the same length after processing is defined as:
[0026]
[0027] Where, L k and N k Represents the time series curve of the k-th cluster center point;
[0028] Step S215, using the sample mean of each cluster to update the cluster center;
[0029] Step S216, continuously iterating steps S214 and S215 until the cluster centers no longer change;
[0030] Step S217, output the final cluster center and K clusters;
[0031] Step S22: extract the load characteristic contour curves of the multi-user group representing the typical power consumption characteristics of each type of user. For the load curve of each large user in the cluster, the following is obtained:
[0032]
[0033] Where Load(i) is the cluster load curve vector, and the cluster load curve vector element l j is the average load of users included in the cluster at the jth moment, T is the range of the timing curve, n i is the total number of final cluster centers; Load(i, j) is the user load value contained in each cluster, 24t represents the 24t dimension, and the hour is selected as the minimum time interval. The isovalue curve of the load characteristics of the multivariate user group is the per-unit curve of Load(i).
[0034] Further preferably, step S3, based on the historical data of county-level unit power load and large users, combined with the large user expansion registration information and the load characteristic contour curves of multiple user groups, uses an improved random forest algorithm to perform load forecasting, including the following steps:
[0035] Step S31, data preprocessing: collecting historical load data of county-level unit power load and large users, social development level data, existing capacity and reported capacity data of large users, and removing outliers and missing values in the data;
[0036] Step S32: Optimize the random forest algorithm using the sparrow algorithm. The process is as follows:
[0037] Step S321: Initialize the position and speed of the sparrow group. Each sparrow represents a parameter set of the random forest algorithm. The initial position of each sparrow is:
[0038]
[0039] Where: x n,d Indicates the initial position of each sparrow;
[0040] Step S322: Calculate the prediction error of the random forest algorithm corresponding to each sparrow as the fitness value. The fitness value of all sparrows is expressed as follows:
[0041]
[0042] In the formula, f([x n,1 x n,2 …x n,d ]) represents the fitness value of each sparrow;
[0043] Step S323: Update the speed and position of each sparrow based on its current position and speed, as well as the global optimal position and individual optimal position. Search for food in random places, and the position of the sparrow population is updated to:
[0044]
[0045] Where L is the 1×d unit matrix; Q is a random number that obeys the normal distribution, t is the current number of iterations; iter max is the maximum number of generations; α is a random number in [0,1]; R2 is the warning value of sparrows; T s Safety threshold for sparrows; represents the state of the value of the i-th individual in the d-th dimension at time t, The state of the value of the i-th individual in the d-th dimension at time t+1, -i is the negative value of the individual index i, used to represent the weight or decay factor;
[0046] Step S324, repeating steps S322 and S323 until a predetermined number of iterations is reached or a stop condition is satisfied;
[0047] Step S325: Based on the optimal sparrow position, the optimal random forest algorithm input parameter combination is obtained. As the followers follow the finder to find food, the position of the sparrow population is updated as follows:
[0048]
[0049] Where: t is the current iteration number, The best position for being the first warning in the sparrow population: X W is the sparrow with the worst current position in the sparrow population; A is a 1×d matrix;
[0050] Step S33: Solving based on the improved random forest algorithm, the solving steps are as follows:
[0051] Step S331, inputting the optimal random forest algorithm parameter combination obtained by the sparrow algorithm optimization;
[0052] Step S332, constructing an initial training set based on the input feature vector and the target variable;
[0053] Step S333: Using the Bootstrap sampling method, randomly and with replacement, reselect n random forest samples from the initial training set as the training subset for the decision tree;
[0054] Step S334: For each node, apply the best segmentation method to m randomly selected variables, randomly select m features from W features, and select the best segmentation features and segmentation points to minimize the Gini impurity. For node t, the Gini impurity is defined as:
[0055]
[0056] Where c is the number of categories, p i is the proportion of samples belonging to class i in node t;
[0057] For continuous variables, find the best split point s at node t so that the weighted sum of the Gini impurity of the left and right child nodes after the split is minimized. Let the total number of samples in node t be n t , the number of samples in the left child node is The number of samples in the right child node is The Gini impurity after segmentation is:
[0058]
[0059] In the formula, G(t L ) and G(t R ) represent the Gini impurity of the left child node and the right child node respectively; by traversing all possible split points s, select G split The smallest split point is taken as the optimal split point;
[0060] Step S335: No upper limit is set for the number of splits, and the tree is not pruned until the number of samples in the node is less than the preset minimum number of samples or each node cannot be split any further. This step is repeated to construct multiple decision trees, forming an improved random forest algorithm structure consisting of multiple decision trees.
[0061] Step S336: Use the remaining samples as the test sample set, perform regression prediction on each decision tree in the random forest for each test sample, obtain the output of each tree, and use the improved random forest algorithm to estimate the average value of the county load short-term forecast:
[0062]
[0063] Among them, n tress is the total number of decision trees, y ij is the predicted value of the decision tree.
[0064] Compared with the existing technology, the beneficial effects of the present invention are: the present invention effectively integrates the coupling relationship between social and economic development indicators, large-user electricity consumption characteristics and power load through strong correlation screening of social indicators and load characteristics, user electricity consumption characteristic isovalue curves and improved random forest algorithm iterative optimization, breaks through the structural defects of traditional models, and provides a new solution for short-term load forecasting. The method should be able to accurately identify the dominant factors affecting county load changes, and effectively capture the dynamic changes in large-user electricity consumption behavior, improve the accuracy and reliability of county electricity load forecasting, and provide strong support for the scientific planning and efficient operation of the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is a flow chart of a method for short-term county load forecasting proposed by the present invention that takes into account differentiated social development levels and dynamic electricity consumption characteristics of large users;
[0066] Figure 2 This is an improved random forest algorithm solution process for a county load short-term forecasting method proposed by the present invention, which takes into account differentiated social development levels and dynamic electricity consumption characteristics of large users. DETAILED DESCRIPTION
[0067] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0068] This embodiment discloses a method for short-term forecasting of county loads that takes into account differentiated social development levels and dynamic electricity consumption characteristics of large users. This method constructs a social development level index system and a county load characteristic index system, and based on the Pearson correlation analysis method, screens and extracts strongly correlated social indicators that dominate the development of county loads as input variables. The K-Means algorithm is used to cluster large users with similar electricity consumption characteristics, and extracts the equivalent curves of load characteristics of multiple user groups representing the typical electricity consumption level characteristics of each type of user. Based on the historical data of county loads and large users, combined with the business expansion application information of large users and the equivalent curves of load characteristics of multiple user groups, an improved random forest algorithm is used to predict county power loads, such as Figure 1 As shown, the method mainly includes the following steps:
[0069] Step S1: Construct a social development level indicator system and a county load characteristic indicator system. Based on the Pearson correlation analysis method, screen and extract strongly correlated social indicators that dominate county load development as input variables.
[0070] Step S2: Using the K-Means algorithm, cluster large users with similar electricity consumption characteristics, and extract load characteristic contour curves of multiple user groups representing the typical electricity consumption level characteristics of each type of user;
[0071] Step S3: Based on the historical data of county-level unit power load and large users, combined with the business expansion registration information of large users and the load characteristic contour curves of various users, an improved random forest algorithm is used to perform load forecasting.
[0072] Specifically, the steps are as follows:
[0073] Step S1: construct a social development level indicator system and a county load characteristic indicator system. Based on the Pearson correlation analysis method, screen and extract the strongly correlated social indicators that dominate the county load development as input variables.
[0074] Step S11: constructing a social development level indicator system and a county load characteristic indicator system.
[0075] The social development indicator system consists of a criterion layer and an indicator layer. The social development indicator system is divided into three levels: overall economic development, social production and consumption, and future social development momentum. This level serves as the criterion layer. The overall economic development indicator layer includes GDP, per capita GDP, and local general public budgets; the social production and consumption indicator layer includes industrial value added, total retail sales of consumer goods, total exports, and the absolute value of actual foreign investment; and the future social development momentum indicator layer includes GDP growth rate, total fixed investment, industrial value added above designated size, various deposit balances of financial institutions, and per capita disposable income of residents. Selected indicators for each of these indicator layers can be found in the China County Statistical Yearbook.
[0076] As an influencing factor of differentiated social development levels, the social development level index system reflects the different indicators of differentiated social development levels in different counties. The index system is established to cover as many key indicators as possible from all aspects of social economy and industrial structure in order to distinguish various county units. The specific division is shown in Table 1.
[0077] Table 1 Social development level indicator system
[0078]
[0079] The public budget is the local general public budget revenue (100 million yuan) and the local general public budget expenditure (100 million yuan). Please distinguish the industrial added value according to the added value of the primary industry, the added value of the secondary industry, and the added value of the tertiary industry.
[0080] Step S12: construct a county load characteristic indicator system.
[0081] The maximum / minimum / average load values, peak-to-valley difference, load rate, maximum load utilization hours, and 5% peak load duration of the specified time series load data are selected and included in the county load characteristic indicator system. The specific representation of the above indicators is as follows:
[0082] In the load characteristic analysis of the power system, the load data in the specified time period are set as P1, P2, ...P n , where n is the number of time series load data points.
[0083] Maximum load value P max , minimum load value P min , average load value P average They are defined as:
[0084] P max =max{P1, P2, ... P n}
[0085] P min =min{P1, P2, ... Pn}
[0086]
[0087] Indicates the sum of load data in all time periods.
[0088] The peak-to-valley difference ΔP is defined as the difference between the maximum load value and the minimum load value in the specified time series load data: ΔP = P max -P min ,
[0089] Load rate K L Defined as the ratio of average load to maximum load, expressed as a percentage:
[0090]
[0091] Maximum load utilization hours are defined as the ratio of actual electricity consumption to maximum load during a specified period of time (usually one year):
[0092]
[0093] Where Δt is the time interval between each data point.
[0094] The 5% peak load duration is defined as the cumulative time during which the load value is greater than or equal to 95% of the maximum load value (i.e., the 5% peak load) within the specified time series load data period:
[0095]
[0096] Wherein, u(x) is a unit step function, when x≥0, u(x)=1; when x<0, u(x)=0.
[0097] Step S13: Pearson correlation analysis. Social development level index system and county load characteristic index system
[0098] Based on the Pearson correlation analysis method, strongly correlated social indicators that dominate county load development are screened and extracted as input variables: by calculating the Pearson correlation coefficient r between each social development level indicator and the county load characteristic indicator, their correlation is obtained, and the strongly correlated social indicators that dominate the county load characteristics are extracted and used as input variables of the improved random forest algorithm.
[0099] Let two variables be X and Y, and each group of samples is represented by r xy , the Pearson correlation coefficient calculation formula is as follows:
[0100]
[0101] in,
[0102]
[0103] (x i ,y i ) represents the sample point, Represents the sample mean.
[0104] A specified number of strongly correlated social indicators of the load development in the leading counties were screened and extracted as input variables of the improved random forest algorithm.
[0105] Through correlation analysis, the Pearson correlation coefficient was obtained. Variables with an absolute value of correlation coefficient greater than or equal to 0.6 with any county-level load characteristic index were defined as strongly correlated social indicators.
[0106] Collect data on social development level indicators and county load characteristic indicators to ensure the accuracy and completeness of the data.
[0107] The data should include multiple sample points to facilitate statistical analysis.
[0108] The correlation between the social development level index and the county load characteristic index was calculated using the Pearson correlation coefficient formula: Based on the calculated Pearson correlation coefficient r;
[0109] Analyze the correlation between social development level indicators and county load characteristic indicators:
[0110] r>0: Positive correlation, indicating that as the level of social development improves, the load characteristic indicators also tend to improve.
[0111] r<0: negative correlation, indicating that as the level of social development increases, the load characteristic index tends to decrease.
[0112] r≈0: No significant correlation.
[0113] Taking a county in the Yangtze River Delta region as an example, the correlation between social development level indicators (such as per capita GDP and education level) and load characteristic indicators (such as maximum load and load peak-to-valley difference) was studied. Through Pearson correlation coefficient calculation and significance test, it was found that there is a significant positive correlation between social development level and annual maximum load.
[0114] It's important to note that the strongly correlated social indicators that dominate county-level load development vary widely. Each county has distinct developmental characteristics. Some counties develop tourism (with a relatively developed service industry and a relatively high 95% peak load duration, thus showing a stronger correlation with the tertiary industry), while others have introduced manufacturing (with a three-shift system leading to pronounced peak-valley characteristics, due to the relatively stronger correlation with the secondary industry).
[0115] Step S2, using the K-Means algorithm to cluster large users with similar electricity consumption characteristics, and extracting the load characteristic contour curves of the multivariate user group representing the typical electricity consumption level characteristics of each type of user, specifically includes the following steps:
[0116] Step S21: clustering the time series load curves of large users with similar electricity consumption characteristics using the K-Means algorithm, specifically including:
[0117] Step S211, data collection and preprocessing, collect historical load data of n large electricity users, record them at the same time interval (hours), process missing values and outliers, align the load data recording time, normalize and standardize the load data, and obtain the time series data to be clustered.
[0118] Step S212: input the pre-processed time series data, which represents a sample data set of load curves of large users U = {U1, U2, ..., U n}, where U n is the nth curve sample.
[0119] Step S213 , initializing the cluster centers, and randomly selecting K different samples from the large user load curve sample dataset U as the initial cluster centers of K-means.
[0120] Step S214: Calculate the distance between the sample and the cluster center. Calculate the distance between each load data point and the cluster center in the large user load curve sample data set, and divide each sample into the cluster with the closest center point. i ={L1, L2, ..., L n} and N i ={N1, N2, ..., N n The Euclidean distance of} is defined as:
[0121]
[0122] Where, L k and N k Represents the time series curve of the k-th cluster center point; n represents a total of n time series data, generally 8760 (a total of 8760 hours in a whole year).
[0123] Step S215: recalculate the cluster center and update the cluster center using the sample mean of each cluster.
[0124] Step S216: continuously iterate steps S214 and S215 until the cluster centers of each cluster no longer change.
[0125] Step S217: Output the final cluster center and K clusters. Users with similar electricity usage characteristics are clustered into one cluster. The cluster represents a sample set with different characteristics in the large user load curve sample data set. Users with similar electricity usage characteristics are clustered into one cluster.
[0126] Step S22: extract the load characteristic contour curves of the multi-user group representing the typical power consumption characteristics of each type of user. For the R load curves of each major user in the cluster:
[0127]
[0128] Where Load(i) is the cluster load curve vector, the superscript T is the time series curve range, which is generally taken as a whole year (8760 hours), and the cluster load curve vector element l j is the average load of users in the cluster at time j, n i is the total number of final cluster centers; Load(i, j) is the user load value contained in each cluster, and 24t represents 24 dimensions (usually hours are used as the minimum time interval). The load characteristic contour curve of the multivariate user group is the per-unit curve of Load(i).
[0129] Load(i) is a 24t-dimensional vector that describes the load level of users in the cluster at 24t time points (usually 1-hour intervals) within t days, that is, it represents the load level of a class of users with similar electricity consumption characteristics.
[0130] Step S3, based on the historical data of county-level unit power load and large users, combined with the large user expansion registration information and the load characteristic contour curves of multiple user groups, the improved random forest algorithm (RFR) is used to perform load forecasting, such as Figure 2 As shown, specifically including:
[0131] Step S31, data preprocessing. Collect historical load data, social development level data, large user existing capacity and reported capacity data, etc., and construct a data set as input data. Remove outliers and missing values in the data to ensure data quality. Extract useful features from the original data, such as average load, load characteristic contours of multiple user groups, and corresponding large user capacities of various types. Extract features such as average load, peak-to-valley difference, and load rate from time series data; calculate spatial features such as capacity share and reported growth rate based on user capacity data; and construct economic-load correlation features by combining social development level indicator systems such as GDP. Perform Z-Score standardization on all numerical variables to eliminate the interference of dimensional differences on model training.
[0132] Step S32: Optimize the random forest algorithm using the Sparrow Scheme Algorithm (SSA). The Sparrow Scheme Algorithm is used to dynamically select a subset of features that are strongly related to load forecasting. For example, binary coding is used to indicate whether a feature is selected, thereby reducing the impact of redundant features on model performance.
[0133] Step S321: Initialize the position and velocity of the sparrow group. Each sparrow represents a parameter set for the random forest algorithm. Suppose there are n sparrows in a d-dimensional search space, then the initial position of each sparrow is:
[0134]
[0135] Where n is the number of sparrows, d is the variable dimension: that is, the number of random forest algorithm (RFR) parameter groups, x n,d Represents the initial position of each sparrow (assuming there are n sparrows in a d-dimensional search space.
[0136] Step S322: Calculate the prediction error (such as mean square error) of the random forest algorithm corresponding to each sparrow as the fitness value. The fitness value of all sparrows is expressed as follows:
[0137]
[0138] In the formula, f([x n,1 x n,2 …x n,d ]) represents the fitness value of each sparrow (assuming there are n sparrows in a d-dimensional search space).
[0139] Step S323 updates the speed and position of each sparrow based on its current position and speed, as well as the global optimal position and individual optimal position. As shown in the above formula, the finder with the highest fitness is the first to find food, and subsequent joiners obtain food through the earliest finder. The finder guides the entire population, searching for food in random locations. Its population position is updated as follows:
[0140]
[0141] Where: L is a 1×d matrix, L is a unit matrix, a row matrix in which all elements are 1, and the number of columns is determined by the dimension of the problem to be solved; Q is a random number that obeys the normal distribution, t is the current number of iterations; iter max is the maximum number of generations; α is a random number in [0,1]; R2 is the warning value of sparrows; T s Safety threshold for sparrows; represents the state of the value of the i-th individual in the d-th dimension at time t, The state of the value of the i-th individual in the d-th dimension at time t+1, -i is the negative value of the individual index i, used to represent the weight or decay factor;
[0142] In the index In the equation, -i is used to make the exponential term decrease as i increases, thereby adjusting or attenuating the weights of different individuals.
[0143] When R2<T s When R2≥T s When , it means that a natural enemy has appeared and has been discovered by a discoverer. Under the leadership of the discoverer, all sparrows will quickly move to a safer area.
[0144] Step S324: Repeat steps S322 and S323 until a predetermined number of iterations is reached or a stopping condition is satisfied. When the predetermined number of iterations is reached, the Sparrow Algorithm outputs the position of the individual with the highest fitness in the current population as the "optimal parameter combination."
[0145] The optimal parameter combination after optimization by the Sparrow Algorithm is typically expressed as a list of numerical parameters and a multidimensional vector / matrix. The "optimal random forest algorithm input parameter combination" includes a preprocessed multidimensional feature matrix (such as load time series characteristics, user capacity, and economic indicators).
[0146] Step S325: Obtain the optimal random forest algorithm input parameter combination based on the optimal sparrow position. As the followers follow the finder to find food, the position of the sparrow population is updated as follows:
[0147]
[0148] Where: t is the current iteration number; The best position for being the first warning in the sparrow population: X W is the sparrow with the worst current position in the sparrow population; A is a 1×d matrix with each element randomly set to 1 or -1. A is a two-unit matrix, where all elements in the matrix are randomly set to 1 or -1. The number of columns is the dimension of the problem to be solved.
[0149] when When , it indicates that the fitness of the i-th follower is poor and it may eventually die due to lack of foraging opportunities. On the contrary, when When , the i-th follower finds a random location near the most occupied best location to forage and survives.
[0150] Step S33, solving based on the improved random forest algorithm, the steps are as follows:
[0151] Step S331: Input the optimal parameter combination of the random forest algorithm optimized by the sparrow algorithm. The optimized optimal parameter combination of the random forest algorithm usually shows as: a list of numerical parameters and multi-dimensional vectors / matrices. The "optimal input parameter combination of the random forest model" includes the preprocessed multi-dimensional feature matrix (such as load time series features, user capacity, economic indicators, etc.)
[0152] Step S332: Construct the initial training set N = {(X1, Y1), (X2, Y2), …, (X k , Y k )}, where X is the input feature vector and Y is the target variable (the target variable is the county-level power load value).
[0153] Step S333: In the initial training set, use the Bootstrap sampling method to randomly and with replacement reselect n random forest samples as the training subset of the decision tree.
[0154] Step S
[0162] In regression problems, the "division of different load intervals" in the Gini impurity formula can be understood as dividing the continuous load value into several intervals. These interval divisions can be adjusted according to actual needs, for example:
[0163] Divide the intervals based on the distribution of historical load data. Alternatively, divide the intervals based on the target demand of load forecast (such as peak load, valley load, etc.).
[0164] The partitioning method helps to convert continuous load values into discrete intervals, thereby better applying the improved random forest algorithm for load forecasting.
[0165] For a continuous variable x, find the best split point s at node t so that the left child node t after splitting L and right child node t R The weighted sum of Gini impurity is minimized. Assume that the total number of samples in node t is n t , left child node t L The number of samples is Right child node t R The number of samples is The Gini impurity after segmentation is:
[0166]
[0167] G(t L ) and G(t R ) represent the Gini impurity of the left child node and the right child node respectively. By traversing all possible split points s, we select G split The smallest split point is taken as the optimal split point.
[0168] Specifically:
[0169] G(t L ) represents the Gini impurity of the left child node, which reflects the distribution of samples in the left child node in different load intervals.
[0170] G(t R ) represents the Gini impurity of the right child node, which reflects the distribution of samples in the right child node in different load intervals.
[0171] Gini impurity is used to measure the "purity" of samples in a node, that is, the distribution of samples in different categories (or load intervals).
[0172] In regression problems, it can be applied by dividing continuous load values into different intervals and selecting the best segmentation features and segmentation points by minimizing the Gini impurity, thereby improving the prediction accuracy of the model.
[0173] Step S335: Build a decision tree without setting an upper limit on the number of splits and without pruning the tree until the number of samples in a node is less than a preset minimum number of samples or all samples in a node belong to the same category (the difference in the target variable values of the samples is less than a preset threshold), i.e., each node cannot be split any further. Repeat this step to build multiple decision trees, forming an improved random forest algorithm structure composed of multiple decision trees.
[0174]
[0175] Each tree is independently constructed based on the training subset obtained by Bootstrap sampling, where h represents the number of decision trees in the random forest.
[0176] Step S336, regression prediction, using the remaining samples (i.e., samples not selected by Bootstrap sampling) as the test sample set N test ={(X test1 , Y test1 ),(X test2 , Y test2 ),…,(X testq ,Y testq )}Y testq Is the true load value of the test sample, that is, the actually observed load value. It represents the true output value of the qth (i.e., the last) test sample in the test sample set. In the county load forecasting scenario, Y testq Specifically, it represents the actual load value corresponding to the qth test sample and is used to evaluate the accuracy of the improved random forest algorithm's prediction results. In regression prediction, the improved random forest algorithm makes predictions based on the characteristics of the test sample to obtain the predicted value, which is then evaluated by comparing it with the true value.
[0177] For each test sample X testi , perform regression prediction on each decision tree in the random forest and get the output y of each tree ij ,The improved random forest algorithm model estimates the average value of the county load short-term forecast:
[0178]
[0179] Among them, n trees is the total number of decision trees, y ij is the predicted value of the decision tree.
[0180] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A short-term county load forecasting method that considers differentiated social development levels and dynamic electricity consumption characteristics of large users, characterized by: The county load short-term forecasting method includes the following steps: Step S1: construct a social development level index system and a county load characteristic index system, and based on the Pearson correlation analysis method, screen and extract the strongly correlated social indicators that dominate the county load development as input variables; Step S2: Using the K-Means algorithm, cluster large users with similar electricity consumption characteristics, and extract load characteristic contour curves of multiple user groups representing the typical electricity consumption level characteristics of each type of user; Step S3: Based on the historical data of county-level unit power load and large users, combined with the business expansion registration information of large users and the load characteristic contour curves of various users, an improved random forest algorithm is used to perform load forecasting.
2. A method for short-term county load forecasting considering differentiated social development levels and dynamic electricity consumption characteristics of large users according to claim 1, characterized in that: Step S1, the social development level index system consists of a criterion layer and an indicator layer. The criterion layer is divided into the overall economic development level, the social production and consumption level, and the future social development momentum. The indicator layer includes GDP, per capita GDP, local general public budget, industrial added value, total retail sales of consumer goods, total exports, the absolute value of actual use of foreign capital, GDP growth rate, total fixed investment, industrial added value above designated size, various deposit balances of financial institutions, and per capita disposable income of residents.
3. A method for short-term county load forecasting considering differentiated social development levels and dynamic electricity consumption characteristics of large users according to claim 2, characterized in that: Step S1, the county load characteristic indicator system includes the maximum load value, minimum load value, average load value, peak-to-valley difference, load rate, maximum load utilization hours and 5% peak load duration of the specified time series load data.
4. A method for short-term county load forecasting considering differentiated social development levels and dynamic electricity consumption characteristics of large users according to claim 3, characterized in that: Based on the Pearson correlation analysis method, the method for screening and extracting strongly correlated social indicators that dominate county load development is as follows: By calculating the Pearson correlation coefficient between the social development level index and the county load characteristic index, the correlation relationship is obtained, and the strongly correlated social indicators that dominate the county load characteristics are extracted and used as the input of the improved random forest algorithm. Let the variables be x and y, and each group of samples is represented by r xy , then the Pearson correlation coefficient calculation formula is as follows: in, (x i ,y i ) represents the sample point, represents the sample mean; Variables with an absolute value of correlation coefficient greater than or equal to 0.6 with any load characteristic indicator are defined as strongly correlated social indicators. A specified number of strongly correlated social indicators that dominate county load development are screened and extracted as input variables of the improved random forest algorithm.
5. The method for short-term county load forecasting considering differentiated social development levels and dynamic electricity consumption characteristics of large users according to claim 1 is characterized in that: Step S2: Use the K-Means algorithm to cluster large users with similar electricity consumption characteristics, and extract the load characteristic contour curves of multiple user groups representing the typical electricity consumption level characteristics of each type of user, including: Step S21, using the K-Means algorithm to cluster the time series load curves of large users with similar electricity consumption characteristics, includes the following steps: Step S211: Collect historical load data of large users, record them at the same time interval, process missing values and outliers, align the load data and record the time, normalize and standardize the load data to obtain time series data to be clustered; Step S212 , inputting pre-processed time series data, where the time series data represents a sample data set of a load curve of a large user; Step S213, randomly selecting K different samples from the load curve sample data set of large users as initial cluster centers of the K-Means algorithm; Step S214: Calculate the distance between the load data point and the cluster center, and divide each sample into the cluster with the closest center point. The Euclidean distance of the time series of the same length after processing is defined as: Where, L k and N k Represents the time series curve of the k-th cluster center point; Step S215, using the sample mean of each cluster to update the cluster center; Step S216, continuously iterating steps S214 and S215 until the cluster centers no longer change; Step S217, output the final cluster center and K clusters; Step S22: extract the load characteristic contour curves of the multi-user group representing the typical power consumption characteristics of each type of user. For the load curve of each large user in the cluster, the following is obtained: Load(i)=[l1,l2,…,l j ] T i∈[1,R],j∈[1,24t] Where Load(i) is the cluster load curve vector, and the cluster load curve vector element l j is the average load of users included in the cluster at the jth moment, T is the range of the timing curve, n i is the total number of final cluster centers; Load(i, j) is the user load value contained in each cluster, 24t represents the 24t dimension, and the hour is selected as the minimum time interval. The isovalue curve of the load characteristics of the multivariate user group is the per-unit curve of Load(i).
6. A method for short-term county load forecasting considering differentiated social development levels and dynamic electricity consumption characteristics of large users according to claim 1, characterized in that: Step S3: Based on the historical data of county-level unit power load and large users, combined with the large user expansion registration information and the load characteristic contour curves of multiple user groups, an improved random forest algorithm is used to perform load forecasting, including the following steps: Step S31, data preprocessing: collecting historical load data of county-level unit power load and large users, social development level data, existing capacity and reported capacity data of large users, and removing outliers and missing values in the data; Step S32: Optimize the random forest algorithm using the sparrow algorithm. The process is as follows: Step S321: Initialize the position and speed of the sparrow group. Each sparrow represents a parameter set of the random forest algorithm. The initial position of each sparrow is: Where: x n,d Indicates the initial position of each sparrow; Step S322: Calculate the prediction error of the random forest algorithm corresponding to each sparrow as the fitness value. The fitness value of all sparrows is expressed as follows: In the formula, f([x n,1 x n,2 … x n,d ]) represents the fitness value of each sparrow; Step S323: Update the speed and position of each sparrow based on its current position and speed, as well as the global optimal position and individual optimal position. Search for food in random places, and the position of the sparrow population is updated to: Where L is the 1×d unit matrix; Q is a random number that obeys the normal distribution, t is the current number of iterations; iter max is the maximum number of generations; α is a random number in [0,1]; R2 is the warning value of sparrows; T s Safety threshold for sparrows; represents the state of the value of the i-th individual in the d-th dimension at time t, The state of the value of the i-th individual in the d-th dimension at time t+1, -i is the negative value of the individual index i, used to represent the weight or decay factor; Step S324, repeating steps S322 and S323 until a predetermined number of iterations is reached or a stop condition is satisfied; Step S325: Based on the optimal sparrow position, the optimal random forest algorithm input parameter combination is obtained. As the followers follow the finder to find food, the position of the sparrow population is updated as follows: Where: t is the current iteration number, The best position for being the first warning in the sparrow population: X W is the sparrow with the worst current position in the sparrow population; A is a 1×d matrix; Step S33: Solving based on the improved random forest algorithm, the solving steps are as follows: Step S331, inputting the optimal random forest algorithm parameter combination obtained by the sparrow algorithm optimization; Step S332, constructing an initial training set based on the input feature vector and the target variable; Step S333: Using the Bootstrap sampling method, randomly and with replacement, reselect n random forest samples from the initial training set as the training subset for the decision tree; Step S334: For each node, apply the best segmentation method to m randomly selected variables, randomly select m features from W features, and select the best segmentation features and segmentation points to minimize the Gini impurity. For node t, the Gini impurity is defined as: Where c is the number of categories, p i is the proportion of samples belonging to class i in node t; For continuous variables, find the best split point s at node t so that the weighted sum of the Gini impurity of the left and right child nodes after the split is minimized. Let the total number of samples in node t be n t , the number of samples in the left child node is The number of samples in the right child node is The Gini impurity after segmentation is: In the formula, G(t L ) and G(t R ) represent the Gini impurity of the left child node and the right child node respectively; by traversing all possible split points s, select G split The smallest split point is taken as the optimal split point; Step S335: No upper limit is set for the number of splits, and the tree is not pruned until the number of samples in the node is less than the preset minimum number of samples or each node cannot be split any further. This step is repeated to construct multiple decision trees, forming an improved random forest algorithm structure consisting of multiple decision trees. Step S336: Use the remaining samples as the test sample set, perform regression prediction on each decision tree in the random forest for each test sample, obtain the output of each tree, and use the improved random forest algorithm to estimate the average value of the county load short-term forecast: Among them, n trees is the total number of decision trees, y ij is the predicted value of the decision tree.