A Method and System for Detecting Anomalies in Smart Home Appliance Energy Consumption Based on User Behavior Profiling

CN122571391APending Publication Date: 2026-08-14CHEARI BEIJING CERTIFICATION & TESTING
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-28
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0002]随着智能家居普及,智能家电品类与入户数量持续增长,家庭用电能耗规模不断扩大,能耗异常、设备故障、忘关电器等问题频发,不仅造成能源浪费,还存在用电安全隐患

Benefits of technology

本发明引入时空图对比学习构建概率化用户行为画像,精准刻画家庭用电时序与周期规律;三是采用物理与数据双驱动动态能耗基线,摒弃传统固定阈值,自适应适配不同用户用电习惯,降低误报漏报;四是实现投切突变、缓退化等多尺度异常检测,并完成设备故障、忘关电器、行为渐变三类因果归因;五搭载轻量化决策模型,可输出异常等级与置信度,具备闭环更新能力,兼顾检测精度、实时性与实际应用价值。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122571391A_ABST
    Figure CN122571391A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for detecting abnormal energy consumption in smart home appliances based on user behavior profiles. The method includes collecting multimodal data and regional monitoring data from a preset smart home appliance scenario; preprocessing the multimodal data and regional monitoring data; the regional monitoring data includes real-time power, current, voltage, dwell time, and movement trajectory; performing fine-grained semantic alignment on the multimodal data and regional monitoring data to obtain a fused feature tensor; constructing a probabilistic user behavior profile based on spatiotemporal graph contrastive learning based on the fused feature tensor; constructing a dynamic energy consumption baseline model driven by physical data based on the probabilistic user behavior profile; performing multi-scale anomaly detection and causal attribution based on the dynamic energy consumption baseline model to obtain a causal effect quantity; constructing a smart home appliance energy consumption anomaly detection model based on the causal effect quantity; inputting the data to be detected into the smart home appliance energy consumption anomaly detection model; and outputting the detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy consumption anomaly detection technology for smart home appliances, and in particular to a method and system for energy consumption anomaly detection of smart home appliances based on user behavior profiles. Background Technology

[0002] With the popularization of smart homes, the types and number of smart home appliances installed in homes continue to grow, leading to a continuous expansion of household energy consumption. Issues such as abnormal energy consumption, equipment malfunctions, and appliances being left on are becoming increasingly frequent, causing not only energy waste but also potential electrical safety hazards. Traditional methods for detecting abnormal energy consumption in home appliances often rely on fixed thresholds and single power data, ignoring dynamic factors such as user habits, spatial behavior, and environmental conditions. Fixed baselines cannot adapt to the personalized electricity usage patterns of different households, easily resulting in false alarms and missed alarms.

[0003] Existing detection solutions still have significant shortcomings: First, multi-modal data such as multi-source energy consumption, personnel presence, and environmental temperature and humidity lack unified spatiotemporal alignment, resulting in prominent data silos; second, they fail to construct refined user behavior profiles, making it difficult to depict the temporal and periodic patterns of home appliance usage; third, energy consumption baselines are mostly statically set and cannot be adaptively updated with changes in user behavior; and fourth, anomalies are only identified, lacking causal attribution for faults, human negligence, and gradual behavioral changes, thus failing to provide a basis for targeted handling.

[0004] Therefore, there is an urgent need for a detection scheme that integrates multimodal perception, spatiotemporal graph modeling, and causal reasoning. By constructing probabilistic user behavior profiles and establishing a dynamic energy consumption baseline driven by both physical and data aspects, this scheme can achieve accurate detection and attribution of multi-scale energy consumption anomalies, thus meeting the practical application needs of smart home energy-saving management and electricity safety. Summary of the Invention

[0005] The purpose of this invention is to provide a method for detecting abnormal energy consumption of smart home appliances based on user behavior profiles.

[0006] To achieve the above objectives, the present invention is implemented according to the following technical solution: This invention includes the following steps: Multimodal data and regional monitoring data of preset smart home appliance scenarios are collected, and the multimodal data and regional monitoring data are preprocessed; the regional monitoring data includes real-time power, current, voltage, dwell time, and movement trajectory; the multimodal data includes regional occupancy data, environmental temperature and humidity data, and personnel temporal behavior data; Fine-grained semantic alignment is performed on the multimodal data and the regional monitoring data to obtain a fused feature tensor. Based on the fused feature tensor, a probabilistic user behavior profile based on spatiotemporal graph contrastive learning is constructed. Based on the probabilistic user behavior profile, a dynamic energy consumption baseline model driven by physical data is constructed. Based on the dynamic energy consumption baseline model, multi-scale anomaly detection and causal attribution are performed to obtain the causal effect size. A smart home appliance energy consumption anomaly detection model is constructed based on the causal effect magnitude. The data to be detected is input into the smart home appliance energy consumption anomaly detection model, and the detection results are output.

[0007] Furthermore, the method for performing fine-grained semantic alignment between the multimodal data and the regional monitoring data includes: The pre-defined smart home appliance scenarios are divided into multiple room areas. Individual appliances are identified through non-intrusive load decomposition, a unified time grid is established, and a precise time protocol is adopted. The edge computing gateway serves as the master clock, and each sensor acts as a slave clock. Network transmission latency is estimated in real-time through bidirectional latency measurement. ,in Send a request for a timestamp to the master clock. To send a request timestamp from the clock, , For the reverse link bidirectional delay measurement timestamp; The original timestamps of each sensor are compensated for network transmission delay to obtain a globally unified time, which is then displayed in a sliding window. The minute-level feature vector of the original power sequence of the internal extraction device is expressed as: ;in For the average power of the window, For power fluctuation intensity, Peak power, Accumulated energy consumption for the window For equipment The 4-dimensional energy consumption feature vector at time t For time step, For at any time The energy consumption of the kth device, where t is the time index; Linear interpolation combined with probabilistic smoothing is used to smooth the original binary sequence of the existence sensor: Obtain the occupancy probability of a room during a given time period; extend the temperature and humidity sensor data to a full-time and spatial grid using first-order hold. ;in The most recent previous sampling time for environmental data. The most recent post-sampling time for environmental data. Let be the room occupancy probability after sampling at time t. Let be the environmental feature vector at time t. This is a continuous-time occupancy signal; Construct a room and equipment membership matrix Calculate the user space transfer probability based on the occupancy probability. A learnable modal projection network is employed to project energy consumption modalities, occupancy temporal context, and environmental modalities into a unified semantic space; among which, energy consumption modal projection... Occupy timing context projection Environmental modal projection ; For the m-th room, For equipment Installed in the room 0-1 membership matrix For time t, dynamically encode the user's activity from the room within adjacent time periods. Transfer to semantic probability, This is the bias vector for the energy consumption mode. Here is the weight matrix for the energy consumption mode. To occupy the bias vector setting of the timing context, The weight matrix for occupying the temporal context, Let be the bias vector of the environmental mode. This is the weight matrix for the environmental modes. The time context window length, For equipment The energy consumption mode embedding vector at time t. For the room The occupancy mode embedding vector at time t, Let be the environmental mode embedding vector at time t. For room number Here, i and j are the serial numbers of the smart home appliances, and i and j are the serial numbers of different rooms within the home. This indicates that the device is deployed in a room; otherwise, the value is 0. Based on the principle of spatial semantic injection, room nodes aggregate the energy consumption semantics of internal devices, and device nodes absorb the occupancy context of their respective rooms to obtain room node fusion features. Device node fusion features And cross-modal adaptive weights, the expression is: ;in For the room The feature vectors of the nodes at time t are fused. Let t be the adaptive weights of the environmental modalities during room node fusion. The total number of devices. Here is the weight matrix of the gated network. is the bias vector of the gated network. For splicing operations, Use the Sigmoid activation function; A fusion feature tensor is generated based on the fusion features of room nodes, device nodes, and cross-modal adaptive weights.

[0008] Furthermore, the method for constructing a probabilistic user behavior profile based on spatiotemporal graph contrastive learning according to the fused feature tensor includes: Modeling the home's physical space as a time-varying composition The fused feature tensor is used as the initial feature of the node, and the node set is... The edges include static edge sets and dynamic edge sets, and the joint adjacency matrix is: ,right Perform symmetric normalization The total number of nodes is Static edge set Including spatial adjacent edges and equipment belonging to the side The physical connectivity between rooms is used as spatial adjacency edges, and the weight of each spatial edge is... ; by membership matrix Decision, if equipment Located in the room ,but Dynamic edge set Including user movement edges Related to energy consumption , by the transfer tensor Determine the edge the user moves. Encodes the semantics of user movement between rooms; dynamically constructs energy consumption association edges based on device power correlation. , This characterizes the collaborative usage pattern between devices; These are the dynamic edge weight coefficients. For degree matrix, Static edge weights For dynamic edge weights, For the number of rooms, For the set of room nodes, For a set of device nodes, Let be the set of edges. For equipment room Weight of time, For users to switch rooms in adjacent time periods Transferred to Dynamic edge weights, For equipment and Energy consumption correlation weight between them For equipment Energy consumption For equipment Energy consumption For power Fluctuation intensity For power Fluctuation intensity; Spatiotemporal graph attention network encoding employs a decoupled spatiotemporal encoding architecture. It first aggregates spatial neighbors through a graph attention network, then propagates along the time axis through a gated recurrent unit: for nodes at time t... , No. Layer representation aggregates spatial neighbors through multi-head attention. ,through After layer-space encoding, the full-map space representation matrix at time t is obtained. ;in The number of spatial coding layers. For the number of attention heads, For node i in the graph The set of first-order neighbor nodes in the middle, For the first The attention weight of node j to node i in the h-th attention head of layer . For node i in the th... Spatial coding features of layers For the process The spatial representation matrix of all nodes after layer spatial encoding; For each node along the time axis Using gated loop units to capture the temporal evolution of behavioral patterns Introducing periodic sensing time coding adjustment The learnable attention pooling aggregation method is used to represent the whole graph. ;in Let i be the attention weight of node i in graph-level pooling. The spatiotemporal encoding features of node i at time t, Let be the periodic sensing time encoding vector at time t. For gated loop unit, For learnable query vectors, Let t be the global implicit representation of user behavior. A temporal contrastive learning framework is constructed using positive sample pairs, negative samples, and a contrastive loss function. This framework leverages the natural periodicity of household electricity consumption behavior to generate self-supervised signals: a positive sample pair containing view A and view B is constructed; view A is the original spatiotemporal subgraph. Original features View B is an enhanced spatiotemporal subgraph. Enhancement strategies include: randomly pruning continuous windows with probability. Randomly discard dynamic edges Preserve static edges Simulate occasional packet loss in sensors, randomly mask node features with a 10% dimension, and apply... Gaussian noise; Construct negative samples that include cross-time period negative samples and cross-family negative samples; cross-time period negative samples are representations of the same family on different dates within the same time window; cross-family negative samples are representations from other families; Through a nonlinear projection head Will Mapping to the contrast space, the contrast loss function is given using normalized temperature cross-entropy. ;in For temperature coefficient, Projection vector and Cosine similarity; Let A be the projection vector of view A. Let be the projection vector of view B; End-to-end clustering is achieved using a deep Gaussian mixture model: Let the number of behavioral patterns be... The parameters of a deep Gaussian mixture model are output through a learnable network, and the posterior probability of the behavioral pattern on the latent representation is calculated using Bayesian rules. Negative log-likelihood is used as the clustering target. The joint contrastive loss gives the total training loss. The process continues until the total training loss is less than the loss threshold, thus obtaining the clustering pattern; where... Let be the mean vector of the c-th Gaussian component. Let be the mixing coefficient of the c-th Gaussian component. Let c be the covariance matrix of the c-th Gaussian component. The upper limit of time, For the first The mixing coefficient of the Gaussian components, For clustering loss function, For mixed distribution density, This is the clustering loss balance coefficient. These are the L2 regularization weights. The set of all learnable parameters for spatiotemporal graph networks and Gaussian mixture models; A semi-supervised annotation strategy based on rule-driven and manual verification is used to extract clustering patterns. Based on the statistical characteristics of the corresponding time period, semantic tags are matched according to preset rule templates to calculate the temporal distribution of clustering patterns. Output probabilistic user behavior profiles ;in For the maximum a posteriori behavior pattern, Clustering pattern High-confidence prototype features. For concentration, This is the peak time of the day. It is a periodic type. For the peak day of pattern c within a week, The concentration of pattern c within the week. It is a daily cycle. It is a weekly cycle. It is irregular.

[0009] Furthermore, the method for constructing a dynamic energy consumption baseline model driven by both physical data based on the probabilistic user behavior profile includes: The physical prior layer establishes a theoretical power consumption benchmark based on the device type to obtain the theoretical power and physical uncertainty. The data-driven layer models residuals using a conditional variational autoencoder: defining the physical residuals. With maximum a posteriori behavior pattern A lightweight conditional variational autoencoder is constructed for the conditions; the encoder decoder Given a training objective The posterior mean of the encoder is input into the decoder to obtain the residual correction. With residual uncertainty ;in For equipment The actual power value at time t For equipment The predicted power value at time t, For the encoding network, are the latent variables of the conditional variational autoencoder. It is a multivariate normal distribution. The mean of the latent variable distribution of the encoder output. The diagonal covariance of the encoder output. For the current behavioral pattern, For decoder networks, This represents the average residual correction value of the decoder output. The residual uncertainty of the decoder output. For encoder distribution Seeking expectations, Let be the divergence between the encoder distribution and the prior distribution; The dual-drive fusion layer includes the baseline mean. and baseline total variance ;in The power mean predicted by the physical model. This represents the average residual correction value of the decoder output. The inherent variance of the physical model. This refers to the variance of the residual uncertainty. Posterior probability of behavioral patterns Perform weighted fusion to obtain the power baseline variance Given a Bayesian online adaptive confidence interval The interval width coefficient is dynamically adjusted based on online coverage feedback. The expression is: ; in for, For target coverage, For learning rate, The total number of behavioral patterns. For equipment The final power baseline mean at time t, Let be the posterior probability of belonging to the c-th behavior pattern at time t. For the device in the c-th behavior mode The baseline mean of power, For equipment The power baseline variance at time t Let be the interval width coefficient at time t. The interval width coefficient at time t+1. For the measured power to fall within the confidence interval Experience frequency; If underreporting increases recently , Automatically increase; if false alarms increase, Automatic tightening.

