Electrical load prediction method and system based on homomorphic encryption, and medium
Through the combination of homomorphic encryption technology and adaptive hybrid neural network, the problems of privacy leakage and low computing efficiency in power load prediction are solved, and efficient and safe power load prediction is achieved, supporting multi-party data sharing and accurate analysis.
Patent Information
- Application Number
- CN202510304783.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-07-08
AI Technical Summary
The existing power load prediction methods have problems such as privacy leakage, difficulty in data exchange, low computing efficiency and insufficient prediction accuracy. Especially in smart grids, it is difficult to improve the accuracy and efficiency of power load prediction while ensuring privacy and security.
Homomorphic encryption technology is used to encrypt the power consumption data, and the adaptive hybrid neural network is used for training and prediction. Public and private keys are created through a fully homomorphic encryption algorithm to ensure that the data is processed in an encrypted state, and computationally optimized by combining distributed architecture and multi-core processors.
It effectively solves the problem of data privacy leakage, improves the accuracy and computing efficiency of prediction, supports collaborative analysis by multiple parties, and improves the overall effect of power load prediction.
Smart Images

Figure CN120278312A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of power system optimal scheduling and data privacy protection, and more specifically, to a method, system and medium for predicting electricity load based on homomorphic encryption, which is applicable to the smart grid environment and uses homomorphic encryption technology to perform power load prediction analysis while ensuring user data privacy. Background Art
[0002] Currently, with the rapid development of smart grid technology, power load prediction plays an increasingly important role in the scheduling, optimization and operation management of power systems. Most traditional power load prediction methods rely on historical data for trend analysis, and common technologies include regression analysis, time series models, neural networks, etc. However, these methods have the following problems:
[0003] Privacy leakage: With the collection and utilization of power consumption data, users' electricity consumption data involves personal privacy. Traditional methods need to centrally process users' electricity consumption data on the server side, and it is easy to be leaked without sufficient protection measures.
[0004] Difficult data exchange: Collaborative analysis among multiple data providers requires the exchange of a large amount of sensitive data, which makes it more difficult to protect privacy and ensure data security.
[0005] Low computing efficiency: With the growth of the user scale, the data volume increases sharply. When traditional prediction models process massive data, the computational complexity is high, and it is difficult to meet the requirements of real-time prediction and scheduling.
[0006] Prediction accuracy: Factors such as complex climate conditions and holidays make it difficult to improve the load prediction accuracy.
[0007] Therefore, how to improve the accuracy and efficiency of power load prediction while ensuring privacy security has become an urgent technical problem to be solved. Summary of the Invention
[0008] In view of this, the present invention provides a method, system and medium for predicting electricity load based on homomorphic encryption. By using homomorphic encryption technology, the electricity consumption data is encrypted and then load prediction is performed. This method can ensure data privacy while using the encrypted data for efficient model training and prediction, thus effectively solving the problems of data privacy leakage and low computing efficiency.
[0009] To achieve the above object, the present invention adopts the following technical solutions:
[0010] In the first aspect, an embodiment of the present invention provides a method for predicting electricity load based on homomorphic encryption, including the following steps:
[0011] S10. Multiple clients, acting as senders, create a public key Pk1 and a private key Sk1, encrypt their historical electricity consumption data according to the public key Pk1, and send the encrypted data to the power load forecasting server side;
[0012] S20. The power load forecasting server side receives the encrypted data sent by the senders and obtains the weather data corresponding to the same time as the historical electricity consumption data; uses the encrypted data and the corresponding weather data as training data to train the constructed network model;
[0013] S30. After the training is completed, the power load forecasting server side receives the encrypted data sent by the terminal to be predicted and simultaneously obtains the corresponding weather forecast data as the input of the network model;
[0014] S40. The network model outputs the corresponding encrypted prediction result, and the power load forecasting server side sends the encrypted prediction result to the corresponding terminal; the terminal decrypts it according to its own private key Sk1 to obtain the final power load prediction value.
[0015] Further, in step S10, multiple clients, acting as senders, use the fully homomorphic encryption FHE algorithm to create the public key Pk1 and the private key Sk1.
[0016] Further, in step S20, the constructed network model is an adaptive hybrid neural network; the adaptive hybrid neural network includes:
[0017] An input layer for encrypted historical electricity consumption data and plaintext weather data; where the number of input layer nodes is determined according to the data feature dimension;
[0018] The encrypted data processing layer includes: a homomorphic encryption convolutional layer and a homomorphic encryption pooling layer; where the homomorphic encryption convolutional layer is used to extract local features from the encrypted electricity consumption data; the homomorphic encryption pooling layer is used to reduce the dimension of the features output by the convolutional layer;
[0019] The plaintext data processing layer is used to process the plaintext weather data, using a convolutional neural network CNN or a fully connected layer Dense Layer;
[0020] A fusion layer for fusing the outputs of the encrypted data processing layer and the plaintext data processing layer, using feature splicing or feature addition for hybrid feature fusion;
[0021] A hidden layer, a long short-term memory network LSTM or a gated recurrent unit GRU, to capture the long-term dependence relationship of time series data;
[0022] An output layer, which is a single or multiple neurons, outputting the encrypted load prediction result.
[0023] Further, the process of training the adaptive hybrid neural network is as follows:
[0024] 1) Obtain the homomorphically encrypted historical electricity consumption data and the corresponding plaintext weather data, and perform normalization and standardization processing on the weather data;
[0025] 2) Initialize the weight and bias parameters of the AHNN model;
[0026] 3) Input the homomorphically encrypted historical electricity consumption data and the corresponding preprocessed weather data into the AHNN model, and perform forward propagation calculation through each layer of the neural network;
[0027] 4) Use the polynomial approximation method to approximate the non-linear activation function of the neural network, and calculate the encrypted gradients of each layer through the backpropagation algorithm compatible with the homomorphic encryption algorithm;
[0028] 5) Update the weight and bias parameters of the model according to the calculated encrypted gradients;
[0029] 6) Use the validation set to verify the model, evaluate the performance of the model, and stop training when the performance on the validation set no longer improves to obtain the corresponding network model.
[0030] Further, before inputting the homomorphically encrypted historical electricity consumption data and the corresponding preprocessed weather data into the AHNN model in step 3), it further includes dimensionality reduction processing of the homomorphically encrypted historical electricity consumption data, specifically including:
[0031] (1) Block data processing:
[0032] Divide the encrypted data into blocks and calculate the encrypted mean and covariance of each block of data respectively;
[0033] (2) Covariance matrix calculation:
[0034] For each encrypted data block, calculate the encrypted covariance matrix of the encrypted data;
[0035] (3) Eigenvalue decomposition:
[0036] Use the power iteration method to calculate the encrypted eigenvalues and eigenvectors of the covariance matrix.
[0037] Further, the power load prediction server side adopts a distributed architecture to process encrypted data in parallel, and uses a multi-core processor and GPU to accelerate matrix operations; the data of each training batch is independently calculated by different nodes, and finally the global update result is obtained through encrypted aggregation.
[0038] In a second aspect, an embodiment of the present invention further provides a power load prediction system based on homomorphic encryption, including:
[0039] Client data encryption and sending module: Multiple clients, acting as senders, create a public key Pk1 and a private key Sk1, encrypt their historical electricity consumption data according to the public key Pk1, and send the encrypted data to the power load forecasting server side;
[0040] Server training module: The power load forecasting server side receives the encrypted data sent by the sender and obtains the weather data corresponding to the same time as the historical electricity consumption data; uses the encrypted data and the corresponding weather data as training data to train the constructed network model;
[0041] Server prediction module: After training is completed, the power load forecasting server side receives the encrypted data sent by the terminal to be predicted and simultaneously obtains the corresponding weather forecast data as the input of the network model;
[0042] Terminal decryption module: The network model outputs the corresponding encrypted prediction result, and the power load forecasting server side sends the encrypted prediction result to the corresponding terminal; the terminal decrypts it according to its own private key Sk1 to obtain the final power load prediction value.
[0043] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the homomorphic encryption-based electricity load forecasting method as described in the first aspect.
[0044] As can be seen from the above technical solutions, compared with the prior art, the present invention discloses a homomorphic encryption-based electricity load forecasting method, which has the following technical advantages:
[0045] 1. Privacy protection: Through homomorphic encryption, it is ensured that all data processing processes are carried out in an encrypted state, fundamentally avoiding the problem of data leakage.
[0046] 2. Accuracy improvement: Since the processing process of encrypted data is more transparent and secure, it avoids prediction errors caused by human operations or data tampering, improving the reliability and accuracy of prediction. In addition, by integrating historical data and weather data, the accuracy and robustness of the prediction model are improved.
[0047] 3. Optimization of calculation: Adopt optimization strategies such as block calculation and dimensionality reduction to reduce the computational burden brought by homomorphic encryption.
[0048] 4. Multi-party collaborative analysis: Multiple data providers such as power companies and data analysis institutions can safely share data and conduct collaborative analysis on the premise of ensuring privacy, improving the overall power load forecasting effect. Description of the Drawings
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.
[0050] Figure 1 It is a flowchart of the power consumption load prediction method based on homomorphic encryption provided by the present invention.
[0051] Figure 2 It is a principle interaction diagram of the power consumption load prediction method based on homomorphic encryption provided by the present invention.
[0052] Figure 3 It is a block diagram of the power consumption load prediction system based on homomorphic encryption provided by the present invention. Specific embodiments
[0053] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0054] Homomorphic encryption is a cryptographic technology that allows mathematical operations on ciphertext without decrypting the ciphertext. This provides an innovative solution to solve the data privacy and security problems in power consumption load prediction.
[0055] Embodiment 1:
[0056] The embodiment of the present invention discloses a power consumption load prediction method based on homomorphic encryption. Referring to Figure 1 as shown, it includes the following steps:
[0057] S10. Multiple clients, as senders, create a public key Pk1 and a private key Sk1, encrypt their historical power consumption data according to the public key Pk1, and send the encrypted data to the power load prediction server.
[0058] In this step, for example, the power station management terminals in multiple regions can each create a public key Pk1 and a private key Sk1 based on the homomorphic encryption algorithm, and encrypt the historical power consumption data through the public key Pk1. The encrypted data is sent to the power load prediction server.
[0059] Since the homomorphic encryption technology is adopted, it ensures that the user's historical electricity consumption data remains encrypted throughout the entire processing process. Even during the server - side and model training processes, the server cannot view the original data, thus protecting user privacy to the greatest extent.
[0060] S20. The power load prediction server - side receives the encrypted data sent by the sending - end, and obtains the weather data corresponding to the same time as the historical electricity consumption data; uses the encrypted data and the corresponding weather data as training data to train the constructed network model.
[0061] After the server - side receives the encrypted data, it simultaneously obtains the weather data corresponding to the data. The server - side uses these encrypted data and the plain - text weather data together to train a prediction model.
[0062] The server - side combines the encrypted historical electricity consumption data and the plain - text weather data, and uses an adaptive prediction model for training to obtain a prediction model, so as to accurately predict the future power load demand and provide a scientific basis for power dispatching and energy management.
[0063] S30. After training is completed, the power load prediction server - side receives the encrypted data sent by the terminal to be predicted, and simultaneously obtains the corresponding weather forecast data as the input of the network model.
[0064] S40. The network model outputs the corresponding encrypted prediction result, and the power load prediction server - side sends the encrypted prediction result to the corresponding terminal; the terminal decrypts it according to its own private key Sk1 to obtain the final power load prediction value.
[0065] In this embodiment, the client does not need to directly upload the original data to the server, but interacts through encrypted data, reducing the risk of data leakage; at the same time, while protecting data privacy, it uses an efficient network model for accurate load prediction, effectively solving the problem of data privacy leakage in traditional load prediction and improving the security and computational efficiency of the prediction system.
[0066] As Figure 2 shown, the technical solution of the present invention will be further described in detail below:
[0067] Step 1: Client data encryption and sending
[0068] Multiple clients act as sending - ends, create a public key Pk1 and a private key Sk1, and use the Fully Homomorphic Encryption (FHE) algorithm to encrypt the historical electricity consumption data. The specific process is as follows:
[0069] 1. Taking a certain client as an example, its historical electricity consumption data is a time series D = {d1, d2, d3,..., d n}, with the unit being kilowatt - hour (kWh).
[0070] 2. Generate a key pair (Pk1, Sk1) using the key generation algorithm.
[0071] 3. Encrypt each data point using the public key Pk1:
[0072] E(D) = {E(d1), E(d2), …, E(d n )}
[0073] where E(d i ) represents the encrypted value of data d i .
[0074] And SK1 is used by the client to decrypt the data.
[0075] 4. Send the encrypted data E(D) to the power load forecasting server - side through a secure communication protocol (such as TLS).
[0076] Step 2: Server - side data pre - processing
[0077] Among them, deploy a distributed architecture on the server - side, use multi - core processors and GPUs to process encrypted data in parallel, and the matrix operation acceleration ratio is more than 10 times. Each node independently processes the assigned data block, and updates the global model parameters through the encrypted aggregation algorithm after training. To ensure data consistency, use the federated learning protocol for synchronization between nodes, and synchronize the data of each client according to the time stamp to ensure the temporal consistency of the training data.
[0078] In this step, after the server receives data from multiple clients, it obtains historical weather data through the external weather data interface and performs the following processing:
[0079] 1. The weather data includes features such as temperature, humidity, rainfall, wind speed, etc., with the units being degrees Celsius (°C), percentage (%), millimeters (mm), and meters per second (m / s) respectively. Assume the data is T = {t1, t2, t3,..., t n}
[0080] 2. Normalize the weather data:
[0081]
[0082] where t max and t min are the maximum and minimum values of the feature respectively.
[0083] Step 3: Network Model Construction and Training
[0084] Construct an Adaptive Hybrid Neural Network (AHNN for short) for model training.
[0085] 1. Input Layer:
[0086] The input layer receives two main data streams. One is the encrypted historical electricity consumption data, and the other is the plaintext weather data. The number of nodes is 32, and the number of input layer nodes is determined according to the data feature dimension. Combining weather data and electricity consumption data for training can improve the prediction accuracy of power load, especially in the face of complex weather changes and special situations such as holidays.
[0087] Input the encrypted historical electricity consumption data E(D) and the normalized weather data T′ = {t′1, t′2,... t′ n}.
[0088] 2. Encrypted Data Processing Layer:
[0089] This layer is dedicated to processing encrypted data and adopts a neural network structure compatible with the homomorphic encryption algorithm, such as the Homomorphic Encryption Perceptron (HEP), which allows feature extraction and preliminary processing in the encrypted state.
[0090] Specifically include:
[0091] Homomorphic Encryption Convolution Layer (HE-ConvLayer): Extract local features from the encrypted electricity consumption data. The convolution kernel size is k×k, and the sliding step is s. The output is
[0092] F c = E(D) * W c
[0093] where W c is the convolution kernel weight matrix, and * represents the convolution operation.
[0094] Homomorphic Encryption Pooling Layer (HE-Pooling Layer): Reduce the dimension of the features output by the convolution layer. For example, use max pooling or average pooling to reduce the dimension of the features, and the pooling window size is p×p.
[0095] 3. Plaintext Data Processing Layer: This layer processes the plaintext weather data and adopts a traditional neural network structure, such as a Convolutional Neural Network (CNN) or a Dense Layer.
[0096] For example, when using a CNN to process normalized weather data, the convolutional kernel size of the convolutional layer is 3×3, the ReLU activation function is used, and the output feature matrix is F t .
[0097] Weather-Conv Layer: Extract features from weather data.
[0098] Weather-Pooling Layer: Reduce the dimension of the features output by the convolutional layer.
[0099] 4. Fusion Layer: Fuse the outputs of the encrypted data processing layer and the plaintext data processing layer, and adopt a hybrid feature fusion strategy, such as Feature Concatenation or Feature Addition.
[0100] Perform feature concatenation on the encrypted features and weather features:
[0101] F f =[F c , F t
[0102] Or feature addition:
[0103] F f =F c +F t
[0104] 5. Hidden Layer: The hidden layer adopts a deep neural network structure, such as Long Short-Term Memory (LSTM) or Gated Recurrent Unit (GRU), to capture the long-term dependencies of time series data.
[0105] Specifically, it includes: LSTM / GRU Layer: Further process the fused features and learn the dynamic characteristics of the time series.
[0106] Dropout Layer: Prevent overfitting and improve the generalization ability of the model.
[0107] When using Long Short-Term Memory (LSTM), the number of hidden units is set to 128.
[0108] 6. Output Layer: The output layer consists of one or more neurons, and outputs the encrypted load prediction results.
[0109] Among them, the training process of the adaptive hybrid neural network is as follows:
[0110] 1) Data preprocessing: Obtain the homomorphically encrypted historical electricity consumption data and the corresponding plaintext weather data, and perform normalization and standardization processing on the weather data;
[0111] 2) Model initialization: Initialize the weight and bias parameters of the AHNN model;
[0112] 3) Forward propagation: Input the homomorphically encrypted historical electricity consumption data and the corresponding preprocessed weather data into the AHNN model, and perform forward propagation calculations through each layer of the neural network;
[0113] In specific implementation: Before inputting the homomorphically encrypted historical electricity consumption data and the corresponding preprocessed weather data into the AHNN model, it also includes dimensionality reduction processing of the homomorphically encrypted historical electricity consumption data, specifically including:
[0114] (1) Block data processing:
[0115] Divide the historical electricity consumption data into m data blocks according to time, and the size of each block is n / m. For each data block, calculate the encrypted mean E(μ) and the encrypted covariance E(Σ):
[0116]
[0117] k represents the number of data points in each data block.
[0118] Among them, the large-scale data is processed in blocks, and a small part of the data is processed each time, reducing the computational complexity of the encryption operation.
[0119] (2) Covariance matrix calculation and eigenvalue decomposition
[0120] Perform eigenvalue decomposition on the covariance matrix, use the power iteration method to calculate the encrypted eigenvalues and eigenvectors, and finally extract the main features for model input. Adopt a dimensionality reduction method to process the input features and reduce the data dimension, thereby improving the training efficiency.
[0121] 4) Homomorphic encryption loss calculation:
[0122] Since the result of the output layer is encrypted, it is necessary to use the homomorphic encryption algorithm to calculate the loss function, such as the Mean Squared Error (MSE). Calculate the loss function: Calculate the loss function in the encrypted state. Taking the Mean Squared Error (MSE) as an example, the calculation process of the loss function is as follows:
[0123] Calculate the difference between the predicted value and the label: For each sample, calculate the difference between the encrypted predicted value and the encrypted label.
[0124] Square the difference: Square the difference obtained in the previous step. Since homomorphic encryption supports multiplication operations, this step can be completed in the encrypted state.
[0125] Summation: Sum the squared differences of all samples to obtain the loss value of the entire batch. Homomorphic encryption also supports addition operations, so this step can also be completed in the encrypted state.
[0126] 5) Backpropagation: Use the homomorphic encryption algorithm to calculate the loss function, and calculate the gradients of each layer through the backpropagation algorithm compatible with the homomorphic encryption algorithm;
[0127] 6) Parameter update: Update the weight and bias parameters of the model according to the calculated gradients;
[0128] 7) Model validation and early stopping: Use the validation set to validate the model, evaluate the performance of the model. When the performance on the validation set no longer improves, stop training to prevent overfitting and obtain the corresponding network model.
[0129] For example: The training batch size (Batch Size) is set to 128, the initial learning rate is 0.001, and the optimizer uses the encrypted version of the Adam optimization algorithm. The loss function is the mean squared error (MSE), and the calculation method is:
[0130]
[0131] where y i is the actual electricity consumption data, is the prediction result. Calculate the gradients and update the model parameters through the homomorphic encryption algorithm.
[0132] During the training process, all encrypted calculations are implemented through the homomorphic encryption algorithm. In particular, the support for addition and multiplication operations on encrypted data ensures that encrypted data can directly participate in the learning process of the neural network. Assume that the encrypted data E(D) is the homomorphic encryption form of d. Then, the addition operation E(a)+E(b) and the multiplication operation E(a)×E(b) in the network model can be directly calculated in the encrypted space through the homomorphic encryption algorithm. The homomorphic encryption technology avoids the process of decrypting and then calculating in traditional encryption technologies, greatly improving the calculation efficiency and ensuring the privacy of data.
[0133] The Adaptive Hybrid Neural Network (AHNN) can better process encrypted electricity consumption data, and at the same time combine the plaintext weather data to improve the accuracy and efficiency of load forecasting. In addition, the application of the homomorphic encryption algorithm ensures the privacy and security of user data. While ensuring data privacy, it can achieve efficient model training and prediction using encrypted data.
[0134] Step 4: Prediction and Decryption
[0135] After the model training is completed, the power load prediction server receives the encrypted data to be predicted (such as new electricity consumption data or real-time meteorological data), and inputs this encrypted data into the already trained neural network model for prediction. The prediction result is still encrypted to ensure the privacy of the data during transmission.
[0136] In the prediction stage, the encrypted electricity consumption data and weather forecast data of the terminal to be predicted are input, and the network model outputs the encrypted prediction result E(Y), which is decrypted by the terminal using the private key Sk1:
[0137] Y = D(E(Y), Sk1)
[0138] The terminal decrypts through the private key Sk1 to obtain the actual predicted value Y.
[0139] In addition, it also includes data optimization and prediction accuracy improvement:
[0140] For example, weighted processing can be performed on each type of weather data (such as temperature, humidity, etc.), and clustering analysis can be performed on the load data of different industries and regions. By introducing more features and refining the data model, the prediction accuracy can be further improved.
[0141] The optimization strategies include:
[0142] Dynamic weighting: Weight the prediction model according to different time periods or climate conditions, considering the impact of weather changes on the load. Feature engineering: In addition to historical electricity consumption data, introduce other external factors that may affect the load (such as holidays, price fluctuations, etc.) to enhance the generalization ability of the model.
[0143] A method for predicting electricity load based on homomorphic encryption provided by an embodiment of the present invention innovatively combines homomorphic encryption with an adaptive hybrid neural network, not only effectively solves the data privacy problem, but also improves the efficiency and accuracy of power load prediction. It has broad application prospects and can support the collaborative analysis between smart grids, large-scale distributed power systems, and multiple data providers.
[0144] Embodiment 2:
[0145] Based on the same inventive concept, an embodiment of the present invention also provides a system for predicting electricity load based on homomorphic encryption. As shown in Figure 3 it includes:
[0146] 1. Client data encryption and sending module:
[0147] Multiple clients act as senders, each generating a public key Pk1 and a private key Sk1, and encrypting the historical electricity consumption data using the fully homomorphic encryption (FHE) algorithm. Each client's data encryption and sending module includes:
[0148] Key Generation Module: Generate public key Pk1 and private key Sk1, using efficient homomorphic encryption algorithms such as specific BFV, CKKS, etc.
[0149] Data Encryption Module: Encrypt historical electricity consumption data (such as time series D = {d1, d2, d3,..., d n}) using the public key to obtain encrypted data E(D).
[0150] Data Transmission Module: The encrypted data is sent to the power load forecasting server side through an encrypted network protocol (such as SSL / TLS).
[0151] 2. Server-side Training Module:
[0152] Data Reception Module: The power load forecasting server side receives the encrypted data and plaintext weather data from the client. The weather data is synchronized with the electricity consumption data according to the time series, and the obtained weather data is normalized.
[0153] Network Model Training Module: Use the Adaptive Hybrid Neural Network (AHNN) model to train with the encrypted electricity consumption data and plaintext weather data. During the training process, optimization algorithms supported by homomorphic encryption are adopted, such as encrypted loss function calculation and encrypted gradient update.
[0154] Data Processing Module: Extract features (such as convolution processing) from the encrypted data and fuse it with the plaintext weather data. The trained model is used for load forecasting.
[0155] 3. Server-side Prediction Module:
[0156] Prediction Input Module: After training, the power load forecasting server side receives the encrypted data and corresponding weather forecast data sent by the terminal to be predicted as the input of the network model.
[0157] Encrypted Prediction Output Module: The model outputs the encrypted load forecasting result E(Y). This result contains the predicted power load value but is still in an encrypted state.
[0158] Terminal Decryption Module:
[0159] Data Reception Module: The terminal receives the encrypted load forecasting result E(Y) sent by the server.
[0160] Decryption Module: The terminal uses the private key Sk1 to decrypt the encrypted load forecasting result to obtain the final power load forecasting value.
[0161] Display and Application Module: The decrypted load forecasting result can be used for applications such as electricity load optimization, equipment scheduling, and energy management on the client side.
[0162] Through the use of the above system and computer program, the present invention can implement a power consumption load prediction method based on homomorphic encryption, safeguard data privacy, and use a neural network for efficient and accurate load prediction. Multiple clients, as senders, create a public key Pk1 and a private key Sk1, encrypt their historical power consumption data according to the public key Pk1, and send the encrypted data to the power load prediction server side.
[0163] The power load prediction server side receives the encrypted data sent by the sender and obtains the weather data corresponding to the same time as the historical power consumption data. The encrypted data and the corresponding weather data are used as training data to train the constructed network model.
[0164] After the training is completed, the power load prediction server side receives the encrypted data sent by the terminal to be predicted, and at the same time obtains the corresponding weather forecast data as the input of the network model.
[0165] The network model outputs the corresponding encrypted prediction result, and the power load prediction server side sends the encrypted prediction result to the corresponding terminal. The terminal decrypts according to its own private key Sk1 to obtain the final power load prediction value.
[0166] For example:
[0167] Suppose there are multiple clients A, B, and C, representing different users. Each client generates its own public key and private key, encrypts the historical power consumption data, and sends it to the server side. The server side receives the encrypted data and obtains the corresponding weather data. The server side uses these data to train the network model. After the training is completed, the server side receives the encrypted data and weather forecast data of the terminal to be predicted as the input of the network model. The network model outputs the encrypted prediction result, and the server side sends the encrypted prediction result to the corresponding terminal. The terminal decrypts using its own private key to obtain the final power load prediction value.
[0168] Example 3:
[0169] The embodiment of the present invention also provides a computer-readable storage medium. The program stored in the computer-readable storage medium is used to execute the power consumption load prediction method based on homomorphic encryption in the above-mentioned embodiment 1. This program can be executed on a processor. The storage medium can be a hard disk, a solid-state drive (SSD), a USB flash drive, an optical disc, cloud storage, etc., any medium that can be used to store and read computer programs. The program stored in this medium is loaded into the processor memory for execution to complete various functions. By connecting to hardware devices, this storage medium enables a computer to execute the above-mentioned encryption, decryption, training, prediction, and data transmission tasks.
[0170] In the present specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0171] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for predicting electricity load based on homomorphic encryption, characterized in that, It includes the following steps: S10. Multiple clients, as senders, create a public key Pk1 and a private key Sk1, encrypt their historical electricity consumption data according to the public key Pk1, and send the encrypted data to the power load forecasting server side; S20. The power load forecasting server side receives the encrypted data sent by the senders and obtains the weather data corresponding to the same moment as the historical electricity consumption data; uses the encrypted data and the corresponding weather data as training data to train the constructed network model; S30. After the training is completed, the power load forecasting server side receives the encrypted data sent by the terminal to be predicted and simultaneously obtains the corresponding weather forecast data as the input of the network model; S40. The network model outputs the corresponding encrypted prediction result, and the power load forecasting server side sends the encrypted prediction result to the corresponding terminal; the terminal decrypts it according to its own private key Sk1 to obtain the final power load prediction value.
2. The method for predicting electrical load based on homomorphic encryption according to claim 1, wherein, In step S10, multiple clients, as senders, use the fully homomorphic encryption FHE algorithm to create the public key Pk1 and the private key Sk1.
3. The method for predicting electricity load based on homomorphic encryption according to claim 1, wherein, In step S20, the constructed network model is an adaptive hybrid neural network; The adaptive hybrid neural network includes: An input layer for encrypted historical electricity consumption data and plaintext weather data; among them, the number of input layer nodes is determined according to the data feature dimension; The encrypted data processing layer includes: a homomorphic encryption convolutional layer and a homomorphic encryption pooling layer; among them, the homomorphic encryption convolutional layer is used to extract local features of the encrypted electricity consumption data; the homomorphic encryption pooling layer is used to reduce the dimension of the features output by the convolutional layer; The plaintext data processing layer is used to process the plaintext weather data, using a convolutional neural network CNN or a fully connected layer DenseLayer; A fusion layer for fusing the outputs of the encrypted data processing layer and the plaintext data processing layer, using feature splicing or feature summation for hybrid feature fusion; A hidden layer, a long short-term memory network LSTM or a gated recurrent unit GRU, to capture the long-term dependence relationship of time series data; An output layer, which is a single or multiple neurons, outputting the encrypted load prediction result.
4. The method for predicting electricity load based on homomorphic encryption according to claim 3, wherein The process of training the adaptive hybrid neural network is as follows: 1) Obtain the homomorphically encrypted historical electricity consumption data and the corresponding plaintext weather data, and perform normalization and standardization processing on the weather data; 2) Initialize the weight and bias parameters of the AHNN model; 3) Input the homomorphically encrypted historical electricity consumption data and the preprocessed corresponding weather data into the AHNN model, and perform forward propagation calculations through each layer of neural network; 4) Use the polynomial approximation method to approximate the non-linear activation function of the neural network, and calculate the encrypted gradients of each layer through the backpropagation algorithm compatible with the homomorphic encryption algorithm; 5) Update the weight and bias parameters of the model according to the calculated encrypted gradients; 6) Use the validation set to verify the model, evaluate the performance of the model, and stop training when the performance on the validation set no longer improves to obtain the corresponding network model.
5. The method for predicting electricity load based on homomorphic encryption according to claim 4, characterized in that, Before inputting the homomorphically encrypted historical electricity consumption data and the corresponding preprocessed weather data into the AHNN model in step 3), it further includes dimensionality reduction processing of the homomorphically encrypted historical electricity consumption data, specifically including: (1) Block data processing: The encrypted data is divided into blocks, and the encrypted mean and covariance of each block of data are calculated respectively; (2) Covariance matrix calculation: For each encrypted data block, the encrypted covariance matrix of the encrypted data is calculated; (3) Eigenvalue decomposition: The power iteration method is used to calculate the encrypted eigenvalues and eigenvectors of the covariance matrix.
6. The method for predicting electricity load based on homomorphic encryption according to claim 1, wherein, The power load prediction server side adopts a distributed architecture to process encrypted data in parallel, and uses a multi-core processor and GPU to accelerate matrix operations; the data of each training batch is independently calculated by different nodes, and finally the global update result is obtained through encrypted aggregation.
7. A power consumption load prediction system based on homomorphic encryption, characterized in that, It includes: Client data encryption and sending module: Multiple clients, as senders, create public key Pk1 and private key Sk1, encrypt their own historical electricity consumption data according to the public key Pk1, and send the encrypted data to the power load prediction server side; Server training module: The power load prediction server side receives the encrypted data sent by the sender and obtains the weather data corresponding to the same time as the historical electricity consumption data; the encrypted data and the corresponding weather data are used as training data to train the constructed network model; Server prediction module: After training is completed, the power load prediction server side receives the encrypted data sent by the terminal to be predicted and simultaneously obtains the corresponding weather forecast data as the input of the network model; Terminal decryption module: The network model outputs the corresponding encrypted prediction result, and the power load prediction server side sends the encrypted prediction result to the corresponding terminal; the terminal decrypts it according to its own private key Sk1 to obtain the final power load prediction value.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the homomorphically encrypted electricity load prediction method according to any one of claims 1 to 6.