Building energy consumption pre-analysis method and system based on cloud computing
By setting edge nodes on each floor in the building and establishing a federated learning framework, combined with the Q-learning reinforcement learning algorithm, the problems of calculation bottlenecks, data privacy risks and insufficient prediction accuracy in traditional building energy consumption prediction methods are solved, and an efficient, coordinated and secure energy consumption prediction model construction is achieved.
Patent Information
- Application Number
- CN202510503211.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-04-22
AI Technical Summary
Traditional building energy consumption prediction methods are prone to problems such as computing bottlenecks, data privacy risks and insufficient prediction accuracy when processing large-scale building data. Especially in a multi-node distributed architecture, how to effectively perform data collaboration and model optimization is still a challenge.
By setting edge nodes on each floor of the building, a federated learning framework is established to predict energy consumption. Edge nodes train models based on local data and upload model parameters to the cloud computing center. The cloud computing center aggregates parameters through federated learning and retrains global models to optimize global parameters. At the same time, the Q-learning reinforcement learning algorithm is used to dynamically adjust the data sampling frequency and training cycle.
Distributed modeling and collaborative optimization are realized, the accuracy and efficiency of energy consumption prediction are improved, data privacy is guaranteed, and the synchronization and security of model parameters are ensured through hash consistency verification.
Smart Images