[0010] Furthermore, the method for multi-scale anomaly detection and causal attribution based on the dynamic energy consumption baseline model includes: Multi-scale anomaly detection: Extracting power change rate Harmonic characteristics ,when and This is labeled as a cutting mutation; cognitive uncertainty is introduced into the conditional variational autoencoder. Constructing comprehensive uncertainty Calculate the uncertainty normalized anomaly score ,when A first-level core deviation detection is triggered at specific time points. If three or more consecutive time points trigger this detection, a second-level confirmation is performed, and the deviation is marked as a core deviation. A recursive cumulative summation is applied to the time-period residuals. ,when At that time, it was marked as slow degradation of the equipment; among which For equipment The rate of change of power at time t For equipment Total harmonic distortion at time t The amplitude of the fundamental voltage. Let h be the amplitude of the h-th harmonic. The highest harmonic order, The power change threshold, For equipment The power confidence interval at time t For equipment The overall uncertainty at time t, For the baseline variance, For equipment The abnormal score at time t, The threshold for abnormal scoring, For equipment The power residual at time t To allow drift amount, The standardized value of the residual. For cumulative sum threshold; Constructing a minimal cause-effect graph ,node Attribution is classified into A1, B1, and C1 categories by using simplified judgment rules for intervention reasoning; among them For behavior, For occupation, For the environment, For device status, Energy consumption; Class A1: When , And energy consumption deviates If so, it is determined to be a equipment failure, and the causal effect size is calculated. Calculate the attribution confidence score for class A1. ;in This represents the relative deviation in equipment power. For equipment The probability of occupancy in a room. This represents the relative deviation in equipment power. This is an indicator function of class A1, which is 1 when there is a device fault and 0 otherwise; Category B1: When the user leaves Device not in standby mode Instantaneous scale no-twisting event If so, it is determined to be an malfunction caused by forgetting to turn off the electrical appliance, and the causal effect size is... The attribution confidence level for class B1 is ;in The threshold for the probability of a user leaving the site. The power change threshold, This is the difference between the actual power consumption and the standby power consumption. The percentage of additional power consumption to standby power. This is a B1 type indicator function, which is 1 when there is an error indicating that an appliance was left on, and 0 otherwise. C1 category: When the posterior distribution of behavior over 7 consecutive days and multiple time periods shows a systematic shift, the measured energy consumption deviates from the old baseline but falls within the baseline corresponding to the new behavior pattern, and there is no instantaneous abrupt change, it is determined to be a gradual change in behavior pattern, and the causal effect size is: The attribution confidence level is For C1 type, no exception alarm is triggered; instead, the probabilistic user behavior profile is updated directly. Distribution of old behavioral patterns For the distribution of new behavioral patterns, The Jason divergence between the old and new behavioral pattern distributions. Let be the Jason divergence threshold, and be the indicator function for class C1. The value is 1 when the behavior pattern changes gradually, and 0 otherwise. This is an energy consumption indicator function, which is 1 when the energy consumption falls within the new baseline, and 0 otherwise. For confirmed abnormal periods, the attribution weights of the three categories are normalized. ,Pick Finally, the attribution is calculated, and the output quadruple is given: ;in For equipment number, For time indexing, The confidence level of the current attribution. For the first The causal effect size of each category.

[0011] Furthermore, the method for constructing a smart home appliance energy consumption anomaly detection model based on the causal effect quantity includes: Obtain auxiliary features, and construct an input vector based on the causal effect size and auxiliary features. ;in For equipment Baseline deviation score at time t For behavioral drift divergence, For behavioral confidence, The probability of the room where the device is located being occupied. The causal effect of equipment failure. The causal effect of forgetting to turn off electrical appliances; The intelligent home appliance energy consumption anomaly detection model includes anomaly detection, attribution decision model, severity and confidence quantification, output interface and closed-loop feedback; anomaly detection employs uncertainty normalization scoring. ,when If the trigger frequency within the sliding window is greater than 60%, then it proceeds to the second attribution decision layer; otherwise, it is marked as normal. The threshold for abnormal scoring is... Attribution decision model: Using causal effect size as the discriminant feature, a lightweight soft maximization classifier is constructed. Hard constraint rules are given based on equipment failure, forgetting to turn off electrical appliances, and gradual behavioral changes. If multiple conditions conflict, the rule is taken. The corresponding type; among which For the input vector Time anomaly belongs to the first The probability of a class For the first Class biased items, For the first The learnable weight vector of the class, For type index; the first The classes include Normal (N), Equipment Failure (A1), Forgot to Turn Off (B1), and Gradual Behavior Change (C1); Severity and confidence quantification: Severity level is ,according to The mapping is divided into four levels: prompt, general, verification, and urgent, with an attribution confidence level of 1. ;in The causal effect size corresponding to the attribution. The duration of the abnormality. The optimal class probability output by the classifier; Output interface and closed-loop feedback: Output detection results When the detection result is A1 or B1, a visual alarm is triggered; when the detection result is C1, no alarm is triggered, and a profile update command is directly output. For equipment number, For time indexing, For indicator functions, when It is 1 if it is true, otherwise it is 0.

[0012] Secondly, a smart home appliance energy consumption anomaly detection system based on user behavior profiles includes: Data acquisition and processing module: used to acquire multimodal data and regional monitoring data of preset smart home appliance scenarios, and to preprocess the multimodal data and regional monitoring data; the regional monitoring data includes real-time power, current, voltage, dwell time, and movement trajectory; Semantic alignment and behavior profiling module: used to perform fine-grained semantic alignment on the multimodal data and the regional monitoring data, obtain a fused feature tensor, and construct a probabilistic user behavior profile based on spatiotemporal graph contrastive learning based on the fused feature tensor; Dynamic energy consumption baseline and causal attribution module: used to construct a dynamic energy consumption baseline model driven by physical data based on the probabilistic user behavior profile, and to perform multi-scale anomaly detection and causal attribution based on the dynamic energy consumption baseline model to obtain causal effect size; Model building and output module: used to build a smart home appliance energy consumption anomaly detection model based on the causal effect quantity, input the data to be detected into the smart home appliance energy consumption anomaly detection model, and output the detection results.

[0013] The beneficial effects of this invention are: This invention relates to a method and system for detecting abnormal energy consumption in smart home appliances based on user behavior profiles. Compared with existing technologies, this invention has the following technical advantages: This invention introduces spatiotemporal graph contrastive learning to construct probabilistic user behavior profiles, accurately depicting the temporal and cyclical patterns of household electricity consumption; thirdly, it adopts a dynamic energy consumption baseline driven by both physical and data methods, abandoning traditional fixed thresholds and adaptively adapting to different users' electricity consumption habits, reducing false alarms and missed alarms; fourthly, it achieves multi-scale anomaly detection, such as sudden switching and gradual degradation, and completes three types of causal attribution: equipment failure, forgetting to turn off appliances, and gradual behavioral changes; fifthly, it is equipped with a lightweight decision model that can output anomaly level and confidence level, has closed-loop update capability, and balances detection accuracy, real-time performance, and practical application value. Attached Figure Description

