An intelligent energy consumption model construction system and method based on artificial intelligence

By integrating multi-source data and constructing a dynamic energy consumption relationship graph based on Transformer and graph neural networks, the shortcomings of existing energy management systems in terms of data integration, real-time response, and security are addressed, achieving efficient energy management and cross-scenario adaptation.

CN120781648BActive Publication Date: 2026-03-13EXANDS INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing energy management systems have significant shortcomings in multi-source data integration and semantic fusion. They cannot respond to equipment failures and changes in regional functions in real time, have insufficient hierarchical collaboration capabilities, and fragmented communication protocols lead to complex system integration and poor real-time performance. They also pose data silo problems and the risk of sensitive information leakage.

Method used

It employs an IoT multi-source data acquisition module, a data cleaning and spatiotemporal calibration module, a multi-source data semantic fusion module, a dynamic energy consumption relationship graph construction module, and an edge-cloud collaborative deployment module. Through Transformer neural networks and graph neural networks, it achieves deep fusion and dynamic modeling of multi-source data, constructs a hierarchical decision-making architecture, and ensures data security and real-time response.

Benefits of technology

It achieves deep fusion and dynamic response of multi-source data, improves the semantic expression capability of data features, ensures the real-time performance and security of the system, reduces model migration costs, and supports cross-scenario model adaptation and data privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120781648B_ABST
    Figure CN120781648B_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent energy consumption model construction system and method based on artificial intelligence, belonging to the field of artificial intelligence technology. The system includes multi-source data acquisition from the Internet of Things, data cleaning and spatiotemporal calibration, multi-source data semantic fusion, dynamic energy consumption relationship graph construction, intelligent decision engine, and edge-cloud collaborative deployment module. It fuses multi-source data through the Transformer multi-head self-attention mechanism, constructs a dynamic energy consumption relationship graph using a graph neural network, and combines an edge-cloud hierarchical decision architecture to achieve dynamic energy consumption modeling and intelligent control. The method includes data acquisition and standardization, cleaning and calibration, semantic fusion, graph modeling, hierarchical decision-making, and collaborative execution. This invention solves the problems of insufficient data integration and static models in traditional systems, improving the accuracy, real-time performance, and global optimization capabilities of energy consumption management. It is applicable to scenarios such as smart buildings, significantly improving energy efficiency and ensuring data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically to an intelligent energy consumption model construction system and method based on artificial intelligence. Background Technology

[0002] Existing energy management systems have significant shortcomings in multi-source data integration and semantic fusion. On the one hand, the lack of unified sensor and device interface protocols (such as the coexistence of Modbus and MQTT) leads to prominent data silos, requiring significant resources for preprocessing. On the other hand, traditional data stitching or rule engines cannot capture the nonlinear relationships between weather, human activity, and equipment status, and manually designed feature engineering struggles to uncover cross-domain dependencies such as "environmental parameters - equipment energy consumption," limiting feature representation capabilities. Furthermore, most systems employ fixed-topology physical models or historical statistical models, failing to respond in real-time to dynamic events such as equipment failures and changes in regional functions. Global retraining mechanisms are time-consuming and wasteful of computational resources, making it difficult to quantify the real-time correlation strength between devices and regions.

[0003] At the decision-making mechanism and model deployment level, traditional systems face the challenge of insufficient layered collaboration capabilities. Local control modes lack a global perspective, which may lead to cross-regional energy consumption imbalances (such as temperature regulation in a single area causing overall load fluctuations), while centralized cloud-based decision-making has significant delays (such as cross-floor collaborative strategy generation requiring minute-level response), making it unable to cope with real-time scenarios such as personnel movement and sudden equipment failures. At the same time, the lack of lightweight model compression technology makes it difficult for edge devices to run complex AI models, centralized training requires uploading raw data, posing a risk of leakage of sensitive information such as personnel activity trajectories and equipment operation details, and models need to be retrained across different building scenarios (such as from office buildings to shopping malls), resulting in high migration costs and poor versatility.

[0004] Fragmented communication protocols and real-time deficiencies further constrain system performance. Proprietary protocols from different vendors lead to complex system integration, insufficient data transmission reliability, and network fluctuations in industrial scenarios may cause command loss. Real-time control commands (such as emergency shutdowns due to equipment failure) may trigger cascading energy consumption anomalies due to communication delays, failing to meet the stringent requirements of building energy management for real-time performance and stability.

[0005] Based on the above problems, this invention proposes an intelligent energy consumption model construction system and method based on artificial intelligence. Summary of the Invention

[0006] The purpose of this invention is to provide an intelligent energy consumption model construction system and method based on artificial intelligence to solve the problems raised in the prior art.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] An AI-based intelligent energy consumption model construction system includes an IoT multi-source data acquisition module, a data cleaning and spatiotemporal calibration module, a multi-source data semantic fusion module, a dynamic energy consumption relationship graph construction module, an intelligent decision engine module, and an edge-cloud collaborative deployment module. The IoT multi-source data acquisition module collects weather data, indoor environmental parameters, device operating status, and historical energy consumption data in real time through sensors, smart meters, and device API interfaces, providing raw input to the data cleaning and spatiotemporal calibration module. The data cleaning and spatiotemporal calibration module is responsible for detecting outliers in the raw data, calibrating cross-device timestamps, and repairing missing values, then processing the raw data into structured time-series data. The multi-source data semantic fusion module, based on the multi-head self-attention mechanism of the Transformer neural network, generates data containing spatiotemporal features and other parameters. The fusion feature vectors of coupling relationships and environmental impact weights are used as the initial node attributes of the dynamic energy consumption graph construction module. This module, based on a graph neural network, abstracts devices and physical areas as nodes, calculates edge weights between nodes through graph convolution, and integrates a time-aware incremental update algorithm. When devices malfunction or regional functions change, the associated subgraphs are locally reconstructed. The intelligent decision engine module, based on a dynamic graph structure, constructs a two-layer decision mechanism: the edge layer adjusts the operating parameters of individual regions or devices in real time based on subgraph features, while the cloud layer generates cross-regional collaborative strategies through model predictive control algorithms. The edge-cloud collaborative deployment module is used to construct a hierarchical computing architecture. The edge layer deploys a lightweight graph neural network model to process local data and execute edge layer instructions, while the cloud layer runs a complete model to integrate all building data and generate global strategies.

[0009] The IoT multi-source data acquisition module includes a data acquisition unit and a protocol adaptation unit;

[0010] The data acquisition unit is equipped with temperature and humidity sensors, light sensors, CO2 concentration sensors, smart meters, and cameras; it collects real-time weather data, indoor environmental parameters, equipment operating status, and historical energy consumption data for various areas of the building, covering three types of data sources: environmental, equipment, and energy consumption.

[0011] The protocol adaptation unit develops a protocol parser. For the Modbus protocol, it uses serial communication and Ethernet interface to parse data frames and extract the numerical data corresponding to the register address. For the MQTT protocol, it obtains messages by subscribing to specified topics, parses the JSON format message body, and uniformly converts the two types of protocol data into XML format data containing timestamps, device identifiers, parameter names, and parameter values. The timestamps adopt the ISO 8601 standard format, and the parameter values ​​are uniformly of floating-point type. This allows the original data to be output to the multi-source data cleaning and spatiotemporal calibration module in a standardized form with fixed field structure and consistent data type.

[0012] The data cleaning and spatiotemporal calibration module includes an anomaly detection unit, a time calibration unit, and a missing value repair unit.

[0013] The anomaly detection unit uses a two-layer detection mechanism to divide the original data into univariate data and multivariate data. First, based on the 3σ rule, the univariate data is initially screened by calculating the mean and standard deviation of each parameter. Data that deviates from the mean by more than 3 times the standard deviation are marked as suspected outliers. For multivariate correlated data, the isolated forest algorithm is used to construct an anomaly detection model. By calculating the path length of data points in the random forest, nonlinear anomaly patterns are identified. Finally, a dataset containing normal / anomaly labels is generated to provide a basis for subsequent data repair.