Figure CN120030663A_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 buildings and green buildings, building energy consumption management has become a vital part of modern building management. Accurately predicting building energy consumption not only helps to improve energy efficiency, but also achieves energy conservation and emission reduction, and reduces operating costs. Traditional building energy consumption prediction methods mostly rely on centralized data processing or a single data source. These methods are prone to computing 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 network edge nodes, enabling real-time data processing and analysis, and improving the efficiency and flexibility of energy efficiency prediction. However, in a multi-node distributed architecture, how to effectively perform data collaboration and model optimization, especially while ensuring data privacy and computing resource optimization, remains a challenge that needs to be solved.
[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 method and system for pre-analyzing building energy consumption based on cloud computing. The method predicts energy consumption by setting 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 through global energy consumption data to optimize the global parameters. The optimized model parameters are sent to the edge nodes, and the parameter synchronization is ensured by hash consistency verification. In addition, the Q-learning reinforcement learning algorithm is adopted to dynamically adjust the data sampling frequency and training cycle according to the prediction error and computing power status of the edge nodes to improve the system efficiency and prediction accuracy.
[0006] To achieve the above object, the present invention provides the following technical solutions: A cloud computing-based building energy consumption pre-analysis method and system, comprising: 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 with the globally sampled energy consumption data to optimize the global model parameters; After completing the global model retraining, the cloud computing center distributes the optimized global model parameters to each edge node, along with a hash check value; the edge node performs a hash consistency check on the global model parameters after receiving them to ensure successful parameter synchronization between the edge node and the cloud computing center; Adopt the Q-learning reinforcement learning algorithm, and use the model prediction error and system computing power status of the edge node as state information to dynamically adjust the data sampling frequency and model training period of the edge node.
[0007] Further, 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, where the second period is greater than the first period.
[0008] Further, the specific steps of global model parameter aggregation include: Receive the local model parameters uploaded by multiple edge nodes respectively; Based on the SCAFFOLD algorithm, update and correct the models of each edge node, and use the difference between the local control variable and the cloud control variable to correct the local update; Perform aggregation processing on the corrected model parameters to generate the preliminarily aggregated global model parameters.
[0009] Further, the specific steps of the SCAFFOLD algorithm include: S301: The cloud computing center and each edge node initialize the cloud control variable and the local control variable respectively, and the cloud computing center distributes the current global model parameters and control variables to the edge node before each round of training; S302: During the local training process of the edge node, correct the model parameter update according to the difference between the cloud control variable and the local control variable, and upload the corrected model parameters and the local control variable to the cloud computing center after this round of training; S303: The cloud computing center aggregates based on the corrected parameters uploaded by each edge node and synchronously updates the cloud control variable for the next round of federated training; S304: Repeat steps S302 to S303 until the training termination condition is met, and output the global model parameters; the termination condition is to reach the set maximum number of training rounds or the change in the global model parameters is less than the change threshold.
[0010] Further, the specific steps of model retraining include: The cloud computing center constructs a training data set based on the sampled overall building 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 a preset convergence condition is met; the preset convergence condition is that the prediction error is less than an error threshold.
[0011] Furthermore, the calculation formula for fine-tuning training is: ; in, express The model parameters at the fine-tuning iteration, Indicates The model parameters at the fine-tuning iteration, represents the learning rate, Indicates The weighting factor of the edge nodes, represents the total number of edge nodes, Indicates The loss function of the model parameters of the edge nodes during fine-tuning iterations, represents the gradient of the loss function.
[0012] Furthermore, 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.
[0013] Furthermore, the specific steps of adjusting the data sampling frequency and model training cycle of the 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 cycle according to the learned strategy and the current state.
[0014] The present invention also provides a building energy consumption pre-analysis system based on cloud computing, comprising: The 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 a central node; The edge computing module is used to train the energy consumption prediction model based on the local energy consumption data collected locally 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 the global model parameters based on the local model parameters of multiple edge nodes received by the cloud computing center using a federated learning method, and retrain the aggregated model through the global energy consumption data collected by sampling to optimize the global model parameters; The distribution verification module is used to send the optimized global model parameters to each edge node after the global model retraining is completed, together 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; 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.
[0015] The beneficial effects of the present invention are: 1. By constructing a federated learning framework with each floor in the building as an edge node and the cloud computing center as the central node, distributed modeling and collaborative optimization are effectively realized. On the one hand, the edge nodes complete model training locally, which helps to protect data privacy and reduce data transmission load; on the other hand, the cloud forms a global model by aggregating local model parameters uploaded by each node, and integrates multi-source information to improve the generalization ability of the model and the overall prediction accuracy. This method not only improves the system's ability to adapt to the energy consumption characteristics of large-scale buildings, but also realizes the construction of an efficient and collaborative energy consumption prediction model under the premise of ensuring data security.
[0016] 2. By introducing sampled global energy consumption data to retrain the aggregated model, the prediction accuracy and robustness of the global model at the overall building level are further improved; at the same time, when issuing optimized model parameters, the hash verification mechanism is combined to ensure that the parameters received by the edge node have not been tampered with or damaged during the transmission process, thereby ensuring the integrity and security of the model deployment process. This mechanism effectively improves the stability and reliability of the system and provides a solid foundation for subsequent edge prediction tasks.
[0017] 3. By introducing the Q-learning reinforcement learning algorithm, the data sampling frequency and model training cycle are dynamically adjusted according to the model prediction error of the edge node and the system computing power status, which can realize the intelligent optimization of edge node resource utilization. On the one hand, it can effectively avoid resource waste and system overload and improve system operation efficiency; on the other hand, it can dynamically adjust the training intensity according to the model performance to improve the accuracy and adaptability of the overall energy consumption prediction. This method takes into account both prediction accuracy and resource consumption, and helps to build a more flexible, efficient and intelligent building energy consumption management system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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: Figure 1 It is a flow chart of a building energy consumption pre-analysis method based on cloud computing provided by the present invention; Figure 2 It is a flow chart of the SCAFFOLD algorithm provided by the present invention; 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
[0019] The preferred embodiments of the present invention are described below in conjunction with 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. Embodiment 1
[0020] A cloud computing-based building energy consumption pre-analysis method, such as Figure 1 As shown, including: S100: Establish a federated learning framework with each floor in the building as an edge node and the cloud computing center as the central node; According to the building structure, the system configures each floor in the building as an independent edge node. Each edge node is responsible for collecting the energy consumption data of the floor and performing model training locally, avoiding the original data from being uploaded to the cloud, and reducing the risk of data leakage from the source. At the same time, the cloud computing center is set as the central node to coordinate the model training, parameter aggregation and task scheduling of each edge node, thereby building a privacy-friendly, distributed federated learning framework.
[0021] 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 the training is completed; Specifically, the prediction model used by the energy consumption prediction model includes but is 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 limit 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.
[0022] S300: Based on the received local model parameters of multiple edge nodes, the cloud computing center aggregates the global model parameters by using a federated learning method, and retrains the aggregated model by using the sampled global energy consumption data to optimize the global model parameters; Furthermore, the data collection period of the edge node is a first period, and the data collection period of the cloud computing center is a second period, wherein the second period is greater than the first period.
[0023] Specifically, the first cycle and the second cycle can be set according to the needs of the user. In this embodiment, the first cycle is 15 minutes and the second cycle is 90 minutes.
[0024] Through this hierarchical sampling mechanism, the system can effectively control the consumption of computing and communication resources while ensuring the prediction accuracy. The edge nodes collect local energy consumption data at a higher frequency, which is conducive to capturing the dynamic change characteristics of the floor level and enhancing the model's ability to respond to short-term fluctuations; while the cloud computing center samples data at a lower frequency, which can significantly reduce the center's computing load and communication pressure, and improve the overall operation efficiency and scalability of the system.
[0025] Furthermore, 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.
[0026] SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) algorithm, that is, stochastic controlled averaging for federated learning, introduces control variables to correct the deviation of the client's update direction in local training, thereby improving the convergence effect of federated learning. By introducing the SCAFFOLD algorithm, effective correction of local model updates on edge nodes is achieved, which can significantly alleviate the model offset problem caused by heterogeneous (non-IID) data distribution on edge nodes. By using the difference between local control variables and cloud control variables for direction correction, it not only improves the consistency and generalization ability of the aggregated model between different nodes, but also accelerates the convergence speed of the global model, improves the accuracy and stability of the overall building energy consumption prediction, and effectively enhances the robustness and practicality of the system in complex building environments.
[0027] Furthermore, the specific steps of the SCAFFOLD algorithm are as follows: Figure 2 As shown, including: 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 update according to the difference between the cloud control variable and the local control variable, 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 of the global model parameters is less than the change threshold.
[0028] Specifically, the cloud computing center initializes the global model parameters and global control variables, and each edge node initializes the 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 is trained based on its own local data. During the training process, the following correction formula is used to update the local model parameters and local control variables: ; ; in, represents the training round, Indicates The local model parameters of the edge nodes, represents the local learning rate, Indicates The gradient calculated by the edge nodes on the local data, Indicates 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: ; ; 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 range of global model parameters in multiple consecutive rounds is lower than the set threshold (In this embodiment ),Right now .
[0029] 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.
[0030] Furthermore, the specific steps of model retraining include: The cloud computing center constructs a training data set based on the sampled overall building 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 a preset convergence condition is met; the preset convergence condition is that the prediction error is less than an error threshold.
[0031] Furthermore, the calculation formula for fine-tuning training is: ; in, express The model parameters at the fine-tuning iteration, Indicates The model parameters at the fine-tuning iteration, represents the learning rate, Indicates The weighting factor of the edge nodes, represents the total number of edge nodes, Indicates The loss function of the model parameters of the edge nodes during fine-tuning iterations, represents the gradient of the loss function.
[0032] Specifically, the cloud computing center samples the overall energy consumption data of the building in the second cycle, and constructs a training data set and a verification 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 initial model is fine-tuned for several rounds using the constructed global data set. During the retraining process, the prediction error of the verification set is monitored in real time. When the preset convergence condition is met, the training is terminated. The convergence condition ,in, represents the prediction error, Indicates the actual energy consumption, represents the predicted energy consumption, represents the error threshold (in this embodiment ).
[0033] 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 performed by combining global building energy consumption data sampled and collected on 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.
[0034] 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 of the edge node and the cloud computing center are successfully synchronized; Furthermore, 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.
[0035] Specifically, before sending down 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, generates 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 no error occurred in the model parameters during the transmission process, 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.
[0036] The introduction of a hash consistency verification mechanism can effectively ensure the integrity and credibility of global model parameters during transmission, and avoid edge nodes loading damaged or incorrect model parameters due to network instability, data tampering, or transmission errors. By comparing hash values between edge nodes and cloud computing centers, model consistency verification and error retransmission can be achieved, which improves the security and robustness of the system during model distribution and ensures that each edge node can carry out subsequent prediction tasks based on a correct and unified global model.
[0037] S500: Adopts Q-learning reinforcement learning algorithm, takes the model prediction error of edge nodes and system computing power status as status information, and dynamically adjusts the data sampling frequency and model training cycle of edge nodes.
[0038] Furthermore, the specific steps of adjusting the data sampling frequency and model training cycle of the 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 cycle according to the learned strategy and the current state.
[0039] Specifically, construct a state space S, 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), define an action set A, where 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.), and 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; construct a reward function that comprehensively considers prediction accuracy and resource consumption , where the reward function The calculation formula is: ; in, Represents 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 the state Next action , the cumulative expected reward that can be obtained in the future, each state transfer execution action After that, update according to the reward value of feedback: ; in, Indicates the current state. Indicates the current action. Indicates in 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 new status 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 finally converges to a stable strategy that balances prediction accuracy and resource usage; the edge node selects the corresponding sampling frequency and training cycle according to the learned strategy and the current state.
[0040] The above design introduces the Q-learning reinforcement learning mechanism to give edge nodes the ability to adjust themselves, 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 system computing power status. Under this mechanism, the system can effectively reduce resource consumption and computing power load while ensuring prediction accuracy, improve the flexibility and robustness of overall energy efficiency management, and help achieve more efficient distributed building energy consumption analysis and control. Embodiment 2
[0041] Taking a multi-storey intelligent office building as an object, the cloud computing-based building energy consumption pre-analysis system proposed in the present invention is deployed and operated. Figure 3 As shown, including: 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 a central node; The edge computing module is used to train the energy consumption prediction model based on the local energy consumption data collected locally 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 the global model parameters based on the local model parameters of multiple edge nodes received by the cloud computing center using a federated learning method, and retrain the aggregated model through the global energy consumption data collected by sampling to optimize the global model parameters; The distribution verification module is used to send the optimized global model parameters to each edge node after the global model retraining is completed, together 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; 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 specific implementation steps of this system are as follows: Each floor in the building is configured as an independent edge node, and each edge node deploys a local computing module and data acquisition device. The cloud computing center serves as the central node and deploys a federated learning service framework to coordinate the collaborative training tasks of each edge node.
[0043] Each edge node collects energy consumption data on the floor at a frequency of 15 minutes per cycle, and trains the energy consumption prediction model locally based on the collected data. The model used is an integrated model combining LSTM and random forest. After training, the local model parameters are uploaded to the cloud computing center.
[0044] 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 perform parameter aggregation after bias correction on the model to obtain a preliminary global model; then, 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 data set, and the global model is fine-tuned and optimized to improve the overall prediction capability.
[0045] After the cloud computing center completes the retraining, it sends the optimized global model parameters and the corresponding hash value (SHA-256 digest) to all edge nodes. After receiving, the edge node uses the same hash algorithm to hash the model parameters and compares them with the checksum sent by the cloud computing center. If they are consistent, the model is loaded; otherwise, the loading is rejected and a retransmission is requested to ensure that the model has not been tampered with or damaged during the transmission process, and to ensure the security and consistency of the system.
[0046] The system deploys Q-learning reinforcement learning agents, with model prediction errors and system computing power status as state inputs in each edge node; the output is a combination of comprehensive data sampling frequency (30 minutes per cycle) and model training cycle (2 days). By building a reward function that weighs prediction accuracy and computing resources, the system continuously optimizes the state-action strategy, allowing each edge node to intelligently adjust the sampling and training plan according to the current operating status, achieving higher energy prediction efficiency and resource scheduling flexibility.
[0047] The multi-storey intelligent office building originally adopted the 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, which 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 average prediction accuracy of the present invention is improved 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%, improving the operation efficiency and scalability of the system. In addition, the present invention realizes model collaborative training through federated learning, without uploading 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.
[0048] Table 1 Comparison of various indicators before and after using the present invention
[0049] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is 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 can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope 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 through sampled global energy consumption data to optimize the global model parameters. After completing the global model retraining, the cloud computing center sends the optimized global model parameters to each edge node, along with the hash check value; After receiving, 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 Q-learning reinforcement learning algorithm is adopted, and the model prediction error of the edge node and the system computing power status are used as the status information to dynamically adjust the data sampling frequency and model training cycle of the edge node.
2. According to the cloud computing-based building energy consumption pre-analysis method of claim 1, it is characterized in that: 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.
3. The cloud computing-based building energy consumption pre-analysis method according to claim 1 is 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.
4. The cloud computing-based building energy consumption pre-analysis method according to claim 3 is 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 update according to the difference between the cloud control variable and the local control variable, 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 of the global model parameters is less than the change threshold.
5. The method for pre-analyzing building energy consumption based on cloud computing according to claim 1, characterized in that: The specific steps of model retraining include: The cloud computing center constructs a training data set based on the sampled overall building 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 a preset convergence condition is met; the preset convergence condition is that the prediction error is less than an error threshold.
6. The cloud computing-based building energy consumption pre-analysis method according to claim 1, characterized in that: The calculation formula for fine-tuning training is: ; in, express The model parameters at the fine-tuning iteration, Indicates The model parameters at the fine-tuning iteration, represents the learning rate, Indicates The weighting factor of the edge nodes, represents the total number of edge nodes, Indicates The loss function of the model parameters of the edge nodes during fine-tuning iterations, represents the gradient of the loss function.
7. The cloud computing-based building energy consumption pre-analysis method according to claim 1, 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.
8. The method for pre-analyzing building energy consumption based on cloud computing according to claim 1, characterized in that: The specific steps to adjust 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 cycle according to the learned strategy and the current state.
9. A cloud computing-based building energy consumption pre-analysis system, 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 a central node; The edge computing module is used to train the energy consumption prediction model based on the local energy consumption data collected locally 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 the global model parameters based on the local model parameters of multiple edge nodes received by the cloud computing center using a federated learning method, and retrain the aggregated model through the global energy consumption data collected by sampling to optimize the global model parameters; The distribution verification module is used to send the optimized global model parameters to each edge node after the global model retraining is completed, together with the hash verification value; After receiving, 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
Layered personalized federal learning method and device in edge computing network and medium
CN116579417A
Method, system and device for fusing distributed edge computing and cloud computing
CN117632478A
Federal element learning image recognition method and system with enhanced noise robustness
CN117994635A
Federal learning-based time delay and energy consumption optimization method
CN119323240A
Complexity and semantic perception video analysis method and system based on edge cloud collaboration
CN119402681A
Cited By
Intelligent energy consumption model construction system and method based on artificial intelligence
CN120781648A
Heat supply energy consumption diagnosis and energy-saving regulation and control method based on edge computing and cloud computing
CN121071456A