[0014] Figure 1 This is a flowchart illustrating the steps of the intelligent home appliance energy consumption anomaly detection method based on user behavior profiles according to the present invention. Detailed Implementation

[0015] The present invention will be further described below through specific embodiments. The illustrative embodiments and descriptions herein are used to explain the present invention, but are not intended to limit the present invention.

[0016] The present invention provides a method and system for detecting abnormal energy consumption of smart home appliances based on user behavior profiles, comprising the following steps: like Figure 1 As shown, this embodiment includes the following steps: Multimodal data and regional monitoring data of preset smart home appliance scenarios are collected, and the multimodal data and regional monitoring data are preprocessed; the regional monitoring data includes real-time power, current, voltage, dwell time, and movement trajectory; the multimodal data includes regional occupancy data, environmental temperature and humidity data, and personnel temporal behavior data; In the actual evaluation, a three-bedroom, one-living-room smart home scenario was used as the test object. A total of eight smart home appliances were deployed throughout the house, including a smart air conditioner, refrigerator, washing machine, electric water heater, kitchen stove, and bedroom lights. Smart meters, current and voltage acquisition sensors, human infrared sensors, temperature and humidity sensors, and regional millimeter-wave positioning sensors were also deployed to collect time-series data for 90 consecutive days from January 1, 2025 to March 31, 2025, with a sampling interval of 1 minute. The hardware architecture adopted an edge computing gateway and a distributed sensor network, with the gateway as the master clock and each sensor as a slave clock, deployed in the home's low-voltage box to achieve edge preprocessing and time synchronization of multi-source data. Regional monitoring data: Real-time power, current, and voltage of each household appliance are collected every minute; human dwell time and movement trajectory of people in the room; Multimodal data: Binary state data of occupancy of each room area, time-series data of indoor and outdoor temperature and humidity, and data on people's home life and time-series behavior. Preprocessing: Linear interpolation is used to complete short-term packet loss data from sensors; the 3σ criterion is used to remove outliers caused by instantaneous power and voltage fluctuations; a bidirectional time delay formula for documents is used to compensate for the timestamp deviation of each sensor and to construct a globally unified 1-minute time grid; a non-intrusive load decomposition algorithm is used to separate the load sequences of 8 independent home appliances from the total power load, thereby achieving decoupling of individual home appliance data. Fine-grained semantic alignment is performed on the multimodal data and the regional monitoring data to obtain a fused feature tensor. Based on the fused feature tensor, a probabilistic user behavior profile based on spatiotemporal graph contrastive learning is constructed. Based on the probabilistic user behavior profile, a dynamic energy consumption baseline model driven by physical data is constructed. Based on the dynamic energy consumption baseline model, multi-scale anomaly detection and causal attribution are performed to obtain the causal effect size. A smart home appliance energy consumption anomaly detection model is constructed based on the causal effect magnitude. The data to be detected is input into the smart home appliance energy consumption anomaly detection model, and the detection results are output.

[0017] In this embodiment, the method for fine-grained semantic alignment of the multimodal data and the regional monitoring data includes: The pre-defined smart home appliance scenarios are divided into multiple room areas. Individual appliances are identified through non-intrusive load decomposition, a unified time grid is established, and a precise time protocol is adopted. The edge computing gateway serves as the master clock, and each sensor acts as a slave clock. Network transmission latency is estimated in real-time through bidirectional latency measurement. ,in Send a request for a timestamp to the master clock. To send a request timestamp from the clock, , For the reverse link bidirectional delay measurement timestamp; The original timestamps of each sensor are compensated for network transmission delay to obtain a globally unified time, which is then displayed in a sliding window. The minute-level feature vector of the original power sequence of the internal extraction device is expressed as: ;in For the average power of the window, For power fluctuation intensity, Peak power, Accumulated energy consumption for the window For equipment The 4-dimensional energy consumption feature vector at time t For time step, For at any time The energy consumption of the kth device, where t is the time index; Linear interpolation combined with probabilistic smoothing is used to smooth the original binary sequence of the existence sensor: Obtain the occupancy probability of a room during a given time period; extend the temperature and humidity sensor data to a full-time and spatial grid using first-order hold. ;in The most recent previous sampling time for environmental data. The most recent post-sampling time for environmental data. Let be the room occupancy probability after sampling at time t. Let be the environmental feature vector at time t. This is a continuous-time occupancy signal; Construct a room and equipment membership matrix Calculate the user space transfer probability based on the occupancy probability. A learnable modal projection network is employed to project energy consumption modalities, occupancy temporal context, and environmental modalities into a unified semantic space; among which, energy consumption modal projection... Occupy timing context projection Environmental modal projection ; For the m-th room, For equipment Installed in the room 0-1 membership matrix For time t, dynamically encode the user's activity from the room within adjacent time periods. Transfer to semantic probability, This is the bias vector for the energy consumption mode. Here is the weight matrix for the energy consumption mode. To occupy the bias vector setting of the timing context, The weight matrix for occupying the temporal context, Let be the bias vector of the environmental mode. This is the weight matrix for the environmental modes. The time context window length, For equipment The energy consumption mode embedding vector at time t. For the room The occupancy mode embedding vector at time t, Let be the environmental mode embedding vector at time t. For room number Here, i and j are the serial numbers of the smart home appliances, and i and j are the serial numbers of different rooms within the home. This indicates that the device is deployed in a room; otherwise, the value is 0. Based on the principle of spatial semantic injection, room nodes aggregate the energy consumption semantics of internal devices, and device nodes absorb the occupancy context of their respective rooms to obtain room node fusion features. Device node fusion features And cross-modal adaptive weights, the expression is: ;in For the room The feature vectors of the nodes at time t are fused. Let t be the adaptive weights of the environmental modalities during room node fusion. The total number of devices. Here is the weight matrix of the gated network. is the bias vector of the gated network. For splicing operations, Use the Sigmoid activation function; A fusion feature tensor is generated based on the fusion features of room nodes, device nodes, and cross-modal adaptive weights. In actual assessment, Encode the temporal evolution pattern of occupation through convolutional or fully connected layers; Through membership matrix Enable semantic aggregation of device-level energy consumption to room nodes, ensuring that room features contain fine-grained energy consumption information of all electrical appliances inside; The home is divided into five independent room areas: living room, master bedroom, secondary bedroom, kitchen, and bathroom. A room-equipment membership matrix is ​​constructed, with equipment belonging to a room marked as 1, otherwise 0. Sliding window feature extraction: A sliding window is set up... For a time of 15 minutes, extract the 4-dimensional power feature vector for each household appliance: Includes window average power, power fluctuation, peak power, and cumulative energy consumption; The binary sequences of human body sensor data are probabilistically smoothed to output the room occupancy probability in the 0-1 interval; temperature and humidity data are supplemented with first-order hold-before interpolation to complete the data at non-sampling times and aligned with the spatiotemporal grid; modal projection and feature fusion: a 3-layer learnable modal projection network is built to map energy consumption modality, occupancy temporal modality, and environmental modality to the same semantic space; adaptive computation is performed through a gating network. , , Cross-modal weights are used to solve the fusion features of room nodes and device nodes respectively, generating a spatiotemporal fusion feature tensor with dimensions of [number of rooms + number of devices, feature dimension, time step].