[0014] The time calibration unit is based on NTP service and obtains standard timestamps from the unified time server within the building to synchronize and calibrate the timestamps of each device in the original data. Specifically, it first identifies the original format of the data timestamps and unifies them to the ISO 8601 standard format through a format conversion function. Then, it performs minute-level alignment on the cross-device data and normalizes the timestamps of all data points within the same minute to the start time of that minute.

[0015] The missing value repair unit uses a bidirectional LSTM neural network to construct a missing value repair model for the dataset after anomaly detection. Specifically, the data is divided into independent sequences according to device and parameter type. The input sequence is taken as five valid data points before and after the missing point. The bidirectional LSTM network extracts forward and backward features, and the predicted value of the missing point is output through a fully connected layer. For missing points at the beginning or end of the sequence, forward padding and backward padding are performed respectively. The repaired dataset is formed into a two-dimensional table with timestamp as index and device identifier and parameter name as columns. It is associated with spatial regions through field mapping rules and output to the multi-source data semantic fusion module as temporal feature input.

[0016] The multi-source data semantic fusion module includes a feature encoding unit, a multi-head attention unit, and a fusion output unit;

[0017] The feature encoding unit converts structured time-series data into numerical embedding vectors suitable for Transformer processing, while also assigning spatiotemporal location information to the data.

[0018] Specifically, feature encoding is divided into time encoding, device and parameter feature encoding, and location information encoding. For time feature encoding, the timestamp is decomposed into periodic features through Fourier transform and converted into a time embedding vector E of dimension T. t Each element corresponds to a sine / cosine function value at a different time granularity, as shown in the following formula:

[0019]

[0020] Where i is the embedding vector dimension index, and timestamp is the standardized timestamp value;

[0021] For device and parameter feature encoding, dictionary mappings are established for device identifiers and parameter names respectively, using an embedding matrix. and Convert to a device embedding vector E of dimension D d and parameter embedding vector E p Among them, V d V represents the total number of device types. p W represents the total number of parameter types. d An embedding matrix representing device type maps discrete device identifiers to continuous vector representations; W p The embedding matrix represents the parameter type, mapping discrete parameter names to continuous vector representations; D represents the dimension of the target embedding vector.

[0022] For location information encoding, a spatial location embedding vector E is generated using the area coordinates (x, y) of the building floor plan. s A linear mapping is used to convert the coordinate values ​​into a vector of dimension D;

[0023] Finally, the time, device, parameter, and spatial embedding vectors are added element-wise to obtain the final input vector X, which is then input into the multi-head attention unit, as shown in the following formula:

[0024] X = E t +E d +E p +E s ;

[0025] The multi-head attention unit uses the Transformer's multi-head self-attention mechanism to calculate the dynamic weights of multi-source data such as weather data, personnel activity data, and equipment status data, and to mine cross-domain dependencies.

[0026] Specifically: First, the input vector X is decomposed into h parallel subspaces, hereinafter referred to as heads, and attention weights are calculated independently for each head; for the k-th head, a query vector is generated through a linear transformation. key vector value vector in, All are learnable weight matrices; then, within each head, the similarity between the query and the key is calculated through a dot product, and the attention weight α is obtained after scaling and normalization. k The calculation formula is as follows:

[0027]

[0028] Where, dk The vector dimension for a single head. The scaling factor is used to stabilize the gradient, and T represents the transpose of the matrix.

[0029] Finally, the single-head output Z is obtained by weighted summation of the value vectors according to the attention weights. k The calculation formula is as follows:

[0030] Z k =α k V k ;

[0031] The outputs of h heads are then concatenated to form the multi-head attention result Z, calculated using the following formula:

[0032] Z = Concat(Z1, Z2, ..., Z) h );

[0033] The fusion output unit integrates the multi-head attention results to generate a fusion feature vector containing spatiotemporal features, device coupling relationships, and environmental influence weights, which serves as the initial attribute of the nodes in the dynamic energy consumption graph construction module.

[0034] Specifically: First, the multi-head attention result Z is input into a two-layer fully connected feedforward network FFN, and high-level semantic features are extracted using the non-linear activation function ReLU. The calculation formula is as follows:

[0035] F=FFN(Z)=σ(ZW1+b1)W2+b2;

[0036] Where W1 and W2 are weight matrices, b1 and b2 are bias vectors, and o' is the activation function;

[0037] Then, the output dimension is adjusted to the node attribute dimension N required by the dynamic energy consumption graph construction module through linear transformation, generating the final fused feature vector F. final ∈R N Each element corresponds to one attribute of the node.

[0038] The dynamic energy consumption graph construction module includes a graph architecture initialization unit, a graph convolution calculation unit, and a dynamic update unit;

[0039] The graph architecture initialization unit is used to abstract physical entities within the building into nodes of a graph structure, and initialize the edges between nodes based on spatial location and physical connection to form the basic frame of the energy consumption relationship graph.

[0040] Specifically: The physical entities within a building are abstracted as nodes in a graph structure, with nodes divided into device nodes and region nodes; the device nodes correspond to specific equipment within the building, including but not limited to air conditioning, lighting, and elevators, and the node attributes are the fused feature vector F output by the multi-source data semantic fusion module.final This includes information such as device type, real-time power, and historical energy consumption patterns. The regional nodes correspond to physical areas within a building, including but not limited to floors, rooms, and corridors. Node attributes include spatial coordinates (x, y), area, and functional type, obtained through building information modeling and IoT device deployment locations. Then, edges are established based on the installation relationship between devices and regions, with edge weights initialized to 1 to represent the basic energy consumption impact. Next, edges are established for adjacent regional nodes, with edge weights initialized based on the reciprocal of the spatial distance to characterize the transmission effect of environmental parameters between regions. Finally, the output graph structure G0 = (V, E0) is shown, where V is the set of nodes and E0 is the set of initialized edges.

[0041] The graph convolution calculation unit uses graph convolution operations of graph neural networks to update node attributes and calculate edge weights by utilizing fused features, thereby quantifying the energy consumption correlation strength between devices and regions.

[0042] Specifically: First, a graph convolutional network algorithm is used to iteratively update node features through neighborhood information aggregation and nonlinear transformation, as shown in the following formula:

[0043]

[0044] Among them, H (l) Let F be the node feature matrix of the l-th layer, initially formed by the fused feature matrix F. final ; Let A be the normalized adjacency matrix, D be the original adjacency matrix, and W be the degree matrix. (l) is the learnable weight matrix of the l-th layer, optimized through backpropagation; o' is the activation function used to introduce nonlinearity;

[0045] Then, the edge weight e is calculated based on the feature similarity of adjacent nodes. ij The formula is as follows:

[0046]

[0047] Where h i ,h j Let i be the feature vectors of nodes i and j, and let the edge weights reflect the correlation between their energy consumption patterns.

[0048] Finally, the updated graph structure G = (V, E) is output, where E represents the set of edges containing dynamic weights.

[0049] The dynamic update unit is used to monitor equipment failures and regional function change events in real time, trigger a time-aware incremental update algorithm, and locally reconstruct the node attributes and edge weights of the associated subgraph.

[0050] Specifically: First, real-time event monitoring is performed. For equipment failures, equipment status data is acquired through an IoT multi-source data acquisition module. When a failure is detected, the corresponding node is marked as faulty. For area changes, the functional attributes of area nodes are updated by receiving area usage adjustment instructions through the building management system. Then, an incremental update algorithm is used to determine the set of affected nodes based on the event type and extract the corresponding subgraph. For faulty equipment nodes, missing values ​​are filled using historical data and characteristics of similar equipment; for nodes in functionally changed areas, their edge weights with adjacent nodes are recalculated; then, graph convolution is performed only on the affected subgraph G′ to update node features and edge weights; finally, the updated dynamic graph structure G is output. updated It is synchronized to the intelligent decision engine module as the latest state space.

[0051] The intelligent decision engine module includes an edge decision unit, a cloud optimization unit, and a strategy output unit;

[0052] The edge decision unit is responsible for deploying a lightweight reinforcement learning model, which generates device operating parameter adjustment instructions in real time based on the subgraph features in the dynamic graph structure.

