CN117350439A - Energy aggregation service provider load prediction method and system based on transverse federal learning - Google Patents

Energy aggregation service provider load prediction method and system based on transverse federal learning Download PDF

Info

Publication number
CN117350439A
CN117350439A CN202311535675.1A CN202311535675A CN117350439A CN 117350439 A CN117350439 A CN 117350439A CN 202311535675 A CN202311535675 A CN 202311535675A CN 117350439 A CN117350439 A CN 117350439A
Authority
CN
China
Prior art keywords
data
local
pca
value
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311535675.1A
Other languages
Chinese (zh)
Inventor
宋瑜辉
黄一川
荆朝霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN202311535675.1A priority Critical patent/CN117350439A/en
Publication of CN117350439A publication Critical patent/CN117350439A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0499Feedforward networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Software Systems (AREA)
  • Strategic Management (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Human Resources & Organizations (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • General Business, Economics & Management (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Marketing (AREA)
  • Biophysics (AREA)
  • Tourism & Hospitality (AREA)
  • Biomedical Technology (AREA)
  • Operations Research (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Primary Health Care (AREA)
  • Water Supply & Treatment (AREA)
  • Public Health (AREA)
  • Quality & Reliability (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method and a system for predicting the load of an energy aggregation server based on transverse federal learning, wherein the method and the system are used for realizing the load prediction of the energy aggregation server under the data privacy security based on a FedAvg transverse federal learning framework and a PCA-BP neural network model, data and model parameters are respectively placed in a local server of each terminal user and a central server of the energy aggregation server, and the local server uses the PCA-BP neural network model to predict the load of the terminal user and calculate Root Mean Square Error (RMSE); the central server adopts FedAvg algorithm to aggregate weighted average loss of all local servers and update PCA-BP neural network model parameters; by the limited interaction of the local server and the central server, strict adherence to data security and privacy protocols is ensured, and the number of models and time consumption are reduced, so that accurate load prediction is realized without damaging user data privacy.

Description

Energy aggregation service provider load prediction method and system based on transverse federal learning
Technical Field
The invention relates to the technical field of energy aggregation service provider load prediction, in particular to an energy aggregation service provider load prediction method and system based on transverse federal learning.
Background
New energy market bodies such as distributed photovoltaics, electric vehicles and energy storage are important structural supports of novel power systems, and compared with traditional energy suppliers such as coal-fired power plants, gas-fired power plants and the like, new energy suppliers generally have the characteristics of smaller capacity scale, dispersion on the physical level of the power systems and mutual independence, so that the capacity of directly obtaining positive benefits in the power market is relatively weak. To address this problem, energy aggregation service providers have evolved that serve matching market transactions. However, the energy aggregation server's effective load forecasting ability is a cornerstone of its participation in the electricity market and is a key factor in achieving maximum market profit. With the growing population of new energy suppliers, a large amount of power data with different granularity of the time-space dimension will be generated. These data are of great value for load prediction and will be preserved according to the energy type and environmental factor requirements of the new energy provider individual. But energy suppliers are reluctant to share their respective data to energy aggregation service providers due to the security and privacy nature of the power commodity. Therefore, on the premise of ensuring the safety and privacy of individual data of the energy suppliers, how to enable the energy aggregation server to effectively utilize the power data for load prediction becomes an important problem.
The electric power data are widely applied to scenes such as load prediction, and important social and economic values are continuously mined. The traditional load prediction method mainly comprises a wavelet neural network WNN, a generalized regression neural network GRNN, a least squares support vector regression LSSVR, a data migration learning DTL, a gradient lifting decision tree GBDT, a deep belief network DBN, a two-way long and short term memory network BiLSTM and the like. However, in an electricity market environment, energy aggregation service providers often cannot directly obtain complete data sets while providing diverse services to the off-flag energy providers. From a retailer perspective, power data relates to system security and privacy, and sharing or disclosure with the outside can present significant security risks. In order to solve the problem, in the existing research, whether a traditional centralized learning algorithm or a distributed computing algorithm is adopted, encryption processing is mainly relied on for data so as to ensure the safety and privacy of the data. However, this method still requires external interaction of the original data, which results in that the privacy and security of the data cannot be effectively guaranteed. To solve this contradiction, federal learning FL provides a good way to protect data security and privacy.
Federal learning has found practical use in a variety of fields including mobile devices, industrial engineering, healthcare, finance, etc., and is particularly widely used in the medical and financial industries. In the FL architecture, two modes, namely, decentralization and centralization are mainly included. The centralization mode is to deploy a central server at the aggregation server to be responsible for the fitting of global model parameters; each energy provider deploys a client server responsible for communication with the central server. In this process, the power data of the energy provider is stored in the local client and does not participate in the data exchange. The energy supplier only needs to download the model parameters of the central server for local training, and then uploads the trained model parameters to the central server. After global optimization fitting is carried out, the central server sends the updated parameters to the client for iterative training until a final prediction model is obtained. But when participating in federal learning training, one problem is faced: under the federal learning framework, the prediction network may have inadequate prediction performance due to irrelevant features and huge amounts of data in the data set.
Disclosure of Invention
A first object of the present invention is to overcome the drawbacks and deficiencies of the prior art and to provide a method for predicting the load of an energy aggregation server based on horizontal federal learning, which allows sharing information of a new energy body without touching a real data set, thereby obtaining an accurate and efficient load prediction capability.
A second object of the present invention is to provide an energy aggregation server load prediction system based on horizontal federal learning.
The first object of the invention is achieved by the following technical scheme: the method is based on FedAvg transverse Federation learning frame and PCA-BP neural network model to realize load prediction of energy aggregation server under data privacy security, wherein data and model parameters are respectively placed in a local server of each terminal user and a central server of the energy aggregation server, the local server uses the PCA-BP neural network model to carry out load prediction on the terminal user and calculate Root Mean Square Error (RMSE), the PCA-BP neural network model extracts main characteristics based on PCA algorithm on the basis of the original BP neural network model, useless and redundant characteristics of a local data set of the aggregator user are removed, and network defects are prevented from being amplified in the BP neural network model; the central server adopts FedAvg algorithm to aggregate weighted average loss of all local servers and update parameters of PCA-BP neural network model; by the limited interaction of the local server and the central server, strict adherence to data security and privacy protocols is ensured, and the number of models and time consumption are reduced, so that accurate load prediction is realized without damaging user data privacy.
Further, the energy aggregation service provider load prediction method based on the transverse federal learning comprises the following steps:
s1: collecting time data, weather data, industry data, load data and economic data, performing manual feature selection to form an aggregator user local data set, preprocessing the aggregator user local data set, including abnormal value detection and missing value supplementation, adopting independent thermal coding and sin/cos cyclic coding to discrete values in the data, and adopting mean value variance normalization operation to continuous values; dividing the preprocessed local data set of the aggregator user into a training set and a testing set which are respectively used for training and testing the model;
s2: the data of the training set is sent into a PCA-BP neural network model of a local server for first training, and initial parameters theta of the model are given in the training 0 The method comprises the steps of carrying out a first treatment on the surface of the During training, feature extraction is firstly carried out on data of a training set by adopting PCA, and the feature extraction comprises standardized processing of a data feature matrix, covariance matrix calculation and singular value decomposition, so as to obtain a feature extracted dataIs a feature matrix of (1); inputting the extracted feature matrix into a PCA-BP neural network model to obtain the load predicted value of each initial terminal user; calculating a load prediction result and a loss value of a true value by adopting a smooth curve cross entropy method in back propagation, and carrying out finite round iteration until the loss value is minimum to obtain a single local training optimal network;
S3: inputting the data of the test set into a single local training optimal network to obtain load prediction information, and then calculating a smooth curve cross entropy loss function of the load prediction information and a true value, a network weight and a counter propagation gradient of a network threshold value to generate a single local optimal network parameter updating value theta';
s4: the local server uploads a single local optimal network parameter update value theta' to a central server, the central server obtains weighted average loss of all end users based on FedAVg algorithm, and the global model parameter theta is fitted through random gradient descent SGD; then, the central server sends the global model parameter theta to the local server, the local server updates the local parameter theta' =theta based on the theta, and the PCA-BP neural network model of the local server adopts the new parameter theta to carry out new training;
s5: repeating the steps S2-S4 until the R-th interaction is completed; through continuous interactive iteration of the central server and the local server, a global optimal model aiming at load prediction under the current market environment is obtained, final load prediction is carried out on the local server by adopting final global optimal model parameters theta, a global optimal load predicted value is obtained, and a corresponding market strategy is formulated according to the global optimal load predicted value so as to obtain benefits.
Further, in step S1, the influence factors in the collected initial data include: time factors, weather factors, industry factors, and economic factors; the latitude data of the time factors are selected from year, month, day, time and minute information to reflect the periodic change of the load; weather factors that affect load changes include temperature, humidity, precipitation, sunlight, wind direction, wind speed, and barometric pressure; industry factors describe the impact on load by using 10 industries of electricity for agriculture/forestry/pasture/fishery, industry, transportation/storage/postal industry, information transmission/software/information technology service industry, wholesale and retail industry, housing and catering industry, financial industry, housing and land industry, leasing and business service industry, public service and management organization; the economic factor directly selects local GDP data to reflect the relationship between the socioeconomic environment and the load.
Further, in step S1, preprocessing is performed on the local data set of the aggregator user, including:
a. detecting possible outliers of the energy aggregation server load data set by using a 3-Sigma criterion;
b. filling the missing values according to formulas (1) and (2):
x ab =X a-1 (1-w ab )+X a w ab ,a=2,3,...,T″,b=1,2,…,N (1);
wherein X is a For the data value of the a-th hour of the original sequence, X a-1 For the data value of a-1 h of the original sequence, x ab For the b data value, w, within the a-th hour of the interpolated sequence ab Is X a For x ab N is the total number of split points in 1 hour, T "is the total number of hours of the original sequence;
c. adopting single-heat coding and sin/cos cyclic coding for discrete values in the data;
d. scaling the continuous values in the data by means of mean variance normalization, as shown in formula (3):
wherein x is norm μ is the mean value of the data, and σ is the standard deviation.
Further, in step S2, training is performed by using the PCA-BP neural network, comprising the following steps:
s21: for each feature in the feature data sample of the training setd m Calculating the mean valueAnd standard deviation->And carrying out standardization processing on each data to obtain a feature d i ' j Finally, a standardized feature matrix D is obtained stand Wherein m represents the number of features, n represents the sequence length of each feature in the time dimension, i ε n, j ε m, as shown in equations (4) - (8):
wherein D is a feature matrix, D nm Specific data representing the mth dimension characteristic of the data sample over the nth length, d' m An m-th dimension eigenvector, d 'representing a normalized eigenvector matrix' nm Specific data of the m-th dimension feature vector of the standardized feature matrix in the nth length is represented;
S22: calculating a normalized feature matrix D stand As shown in formulas (9), (10):
wherein a is ij And a nm Elements representing covariance matrix, k.epsilon.n, d' ki And d' kj The kth data representing the normalized ith and jth dimensional features, respectively, is calculated from equation (7),and->Mean values respectively representing the ith dimension and the jth dimension are calculated by a formula (5);
s23: calculating eigenvalue lambda of covariance matrix A by singular value decomposition SVD q And feature vector Z q Wherein q is E [1, m]As shown in formulas (11), (12):
Z 1 =[z 11 z 12 … z 1m ] T Z 2 =[z 21 z 22 … z 2m ] T …Z m =[z n1 z n2 … z nm ] T (11);
λ 1 ≥λ 2 ≥…≥λ m ≥0 (12);
wherein lambda is m 、Z m Eigenvalues and eigenvectors, z, of the covariance matrix, respectively nm N-th data which is an m-th feature vector;
s24: introducing the accumulated contribution rate mu' of the main component as an evaluation index of the feature vector, and selecting a feature vector t with the accumulated contribution rate exceeding 80 percent j As an evaluation matrix T', a feature matrix X is obtained by PCA feature extraction as shown in formulas (13) - (15):
T′=[t 1 t 2 … t m ] (14);
x m =d m t m ,X=DT′ (15);
wherein p' represents the order of eigenvalues, λ j 、λ k Are all lambda m Is a subset of x m Is the m-th dimension characteristic of the characteristic matrix X;
s25: based on the BP neural network model, a load prediction model consisting of 1 input layer, 3 hidden layers and 1 output layer is built, namely a PCA-BP neural network model, and the activation functions of the model are all Sigmoid functions, as shown in a formula (16):
Wherein f (x) is an activation function of the neuron, and x represents an output of each layer of the neuron;
s26: setting weight coefficients of 3 hidden layers to omega respectively 123 The threshold values are b 1 ,b 2 ,b 3 The method comprises the steps of carrying out a first treatment on the surface of the The weight coefficient of the output layer is omega 4 A threshold value of b 4 The method comprises the steps of carrying out a first treatment on the surface of the The PCA-BP neural network model parameters are summed up as theta epsilon W, b, wherein W= { omega 1234 |,b={b 1 ,b 2 ,b 3 ,b 4 W is the PCA-BP neural network model weight set, and b is the PCA-BP neural network model threshold set; the forward propagation of the PCA-BP neural network model is shown as the following formula (17):
wherein q=z + Indicating the layer number of the network model, and h epsilon q; x is X q =[x q,1 x q,2 … x q,m ]And Y q =[y q,1 y q,2 … y q,m ]Respectively representing the input and output of the q-th layer network, x q,m For the mth input of the q-th layer network, y q,m An mth output for the q-th layer network; omega h And b h Respectively representing the weight coefficient and the threshold value, omega of the h layer network h ∈W,b h E b, and when q=1, X q Equal to X in equation (15), i.e., X is the first layer input of the network model;
s27: inputting the data of the training set into the constructed PCA-BP neural network model through the input X after the PCA dimension reduction to obtain a prediction result;
s28: obtaining a loss function L of each level of the PCA-BP neural network model by adopting a smooth curve cross entropy method q As shown in formula (18):
wherein Y 'is' q Representing the true value of each layer of network;
S29: calculating back propagation gradient of PCA-BP neural network model weightCounter-propagating gradient with thresholdAs shown in formulas (19), (20):
s210: updating PCA-BP neural network model parameters, expressed as formula (21):
wherein l is the learning rate of the network model, and is used for representing the convergence speed of the training iteration of the network model, omega' h 、b' h Respectively representing the updated PCA-BP neural network model weight and threshold value;
s211: and repeating the steps S26-S210 until the PCA-BP neural network parameter theta' is stopped to be iteratively updated after the limited round of training, so as to obtain the single local training optimal network.
Further, the step S3 includes the steps of:
s31: inputting the data of the test set into a single local training optimal network to obtain a load predicted value;
s32: calculating a smooth curve cross entropy loss function L of the test set load predicted value and the true value according to (18) - (20) j (θ) and network weights, network thresholds;
s33: a single local optimum network parameter update value θ' is generated according to equation (21).
Further, the step S4 includes the steps of:
s41: the local server uploads the single local optimal network parameter update value theta' to the central server;
S42: after the central server collects all updated model parameters theta '= { theta' p (p=1,2,…,P)},θ' p And (3) representing a single local optimal network parameter updating value of the p-th response user, performing aggregation processing on the parameters based on FedAVg algorithm, solving a weighted average loss of all terminal users, and fitting a global model parameter theta through SGD (generalized algorithm) as shown in formulas (22) and (23):
wherein F is p (θ) represents the p-th polymerizationAverage loss of all data features of quotient users, F (θ) is a function of updated θ, F g (θ) represents the average loss of all data features for the g-th aggregator user, g ε P is a subset;
s43: the central server of the energy aggregation server sends the global model parameter theta to all local servers, and the local server of the aggregator user updates the PCA-BP neural network model parameter theta' =theta based on the global model parameter;
s44: and performing a new training round by adopting a new parameter theta in the PCA-BP neural network model of the local server.
Further, the step S5 includes the steps of:
s51: repeating steps S2-S4, and completing limited times of interaction between the central server and the local server;
s52: after the R-th interaction, a global optimal model aiming at load prediction under the current market environment is obtained, and communication interaction rounds r=1, 2 and … are carried out, wherein R is the number of times of interaction between a local server of an aggregator user and a central server model parameter of an energy aggregation server;
S53: the energy aggregation server verifies the global optimal model and gives corresponding aggregator users a response reward according to the contribution degree of the global optimal model;
s54: carrying out final load prediction of an aggregate user at a local server by adopting a final global optimal model parameter theta to obtain a global optimal load predicted value;
s55: and formulating a corresponding market strategy according to the global optimal load predicted value to obtain benefits.
The second object of the invention is achieved by the following technical scheme: the energy aggregation service provider load prediction system based on the transverse federal learning is used for realizing the energy aggregation service provider load prediction method based on the transverse federal learning, and comprises the following steps:
the data acquisition and processing module is used for acquiring initial data of five characteristic types, namely time data, weather data, industry data, load data and economic data, and performing manual characteristic selection to form a local data set of an aggregator user, preprocessing the local data set of the aggregator user, including abnormal value detection and missing value supplementation, adopting independent heat coding and sin/cos cyclic coding on discrete values in the data, and adopting mean value variance normalization operation on continuous values; dividing the preprocessed local data set of the aggregator user into a training set and a testing set which are respectively used for training and testing the model;
The training module is used for transmitting the data of the training set into the PCA-BP neural network model of the local server for first training, and the initial parameter theta of the model is given in the training 0 The method comprises the steps of carrying out a first treatment on the surface of the During training, feature extraction is firstly carried out on data of a training set by adopting PCA, wherein the feature extraction comprises standardized processing of a data feature matrix, covariance matrix calculation and singular value decomposition, and a feature matrix after feature extraction is obtained; inputting the extracted feature matrix into a PCA-BP neural network model to obtain the load predicted value of each initial terminal user; calculating a load prediction result and a loss value of a true value by adopting a smooth curve cross entropy method in back propagation, and carrying out finite round iteration until the loss value is minimum to obtain a single local training optimal network;
the parameter updating module is used for inputting the data of the test set into a single local training optimal network to obtain load prediction information, and then calculating a smooth curve cross entropy loss function of the load prediction information and a true value, a network weight and a counter propagation gradient of a network threshold value to generate a single local optimal network parameter updating value theta';
the calculation module is used for uploading the single local optimal network parameter updating value theta' to the central server through the local server, the central server is used for solving the weighted average loss of all the terminal users based on the FedAVg algorithm, and the global model parameter theta is fitted through the random gradient descent SGD; then, the central server sends the global model parameter theta to the local server, the local server updates the local parameter theta' =theta based on the theta, and the PCA-BP neural network model of the local server adopts the new parameter theta to carry out new training;
The load prediction module is used for obtaining a global optimal model aiming at load prediction under the current market environment through continuous interactive iteration of the central server and the local server, carrying out final load prediction on the local server by adopting a final global optimal model parameter theta to obtain a global optimal load prediction value, and formulating a corresponding market strategy according to the global optimal load prediction value to obtain benefits.
Compared with the prior art, the invention has the following advantages and beneficial effects:
1. the present invention introduces a novel federated framework for energy aggregators that ensures confidentiality of emerging energy provider data, thereby enabling them to communicate without revealing power consumption information.
2. The invention provides a PCA-BP neural network model, which utilizes data privacy consideration to conduct feature extraction.
3. The invention designs a method for training a neural network model by using a joint average weighted combination, and provides technical support for energy aggregators to formulate corresponding market strategies and acquire benefits.
In a word, the invention ensures strict adherence to data security and privacy protocols, reduces the number of models and time consumption, realizes accurate load prediction by utilizing federal learning aggregation parameters under the condition of not damaging user data privacy, has practical application value and is worth popularizing.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention.
FIG. 2 is a block diagram of a system according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but embodiments of the present invention are not limited thereto.
Example 1
As shown in fig. 1, the embodiment discloses an energy aggregation server load prediction method based on transverse federal learning, which is to implement load prediction of an energy aggregation server under data privacy security based on a Fedavg transverse federal learning framework and a PCA-BP neural network model, wherein data and model parameters are respectively placed in a local server of each terminal user and a central server of the energy aggregation server, the local server uses the PCA-BP neural network model to perform load prediction on the terminal user and calculate Root Mean Square Error (RMSE), the PCA-BP neural network model extracts main features based on a PCA algorithm on the basis of an original BP neural network model, and useless and redundant features of a local data set of the aggregate user are removed to prevent network defects from being amplified in the BP neural network model; the central server adopts FedAvg algorithm to aggregate weighted average loss of all local servers and update parameters of PCA-BP neural network model; by the limited interaction of the local server and the central server, strict adherence to data security and privacy protocols is ensured, and the number of models and time consumption are reduced, so that accurate load prediction is realized without damaging user data privacy.
The specific implementation of the energy aggregation service provider load prediction method comprises the following steps:
s1: collecting time data, weather data, industry data, load data and economic data, performing manual feature selection to form an aggregator user local data set, preprocessing the aggregator user local data set, including abnormal value detection and missing value supplementation, adopting independent thermal coding and sin/cos cyclic coding to discrete values in the data, and adopting mean value variance normalization operation to continuous values; and then dividing the preprocessed local data set of the aggregator user into a training set and a testing set which are respectively used for training and testing the model.
The influence factors in the acquired initial data include: time factors, weather factors, industry factors, and economic factors; the latitude data of the time factors are selected from year, month, day, time and minute information to reflect the periodic change of the load; weather factors that affect load changes include temperature, humidity, precipitation, sunlight, wind direction, wind speed, and barometric pressure; industry factors describe the impact on load by using 10 industries of electricity for agriculture/forestry/pasture/fishery, industry, transportation/storage/postal industry, information transmission/software/information technology service industry, wholesale and retail industry, housing and catering industry, financial industry, housing and land industry, leasing and business service industry, public service and management organization; the economic factor directly selects local GDP data to reflect the relationship between the socioeconomic environment and the load.
Preprocessing the local data set of the user of the aggregator, comprising:
a. detecting possible outliers of the energy aggregation server load data set by using a 3-Sigma criterion;
b. filling the missing values according to formulas (1) and (2):
x ab =X a-1 (1-w ab )+X a w ab ,a=2,3,...,T″,b=1,2,...,N (1);
wherein X is a For the data value of the a-th hour of the original sequence, X a-1 For the data value of a-1 h of the original sequence, x ab For the b data value, w, within the a-th hour of the interpolated sequence ab Is X a For x ab N is the total number of split points in 1 hour, T "is the total number of hours of the original sequence;
c. adopting single-heat coding and sin/cos cyclic coding for discrete values in the data;
d. scaling the continuous values in the data by means of mean variance normalization, as shown in formula (3):
wherein x is norm μ is the mean value of the data, and σ is the standard deviation.
S2: the data of the training set is sent into a PCA-BP neural network model of a local server for first training, and initial parameter lambda of the model is given in the training 0 The method comprises the steps of carrying out a first treatment on the surface of the During training, feature extraction is firstly carried out on data of a training set by adopting PCA, wherein the feature extraction comprises standardized processing of a data feature matrix, covariance matrix calculation and singular value decomposition, and a feature matrix after feature extraction is obtained; then the extracted feature matrix is input into PCA- Obtaining a load predicted value of each initial terminal user in the BP neural network model; and calculating the loss values of the load prediction result and the true value by adopting a smooth curve cross entropy method in the back propagation, and carrying out finite round iteration until the loss values are minimum to obtain the single local training optimal network.
Training by adopting a PCA-BP neural network, comprising the following steps of:
s21: for each feature d in the feature data sample of the training set m Calculating the mean valueAnd standard deviation->And carrying out standardization processing on each data to obtain a feature d i ' j Finally, a standardized feature matrix D is obtained stand Wherein m represents the number of features, n represents the sequence length of each feature in the time dimension, i ε n, j ε m, as shown in equations (4) - (8):
wherein D is a feature matrix, D nm Indicating numberSpecific data on the nth length from the mth dimension characteristic of the sample, d' m An m-th dimension eigenvector, d 'representing a normalized eigenvector matrix' nm Specific data of the m-th dimension feature vector of the standardized feature matrix in the nth length is represented;
s22: calculating a normalized feature matrix D stand As shown in formulas (9), (10):
wherein a is ij And a nm Elements representing covariance matrix, k.epsilon.n, d' ki And d' kj The kth data representing the normalized ith and jth dimensional features, respectively, is calculated from equation (7), And->Mean values respectively representing the ith dimension and the jth dimension are calculated by a formula (5);
s23: calculating eigenvalue lambda of covariance matrix A by singular value decomposition SVD q And feature vector Z q Wherein q is E [1, m]As shown in formulas (11), (12):
Z 1 =[z 11 z 12 … z 1m ] T Z 2 =[z 21 z 22 … z 2m ] T …Z m =[z n1 z n2 … z nm ] T (11);
λ 1 ≥λ 2 ≥…≥λ m ≥0 (12);
wherein lambda is m 、Z m Respectively covariance matrixIs a characteristic value and a characteristic vector of (a), z nm N-th data which is an m-th feature vector;
s24: introducing the accumulated contribution rate mu' of the main component as an evaluation index of the feature vector, and selecting a feature vector t with the accumulated contribution rate exceeding 80 percent j As an evaluation matrix T', a feature matrix X is obtained by PCA feature extraction as shown in formulas (13) - (15):
T′=[t 1 t 2 … t m ] (14);
x m =d m t m ,X=DT′ (15);
wherein p' represents the order of eigenvalues, λ j 、λ k Are all lambda m Is a subset of x m Is the m-th dimension characteristic of the characteristic matrix X;
s25: based on the BP neural network model, a load prediction model consisting of 1 input layer, 3 hidden layers and 1 output layer is built, namely a PCA-BP neural network model, and the activation functions of the model are all Sigmoid functions, as shown in a formula (16):
wherein f (x) is an activation function of the neuron, and x represents an output of each layer of the neuron;
s26: setting weight coefficients of 3 hidden layers to omega respectively 123 The threshold values are b 1 ,b 2 ,b 3 The method comprises the steps of carrying out a first treatment on the surface of the The weight coefficient of the output layer is omega 4 A threshold value of b 4 The method comprises the steps of carrying out a first treatment on the surface of the The PCA-BP neural network model parameters are summed up as theta epsilon W, b, wherein W= { omega 1234 },b={b 1 ,b 2 ,b 3 ,b 4 W is the PCA-BP neural network model weight set, and b is the PCA-BP neural network model threshold set; positive direction of the PCA-BP neural network modelThe propagation to the direction is shown in formula (17):
wherein q=z + Indicating the layer number of the network model, and h epsilon q; x is X q =[x q,1 x q,2 … x q,m ]And Y q =[y q,1 y q,2 … y q,m ]Respectively representing the input and output of the q-th layer network, x q,m For the mth input of the q-th layer network, y q,m An mth output for the q-th layer network; omega h And b h Respectively representing the weight coefficient and the threshold value, omega of the h layer network h ∈W,b h E b, and when q=1, X q Equal to X in equation (15), i.e., X is the first layer input of the network model;
s27: inputting the data of the training set into the constructed PCA-BP neural network model through the input X after the PCA dimension reduction to obtain a prediction result;
s28: obtaining a loss function L of each level of the PCA-BP neural network model by adopting a smooth curve cross entropy method q As shown in formula (18):
wherein Y 'is' q Representing the true value of each layer of network;
s29: calculating back propagation gradient of PCA-BP neural network model weightCounter-propagating gradient with thresholdAs shown in formulas (19), (20):
s210: updating PCA-BP neural network model parameters, expressed as formula (21):
Wherein l is the learning rate of the network model, and is used for representing the convergence speed of the training iteration of the network model, omega' h 、b' h Respectively representing the updated PCA-BP neural network model weight and threshold value;
s211: and repeating the steps S26-S210 until the PCA-BP neural network parameter theta' is stopped to be iteratively updated after the limited round of training, so as to obtain the single local training optimal network.
S3: inputting the data of the test set into a single local training optimal network to obtain load prediction information, and then calculating a smooth curve cross entropy loss function of the load prediction information and a true value, a network weight and a counter propagation gradient of a network threshold value to generate a single local optimal network parameter updating value theta', wherein the method comprises the following steps of:
s31: inputting the data of the test set into a single local training optimal network to obtain a load predicted value;
s32: calculating a smooth curve cross entropy loss function L of the test set load predicted value and the true value according to (18) - (20) j (θ) and network weights, network thresholds;
s33: a single local optimum network parameter update value θ' is generated according to equation (21).
S4: the local server uploads a single local optimal network parameter update value theta 'to a central server, the central server obtains weighted average loss of all end users based on FedAVg algorithm, the global model parameter theta is fitted through random gradient descent SGD, then the central server sends the global model parameter theta to the local server, the local server updates the local parameter theta' =theta based on theta, and a PCA-BP neural network model of the local server adopts a new parameter theta to carry out new training, and the method comprises the following steps:
S41: the local server uploads the single local optimal network parameter update value theta' to the central server;
s42: after the central server collects all updated model parameters theta '= { theta' p (p=1,2,…,P)},θ' p And (3) representing a single local optimal network parameter updating value of the p-th response user, performing aggregation processing on the parameters based on FedAVg algorithm, solving a weighted average loss of all terminal users, and fitting a global model parameter theta through SGD (generalized algorithm) as shown in formulas (22) and (23):
wherein F is p (θ) represents the average loss of all data features of the p-th aggregator user, F (θ) is a function of the update θ, F g (θ) represents the average loss of all data features for the g-th aggregator user, g ε P is a subset;
s43: the central server of the energy aggregation server sends the global model parameter theta to all local servers, and the local server of the aggregator user updates the PCA-BP neural network model parameter theta' =0 based on the global model parameter;
s44: and performing a new training round by adopting a new parameter theta in the PCA-BP neural network model of the local server.
S5: repeating the steps S2-S4 until the R-th interaction is completed; through continuous interactive iteration of a central server and a local server, a global optimal model aiming at load prediction under the current market environment is obtained, final load prediction is carried out on the local server by adopting final global optimal model parameters theta, a global optimal load predicted value is obtained, and a corresponding market strategy is formulated according to the global optimal load predicted value to obtain benefits, and the method comprises the following steps:
S51: repeating steps S2-S4, and completing limited times of interaction between the central server and the local server;
s52: after the R-th interaction, a global optimal model aiming at load prediction under the current market environment is obtained, and communication interaction rounds r=1, 2 and … are carried out, wherein R is the number of times of interaction between a local server of an aggregator user and a central server model parameter of an energy aggregation server;
s53: the energy aggregation server verifies the global optimal model and gives corresponding aggregator users a response reward according to the contribution degree of the global optimal model;
s54: carrying out final load prediction of an aggregate user at a local server by adopting a final global optimal model parameter theta to obtain a global optimal load predicted value;
s55: and formulating a corresponding market strategy according to the global optimal load predicted value to obtain benefits.
The following describes the implementation process and the achieved beneficial effects of the energy aggregation server load prediction method based on the transverse federal learning according to the above embodiment of the present invention with a specific example.
The data set used is a multi-element characteristic real data set of 365 days in 2018, 9 months-2019, 8 months of individuals of 10 new energy suppliers under the flag of a large energy aggregation service provider in a certain city in south China. The time granularity of constructing the dataset was 1 hour, i.e. there were 24 multivariate feature load data values per day. The data set involved in training will be as follows: 2: the scale of 2 is divided into a training set, a validation set and a test set.
And finally selecting the input characteristic types of the load prediction model as time, weather, load, industry and economy after comprehensively considering the influence factors of the load. Wherein the time dimension data is selected to reflect the periodic variation of the load by the time-of-year, month, day and time-of-day information; factors that affect load changes include temperature, humidity, precipitation, sunlight, wind direction, wind speed, and barometric pressure; industry type factors describe the impact on load by using 10 industries such as agriculture/forestry/pasture/fishery, industry, transportation/storage/postal industry, information transmission/software/information technology service industry, wholesale and retail industry, accommodation and catering industry, financial industry, house industry, lease and business service industry, public service and management organization; the economic factors then directly select local GDP data reflecting the relationship between socioeconomic environment and load.
Further, preprocessing the data sets of the original power load data such as anomaly detection, missing value filling and the like to construct an energy aggregation service provider load data set, wherein the data sets are specifically shown in the table 1:
table 1 initial feature type of energy aggregation server load dataset
By artificial feature selection of the initial data of five feature types of time, weather, industry, load and economy, single-heat coding and sin/cos cyclic coding conversion treatment are adopted for discrete values, and normalization conversion treatment is adopted for continuous values uniformly, 29 feature quantities are finally obtained, as shown in table 2:
TABLE 2 feature extraction
And extracting main features in table 2 by utilizing SVD and PCA to obtain an extracted feature matrix X.
And building an energy aggregation service provider load prediction framework based on federal learning based on FedAvg algorithm, wherein the main body comprises a wind energy source provider, a photovoltaic energy source provider, an energy storage energy source provider, an electric automobile energy source provider and an energy aggregation service provider. In the application scene, the individual clients of the energy suppliers respectively have independent power data sets, the sample volumes of the data sets are different, but the data sets are in the same area, the load prediction is influenced by the same factors, and the data sets have the data characteristics of the same dimension. The whole process is divided into 6 steps, as follows:
step 1: energy aggregation servers participating in market quotes need to formulate policies to initiate federal training requests for their internal energy suppliers.
Step 2: and the energy supplier decides whether to respond to the request of the server side to carry out prediction model training by combining the local power data according to the self demand.
Step 3: each round of energy supplier responding to server request firstly downloads global model parameters from the energy aggregation server, inputs respective power data into the prediction model at the local client to carry out local training, and uploads model parameters of each round to the server.
Step 4: after multiple communication interactions with the responding energy provider clients, the energy aggregation server obtains a global optimal model for load prediction in the current market environment.
Step 5: the energy aggregation server checks the global optimal model, and gives response energy suppliers a response reward according to the contribution degree of the global optimal model.
Step 6: and the energy aggregation server adopts a final global optimal model to predict the load, and formulates a corresponding market strategy to obtain benefits.
Federal learning model parameters were set according to table 3. The load prediction in this embodiment predicts the load value at the current time by using the historical data 24 hours before the current time, and belongs to the regression task problem. Systems for such problems typically employ four evaluation indices, mean absolute error (Mean Absolute Error, MAE), root mean square error (Root Mean Squared Error, RMSE), mean absolute percent error (Mean Absolute Percentage Error, MAPE), and symmetric mean absolute percent error (Symmetric Mean Absolute Percentage Error, SMAPE). Since RMSE index has a larger penalty for large error samples, is more sensitive to outliers, and load prediction is sensitive to the prediction accuracy requirement, RMSE is used as an evaluation index of the model algorithm, as shown in equation (24):
TABLE 3 model parameters
Parameter name Parameter value
Input layer neurons 32 pieces of
Hidden layer neurons 60 (20X 20) x 20) of
Output layer neurons 10 pieces
Network learning rate l 0.08
Proportion parameter C 0.5
Client quantity parameter P 10 pieces
Local sampling parameter B 100
Local training parameters E 100 wheels
Communication parameter R 10 wheels
Wherein lambda is RMSE Represented asTime prediction value->And the true value->Sample standard deviation of the difference;Is the total number of samples. Lambda (lambda) RMSE Smaller values indicate better model prediction accuracy.
The current mainstream load prediction technical method is comprehensively compared from three dimensions of data privacy and safety, feature extraction and model training speed, as shown in tables 4 and 5. The PF represents the energy aggregation service provider load prediction method based on transverse federal learning, and Fedavg represents the method of the PF under the condition of not extracting features; P-BP, P-LSTM, LSTM represent traditional centralized load prediction methods that require direct access to all data, respectively, whereas P-BP and P-LSTM methods perform feature extraction on the data set.
Table 4 model training time comparisons for different prediction methods
TABLE 5 comparison of RMSE for prediction accuracy for different methods
Client terminal PF Fedavg P-BP P-LSTM LSTM
1 0.03996 0.03882 0.04774 0.06413 0.14433
2 0.04115 0.04194 0.04280 0.05893 0.06413
3 0.03966 0.04044 0.04332 0.07143 0.06074
4 0.04092 0.04545 0.04016 0.06279 0.12337
5 0.04091 0.04545 0.04016 0.08179 0.11793
6 0.03924 0.04196 0.04218 0.08229 0.13123
7 0.03923 0.03980 0.04418 0.04609 0.09295
8 0.03943 0.03937 0.04428 0.08999 0.13312
9 0.04672 0.04163 0.05576 0.10567 0.07222
10 0.04014 0.04163 0.04082 0.04279 0.12828
Average value of 0.04074 0.04165 0.04414 0.07059 0.10683
As can be seen from tables 5 and 6, the PF and P-LSTM methods are improved in the performance of the RMSE values over the Fedavg and LSTM methods, demonstrating that the same method has higher accuracy of feature extraction than the lack of prediction and is also more advantageous in training learning speed. This is because the PCA can effectively discriminate features related to load changes prior to training, thus making the model approach more efficient in training. Compared with the traditional method, the algorithm model load predicted value and the true value have the advantages of minimum deviation and better performance. It can be seen that in the parallel data set environment, the PF method not only can effectively ensure data privacy and safety, but also has excellent performance in the aspects of prediction accuracy and model learning training speed convenience.
Finally, considering that the data sample sizes available among the energy suppliers are different in a real environment, the algorithm model has the problem of unbalanced data sets under the federal distributed learning, the experiment randomly samples the original data samples of 10 energy suppliers according to the proportions of 56%,36%,89%,47%,23%,22%,68%,76%,48% and 35%, and the simulation experiment is carried out to obtain the table 6. The result shows that the algorithm model provided by the invention can still ensure enough prediction precision under the environment of an unbalanced data set, and has stronger universality.
TABLE 6 RMSE comparison of federal learning prediction accuracy under unbalanced data sets
Client terminal RMSE value
1 0.00655
2 0.00874
3 0.08602
4 0.01793
5 0.03718
6 0.03274
7 0.04143
8 0.08920
9 0.00771
10 0.00942
Average of 0.03369
Example 2
The embodiment discloses an energy aggregation service provider load prediction system based on transverse federal learning, which is used for realizing the energy aggregation service provider load prediction method based on transverse federal learning described in embodiment 1, and as shown in fig. 2, the system comprises the following functional modules:
the data acquisition and processing module is used for acquiring initial data of five characteristic types, namely time data, weather data, industry data, load data and economic data, and performing manual characteristic selection to form a local data set of an aggregator user, preprocessing the local data set of the aggregator user, including abnormal value detection and missing value supplementation, adopting independent heat coding and sin/cos cyclic coding on discrete values in the data, and adopting mean value variance normalization operation on continuous values; dividing the preprocessed local data set of the aggregator user into a training set and a testing set which are respectively used for training and testing the model;
The training module is used for transmitting the data of the training set into the PCA-BP neural network model of the local server for first training, and the initial parameter theta of the model is given in the training 0 The method comprises the steps of carrying out a first treatment on the surface of the During training, feature extraction is firstly carried out on data of a training set by adopting PCA, wherein the feature extraction comprises standardized processing of a data feature matrix, covariance matrix calculation and singular value decomposition, and a feature matrix after feature extraction is obtained; inputting the extracted feature matrix into a PCA-BP neural network model to obtain the load predicted value of each initial terminal user; wherein the load is calculated by adopting a smooth curve cross entropy method in back propagationThe predicted result and the loss value of the true value are iterated through a limited wheel until the loss value is minimum, and a single local training optimal network is obtained;
the parameter updating module is used for inputting the data of the test set into a single local training optimal network to obtain load prediction information, and then calculating a smooth curve cross entropy loss function of the load prediction information and a true value, a network weight and a counter propagation gradient of a network threshold value to generate a single local optimal network parameter updating value theta';
the calculation module is used for uploading the single local optimal network parameter updating value theta' to the central server through the local server, the central server is used for solving the weighted average loss of all the terminal users based on the FedAVg algorithm, and the global model parameter theta is fitted through the random gradient descent SGD; then, the central server sends the global model parameter theta to the local server, the local server updates the local parameter theta' =theta based on the theta, and the PCA-BP neural network model of the local server adopts the new parameter theta to carry out new training;
The load prediction module is used for obtaining a global optimal model aiming at load prediction under the current market environment through continuous interactive iteration of the central server and the local server, carrying out final load prediction on the local server by adopting a final global optimal model parameter theta to obtain a global optimal load prediction value, and formulating a corresponding market strategy according to the global optimal load prediction value to obtain benefits.
The above examples are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above examples, and any other changes, modifications, substitutions, combinations, and simplifications that do not depart from the spirit and principle of the present invention should be made in the equivalent manner, and the embodiments are included in the protection scope of the present invention.

Claims (9)

1. The method is characterized in that the method is based on FedAvg transverse Federal learning framework and PCA-BP neural network model to realize load prediction of the energy aggregation server under data privacy security, wherein data and model parameters are respectively placed in a local server of each terminal user and a central server of the energy aggregation server, the local server uses the PCA-BP neural network model to conduct load prediction on the terminal user and calculate Root Mean Square Error (RMSE), and the PCA-BP neural network model extracts main characteristics based on a PCA algorithm on the basis of the original BP neural network model and eliminates useless and redundant characteristics of a local data set of the user of the aggregate; the central server adopts FedAvg algorithm to aggregate weighted average loss of all local servers and update parameters of PCA-BP neural network model; by the limited number of interactions between the local server and the central server, strict adherence to data security and privacy protocols is ensured, and accurate load prediction is realized without compromising user data privacy.
2. The method for predicting the load of an energy aggregation server based on horizontal federal learning according to claim 1, comprising the steps of:
s1: collecting time data, weather data, industry data, load data and economic data, performing manual feature selection to form an aggregator user local data set, preprocessing the aggregator user local data set, including abnormal value detection and missing value supplementation, adopting independent thermal coding and sin/cos cyclic coding to discrete values in the data, and adopting mean value variance normalization operation to continuous values; dividing the preprocessed local data set of the aggregator user into a training set and a testing set which are respectively used for training and testing the model;
s2: the data of the training set is sent into a PCA-BP neural network model of a local server for first training, and initial parameters theta of the model are given in the training 0 The method comprises the steps of carrying out a first treatment on the surface of the During training, feature extraction is firstly carried out on data of a training set by adopting PCA, wherein the feature extraction comprises standardized processing of a data feature matrix, covariance matrix calculation and singular value decomposition, and a feature matrix after feature extraction is obtained; inputting the extracted feature matrix into a PCA-BP neural network model to obtain the load predicted value of each initial terminal user; wherein, the load prediction result is calculated by adopting a smooth curve cross entropy method in back propagation And the loss value of the true value is iterated to the minimum value through a limited round to obtain a single local training optimal network;
s3: inputting the data of the test set into a single local training optimal network to obtain load prediction information, and then calculating a smooth curve cross entropy loss function of the load prediction information and a true value, a network weight and a counter propagation gradient of a network threshold value to generate a single local optimal network parameter updating value theta';
s4: the local server uploads a single local optimal network parameter update value theta' to a central server, the central server obtains weighted average loss of all end users based on FedAVg algorithm, and the global model parameter theta is fitted through random gradient descent SGD; then, the central server sends the global model parameter theta to the local server, the local server updates the local parameter theta' =theta based on the theta, and the PCA-BP neural network model of the local server adopts the new parameter theta to carry out new training;
s5: repeating the steps S2-S4 until the R-th interaction is completed; through continuous interactive iteration of the central server and the local server, a global optimal model aiming at load prediction under the current market environment is obtained, final load prediction is carried out on the local server by adopting final global optimal model parameters theta, a global optimal load predicted value is obtained, and a corresponding market strategy is formulated according to the global optimal load predicted value so as to obtain benefits.
3. The method for predicting load of energy aggregation server based on horizontal federal learning according to claim 2, wherein in step S1, the influencing factors in the collected initial data include: time factors, weather factors, industry factors, and economic factors; the latitude data of the time factors are selected from year, month, day, time and minute information to reflect the periodic change of the load; weather factors that affect load changes include temperature, humidity, precipitation, sunlight, wind direction, wind speed, and barometric pressure; industry factors describe the impact on load by using 10 industries of electricity for agriculture/forestry/pasture/fishery, industry, transportation/storage/postal industry, information transmission/software/information technology service industry, wholesale and retail industry, housing and catering industry, financial industry, housing and land industry, leasing and business service industry, public service and management organization; the economic factor directly selects local GDP data to reflect the relationship between the socioeconomic environment and the load.
4. The method for predicting load of energy aggregation server based on horizontal federal learning according to claim 3, wherein the preprocessing of the local data set of the aggregator user in step S1 comprises:
a. Detecting possible outliers of the energy aggregation server load data set by using a 3-Sigma criterion;
b. filling the missing values according to formulas (1) and (2):
x ab =X a-1 (1-w ab )+X a w ab ,a=2,3,...,T″,b=1,2,...,N (1);
wherein X is a For the data value of the a-th hour of the original sequence, X a-1 For the data value of a-1 h of the original sequence, x ab For the b data value, w, within the a-th hour of the interpolated sequence ab Is X a For x ab N is the total number of split points in 1 hour, T "is the total number of hours of the original sequence;
c. adopting single-heat coding and sin/cos cyclic coding for discrete values in the data;
d. scaling the continuous values in the data by means of mean variance normalization, as shown in formula (3):
wherein x is norm μ is the mean value of the data, and σ is the standard deviation.
5. The method for predicting the load of an energy aggregation server based on horizontal federal learning according to claim 4, wherein the training using the PCA-BP neural network in step S2 comprises the steps of:
s21: for each feature d in the feature data sample of the training set m Calculating the mean valueAnd standard deviation->And carrying out standardization processing on each data to obtain a feature d i ' j Finally, a standardized feature matrix D is obtained stand Wherein m represents the number of features, n represents the sequence length of each feature in the time dimension, i ε n, j ε m, as shown in equations (4) - (8):
Wherein D is a feature matrix, D nm Specific data representing the mth dimension characteristic of the data sample over the nth length, d' m An m-th dimension eigenvector, d 'representing a normalized eigenvector matrix' nm Specific data of the m-th dimension feature vector of the standardized feature matrix in the nth length is represented;
s22: calculating a normalized feature matrix D stand As shown in formulas (9), (10):
wherein a is ij And a nm Elements representing covariance matrix, k.epsilon.n, d' ki And d' kj The kth data representing the normalized ith and jth dimensional features, respectively, is calculated from equation (7),and->Mean values respectively representing the ith dimension and the jth dimension are calculated by a formula (5);
s23: calculating eigenvalue lambda of covariance matrix A by singular value decomposition SVD q And feature vector Z q Wherein q is E [1, m]As shown in formulas (11), (12):
Z 1 =[z 11 z 12 … z 1m ] T Z 2 =[z 21 z 22 … z 2m ] T … Z m =[z n1 z n2 … z nm ] T (11);
λ 1 ≥λ 2 ≥…≥ m ≤0 (12);
wherein lambda is m 、Z m Eigenvalues and eigenvectors, z, of the covariance matrix, respectively nm Nth as mth eigenvectorData;
s24: introducing the accumulated contribution rate mu' of the main component as an evaluation index of the feature vector, and selecting a feature vector t with the accumulated contribution rate exceeding 80 percent j As an evaluation matrix T', a feature matrix X is obtained by PCA feature extraction as shown in formulas (13) - (15):
T′=[t 1 t 2 … t m ] (14);
x m =d m t m ,X=DT′ (15);
Wherein p' represents the order of eigenvalues, λ j 、λ k Are all lambda m Is a subset of x m Is the m-th dimension characteristic of the characteristic matrix X;
s25: based on the BP neural network model, a load prediction model consisting of 1 input layer, 3 hidden layers and 1 output layer is built, namely a PCA-BP neural network model, and the activation functions of the model are all Sigmoid functions, as shown in a formula (16):
wherein f (x) is an activation function of the neuron, and x represents an output of each layer of the neuron;
s26: setting weight coefficients of 3 hidden layers to omega respectively 123 The threshold values are b 1 ,b 2 ,b 3 The method comprises the steps of carrying out a first treatment on the surface of the The weight coefficient of the output layer is omega 4 A threshold value of b 4 The method comprises the steps of carrying out a first treatment on the surface of the The PCA-BP neural network model parameters are summed up as theta epsilon W, b, wherein W= { omega 1234 |,b={b 1 ,b 2 ,b 3 ,b 4 W is the PCA-BP neural network model weight set, and b is the PCA-BP neural network model threshold set; the forward propagation of the PCA-BP neural network model is shown as the following formula (17):
wherein q=z + Indicating the layer number of the network model, and h epsilon q; x is X q =[x q,1 x q,2 … x q,m ]And Y q =[y q,1 y q,2 … y q,m ]Respectively representing the input and output of the q-th layer network, x q,m For the mth input of the q-th layer network, y q,m An mth output for the q-th layer network; omega h And b h Respectively representing the weight coefficient and the threshold value, omega of the h layer network h ∈W,b h E b, and when q=1, X q Equal to X in equation (15), i.e., X is the first layer input of the network model;
S27: inputting the data of the training set into the constructed PCA-BP neural network model through the input X after the PCA dimension reduction to obtain a prediction result;
s28: obtaining a loss function L of each level of the PCA-BP neural network model by adopting a smooth curve cross entropy method q As shown in formula (18):
wherein Y 'is' q Representing the true value of each layer of network;
s29: calculating back propagation gradient of PCA-BP neural network model weightCounter-propagating gradient to threshold->As shown in formulas (19), (20):
s210: updating PCA-BP neural network model parameters, expressed as formula (21):
wherein l is the learning rate of the network model, and is used for representing the convergence speed of the training iteration of the network model, omega' h 、b' h Respectively representing the updated PCA-BP neural network model weight and threshold value;
s211: and repeating the steps S26-S210 until the PCA-BP neural network parameter theta' is stopped to be iteratively updated after the limited round of training, so as to obtain the single local training optimal network.
6. The method for predicting load of energy aggregation server based on horizontal federal learning according to claim 5, wherein the step S3 comprises the steps of:
s31: inputting the data of the test set into a single local training optimal network to obtain a load predicted value;
S32: calculating a smooth curve cross entropy loss function L of the test set load predicted value and the true value according to (18) - (20) j (θ) and network weights, network thresholds;
s33: a single local optimum network parameter update value θ' is generated according to equation (21).
7. The method for predicting load of energy aggregation server based on horizontal federal learning according to claim 6, wherein the step S4 comprises the steps of:
s41: the local server uploads the single local optimal network parameter update value theta' to the central server;
s42: the central server is collectingAll the updated model parameters theta ' = { theta ' responding to the user ' p (p=1,2,…,P)},θ' p And (3) representing a single local optimal network parameter updating value of the p-th response user, performing aggregation processing on the parameters based on FedAVg algorithm, solving a weighted average loss of all terminal users, and fitting a global model parameter theta through SGD (generalized algorithm) as shown in formulas (22) and (23):
wherein F is p (θ) represents the average loss of all data features of the p-th aggregator user, F (θ) is a function of the update θ, F g (θ) represents the average loss of all data features for the g-th aggregator user, g ε P is a subset;
s43: the central server of the energy aggregation server sends the global model parameter theta to all local servers, and the local server of the aggregator user updates the PCA-BP neural network model parameter theta' =theta based on the global model parameter;
S44: and performing a new training round by adopting a new parameter theta in the PCA-BP neural network model of the local server.
8. The method for predicting load of energy aggregation server based on horizontal federal learning according to claim 7, wherein the step S5 comprises the steps of:
s51: repeating steps S2-S4, and completing limited times of interaction between the central server and the local server;
s52: after the R-th interaction, a global optimal model aiming at load prediction under the current market environment is obtained, and communication interaction rounds r=1, 2 and … are carried out, wherein R is the number of times of interaction between a local server of an aggregator user and a central server model parameter of an energy aggregation server;
s53: the energy aggregation server verifies the global optimal model and gives corresponding aggregator users a response reward according to the contribution degree of the global optimal model;
s54: carrying out final load prediction of an aggregate user at a local server by adopting a final global optimal model parameter theta to obtain a global optimal load predicted value;
s55: and formulating a corresponding market strategy according to the global optimal load predicted value to obtain benefits.
9. The energy aggregation server load prediction system based on transverse federal learning, which is used for realizing the energy aggregation server load prediction method based on transverse federal learning as claimed in any one of claims 1 to 8, and comprises the following steps:
The data acquisition and processing module is used for acquiring initial data of five characteristic types, namely time data, weather data, industry data, load data and economic data, and performing manual characteristic selection to form a local data set of an aggregator user, preprocessing the local data set of the aggregator user, including abnormal value detection and missing value supplementation, adopting independent heat coding and sin/cos cyclic coding on discrete values in the data, and adopting mean value variance normalization operation on continuous values; dividing the preprocessed local data set of the aggregator user into a training set and a testing set which are respectively used for training and testing the model;
the training module is used for transmitting the data of the training set into the PCA-BP neural network model of the local server for first training, and the initial parameter theta of the model is given in the training 0 The method comprises the steps of carrying out a first treatment on the surface of the During training, feature extraction is firstly carried out on data of a training set by adopting PCA, wherein the feature extraction comprises standardized processing of a data feature matrix, covariance matrix calculation and singular value decomposition, and a feature matrix after feature extraction is obtained; inputting the extracted feature matrix into a PCA-BP neural network model to obtain the load predicted value of each initial terminal user; calculating a load prediction result and a loss value of a true value by adopting a smooth curve cross entropy method in back propagation, and carrying out finite round iteration until the loss value is minimum to obtain a single local training optimal network;
The parameter updating module is used for inputting the data of the test set into a single local training optimal network to obtain load prediction information, and then calculating a smooth curve cross entropy loss function of the load prediction information and a true value, a network weight and a counter propagation gradient of a network threshold value to generate a single local optimal network parameter updating value theta';
the calculation module is used for uploading the single local optimal network parameter updating value theta' to the central server through the local server, the central server is used for solving the weighted average loss of all the terminal users based on the FedAVg algorithm, and the global model parameter theta is fitted through the random gradient descent SGD; then, the central server sends the global model parameter theta to the local server, the local server updates the local parameter theta' =theta based on the theta, and the PCA-BP neural network model of the local server adopts the new parameter theta to carry out new training;
the load prediction module is used for obtaining a global optimal model aiming at load prediction under the current market environment through continuous interactive iteration of the central server and the local server, carrying out final load prediction on the local server by adopting a final global optimal model parameter theta to obtain a global optimal load prediction value, and formulating a corresponding market strategy according to the global optimal load prediction value to obtain benefits.
CN202311535675.1A 2023-11-16 2023-11-16 Energy aggregation service provider load prediction method and system based on transverse federal learning Pending CN117350439A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311535675.1A CN117350439A (en) 2023-11-16 2023-11-16 Energy aggregation service provider load prediction method and system based on transverse federal learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311535675.1A CN117350439A (en) 2023-11-16 2023-11-16 Energy aggregation service provider load prediction method and system based on transverse federal learning

Publications (1)

Publication Number Publication Date
CN117350439A true CN117350439A (en) 2024-01-05

Family

ID=89359666

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311535675.1A Pending CN117350439A (en) 2023-11-16 2023-11-16 Energy aggregation service provider load prediction method and system based on transverse federal learning

Country Status (1)

Country Link
CN (1) CN117350439A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113962364A (en) * 2021-10-22 2022-01-21 四川大学 Multi-factor power load prediction method based on deep learning
CN115600717A (en) * 2022-09-07 2023-01-13 东南大学(Cn) Federal learning-based industry-divided power load prediction method, equipment and storage medium
CN115775010A (en) * 2022-11-23 2023-03-10 国网江苏省电力有限公司信息通信分公司 Electric power data sharing method based on horizontal federal learning
CN116128164A (en) * 2023-04-13 2023-05-16 南京邮电大学 Power load short-term prediction system and method based on privacy protection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113962364A (en) * 2021-10-22 2022-01-21 四川大学 Multi-factor power load prediction method based on deep learning
CN115600717A (en) * 2022-09-07 2023-01-13 东南大学(Cn) Federal learning-based industry-divided power load prediction method, equipment and storage medium
CN115775010A (en) * 2022-11-23 2023-03-10 国网江苏省电力有限公司信息通信分公司 Electric power data sharing method based on horizontal federal learning
CN116128164A (en) * 2023-04-13 2023-05-16 南京邮电大学 Power load short-term prediction system and method based on privacy protection

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王佩作: "矿井防尘供水管网可靠性分析与优化", 28 February 2022, 北京理工大学出版社, pages: 144 - 146 *
王海峰: "考虑气象因素的PCA-BP神经网络短期负荷预测", 电工电气, 15 July 2018 (2018-07-15) *

Similar Documents

Publication Publication Date Title
Yang et al. Bayesian deep learning-based probabilistic load forecasting in smart grids
Zhou et al. Multi-objective prediction intervals for wind power forecast based on deep neural networks
Zhang et al. Probabilistic solar irradiation forecasting based on variational Bayesian inference with secure federated learning
Mellit et al. A 24-h forecast of solar irradiance using artificial neural network: Application for performance prediction of a grid-connected PV plant at Trieste, Italy
Shabri et al. Streamflow forecasting using least-squares support vector machines
Jalalkamali Using of hybrid fuzzy models to predict spatiotemporal groundwater quality parameters
Chang et al. Bike sharing demand prediction using artificial immune system and artificial neural network
Sawale et al. Use of artificial neural network in data mining for weather forecasting
Li et al. A novel combined prediction model for monthly mean precipitation with error correction strategy
Trattner et al. Investigating the utility of the weather context for point of interest recommendations
Chen et al. A novel trilinear deep residual network with self-adaptive Dropout method for short-term load forecasting
Shi et al. Temporal dynamic matrix factorization for missing data prediction in large scale coevolving time series
Sahoo et al. Space–time forecasting of groundwater level using a hybrid soft computing model
Zhang et al. Load Prediction Based on Hybrid Model of VMD‐mRMR‐BPNN‐LSSVM
Bamisile et al. Comprehensive assessment, review, and comparison of AI models for solar irradiance prediction based on different time/estimation intervals
CN115759371A (en) GCN-LSTM-based short-term load prediction method for power system
Bagherzadeh et al. Parametric-based neural networks and TOPSIS modeling in land suitability evaluation for alfalfa production using GIS
Bai et al. Accurate four-hour-ahead probabilistic forecast of photovoltaic power generation based on multiple meteorological variables-aided intelligent optimization of numeric weather prediction data
Hong et al. Forecasting solar irradiation using convolutional long short-term memory and feature selection of data from neighboring locations
Ercan et al. Prediction of solar irradiance with machine learning methods using satellite data
CN117634554A (en) Space-time deep learning runoff prediction method and system based on spatial information fusion
Huang et al. Load forecasting using federated learning with considering electricity data privacy preservation of EASP
CN117350439A (en) Energy aggregation service provider load prediction method and system based on transverse federal learning
Peng et al. Meteorological satellite operation prediction using a BiLSTM deep learning model
Yeganeh et al. Shallow vs. Deep Learning Models for Groundwater Level Prediction: A Multi-Piezometer Data Integration Approach

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination