Hierarchical session-based intelligent socket local load behavior identification method

By employing a two-layer detection method involving electrical events and power consumption sessions, combined with feature patterns and class acceptance radius, the problem of load behavior identification under resource-constrained conditions on the smart socket side is solved, achieving efficient and accurate local power consumption monitoring and safety judgment.

CN123179042APending Publication Date: 2026-11-27GUILIN UNIV OF ELECTRONIC TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202611421343.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-14
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Under the condition of limited resources on the smart socket side, it is difficult to effectively identify load behavior, especially with electrical parameter data at intervals of 1 to 2 seconds. Existing methods are unable to retain the alternating high and low power structure of the cycle, and the inconsistency of model input and differences in hardware configuration lead to insufficient identification accuracy.

Method used

A two-layer detection method of electrical sub-events and power consumption sessions is adopted. By constraining the field set through feature patterns, using class acceptance radius and heterogeneous separation conditions, and combining centroid and confidence correction mechanisms, local load behavior identification is achieved.

Benefits of technology

Accurate identification of load behavior is achieved on a low-cost microcontroller, reducing communication overhead, improving the timeliness and accuracy of identification, and supporting local power consumption monitoring and safety judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123179042A_ABST
    Figure CN123179042A_ABST
Patent Text Reader

Abstract

The present application relates to electricity monitoring technology, disclose a kind of based on layered conversation intelligent socket local load behavior identification method.Electricity parameter is collected by intelligent socket at 1 second to 2 second interval, and the detection of electrical sub-event is carried out using no-load power baseline, hysteresis threshold and duration criterion, and the sub-event meeting interval condition is combined into electricity conversation;According to fixed feature mode extraction stage and conversation feature, load behavior is identified using local centroid-class radius model.When the nearest class distance, the difference of different class distance or the modified confidence does not meet the preset condition, the rejection result is output.The modified confidence is calculated in combination with model matching degree, data quality and conversation integrity.The method is used to retain the conversation structure of periodic load, and realizes the load behavior identification under the condition of low-frequency electric parameter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to smart home, IoT power consumption monitoring and embedded load identification technology, specifically to a method for aggregating electrical sub-events into power consumption sessions using second-level electrical parameters at the smart socket end, and combining fixed feature patterns, centroid and class acceptance radius to achieve local load behavior identification and rejection. Background Technology

[0002] With the development of smart home and IoT technologies, smart sockets are widely used in homes, apartments, dormitories, offices, and small shops. Existing smart sockets typically feature remote switching, power display, energy consumption statistics, timer control, and overcurrent protection. Some products can also upload data such as voltage, current, active power, and cumulative energy consumption to an IoT platform. Load behavior recognition can provide auxiliary information for refined power management and local safety assessments; however, the sampling frequency, storage space, and processing capabilities of smart sockets are all constrained by cost.

[0003] Among existing load identification methods, one type relies on high-frequency voltage and current waveforms, harmonics, phase differences, VI trajectories, or dedicated monitoring equipment, which places high demands on sampling frequency, analog front-end, storage capacity, and computing resources. For example, the patent application with publication number CN120994956A extracts the spectrum and transient features based on multi-scale time-frequency decomposition of voltage and current waveforms. This type of method is difficult to directly transfer to low-cost smart sockets that only provide second-level statistical electrical parameters.

[0004] Patent application CN122225681A describes a scheme for feature processing of operating parameters within a monitoring period and inputting them into a pre-trained model to obtain load labels and confidence levels; patent application CN117954919A describes a scheme for identifying the on-time and standby modes of electrical appliances using energy measurements over a baseline time period. For server-based identification architectures, continuous transmission of raw data increases communication overhead, and network connectivity conditions also affect the timeliness of socket obtaining identification results.

[0005] With only a 1-2 second sampling interval at the edge, the discriminative information of the load is mainly reflected in the second-level power time-series structure. If the sequence is divided only by the start and end thresholds of a single "electricity consumption event," the periodically temperature-controlled load may be prematurely terminated in each low-power phase, making it impossible to form multiple high and low power cycles within the same identified object. If optional sensing fields are directly concatenated as features, different hardware configurations will cause a mismatch between feature dimensions and model parameters. In addition, relying solely on the maximum score obtained by normalizing the relative distance of each category may still give a high relative score to unknown loads that are far from all known categories. The fixed time window may also span the boundaries of start-up, stability, low power, and stop, causing statistical features to overlap.

[0006] Therefore, a suitable load behavior recognition method for smart sockets is needed: a two-layer state structure of electrical sub-events and power consumption sessions is used to retain periodic behavior, the sensing field and feature dimension are constrained by fixed feature patterns, open set rejection is implemented by class acceptance radius and heterogeneous separation conditions, and a local model with parameter quantity and computational quantity that can be carried by low-cost microcontrollers is adopted. Summary of the Invention