[0018] In this embodiment, the method for constructing a probabilistic user behavior profile based on spatiotemporal graph contrastive learning according to the fused feature tensor includes: Modeling the home's physical space as a time-varying composition The fused feature tensor is used as the initial feature of the node, and the node set is... The edges include static edge sets and dynamic edge sets, and the joint adjacency matrix is: ,right Perform symmetric normalization The total number of nodes is Static edge set Including spatial adjacent edges and equipment belonging to the side The physical connectivity between rooms is used as spatial adjacency edges, and the weight of each spatial edge is... ; by membership matrix Decision, if equipment Located in the room ,but Dynamic edge set Including user movement edges Related to energy consumption , by the transfer tensor Determine the edge the user moves. Encodes the semantics of user movement between rooms; dynamically constructs energy consumption association edges based on device power correlation. , This characterizes the collaborative usage pattern between devices; These are the dynamic edge weight coefficients. For degree matrix, Static edge weights For dynamic edge weights, For the number of rooms, For the set of room nodes, For a set of device nodes, Let be the set of edges. For equipment room Weight of time, For users to switch rooms in adjacent time periods Transferred to Dynamic edge weights, For equipment and Energy consumption correlation weight between them For equipment Energy consumption For equipment Energy consumption For power Fluctuation intensity For power Fluctuation intensity; Spatiotemporal graph attention network encoding employs a decoupled spatiotemporal encoding architecture. It first aggregates spatial neighbors through a graph attention network, then propagates along the time axis through a gated recurrent unit: for nodes at time t... , No. Layer representation aggregates spatial neighbors through multi-head attention. ,through After layer-space encoding, the full-map space representation matrix at time t is obtained. ;in The number of spatial coding layers. For the number of attention heads, For node i in the graph The set of first-order neighbor nodes in the middle, For the first The attention weight of node j to node i in the h-th attention head of layer . For node i in the th... Spatial coding features of layers For the process The spatial representation matrix of all nodes after layer spatial encoding; For each node along the time axis Using gated loop units to capture the temporal evolution of behavioral patterns Introducing periodic sensing time coding adjustment The learnable attention pooling aggregation method is used to represent the whole graph. ;in Let i be the attention weight of node i in graph-level pooling. The spatiotemporal encoding features of node i at time t, Let be the periodic sensing time encoding vector at time t. For gated loop unit, For learnable query vectors, Let t be the global implicit representation of user behavior. A temporal contrastive learning framework is constructed using positive sample pairs, negative samples, and a contrastive loss function. This framework leverages the natural periodicity of household electricity consumption behavior to generate self-supervised signals: a positive sample pair containing view A and view B is constructed; view A is the original spatiotemporal subgraph. Original features View B is an enhanced spatiotemporal subgraph. Enhancement strategies include: randomly pruning continuous windows with probability. Randomly discard dynamic edges Preserve static edges Simulate occasional packet loss in sensors, apply a 10% dimension random mask to node features, and apply... Gaussian noise; Construct negative samples that include cross-time period negative samples and cross-family negative samples; cross-time period negative samples are representations of the same family on different dates within the same time window; cross-family negative samples are representations from other families; Through a nonlinear projection head Will Mapping to the contrast space, the contrast loss function is given using normalized temperature cross-entropy. ;in For temperature coefficient, Projection vector and Cosine similarity; Let A be the projection vector of view A. Let be the projection vector of view B; End-to-end clustering is achieved using a deep Gaussian mixture model: Let the number of behavioral patterns be... The parameters of a deep Gaussian mixture model are output through a learnable network, and the posterior probability of the behavioral pattern on the latent representation is calculated using Bayesian rules. Negative log-likelihood is used as the clustering target. The joint contrastive loss gives the total training loss. The process continues until the total training loss is less than the loss threshold, thus obtaining the clustering pattern; where... Let be the mean vector of the c-th Gaussian component. Let be the mixing coefficient of the c-th Gaussian component. Let c be the covariance matrix of the c-th Gaussian component. The upper limit of time, For the first The mixing coefficient of the Gaussian components, For clustering loss function, For mixed distribution density, This is the clustering loss balance coefficient. These are the L2 regularization weights. The set of all learnable parameters for spatiotemporal graph networks and Gaussian mixture models; A semi-supervised annotation strategy based on rule-driven and manual verification is used to extract clustering patterns. Based on the statistical characteristics of the corresponding time period, semantic tags are matched according to preset rule templates to calculate the temporal distribution of clustering patterns. Output probabilistic user behavior profiles ;in For the maximum a posteriori behavior pattern, Clustering pattern High-confidence prototype features. For concentration, This is the peak time of the day. It is a periodic type. For the peak day of pattern c within a week, The concentration of pattern c within the week. It is a daily cycle. It is a weekly cycle. It is irregular; In actual evaluation, dynamic edge weight coefficients are used to balance spatial physical structure and time-varying behavioral semantics, and periodic type is automatically inferred through kernel density estimation of implicit timestamps; Dynamic edge weight coefficient: used to balance the static physical topology of the home and the dynamic relationship of time-varying user behavior; it clarifies that static edges only include room spatial adjacency and device room affiliation, while dynamic edges only include personnel movement edges and device energy consumption relationship edges; Static edges: physical adjacency edges between rooms, equipment-room membership edges, with fixed weights; Dynamic edges: personnel moving between rooms, appliance energy consumption related edges, dynamically updated by real-time transfer probability and power correlation. The value is 0.3, and the joint adjacency matrix is ​​symmetrically normalized. A decoupled spatiotemporal graph attention network is employed: a 3-layer spatial multi-head attention encoding, followed by GRU temporal modeling, incorporating daily and weekly time-based encodings to output a global behavioral latent representation; positive samples are generated using the original spatiotemporal subgraph with random window pruning, 10% node feature masking, Gaussian noise, and a 0.1 probability of discarding dynamic edges; negative samples include samples from the same household on different dates at the same time, and heterogeneous behavioral samples from other households; contrastive loss + Gaussian mixture clustering loss + L2 regularization are used, and training is iteratively continued until the total loss is below a threshold of 10. -4 The number of behavior patterns is set to 6. After clustering, the behavior patterns are divided into 6 typical categories: daytime home, nighttime rest, weekday outings, weekend home, cooking time, and bathing time through rule templates and semi-supervised manual annotation. The output is a probabilistic user behavior profile containing mean, covariance, periodic distribution, and occurrence time.