[0053] Specifically: For the model architecture, a Q-Learning model is adopted, and the state space is the feature vector h of the subgraph nodes. i The action space consists of adjustable parameters of the device; then, the current subgraph is obtained from the dynamic energy consumption graph construction module. Extract target node features h i As state s t Then, the model predicts action a. t The calculation formula is as follows:

[0054] a t =arg max a Q(s t , a; θ);

[0055] Where Q is the action value function and θ is the model parameter;

[0056] Finally, the control parameters corresponding to the output action are sent to the strategy output unit.

[0057] The cloud-based optimization unit is used to run the complete reinforcement learning model, combined with the model prediction and control algorithm, based on the global graph structure G. updated Generate cross-regional collaboration strategies;

[0058] Specifically: First, the entire building structure is encoded into a state vector S = (h1, h2, ..., h n ); where h iThe device / region node features include spatiotemporal characteristics and energy consumption correlation weights; then, a prediction model based on a graph neural network is used to predict the state evolution in the next T steps, as shown in the following formula:

[0059] S t+1:T =GNN(S t A);

[0060] Where A is the adjacency matrix;

[0061] Then, the objective is optimized by minimizing the weighted sum of energy consumption cost and comfort deviation, as shown in the following formula:

[0062]

[0063] Wherein, is the control sequence for the next T steps; E k To predict energy consumption, calculations are performed by aggregating edge weights within the graph structure; ComfDeviation i (k) represents the comfort deviation of region i; is the weighting coefficient, which can be configured through the cloud interface;

[0064] The strategy output unit is responsible for converting the decision results of the edge layer and the cloud layer into device-executable protocol instructions and sending them to the edge-cloud collaborative deployment module;

[0065] Specifically: First, the actions output by the lightweight model are converted into register write instructions in the Modbus protocol. Then, the control sequences optimized by MPC are converted into policy files in JSON format and pushed to edge nodes via the MQTT protocol. Finally, a unified instruction format specification is defined, including but not limited to fields such as device identifier, parameter name, target value, and execution time window, and it is ensured that the device identifier in the instruction corresponds one-to-one with the node ID in the dynamic energy consumption relationship graph.

[0066] The edge-cloud collaborative deployment module includes an edge computing unit, a cloud central unit, and a communication interaction unit;

[0067] The edge computing unit is responsible for deploying a lightweight graph neural network model compressed using knowledge distillation technology, and completing local data preprocessing, subgraph feature extraction, and edge layer decision execution at the edge nodes;

[0068] Specifically: First, knowledge distillation technology is used to transfer the core knowledge of the Transformer and graph neural network combined model to a lightweight edge model. Then, the raw data collected by the Internet of Things is normalized by calculating the mean and standard deviation of the data to convert the raw values ​​into feature values ​​of a standard scale. Next, based on the local subgraph structure output by the dynamic energy consumption relationship graph construction module, the correlation features between devices and regional nodes in the subgraph are extracted through the convolution operation of the graph neural network to form a subgraph feature vector for edge layer decision-making. Finally, edge layer instructions are received from the intelligent decision engine module and converted into control signals that can be recognized by the device through the device driver interface to execute local device regulation in real time.

[0069] The cloud-based central unit is used to run complete Transformer and graph neural network models, integrate data from the entire building and multiple locations, and achieve global model training and cross-scene transfer through federated learning technology.

[0070] Specifically: Global data integration collects subgraph feature vectors uploaded by each edge node, and integrates building information model and historical energy consumption data to construct a global energy consumption relationship graph covering all building equipment and regional relationships, thereby enhancing the model's ability to learn overall energy consumption patterns; Federated learning initializes the global model in the cloud first, and then each edge node independently conducts model training based on local data, only uploading gradient update information of model training to the cloud without transmitting the original data. The cloud completes the global model parameter update by aggregating the gradient information of all edge nodes and distributes the updated model to the edge nodes; Cross-scene migration adapts to different building types by adjusting parameters in the model related to regional functions and equipment types to achieve adaptation to new scenarios;

[0071] The communication interaction unit establishes a two-way communication channel between the edge node and the cloud server based on the MQTT protocol, realizing real-time interaction between subgraph feature uploading and global policy distribution;

[0072] Specifically: The MQTT protocol is adopted, and topics are defined for data interaction; then, the JSON format for data interaction is unified, and the subgraph feature message includes the edge node ID, subgraph ID and feature vector data; the global policy message includes the policy ID, device identifier, control parameters and target value; finally, real-time interaction between subgraph feature uploading and global policy distribution is realized through bidirectional channels.

[0073] An intelligent construction method for energy consumption models based on artificial intelligence includes the following steps:

[0074] S1. Real-time collection of weather data, indoor environmental parameters, equipment operating status and historical energy consumption data through sensors, smart meters and device API interfaces. After parsing by Modbus and MQTT protocols, the data is uniformly converted into standardized XML format data containing timestamps, device identifiers, parameter names and parameter values.

[0075] S2. The 3o' rule and the isolated forest algorithm are used to detect outliers in the original data. Cross-device timestamps are calibrated and normalized based on the NTP protocol. Missing values ​​are repaired by interpolation using a bidirectional LSTM neural network, generating time-aligned and spatially correlated structured time-series data.

[0076] S3. Through Fourier transform, embedding matrix mapping and linear transformation, the structured time series data is encoded into an embedding vector containing time, device, parameter and spatial features. Then, the multi-head self-attention mechanism of the Transformer neural network is used to generate a feature vector that integrates spatiotemporal features, device coupling relationship and environmental influence weights.

[0077] S4. Abstract devices and physical regions into graph nodes, initialize edge weights based on spatial location and physical connection, update node attributes and calculate edge weights through graph convolution operations, integrate a time-aware incremental update algorithm, and locally reconstruct the associated subgraph when devices fail or regional functions change.

[0078] S5: The edge layer is based on dynamic graph subgraph features and uses a lightweight reinforcement learning model to adjust the operating parameters of a single region or device in real time; the cloud layer is based on a global graph structure and uses a model predictive control algorithm to generate cross-regional collaborative strategies, thus constructing a two-layer decision-making mechanism.

[0079] S6. Edge nodes convert decision commands into Modbus protocol commands for execution and upload subgraph features to the cloud. The cloud integrates all building data through federated learning to optimize model parameters and distributes the updated model to edge nodes, achieving a collaborative closed loop.

[0080] Compared with the prior art, the beneficial effects of the present invention are:

[0081] 1. Deep Fusion of Multi-Source Data: Through a unified protocol parsing module, heterogeneous data such as Modbus and MQTT are converted into standardized formats, integrating multi-dimensional data sources such as weather, environment, and equipment status. By utilizing the multi-head self-attention mechanism of the Transformer neural network, the spatiotemporal correlation and cross-domain dependency between data are deeply explored, eliminating the problem of data silos, improving the semantic expression ability of data features, and providing structured and semantic high-quality input for subsequent energy consumption modeling.

[0082] 2. Real-time Response of Dynamic Graph Modeling: A dynamic energy consumption relationship graph is constructed based on graph neural networks. Devices and physical areas are abstracted as nodes. The energy consumption correlation strength between nodes is quantified through graph convolution operations, and a time-aware incremental update algorithm is integrated. When a device fails or the function of an area changes, only the node attributes of the affected local subgraph are updated and the edge weights are reconstructed, rather than global retraining. This significantly improves the model's response speed and computational efficiency to dynamic changes in the building environment, ensuring that the energy consumption model reflects the real scene in real time.

[0083] 3. Layered Decision-Making and Communication Security: A layered decision-making architecture for edge-cloud collaboration is constructed. The edge layer deploys lightweight models that adjust individual device or region parameters in real time based on subgraph features, achieving millisecond-level local response. The cloud layer generates cross-regional collaborative strategies through a global graph structure and model predictive control algorithms, balancing overall energy consumption and user comfort. Knowledge distillation compresses the edge model, and federated learning enables global cloud training, ensuring data privacy while supporting cross-scenario model migration. The communication interaction unit establishes a reliable channel based on the MQTT protocol, ensuring real-time issuance of decision commands and data feedback, improving system stability and security. Attached Figure Description