[0007] The technical problem to be solved by this invention is: under the condition that the smart socket only provides electrical parameters at intervals of 1 to 2 seconds and the end-side resources are limited, to retain the high and low power alternation structure of the periodic load, to constrain the consistency between the hardware fields and the model input, and to output rejection results for samples that do not meet the acceptance conditions of known behavior, so as to provide load behavior information for local power consumption monitoring.

[0008] Purpose of the invention: To provide a two-layer detection method for electrical sub-events and power consumption sessions, which enables the electrical sub-event to end with a short low-power interval but does not immediately end the power consumption session, thereby preserving the alternation of high and low power cycles within the same power consumption session.

[0009] A fixed-dimensional feature extraction method is provided, which uses a set of constraint fields, sampling interval, dimension, order, and missing code to identify feature patterns, thus avoiding inconsistencies in the model input structure caused by optional sensing fields.

[0010] It provides an identification process consisting of robust standardization, type centroid, class acceptance radius, and dissimilar distance separation conditions, which can achieve the identification of known behaviors with limited model parameters and reject samples that do not meet the distance or confidence conditions.

[0011] A modified confidence mechanism is provided that evaluates model matching, required field data quality, and electricity session integrity separately, and right-truncated prefix training samples are used for rolling identification.

[0012] It provides pattern verification, integrity and signature verification of model parameters, as well as switching methods for inactive storage areas, and supports reporting session-level results and feature summaries.

[0013] Technical Solution: S1, end-side periodic acquisition of low-frequency electrical parameter data. The smart socket's main control chip acquires data including at least active power and timestamps via a metering circuit, with a sampling interval of 1 to 2 seconds. Optional fields include voltage, current, leakage current, power factor, cumulative energy, internal temperature, and relay status. The low-frequency data here are second-level statistical electrical parameters, excluding waveforms within the power frequency cycle. A feature mode is selected based on the available fields and sampling intervals from the hardware; numerical dimension, order, unit, missing data rules, and mask mapping are bound to this mode.

[0014] S2, End-side data preprocessing. Arrived but unprocessed sample points are sorted, deduplicated, and aligned to the predetermined sampling time. Missing markers for required fields are retained before numerical imputation for subsequent quality calculations. Short-term missing values ​​for continuous quantities can retain previous values ​​without using future samples; if the missing time exceeds the allowed duration, the missing state is retained. Relay states are only discretely preserved, without linear interpolation. Online output and prefix training use the same causal preprocessing; output results do not depend on samples arriving later.

[0015] S3, end-side detection of power consumption events. First, a hysteresis interval is formed using the baseline plus a first power increment and the baseline plus a second power increment. The sub-event boundary is confirmed based on the actual duration of continuous fulfillment of conditions; relay disconnection prioritizes terminating the sub-event. The first sub-event initiates a session, and after the sub-event ends, it enters a merge waiting state. When the next sub-event is detected within the merge duration, it is merged into the current session along with the low-power interval between the two; the session is confirmed to end only if the low power persists beyond the duration or the relay disconnects. During the merge waiting period, the session remains active, the baseline remains frozen, and the session integrity level must not be prematurely set to 1.

[0016] S4 segments the electricity consumption event into stages. Within a sub-event, the start-up stage is determined by the initial boundary, the stable stage is determined by the continuous satisfaction of the recent power change rate and fluctuation coefficient with stable conditions, and the stop stage is determined by the continuous decline and stop threshold. At the session layer, the coefficients of variation of the adjacent start interval and the high power duration are calculated for no less than three consecutive sub-events within a preset statistical interval. When both do not exceed the corresponding thresholds, the periodic operation stage is confirmed. The statistical interval can be the entire session or a predefined bounded continuous sub-event window in the model; the same rules are used for training and inference. The power change rate is calculated based on the actual time difference.

[0017] S5 extracts stage-level and event-level features. In a fixed-mode scenario, it outputs a D-dimensional numerical vector and a stage presence mask. Numerical features describe duration, number of sub-events, duty cycle, power statistics, initiation, stabilization, and cycle pattern. The mask indicates whether a stage has formed and maps it to the effective weights of the relevant numerical dimensions. Features of stages that have not formed are filled with the training median and have a weight of 0. Fields not provided by the hardware are not included in the corresponding mode, and the numerical dimension should not be arbitrarily increased or decreased during operation. Quality coefficients and completeness are used for confidence calculation and are not repeated as ordinary classification features.

[0018] S6: Run the local load behavior recognition model. The server organizes training and validation data by device groups, and stores the median, scale, type centroid, and class acceptance radius of each numerical feature. The main control chip uses the same mode to calculate the distance of each centroid; when there are multiple centroids of the same type, the minimum distance is taken as the distance of this type. Determine d1 and d2 from different types, and obtain the radius r1 of the centroid corresponding to d1. The candidate type is retained only when d1 ≤ r1 and d2-d1 ≥ Δd, otherwise distance rejection is output.

[0019] S7: Confidence correction and recognition result output. Calculate the relative matching score, absolute proximity score and model matching degree M, and then calculate the corrected confidence according to C=M×Qdata×Esession. If the distance condition is not met, it will be directly rejected; if the distance condition is met but C<Cmin, the low-confidence rejection will be output; only when all conditions are met will the known type be output. The output includes the type or rejection status, confidence and rejection reason. The unfinished session uses a dedicated prefix model or parameters, and maintains the corresponding truncation flag and integrity discount.

[0020] Beneficial effects: The two-layer structure of sub-events and sessions makes the short low-power interval only end the sub-event, so that multiple high and low power stages can be retained within the allowable combined duration, providing a unified statistical object for periodic behavior characteristics.

[0021] The fixed mode specifies the field, numerical dimension, order, unit and mask mapping, so that the model parameters are consistent with the end-side input.

[0022] The class radius and the heterogeneous distance difference simultaneously constrain the acceptance range of the candidate category, and then combined with the quality and integrity degradation processing, an interpretable rejection reason can be output for the session that does not meet the acceptance conditions.

[0023] The model body is composed of standardized parameters, centroids and radii, and the number of numerical parameters increases linearly with the feature dimension and the number of centroids. When using incremental statistics and bounded sub-event statistical windows, the number of original sampling and periodic description records that need to be retained can be limited.

[0024] The parameter package is written and switched in the inactive area after verification, which can retain the effective model when the update fails. When the session occurrence frequency is lower than the sampling frequency, only reporting the session-level results can reduce the transmission volume of conventional raw telemetry. Description of the drawings

[0025] Figure 1 It is the overall system architecture diagram provided by the embodiment of the present invention.

[0026] Figure 2 It is a flow chart of the end-side hierarchical recognition method provided by the embodiment of the present invention.

[0027] Figure 3This is a two-layer timing diagram of electrical sub-events and power consumption sessions provided in an embodiment of the present invention.

[0028] Figure 4 This is a schematic diagram illustrating the centroid-radius open set identification and confidence correction provided in an embodiment of the present invention.

[0029] Figure 5 This diagram illustrates the model training, signature distribution, and atomic switching deployment provided in an embodiment of the present invention. Detailed Implementation

[0030] The implementation method is illustrated below with reference to the accompanying diagrams. Parameter configurations and formula examples are used to illustrate the algorithm and data structure; records explicitly stated as offline analysis represent only the corresponding prototype analysis and are not considered as edge-side inference performance or complete system test results. Figure 3 and Figure 4 This is a schematic diagram of the principle; its coordinates, amplitudes, and distance relationships do not represent actual measured data.

[0031] Example 1: End-side Data Acquisition: The smart socket can employ a microcontroller with communication capabilities, a power metering circuit, a relay driver, and a status readback circuit. Internal temperature is provided by an available temperature acquisition channel. Feature modes are configured at the factory or during deployment according to hardware fields and sampling intervals. For example, the power mode uses power and a timestamp, while the extended mode can add current, power factor, power consumption, or internal temperature. Start / stop increments, acknowledgment durations, and session merging durations associated with the mode are stored as configuration parameters; the parameter set is determined before the session begins and remains unchanged during the session, without using the true category of the sample to be identified as input.

[0032] Sampling records must include at least an integer millisecond timestamp (timestamp_ms) and active power (power). Voltage, current, power, energy, and temperature are expressed in V, A, W, kWh, and ℃, respectively, with the field order and units fixed by the mode. The power factor can be obtained directly from the metering circuit or estimated from aligned power, voltage, and current as specified by the mode; the derived current should be greater than a preset effective lower limit, and abnormal or invalid inputs should retain a quality flag.

[0033] Temperature only indicates the thermal state of the socket, not the internal temperature of the appliance. The relay_state specification is 0 or 1 and is treated as a discrete state. Temporarily missing required fields are handled using established missing field handling and have their quality coefficient reduced, and are handled separately from fields that are not inherently available in the hardware and therefore not selected by the pattern.

[0034] Example 2: End-side event detection, stage segmentation, and scrolling recognition: such as Figure 2As shown, the main control chip performs causal preprocessing, sub-event detection, session aggregation, stage update, and recognition sequentially as samples arrive. Taking a 1-second interval as an example, the previous value of continuous quantities can be limited to a maximum of 2 sampling points; after exceeding this limit, missing values ​​are retained and not padded with subsequent samples. The complete record and prefix used for training are replayed according to the same process.

