Regional level power load prediction method based on federated learning
Through federated learning and Autoformer time series network model, cross-regional predictions are combined with power load and meteorological data, the problem of neglecting inter-regional impact in traditional methods is solved, and the accuracy and safety of power load prediction is improved.
Patent Information
- Application Number
- CN202411193736.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-13
Smart Images

Figure CN119134299A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the electric power field, and in particular to a regional electric power load forecasting method based on federated learning. Background Art
[0002] With the rapid development of modern society, electricity has become an indispensable energy source for social production and life. As an important part of power system planning and operation management, power load forecasting plays a vital role in the safety, stability and economic operation of the power system.
[0003] However, traditional power load forecasting methods are mostly based on historical data of a single region, ignoring the mutual influence and linkage of power loads between different regions, which makes the forecast results have great limitations and causes the obtained forecast results to fail to effectively reflect the actual situation.
[0004] Therefore, in order to solve the above problems, a regional power load forecasting method based on federated learning is needed, which can realize cross-regional joint modeling and forecasting, and improve the accuracy and generalization ability of power load forecasting. Summary of the invention
[0005] In view of this, the purpose of the present invention is to overcome the defects in the prior art and provide a regional power load forecasting method based on federated learning, which can realize cross-regional joint modeling and forecasting, and improve the accuracy and generalization ability of power load forecasting.
[0006] The regional power load forecasting method based on federated learning of the present invention comprises:
[0007] S1. Obtain power load data of each region to form first sample data; obtain meteorological factor data of each region to obtain second sample data;
[0008] S2. The first sample data and the second sample data are spliced to obtain processed sample data; the correlation analysis between various meteorological factors and power load in the processed sample data is performed to obtain analyzed sample data;
[0009] S3. Input the corresponding data of each region in the analyzed sample data into their respective prediction models for model training; upload the trained parameters of each regional model to the global model for aggregation, and distribute the aggregated global model parameters to each regional model, and iterate this step until the preset convergence standard is met;
[0010] S4. Use the prediction models trained in each region to predict the power load in each region and obtain the final prediction value.
[0011] Further, the first sample data is formed, specifically including: when collecting the power load data of each area, one sampling point is taken every 15 minutes, and 96 points are taken every day to obtain the first sample data.
[0012] Furthermore, the meteorological factor data include daily maximum temperature, daily minimum temperature, daily average temperature, daily relative humidity and daily rainfall.
[0013] Further, the first sample data and the second sample data are concatenated, specifically including:
[0014] The second sample data is converted into sampling points every 15 minutes by interpolation or keeping unchanged, for a total of 96 points, and the date is aligned with the first sample data and spliced horizontally to obtain a complete sample data set.
[0015] Furthermore, the correlation analysis between various meteorological factors and power load in the processed sample data is carried out, including:
[0016] respectively calculating the covariance between each meteorological factor and the power load in the second sample data;
[0017] Calculate the standard deviation between each meteorological factor and the power load in the second sample data respectively;
[0018] Divide the covariance and standard deviation between each meteorological factor and the power load to obtain the Pearson correlation coefficient between each meteorological factor and the power load;
[0019] A threshold is set, and meteorological factors whose correlation coefficient with power load is greater than the threshold are screened out to form a data set.
[0020] Furthermore, the prediction model is a network model based on the Autoformer time series.
[0021] Further, the step S3 specifically includes:
[0022] S31. The central server first initializes a global model parameter ω0;
[0023] S32. All regional power terminal platforms train their own regional data sets on the local server and calculate the local model parameters ω on the local server i ;
[0024] S33. All regional power terminal platforms will calculate the local model parameters ω i Upload to the central server;
[0025] S34. The central server calculates the weighted average of the local model parameters of all regional power terminal platforms
[0026] S35. The central server calculates the weighted average Distributed to the local models of all regional power terminal platforms;
[0027] S36. Local models of all regional power terminal platforms adopt new global model parameters As the initial values of the local model parameters, steps S32 to S35 are repeated until the global model converges.
[0028] Furthermore, in step S2, after the splicing process, the processed sample data is preprocessed, specifically including: outlier identification, missing value filling and data normalization.
[0029] Furthermore, the sample data outlier identification uses the isolation forest method to identify abnormal data;
[0030] The missing values of sample data are filled by using the mean of the normal data at the previous moment and the normal data at the next moment;
[0031] The following formula is used to normalize the data:
[0032]
[0033] Among them, X is the original data, X min is the minimum value in the data set, X max is the maximum value in the data set, X norm is the normalized data.
[0034] The beneficial effects of the present invention are as follows: a regional power load forecasting method based on federated learning disclosed in the present invention can make full use of the power load characteristics and data resources among regions, significantly improve the accuracy and reliability of power load forecasting, and provide a more accurate reference for the planning and operation of the power system; secondly, by adopting a federated learning algorithm, data sharing and model training are realized under the premise of protecting data privacy, effectively avoiding the privacy leakage risks that may be caused by direct data exchange in traditional methods, and enhancing the security and compliance of data use. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0036] Figure 1 It is a flowchart of the present invention;
[0037] Figure 2 It is a schematic diagram of the flow chart of the prediction method of the present invention;
[0038] Figure 3 It is a specific schematic diagram of the prediction method of the present invention;
[0039] Figure 4 This is a diagram of the federated learning architecture of the present invention. DETAILED DESCRIPTION
[0040] The present invention is further described below in conjunction with the accompanying drawings, as shown in the drawings:
[0041] This embodiment discloses a regional power load forecasting method based on federated learning, comprising the following steps:
[0042] S1. Obtain power load data of each region to form first sample data; obtain meteorological factor data of each region to obtain second sample data;
[0043] S2. The first sample data and the second sample data are spliced to obtain processed sample data; the correlation analysis between various meteorological factors and power load in the processed sample data is performed to obtain analyzed sample data;
[0044] S3. Input the corresponding data of each region in the analyzed sample data into their respective prediction models for model training; upload the trained parameters of each regional model to the global model for aggregation, and redistribute the aggregated global model parameters to each regional model, and iterate this step until the preset convergence standard is met; wherein the prediction model is a network model based on the Autoformer time series.
[0045] S4. Use the prediction models trained in each region to predict the power load in each region and obtain the final prediction value.
[0046] In this embodiment, forming the first sample data specifically includes: when collecting power load data in each area, one sampling point is taken every 15 minutes, and 96 points are taken every day to obtain the first sample data.
[0047] The meteorological factor data include daily maximum temperature, daily minimum temperature, daily average temperature, daily relative humidity and daily rainfall.
[0048] The first sample data and the second sample data are concatenated, specifically including:
[0049] The second sample data was converted into sampling points every 15 minutes by interpolation or keeping it unchanged, and was replicated and expanded to 96 points every day. The data was aligned with the first sample data and spliced horizontally to obtain a complete sample data set.
[0050] In this embodiment, in step S2, after the splicing process, the processed sample data is preprocessed, specifically including: outlier identification, missing value filling and data normalization.
[0051] Among them, the sample data outlier identification uses the isolation forest method to identify abnormal data;
[0052] The missing values of sample data are filled by using the mean of the normal data at the previous moment and the normal data at the next moment;
[0053] The following formula is used to normalize the data:
[0054]
[0055] Among them, X is the original data, X min is the minimum value in the data set, X max is the maximum value in the data set, X norm is the normalized data.
[0056] In this embodiment, after preprocessing, correlation analysis is performed on various meteorological factors and power load in the processed sample data, and factors with low correlation coefficients are discarded, specifically including:
[0057] respectively calculating the covariance between each meteorological factor and the power load in the second sample data;
[0058] Calculate the standard deviation between each meteorological factor and the power load in the second sample data respectively;
[0059] Divide the covariance and standard deviation between each meteorological factor and the power load to obtain the Pearson correlation coefficient between each meteorological factor and the power load;
[0060] The Pearson correlation coefficient between each meteorological factor and power load in the sample data is calculated as:
[0061]
[0062] Among them, γ represents the Pearson correlation coefficient, x i and i The i-th observation value of two variables X and Y respectively, and denote the sample means of samples X and Y respectively, and n is the number of observations.
[0063] A threshold is set, and meteorological factors whose correlation coefficient with power load is greater than the threshold are screened out to form a data set.
[0064] In this embodiment, each regional power terminal platform is trained on the data of its own region on the local server, and the training parameters are uploaded to the central server for federated average (FedAvg) aggregation, and then sent back to each sub-region. This step is iteratively performed until the model converges, specifically including:
[0065] S31. The central server first initializes a global model parameter ω0;
[0066] S32. All regional power terminal platforms train their own regional data sets on the local server and calculate the local model parameters ω on the local server i ;
[0067] S33. All regional power terminal platforms will calculate the local model parameters ω i Upload to the central server;
[0068] S34. The central server calculates the weighted average of the local model parameters of all regional power terminal platforms
[0069] S35. The central server calculates the weighted average Distributed to the local models of all regional power terminal platforms;
[0070] S36. Local models of all regional power terminal platforms adopt new global model parameters As the initial values of the local model parameters, steps S32 to S35 are repeated until the global model converges.
[0071] In this embodiment, each regional power terminal platform uses the Autoformer time series prediction model trained on the local server to predict the power load in its own region and obtain the final prediction value. Specifically, the prediction value is measured by the mean square error (MSE) and the mean absolute error (MAE), as shown in the following formula:
[0072]
[0073]
[0074] Among them, M is the total number of samples, y m is the sample value, is the sample prediction value, is the sample mean.
[0075] In order to better understand the regional power load forecasting method of the present invention, further examples are given as follows:
[0076] Collect the power load data of A and B at 96 time points every day from January 1, 2012 to January 10, 2015;
[0077] Collect meteorological data from January 1, 2012 to January 10, 2015 in places A and B, including daily maximum temperature, minimum temperature, average temperature, relative humidity and rainfall;
[0078] The daily meteorological data (maximum temperature, minimum temperature, average temperature, relative humidity, and rainfall) are copied and expanded to 96 records so that they can be horizontally matched and spliced with the daily 96-point power load data by timestamp.
[0079] Data preprocessing is performed on the spliced comprehensive data set, including outlier detection and correction, missing value filling, and elimination of dimensional differences between data through normalization.
[0080] The Pearson correlation coefficient between power load and meteorological characteristics (maximum temperature, minimum temperature, average temperature, relative humidity, and rainfall) was calculated. Based on the correlation coefficient, the features with less influence were eliminated, and only the features with significant influence on power load were retained to form the final data sets for A and B.
[0081] The data sets of sites A and B are respectively input into the Autoformer time series prediction model on their respective power terminal platforms for training. The parameters of the models of sites A and B are uploaded to the central server, which performs weighted average processing and feeds the processed parameters back to the local models of the two sites.
[0082] The power terminal platforms at locations A and B receive the updated model parameters and repeat the above training and parameter updating process until the model performance reaches a stable convergence state.
[0083] Locations A and B use the trained local models to predict the power load in their respective areas.
[0084] The division of regions in the present invention includes but is not limited to division by station area, by town, or by county. The setting of the Pearson correlation coefficient threshold in the present invention is specifically set according to the specific data set, and features with coefficients lower than 0.1 are usually discarded.
[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A regional power load forecasting method based on federated learning, characterized by: include: S1. Obtain power load data of each region to form first sample data; obtain meteorological factor data of each region to obtain second sample data; S2. The first sample data and the second sample data are spliced to obtain processed sample data; the correlation analysis between various meteorological factors and power load in the processed sample data is performed to obtain analyzed sample data; S3. Input the corresponding data of each region in the analyzed sample data into their respective prediction models for model training; upload the trained parameters of each regional model to the global model for aggregation, and distribute the aggregated global model parameters to each regional model, and iterate this step until the preset convergence standard is met; S4. Use the prediction models trained in each region to predict the power load in each region and obtain the final prediction value.
2. The regional power load forecasting method based on federated learning according to claim 1 is characterized in that: The first sample data is formed, specifically including: when collecting power load data in each area, one sampling point is taken every 15 minutes, and 96 points are taken every day to obtain the first sample data.
3. The regional power load forecasting method based on federated learning according to claim 1 is characterized in that: The meteorological factor data include daily maximum temperature, daily minimum temperature, daily average temperature, daily relative humidity and daily rainfall.
4. The regional power load forecasting method based on federated learning according to claim 1 is characterized in that: The first sample data and the second sample data are concatenated, specifically including: The second sample data is converted into sampling points every 15 minutes by interpolation or keeping unchanged, for a total of 96 points, and the date is aligned with the first sample data and spliced horizontally to obtain a complete sample data set.
5. The regional power load forecasting method based on federated learning according to claim 1 is characterized in that: The correlation analysis between various meteorological factors and power load in the processed sample data is carried out, including: respectively calculating the covariance between each meteorological factor and the power load in the second sample data; Calculate the standard deviation between each meteorological factor and the power load in the second sample data respectively; Divide the covariance and standard deviation between each meteorological factor and the power load to obtain the Pearson correlation coefficient between each meteorological factor and the power load; A threshold is set, and meteorological factors whose correlation coefficient with power load is greater than the threshold are screened out to form a data set.
6. The regional power load forecasting method based on federated learning according to claim 1 is characterized in that: The prediction model is a network model based on the Autoformer time series.
7. The regional power load forecasting method based on federated learning according to claim 1 is characterized in that: The step S3 specifically includes: S31. The central server first initializes a global model parameter ω0; S32. All regional power terminal platforms train their own regional data sets on the local server and calculate the local model parameters ω on the local server i ; S33. All regional power terminal platforms will calculate the local model parameters ω i Upload to the central server; S34. The central server calculates the weighted average of the local model parameters of all regional power terminal platforms S35. The central server calculates the weighted average Distributed to the local models of all regional power terminal platforms; S36. Local models of all regional power terminal platforms adopt new global model parameters As the initial values of the local model parameters, steps S32 to S35 are repeated until the global model converges.
8. The regional power load forecasting method based on federated learning according to claim 1 is characterized in that: In the step S2, after the splicing process, the processed sample data is preprocessed, specifically including: outlier identification, missing value filling and data normalization.
9. The regional power load forecasting method based on federated learning according to claim 8 is characterized in that: Identification of outliers in sample data uses the isolation forest method to identify abnormal data; The missing values of sample data are filled by using the mean of the normal data at the previous moment and the normal data at the next moment; The following formula is used to normalize the data: Among them, X is the original data, X min is the minimum value in the data set, X max is the maximum value in the data set, X norm is the normalized data.