[0084] Figure 1 This is an organizational structure diagram of an intelligent energy consumption model construction system based on artificial intelligence, according to the present invention.

[0085] Figure 2 This is a flowchart of the intelligent construction system for energy consumption models based on artificial intelligence, as described in this invention. Detailed Implementation

[0086] The technical solutions of 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.

[0087] Example: Figures 1-2 As shown, the present invention provides a technical solution.

[0088] An AI-based intelligent energy consumption model construction system includes an IoT multi-source data acquisition module, a data cleaning and spatiotemporal calibration module, a multi-source data semantic fusion module, a dynamic energy consumption relationship graph construction module, an intelligent decision engine module, and an edge-cloud collaborative deployment module. The IoT multi-source data acquisition module collects weather data, indoor environmental parameters, device operating status, and historical energy consumption data in real time through sensors, smart meters, and device API interfaces, providing raw input to the data cleaning and spatiotemporal calibration module. The data cleaning and spatiotemporal calibration module is responsible for detecting outliers in the raw data, calibrating cross-device timestamps, and repairing missing values, then processing the raw data into structured time-series data. The multi-source data semantic fusion module, based on the multi-head self-attention mechanism of the Transformer neural network, generates data containing spatiotemporal features and other parameters. The fusion feature vectors of coupling relationships and environmental impact weights are used as the initial node attributes of the dynamic energy consumption graph construction module. This module, based on a graph neural network, abstracts devices and physical areas as nodes, calculates edge weights between nodes through graph convolution, and integrates a time-aware incremental update algorithm. When devices malfunction or regional functions change, the associated subgraphs are locally reconstructed. The intelligent decision engine module, based on a dynamic graph structure, constructs a two-layer decision mechanism: the edge layer adjusts the operating parameters of individual regions or devices in real time based on subgraph features, while the cloud layer generates cross-regional collaborative strategies through model predictive control algorithms. The edge-cloud collaborative deployment module is used to construct a hierarchical computing architecture. The edge layer deploys a lightweight graph neural network model to process local data and execute edge layer instructions, while the cloud layer runs a complete model to integrate all building data and generate global strategies.

[0089] The IoT multi-source data acquisition module includes a data acquisition unit and a protocol adaptation unit;

[0090] The data acquisition unit is equipped with temperature and humidity sensors, light sensors, CO2 concentration sensors, smart meters, and cameras; it collects real-time weather data, indoor environmental parameters, equipment operating status, and historical energy consumption data for various areas of the building, covering three types of data sources: environmental, equipment, and energy consumption.

[0091] The protocol adaptation unit develops a protocol parser. For the Modbus protocol, it uses serial communication and Ethernet interface to parse data frames and extract the numerical data corresponding to the register address. For the MQTT protocol, it obtains messages by subscribing to specified topics, parses the JSON format message body, and uniformly converts the two types of protocol data into XML format data containing timestamps, device identifiers, parameter names, and parameter values. The timestamps adopt the ISO 8601 standard format, and the parameter values ​​are uniformly of floating-point type. This allows the original data to be output to the multi-source data cleaning and spatiotemporal calibration module in a standardized form with fixed field structure and consistent data type.

[0092] The data cleaning and spatiotemporal calibration module includes an anomaly detection unit, a time calibration unit, and a missing value repair unit.

[0093] The anomaly detection unit uses a two-layer detection mechanism to divide the original data into univariate data and multivariate data. First, based on the 3σ rule, the univariate data is initially screened by calculating the mean and standard deviation of each parameter. Data that deviates from the mean by more than 3 times the standard deviation are marked as suspected outliers. For multivariate correlated data, the isolated forest algorithm is used to construct an anomaly detection model. By calculating the path length of data points in the random forest, nonlinear anomaly patterns are identified. Finally, a dataset containing normal / anomaly labels is generated to provide a basis for subsequent data repair.

[0094] The time calibration unit is based on NTP service and obtains standard timestamps from the unified time server within the building to synchronize and calibrate the timestamps of each device in the original data. Specifically, it first identifies the original format of the data timestamps and unifies them to the ISO 8601 standard format through a format conversion function. Then, it performs minute-level alignment on the cross-device data and normalizes the timestamps of all data points within the same minute to the start time of that minute.

[0095] The missing value repair unit uses a bidirectional LSTM neural network to construct a missing value repair model for the dataset after anomaly detection. Specifically, the data is divided into independent sequences according to device and parameter type. The input sequence is taken as five valid data points before and after the missing point. The bidirectional LSTM network extracts forward and backward features, and the predicted value of the missing point is output through a fully connected layer. For missing points at the beginning or end of the sequence, forward padding and backward padding are performed respectively. The repaired dataset is formed into a two-dimensional table with timestamp as index and device identifier and parameter name as columns. It is associated with spatial regions through field mapping rules and output to the multi-source data semantic fusion module as temporal feature input.

[0096] The multi-source data semantic fusion module includes a feature encoding unit, a multi-head attention unit, and a fusion output unit;

[0097] The feature encoding unit converts structured time-series data into numerical embedding vectors suitable for Transformer processing, while also assigning spatiotemporal location information to the data.

[0098] Specifically, feature encoding is divided into time encoding, device and parameter feature encoding, and location information encoding. For time feature encoding, the timestamp is decomposed into periodic features through Fourier transform and converted into a time embedding vector E of dimension T. t Each element corresponds to a sine / cosine function value at a different time granularity, as shown in the following formula:

[0099]

[0100] Where i is the embedding vector dimension index, and timestamp is the standardized timestamp value;

[0101] For device and parameter feature encoding, dictionary mappings are established for device identifiers and parameter names respectively, using an embedding matrix. and Convert to a device embedding vector E of dimension D d and parameter embedding vector E p Among them, V d V represents the total number of device types. p W represents the total number of parameter types. d An embedding matrix representing device type maps discrete device identifiers to continuous vector representations; W p The embedding matrix represents the parameter type, mapping discrete parameter names to continuous vector representations; D represents the dimension of the target embedding vector.

[0102] For location information encoding, a spatial location embedding vector E is generated using the area coordinates (x, y) of the building floor plan. s A linear mapping is used to convert the coordinate values ​​into a vector of dimension D;

[0103] Finally, the time, device, parameter, and spatial embedding vectors are added element-wise to obtain the final input vector X, which is then input into the multi-head attention unit, as shown in the following formula:

[0104] X = E t +E d +E p +E s ;

[0105] The multi-head attention unit uses the Transformer's multi-head self-attention mechanism to calculate the dynamic weights of multi-source data such as weather data, personnel activity data, and equipment status data, and to mine cross-domain dependencies.

[0106] Specifically: First, the input vector X is decomposed into h parallel subspaces, hereinafter referred to as heads, and attention weights are calculated independently for each head; for the k-th head, a query vector is generated through a linear transformation. key vector value vector in, All are learnable weight matrices; then, within each head, the similarity between the query and the key is calculated through a dot product, and the attention weight α is obtained after scaling and normalization. k The calculation formula is as follows:

[0107]

[0108] Where, dk The vector dimension for a single head. The scaling factor is used to stabilize the gradient, and T represents the transpose of the matrix.

[0109] Finally, the single-head output Z is obtained by weighted summation of the value vectors according to the attention weights. k The calculation formula is as follows:

[0110] Z k =α k V k ;

[0111] The outputs of h heads are then concatenated to form the multi-head attention result Z, calculated using the following formula:

[0112] Z = Concat(Z1, Z2, ..., Z) h );

[0113] The fusion output unit integrates the multi-head attention results to generate a fusion feature vector containing spatiotemporal features, device coupling relationships, and environmental influence weights, which serves as the initial attribute of the nodes in the dynamic energy consumption graph construction module.

[0114] Specifically: First, the multi-head attention result Z is input into a two-layer fully connected feedforward network FFN, and high-level semantic features are extracted using the non-linear activation function ReLU. The calculation formula is as follows:

[0115] F=FFN(Z)=σ(ZW1+b1)W2+b2;

[0116] Where W1 and W2 are weight matrices, b1 and b2 are bias vectors, and o' is the activation function;

[0117] Then, the output dimension is adjusted to the node attribute dimension N required by the dynamic energy consumption graph construction module through linear transformation, generating the final fused feature vector F. final ∈R N Each element corresponds to one attribute of the node.

[0118] The dynamic energy consumption graph construction module includes a graph architecture initialization unit, a graph convolution calculation unit, and a dynamic update unit;

[0119] The graph architecture initialization unit is used to abstract physical entities within the building into nodes of a graph structure, and initialize the edges between nodes based on spatial location and physical connection to form the basic frame of the energy consumption relationship graph.

[0120] Specifically: The physical entities within a building are abstracted as nodes in a graph structure, with nodes divided into device nodes and region nodes; the device nodes correspond to specific equipment within the building, including but not limited to air conditioning, lighting, and elevators, and the node attributes are the fused feature vector F output by the multi-source data semantic fusion module.final This includes information such as device type, real-time power, and historical energy consumption patterns. The regional nodes correspond to physical areas within a building, including but not limited to floors, rooms, and corridors. Node attributes include spatial coordinates (x, y), area, and functional type, obtained through building information modeling and IoT device deployment locations. Then, edges are established based on the installation relationship between devices and regions, with edge weights initialized to 1 to represent the basic energy consumption impact. Next, edges are established for adjacent regional nodes, with edge weights initialized based on the reciprocal of the spatial distance to characterize the transmission effect of environmental parameters between regions. Finally, the output graph structure G0 = (V, E0) is shown, where V is the set of nodes and E0 is the set of initialized edges.

[0121] The graph convolution calculation unit uses graph convolution operations of graph neural networks to update node attributes and calculate edge weights by utilizing fused features, thereby quantifying the energy consumption correlation strength between devices and regions.

[0122] Specifically: First, a graph convolutional network algorithm is used to iteratively update node features through neighborhood information aggregation and nonlinear transformation, as shown in the following formula:

[0123]

[0124] Among them, H (l) Let F be the node feature matrix of the l-th layer, initially formed by the fused feature matrix F. final ; Let A be the normalized adjacency matrix, D be the original adjacency matrix, and W be the degree matrix. (l) is the learnable weight matrix of the l-th layer, optimized through backpropagation; o' is the activation function used to introduce nonlinearity;

[0125] Then, the edge weight e is calculated based on the feature similarity of adjacent nodes. ij The formula is as follows:

[0126]

[0127] Where h i ,h j Let i be the feature vectors of nodes i and j, and let the edge weights reflect the correlation between their energy consumption patterns.

[0128] Finally, the updated graph structure G = (V, E) is output, where E represents the set of edges containing dynamic weights.

[0129] The dynamic update unit is used to monitor equipment failures and regional function change events in real time, trigger a time-aware incremental update algorithm, and locally reconstruct the node attributes and edge weights of the associated subgraph.

[0130] Specifically: First, real-time event monitoring is performed. For equipment failures, equipment status data is acquired through an IoT multi-source data acquisition module. When a failure is detected, the corresponding node is marked as faulty. For area changes, the functional attributes of area nodes are updated by receiving area usage adjustment instructions through the building management system. Then, an incremental update algorithm is used to determine the set of affected nodes based on the event type and extract the corresponding subgraph. For faulty equipment nodes, missing values ​​are filled using historical data and characteristics of similar equipment; for nodes in functionally changed areas, their edge weights with adjacent nodes are recalculated; then, graph convolution is performed only on the affected subgraph G′ to update node features and edge weights; finally, the updated dynamic graph structure G is output. updated It is synchronized to the intelligent decision engine module as the latest state space.

[0131] The intelligent decision engine module includes an edge decision unit, a cloud optimization unit, and a strategy output unit;

[0132] The edge decision unit is responsible for deploying a lightweight reinforcement learning model, which generates device operating parameter adjustment instructions in real time based on the subgraph features in the dynamic graph structure.

[0133] Specifically: For the model architecture, a Q-Learning model is adopted, and the state space is the feature vector h of the subgraph nodes. i The action space consists of adjustable parameters of the device; then, the current subgraph is obtained from the dynamic energy consumption graph construction module. Extract target node features h i As state s t Then, the model predicts action a. t The calculation formula is as follows:

[0134] a t =arg max a Q(s t , a; θ);

[0135] Where Q is the action value function and θ is the model parameter;

[0136] Finally, the control parameters corresponding to the output action are sent to the strategy output unit.

[0137] The cloud-based optimization unit is used to run the complete reinforcement learning model, combined with the model prediction and control algorithm, based on the global graph structure G. updated Generate cross-regional collaboration strategies;

[0138] Specifically: First, the entire building structure is encoded into a state vector S = (h1, h2, ..., h n ); where h iThe device / region node features include spatiotemporal characteristics and energy consumption correlation weights; then, a prediction model based on a graph neural network is used to predict the state evolution in the next T steps, as shown in the following formula:

[0139] S t+1:T =GNN(S t A);

[0140] Where A is the adjacency matrix;

[0141] Then, the objective is optimized by minimizing the weighted sum of energy consumption cost and comfort deviation, as shown in the following formula:

[0142]

[0143] Wherein, is the control sequence for the next T steps; E k To predict energy consumption, calculations are performed by aggregating edge weights within the graph structure; ComfDeviation i (k) represents the comfort deviation of region i; is the weighting coefficient, which can be configured through the cloud interface;

[0144] The strategy output unit is responsible for converting the decision results of the edge layer and the cloud layer into device-executable protocol instructions and sending them to the edge-cloud collaborative deployment module;

[0145] Specifically: First, the actions output by the lightweight model are converted into register write instructions in the Modbus protocol. Then, the control sequences optimized by MPC are converted into policy files in JSON format and pushed to edge nodes via the MQTT protocol. Finally, a unified instruction format specification is defined, including but not limited to fields such as device identifier, parameter name, target value, and execution time window, and it is ensured that the device identifier in the instruction corresponds one-to-one with the node ID in the dynamic energy consumption relationship graph.

[0146] The edge-cloud collaborative deployment module includes an edge computing unit, a cloud central unit, and a communication interaction unit;

[0147] The edge computing unit is responsible for deploying a lightweight graph neural network model compressed using knowledge distillation technology, and completing local data preprocessing, subgraph feature extraction, and edge layer decision execution at the edge nodes;

[0148] Specifically: First, knowledge distillation technology is used to transfer the core knowledge of the Transformer and graph neural network combined model to a lightweight edge model. Then, the raw data collected by the Internet of Things is normalized by calculating the mean and standard deviation of the data to convert the raw values ​​into feature values ​​of a standard scale. Next, based on the local subgraph structure output by the dynamic energy consumption relationship graph construction module, the correlation features between devices and regional nodes in the subgraph are extracted through the convolution operation of the graph neural network to form a subgraph feature vector for edge layer decision-making. Finally, edge layer instructions are received from the intelligent decision engine module and converted into control signals that can be recognized by the device through the device driver interface to execute local device regulation in real time.

[0149] The cloud-based central unit is used to run complete Transformer and graph neural network models, integrate data from the entire building and multiple locations, and achieve global model training and cross-scene transfer through federated learning technology.

[0150] Specifically: Global data integration collects subgraph feature vectors uploaded by each edge node, and integrates building information model and historical energy consumption data to construct a global energy consumption relationship graph covering all building equipment and regional relationships, thereby enhancing the model's ability to learn overall energy consumption patterns; Federated learning initializes the global model in the cloud first, and then each edge node independently conducts model training based on local data, only uploading gradient update information of model training to the cloud without transmitting the original data. The cloud completes the global model parameter update by aggregating the gradient information of all edge nodes and distributes the updated model to the edge nodes; Cross-scene migration adapts to different building types by adjusting parameters in the model related to regional functions and equipment types to achieve adaptation to new scenarios;

[0151] The communication interaction unit establishes a two-way communication channel between the edge node and the cloud server based on the MQTT protocol, realizing real-time interaction between subgraph feature uploading and global policy distribution;

