The invention relates to an
electricity consumption prediction method and
system based on fusion RAG and personalized graph
federated learning, and belongs to the technical field of
electricity consumption prediction. The method comprises the following steps of: preprocessing historical
electricity consumption data of each municipal district, converting the historical electricity consumption data into a data frame, and improving
data quality by removing a full null value column, eliminating abnormal data, filling missing values by adopting linear interpolation and the like; carrying out normalization
processing on the data by utilizing a Z-
score and Min-Max
standardization method; a graph neural network is adopted as a basic model structure, an adjacent matrix is generated in combination with geographic position information, and the space incidence relation between communities is captured; an RAG
knowledge base is introduced, special scene structured external knowledge is integrated, an embedded vector is generated through Sension-BERT to achieve historical scene retrieval, a
retrieval result and
model prediction are fused in combination with a gating mechanism, under a
federated learning framework, a
server initializes a plurality of personalized models, and a user carries out training locally to upload updated
model parameters. And the
server calculates an aggregation weight between the users through the functional feature similarity.