[0019] In this embodiment, the method for constructing a dynamic energy consumption baseline model driven by both physical data based on the probabilistic user behavior profile includes: The physical prior layer establishes a theoretical power consumption benchmark based on the device type to obtain the theoretical power and physical uncertainty. The data-driven layer models residuals using a conditional variational autoencoder: defining the physical residuals. With maximum a posteriori behavior pattern To construct a lightweight conditional variational autoencoder; encoder decoder Given a training objective The posterior mean of the encoder is input into the decoder to obtain the residual correction. With residual uncertainty ;in For equipment The actual power value at time t For equipment The predicted power value at time t, For the encoding network, are the latent variables of the conditional variational autoencoder. It is a multivariate normal distribution. The mean of the latent variable distribution of the encoder output. The diagonal covariance of the encoder output. For the current behavioral pattern, For decoder networks, This represents the average residual correction value of the decoder output. The residual uncertainty of the decoder output. For encoder distribution Seeking expectations, Let be the divergence between the encoder distribution and the prior distribution; The dual-drive fusion layer includes the baseline mean. and baseline total variance ;in The power mean predicted by the physical model. This represents the average residual correction value of the decoder output. The inherent variance of the physical model. This refers to the variance of the residual uncertainty. Posterior probability of behavioral patterns Perform weighted fusion to obtain the power baseline variance Given a Bayesian online adaptive confidence interval The interval width coefficient is dynamically adjusted based on online coverage feedback. The expression is: ; in for, For target coverage, For learning rate, The total number of behavioral patterns. For equipment The final power baseline mean at time t, Let be the posterior probability of belonging to the c-th behavior pattern at time t. For the device in the c-th behavior mode The baseline mean of power, For equipment The power baseline variance at time t Let be the interval width coefficient at time t. The interval width coefficient at time t+1. For the measured power to fall within the confidence interval Experience frequency; If underreporting increases recently , Automatically increase; if false alarms increase, Automatic tightening; In the actual evaluation, a theoretical power consumption model was established based on the rated parameters and energy efficiency levels of 8 home appliances: Refrigerator: standby power consumption 8W, average operating power consumption 45W; Air conditioner: theoretical power consumption for cooling / heating modes; Electric water heater: theoretical power consumption for both constant temperature insulation and heating modes; The theoretical power consumption and physical inherent variance of each device were output. Define the physical residuals and construct a lightweight conditional variational autoencoder based on the maximum posterior behavior pattern at each time step. Train the decoder using ELBO loss and output the residual corrected mean and residual variance. The baseline mean and variance are fused according to the document formula and weighted by the posterior probability of the behavior pattern to obtain the real-time baseline; the target coverage rate is 0.95, the learning rate is 0.05, and the interval width is dynamically adjusted, widening when there is a missed report and tightening when there is a false positive, to adapt to the temporal changes in user behavior.

[0020] In this embodiment, the method for multi-scale anomaly detection and causal attribution based on the dynamic energy consumption baseline model includes: Multi-scale anomaly detection: Extracting power change rate Harmonic characteristics ,when and This is labeled as a cutting mutation; cognitive uncertainty is introduced into the conditional variational autoencoder. Constructing comprehensive uncertainty Calculate the uncertainty normalized anomaly score ,when A first-level core deviation detection is triggered at specific time points. If three or more consecutive time points trigger this detection, a second-level confirmation is performed, and the deviation is marked as a core deviation. A recursive cumulative summation is applied to the time-period residuals. ,when At that time, it was marked as slow degradation of the equipment; among which For equipment The rate of change of power at time t For equipment Total harmonic distortion at time t The amplitude of the fundamental voltage. Let h be the amplitude of the h-th harmonic. The highest harmonic order, The power change threshold, For equipment The power confidence interval at time t For equipment The overall uncertainty at time t, For the baseline variance, For equipment The abnormal score at time t, The threshold for abnormal scoring, For equipment The power residual at time t To allow drift amount, The standardized value of the residual. For cumulative sum threshold; Constructing a minimal cause-effect graph ,node Attribution is classified into A1, B1, and C1 categories by using simplified judgment rules for intervention reasoning; among them For behavior, For occupation, For the environment, For device status, Energy consumption; Class A1: When , And energy consumption deviates If so, it is determined to be a equipment failure, and the causal effect size is calculated. Calculate the attribution confidence score for class A1. ;in This represents the relative deviation in equipment power. For equipment The probability of occupancy in a room. This represents the relative deviation in equipment power. This is an indicator function of class A1, which is 1 when there is a device fault and 0 otherwise; Category B1: When the user leaves Device not in standby mode Instantaneous scale no-twisting event If so, it is determined to be an malfunction caused by forgetting to turn off the electrical appliance, and the causal effect size is... The attribution confidence level for class B1 is ;in The threshold for the probability of a user leaving the site. The power change threshold, This is the difference between the actual power consumption and the standby power consumption. The percentage of additional power consumption to standby power. This is a B1 type indicator function, which is 1 when there is an error indicating that an appliance was left on, and 0 otherwise. C1 category: When the posterior distribution of behavior over 7 consecutive days and multiple time periods shows a systematic shift, the measured energy consumption deviates from the old baseline but falls within the baseline corresponding to the new behavior pattern, and there is no instantaneous abrupt change, it is determined to be a gradual change in behavior pattern, and the causal effect size is: The attribution confidence level is For C1 type, no exception alarm is triggered; instead, the probabilistic user behavior profile is updated directly. Distribution of old behavioral patterns For the distribution of new behavioral patterns, The Jason divergence between the old and new behavioral pattern distributions. Let be the Jason divergence threshold, and be the indicator function for class C1. The value is 1 when the behavior pattern changes gradually, and 0 otherwise. This is an energy consumption indicator function, which is 1 when the energy consumption falls within the new baseline, and 0 otherwise. For confirmed abnormal periods, the attribution weights of the three categories are normalized. ,Pick Finally, the attribution is calculated, and the output quadruple is given: ;in For equipment number, For time indexing, The confidence level of the current attribution. For the first The causal effect size of each category; In actual evaluation, the posterior probability threshold for behavior is 0.7, the probability threshold for user leaving occupancy is 0.3, the Jason divergence anomaly threshold is 0.15; the power change rate threshold is 5W / min, the anomaly score threshold is 2.5, and the residual cumulative sum threshold is 4. If the system determines that the user forgot to turn off the air conditioner / water heater when leaving home, or if the user's daily routine and electricity usage habits are gradually changing, it will not issue an alarm but will only update the behavioral profile.