[0152] Specifically: The MQTT protocol is adopted, and topics are defined for data interaction; then, the JSON format for data interaction is unified, and the subgraph feature message includes the edge node ID, subgraph ID and feature vector data; the global policy message includes the policy ID, device identifier, control parameters and target value; finally, real-time interaction between subgraph feature uploading and global policy distribution is realized through bidirectional channels.

[0153] An intelligent construction method for energy consumption models based on artificial intelligence includes the following steps:

[0154] S1. Real-time collection of weather data, indoor environmental parameters, equipment operating status and historical energy consumption data through sensors, smart meters and device API interfaces. After parsing by Modbus and MQTT protocols, the data is uniformly converted into standardized XML format data containing timestamps, device identifiers, parameter names and parameter values.

[0155] S2. The 3o' rule and the isolated forest algorithm are used to detect outliers in the original data. Cross-device timestamps are calibrated and normalized based on the NTP protocol. Missing values ​​are repaired by interpolation using a bidirectional LSTM neural network, generating time-aligned and spatially correlated structured time-series data.

[0156] S3. Through Fourier transform, embedding matrix mapping and linear transformation, the structured time series data is encoded into an embedding vector containing time, device, parameter and spatial features. Then, the multi-head self-attention mechanism of the Transformer neural network is used to generate a feature vector that integrates spatiotemporal features, device coupling relationship and environmental influence weights.

[0157] S4. Abstract devices and physical regions into graph nodes, initialize edge weights based on spatial location and physical connection, update node attributes and calculate edge weights through graph convolution operations, integrate a time-aware incremental update algorithm, and locally reconstruct the associated subgraph when devices fail or regional functions change.

[0158] S5: The edge layer is based on dynamic graph subgraph features and uses a lightweight reinforcement learning model to adjust the operating parameters of a single region or device in real time; the cloud layer is based on a global graph structure and uses a model predictive control algorithm to generate cross-regional collaborative strategies, thus constructing a two-layer decision-making mechanism.

[0159] S6. Edge nodes convert decision commands into Modbus protocol commands for execution and upload subgraph features to the cloud. The cloud integrates all building data through federated learning to optimize model parameters and distributes the updated model to edge nodes, achieving a collaborative closed loop.

[0160] Taking the third-floor office area of ​​a smart office building as an example, the specific implementation process of this invention is illustrated below:

[0161] I. Data Acquisition and Preprocessing

[0162] Temperature and humidity sensors (Modbus protocol), smart meters (MQTT protocol), and cameras are deployed in the three-story office area to collect data in real time. The temperature and humidity sensors upload data every 10 seconds, such as a temperature of 26.5℃ collected at 10:05:32 (Device ID: SENSOR-01, parameter: temperature). The smart meters record the air conditioner power every minute, such as an air conditioner power of 8.2kW detected at 10:05:00 (Device ID: AC-03, parameter: power). The cameras use image recognition to count the number of people, such as a number of people in room 302 of 0.8 people / ㎡ detected at 10:05 (Device ID: CAM-02, parameter: number of people).

[0163] The protocol adaptation unit parses Modbus data frames into numerical data, converts MQTT messages into JSON format, and outputs them as XML data, including timestamps (ISO 8601 format, such as 2025-05-19T10:05:00), device ID, parameter names and values.

[0164] II. Data Cleaning and Semantic Fusion

[0165] Anomaly detection: For univariate data (such as temperature), the mean was calculated to be 24℃ and the standard deviation was 1.2℃. 26.5℃ was marked as normal (not exceeding 3σ, i.e., 27.6℃). For multivariate data (such as population density and air conditioning power), the isolated forest algorithm was used to identify nonlinear anomalies, and no abnormal patterns were found.

[0166] Time calibration: Normalize the timestamps of 10:05:32 and 10:05:48 to 10:05:00 to ensure minute-level alignment.

[0167] Missing value repair: Assuming that the illumination data at 10:06 is missing, the value is predicted to be 350 Lux using the five valid data points before and after (10:01-10:05 and 10:07-10:10) through bidirectional LSTM.

[0168] Time encoding: Convert 10:05 into a periodic vector after Fourier transform;

[0169] Device code: Air conditioner (ID: AC-03) is mapped to a vector [0.2, 0.5, 0.8, 1.1] via an embedding matrix;

[0170] Spatial encoding: The coordinates (3,5) of room 302 are linearly mapped to the vector [0.3,0.5].

[0171] Fusion vector: The sum of time, device, parameter and spatial vectors is input into the Transformer multi-head attention unit to calculate the fusion vector containing spatiotemporal features. For example, the coupling weight between air conditioner and room is 0.75.

[0172] III. Dynamic Graph Modeling and Intelligent Decision Making

[0173] Graph initialization: Abstract air conditioner AC-03 and lighting L-05 are device nodes, and room 302 is a region node. Initial edge weights: the edge weight between AC-03 and room 302 is 1 (physical connection), and the edge weight between room 302 and adjacent room 301 is 0.8 (distance 5 meters, weight = 1 / 5 = 0.2, here we assume the example value is 0.8).

[0174] Graph convolution update: Node features are calculated through neighborhood aggregation. The features of air conditioner AC-03 are updated to [0.3, 0.6, 0.9, 1.2], the cosine similarity with room 302 is 0.92, and the edge weight is updated to 0.92.

[0175] Dynamic update: If AC-03 is detected as faulty at 14:00, the node is marked as faulty, the features are filled using historical data of similar device AC-01, and the edge weight with room 302 is recalculated to 0.4 (the impact of the fault is reduced).

[0176] Edge layer: Detecting that the occupancy density in room 302 has dropped to 0, an instruction is generated through the Q-Learning model to turn off lighting L-05 within 10 seconds (Modbus instruction: write 0 to register 0x0001);

[0177] Cloud layer: At 17:00, based on the global graph structure, predict the overall energy consumption during the off-get off work period and generate a strategy through the MPC algorithm: adjust the set temperature of the three-layer air conditioner from 24℃ to 26℃, which is expected to reduce energy consumption by 12% and control the comfort deviation within ±1℃.

[0178] IV. Edge-Cloud Collaborative Execution

[0179] Upon receiving the instruction, the edge node executes the L-05 shutdown operation at 10:05:10 and uploads subgraph features (such as the subgraph structure after the AC-03 failure) to the cloud. The cloud aggregates the gradients of each edge node through federated learning, updates the global model parameters, and distributes the lightweight model to the edge to optimize subsequent decisions. The entire process achieves a closed loop from data collection to intelligent control, improving the energy efficiency of the office area by more than 30%, with response latency controlled within seconds.

