A smart building energy consumption data monitoring management method and system
By constructing a distributed architecture, using graph attention mechanism and EPC-PSO algorithm optimization, and combining Lagrange decomposition and Hungarian KM algorithm, the accuracy and robustness issues of anomaly detection in smart building energy consumption data monitoring are solved, achieving efficient resource allocation and adaptive anomaly response.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LONG TECH CO LTD
- Filing Date
- 2025-05-27
- Publication Date
- 2026-05-12
AI Technical Summary
Existing smart building energy consumption data monitoring methods lack in-depth mining of the correlation characteristics between energy consumption data and environmental data, which makes it easy to misjudge or miss anomalies. Traditional algorithms cannot effectively capture the complex dependencies between nodes in high-dimensional time series data processing, and are difficult to run efficiently in distributed systems, with insufficient optimization of resource allocation and task scheduling.
A distributed architecture is constructed, energy consumption and environmental data are collected and preprocessed, a dynamic graph structure is built, and the graph attention mechanism GAT is used to extract the joint features of energy consumption and environmental data. The batch average attention coefficient is used to weight the Mahalanobis distance of nodes, a classification objective function is defined, and the EPC-PSO algorithm is used for iterative optimization. Under gradient descent, the Lagrange multiplication table is used to decompose the problem into subproblems for each device, and the gradient descent method is used to output the global initial policy vector. The smart building task is defined, a matrix of comprehensive benefit weights is constructed, and the devices and tasks are transformed into a bipartite graph problem, which is solved using the Hungarian KM algorithm.
It improves the accuracy and robustness of anomaly detection, enhances resource allocation efficiency and overall benefits, and strengthens the system's adaptive anomaly response capability.
Smart Images