[0035] For example, the idle baseline is the median of historical inactive samples plus three times the absolute median difference. A set of normal power configurations can use 8W start increments and 4W stop increments, with at least two confirmations; low-power configurations can use 2W and 1W increments, with the shortest sub-event duration set to 20 seconds. The session merging duration can be set during deployment based on the target runtime scale, such as 300 seconds or 1800 seconds. For configurations with a high low-power operating platform, the start and stop thresholds should be above that platform and below the target high-power range; different configurations use corresponding processing methods to construct training features, and these features should be consistent with the parameter package through configuration identifiers. The above values ​​are configuration examples and do not indicate that a certain set of thresholds applies to all appliances.

[0036] like Figure 3 As shown, a single session contains several high-power sub-events and low-power intervals that have not exceeded the merging duration. After a sub-event ends, the session must still wait for the session termination condition; the session termination confirmation time in the figure is later than the termination boundary of the last high-power sub-event. The complete session characteristic interval in this implementation extends from the first sub-event to the last sub-event, including the low-power intervals between sub-events, and does not include the final waiting tail segment used for termination confirmation in the characteristic interval. Prefixes that have not yet been confirmed for termination use the currently observed interval and are marked with a right truncation flag. Termination is immediately confirmed when the relay is disconnected; the next startup will open a new session, and merging cannot cross disconnected states.

[0037] A stable phase can be confirmed after the slope and fluctuation of recent samples simultaneously meet the thresholds and persist for 10 to 30 seconds. Periodicity determination requires at least three sub-events; for example, for a window consisting of the four most recent consecutive sub-events, the coefficients of variation for the adjacent start interval and the duration of high power are calculated separately. A local periodicity is confirmed when both do not exceed 0.25. The window length and threshold are consistent during model training and edge processing. Unfinished sessions can be identified every 60 seconds using prefix parameters; if the minimum number of sub-events and consistency conditions are not met, the evidence is insufficient or other provisional results are output, indicating uncertainty about whether it is a periodic temperature control type.

[0038] Electric kettles, fans, and temperature control devices can exhibit different continuous power and cycle patterns under varying operating conditions. The classification is based on the behavior observed in this session, not solely on the appliance's name. Independent combinations that do not meet the conditions for a single device or a synchronous fixed load group may form features outside the training range; these will be rejected according to the same rules when considering trigger distance or confidence levels. Rejection results only indicate that the current feature has not been reliably accepted; distance alone cannot be used to infer the number of loads or specific faults.

[0039] As a segmented prototype observation, the applicant conducted offline Python analysis on a fixed-frequency portable air conditioner data acquisition record: with a start-up increment of 400W, a stop increment of 150W, and a merging duration of 1800 seconds, 23 high-power compressor sub-events were detected, with a high-power range of approximately 900W to 1100W and a low-power range of approximately 118W. The coefficient of variation of the entire period of this record did not meet the 0.25 condition, but there were intervals that met the local window consistency condition. Only about 10 seconds of low power was retained at the end of the record while the relay was still closed, which did not meet the session termination condition of this implementation method. Therefore, it is used to illustrate the segmentation and local period of the running segment and is not used as a complete session confidence example.

[0040] This observation indicates that the segmentation parameters need to be adapted to the predetermined power range and time scale. Fixed windows may cross stage boundaries, and shorter windows may not yet include the sub-events required for period determination; this method provides statistical objects across sub-events through session aggregation, and its applicability is determined by specific sampling conditions and parameter configurations.

[0041] Example 3: Model Training and Feature Definition (Server Side): The server organizes training, validation, and test records according to physical device identifiers. Repeated runs of the same device, different speed settings, and prefixes truncated from the same record should be kept in the same group. Feature transformation and threshold selection do not use the final test group. Complete sessions and right-truncated prefixes are constructed as samples according to their corresponding processing methods. The labeling rules first determine the periodic behavior of the current statistical interval, and then combine the operating conditions and available electrical parameters to select from other behavior types; labels cannot be changed solely based on device name or a single power factor value.

[0042] The table below provides behavioral patterns for reference during data collection and annotation; specific labels are based on session conditions and predefined mutual exclusion rules.

[0043] Sample source example Behavioral tags or status Main time series patterns Single heating setting, electric kettle, etc. resistive stabilization heating The heating phase is relatively stable; specific labels are determined based on the session conditions. Fans, small pumps, etc. Motor or inductive operation The electrical parameters change accordingly during startup and operation. Chargers, routers, etc. Electronic or low-power stability Low power, stable or slowly changing Temperature-controlled heating, compressor, etc. Cyclic temperature control Within the specified window, the condition of consistency between the number of sub-events and the period must be met. Conditions not met or no load Rejection or rule status No known centroid is established; the probability of composition is not determined solely by distance.

[0044] The closed or empty state is output by rules; the unknown and low confidence states are rejected, and no centroids for known types are established in either case. Composite load probes are used to observe situations exceeding predetermined access conditions; their absence from training does not necessarily mean they do not belong to any known behavior type. Manually verified samples are only used for subsequent training if the labels and feature patterns are consistent and the quality meets requirements.

[0045] The table below provides an example of an extended pattern for the 17-dimensional numerical features. The power pattern can select a fixed subset independent of current, power factor, and temperature; other extended patterns can also include features such as electrical energy, but the dimensions and order should be declared separately. Stage masks and right truncation flags are stored separately and are not counted repeatedly in these 17 numerical dimensions.

[0046] Numerical features Definition and applicable conditions 1. Session duration The complete session uses the feature interval from the start of the first sub-event to the end of the last sub-event; the prefix uses the observed interval. 2. Number of sub-events Number of confirmed sub-events in the current session or prefix 3. High power duty cycle The sum of the high-power durations of each sub-event divided by the duration of the corresponding characteristic interval 4. Average session power The average value of the effective power samples within the corresponding feature interval 5. Session power fluctuation coefficient Power standard deviation divided by the sum of the absolute value of the average power and the positive minimum. 6. Start-up power slope Power change during the first sub-event initiation phase divided by the actual time difference 7. Start-up peak power Maximum effective power has been achieved during the startup phase. 8. Stable average power The average effective power during the steady-state phase has been confirmed. 9. Standard deviation of stable power The standard deviation of effective power during the steady-state phase has been confirmed. 10-interval average power The average power of the low-power interval between sub-events as specified by the pattern 11-period median Median of adjacent start intervals within the scheduled sub-event statistics window 12. Coefficient of variation of period intervals Coefficient of variation of adjacent starting intervals within the same statistical window 13. High-power duration variation coefficient Coefficient of variation of the duration of high-power sub-events within the same statistical window 14-period amplitude The difference in representative power between high and low power ranges within the same statistical window 15 Power Factor Statistics Extended schema usage; source and statistical rules are defined by the schema declaration. 16 Average Current Extended mode is used; the average effective current value of the corresponding interval is obtained. 17. Internal temperature rise slope Extended mode usage; the change in internal socket temperature divided by the actual duration. Stage has a mask Save separately to determine if the corresponding numerical dimension is valid, and avoid double counting in D. Right truncation mark The prefix model's state input indicates that the session termination condition has not yet been confirmed.

[0047] Let the numerical vector be x = (x1, ..., xD). Each dimension can be transformed using an identity transformation or a sign-preserving log(1 + |xj|) transformation according to the pattern. The transformation rule is used for both training and inference, and the transformed value is denoted as uj. zj = (uj - mj) / max(sj, smin) is obtained using the transformed median mj and interquartile range sj of the training samples, where smin > 0. Dimensions without a defined stage are filled with mj and assigned a weight of 0; the weights of other effective dimensions are determined according to the pattern. One or more centroids can be established for the same type, and the centroids are calculated using effective samples from each dimension. The class acceptance radius can be taken as the 95th quantile of the distance between samples of the same type, and a positive lower limit rmin is set; for small samples, the configuration of the maximum distance multiplied by the expansion coefficient can be used. The server saves the separation threshold Δd, temperature parameter τ > 0, Cmin, and processing configuration together, and the parameter selection uses the training and validation grouping.

[0048] The applicant has generated a preliminary data collection record, comprising 9 devices and 17 non-empty records, categorized by device identifier. Eight of these devices serve as sources of known behavior samples, while one PID-controlled temperature heating station is reserved as an unknown probe. The typical sampling interval is 2 seconds. Offline Python prototype analysis has been conducted to observe the computability of sub-events, sessions, and distance features. This batch of records does not constitute proof that cross-device performance, complete confidence gating, or edge resource usage has been validated.

[0049] like Figure 4 As shown, the system first checks whether the fields and patterns match and whether there are enough effective weights, and then performs distance and confidence gating. If there are fewer than two known types, the model does not match, or all features are invalid, the system outputs a "model or data insufficient" status and does not perform distance comparisons that do not meet the defined conditions. When there are multiple centroids in the same category, the system first takes the minimum distance within that category, and then calculates d1 and d2 between different categories.

[0050] Example 4: End-side confidence correction and unknown load handling: The distance to the l-th centroid is calculated as dl = sqrt[Σj wj(zj-μlj)^2 / Σj wj], and inference stops when the denominator is 0. Let gk be the minimum centroid distance of the k-th class, then the relative matching score of the nearest class is Srel = exp(-d1 / τ) / Σk exp(-gk / τ), and the absolute proximity score is Sabs = exp[-(d1 / r1)^2], M = Srel × Sabs. These quantities are model matching scores and are not directly equivalent to the calibrated class probabilities. The corrected confidence is:

[0051] C = M × Qdata × Esession

