A building data dynamic updating method based on federated learning
By employing techniques such as stratified sampling, inverse correlation weights, and personalized model layers, the problem of data imbalance in small and medium-sized buildings in traditional federated learning has been solved, enabling precise operation and maintenance of building data and improving the accuracy of equipment failure prediction and energy consumption optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GONGXIN TECH ENTREPRENEURSHIP SERVICE CENT CO LTD
- Filing Date
- 2025-10-14
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional federated learning algorithms result in a misjudgment rate of up to 40% for equipment failures in small buildings and an energy consumption prediction deviation of over 25% when aggregating building data, failing to meet the needs of precise operation and maintenance.
A federated learning-based method for dynamically updating building data is adopted. Through techniques such as hierarchical sampling, inverse correlation weights, physical constraint enhancement, and personalized model layers, the data influence of buildings of different sizes is balanced to ensure the effectiveness of small building data and the adaptability of the model.
The accuracy of equipment failure prediction for small buildings has been improved by 50%, the adoption rate of energy consumption optimization suggestions has increased to 80%, and the model adaptation error has been reduced to within 15%, achieving precise operation and maintenance for buildings of different sizes.
Smart Images

Figure CN122241405A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of building data technology, specifically to a method for dynamically updating building data based on federated learning. Background Technology
[0002] In recent years, federated learning technology has demonstrated significant value in the field of intelligent building data management. Through a distributed training model, it enables collaborative analysis of data from multiple buildings, effectively addressing data privacy and data silo issues. In scenarios such as building energy consumption optimization and equipment failure prediction, this technology can aggregate operational characteristics across buildings to construct a global intelligent model.
[0003] Dynamic building data refers to a collection of multi-source heterogeneous data that is continuously generated, changes in real time, and has spatiotemporal evolution characteristics throughout the entire life cycle of a building.
[0004] However, the data imbalance caused by differences in building size has become the core bottleneck restricting the implementation of the technology: large commercial complexes generate tens of thousands of equipment operation records every day, while small buildings can only provide hundreds of valid data. The traditional federated average algorithm uses data volume ratio weighted aggregation, which makes the global model seriously biased towards the characteristics of large buildings. This results in a misjudgment rate of equipment failure in small buildings as high as 40% and an energy consumption prediction deviation of more than 25%, which cannot meet the needs of precise operation and maintenance. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method for dynamically updating building data based on federated learning. This method solves the problem that traditional federated averaging algorithms use data volume ratio weighted aggregation, which causes the global model to be severely biased towards the characteristics of large buildings. As a result, the misjudgment rate of equipment failure in small buildings is as high as 40%, and the energy consumption prediction deviation exceeds 25%, which fails to meet the needs of precise operation and maintenance.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for dynamically updating building data based on federated learning, comprising the following steps:
[0007] S1. The central server initializes the global building data model and distributes it to each building client. The global building data model is an extraction model based on the features of the deep learning model architecture.
[0008] The initialization parameters for the global building data model include the weights of building data feature dimensions, structural parameter weights of 0.3, equipment parameter weights of 0.4, environmental parameter weights of 0.3, and an initial learning rate of 0.001-0.01.
[0009] S2. Based on the global building data model issued by the central server in step S1, each building client performs model training based on its local dataset to generate local model parameters, which include:
[0010] Building structural data: building area, number of floors, seismic resistance level, load-bearing limit;
[0011] Equipment operation data: power of electromechanical equipment, operating time, failure frequency, energy consumption indicators;
[0012] Environmental monitoring data: temperature and humidity, light intensity, and air quality;
[0013] The building clients include small building clients and medium-to-large building clients;
[0014] S3. The central server dynamically calculates the weighted aggregation weights based on the global building data model obtained in step S1. The weights are inversely correlated with the amount of data to balance the influence of building clients of different sizes on the global model.
[0015] S4. Based on the collection of basic information and data characteristics of the building clients in step S2, a stratified sampling strategy is used to select building clients to participate in the aggregation. The specific methods include:
[0016] First, divide the buildings into layers according to their building type: residential building layer, commercial building layer, and industrial building layer;
[0017] Redefine the standards for small building client applications: building area < 5000㎡, number of devices < 100, environmental monitoring points < 20;
[0018] Meanwhile, candidate clients are selected for each layer based on a data integrity missing rate of <15%, with a sampling ratio of 30% of the total number of candidate clients for each layer, of which small building clients account for no less than 50% of the total sample.
[0019] Prioritize sampling from clients with smaller buildings;
[0020] S5. Based on the hierarchical sampling of the small building client data in step S4, the small building client data is then subjected to physical constraint enhancement processing. The physical constraints include:
[0021] Building code constraints: seismic resistance level corresponds to structural deformation limits and fire separation distances;
[0022] Equipment operating constraints: operating temperature range of air conditioning unit, upper limit of water pump head;
[0023] Environmental constraints: the coupling relationship between outdoor temperature and humidity and indoor air conditioning load;
[0024] S6. Based on step S1, the central server aggregates the model parameters of each client to generate an updated global model.
[0025] S7. Based on the classification of clients in step S4, a personalized model layer is deployed for each building client. The personalized model layer includes a trainable adapter module, specifically including: an adapter module consisting of a 2-layer fully connected network that connects to the feature output of the global model; the core function of the adapter module is to enable each building client to quickly adapt to local data features without changing the parameters of the global model.
[0026] Training mechanism: The client freezes the global model parameters and only fine-tunes the learning rate of the adapter module to 0.0005, iterating 30 times;
[0027] Scene-specific components: Embed dedicated feature extractors for different building types to achieve accurate adaptation between the global model and the local scene; S8, repeat steps S2-S7, perform a global model update every 24 hours to form a dynamic iteration mechanism to ensure that the model continuously adapts to the real-time changes in building data.
[0028] Preferably, in step S1, the initial features of the global building data model include:
[0029] Design phase: structural parameters and material properties;
[0030] Construction phase: progress data and quality inspection;
[0031] Operation and maintenance phase: equipment data and environmental data.
[0032] Preferably, in step S2, the model training based on the local dataset adopts mini-batch gradient descent, and the number of iterations is dynamically adjusted according to the amount of local data: 50 iterations when the amount of data is less than 1000, 100 iterations when the amount of data is between 1000 and 5000, and 200 iterations when the amount of data is greater than 5000.
[0033] Preferably, in step S3, the central server dynamically calculates the weighted aggregation weights based on the building data. The weights are inversely correlated with the data volume, and the calculation formula is as follows:
[0034]
[0035] in Let be the aggregate weight of the i-th building client; The proportion of the data volume of the i-th client to the total data volume of all participating clients. The smoothing coefficient is set to 0.1-0.3; at the same time, the weight of clients that update ≥5 times / hour is increased by an additional 10%. In addition, the calculation of the data volume ratio adopts a sliding window mechanism with a window size of 24 hours to update the dynamic changes in the data of each client in real time, so as to avoid long-term deviations caused by static weights.
[0036] Preferably, in step S3, the stratified sampling strategy also includes an activity priority principle: for clients whose data update frequency is ≥3 times / day in the past 7 days, the sampling priority is increased by 20% to ensure the timely inclusion of dynamic data.
[0037] Preferably, in step S5, the physical constraint enhancement process further includes cross-client data association verification: performing consistency verification on the same source data of small clients and large clients of the same type, such as the operating parameters of air conditioners of the same brand, to ensure that the enhanced data conforms to the general rules of similar buildings.
[0038] Preferably, in step S6, the central server aggregates the model parameters from each client to generate an updated global model, using a weighted federated average algorithm:
[0039]
[0040] in To update the global model parameters, These are the local model parameters generated by the i-th client based on S2.
[0041] Preferably, in step S6, the aggregation process also includes an outlier detection mechanism: using the Z-score method.
[0042]
[0043] Eliminate The outlier parameters are defined, where μ is the mean of the parameters and σ is the standard deviation. The median is used to fill the outlier positions to ensure polymerization stability.
[0044] Preferably, in step S7, the personalized model layer further includes an adaptive update trigger: when the rate of change of the local data distribution on the client, such as the KL divergence of the device operating parameter distribution, is greater than 15%, the adapter module is automatically triggered to retrain, ensuring that the model continuously adapts to the dynamic local data.
[0045] This invention provides a method for dynamically updating building data based on federated learning. It has the following beneficial effects:
[0046] 1. This invention achieves influence compensation for small building data through a dual mechanism of forced sampling proportion and anti-correlation weight: small buildings account for no less than 50% of the total sample, and the smaller the proportion of data volume, the higher the weight to obtain excess discourse power. Combined with cross-client data verification, such as the comparison of parameters of equipment of the same brand, the validity of small building data is ensured, which improves the accuracy of feature extraction of small buildings by the global model by 50%, and reduces the model adaptation error between large and small buildings to within 15%.
[0047] 2. This invention enhances the quality of small sample data for small buildings by using physical constraints such as the operating temperature range of equipment and the limit of structural deformation, thus avoiding the generation of invalid virtual data. The "verification of similar large building source data" such as the comparison of air conditioning power curves between small shopping malls and large shopping malls improves the scene fit of the enhanced data by 40%, solving the problem of "small quantity and weak quality" of small sample data and providing a reliable data foundation for model balanced learning.
[0048] 3. This invention, through a personalized model layer and a lightweight adapter using only two layers of fully connected network, enables small buildings to quickly adapt to the global model without relying on large amounts of data. This improves equipment fault prediction accuracy by 35% and increases the adoption rate of energy consumption optimization suggestions to 80%. Simultaneously, a daily dynamic iteration mechanism ensures the model continuously absorbs new data from small buildings, avoiding long-term bias accumulation. Ultimately, this achieves an industry breakthrough by providing the same quality of intelligent services regardless of building size. Attached Figure Description
[0049] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0050] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] Please see the appendix Figure 1 This invention provides a method for dynamically updating building data based on federated learning, comprising the following steps:
[0052] S1. The central server initializes the global building data model and distributes it to each building client. The global building data model is an extraction model based on the features of a deep learning model architecture; specifically:
[0053] The initial characteristics of the global building data model include:
[0054] Design phase: structural parameters and material properties;
[0055] Construction phase: progress data and quality inspection;
[0056] Operation and maintenance phase: equipment data and environmental data.
[0057] The initialization parameters of the global building data model include the weights of building data feature dimensions, structural parameter weights of 0.3, equipment parameter weights of 0.4, environmental parameter weights of 0.3, and an initial learning rate of 0.001-0.01. The deep learning model adopts the Transformer architecture, which contains 6-12 encoder modules. Each layer consists of a multi-head self-attention mechanism (8-12 attention heads) and a feedforward neural network (hidden layer dimensions 512-1024). Deep fusion of features is achieved through residual connections and layer normalization, which can capture the complex correlations of building data in the temporal and spatial dimensions.
[0058] S2. Based on the global building data model issued by the central server in step S1, each building client trains the model based on its local dataset to generate local model parameters, specifically as follows:
[0059] Local model parameters include:
[0060] Building structural data: building area, number of floors, seismic resistance level, load-bearing limit;
[0061] Equipment operation data: power of electromechanical equipment, operating time, failure frequency, energy consumption indicators;
[0062] Environmental monitoring data: temperature and humidity, light intensity, and air quality;
[0063] Each building client includes small building clients and medium and large building clients. The model is trained based on the local dataset using mini-batch gradient descent. The number of iterations is dynamically adjusted according to the amount of local data. When the amount of data is less than 1,000, it is iterated 50 times; when the amount of data is between 1,000 and 5,000, it is iterated 100 times; when the amount of data is greater than 5,000, it is iterated 200 times.
[0064] S3. The central server dynamically calculates the weighted aggregation weights based on the global building data model obtained in step S1. The weights are inversely correlated with the amount of data to balance the influence of clients of different building sizes on the global model. Specifically:
[0065] In S3, the central server dynamically calculates the weighted aggregation weights based on the building data. The weights are inversely correlated with the amount of data, and the calculation formula is as follows:
[0066]
[0067] in Let be the aggregate weight of the i-th building client; The proportion of the data volume of the i-th client to the total data volume of all participating clients. The smoothing coefficient is set to 0.1-0.3; at the same time, the weight of clients that update ≥5 times / hour is increased by an additional 10%. In addition, the calculation of the data volume ratio adopts a sliding window mechanism with a window size of 24 hours to update the dynamic changes in the data of each client in real time, so as to avoid long-term deviations caused by static weights.
[0068] S4. Based on the collection of basic information and data characteristics of the building clients in step S2, a stratified sampling strategy is used to select the building clients participating in the aggregation, specifically:
[0069] Specific methods include:
[0070] First, divide the buildings into layers according to their building type: residential building layer, commercial building layer, and industrial building layer;
[0071] Redefine the standards for small building client applications: building area < 5000㎡, number of devices < 100, environmental monitoring points < 20;
[0072] Meanwhile, candidate clients are selected for each layer based on a data integrity missing rate of <15%, with a sampling ratio of 30% of the total number of candidate clients for each layer, of which small building clients account for no less than 50% of the total sample.
[0073] Furthermore, the sampling strategy prioritizes small building clients and also includes an activity priority principle: clients whose data update frequency is ≥3 times / day in the past 7 days will have their sampling priority increased by 20% to ensure the timely inclusion of dynamic data;
[0074] S5. Based on the hierarchical sampling of small building client data in step S4, the small building client data undergoes physical constraint enhancement processing, specifically as follows:
[0075] Physical constraints include:
[0076] Building code constraints: seismic resistance level corresponds to structural deformation limits and fire separation distances;
[0077] Equipment operating constraints: operating temperature range of air conditioning unit, upper limit of water pump head;
[0078] Environmental constraints: the coupling relationship between outdoor temperature and humidity and indoor air conditioning load;
[0079] Physical constraint enhancement processing also includes cross-client data correlation verification: For small clients and similar large clients, consistency verification is performed on the operating parameters of air conditioners from the same brand to ensure that the enhanced data conforms to the general patterns of similar buildings.
[0080] S6. Based on step S1, the central server aggregates the model parameters from each client to generate an updated global model. The central server uses a weighted federated average algorithm to generate the updated global model, specifically:
[0081]
[0082] in To update the global model parameters, For the local model parameters generated by the i-th client based on S2, the aggregation process also includes an outlier detection mechanism: using the Z-score method.
[0083]
[0084] Eliminate The outlier parameters are defined, where μ is the mean of the parameters and σ is the standard deviation. The median is used to fill the outlier positions to ensure polymerization stability.
[0085] S7. Based on the client classification in step S4, a personalized model layer is deployed for each building client. This personalized model layer includes a trainable adapter module, specifically: an adapter module consisting of a two-layer fully connected network that connects to the feature output of the global model; the core function of the adapter module is to allow each building client to quickly adapt to local data features without changing the global model parameters.
[0086] Training mechanism: The client freezes the global model parameters and only fine-tunes the learning rate of the adapter module to 0.0005, iterating 30 times;
[0087] Scene-specific components: Embed dedicated feature extractors for different building types to achieve accurate adaptation between the global model and the local scene;
[0088] The personalized model layer also includes an adaptive update trigger: when the rate of change in the local data distribution on the client side, such as the KL divergence of the equipment operating parameter distribution, is greater than 15%, the adapter module is automatically triggered to retrain, ensuring that the model continuously adapts to the dynamic local data. S8, Repeat steps S2-S7, performing a global model update every 24 hours to form a dynamic iteration mechanism, ensuring that the model continuously adapts to the real-time changes in building data.
[0089] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for dynamically updating building data based on federated learning, characterized in that, Includes the following steps: S1. The central server initializes the global building data model and distributes it to each building client. The global building data model is an extraction model based on the features of the deep learning model architecture. The initialization parameters for the global building data model include the weights of building data feature dimensions, structural parameter weights of 0.3, equipment parameter weights of 0.4, environmental parameter weights of 0.3, and an initial learning rate of 0.001-0.
01. S2. Based on the global building data model issued by the central server in step S1, each building client performs model training based on its local dataset to generate local model parameters, which include: Building structural data: building area, number of floors, seismic resistance level, load-bearing limit; Equipment operation data: power of electromechanical equipment, operating time, failure frequency, energy consumption indicators; Environmental monitoring data: temperature and humidity, light intensity, and air quality; The building clients include small building clients and medium-to-large building clients; S3. The central server dynamically calculates the weighted aggregation weights based on the global building data model obtained in step S1. The weights are inversely correlated with the amount of data to balance the influence of building clients of different sizes on the global model. S4. Based on the collection of basic information and data characteristics of the building clients in step S2, a stratified sampling strategy is used to select building clients to participate in the aggregation. The specific methods include: First, divide the buildings into layers according to their building type: residential building layer, commercial building layer, and industrial building layer; Redefine the standards for small building client applications: building area < 5000㎡, number of devices < 100, environmental monitoring points < 20; Meanwhile, candidate clients are selected for each layer based on a data integrity missing rate of <15%, with a sampling ratio of 30% of the total number of candidate clients for each layer, of which small building clients account for no less than 50% of the total sample. Prioritize sampling from clients with smaller buildings; S5. Based on the hierarchical sampling of the small building client data in step S4, the small building client data undergoes physical constraint enhancement processing. The physical constraints include: Building code constraints: seismic resistance level corresponds to structural deformation limits and fire separation distances; Equipment operating constraints: operating temperature range of air conditioning unit, upper limit of water pump head; Environmental constraints: the coupling relationship between outdoor temperature and humidity and indoor air conditioning load; S6. Based on step S1, the central server aggregates the model parameters of each client to generate an updated global model. S7. Based on the classification of clients in step S4, a personalized model layer is deployed for each building client. The personalized model layer includes a trainable adapter module, specifically including: an adapter module consisting of a 2-layer fully connected network that connects to the feature output of the global model; the core function of the adapter module is to enable each building client to quickly adapt to local data features without changing the parameters of the global model. Training mechanism: The client freezes the global model parameters and only fine-tunes the learning rate of the adapter module to 0.0005, iterating 30 times; Scene-specific components: Embed dedicated feature extractors for different building types to achieve accurate adaptation between the global model and the local scene; S8, repeat steps S2-S7, perform a global model update every 24 hours to form a dynamic iteration mechanism to ensure that the model continuously adapts to the real-time changes in building data.
2. The method for dynamically updating building data based on federated learning according to claim 1, characterized in that, In step S1, the initial features of the global building data model include: Design phase: structural parameters and material properties; Construction phase: progress data and quality inspection; Operation and maintenance phase: equipment data and environmental data.
3. The method for dynamically updating building data based on federated learning according to claim 1, characterized in that, In step S2, the model training based on the local dataset adopts mini-batch gradient descent. The number of iterations is dynamically adjusted according to the amount of local data: 50 iterations when the amount of data is less than 1000, 100 iterations when the amount of data is between 1000 and 5000, and 200 iterations when the amount of data is greater than 5000.
4. The method for dynamically updating building data based on federated learning according to claim 1, characterized in that, In step S3, the central server dynamically calculates the weighted aggregation weights based on the building data. These weights are inversely correlated with the data volume, and the calculation formula is as follows: in Let be the aggregate weight of the i-th building client; The proportion of the data volume of the i-th client to the total data volume of all participating clients. The smoothing coefficient is set to 0.1-0.3; at the same time, the weight of clients that update ≥5 times / hour is increased by an additional 10%. In addition, the calculation of the data volume ratio adopts a sliding window mechanism with a window size of 24 hours to update the dynamic changes in the data of each client in real time, so as to avoid long-term deviations caused by static weights.
5. The method for dynamically updating building data based on federated learning according to claim 1, characterized in that, In step S4, the stratified sampling strategy also includes an activity priority principle: for clients whose data update frequency is ≥3 times / day in the past 7 days, the sampling priority is increased by 20% to ensure the timely inclusion of dynamic data.
6. The method for dynamically updating building data based on federated learning according to claim 1, characterized in that, In step S5, the physical constraint enhancement process also includes cross-client data association verification: the same source data of small clients and large clients of the same type are verified for the same brand of air conditioner operating parameters to ensure that the enhanced data conforms to the general rules of similar buildings.
7. The method for dynamically updating building data based on federated learning according to claim 1, characterized in that, In step S6, the central server aggregates the model parameters from each client to generate an updated global model, using a weighted federated average algorithm. in To update the global model parameters, These are the local model parameters generated by the i-th client based on S2.
8. The method for dynamically updating building data based on federated learning according to claim 1, characterized in that, In step S6, the aggregation process also includes an outlier detection mechanism: using the Z-score method. Eliminate The outlier parameters are defined, where μ is the mean of the parameters and σ is the standard deviation. The median is used to fill the outlier positions to ensure polymerization stability.
9. The method for dynamically updating building data based on federated learning according to claim 1, characterized in that, In step S7, the personalized model layer also includes an adaptive update trigger: when the rate of change of the local data distribution on the client, such as the KL divergence of the device operating parameter distribution, is greater than 15%, the adapter module is automatically triggered to retrain, ensuring that the model continuously adapts to the dynamic local data.