A building energy consumption pre-analysis method and system based on cloud computing
By setting up edge nodes on building floors and using federated learning and Q-learning reinforcement learning algorithms, the computational bottlenecks and data privacy issues in large-scale building energy consumption forecasting are resolved, and an efficient, secure, and flexible energy consumption forecasting model is constructed, improving forecast accuracy and resource utilization efficiency.
Patent Information
- Application Number
- CN202510503211.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-04-22
AI Technical Summary
Existing building energy consumption prediction methods are prone to computational bottlenecks, data privacy risks, and insufficient prediction accuracy when processing large-scale building data. In particular, how to effectively perform data collaboration and model optimization in a multi-node distributed architecture remains a challenge.
A cloud computing-based building energy consumption pre-analysis method is adopted. By setting up edge nodes on each floor, a federated learning framework is established to predict energy consumption. The model is trained using local data from edge nodes and the parameters are uploaded to the cloud computing center for global parameter aggregation and optimization. The data sampling frequency and training cycle are dynamically adjusted in combination with the Q-learning reinforcement learning algorithm.
It has achieved the construction of an efficient and collaborative energy consumption prediction model, improved prediction accuracy and robustness, ensured data security and resource utilization efficiency, reduced the risk of data privacy leakage, and enhanced adaptability and flexibility.
Smart Images

Figure CN120030663B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of building energy consumption prediction, and in particular to a cloud computing-based building energy consumption pre-analysis method and system. Background Art
[0002] With the rapid development of smart and green buildings, building energy management has become a crucial component of modern building management. Accurately predicting building energy consumption not only helps improve energy efficiency but also reduces energy consumption and emissions, thereby lowering operating costs. Traditional building energy consumption prediction methods often rely on centralized data processing or a single data source. These methods are prone to computational bottlenecks, data privacy risks, and insufficient prediction accuracy when processing large-scale building data.
[0003] With the rise of edge computing and cloud computing, edge computing reduces the burden on cloud computing centers by pushing data processing to edge nodes. This enables real-time data processing and analysis, improving the efficiency and flexibility of energy efficiency prediction. However, effective data collaboration and model optimization in a multi-node distributed architecture, particularly while ensuring data privacy and optimizing computing resources, remains a pressing challenge.
[0004] Therefore, a building energy consumption pre-analysis method and system based on cloud computing is proposed. Summary of the Invention
[0005] The present invention provides a cloud computing-based building energy consumption pre-analysis method and system. This method performs energy consumption prediction by setting up edge nodes on each floor of the building and establishing a federated learning framework. The edge nodes perform model training based on locally collected data and upload local parameters to the cloud computing center. The cloud computing center aggregates the parameters of each edge node through federated learning and retrains the model using global energy consumption data to optimize the global parameters. The optimized model parameters are sent to the edge nodes, and parameter synchronization is ensured through hash consistency verification. In addition, the Q-learning reinforcement learning algorithm is used to dynamically adjust the data sampling frequency and training cycle based on the prediction error and computing power status of the edge nodes to improve system efficiency and prediction accuracy.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A cloud computing-based building energy consumption pre-analysis method and system, comprising:
[0008] Establish a federated learning framework with each floor in the building as an edge node and the cloud computing center as the central node;
[0009] The energy consumption prediction model is trained based on the local energy consumption data collected by the edge node, and the corresponding local model parameters are uploaded to the cloud computing center after the training is completed;
[0010] Based on the local model parameters received from multiple edge nodes, the cloud computing center uses federated learning to aggregate global model parameters and retrains the aggregated model using sampled global energy consumption data to optimize the global model parameters.
[0011] After completing the global model retraining, the cloud computing center sends the optimized global model parameters to each edge node, along with a hash check value. After receiving the global model parameters, the edge node performs a hash consistency check to ensure that the parameters are successfully synchronized with the cloud computing center.
[0012] The Q-learning reinforcement learning algorithm is used, and the model prediction error of the edge node and the system computing power status are used as status information to dynamically adjust the data sampling frequency and model training cycle of the edge node.
[0013] Furthermore, the data collection period of the edge node is the first period, and the data collection period of the cloud computing center is the second period, wherein the second period is greater than the first period.
[0014] Furthermore, the specific steps of global model parameter aggregation include:
[0015] Receive local model parameters uploaded by multiple edge nodes;
[0016] The model of each edge node is updated and corrected based on the SCAFFOLD algorithm, and the difference between the local control variables and the cloud control variables is used to correct the local update;
[0017] The corrected model parameters are aggregated to generate preliminary aggregated global model parameters.
[0018] Furthermore, the specific steps of the SCAFFOLD algorithm include:
[0019] S301: The cloud computing center and each edge node initialize cloud control variables and local control variables respectively, and before each round of training, the cloud computing center sends the current global model parameters and control variables to the edge node;
[0020] S302: During the local training process, the edge node corrects the model parameter updates based on the difference between the cloud control variables and the local control variables, and uploads the corrected model parameters and local control variables to the cloud computing center after the current round of training is completed;
[0021] S303: The cloud computing center aggregates the correction parameters uploaded by each edge node and synchronously updates the cloud control variables for the next round of federated training;
[0022] S304: Repeat steps S302 to S303 until the training termination condition is met and the global model parameters are output; the termination condition is that the set maximum number of training rounds is reached or the change in the global model parameters is less than the change threshold.
[0023] Furthermore, the specific steps of model retraining include:
[0024] The cloud computing center constructs a training data set based on the sampled building overall energy consumption data, uses the aggregated global model parameters as the initial model, and performs fine-tuning training on the training data set;
[0025] During the retraining process, the prediction error of the validation set is monitored in real time, and the training is terminated when a preset convergence condition is met; the preset convergence condition is that the prediction error is less than the error threshold.
[0026] Furthermore, the calculation formula for fine-tuning training is:
[0027] ;
[0028] in, express The model parameters at the fine-tuning iteration, Indicates the The model parameters at the fine-tuning iteration, represents the learning rate, Indicates the The weighting factor of the edge nodes, Indicates the total number of edge nodes, Indicates the The loss function of the model parameters of the edge nodes during fine-tuning iterations, represents the gradient of the loss function.
[0029] Furthermore, the specific steps of hash consistency verification include:
[0030] After receiving the global model parameters, the edge node uses the same hash algorithm as the cloud computing center to perform hash calculation on the received model parameters;
[0031] The calculated hash check value is compared with the hash check value issued by the cloud computing center; if the two are consistent, the edge node loads and applies the model; otherwise, the edge node refuses to load the model and sends a retransmission request to the cloud computing center until the verification passes.
[0032] Furthermore, the specific steps for adjusting the data sampling frequency and model training cycle of edge nodes include:
[0033] The model prediction error and system computing power status of the edge node are used as state information input, and the action output includes data sampling frequency and model training cycle to form a state-action mapping relationship;
[0034] Construct a reward function that comprehensively considers prediction accuracy and resource consumption, and use the Q-learning algorithm to update and optimize the strategies of edge nodes to improve system resource utilization efficiency and overall model prediction accuracy;
[0035] The edge node selects the corresponding sampling frequency and training period according to the learned strategy and the current state.
[0036] The present invention also provides a building energy consumption pre-analysis system based on cloud computing, comprising:
[0037] A federated learning establishment module is used to establish a federated learning framework with each floor in the building as an edge node and the cloud computing center as the central node;
[0038] The edge computing module is used to train the energy consumption prediction model based on the local energy consumption data collected by the edge node, and upload the corresponding local model parameters to the cloud computing center after the training is completed;
[0039] The central computing module is used to aggregate global model parameters based on the local model parameters received from multiple edge nodes. The cloud computing center uses federated learning to retrain the aggregated model using sampled global energy consumption data to optimize the global model parameters.
[0040] The distribution verification module is used to distribute the optimized global model parameters to each edge node after the global model retraining is completed, along with the hash verification value. After receiving the global model parameters, the edge node performs a hash consistency check on the global model parameters to ensure that the parameters of the edge node and the cloud computing center are successfully synchronized.
[0041] The strategy adjustment module is used to adopt the Q-learning reinforcement learning algorithm, using the model prediction error of the edge node and the system computing power status as status information to dynamically adjust the data sampling frequency and model training cycle of the edge node.
[0042] The beneficial effects of the present invention are:
[0043] 1. By constructing a federated learning framework with each floor of the building serving as an edge node and the cloud computing center as the central node, distributed modeling and collaborative optimization are effectively achieved. On the one hand, edge nodes complete model training locally, helping to protect data privacy and reduce data transmission load. On the other hand, the cloud aggregates local model parameters uploaded by each node to form a global model, integrating multi-source information to improve the model's generalization and overall prediction accuracy. This approach not only improves the system's adaptability to the energy consumption characteristics of large-scale buildings, but also enables the construction of efficient and collaborative energy consumption prediction models while ensuring data security.
[0044] 2. By retraining the aggregated model with sampled global energy consumption data, the global model's prediction accuracy and robustness at the building level were further improved. Furthermore, when distributing optimized model parameters, a hash check mechanism was incorporated to ensure that the parameters received by edge nodes were not tampered with or corrupted during transmission, thereby safeguarding the integrity and security of the model deployment process. This mechanism effectively improved the system's stability and reliability, providing a solid foundation for subsequent edge prediction tasks.
[0045] 3. By introducing the Q-learning reinforcement learning algorithm, the data sampling frequency and model training cycle are dynamically adjusted based on the edge node's model prediction error and system computing power status, enabling intelligent optimization of edge node resource utilization. This effectively avoids resource waste and system overload, improving system operational efficiency. Furthermore, the training intensity can be dynamically adjusted based on model performance, enhancing the accuracy and adaptability of overall energy consumption forecasts. This approach balances prediction accuracy and resource consumption, contributing to the development of a more flexible, efficient, and intelligent building energy management system. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0047] Figure 1 This is a flow chart of a building energy consumption pre-analysis method based on cloud computing provided by the present invention;
[0048] Figure 2 It is a flow chart of the SCAFFOLD algorithm provided by the present invention;
[0049] Figure 3 This is a structural diagram of a building energy consumption pre-analysis system based on cloud computing provided by the present invention. DETAILED DESCRIPTION
[0050] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0051] Example 1
[0052] A cloud computing-based building energy consumption pre-analysis method, such as Figure 1 Shown, including:
[0053] S100: Build a federated learning framework with each floor in the building as an edge node and the cloud computing center as the central node;
[0054] Based on the building structure, the system configures each floor as an independent edge node. Each edge node is responsible for collecting energy consumption data for that floor and performing model training locally, preventing the original data from being uploaded to the cloud and reducing the risk of data leakage at the source. Furthermore, a cloud computing center serves as the central node to coordinate model training, parameter aggregation, and task scheduling across the edge nodes, thereby building a privacy-friendly, distributed federated learning framework.
[0055] S200: training an energy consumption prediction model based on local energy consumption data collected locally by the edge node, and uploading corresponding local model parameters to the cloud computing center after training is completed;
[0056] Specifically, the prediction models used in the energy consumption prediction model include, but are not limited to, traditional machine learning models (such as decision trees, support vector machines, random forests, etc.) or deep learning models (such as convolutional neural networks (CNN), recurrent neural networks (RNN), long short-term memory networks (LSTM), etc.), which can be flexibly selected and deployed according to actual scenarios. The present invention does not restrict the model architecture to ensure that the method has good versatility and scalability. Model training is completed locally to ensure that the original energy consumption data is not uploaded to the cloud, thereby effectively protecting data privacy; after training is completed, the edge node only uploads the extracted model parameters (such as weights, gradients, etc.) for the cloud computing center to perform subsequent global parameter aggregation.
[0057] S300: Based on the local model parameters received from multiple edge nodes, the cloud computing center aggregates the global model parameters using a federated learning approach, and retrains the aggregated model using sampled global energy consumption data to optimize the global model parameters.
[0058] Furthermore, the data collection period of the edge node is the first period, and the data collection period of the cloud computing center is the second period, wherein the second period is greater than the first period.
[0059] Specifically, the first period and the second period can be set according to the needs of the user. In this embodiment, the first period is 15 minutes and the second period is 90 minutes.
[0060] Through this stratified sampling mechanism, the system effectively controls computing and communication resource consumption while ensuring prediction accuracy. Edge nodes collect local energy consumption data at a higher frequency, which helps capture dynamic changes at the fine-grained floor level and enhances the model's responsiveness to short-term fluctuations. Meanwhile, the cloud computing center samples data at a lower frequency, significantly reducing the computing load and communication pressure at the center, improving the overall system's operational efficiency and scalability.
[0061] Furthermore, the specific steps of global model parameter aggregation include:
[0062] Receive local model parameters uploaded by multiple edge nodes;
[0063] The model of each edge node is updated and corrected based on the SCAFFOLD algorithm, and the difference between the local control variables and the cloud control variables is used to correct the local update;
[0064] The corrected model parameters are aggregated to generate preliminary aggregated global model parameters.
[0065] The SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) algorithm, also known as stochastic controlled averaging for federated learning, introduces control variables to correct for deviations in client update directions during local training, thereby improving the convergence of federated learning. The introduction of the SCAFFOLD algorithm effectively corrects local model updates at edge nodes, significantly alleviating model drift issues caused by heterogeneous (non-IID) data distribution at edge nodes. By utilizing the difference between local control variables and cloud-based control variables for direction correction, this not only improves the consistency and generalization capabilities of the aggregated model across different nodes, but also accelerates the convergence of the global model, enhancing the accuracy and stability of overall building energy consumption predictions, and effectively enhancing the robustness and practicality of the system in complex building environments.
[0066] Furthermore, the specific steps of the SCAFFOLD algorithm are as follows: Figure 2 Shown, including:
[0067] S301: The cloud computing center and each edge node initialize cloud control variables and local control variables respectively, and before each round of training, the cloud computing center sends the current global model parameters and control variables to the edge node;
[0068] S302: During the local training process, the edge node corrects the model parameter updates based on the difference between the cloud control variables and the local control variables, and uploads the corrected model parameters and local control variables to the cloud computing center after the current round of training is completed;
[0069] S303: The cloud computing center aggregates the correction parameters uploaded by each edge node and synchronously updates the cloud control variables for the next round of federated training;
[0070] S304: Repeat steps S302 to S303 until the training termination condition is met and the global model parameters are output; the termination condition is that the set maximum number of training rounds is reached or the change in the global model parameters is less than the change threshold.
[0071] Specifically, the cloud computing center initializes global model parameters and global control variables, and each edge node initializes local model parameters and local control variables. Before each round of training, the cloud distributes the current global model parameters and global control variables to each edge node; each edge node trains based on its own local data. During training, the following correction formula is used to update local model parameters and local control variables:
[0072] ;
[0073] ;
[0074] in, represents the training round, Indicates the The local model parameters of the edge nodes, represents the local learning rate, Indicates the The gradient calculated by edge nodes on local data, Indicates the The local control variables of the edge nodes, Represents the global control variable. After the training is completed, the edge node will update the local model parameters and local control variables The cloud computing center aggregates the model parameters uploaded by each edge node and uses weighted average to generate global model parameters and global control variables:
[0075] ;
[0076] ;
[0077] in, Indicates the number of edge nodes participating in training, Represents the global model parameters; repeat the local training and cloud aggregation process until the termination condition is met, which is: reaching the maximum number of training rounds (In this embodiment ), or the change in global model parameters in multiple consecutive rounds is lower than the set threshold (In this embodiment ),Right now .
[0078] By introducing control variables, SCAFFOLD reduces the training offset caused by data heterogeneity, improves the generalization performance and convergence speed of the global model among all nodes, and is more suitable for data distribution scenarios such as building energy consumption with geographical location and time differences.
[0079] Furthermore, the specific steps of model retraining include:
[0080] The cloud computing center constructs a training data set based on the sampled building overall energy consumption data, uses the aggregated global model parameters as the initial model, and performs fine-tuning training on the training data set;
[0081] During the retraining process, the prediction error of the validation set is monitored in real time, and the training is terminated when a preset convergence condition is met; the preset convergence condition is that the prediction error is less than the error threshold.
[0082] Furthermore, the calculation formula for fine-tuning training is:
[0083] ;
[0084] in, express The model parameters at the fine-tuning iteration, Indicates the The model parameters at the fine-tuning iteration, represents the learning rate, Indicates the The weighting factor of the edge nodes, Indicates the total number of edge nodes, Indicates the The loss function of the model parameters of the edge nodes during fine-tuning iterations, represents the gradient of the loss function.
[0085] Specifically, the cloud computing center samples the building's overall energy consumption data in the second cycle, and constructs a training data set and a validation data set containing input features and energy consumption labels. The data set is representative and can reflect the energy consumption trend of the entire building. The global model parameters aggregated by federated learning in the previous stage are used as the initial model for fine-tuning. The constructed global data set is used to perform several rounds of fine-tuning training on the initial model. During the retraining process, the prediction error of the validation set is monitored in real time. When the preset convergence conditions are met, the training is terminated. The convergence conditions ,in, represents the prediction error, Indicates the actual energy consumption, represents the predicted energy consumption, Indicates the error threshold (in this embodiment ).
[0086] By using the aggregated global model parameters as the initial model for fine-tuning training, the knowledge base of distributed training on edge nodes is fully inherited, avoiding the waste of resources caused by training from scratch; fine-tuning is combined with global building energy consumption data sampled and collected from the cloud to further improve the model's generalization ability and prediction accuracy at the overall building scale, enabling the system to achieve better prediction results at a lower computing cost.
[0087] S400: After completing the global model retraining, the cloud computing center sends the optimized global model parameters to each edge node, along with a hash check value. After receiving the global model parameters, the edge node performs a hash consistency check on the global model parameters to ensure that the parameters are successfully synchronized with the cloud computing center.
[0088] Furthermore, the specific steps of hash consistency verification include:
[0089] After receiving the global model parameters, the edge node uses the same hash algorithm as the cloud computing center to perform hash calculation on the received model parameters;
[0090] The calculated hash check value is compared with the hash check value issued by the cloud computing center; if the two are consistent, the edge node loads and applies the model; otherwise, the edge node refuses to load the model and sends a retransmission request to the cloud computing center until the verification passes.
[0091] Specifically, before issuing the optimized global model parameters, the cloud computing center uses a preset hash algorithm (SHA-256 in this embodiment) to perform hash calculation on the model parameters to generate a hash check value, and sends the value together with the model parameters to each edge node; after receiving the model parameters, the edge node immediately uses the same hash algorithm to perform local calculation on the received model parameters to generate a local hash value; the edge node compares the locally generated hash value with the hash check value sent by the cloud computing center. If the two are consistent, it indicates that there is no error in the model parameters during transmission, and the edge node can safely load and apply the model; if the two are inconsistent, it indicates that the model parameters may have been damaged or tampered with. The edge node refuses to load the model and automatically initiates a retransmission request to the cloud computing center.
[0092] The introduction of a hash consistency verification mechanism effectively ensures the integrity and reliability of global model parameters during transmission, preventing edge nodes from loading damaged or incorrect model parameters due to network instability, data tampering, or transmission errors. By comparing hash values between edge nodes and the cloud computing center, model consistency verification and error retransmission are achieved, improving the security and robustness of the system during model distribution and ensuring that each edge node can carry out subsequent prediction tasks based on a correct and unified global model.
[0093] S500: Adopts the Q-learning reinforcement learning algorithm, uses the model prediction error of edge nodes and the system computing power status as status information, and dynamically adjusts the data sampling frequency and model training cycle of edge nodes.
[0094] Furthermore, the specific steps for adjusting the data sampling frequency and model training cycle of edge nodes include:
[0095] The model prediction error and system computing power status of the edge node are used as state information input, and the action output includes data sampling frequency and model training cycle to form a state-action mapping relationship;
[0096] Construct a reward function that comprehensively considers prediction accuracy and resource consumption, and use the Q-learning algorithm to update and optimize the strategies of edge nodes to improve system resource utilization efficiency and overall model prediction accuracy;
[0097] The edge node selects the corresponding sampling frequency and training period according to the learned strategy and the current state.
[0098] Specifically, a state space S is constructed, which contains the current state information of the edge node (the model prediction error of the edge node and the system computing power state, where all edge nodes maintain the same system computing power state), and an action set A is defined. The action is the data sampling frequency (such as 15 minutes, 20 minutes or 30 minutes, etc.) and the model training cycle (such as 1 hour, 3 hours, 6 hours, etc.). Each action corresponds to a combination of a sampling frequency + training cycle, and the state and action of the edge node are mapped to each other, that is, the state can determine the action, and the action can change the state; a reward function that comprehensively considers prediction accuracy and resource consumption is constructed. , where the reward function The calculation formula is:
[0099] ;
[0100] in, Indicates the total number of edge nodes, represents the prediction error of the edge node, Indicates the system computing power status and initializes the Q table of the Q-learning algorithm , in state Next action , the cumulative expected rewards that can be obtained in the future, each state transfer execution action Then, update according to the reward value of feedback:
[0101] ;
[0102] in, Indicates the current state, Indicates the current action. Indicates that the status Next action , the cumulative expected rewards that can be obtained in the future, represents the learning rate, represents the reward function, represents the discount factor, Indicates action The new state entered after execution, Indicates a new state The next optional action; before each model training, the edge node is based on the current state Query Table, adopts greedy strategy to select the current optimal action (i.e., sampling frequency and training cycle combination) to execute. As the training process iterates, The table is continuously updated, the strategy is gradually optimized, and eventually converges to a stable strategy that balances prediction accuracy and resource usage; the edge node selects the corresponding sampling frequency and training cycle based on the learned strategy and the current state.
[0103] This design, through the introduction of a Q-learning reinforcement learning mechanism, empowers edge nodes with autonomous adjustment capabilities, enabling them to intelligently select the optimal data sampling frequency and training cycle based on dynamic environmental information such as the current prediction error and the system's computing power. This mechanism effectively reduces resource consumption and computing load while ensuring prediction accuracy, enhancing the flexibility and robustness of overall energy efficiency management and contributing to more efficient distributed building energy consumption analysis and control.
[0104] Example 2
[0105] Taking a multi-story smart office building as the object, the cloud computing-based building energy consumption pre-analysis system proposed in this invention is deployed and operated. Figure 3 Shown, including:
[0106] A federated learning establishment module is used to establish a federated learning framework with each floor in the building as an edge node and the cloud computing center as the central node;
[0107] The edge computing module is used to train the energy consumption prediction model based on the local energy consumption data collected by the edge node, and upload the corresponding local model parameters to the cloud computing center after the training is completed;
[0108] The central computing module is used to aggregate global model parameters based on the local model parameters received from multiple edge nodes. The cloud computing center uses federated learning to retrain the aggregated model using sampled global energy consumption data to optimize the global model parameters.
[0109] The distribution verification module is used to distribute the optimized global model parameters to each edge node after the global model retraining is completed, along with the hash verification value. After receiving the global model parameters, the edge node performs a hash consistency check on the global model parameters to ensure that the parameters of the edge node and the cloud computing center are successfully synchronized.
[0110] The strategy adjustment module is used to adopt the Q-learning reinforcement learning algorithm, using the model prediction error of the edge node and the system computing power status as status information to dynamically adjust the data sampling frequency and model training cycle of the edge node.
[0111] The specific implementation steps of this system are as follows:
[0112] Each floor of the building is configured as an independent edge node, each of which deploys local computing modules and data acquisition devices. The cloud computing center serves as the central node, deploying a federated learning service framework to coordinate the collaborative training tasks of each edge node.
[0113] Each edge node collects energy consumption data for each floor at a 15-minute interval and trains a local energy consumption prediction model based on this data. The model used is an integrated LSTM and random forest model. After training, the local model parameters are uploaded to the cloud computing center.
[0114] The cloud computing center uses the SCAFFOLD federated learning algorithm, combined with the local model parameters and control variables uploaded by each edge node, to correct the model bias and aggregate the parameters to obtain a preliminary global model. Subsequently, the overall energy consumption data of the entire floor is sampled and collected at a frequency of 90 minutes per cycle to construct a retraining dataset, and the global model is fine-tuned and optimized to improve overall prediction capabilities.
[0115] After retraining, the cloud computing center sends the optimized global model parameters and their corresponding hash values (SHA-256 digests) to all edge nodes. Upon receiving these, the edge nodes hash the model parameters using the same hash algorithm and compare them with the checksum sent by the cloud computing center. If they match, the model is loaded; otherwise, the load is rejected and a retransmission is requested. This ensures that the model has not been tampered with or damaged during transmission, thus ensuring system security and consistency.
[0116] The system deploys a Q-learning reinforcement learning agent, taking model prediction error and system computing power status as state inputs at each edge node. The output is a combination of data sampling frequency (30-minute cycles) and model training period (2 days). By constructing a reward function that balances prediction accuracy and computing resources, the system continuously optimizes the state-action strategy, enabling each edge node to intelligently adjust sampling and training plans based on its current operating status, achieving higher energy prediction efficiency and resource scheduling flexibility.
[0117] The multi-story smart office building originally adopted a traditional centralized energy consumption prediction system. After adopting the building energy consumption pre-analysis system provided by the present invention, the performance comparison is shown in Table 1. The table shows the advantages of the present invention over the traditional building energy consumption prediction system in key performance indicators. By introducing the federated learning framework and the Q-learning reinforcement learning mechanism, the present invention improves the average prediction accuracy from 82.3% of the traditional system to 91.7%, significantly improving the accuracy and reliability of the prediction; at the same time, with the help of reinforcement learning, the dynamic optimization of the edge node sampling frequency and training cycle effectively reduces the computing resource occupancy rate of the edge node from 76% to 58%, thereby improving the operating efficiency and scalability of the system. In addition, the present invention realizes model collaborative training through federated learning, without the need to upload original data, greatly reducing the risk of data privacy leakage, and enhancing the data security protection capability of the system in actual deployment. Therefore, while improving the accuracy of energy consumption prediction, the present invention achieves higher resource utilization efficiency and stronger data privacy protection, and has significant practical value and promotion prospects.
[0118] Table 1 Comparison of various indicators before and after using the present invention
[0119]
[0120] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A cloud computing-based building energy consumption pre-analysis method, characterized in that: include: Establish a federated learning framework with each floor in the building as an edge node and the cloud computing center as the central node; The energy consumption prediction model is trained based on the local energy consumption data collected by the edge node, and the corresponding local model parameters are uploaded to the cloud computing center after the training is completed; Based on the local model parameters received from multiple edge nodes, the cloud computing center uses federated learning to aggregate global model parameters and retrains the aggregated model using sampled global energy consumption data to optimize the global model parameters. After completing the global model retraining, the cloud computing center will send the optimized global model parameters to each edge node, along with a hash checksum. After receiving the data, the edge node performs a hash consistency check on the global model parameters to ensure that the parameters of the edge node and the cloud computing center are successfully synchronized; Adopting the Q-learning reinforcement learning algorithm, the edge node's model prediction error and system computing power status are used as status information to dynamically adjust the edge node's data sampling frequency and model training cycle; The data collection period of the edge node is the first period, and the data collection period of the cloud computing center is the second period, wherein the second period is greater than the first period; The specific steps of model retraining include: The cloud computing center constructs a training data set based on the sampled building overall energy consumption data, uses the aggregated global model parameters as the initial model, and performs fine-tuning training on the training data set; During the retraining process, the prediction error of the validation set is monitored in real time, and the training is terminated when the preset convergence condition is met; the preset convergence condition is that the prediction error is less than the error threshold; The specific steps for adjusting the data sampling frequency and model training cycle of edge nodes include: The model prediction error and system computing power status of the edge node are used as state information input, and the action output includes data sampling frequency and model training cycle to form a state-action mapping relationship; Construct a reward function that comprehensively considers prediction accuracy and resource consumption, and use the Q-learning algorithm to update and optimize the strategies of edge nodes to improve system resource utilization efficiency and overall model prediction accuracy; The edge node selects the corresponding sampling frequency and training period according to the learned strategy and the current state.
2. The cloud computing-based building energy consumption pre-analysis method according to claim 1, characterized in that: The specific steps of global model parameter aggregation include: Receive local model parameters uploaded by multiple edge nodes; The model of each edge node is updated and corrected based on the SCAFFOLD algorithm, and the difference between the local control variables and the cloud control variables is used to correct the local update; The corrected model parameters are aggregated to generate preliminary aggregated global model parameters.
3. The cloud computing-based building energy consumption pre-analysis method according to claim 2, characterized in that: The specific steps of the SCAFFOLD algorithm include: S301: The cloud computing center and each edge node initialize cloud control variables and local control variables respectively, and before each round of training, the cloud computing center sends the current global model parameters and control variables to the edge node; S302: During the local training process, the edge node corrects the model parameter updates based on the difference between the cloud control variables and the local control variables, and uploads the corrected model parameters and local control variables to the cloud computing center after the current round of training is completed; S303: The cloud computing center aggregates the correction parameters uploaded by each edge node and synchronously updates the cloud control variables for the next round of federated training; S304: Repeat steps S302 to S303 until the training termination condition is met and the global model parameters are output; the termination condition is that the set maximum number of training rounds is reached or the change in the global model parameters is less than the change threshold.
4. The cloud computing-based building energy consumption pre-analysis method according to claim 3, characterized in that: The calculation formula for fine-tuning training is: ; in, express The model parameters at the fine-tuning iteration, Indicates the The model parameters at the fine-tuning iteration, represents the learning rate, Indicates the The weighting factor of the edge nodes, Indicates the total number of edge nodes, Indicates the The loss function of the model parameters of the edge nodes during fine-tuning iterations, represents the gradient of the loss function.
5. The cloud computing-based building energy consumption pre-analysis method according to claim 4, characterized in that: The specific steps of hash consistency verification include: After receiving the global model parameters, the edge node uses the same hash algorithm as the cloud computing center to perform hash calculation on the received model parameters; The calculated hash check value is compared with the hash check value issued by the cloud computing center; if the two are consistent, the edge node loads and applies the model; otherwise, the edge node refuses to load the model and sends a retransmission request to the cloud computing center until the verification passes.
6. A cloud computing-based building energy consumption pre-analysis system, applying the cloud computing-based building energy consumption pre-analysis method according to any one of claims 1 to 5, characterized in that: include: A federated learning establishment module is used to establish a federated learning framework with each floor in the building as an edge node and the cloud computing center as the central node; The edge computing module is used to train the energy consumption prediction model based on the local energy consumption data collected by the edge node, and upload the corresponding local model parameters to the cloud computing center after the training is completed; The central computing module is used to aggregate global model parameters based on the local model parameters received from multiple edge nodes. The cloud computing center uses federated learning to retrain the aggregated model using sampled global energy consumption data to optimize the global model parameters. The distribution verification module is used to distribute the optimized global model parameters to each edge node after the global model retraining is completed, along with the hash verification value; After receiving the data, the edge node performs a hash consistency check on the global model parameters to ensure that the parameters of the edge node and the cloud computing center are successfully synchronized; The strategy adjustment module is used to adopt the Q-learning reinforcement learning algorithm, using the model prediction error of the edge node and the system computing power status as status information to dynamically adjust the data sampling frequency and model training cycle of the edge node.
Citation Information
Patent Citations
Federal element learning image recognition method and system with enhanced noise robustness
CN117994635A
AI algorithm process and service all-in-one machine based on edge computing
CN119690673A