[0052] Qdata = (1 - Rmiss) × (1 - Runstable), only the required fields specified by the statistical model. Rmiss is calculated on the resampling grid before missing data imputation; Runstable is calculated based on the original timestamp interval, for example, with a tolerance example of 50% deviation from the expected interval. Esession is only 1 if the start boundary has been observed and the session end condition has been confirmed; a configuration discount of less than 1 is applied if the data has started running, the end has been truncated, or is in a merge waiting period. The final known output requires d1 ≤ r1, d2 - d1 ≥ Δd, and C ≥ Cmin to be true simultaneously; the discount value and threshold are determined by the training and validation configuration.

[0053] The following are just examples of formula calculations; the values ​​do not represent new actual measurements. Assume the minimum distances for the four classes are 0.3, 2.0, 3.0, and 4.0 respectively, with r1=1.0, τ=1, Δd=0.3, Cmin=0.6, Qdata=0.98, and Esession=1. At this point, Srel is approximately 0.785, Sabs is approximately 0.914, M is approximately 0.717, and C is approximately 0.703. Both distance and confidence conditions are satisfied, and the nearest type can be output. If this is only to demonstrate the effect of the completeness coefficient, change Esession to 0.8 while keeping the other values ​​unchanged. Then C is approximately 0.562, which is lower than 0.6, and a low confidence level should be output; actual prefix recognition still requires the use of the corresponding prefix model. If d1 is greater than r1, then regardless of the relative matching score, direct distance rejection is performed.

[0054] Example 5: Edge Resource Consumption and Parameter Deployment: Taking D=17 numerical features, 4 classes, and 1 centroid per class as a configuration example, the median, scale, centroid, and radius total 2×17+4×17+4=106 values. If 32-bit floating-point storage is used, the main numerical parameters are 424 bytes. This is parameter estimation under a specified data type, excluding overhead such as pattern definition, mask mapping, threshold, signature, program, cache, and runtime stack, and is not considered as the measured total edge memory value. During implementation, a circular buffer of, for example, 120 sampling points can be maintained, and the count, cumulative sum, sum of squares, and extreme values ​​can be updated incrementally. For features requiring median or periodic consistency, a bounded continuous sub-event window pre-declared by the pattern can be used to save the duration, interval, and power summary within the window. The same window rules are used on the training end. The computational cost of centroid distance calculation is linearly related to D and L, and the complete pipeline overhead also depends on the selected statistical window and update frequency.

[0055] like Figure 5 As shown, the server exports the mode, transformation rules, scale, centroid, radius, threshold, version, and hardware identifier, calculates the integrity check value, and signs it. The socket checks the target hardware, mode, check value, and signature according to pre-set verification materials. Upon passing, it writes the data to the inactive area and performs a parameter structure and inference self-check. After the self-check passes, it atomically switches the active model identifier. If verification or self-check fails, the original valid model is retained. If a power outage occurs before switching submission, the last submitted and valid model is selected after restarting. Boundaries, types, or rejection states, confidence levels, and feature summaries can be reported by session. If the original curve is required, the corresponding telemetry configuration is enabled separately.

[0056] Example 6: Local Security Application of Identification Results: Identification results can serve as auxiliary input for local socket safety judgment. For sessions identified as resistive stable heating behavior and with a corrected confidence level reaching the safety application threshold, continuous power supply anomalies can be judged by combining the high power duration and the socket's internal temperature rise. For periodic temperature control behavior, if the duration of the current high power sub-event exceeds a preset multiple of the median duration of the previous complete high power interval, and the socket does not enter the low power interval within the expected transition window, and the slope of the socket's internal temperature change continuously exceeds the threshold, then "Suspected Periodic Control Anomaly" is output and a local alarm is triggered. This judgment describes an abnormal combination of power cycle and socket-side thermal state, does not equate the socket's internal temperature with the appliance's internal temperature, and does not directly assert the specific cause of the fault.

[0057] Hard power, current, leakage current, socket internal temperature, or temperature rise rate protection are executed independently of behavior recognition. When predetermined hard protection conditions are met, an alarm is triggered or the relay is disconnected according to the protection strategy. Unknown or low-confidence results that do not trigger hard conditions maintain the relay status, and the reason for rejection is reported for manual confirmation. Once the confirmed samples meet the label, pattern, and quality requirements, they can be used as subsequent training data.

Claims