[0021] In this embodiment, the method for constructing a smart home appliance energy consumption anomaly detection model based on the causal effect quantity includes: Obtain auxiliary features, and construct an input vector based on the causal effect size and auxiliary features. ;in For equipment Baseline deviation score at time t For behavioral drift divergence, For behavioral confidence, The probability of the room where the device is located being occupied. The causal effect of equipment failure. The causal effect of forgetting to turn off electrical appliances; The intelligent home appliance energy consumption anomaly detection model includes anomaly detection, attribution decision model, severity and confidence quantification, output interface and closed-loop feedback; anomaly detection employs uncertainty normalization scoring. ,when If the trigger frequency within the sliding window is greater than 60%, then it proceeds to the second attribution decision layer; otherwise, it is marked as normal. The threshold for abnormal scoring is... Attribution decision model: Using causal effect size as the discriminant feature, a lightweight soft maximization classifier is constructed. Hard constraint rules are given based on equipment failure, forgetting to turn off electrical appliances, and gradual behavioral changes. If multiple conditions conflict, the rule is taken. The corresponding type; among which For the input vector Time anomaly belongs to the first The probability of a class For the first Class biased items, For the first The learnable weight vector of the class, For type index; the first The classes include Normal (N), Equipment Failure (A1), Forgot to Turn Off (B1), and Gradual Behavior Change (C1); Severity and confidence quantification: Severity level is ,according to The mapping is divided into four levels: prompt, general, verification, and urgent, with an attribution confidence level of 1. ;in The causal effect size corresponding to the attribution. The duration of the abnormality. The optimal class probability output by the classifier; Output interface and closed-loop feedback: Output detection results When the detection result is A1 or B1, a visual alarm is triggered; when the detection result is C1, no alarm is triggered, and a profile update command is directly output. For equipment number, For time indexing, For indicator functions, when It is 1 if it is true, otherwise it is 0; In actual evaluation, the input vector is the normalized input of all 6-dimensional features. The hard constraint rule is: when the anomaly detection is a device malfunction, a forced... When the abnormality detection indicates that the appliance was left on, force it to... When the anomaly detection is a gradual change in behavior, force... ; Tested on 90 days of data, this method, compared with traditional fixed threshold detection, has: improved anomaly detection accuracy to 96.8%; reduced false alarm rate by 72% and false negative rate by 65%; can accurately distinguish between three types of anomalies: equipment failure, human forgetting to turn off the device, and gradual behavioral changes, and outputs the anomaly level and source tracing basis, adapting to personalized household electricity usage habits and meeting the actual needs of smart home energy consumption management and electricity safety.

[0022] Secondly, a smart home appliance energy consumption anomaly detection system based on user behavior profiles includes: Data acquisition and processing module: used to acquire multimodal data and regional monitoring data of preset smart home appliance scenarios, and to preprocess the multimodal data and regional monitoring data; the regional monitoring data includes real-time power, current, voltage, dwell time, and movement trajectory; Semantic alignment and behavior profiling module: used to perform fine-grained semantic alignment on the multimodal data and the regional monitoring data, obtain a fused feature tensor, and construct a probabilistic user behavior profile based on spatiotemporal graph contrastive learning based on the fused feature tensor; Dynamic energy consumption baseline and causal attribution module: used to construct a dynamic energy consumption baseline model driven by physical data based on the probabilistic user behavior profile, and to perform multi-scale anomaly detection and causal attribution based on the dynamic energy consumption baseline model to obtain causal effect size; Model building and output module: used to build a smart home appliance energy consumption anomaly detection model based on the causal effect quantity, input the data to be detected into the smart home appliance energy consumption anomaly detection model, and output the detection results.

[0023] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting abnormal energy consumption in smart home appliances based on user behavior profiles, characterized in that, Includes the following steps: Collect multimodal data and regional monitoring data of preset smart home appliance scenarios, and preprocess the multimodal data and regional monitoring data; The area monitoring data includes real-time power, current, voltage, dwell time, and movement trajectory; the multimodal data includes area occupancy data, environmental temperature and humidity data, and personnel temporal behavior data. Fine-grained semantic alignment is performed on the multimodal data and the regional monitoring data to obtain a fusion feature tensor. Based on the fusion feature tensor, a probabilistic user behavior profile based on spatiotemporal graph contrastive learning is constructed. Based on the probabilistic user behavior profile, a dynamic energy consumption baseline model driven by physical data is constructed. Based on the dynamic energy consumption baseline model, multi-scale anomaly detection and causal attribution are performed to obtain the causal effect size. A smart home appliance energy consumption anomaly detection model is constructed based on the causal effect magnitude. The data to be detected is input into the smart home appliance energy consumption anomaly detection model, and the detection results are output.

2. The method for detecting abnormal energy consumption of smart home appliances based on user behavior profiles according to claim 1, characterized in that, A method for fine-grained semantic alignment of the multimodal data and the regional monitoring data includes: The pre-defined smart home appliance scenarios are divided into multiple room areas. Individual appliances are identified through non-intrusive load decomposition, a unified time grid is established, and a precise time protocol is adopted. The edge computing gateway serves as the master clock, and each sensor acts as a slave clock. Network transmission latency is estimated in real-time through bidirectional latency measurement. ; The original timestamps of each sensor are compensated for network transmission delay to obtain a globally unified time, which is then displayed in a sliding window. The minute-level feature vector of the original power sequence of the internal extraction device is expressed as: ; Linear interpolation combined with probabilistic smoothing is used to smooth the original binary sequence of the existence sensor: Obtain the occupancy probability of a room during a given time period; extend the temperature and humidity sensor data to a full-time and spatial grid using first-order hold. ; Construct a room and equipment membership matrix Calculate the user space transfer probability based on the occupancy probability. A learnable modal projection network is used to project energy consumption modalities, occupancy temporal contexts, and environmental modalities into a unified semantic space; Based on the principle of spatial semantic injection, room nodes aggregate the energy consumption semantics of internal devices, and device nodes absorb the occupancy context of their respective rooms to obtain room node fusion features. Device node fusion features And cross-modal adaptive weights, the expression is: ; A fusion feature tensor is generated based on the fusion features of room nodes, device nodes, and cross-modal adaptive weights.

3. The method for detecting abnormal energy consumption of smart home appliances based on user behavior profiles according to claim 1, characterized in that, A method for constructing a probabilistic user behavior profile based on spatiotemporal graph contrastive learning using the fused feature tensor includes: Modeling the home's physical space as a time-varying composition The fused feature tensor is used as the initial feature of the node, and the node set is... The edges include static edge sets and dynamic edge sets, and the joint adjacency matrix is: ,right Perform symmetric normalization ; Spatiotemporal graph attention network encoding employs a decoupled spatiotemporal encoding architecture. It first aggregates spatial neighbors through a graph attention network, then propagates along the time axis through a gated recurrent unit: for nodes at time t... , No. Layer representation aggregates spatial neighbors through multi-head attention. ,through After layer-space encoding, the full-map space representation matrix at time t is obtained. ; For each node along the time axis Using gated loop units to capture the temporal evolution of behavioral patterns Introducing periodic sensing time coding adjustment The learnable attention pooling aggregation method is used to represent the whole graph. ; A temporal contrastive learning framework is constructed using positive sample pairs, negative samples, and a contrastive loss function. This framework leverages the natural periodicity of household electricity consumption behavior to generate self-supervised signals: a positive sample pair containing view A and view B is constructed; view A is the original spatiotemporal subgraph. Original features View B is an enhanced spatiotemporal subgraph. Enhancement strategies include: randomly pruning continuous windows with probability. Randomly discard dynamic edges Preserve static edges Simulate occasional packet loss in sensors, apply a 10% dimension random mask to node features, and apply... Gaussian noise; Construct negative samples that include cross-time period negative samples and cross-family negative samples; cross-time period negative samples are representations of the same family on different dates within the same time window; cross-family negative samples are representations from other families; Through a nonlinear projection head Will Mapping to the contrast space, the contrast loss function is given using normalized temperature cross-entropy. ; End-to-end clustering is achieved using a deep Gaussian mixture model: Let the number of behavioral patterns be... The parameters of a deep Gaussian mixture model are output through a learnable network, and the posterior probability of the behavioral pattern on the latent representation is calculated using Bayesian rules. Negative log-likelihood is used as the clustering target. The joint contrastive loss gives the total training loss. Continue training until the total training loss is less than the loss threshold to obtain the clustering pattern; A semi-supervised annotation strategy based on rule-driven and manual verification is used to extract clustering patterns. Based on the statistical characteristics of the corresponding time period, semantic tags are matched according to preset rule templates to calculate the temporal distribution of clustering patterns. Output probabilistic user behavior profiles .