[0180] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. An intelligent energy consumption model construction system based on artificial intelligence, characterized in that: The system comprises an IoT multi-source data acquisition module, a data cleaning and spatiotemporal calibration module, a multi-source data semantic fusion module, a dynamic energy consumption relationship graph construction module, an intelligent decision engine module, and an edge-cloud collaborative deployment module. The IoT multi-source data acquisition module collects weather data, indoor environmental parameters, device operating status, and historical energy consumption data in real time through sensors, smart meters, and device API interfaces, providing raw input to the data cleaning and spatiotemporal calibration module. The data cleaning and spatiotemporal calibration module is responsible for detecting outliers in the raw data, calibrating cross-device timestamps, and repairing missing values, then processing the raw data into structured time-series data. The multi-source data semantic fusion module, based on the multi-head self-attention mechanism of the Transformer neural network, generates data containing spatiotemporal features, device coupling relationships, and environmental influences. The fusion feature vector of the weights serves as the initial node attribute of the dynamic energy consumption graph construction module. This module, based on a graph neural network, abstracts devices and physical regions as nodes, calculates edge weights between nodes through graph convolution, and integrates a time-aware incremental update algorithm. When devices malfunction or regional functions change, the associated subgraph is locally reconstructed. The intelligent decision engine module, based on a dynamic graph structure, constructs a two-layer decision-making mechanism: the edge layer adjusts the operating parameters of individual regions or devices in real time based on subgraph features, while the cloud layer generates cross-regional collaborative strategies through model predictive control algorithms. The edge-cloud collaborative deployment module is used to construct a hierarchical computing architecture. The edge layer deploys a lightweight graph neural network model to process local data and execute edge layer instructions, while the cloud layer runs a complete model to integrate all building data and generate global strategies. The multi-source data semantic fusion module includes a feature encoding unit, a multi-head attention unit, and a fusion output unit; The feature encoding unit converts structured time-series data into numerical embedding vectors suitable for Transformer processing, while also assigning spatiotemporal location information to the data. Specifically, feature encoding is divided into time encoding, device and parameter feature encoding, and location information encoding. For time feature encoding, the timestamp is decomposed into periodic features through Fourier transform and converted into a time embedding vector E of dimension T. t Each element corresponds to a sine / cosine function value at a different time granularity, as shown in the following formula: ; Where i is the embedding vector dimension index, and timestamp is the standardized timestamp value; For device and parameter feature encoding, dictionary mappings are established for device identifiers and parameter names respectively, using an embedding matrix. and Convert to a device embedding vector E of dimension D d and parameter embedding vector E p Among them, V d V represents the total number of device types. p W represents the total number of parameter types. d An embedding matrix representing device type maps discrete device identifiers to continuous vector representations; W p The embedding matrix represents the parameter type, mapping discrete parameter names to continuous vector representations; D represents the dimension of the target embedding vector. For location information encoding, a spatial location embedding vector E is generated using the area coordinates (x, y) of the building floor plan. s A linear mapping is used to convert the coordinate values ​​into a vector of dimension D; Finally, the time, device, parameter, and spatial embedding vectors are added element-wise to obtain the final input vector X, which is then input into the multi-head attention unit, as shown in the following formula: ; The multi-head attention unit uses the Transformer's multi-head self-attention mechanism to calculate the dynamic weights of multi-source data such as weather data, personnel activity data, and equipment status data, and to mine cross-domain dependencies. Specifically: First, the input vector X is decomposed into h parallel subspaces, hereinafter referred to as heads, and attention weights are calculated independently for each head; for the k-th head, a query vector is generated through a linear transformation. key vector value vector ,in, All are learnable weight matrices; then, within each head, the similarity between the query and the key is calculated through a dot product, and the attention weight α is obtained after scaling and normalization. k The calculation formula is as follows: ; Where, d k The vector dimension of a single head. The scaling factor is used to stabilize the gradient, and T represents the transpose of the matrix. Finally, the single-head output Z is obtained by weighted summation of the value vectors according to the attention weights. k The calculation formula is as follows: ; The outputs of h heads are then concatenated to form the multi-head attention result Z, calculated using the following formula: ; The fusion output unit integrates the multi-head attention results to generate a fusion feature vector containing spatiotemporal features, device coupling relationships, and environmental influence weights, which serves as the initial attribute of the nodes in the dynamic energy consumption graph construction module. Specifically: First, the multi-head attention result Z is input into a two-layer fully connected feedforward network FFN, and high-level semantic features are extracted using the non-linear activation function ReLU. The calculation formula is as follows: ; Where W1 and W2 are weight matrices, b1 and b2 are bias vectors, and ơ is the activation function; Then, the output dimension is adjusted to the node attribute dimension N required by the dynamic energy consumption graph construction module through linear transformation, generating the final fused feature vector. Each element corresponds to one attribute of the node.

2. The intelligent energy consumption model construction system based on artificial intelligence according to claim 1, characterized in that: The IoT multi-source data acquisition module includes a data acquisition unit and a protocol adaptation unit; The data acquisition unit is equipped with temperature and humidity sensors, light sensors, CO2 concentration sensors, smart meters, and cameras; it collects real-time weather data, indoor environmental parameters, equipment operating status, and historical energy consumption data for various areas of the building, covering three types of data sources: environmental, equipment, and energy consumption. The protocol adaptation unit develops a protocol parser to parse data frames using serial communication and Ethernet interfaces for the Modbus protocol, and extracts the numerical data corresponding to the register address. For the MQTT protocol, messages are obtained by subscribing to a specified topic, and the JSON-formatted message body is parsed. The two types of protocol data are uniformly converted into XML format data containing timestamps, device identifiers, parameter names, and parameter values. The timestamps adopt the ISO 8601 standard format, and the parameter values ​​are uniformly floating-point types. This allows the original data to be output to the multi-source data cleaning and spatiotemporal calibration module in a standardized form with fixed field structure and consistent data type.

3. The intelligent energy consumption model construction system based on artificial intelligence according to claim 1, characterized in that: The data cleaning and spatiotemporal calibration module includes an anomaly detection unit, a time calibration unit, and a missing value repair unit. The anomaly detection unit uses a two-layer detection mechanism to divide the original data into univariate data and multivariate data. First, it performs preliminary screening of univariate data based on the 3×3 rule, calculates the mean and standard deviation of each parameter, and marks data that deviate from the mean by more than 3 times the standard deviation as suspected outliers. For multivariate correlated data, it uses the isolated forest algorithm to construct an anomaly detection model, identifies nonlinear anomaly patterns by calculating the path length of data points in the random forest, and finally generates a dataset containing normal / anomaly labels to provide a basis for subsequent data repair. The time calibration unit is based on NTP service and obtains standard timestamps from the unified time server within the building to synchronize and calibrate the timestamps of each device in the original data. Specifically, it first identifies the original format of the data timestamps and unifies them to the ISO 8601 standard format through a format conversion function. Then, it performs minute-level alignment on the cross-device data and normalizes the timestamps of all data points within the same minute to the start time of that minute. The missing value repair unit uses a bidirectional LSTM neural network to construct a missing value repair model for the dataset after anomaly detection. Specifically, the data is divided into independent sequences according to device and parameter type. The input sequence is taken as five valid data points before and after the missing point. The bidirectional LSTM network extracts forward and backward features, and the predicted value of the missing point is output through a fully connected layer. For missing points at the beginning or end of the sequence, forward padding and backward padding are performed respectively. The repaired dataset is formed into a two-dimensional table with timestamp as index and device identifier and parameter name as columns. It is associated with spatial regions through field mapping rules and output to the multi-source data semantic fusion module as temporal feature input.

4. The intelligent energy consumption model construction system based on artificial intelligence according to claim 1, characterized in that: The dynamic energy consumption graph construction module includes a graph architecture initialization unit, a graph convolution calculation unit, and a dynamic update unit; The graph architecture initialization unit is used to abstract physical entities within the building into nodes of a graph structure, and initialize the edges between nodes based on spatial location and physical connection to form the basic frame of the energy consumption relationship graph. Specifically: The physical entities within a building are abstracted as nodes in a graph structure, with nodes divided into device nodes and region nodes; the device nodes correspond to specific equipment within the building, including but not limited to air conditioning, lighting, and elevators, and the node attributes are the fused feature vector F output by the multi-source data semantic fusion module. final This includes information such as device type, real-time power, and historical energy consumption patterns. The regional nodes correspond to physical areas within a building, including but not limited to floors, rooms, and corridors. Node attributes include spatial coordinates (x, y), area, and functional type, obtained through building information modeling and IoT device deployment locations. Then, edges are established based on the installation relationship between devices and regions, with edge weights initialized to 1 to represent the basic energy consumption impact. Next, edges are established for adjacent regional nodes, with edge weights initialized based on the reciprocal of the spatial distance to characterize the transmission effect of environmental parameters between regions. Finally, the output graph structure G0=(V,E0) is shown, where V is the set of nodes and E0 is the set of initialized edges. The graph convolution calculation unit uses graph convolution operations of graph neural networks to update node attributes and calculate edge weights by utilizing fused features, thereby quantifying the energy consumption correlation strength between devices and regions. Specifically: First, a graph convolutional network algorithm is used to iteratively update node features through neighborhood information aggregation and nonlinear transformation, as shown in the following formula: ; in, For the first The node feature matrix of the layer is initially the fused feature matrix F. final ; Let A be the normalized adjacency matrix, A be the original adjacency matrix, and D be the degree matrix. For the first The learnable weight matrix of the layer is optimized through backpropagation; ơ is the activation function used to introduce nonlinearity; Then, the edge weight e is calculated based on the feature similarity of adjacent nodes. ij The formula is as follows: ; Where h i , h j Let i be the feature vectors of nodes i and j, and let the edge weights reflect the correlation between their energy consumption patterns. Finally, the updated graph structure G=(V,E) is output, where E represents the set of edges containing dynamic weights; The dynamic update unit is used to monitor equipment failures and regional function change events in real time, trigger a time-aware incremental update algorithm, and locally reconstruct the node attributes and edge weights of the associated subgraph. Specifically: First, real-time event monitoring is performed. For equipment failures, equipment status data is acquired through an IoT multi-source data acquisition module. When a failure is detected, the corresponding node is marked as faulty. For area changes, the functional attributes of area nodes are updated by receiving area usage adjustment instructions through the building management system. Then, an incremental update algorithm is used to determine the set of affected nodes based on the event type and extract the corresponding subgraph. For faulty equipment nodes, missing values ​​are filled using historical data and characteristics of similar equipment; for nodes in areas of functional change, the edge weights between them and their adjacent nodes are recalculated; then only the affected subgraphs are processed. Perform graph convolution operations to update node features and edge weights; finally, output the updated dynamic graph structure G. updated It is synchronized to the intelligent decision engine module as the latest state space.