1. A method for identifying local load behavior of a smart socket based on hierarchical sessions, executed by the main control chip of the smart socket, wherein the controlled output terminal of the smart socket is connected to a single electrical device or a fixed load group with synchronized working states during a single identification process, characterized in that... include: Low-frequency electrical parameters, including at least active power and timestamps, are collected at sampling intervals of 1 to 2 seconds. The received samples are then sorted by time, deduplicated, processed for missing causal information, and resampled to obtain a time series of electrical parameters with equal intervals. An idle power baseline is determined based on low-power samples during relay disconnection or that do not belong to active power consumption sessions. The baseline plus a first power increment and a second power increment are used as the sub-event start threshold and stop threshold, respectively, where the first power increment is greater than the second power increment. When the active power continuously meets the start threshold for a first confirmation duration, the electrical sub-event is confirmed to start; when the active power continuously meets the stop threshold for a second confirmation duration, the electrical sub-event is confirmed to end. A power consumption session is initiated with the first electrical sub-event. Adjacent electrical sub-events with an interval not exceeding a preset session merging duration are merged into a single power consumption session. The session is confirmed to end only if the low-power state persists beyond the session merging duration or a relay is disconnected. The session merging duration is greater than a second confirmation duration. Within each sub-event, start-up, stable operation, and stop phases are determined. A periodic operation phase is determined when the same session contains at least three sub-events and meets a preset periodic consistency criterion. A D-dimensional numerical feature vector and corresponding phase existence masks are extracted according to a fixed feature pattern that matches the hardware field configuration and sampling interval. The code; inputs the numerical feature vector and stage existence mask into the local load behavior recognition model of the socket, calculates the centroid distance of each known behavior type, obtains the nearest distance d1 and the second nearest distance d2 belonging to different types, and retains the candidate type only when d1 is not greater than the corresponding class acceptance radius r1 and the difference between d2 and d1 is not less than the preset separation threshold; calculates the corrected confidence based on the model matching degree, data quality coefficient and session integrity coefficient, and outputs the candidate type only when the distance condition and the corrected confidence threshold condition are both met, otherwise outputs the unknown or low confidence rejection result, and outputs the corrected confidence locally.

2. The method according to claim 1, characterized in that, The low-frequency electrical parameters also include one or more of the following: voltage, current, leakage current, power factor, accumulated energy, internal temperature of the smart socket, and relay status. The feature pattern is uniquely determined by the feature pattern identifier, which specifies the fields involved in the processing, sampling interval, numerical feature dimension D, feature order, unit of measurement, the correspondence between the stage existence mask and the feature dimension, and the missing handling method. The smart socket only loads the model parameter package that matches the feature pattern. Optional fields not selected by the pattern do not participate in distance calculation. The stage existence mask is used to determine the effective weight of the corresponding numerical feature and is not counted repeatedly in D as an additional continuous numerical dimension.

3. The method according to claim 2, characterized in that, The idle power baseline is the sum of the absolute median difference between the median of the baseline samples and a preset multiple; the baseline samples are preferentially taken from the relay disconnection period, and when the samples are insufficient, they are taken from the low power samples during the most recent inactive session, and the baseline is frozen during the active session and the session end waiting period; the first confirmation duration and the second confirmation duration are expressed as the actual time length, and each requires at least 2 consecutive sampling points to meet the corresponding conditions, and the event boundary is backtracked to the starting position of the corresponding consecutive conditions; candidate sub-events with a duration less than the preset shortest sub-event duration are discarded, and the shortest duration is not less than twice the sampling interval; The relay status is handled using discrete state processing that retains the previous value, without linear interpolation. When the relay changes from closed to open, the current sub-event and power consumption session are immediately terminated and the merged waiting state is cleared. When the low-frequency electrical parameters include current and accumulated power, the validity of the event is further verified by the direction of current change and the positive increment of accumulated power.

4. The method according to claim 2, characterized in that, The startup phase is determined from the boundary of the sub-event; the stable operation phase is determined when the absolute value of the power change rate and the local power fluctuation coefficient are not higher than the corresponding thresholds and remain stable for a preset time; the stop phase is confirmed based on the continuous power decrease and the stop threshold; within all sub-events of the same session or within a window of consecutive sub-events predefined by the mode, the periodic operation phase is determined when the coefficient of variation of the adjacent start interval and the coefficient of variation of the high power duration of at least 3 sub-events are not higher than the corresponding thresholds; the numerical characteristics include at least the session duration, the number of sub-events, the high power duty cycle, the session average power, the power fluctuation coefficient, the startup power slope, the startup peak value, the average power and standard deviation of the stable phase, the period amplitude, and the median of the period interval; Numerical features of unformed stages are filled with the median of training samples, and the corresponding weights are reset to 0 using a stage existence mask; when required fields are missing due to collection failures, they are also included in the data quality coefficient.

5. The method according to claim 4, characterized in that, The server utilizes a pre-trained model based on labeled sessions grouped by physical electrical equipment identifiers. The labeling targets are mutually exclusive load behavior types, with records from the same physical device and prefix samples extracted from it grouped into the same data group. Robust standardization is performed on each numerical feature using the median of the training samples as the center and the interquartile range as the scale, with a positive lower limit set for the scale. One or more centroids are established for each type, and the class acceptance radius is determined by the quantile distance from the corresponding training sample to the centroid, ensuring that the class acceptance radius is not less than the preset positive lower limit. The distributed parameter package includes feature pattern identifiers, sampling intervals, median, scale, centroid, class acceptance radius, separation threshold, confidence threshold, temperature parameter, and a category table. If the total number of centroids is L, then the number of the four main numerical parameters—median, scale, centroid, and radius—is 2D+L×D+L. Mask mapping, field definitions, and version information are stored separately as metadata.