Figure CN120634102B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart building and energy management technology, and in particular to a smart building energy consumption data monitoring and management method and system. Background Technology
[0002] With the continuous advancement of concepts such as smart cities and green buildings, building energy management has become one of the key links in improving the sustainable development capabilities of cities. In recent years, the development of emerging technologies such as the Internet of Things (IoT), edge computing, and artificial intelligence has provided important support for the acquisition, processing, and analysis of energy consumption data in smart buildings. Current smart building systems typically rely on various sensor nodes deployed within the building to collect multi-dimensional energy consumption data and environmental parameters such as electricity, water, and gas. These data are then aggregated, modeled, and analyzed through a centralized data platform to achieve functions such as energy consumption trend prediction, operational efficiency assessment, and anomaly early warning.
[0003] Despite some progress in related technologies, many challenges and limitations remain. Most existing methods only analyze energy consumption data or environmental data separately, lacking in-depth mining of the correlation features between the two, which makes it easy to make false or false judgments during anomaly detection. Traditional anomaly detection algorithms often fail to effectively capture the complex dependencies between nodes when processing high-dimensional time-series data and lack robustness. In terms of task scheduling and energy consumption optimization, current common methods are mostly based on heuristic algorithms or centralized solution frameworks, which are difficult to run efficiently in distributed systems and fail to fully consider the nonlinear coupling relationship and resource constraints between devices and tasks. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a smart building energy consumption data monitoring and management method and system to solve the problem that most existing methods only analyze energy consumption data or environmental data separately, lacking in-depth mining of the correlation characteristics between the two, which leads to misjudgment or missed judgment in the anomaly detection process. Traditional anomaly detection algorithms often fail to effectively capture the complex dependencies between nodes when processing high-dimensional time series data, and lack robustness. In terms of task scheduling and energy consumption optimization, current common methods are mostly based on heuristic algorithms or centralized solution frameworks, which are difficult to run efficiently in distributed systems, and also fail to fully consider the nonlinear coupling relationship and resource constraints between devices and tasks.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a method for monitoring and managing energy consumption data in smart buildings, comprising,
[0008] A distributed architecture is constructed, energy consumption and environmental data are collected and preprocessed, a dynamic graph structure is built, the graph attention mechanism GAT is used to extract the joint features of energy consumption and environmental data, and the Mahalanobis distance of nodes is weighted using the batch average attention coefficient to obtain the abnormal scene feature vector.
[0009] Define a classification objective function, use the EPC-PSO algorithm for iterative optimization, use the Softmax classifier to classify the feature vectors of abnormal scenes, and calculate the severity of each abnormality type;
[0010] Define the energy efficiency objective function, use Lagrange decomposition to decompose the subproblems of each device, use gradient descent to output the global initial policy vector, define the smart building task, construct the matrix of comprehensive benefit weights, transform the device and task into a bipartite graph problem, and use the Hungarian KM algorithm to solve it.
[0011] Collect real-time data to perform smart building energy consumption management, and build a visual interface to display and analyze the generated data.
[0012] As a preferred embodiment of the intelligent building energy consumption data monitoring and management method of the present invention, the following steps are included: constructing a dynamic graph structure, using the graph attention mechanism (GAT) to extract joint features of energy consumption and environmental data, and calculating feature vectors for abnormal scenarios:
[0013] The distributed architecture includes edge nodes and master control nodes;
[0014] The collected energy consumption and environmental data include current, power, energy consumption rate, temperature, humidity, and smoke concentration data.
[0015] Construct a time-segment data matrix, map each data type in the time-segment data matrix to a node, and use the Pearson correlation coefficient to add edges to the dynamic graph structure;
[0016] Calculate the overall volatility of edges between nodes with added edges, convert it to a time decay factor using a linear mapping function, calculate the dynamic weights of the edges, construct a dynamic graph structure, and calculate the adjacency matrix.
[0017] Based on the adjacency matrix and dynamic graph structure, the graph attention mechanism GAT is used at the edge nodes to extract the joint features of energy consumption and environmental variables.
[0018] We use weighted multi-head attention to calculate the weighted attention score of each pair of nodes, calculate the average attention coefficient of each node, use the ReLU activation function to aggregate the neighbor features for each head, concatenate the feature vectors generated by each head to obtain the feature matrix H, divide the features in the feature matrix H and the average attention coefficient of each node into batches to obtain the batch feature matrix and batch attention coefficient.
[0019] Calculate the mean and covariance matrix of the feature matrix for each batch, calculate the Mahalanobis distance of each node, use the batch attention coefficient to weight the Mahalanobis distance of each node as the anomaly score, and perform normalization processing. Use a fixed threshold screening method to filter out nodes with anomaly scores greater than the anomaly threshold, generate an anomaly node set, and transmit it to the master node through the edge node.
[0020] The master node uses a multiplication method to weight the anomaly scores onto the feature vectors in the received set of anomaly nodes, thereby obtaining the anomaly scene feature vectors. All the anomaly scene feature vectors are then used to generate an anomaly scene set.
[0021] As a preferred embodiment of the intelligent building energy consumption data monitoring and management method of the present invention, the following steps are included: defining a classification objective function, iteratively optimizing it using the EPC-PSO algorithm, classifying the feature vectors of abnormal scenes using a Softmax classifier, and calculating the severity of each abnormality type:
[0022] On the master node, the EPC-PSO particle swarm is initialized, and abnormal data in the collected tagged historical energy consumption data and historical environmental data are extracted as historical abnormal datasets.
[0023] Define a classification objective function, input each initialized particle position as a classification boundary parameter into the classification objective function, calculate the objective function value, select the global optimal particle position for the current iteration, update the velocity and position of each particle using the EPC movement rule, output the global optimal position after reaching the maximum number of iterations, substitute the global optimal position into the classification objective function to obtain the initial individual optimal position, use PSO to update the velocity and position of the initial individual optimal position, calculate the classification score based on the abnormal scene feature vector, generate a classification score vector, use the Softmax function to calculate the probability of the classification score vector, set the anomaly type weight, use the average severity calculation method to calculate the initial severity score of the anomaly score in the classification score vector, and use the multiplication method to calculate the adjusted severity score.
[0024] Based on rules of thumb, high-risk and medium-risk thresholds are set separately, and alarm level classification rules are set using the adjusted severity scores.
[0025] As a preferred embodiment of the intelligent building energy consumption data monitoring and management method of the present invention, the following is included: defining the energy consumption efficiency objective function, using Lagrange decomposition to subproblems for each device, and using gradient descent to output a global initial policy vector, including:
[0026] Energy efficiency targets are constructed at edge nodes to maximize the ratio of performance to energy consumption. Power and performance constraints are set for edge nodes. The local optimization targets and constraints are decomposed into subproblems for each device using Lagrange multiplication. For each device, the power is iteratively updated using gradient descent, and the environmental quality is calculated using the updated power.
[0027] The updated equipment efficiency is calculated using the ratio method, and the overall efficiency of each updated equipment is calculated using the weighted summation method. The efficiency threshold of the equipment is set using the fixed value method. The efficiency threshold of the equipment is compared with the updated overall efficiency to determine the switching status of the equipment. Based on the updated power, the quantization value of the mode is obtained using the mapping method.
[0028] Based on the updated power, the Lagrange multipliers are updated. After reaching the maximum number of iterations, the optimal power, switching state, and operating mode of the output device are determined, and a global initial policy vector is generated at the master control node.
[0029] As a preferred embodiment of the smart building energy consumption data monitoring and management method of the present invention, the following steps are included: defining smart building tasks, constructing a matrix of comprehensive benefit weights, transforming equipment and tasks into a bipartite graph problem, and solving it using the Hungarian KM algorithm:
[0030] Define the standard forms of four tasks for smart buildings and the candidate action rules for normal and abnormal scenarios. Set the comprehensive benefit weight of each device under the task and candidate action. Construct a weight matrix of the comprehensive benefit weight of each device. Generate a candidate action set for the candidate actions of normal and abnormal scenarios.
[0031] Each edge node transmits its weight matrix and candidate action set to the master node. The master node aggregates the weight matrices of all edge nodes using the mean aggregation method to obtain the initial global weight. Based on the candidate action set, the initial global weight is corrected by action constraint weights to obtain the final global weight. The master node then distributes the global weight and candidate action set to each edge node.
[0032] Based on global weights, a bipartite graph is constructed. Using a device-task adaptability verification method, unreasonable device-task edges are removed. Virtual nodes are used to supplement nodes where the number of devices is not equal to the number of tasks. The virtual nodes are then added to the bipartite graph using a graph expansion method to obtain the updated bipartite graph.
[0033] With the objective function of maximizing global weight and task matching, a single-match constraint is set;
[0034] Based on the updated bipartite graph, an empty matching set is set, and the KM Hungarian algorithm is used to match device-task edges, outputting the final matching set.
[0035] Each edge node transmits the final matching set to the master node, which then converts the final matching set into device control commands and distributes them to the edge nodes for task allocation.
[0036] As a preferred embodiment of the smart building energy consumption data monitoring and management method of the present invention, the step of collecting real-time data to perform smart building energy consumption management includes:
[0037] Edge nodes collect real-time data, and the master control node analyzes the normal and abnormal conditions of the data. Based on different scenarios (normal and abnormal scenarios), with the goal of minimizing energy consumption, tasks are executed in order of alarm level, and the final matching set is used to send instructions to the devices controlled by the edge nodes for control.
[0038] As a preferred embodiment of the smart building energy consumption data monitoring and management method of the present invention, the step of constructing a visual interface to display and analyze the generated data includes:
[0039] Use BIM to build a visual interface that displays four areas;
[0040] The four areas include displaying energy consumption distribution in the form of a heat map, the actions of equipment controlled by edge nodes (power, on / off status, and operating status), displaying the location of anomalies, and real-time values of energy consumption and environmental data;
[0041] It provides an interactive interface that allows administrators to manually adjust equipment status and confirm automation recommendations.
[0042] Secondly, this invention provides a smart building energy consumption data monitoring and management system, comprising,
[0043] The collection module is used to build a distributed architecture. It collects energy consumption and environmental data for preprocessing, builds a dynamic graph structure, uses the graph attention mechanism GAT to extract the joint features of energy consumption and environmental data, and uses the batch average attention coefficient to weight the Mahalanobis distance of the nodes to obtain the abnormal scene feature vector.
[0044] Define a classification module to define the classification objective function, use the EPC-PSO algorithm for iterative optimization, use the Softmax classifier to classify the feature vectors of abnormal scenes, and calculate the severity of each abnormality type;
[0045] The decomposition and solution module is used to define the energy efficiency objective function, use Lagrange decomposition to subproblems for each device, use gradient descent to output the global initial policy vector, define the smart building task, construct the matrix of comprehensive benefit weights, transform the device and task into a bipartite graph problem, and use the Hungarian KM algorithm to solve it.
[0046] The visualization module is used to collect real-time data for smart building energy management and to build a visual interface to display the generated data.
[0047] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the smart building energy consumption data monitoring and management method as described in the first aspect of the present invention.
[0048] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the smart building energy consumption data monitoring and management method as described in the first aspect of the present invention.
[0049] The beneficial effects of this invention are as follows: By constructing a distributed architecture, collecting and preprocessing energy consumption and environmental data, constructing a dynamic graph structure, using the graph attention mechanism GAT to extract joint features of energy consumption and environmental data, and using batch average attention coefficients to weight the Mahalanobis distance of nodes to obtain anomaly scene feature vectors; defining a classification objective function, using the EPC-PSO algorithm for iterative optimization, using a Softmax classifier to classify the anomaly scene feature vectors, and calculating the severity of each anomaly type; defining an energy consumption efficiency objective function, using Lagrange decomposition to subproblems for each device, using gradient descent to output a global initial policy vector, defining smart building tasks, constructing a matrix of comprehensive benefit weights, transforming devices and tasks into bipartite graph problems, and solving them using the Hungarian KM algorithm; collecting real-time data to perform smart building energy consumption management, constructing a visual interface to display and analyze the generated data, improving the accuracy and robustness of anomaly detection, enhancing resource allocation efficiency and comprehensive benefits, and strengthening the system's adaptive anomaly response capability. Attached Figure Description
[0050] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart of the smart building energy consumption data monitoring and management method in Example 1.
[0052] Figure 2 This is a schematic diagram of the smart building energy consumption data monitoring and management system in Example 1.
[0053] Figure 3This is a flowchart of the dynamic graph structure and anomaly detection process in Example 1.
[0054] Figure 4 This is a flowchart of the optimization and task scheduling process in Example 1. Detailed Implementation
[0055] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0056] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0057] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0058] Example 1, referring to Figures 1 to 4 This is the first embodiment of the present invention, which provides a smart building energy consumption data monitoring and management method, including the following steps:
[0059] S1. Construct a distributed architecture, collect energy consumption and environmental data for preprocessing, construct a dynamic graph structure, use the graph attention mechanism GAT to extract the joint features of energy consumption and environmental data, and use the batch average attention coefficient to weight the Mahalanobis distance of the nodes to obtain the abnormal scene feature vector.
[0060] Preferably, sensors, including power meters, current sensors, temperature sensors, humidity sensors and smoke sensors, are deployed in key areas of the smart building to collect energy consumption data (current, power, energy consumption rate) and environmental data (temperature, humidity, smoke concentration).
[0061] The critical areas include air conditioning, lighting, heating, and data center cooling systems;
[0062] The sensor adopts a distributed architecture and connects to the embedded PLC of the edge controller through a low-power communication protocol. It collects data and transmits it to the edge node PLC of the distributed control system (DCS). The DCS master node (cloud server) coordinates the edge nodes to ensure data synchronization and real-time performance.
[0063] The collected energy consumption and environmental data are preprocessed;
[0064] The preprocessing includes using Kalman filtering to remove sensor noise, using linear interpolation to fill in missing data, and standardizing the collected energy consumption and environmental data.
[0065] At the edge node PLC, the time series is divided into time segments by minutes, and a time segment data matrix is constructed with the time segment length as a column and the data type as a column.
[0066] Construct a dynamic graph structure, mapping each data type in the time segment data matrix to a node, calculate the Pearson correlation coefficient between nodes, set a correlation threshold using an empirical method, add edges between nodes with Pearson correlation coefficients greater than the correlation threshold, and do not add edges otherwise;
[0067] Calculate the overall volatility of edges between nodes with added edges. ,formula:
[0068] in, and The first The and the first The variance of each node, and These are two adjacent nodes;
[0069] Side-by-side comprehensive volatility Normalization is performed, and a linear mapping function is used to convert the normalized edge-synthesized volatility into a time decay factor. ;
[0070] Use time decay factor Calculate the dynamic weight of the edge using the following formula:
[0071] in, For the edge in time segment t The weight, For the time segment t, the first The and the first Pearson correlation coefficient of each node, For the previous time segment, , For the initial edge The weight,
[0072] For the first The and the first The average Pearson correlation coefficient of each node The total number of time segments. The index weighting factor is set using a fixed-value method;
[0073] Define an empty matrix, generate an edge set E between all nodes, traverse the edge set E, and map the dynamic weights of the edges to the corresponding positions in the empty matrix to obtain the adjacency matrix.
[0074] Computational dynamic graph structure The average value and rate of change of each node in time segment t are calculated, and the data, average value and rate of change of each node are grouped into the feature vector of that node. All feature vectors and edge weight sets are normalized.
[0075] To construct a graph attention mechanism (GAT), collect labeled historical energy consumption data and historical environmental data for preprocessing, construct a dynamic graph structure, train the graph attention mechanism (GAT), stop training after reaching the maximum number of training iterations, and output the trained graph attention mechanism (GAT).
[0076] Using weighted multi-head attention to calculate the first The and the first The weighted attention score for each node, calculated using the formula:
[0077] in, The weighted attention scores for nodes i and j at the k-th head of time segment t. For activation function,
[0078] The transpose of the attention vector of the k-th head is obtained through training using the graph attention mechanism GAT. It is the transpose symbol. The feature transformation matrix of the k-th head is obtained through training using the graph attention mechanism GAT. and Let be the normalized feature vectors of node i and node j in time segment t, respectively. For normalization processing of edges in time segment t The weights;
[0079] Calculate the average attention coefficient for each node to aid in anomaly localization. The formula is:
[0080] in, For time segments The average attention coefficient of node i reflects the overall importance of its neighbor relationships (e.g., a high value indicates a key variable, such as smoke concentration in a fire). The number of heads for multi-head attention. Let i be the set of neighboring nodes of node i;
[0081] The ReLU activation function is used to aggregate neighbor features for each head, as shown in the formula:
[0082] in, For the k-th head in time segment The feature vector generated by node i, It is the ReLU activation function;
[0083] The feature vectors generated by each head are concatenated according to the same time segment and node to obtain the feature matrix H;
[0084] Based on the memory of edge nodes, the batch size is set, and the features in the feature matrix H and the average attention coefficient of each node are divided into batches to obtain the batch feature matrix and batch attention coefficient.
[0085] Calculate the mean and covariance matrix of the feature matrix for each batch, calculate the Mahalanobis distance for each node, and weight the Mahalanobis distance of each node using the batch attention coefficient as the anomaly score. The formula is:
[0086] in, For time segments The abnormal score of node i, To amplify the scores of topologically abnormal nodes based on attention coefficients,
[0087] for The batch average, It should be a small constant to prevent division by zero. The characteristic deviation of the Mahalanobis distance,
[0088] For the characteristic matrix H in time segment The feature vector of node i,
[0089] The global mean. Let be the average of the b-th batch. Let be the set of indices of the feature vectors of the b-th batch. The inverse of the covariance matrix is used for standardized deviation. The global covariance matrix, Let be the covariance matrix of the b-th batch;
[0090] The abnormal scores of all nodes are normalized, an abnormal threshold is set using an empirical method, and nodes with abnormal scores greater than the abnormal threshold are selected using a fixed threshold screening method to generate an abnormal node set, which is then transmitted to the master node through the edge node.
[0091] The master node uses a multiplication method to weight the anomaly scores onto the feature vectors in the received set of anomaly nodes, thereby obtaining the anomaly scene feature vectors. All the anomaly scene feature vectors are then used to generate an anomaly scene set.
[0092] By dividing minute-level time series into time segments and constructing a data matrix, temporal discretization management of energy consumption and environmental data is achieved. By normalizing the comprehensive volatility of edges and converting it into a time decay factor, temporal dynamics are introduced. Combined with the Pearson coefficient between nodes, this effectively adapts to the changing trends of building operation status over time, thereby improving the model's adaptability to dynamic environments and the accuracy of feature representation. By calculating the average attention coefficient of each node, the importance of "key variables" in specific time periods is identified, realizing an interpretable anomaly detection mechanism oriented towards variable importance. This enhances anomaly tracing and on-site management capabilities. The node feature vector is used to calculate the Mahalanobis distance and incorporate batch average attention coefficient weighted scoring to accurately characterize the degree to which a node deviates from normal behavior. This achieves a comprehensive scoring mechanism for local topological anomalies and temporal anomalies, thereby improving the credibility and accuracy of anomaly detection results. By setting an empirical threshold, nodes with high anomaly scores are selected to form an anomaly node set. Anomaly scene feature vectors are generated using a multiplication method and finally summarized into an anomaly scene set. This structure and contextualizes the original anomaly detection results, enabling the management system to have the ability to visualize, trace, and respond to anomalies, significantly improving operational efficiency and security assurance levels.
[0093] S2. Define the classification objective function, use the EPC-PSO algorithm for iterative optimization, use the Softmax classifier to classify the feature vectors of abnormal scenes, and calculate the severity of each abnormality type;
[0094] Preferably, on the master control node, the EPC-PSO particle swarm is initialized, and abnormal data in the collected tagged historical energy consumption data and historical environmental data are extracted as historical abnormal datasets.
[0095] The initialization process includes initializing the particle positions of the EPC-PSO particle swarm using chaotic mapping, performing zero initialization on the particle velocities, setting the values of EPC parameters (temperature factor and distance factor) based on empirical rules, and setting the values of PSO parameters (inertia weight and learning factor) using a fixed-value method.
[0096] Define the classification objective function, formula:
[0097] in, The objective function is to minimize the classification error and the regularization term. These are the classification boundary parameters of the classifier. For historical anomalous datasets, For indexing historical anomalous datasets, Cross-entropy loss measures the error between the predicted and the true labels.
[0098] and These are the first in the historical anomaly dataset. The true labels (0: mechanical failure, 1: electrical failure, 2: operational abnormality, 3: environmental interference) and predicted labels for each abnormal data point. L2 regularization is used to prevent overfitting. This is the regularization coefficient, a general value set according to the situation;
[0099] Each initialized particle position is used as a classification boundary parameter and input into the classification objective function. The objective function value is calculated, and the globally optimal particle position for the current iteration is selected. The formula is:
[0100] in, Let be the globally optimal particle position in the c-th iteration, and represent the optimal classification boundary parameters. Let p be the position of particle p in the c-th iteration;
[0101] The update velocity of each particle is calculated using the EPC movement rule, formula:
[0102] in, For particle p in the first... The speed of the next iteration Temperature is used as a factor to control the scope of exploration, while a universal value ensures global search capability.
[0103] To use random values enhances search diversity. The distance factor is based on the Euclidean distance between the particle and the global optimum; a universal value balances the convergence speed.
[0104] The Euclidean distance measures how close a particle is to the optimal solution;
[0105] Update the particle position using the update velocity of each particle, using the following formula:
[0106] in, For particle p in the first... The position of the next iteration;
[0107] Set particle position range constraints to prevent overflow, formula:
[0108] in, To be Limited to Within the range, consistent with the initialization range;
[0109] The iteration continues until the maximum number of iterations is reached, at which point the iteration stops. The global optimal position is output, and this position is substituted into the classification objective function to obtain the initial individual optimal position. The update rate for the initial individual optimal position is given by the formula:
[0110] in, For particle p in the first... The speed of the next iteration The maximum number of iterations for global optimization. As an inertia weight, it retains the inertia of the velocity from the previous iteration. and These are learning factors that control the attractiveness of individuals and the global optimum, respectively. As a random factor, it enhances the randomness of the search. For the first The globally optimal position provided by the next iteration of EPC. For particle p in the first... The optimal position of the individual in the next iteration;
[0111] Update the particle position using the initial optimal position update velocity, calculate the objective function value at the new position, and update the optimal position of the individual. The formula is:
[0112] Set a maximum number of iterations. Update velocity and position each time. Stop iterating when the maximum number of iterations is reached. Output the final particle swarm state. Select the classification parameter with the smallest objective function value from the final particle swarm state as the optimal solution. ;
[0113] Based on the feature vectors of abnormal scenarios, the optimal solution is used. Calculate the classification score using the following formula:
[0114] in, Let m be the classification score of the m-th type of abnormality. These correspond to mechanical failures, electrical failures, operational abnormalities, and environmental interference, respectively. The m-th column of the optimal classification boundary parameters,
[0115] This represents the feature vector of the nth abnormal scene in the set of abnormal scenes. The inner product operation measures the degree of matching between the feature vectors of abnormal scenes in the set of abnormal scenes and the boundary of the m-th class.
[0116] The calculated classification scores for different types of anomalies are summarized into a classification score vector s. The probability of the classification score vector s is calculated using the Softmax function, generating a probability distribution vector P. The anomaly type is then calculated using the following formula:
[0117] in, For the predicted anomaly type, Let be the predicted probability of the m-th type of anomaly;
[0118] Set the weight for each exception type, using the following formula:
[0119] in, For the predicted anomaly type The weight, Standard anomaly weights are set based on actual circumstances. and These represent the abnormal weights that are lower and higher than the standard abnormal weights, respectively. Mechanical and electrical faults represent the standard priority, operational abnormalities have the lowest priority (usually having a small impact on the system), and environmental disturbances have the highest priority (such as fires that require emergency response).
[0120] The initial severity scores of the outlier scores in the classification score vector are calculated using the average severity calculation method, and the outlier type weights are then multiplied. Combined with the initial severity score, it serves as the adjusted severity score;
[0121] The predicted anomaly type, adjusted severity score, anomaly scene feature vector, and timestamp are encapsulated as anomaly information and transmitted to edge nodes via the BACnet protocol. The edge nodes map the anomaly type to a specific descriptive label (e.g., c=0 → "mechanical failure, low motor efficiency") and construct an alarm data packet, which is then stored in the master node database.
[0122] High-risk thresholds were set based on rules of thumb. and intermediate risk threshold Use the adjusted severity score to set the alarm level classification rules, formula:
[0123] in, Alarm level, , and The alarm levels are categorized as high-risk, medium-risk, and low-risk. This is the adjusted severity score.
[0124] By initializing particle positions using chaotic mapping on the master node, an efficient search initialization state and training dataset foundation were built. By defining a classification objective function composed of cross-entropy loss and L2 regularization, the dual objectives of accurate anomaly classification and model complexity control were achieved. By using particle positions as classification boundary parameters input to the classification objective function and iteratively updating particle velocity and position using rules such as EPC temperature factor and Euclidean distance factor, an optimization strategy combining efficient global search and local convergence control was implemented. By normalizing the classification score vector using the Softmax function and calculating the probability distribution of each anomaly type, a normalized decision mechanism for multi-class anomaly scenarios was implemented. By assigning priority weights to different anomaly types and using severity calculation combined with classification probability, a functional leap from "category recognition" to "event severity quantification" was achieved. By setting high-risk, medium-risk, and low-risk alarm levels based on practical empirical rules and performing graded calculations according to severity scores, a dynamic and flexible alarm level evaluation system was implemented.
[0125] S3. Define the energy efficiency objective function, use Lagrange decomposition to decompose the subproblems of each device, use gradient descent to output the global initial policy vector, define the smart building task, construct the matrix of comprehensive benefit weights, transform the device and task into a bipartite graph problem, and use the Hungarian KM algorithm to solve it.
[0126] Preferably, the anomaly score, predicted anomaly type, adjusted severity score, node features of the dynamic graph structure, edge weights, and preprocessed energy consumption and environmental data are integrated and normalized to generate a state vector.
[0127] The master node distributes state vectors to edge nodes via the BACnet protocol, and energy efficiency targets are constructed at the edge nodes to maximize the ratio of performance to energy consumption, using the formula:
[0128] in, For edge nodes l Energy efficiency (performance / energy consumption, a general indicator). For edge nodes The responsible equipment set For the first The overall efficiency of each device
[0129] For the first The contribution of each device to environmental quality For the first The output of each device is the actual value of the o-th environmental parameter. A collection of environmental parameters. The target value for the o-th environmental parameter is set based on actual needs. The first The efficiency of each device is the ratio of output performance to energy consumption, and recommendations for use are obtained from each device and its manufacturer. Weights for environmental quality
[0130] As a weight for equipment efficiency, For the first q Normalized power of each device;
[0131] Define the power and performance constraints for edge nodes, using the following formula:
[0132] in, Total power allocated to edge nodes and This represents the minimum performance requirements for the equipment. For edge node power constraints, and These are constraints on environmental quality and performance, respectively.
[0133] Local optimization target Given the constraints, we use Lagrange decomposition to create subproblems for each device, as shown in the formula:
[0134] in, Let be the Lagrangian function of the l-th edge node. , and All are Lagrange multipliers, and their initial values are set using the fixed-value method. Let be the Lagrange multiplier of the l-th edge node. For the first The Lagrange multiplier of the environmental quality of each device, For the first The Lagrange multiplier of the efficiency of a device;
[0135] Subproblem definition: For each device Optimize the sub-Lagrange function, formula:
[0136] in, For the l-th edge node in The Lagrangian function of each device, Let be the power allocation coefficient for the l-th edge node, initially set to . ;
[0137] For each device, the power is iteratively updated using gradient descent. , For the first step using gradient descent The next iteration, and through the updated power Calculate environmental quality using the following formula:
[0138] in, The sensitivity coefficient for the o-th environmental parameter is estimated based on the equipment specifications. This represents the power difference between the current iteration number and the previous iteration number.
[0139] The updated equipment performance was calculated using the ratio method, and the overall performance of each updated equipment was calculated using the weighted summation method.
[0140] The efficiency threshold of the equipment is set using a fixed value method. The efficiency threshold of the equipment is compared with the updated comprehensive efficiency. If the updated comprehensive efficiency is less than the efficiency threshold of the corresponding equipment, it means that the equipment is not contributing enough. The equipment switch is updated to the off state to save energy. Otherwise, the equipment switch is updated to the on state.
[0141] For devices whose switches are updated to the "on" state, the updated power is normalized and then divided using the ternary method. The power is divided into three ranges, the updated power is mapped to these three ranges, the mode is selected according to the range, and the power values mapped to these three ranges are quantized as the quantization values of the mode.
[0142] The three ranges are arranged in descending order, from high to low, and are labeled as high performance mode, normal mode and energy-saving mode respectively.
[0143] For devices whose switch is updated to the off state, they are marked as having no mode;
[0144] Based on the updated power, the Lagrange multipliers are updated using the following formula:
[0145] in, The step size for gradient descent is a fixed step size set using the fixed-value method. , and All are the first Lagrange multipliers in the next iteration;
[0146] Once the maximum number of iterations is reached, the iteration stops, the optimal power, switching state, and operating mode of the device are output, and the optimal power, switching state, and operating mode of the device are concatenated into a global initial strategy vector at the master control node.
[0147] By constructing an energy efficiency objective function, we ensure that the maximum system benefits are obtained under energy consumption constraints, achieving a balance between energy saving and performance, and improving the overall energy efficiency ratio of building operation. By setting power and performance constraints and constructing reasonable boundary conditions, we achieve quality control under the premise of energy saving, improve the stability and engineering adaptability of system operation, and ensure that basic operational needs and environmental comfort are met while saving energy. By decomposing the problem into subproblems using Lagrange multiplication, we achieve distributed parallel optimization among multiple devices, improving scheduling efficiency and system convergence. By optimizing device power allocation using gradient descent, we achieve high-precision energy efficiency regulation and enhance the dynamics of control strategies. By judging efficiency thresholds and switching device states, we achieve dynamic energy consumption trimming and improve operational economy. By power segmentation mapping and mode quantization, we achieve controllability of device states and standardization of strategies, improving the execution accuracy and visualization capabilities of the system. By dynamically updating Lagrange multipliers, we achieve self-adjustment of optimization direction, improve the stability of system iterative convergence, ensure that the system optimization process gradually approaches the optimal solution under multiple constraints, and improve the controllability of optimization accuracy and overall system performance.
[0148] Furthermore, based on the manager's preferences, standard forms for the four tasks of smart buildings are defined;
[0149] The four tasks include ventilation, used to regulate air quality (e.g., smoke concentration <20ppm), cooling, used to reduce indoor temperature (e.g., target temperature <25°C), lighting, used to provide indoor illumination (e.g., illuminance >500lx), and entertainment, used to support the functions of entertainment equipment such as conference room multimedia equipment.
[0150] Use an empirical approach to set severity thresholds and define candidate action rules for normal and abnormal scenarios:
[0151] When the predicted anomaly type is environmental disturbance, if the severity score is greater than the severity threshold, the ventilation equipment is forced to be on and the operating mode is high performance, while other equipment is forced to be off. Otherwise, the ventilation equipment is still forced to be on and the operating mode is high performance, while other equipment is in energy-saving mode.
[0152] When the predicted anomaly type is mechanical or electrical fault, if the severity score is greater than the severity threshold, the affected equipment is forcibly shut down, while other equipment continues to perform its tasks; otherwise, the affected equipment is put into energy-saving mode, while other equipment continues to perform its tasks.
[0153] When the predicted anomaly type is operational anomaly, if the severity score is greater than the severity threshold, all devices will perform tasks in energy-saving mode; otherwise, all devices will perform tasks in normal mode.
[0154] Under normal circumstances, all devices perform tasks at optimal power, on / off states, and operating modes.
[0155] Define the overall benefit weight of each device in the task, using the following formula:
[0156] in, Let q be the weight of the overall benefit of the q-th device under the u-th task.
[0157] Let q be the energy consumption weight of the q-th device under the u-th task. This represents the candidate switch state of the q-th device under the u-th task; 0 indicates it is off, and 1 indicates it is on. Let q be the output power of the q-th device under the u-th task. Let q be the maximum output power of the q-th device. The quantization value for the candidate operating mode of the q-th device.
[0158] Let q be the QoS weight of the q-th device under the u-th task, quantifying the degree to which the device output meets the task requirements. Let q be the performance output of the q-th device under the u-th task (e.g., if the target temperature for the task is 25°C and the room temperature is 30°C, then the task requirement is a decrease of 5°C). To achieve a temperature drop of 5°C. For the performance output required by the u-th task,
[0159] Let q be the abnormal interference weight for the q-th device under the u-th task;
[0160] If the device does not support the task. ;
[0161] The comprehensive benefit weight of each device under the task is constructed into a weight matrix, and candidate action sets are generated for normal and abnormal scenarios.
[0162] Each edge node packages its weight matrix and candidate action set into JSON format and transmits it to the master node. The master node aggregates the weight matrices of all edge nodes using the mean aggregation method to obtain the initial global weight. Based on the candidate action set, it performs action constraint weight correction on the initial global weight to obtain the final global weight. The master node then distributes the global weight and candidate action set to each edge node.
[0163] Construct a bipartite graph, and based on global weights, map each pair of devices and tasks to an edge of the bipartite graph. The left node of the bipartite graph is the set of devices, and the right node is the set of tasks.
[0164] Using the device-task compatibility verification method, the type of task to be executed is determined based on the device function. Unreasonable device-task edges are removed (such as lighting equipment performing a cooling task), and the weight of the edge is set to an invalid value (negative infinity).
[0165] If the number of devices is not equal to the number of tasks, virtual nodes are used to supplement them. The graph expansion method is used to add the virtual nodes to the bipartite graph to obtain the updated bipartite graph.
[0166] With the objective function of maximizing global weights and task matching, the formula is:
[0167] in, The objective function is to maximize energy efficiency benefits. Let be the final global weight of the q-th device under the u-th task. Let be the matching variable for the q-th device and the u-th task. This indicates that the q-th device is assigned to the u-th task. This indicates that the q-th device was not assigned the u-th task;
[0168] Set a single allocation constraint: each device can be assigned at most one task, and each task can be assigned at most one device.
[0169] Based on the updated bipartite graph, an empty matching set is set, and the KM Hungarian algorithm is used to match device-task edges to construct an equal subgraph that contains only reasonable device-task edges.
[0170] For devices without matching devices, start visiting the unmatched devices, use the depth-first search algorithm to find augmenting paths in the equal subgraph, update the matching set with the augmenting paths, stop iterating when every device in the matching set has found a task, and output the final matching set;
[0171] The access refers to matching devices and tasks;
[0172] The augmenting path refers to starting from an unmatched device, exploring all edges connected to the task, and if there is an unmatched task, matching the unmatched device with the unmatched task as an augmenting path. If there is no unmatched task, the devices with matched tasks are explored, and the devices with unmatched tasks are used as the starting point for exploration again. If no augmenting path is found after exploring each device, the appropriate device-task edges are adjusted, and an equal subgraph is reconstructed for exploration.
[0173] Each edge node transmits the final matching set to the master node, which then converts the final matching set into device control commands and distributes them to the edge nodes for task allocation.
[0174] By pre-setting four categories of building operation tasks—ventilation, cooling, lighting, and entertainment—based on users' actual needs and preferences, the system achieves functional classification and quantitative management of target parameters for building usage scenarios. Based on this, the system can intelligently determine the degree of fit between current operational needs and equipment status, forming task-driven data perception and execution logic. By introducing empirical methods to set severity thresholds and combining different equipment control strategies with anomaly types (environmental interference, equipment failure, operational anomalies, etc.), a dynamic response mechanism based on intelligent classification and hierarchical control is realized. Furthermore, by constructing a weight function encompassing multiple dimensions such as energy consumption, task responsiveness (QoS), performance output, and abnormal interference, the system achieves a quantitative assessment of the comprehensive performance of equipment under specific tasks. By constructing a matrix of candidate device actions and their comprehensive benefit weights under different scenarios, and packaging and transmitting it locally at the edge node, an edge-cloud collaborative processing mechanism for task control decision-making is realized. By constructing a bipartite graph structure with devices and tasks as two vertex sets, and using a device function adaptation method to remove logically unreasonable matching edges, the initial regularization of the task matching space and semantic legality verification are achieved. By defining a maximum benefit objective function based on global weights and setting "single matching constraints" for devices and tasks, the KM Hungarian algorithm is used to construct an equal subgraph and iteratively solve augmenting paths to ensure the widest matching coverage. Ultimately, this achieves the beneficial effect of optimal resource utilization and improved energy efficiency scheduling under the conditions of limited task quantity and device resources.
[0175] S4. Collect real-time data to perform smart building energy consumption management, and build a visual interface to display and analyze the generated data;
[0176] Preferably, edge nodes collect real-time data, and the master control node analyzes the normal and abnormal conditions of the data. Based on different scenarios (normal scenarios and abnormal scenarios), with the goal of minimizing energy consumption, tasks are executed in order of alarm level, and the final matching set is used to send instructions to the devices controlled by the edge nodes for control.
[0177] By constructing graph models and using graph attention mechanisms, the master control node integrates and analyzes the collected data, identifies abnormal patterns in energy consumption behavior, and divides the current building status into scenarios. This enhances the system's understanding of complex and dynamic energy consumption environments, helping to accurately identify system faults, atypical behaviors, or potential energy waste. By constructing a comprehensive objective function and introducing energy consumption optimization strategies, the system dynamically adjusts the task execution order under different operating scenarios and optimally allocates system resources. This improves the system's intelligent scheduling capabilities and task response flexibility, ensuring building operational safety while pursuing optimal energy efficiency under normal conditions, thereby achieving the optimal balance between energy use and system stability.
[0178] Furthermore, BIM is used to build a visual interface that displays the four areas;
[0179] The four areas include displaying energy consumption distribution in the form of a heat map, the actions of equipment controlled by edge nodes (power, on / off status, and operating status), displaying the location of anomalies, and real-time values of energy consumption and environmental data;
[0180] It provides an interactive interface that allows administrators to manually adjust equipment status and confirm automation recommendations.
[0181] By presenting energy consumption data in the form of a heat map within the building space, the energy density of each area within the building is visually visualized and intuitively understood. The action information of various devices controlled by edge nodes is presented through a visual interface, enabling centralized and transparent management of the operating status of terminal devices. By intuitively marking the specific location of abnormal events on the interface, the integration of anomaly detection and spatial positioning is achieved. By continuously displaying real-time collected values of energy consumption (such as electricity, water, and gas) and environmental data (such as temperature, humidity, and CO2 concentration) on the interface, the holographic perception and trend tracking of the building's operating status are realized. By constructing a human-machine interactive interface, managers are given the ability to intervene manually and the right to confirm intelligent control suggestions, thus realizing a human-machine collaborative mechanism for system control.
[0182] This embodiment also provides a smart building energy consumption data monitoring and management system, including:
[0183] The collection module is used to build a distributed architecture. It collects energy consumption and environmental data for preprocessing, builds a dynamic graph structure, uses the graph attention mechanism GAT to extract the joint features of energy consumption and environmental data, and uses the batch average attention coefficient to weight the Mahalanobis distance of the nodes to obtain the abnormal scene feature vector.
[0184] Define a classification module to define the classification objective function, use the EPC-PSO algorithm for iterative optimization, use the Softmax classifier to classify the feature vectors of abnormal scenes, and calculate the severity of each abnormality type;
[0185] The decomposition and solution module is used to define the energy efficiency objective function, use Lagrange decomposition to subproblems for each device, use gradient descent to output the global initial policy vector, define the smart building task, construct the matrix of comprehensive benefit weights, transform the device and task into a bipartite graph problem, and use the Hungarian KM algorithm to solve it.
[0186] The visualization module is used to collect real-time data for smart building energy management and to build a visual interface to display the generated data.
[0187] This embodiment also provides a computer device applicable to the smart building energy consumption data monitoring and management method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the smart building energy consumption data monitoring and management method proposed in the above embodiment.
[0188] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0189] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the intelligent building energy consumption data monitoring and management method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0190] In summary, this invention improves the accuracy and robustness of anomaly detection, enhances resource allocation efficiency and overall benefits, and strengthens the system's adaptive anomaly response capability by: constructing a distributed architecture, collecting and preprocessing energy consumption and environmental data, building a dynamic graph structure, using the graph attention mechanism GAT to extract joint features of energy consumption and environmental data, and weighting the Mahalanobis distance of nodes using batch average attention coefficients; defining a classification objective function, iteratively optimizing it using the EPC-PSO algorithm, classifying the anomaly scene feature vectors using a Softmax classifier, and calculating the severity of each anomaly type; defining an energy efficiency objective function, using Lagrange decomposition to sub-problems for each device, outputting a global initial policy vector using gradient descent, defining smart building tasks, constructing a matrix of comprehensive benefit weights, transforming devices and tasks into bipartite graph problems, and solving them using the Hungarian KM algorithm; collecting real-time data to perform smart building energy consumption management, and constructing a visual interface to display and analyze the generated data.
[0191] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for monitoring and managing energy consumption data in smart buildings, characterized in that: include, S1. Construct a distributed architecture, collect energy consumption and environmental data for preprocessing, construct a dynamic graph structure, use the graph attention mechanism GAT to extract the joint features of energy consumption and environmental data, use the batch average attention coefficient to weight the Mahalanobis distance of nodes as the anomaly score, normalize the anomaly scores of all nodes, use an empirical method to set an anomaly threshold, use a fixed threshold screening method to screen out nodes with anomaly scores greater than the anomaly threshold, generate an anomaly node set, and transmit it to the master node through the edge nodes; The master node uses a multiplication method to weight the anomaly score onto the feature vector in the received set of anomaly nodes, thus obtaining the anomaly scene feature vector; S2. Define the classification objective function, iteratively optimize it using the EPC-PSO algorithm, classify the feature vectors of abnormal scenes using a Softmax classifier, and calculate the severity of each anomaly type, including: On the master node, the EPC-PSO particle swarm is initialized, and abnormal data in the collected tagged historical energy consumption data and historical environmental data are extracted as historical abnormal datasets. Define a classification objective function, input each initialized particle position as a classification boundary parameter into the classification objective function, calculate the objective function value, select the global optimal particle position for the current iteration, update the velocity and position of each particle using the EPC movement rule, output the global optimal position after reaching the maximum number of iterations, substitute the global optimal position into the classification objective function to obtain the initial individual optimal position, use PSO to update the velocity and position of the initial individual optimal position, calculate the classification score based on the abnormal scene feature vector, generate a classification score vector, use the Softmax function to calculate the probability of the classification score vector, set the anomaly type weight, use the average severity calculation method to calculate the initial severity score of the anomaly score in the classification score vector, and use the multiplication method to calculate the adjusted severity score. Based on rules of thumb, high-risk and medium-risk thresholds are set separately, and alarm level classification rules are set using the adjusted severity score. The velocity of each particle is updated using the EPC movement rule, formula: , in, For particle p in the first... The speed of each iteration Temperature is used as a factor to control the scope of exploration, while a universal value ensures global search capability. To use random values enhances search diversity. The distance factor is based on the Euclidean distance between the particle and the global optimum; a universal value balances the convergence speed. The Euclidean distance is used to measure how close a particle is to the optimal solution. Let be the globally optimal particle position in the c-th iteration, and represent the optimal classification boundary parameters. Let p be the position of particle p in the c-th iteration; S3. Define the energy efficiency objective function, use Lagrange decomposition to decompose the subproblems of each device, use gradient descent to output the global initial policy vector, define the smart building task, construct the matrix of comprehensive benefit weights, transform the device and task into a bipartite graph problem, and use the Hungarian KM algorithm to solve it. The defined energy efficiency objective function includes integrating anomaly scores, predicted anomaly types, adjusted severity scores, node features of the dynamic graph structure, edge weights, and preprocessed energy consumption data and environmental data, and performing normalization processing to generate a state vector. The master node distributes state vectors to edge nodes through the BACnet protocol, and builds energy efficiency targets at the edge nodes to maximize the ratio of performance to energy consumption. S4. Collect real-time data to perform smart building energy consumption management, and build a visual interface to display and analyze the generated data.
2. The smart building energy consumption data monitoring and management method as described in claim 1, characterized in that: S1 includes: The distributed architecture includes edge nodes and master control nodes; The collected energy consumption and environmental data include current, power, energy consumption rate, temperature, humidity, and smoke concentration data. Construct a time-segment data matrix, map each data type in the time-segment data matrix to a node, and use the Pearson correlation coefficient to add edges to the dynamic graph structure; Calculate the overall volatility of edges between nodes with added edges, convert it to a time decay factor using a linear mapping function, calculate the dynamic weights of the edges, construct a dynamic graph structure, and calculate the adjacency matrix. Based on the adjacency matrix and dynamic graph structure, the graph attention mechanism GAT is used at the edge nodes to extract the joint features of energy consumption and environmental variables. We use weighted multi-head attention to calculate the weighted attention score of each pair of nodes, calculate the average attention coefficient of each node, use the ReLU activation function to aggregate the neighbor features for each head, concatenate the feature vectors generated by each head to obtain the feature matrix H, divide the features in the feature matrix H and the average attention coefficient of each node into batches to obtain the batch feature matrix and batch attention coefficient. Calculate the mean and covariance matrix of the feature matrix for each batch, calculate the Mahalanobis distance of each node, use the batch attention coefficient to weight the Mahalanobis distance of each node as the anomaly score, and perform normalization processing. Use a fixed threshold screening method to filter out nodes with anomaly scores greater than the anomaly threshold, generate an anomaly node set, and transmit it to the master node through the edge node. The master node uses a multiplication method to weight the anomaly scores onto the feature vectors in the received set of anomaly nodes, thereby obtaining the anomaly scene feature vectors. All the anomaly scene feature vectors are then used to generate an anomaly scene set.
3. The smart building energy consumption data monitoring and management method as described in claim 2, characterized in that: The defined energy efficiency objective function is decomposed into subproblems for each device using Lagrange multiplication, and a global initial policy vector is output using gradient descent, including: Energy efficiency targets are constructed at edge nodes to maximize the ratio of performance to energy consumption. Power and performance constraints are set for edge nodes. The local optimization targets and constraints are decomposed into subproblems for each device using Lagrange multiplication. For each device, the power is iteratively updated using gradient descent, and the environmental quality is calculated using the updated power. The updated equipment efficiency is calculated using the ratio method, and the overall efficiency of each updated equipment is calculated using the weighted summation method. The efficiency threshold of the equipment is set using the fixed value method. The efficiency threshold of the equipment is compared with the updated overall efficiency to determine the switching status of the equipment. Based on the updated power, the quantization value of the mode is obtained using the mapping method. Based on the updated power, the Lagrange multipliers are updated. After reaching the maximum number of iterations, the optimal power, switching state, and operating mode of the output device are determined, and a global initial policy vector is generated at the master control node.
4. The smart building energy consumption data monitoring and management method as described in claim 3, characterized in that: The definition of smart building tasks involves constructing a matrix of comprehensive benefit weights, transforming equipment and tasks into a bipartite graph problem, and solving it using the Hungarian KM algorithm, including: Define the standard forms of four tasks for smart buildings and the candidate action rules for normal and abnormal scenarios. Set the comprehensive benefit weight of each device under the task and candidate action. Construct a weight matrix of the comprehensive benefit weight of each device. Generate a candidate action set for the candidate actions of normal and abnormal scenarios. The four tasks include ventilation, which is used to regulate air quality; cooling, which is used to reduce indoor temperature; lighting, which is used to provide indoor illumination; and entertainment, which is used to support the functions of entertainment equipment. Each edge node transmits its weight matrix and candidate action set to the master node. The master node aggregates the weight matrices of all edge nodes using the mean aggregation method to obtain the initial global weight. Based on the candidate action set, the initial global weight is corrected by action constraint weights to obtain the final global weight. The master node then distributes the global weight and candidate action set to each edge node. Based on global weights, a bipartite graph is constructed. Using a device-task adaptability verification method, unreasonable device-task edges are removed. Virtual nodes are used to supplement nodes where the number of devices is not equal to the number of tasks. The virtual nodes are then added to the bipartite graph using a graph expansion method to obtain the updated bipartite graph. With the objective function of maximizing global weight and task matching, a single-match constraint is set; Based on the updated bipartite graph, an empty matching set is set, and the KM Hungarian algorithm is used to match device-task edges, outputting the final matching set. Each edge node transmits the final matching set to the master node, which then converts the final matching set into device control commands and distributes them to the edge nodes for task allocation.
5. The smart building energy consumption data monitoring and management method as described in claim 4, characterized in that: The collection of real-time data for smart building energy management includes: Edge nodes collect real-time data, and the master control node analyzes the normal and abnormal conditions of the data. Based on different scenarios, with the goal of minimizing energy consumption, tasks are executed in order of alarm level, and the final matching set is used to send instructions to the devices controlled by the edge nodes for control.
6. The smart building energy consumption data monitoring and management method as described in claim 5, characterized in that: The process of constructing a visual interface to display and analyze the generated data includes: Use BIM to build a visual interface that displays four areas; It provides an interactive interface that allows administrators to manually adjust equipment status and confirm automation recommendations.
7. A smart building energy consumption data monitoring and management system, based on the smart building energy consumption data monitoring and management method according to any one of claims 1 to 6, characterized in that: include, The collection module is used to build a distributed architecture. It collects energy consumption and environmental data for preprocessing, builds a dynamic graph structure, uses the graph attention mechanism GAT to extract the joint features of energy consumption and environmental data, and uses the batch average attention coefficient to weight the Mahalanobis distance of the nodes to obtain the abnormal scene feature vector. Define a classification module to define the classification objective function, use the EPC-PSO algorithm for iterative optimization, use the Softmax classifier to classify the feature vectors of abnormal scenes, and calculate the severity of each abnormality type; The decomposition and solution module is used to define the energy efficiency objective function, use Lagrange decomposition to subproblems for each device, use gradient descent to output the global initial policy vector, define the smart building task, construct the matrix of comprehensive benefit weights, transform the device and task into a bipartite graph problem, and use the Hungarian KM algorithm to solve it. The visualization module is used to collect real-time data for smart building energy management and to build a visual interface to display the generated data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the smart building energy consumption data monitoring and management method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the smart building energy consumption data monitoring and management method according to any one of claims 1 to 6.