4. The method for detecting abnormal energy consumption of smart home appliances based on user behavior profiles according to claim 1, characterized in that, The method for constructing a dynamic energy consumption baseline model driven by both physical data based on the probabilistic user behavior profile includes: The physical prior layer establishes a theoretical power consumption benchmark based on the device type to obtain the theoretical power and physical uncertainty. The data-driven layer models residuals using a conditional variational autoencoder: defining the physical residuals. With maximum a posteriori behavior pattern To construct a lightweight conditional variational autoencoder; encoder decoder Given a training objective The posterior mean of the encoder is input into the decoder to obtain the residual correction. With residual uncertainty ; The dual-drive fusion layer includes the baseline mean. and baseline total variance ;in The power mean predicted by the physical model. This represents the average residual correction value of the decoder output. The inherent variance of the physical model. This refers to the variance of the residual uncertainty. Posterior probability of behavioral patterns Perform weighted fusion to obtain the power baseline variance Given a Bayesian online adaptive confidence interval The interval width coefficient is dynamically adjusted based on online coverage feedback. The expression is: ; in for, For target coverage, For learning rate, The total number of behavioral patterns, For equipment The final power baseline mean at time t, Let be the posterior probability of belonging to the c-th behavior pattern at time t. For the device in the c-th behavior mode The baseline mean of power, For equipment The power baseline variance at time t Let be the interval width coefficient at time t. The interval width coefficient at time t+1, For the measured power to fall within the confidence interval Experience frequency; If underreporting increases recently , Automatically increase; if false alarms increase, Automatic tightening.

5. The method for detecting abnormal energy consumption of smart home appliances based on user behavior profiles according to claim 1, characterized in that, The method for multi-scale anomaly detection and causal attribution based on the dynamic energy consumption baseline model includes: Multi-scale anomaly detection: Extracting power change rate Harmonic characteristics ,when and This is labeled as a cutting mutation; cognitive uncertainty is introduced into the conditional variational autoencoder. Constructing comprehensive uncertainty Calculate the uncertainty normalized anomaly score ,when A first-level core deviation detection is triggered at specific time points. If three or more consecutive time points trigger this detection, a second-level confirmation is performed, and the deviation is marked as a core deviation. A recursive cumulative summation is applied to the time-period residuals. ,when At that time, it is marked as slow degradation of the equipment; Constructing a minimal cause-effect graph ,node Attribution is classified into A1, B1, and C1 categories by using simplified judgment rules for intervention reasoning; among them For behavior, For occupation, For the environment, For device status, Energy consumption; Class A1: When , And energy consumption deviates If so, it is determined to be a equipment malfunction, and the causal effect size is calculated. Calculate the attribution confidence score for class A1. ; Category B1: When the user leaves Device not in standby mode Instantaneous scale no-twisting event If so, it is determined to be an malfunction caused by forgetting to turn off the electrical appliance, and the causal effect size is... The attribution confidence level for class B1 is ; C1 category: When the posterior distribution of behavior over multiple time periods for 7 consecutive days shows a systematic shift, the measured energy consumption deviates from the old baseline but falls within the baseline corresponding to the new behavior pattern, and there is no instantaneous abrupt change, it is determined to be a gradual change in behavior pattern, and the causal effect size is: The attribution confidence level is For C1 type, no exception alarm is triggered; instead, the probabilistic user behavior profile is updated directly. For confirmed abnormal periods, the attribution weights of the three categories are normalized. ,Pick Finally, the attribution is calculated, and the output quadruple is given: ;in For equipment number, For time indexing, The confidence level of the current attribution. For the first The causal effect size of each category.

6. The method for detecting abnormal energy consumption of smart home appliances based on user behavior profiles according to claim 1, characterized in that, A method for constructing an anomaly detection model for smart home appliances based on the causal effect magnitude includes: Obtain auxiliary features, and construct an input vector based on the causal effect size and auxiliary features. ;in For equipment Baseline deviation score at time t For behavioral drift divergence, For behavioral confidence, The probability of the room where the device is located being occupied. The causal effect of equipment failure. The causal effect of forgetting to turn off electrical appliances; The intelligent home appliance energy consumption anomaly detection model includes anomaly detection, attribution decision model, severity and confidence quantification, output interface and closed-loop feedback; anomaly detection employs uncertainty normalization scoring. ,when If the trigger frequency within the sliding window is greater than 60%, then it proceeds to the second attribution decision layer; otherwise, it is marked as normal. The abnormal scoring threshold is... Attribution decision model: Using causal effect size as the discriminant feature, a lightweight soft maximization classifier is constructed. Hard constraint rules are given based on equipment failure, forgetting to turn off electrical appliances, and gradual behavioral changes. If multiple conditions conflict, the rule is taken. The corresponding type; among which For the input vector Time anomaly belongs to the first The probability of a class For the first Class biased items, For the first The learnable weight vector of the class, For type index; the first The classes include Normal (N), Equipment Failure (A1), Forgot to Turn Off (B1), and Gradual Behavior Change (C1); Severity and confidence quantification: Severity level is ,according to The mapping is divided into four levels: prompt, general, verification, and urgent, with an attribution confidence level of 1. ;in The causal effect size corresponding to the attribution. The duration of the abnormality. The optimal class probability output by the classifier; Output interface and closed-loop feedback: Output detection results When the detection result is A1 or B1, a visual alarm is triggered; when the detection result is C1, no alarm is triggered, and a profile update command is directly output. For equipment number, For time indexing, For indicator functions, when It is 1 if it is true, otherwise it is 0.

7. A smart home appliance energy consumption anomaly detection system based on user behavior profiles, used to execute the method described in any one of claims 1-6, characterized in that, include: Data acquisition and processing module: used to collect multimodal data and regional monitoring data of preset smart home appliance scenarios, and to preprocess the multimodal data and regional monitoring data; The area monitoring data includes real-time power, current, voltage, dwell time, and movement trajectory; Semantic alignment and behavior profiling module: used to perform fine-grained semantic alignment on the multimodal data and the regional monitoring data, obtain a fused feature tensor, and construct a probabilistic user behavior profile based on spatiotemporal graph contrastive learning based on the fused feature tensor; Dynamic energy consumption baseline and causal attribution module: used to construct a dynamic energy consumption baseline model driven by physical data based on the probabilistic user behavior profile, and to perform multi-scale anomaly detection and causal attribution based on the dynamic energy consumption baseline model to obtain causal effect size; Model building and output module: used to build a smart home appliance energy consumption anomaly detection model based on the causal effect quantity, input the data to be detected into the smart home appliance energy consumption anomaly detection model, and output the detection results.