6. The method according to claim 5, characterized in that, For features to be recognized, the weighted Euclidean distance is calculated using the same normalization parameters and masking rules as in training; when the sum of valid weights is 0, a rejection result indicating insufficient data is output. When the sum of valid weights is greater than 0, the l-th centroid distance is obtained by dividing the weighted sum of squared normalized differences of valid features by the sum of valid weights, then taking the square root; The relative matching score Srel is obtained by performing temperature parameter normalized exponential transformation on the negative values of the minimum distances of each type, the absolute proximity score is Sabs=exp[-(d1 / r1)^2], and the model matching degree is M=Srel×Sabs; the corrected confidence is C=M×Qdata×Esession, where Qdata=(1-Rmiss)×(1-Runstable), Rmiss is the proportion of missing cells of required fields on the resampled grid before missing value imputation, and Runstable is the proportion of intervals where the original timestamp interval deviates from the expected interval by more than the preset tolerance; Esession takes a value of 1 only when both the start boundary and end conditions are confirmed, and takes a discount value greater than 0 and less than 1 when data boundary truncation occurs or the session end has not been confirmed; when any of the conditions d1>r1, d2-d1<Δd, or C<Cmin is satisfied, a rejection result is output, where Δd is the separation threshold and Cmin is the confidence threshold.

7. The method according to claim 6, characterized in that, The known category set includes periodic temperature control behavior type, resistive stable heating behavior type, motor or inductive operation behavior type, and electronic or low-power stable behavior type; labeling is performed according to predetermined mutually exclusive rules, among which those satisfying the periodic consistency condition of claim 4 are preferentially labeled as periodic temperature control behavior type, and the rest are classified into one of the other types according to available electrical parameters and operating conditions; shutdown or no-load is determined by no-load baseline and relay state rules, and is not treated as a centroid category; unknown and low confidence are rejection states, and are not treated as known training categories; for independent load combinations that do not meet the access object conditions, a rejection result is output when their features trigger the rejection conditions.

8. The method according to claim 7, characterized in that, When performing rolling recognition on sessions that have not been confirmed to end according to a preset period, a rolling model or rolling parameters trained using right-boundary truncated prefix samples intercepted from complete sessions are used, the input includes a right truncation flag, and features are calculated only using data observed at that time; Undeveloped stages are encoded according to claim 4, and when the minimum number of sub-events and consistency conditions required for periodic determination are not met, a definite result of periodic temperature control behavior type is not output; Esession does not take a value of 1 when the session is still in the merge waiting period.

9. The method according to claim 7 or 8, characterized in that, The low-frequency electrical parameter data also includes the internal temperature of the smart socket. When the identification result is a periodic temperature control behavior and the corrected confidence level is not lower than the safety application threshold, if the duration of the current high-power electrical sub-event exceeds a preset multiple of the median duration of the previous complete high-power interval within the same power consumption session, does not enter the low-power interval within the expected transition window, and the slope of the internal temperature change of the smart socket continuously exceeds the preset temperature rise rate threshold within the preset temperature rise judgment time, then a suspected periodic control abnormal event is output and a local alarm is triggered on the smart socket. The internal temperature of the smart socket is only used to characterize the thermal state of the socket side. The method does not use the internal temperature of the connected electrical appliance as a direct measurement value; the method also includes performing at least one hard safety judgment of power threshold, current threshold, leakage current threshold, smart socket internal temperature threshold and temperature rise rate threshold independently of the load behavior recognition result; when any hard safety threshold is triggered, a local alarm is executed or the relay is disconnected according to the preset protection strategy; when none of the hard safety thresholds are triggered, the current state of the relay is maintained for unknown or low confidence results, an event-level message including the power session boundary, the reason for rejection, the corrected confidence and the feature summary is generated and reported to the server to request manual confirmation.

10. The method according to claim 5, characterized in that, The model parameter package also includes a version number, target hardware identifier, feature pattern identifier, sampling interval, integrity check value, and digital signature. After receiving the model parameter package, the smart socket first verifies the target hardware, feature pattern, integrity, and digital signature, then writes the verified model parameters into the inactive storage area, completes the self-check, and atomically switches to the active model. If verification or self-check fails, the previous valid model is retained. If a power outage occurs before the switching is completed, the model that has completed validity verification and has been submitted is selected after restarting.

Citation Information

Patent Citations

  • System and method for reducing energy consumption of one or more appliances using smart socket

    CN117954919A

  • Intelligent socket integrated with electric energy recording and counting functions and operation method thereof

    CN120994956A

  • Intelligent socket energy-saving control system based on load identification

    CN122225681A