5. The intelligent energy consumption model construction system based on artificial intelligence according to claim 1, characterized in that: The intelligent decision engine module includes an edge decision unit, a cloud optimization unit, and a strategy output unit; The edge decision unit is responsible for deploying a lightweight reinforcement learning model, which generates device operating parameter adjustment instructions in real time based on the subgraph features in the dynamic graph structure. Specifically: For the model architecture, a Q-Learning model is adopted, and the state space is the feature vector h of the subgraph nodes. i The action space consists of adjustable parameters of the device; then, the current subgraph is obtained from the dynamic energy consumption graph construction module. Extract target node features h i As state s t Then, the model predicts action a. t The calculation formula is as follows: ; Where Q is the action value function and θ is the model parameter; Finally, the control parameters corresponding to the output action are sent to the strategy output unit. The cloud-based optimization unit is used to run the complete reinforcement learning model, combined with the model prediction and control algorithm, based on the global graph structure G. updated Generate cross-regional collaboration strategies; Specifically: First, the entire building structure is encoded into a state vector S = (h1, h2, ..., h...). n ); where h i The device / region node features include spatiotemporal characteristics and energy consumption correlation weights; then, a prediction model based on a graph neural network is used to predict the state evolution in the next T steps, as shown in the following formula: ; Where A is the adjacency matrix; Then, the objective is optimized by minimizing the weighted sum of energy consumption cost and comfort deviation, as shown in the following formula: ; Wherein, is the control sequence for the next T steps; E k To predict energy consumption, calculations are performed by aggregating edge weights within the graph structure; ComfDeviation i (k) represents the comfort deviation of region i; is the weighting coefficient, which can be configured through the cloud interface; The strategy output unit is responsible for converting the decision results of the edge layer and the cloud layer into device-executable protocol instructions and sending them to the edge-cloud collaborative deployment module; Specifically: First, the actions output by the lightweight model are converted into register write instructions in the Modbus protocol. Then, the control sequences optimized by MPC are converted into policy files in JSON format and pushed to edge nodes via the MQTT protocol. Finally, a unified instruction format specification is defined, including but not limited to fields such as device identifier, parameter name, target value, and execution time window, and it is ensured that the device identifier in the instruction corresponds one-to-one with the node ID in the dynamic energy consumption relationship graph.

6. The intelligent energy consumption model construction system based on artificial intelligence according to claim 1, characterized in that: The edge-cloud collaborative deployment module includes an edge computing unit, a cloud central unit, and a communication interaction unit; The edge computing unit is responsible for deploying a lightweight graph neural network model compressed using knowledge distillation technology, and completing local data preprocessing, subgraph feature extraction, and edge layer decision execution at the edge nodes; Specifically: First, knowledge distillation technology is used to transfer the core knowledge of the Transformer and graph neural network combined model to a lightweight edge model. Then, the raw data collected by the Internet of Things is normalized by calculating the mean and standard deviation of the data to convert the raw values ​​into feature values ​​of a standard scale. Next, based on the local subgraph structure output by the dynamic energy consumption relationship graph construction module, the correlation features between devices and regional nodes in the subgraph are extracted through the convolution operation of the graph neural network to form a subgraph feature vector for edge layer decision-making. Finally, edge layer instructions are received from the intelligent decision engine module and converted into control signals that can be recognized by the device through the device driver interface to execute local device regulation in real time. The cloud-based central unit is used to run complete Transformer and graph neural network models, integrate data from the entire building and multiple locations, and achieve global model training and cross-scene transfer through federated learning technology. Specifically: Global data integration collects subgraph feature vectors uploaded by each edge node, and integrates building information model and historical energy consumption data to construct a global energy consumption relationship graph covering all building equipment and regional relationships, thereby enhancing the model's ability to learn the overall energy consumption pattern; Federated learning starts by initializing the global model in the cloud, and then each edge node independently conducts model training based on local data, only uploading gradient update information of model training to the cloud without transmitting the original data. The cloud completes the update of global model parameters by aggregating the gradient information of all edge nodes and then distributes the updated model to the edge nodes; For cross-scene migration, the cloud adjusts parameters related to regional functions and equipment types in the model to adapt to new scenes for different building types. The communication interaction unit establishes a two-way communication channel between the edge node and the cloud server based on the MQTT protocol, realizing real-time interaction between subgraph feature uploading and global policy distribution; Specifically: the MQTT protocol is used to define topics for data interaction; then the JSON format for data interaction is standardized, and the subgraph feature message includes edge node ID, subgraph ID, and feature vector data; The global policy message includes the policy ID, device identifier, control parameters, and target value; finally, real-time interaction between subgraph feature uploading and global policy distribution is achieved through a bidirectional channel.

7. An intelligent energy consumption model construction method based on artificial intelligence, applied to the intelligent energy consumption model construction system based on artificial intelligence as described in claims 1-6, characterized in that: Includes the following steps: S1. Real-time collection of weather data, indoor environmental parameters, equipment operating status and historical energy consumption data through sensors, smart meters and device API interfaces. After parsing by Modbus and MQTT protocols, the data is uniformly converted into standardized XML format data containing timestamps, device identifiers, parameter names and parameter values. S2. The 3ơ rule and the isolated forest algorithm are used to detect outliers in the original data. Cross-device timestamps are calibrated and normalized based on the NTP protocol. Missing values ​​are repaired by interpolation using a bidirectional LSTM neural network, generating time-aligned and spatially correlated structured time-series data. S3. Through Fourier transform, embedding matrix mapping and linear transformation, the structured time series data is encoded into an embedding vector containing time, device, parameter and spatial features. Then, the multi-head self-attention mechanism of the Transformer neural network is used to generate a feature vector that integrates spatiotemporal features, device coupling relationship and environmental influence weights. S4. Abstract devices and physical regions into graph nodes, initialize edge weights based on spatial location and physical connection, update node attributes and calculate edge weights through graph convolution operations, integrate a time-aware incremental update algorithm, and locally reconstruct the associated subgraph when devices fail or regional functions change. S5: The edge layer is based on dynamic graph subgraph features and uses a lightweight reinforcement learning model to adjust the operating parameters of a single region or device in real time; the cloud layer is based on a global graph structure and uses a model predictive control algorithm to generate cross-regional collaborative strategies, thus constructing a two-layer decision-making mechanism. S6. Edge nodes convert decision instructions into Modbus protocol instructions for execution and upload subgraph features to the cloud; The cloud-based system integrates all building data through federated learning to optimize model parameters and distributes the updated model to edge nodes, achieving a collaborative closed loop.

Citation Information

Patent Citations

  • Energy consumption monitoring and optimizing method and system based on large model and multiple agents

    CN118916778A

  • Internet of things system

    WO2023030513A1