Switch partner system for intelligently controlling on-off of power supply
By using an intelligent power switch companion system that controls the on/off state of the building, combined with reinforcement learning and multi-agent collaborative control, precise and dynamic management of building power is achieved. This solves the compatibility and energy waste problems of traditional building power control systems, and improves management efficiency and equipment compatibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-03-17
AI Technical Summary
Traditional building power control systems cannot dynamically adjust according to actual usage scenarios, resulting in energy waste, low management efficiency, poor compatibility, and increased renovation costs.
The intelligent power supply control switch companion system includes a data acquisition module, an intelligent control module, and an execution module. Through reinforcement learning algorithms and multi-agent collaborative control, it achieves millisecond-level precise on/off control of the main circuit and branch circuits, supports single-live/zero-live dual-mode power supply, and is compatible with existing building switch boxes.
It achieves precise power control that dynamically adjusts according to the scenario, reduces building energy consumption, improves management efficiency, is compatible with existing equipment, has multiple protection functions, and supports remote monitoring and fault early warning.
Smart Images

Figure CN121688858A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent control, and more particularly to a switch companion system for intelligently controlling the on / off state of power supply. Background Technology
[0002] Buildings currently account for a significant portion of energy consumption, and traditional building power control systems have many drawbacks: First, the main circuit control is crude and cannot be dynamically adjusted according to actual usage scenarios; second, the compatibility of switching equipment is poor, and single-live and neutral-live wiring scenarios require separate selection, increasing the cost of renovation; third, there is a lack of intelligent algorithm support, resulting in serious energy waste, such as equipment continuing to run when no one is in public areas and the long-term accumulation of standby power consumption of office equipment.
[0003] To address the aforementioned issues, and focusing on building smart renovation and energy-saving scenarios, there is an urgent need for an intelligent power control switch companion system that can achieve precise and efficient control of the building's main circuit and branch circuit power supply, reduce building energy consumption, and improve management efficiency. Summary of the Invention
[0004] To address the aforementioned issues, this invention provides an intelligent power supply switching companion system. Based on an intelligent algorithm, it achieves millisecond-level precise on / off control of the main circuit and key branch circuit power supplies, reducing energy consumption. Furthermore, it can dynamically adjust the control strategy according to the scenario and supports single-wire / zero-wire dual-mode power supply.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: This invention provides an intelligent power supply control switch companion system, including a data acquisition module, an intelligent control module, and an execution module connected by communication; Data acquisition module: used to collect multi-dimensional data such as personnel status, environmental parameters, and electrical load, and to preprocess the collected data; Intelligent control module: It is used to analyze the collected data, combine the identified current scene, the constructed energy consumption distribution map, and the predicted power quality, and dynamically adjust the control parameters based on the reinforcement learning algorithm to generate power on / off control commands; Execution module: Used to drive the corresponding equipment to perform actions according to the control commands generated by the intelligent module, so as to realize the on and off control of the circuit power supply; The intelligent control module includes a scene recognition unit, an energy consumption analysis unit, a power quality monitoring unit, and a control decision unit. Scene recognition unit: Based on preprocessed data and combined with time dimension information, it automatically recognizes building scenes, including office areas, public corridors and equipment rooms; Energy consumption analysis unit: used to analyze energy consumption data, monitor loop energy consumption in real time, and construct energy consumption distribution map; Power quality monitoring unit: It monitors the quality of collected real-time power data by constructing a power quality monitoring model, compares it with standard data, and predicts whether the quality is up to standard; Control Decision Unit: Formulates exclusive control rules according to different scenarios, generates a set of control strategies based on reinforcement learning algorithms and searches for the optimal solution set, and integrates the decisions of fuzzy scenarios to generate the final control commands.
[0006] As a preferred approach, in the scene recognition unit, for three target scenes—office areas, public corridors, and equipment rooms—differentiated features are extracted, and multi-condition combination matching rules are established. The integrated scene data frames are compared one by one to initially determine the scene category. A confidence calculation mechanism is introduced to assign weights to the matching rule items for each scene, calculate the matching score for each frame of multi-frame data, and the scene confidence is the average of the scores of multiple frames. A confidence threshold is set to determine the current scene category. At the same time, data changes are monitored in real time, and scene triggering conditions are set to dynamically update the recognized scene.
[0007] As a preferred approach, energy consumption data is analyzed from three dimensions: time, space, and equipment. An energy consumption distribution map is constructed based on the management scenario requirements. The energy consumption distribution map includes three types: overall hierarchical energy consumption distribution map, regional physical space energy consumption distribution map, and equipment type energy consumption distribution map.
[0008] Preferably, the power quality monitoring model includes a dual-branch structure, which outputs the current qualified / unqualified judgment result through a random forest classifier, outputs the future qualified probability through a LightGBM regressor, and compares the preprocessed real-time data with a set threshold, which includes a basic national standard threshold, a scenario-defined threshold, and a dynamic trend threshold; and outputs the final conclusion by combining the real-time comparison results and the model prediction results.
[0009] Preferably, the control decision unit generates control commands by including the following steps: Set scene-specific control rules and assign priorities, with the priorities from high to low being: safety rules, basic scene rules, and energy-saving rules; A scene weight factor and a feedback adaptive mechanism are introduced into the reward function to dynamically balance the weights of multiple objectives and adapt to scene changes. Based on the power quality time series data after Kalman filtering, linear regression is used to predict the trend of power quality index changes in the next 3 and 5 minutes. With the objectives of minimizing energy consumption, optimizing user experience, and ensuring qualified power quality, the MARL algorithm is used to optimize regional cooperative control and generate a set of control strategies. Based on the NSGA-II algorithm, the optimal solution set is searched among the three objectives of minimum energy consumption, optimal user experience, and qualified power quality. The final control strategy is selected by combining the scene weight factor. For fuzzy scenarios, qualitative descriptions are transformed into quantitative decisions based on fuzzy logic algorithms, and the quantitative decisions are integrated with the final control strategy to generate the final control instructions.
[0010] Preferably, generating a control policy set includes the following steps: Based on the physical division and functional attributes of building areas / loops, a two-layer architecture of local execution agents and global coordination agents is constructed. Each agent's state space, action space, and reward function are defined based on the goals of minimum energy consumption, optimal user experience, and acceptable power quality. Training is performed based on a multi-agent deep deterministic policy gradient algorithm; Design conflict detection logic based on conflict type and set conflict resolution priority rules; The optimal strategies of each agent are integrated with global coordination rules to form a set of scenario-based control strategies.
[0011] As a preferred approach, the optimal solution set is searched based on the NSGA-II algorithm, and the final control strategy is selected by combining the scene weight factor, including the following steps: The three objectives of energy consumption, user experience, and power quality are uniformly quantified into a maximum objective score, and decision variables and constraints are defined. The control strategy is encoded into chromosomes using real-number encoding, and the population size is set and initialized. For all individuals in the current population, stratify them according to dominance relationship and select the top-level individuals that are not dominated by any other individuals; Calculate the crowding degree of each individual and generate a better strategy through genetic operations; Calculate the weighted total score of the three objectives and the scene weights, select the strategy with the highest total score as the final control strategy, and convert it into control command output.
[0012] Preferably, the execution module includes a power supply mode switching unit, a drive unit, and a circuit protection unit; Power supply mode switching unit: used to detect the neutral and live wires in the circuit, and switch to the corresponding power supply mode according to the detection result. The power supply modes include neutral-live power supply mode and single-live power supply mode. Drive unit: It adopts a composite drive method combining relays and MOSFETs to drive and execute equipment actions according to control commands; Circuit protection unit: It realizes the circuit protection function through a four-fold circuit protection mechanism, which includes circuit overcurrent, overvoltage, short circuit and surge.
[0013] Preferably, the system also includes an anomaly handling module, which is electrically connected to the data acquisition module, the intelligent control module, and the execution module. This module is used to monitor the system status in real time, issue an early warning when an anomaly is detected, and automatically switch to the local emergency mode. It executes control based on preset basic rules and continuously attempts to restore communication and sensor functions.
[0014] Preferably, it also includes an application module, which is electrically connected to the data acquisition module, intelligent control module, and execution module. It is used to provide managers and maintenance personnel with a visual management interface and function access, and can realize equipment management, real-time monitoring, remote control, fault early warning and strategy configuration functions. It supports docking with the smart city energy management platform to realize multi-building energy consumption collaborative optimization.
[0015] The beneficial effects of this invention are as follows: This invention, based on intelligent algorithms and incorporating multi-dimensional data such as personnel presence, environmental parameters, and electrical load, achieves millisecond-level precise on / off control of the main circuit and key branch circuits, reducing energy consumption. It can dynamically adjust according to different scenarios, such as automatic power-off during unoccupied periods and intelligent shutdown in case of abnormal loads, for different scenarios including public areas and office areas in buildings. Through hardware circuit optimization, an embedded P1 control module is designed in the switch box, supporting single-live / neutral dual-mode power supply, compatible with existing mainstream switch boxes such as the 86-type and 118-type, eliminating the need for rewiring during upgrades and reducing construction costs. It features multiple protection functions including overcurrent, overvoltage, short circuit, and surge protection, adapting to complex building power environments. It supports integration with building intelligent management platforms and IoT gateways, enabling remote monitoring, data statistics, and fault early warning functions, improving the level of intelligent building energy management. Attached Figure Description
[0016] Figure 1 This is a block diagram of a switch companion system for intelligent power supply control according to the present invention. Detailed Implementation
[0017] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided.
[0018] Please see Figure 1 As shown, the present invention provides an intelligent power supply control switch companion system, including a data acquisition module, an intelligent control module, and an execution module connected by communication; Data acquisition module: used to collect multi-dimensional data such as personnel status, environmental parameters, and electrical load, and to preprocess the collected data; Personnel Status Data: The presence status of personnel in the area is detected by fusing human infrared sensors (PIR) and microwave radar sensors. AI visual recognition technology is introduced and combined with camera data to improve the accuracy of personnel presence detection. It supports the analysis of personnel flow trajectories in multiple areas and provides a basis for dynamically adjusting control strategies (such as power outage delay).
[0019] Environmental parameter data: Ambient light intensity is collected by a light sensor, ranging from 0 to 100,000 lux, to determine whether lighting equipment needs to be turned on; ambient temperature and humidity data (temperature -20-60℃, humidity 0-100%RH) are collected by a temperature and humidity sensor to help determine the operating requirements of equipment such as air conditioners.
[0020] Electrical load data: Real-time monitoring of circuit current (0-63A), voltage (170-250V), power and other parameters via current / voltage sensors, with a sampling frequency of 10Hz and a measurement accuracy of ±1%.
[0021] The collected data is preprocessed, and a Kalman filter algorithm is used to filter real-time changing data such as current and voltage to remove high-frequency noise caused by power grid fluctuations. For personnel detection data, a sliding window averaging method is used to avoid misjudgments caused by brief personnel movements; the window size can be set to 3-5 seconds. Data with different dimensions, such as light intensity, temperature, humidity, and current, are mapped to the [0,1] interval to ensure the consistency of the algorithm's input data. Based on the 3σ criterion, abnormal data such as over-range data (e.g., over-range data caused by sensor failure) are identified, and backup sensor data or historical averages are automatically used to fill the gaps, ensuring data continuity.
[0022] Intelligent control module: It is used to analyze the collected data, combine the identified current scene, the constructed energy consumption distribution map, and the predicted power quality, and dynamically adjust the control parameters based on the reinforcement learning algorithm to generate power on / off control commands; The intelligent control module includes a scene recognition unit, an energy consumption analysis unit, a power quality monitoring unit, and a control decision unit; Scene recognition unit: Based on preprocessed data and combined with time dimension information, it automatically recognizes building scenes, including office areas, public corridors and equipment rooms; Specifically, the preprocessed data is linked and integrated according to timestamps to form a unified scene recognition dataset, ensuring that personnel, environment, and electricity consumption data at the same point in time can be analyzed in a correlated manner. For example, at 14:30 on a weekday, there are people in office area A, the light intensity is 300 lux, and the current is 5A. For three target scenes—office areas, public corridors, and equipment rooms—distinctive features are extracted, and multi-condition combination matching rules are established. The integrated scene data frames are compared one by one to initially determine the scene category. The matching rules are formulated by combining core conditions (all must be met) with auxiliary conditions (at least one needs to be met), for example: Office area: Differentiated characteristics: Personnel characteristics: Personnel presence is concentrated in certain time periods, with a high probability of being present during working hours and a high probability of leaving during non-working hours, with a relatively long duration of presence, usually ≥10 minutes; Environmental characteristics: Lighting requirements vary with personnel activity, needing to be maintained at 300-500 lux during working hours, and temperature and humidity need to match office comfort, with a temperature of 22-26℃ and humidity of 40%-60%; Power consumption characteristics: Load has stable fluctuations, with power consumption stable at 100-500W during working hours, corresponding to equipment such as computers and printers, and power consumption ≤5W during non-working hours, only standby load; Time characteristics: Strongly correlated with weekdays / working hours.
[0023] Key requirements: The date must be a weekday and the time period must be during working hours; the person must be present and have been present for at least 5 minutes; and the real-time power consumption must be between 100-500W (which meets the load requirements of office equipment).
[0024] Auxiliary conditions: Illumination intensity of 300-500 lux (office lighting requirements); ambient temperature of 22-26℃ (office comfort range).
[0025] Public corridor: Differentiated characteristics: Personnel characteristics: Personnel presence is transient, with a passage time of ≤30 seconds, no long-term stay, and the flow trajectory is linear; Environmental characteristics: Lighting requirements vary with time of day, relying on natural light during the day, no supplementary lighting is needed when the light intensity is ≥500 lux, and low illumination of 100-200 lux is required at night to avoid darkness; Electricity characteristics: Single and low-power load, only lighting load, power of 10-30W, no continuous and stable load; Temporal characteristics: Personnel presence is dispersed in time periods, with no clear distinction between work and non-work, such as dense crowds during commuting peak hours.
[0026] Key conditions: Personnel status is present, but the duration of presence is ≤30 seconds; real-time power is in the range of 10-30W (lighting load only); personnel movement trajectory is linear.
[0027] Auxiliary conditions: Light intensity varies with time of day (≥500 lux during the day, ≤200 lux at night); no stable continuous load (power fluctuation ≤±2W).
[0028] Equipment room: Differentiated characteristics: Personnel characteristics: Low frequency and short duration of personnel presence, only present during maintenance, with each instance lasting ≤1 hour, and no personnel present during normal times; Environmental characteristics: Strict thresholds for temperature and humidity, with temperatures ≤40℃ and humidity ≤70%, otherwise equipment is prone to failure; No specific lighting requirements, as server rooms are mostly enclosed and rely on internal lighting; Power consumption characteristics: Continuous and stable load, with power consumption remaining stable within the rated range for 24 hours, such as a server load of 50-100A, with fluctuations ≤±10%, and no significant time-of-day differences; Time characteristics: Weak correlation with maintenance schedules, with personnel data only possible during maintenance periods.
[0029] Key conditions: Personnel status is absent (normal status) or present for ≤1 hour (maintenance status); real-time power is stable within the rated range (e.g., 50-100A), with fluctuation range ≤±10%; ambient temperature ≤40℃ (safety threshold for data center equipment).
[0030] Auxiliary conditions: Illumination intensity of 300-500 lux (office lighting requirements); ambient temperature of 22-26℃ (office comfort range).
[0031] To address initial matching biases caused by data fluctuations, a confidence calculation mechanism is introduced. This mechanism verifies the final scene using multiple frames of data, reducing the false positive rate. Specifically, weights are assigned to the matching rules for each scene, such as 60% for core conditions and 40% for auxiliary conditions. A matching score is calculated for each of the 10 consecutive frames (1 second total), with 20% awarded for meeting a core condition and 10% for meeting an auxiliary condition, up to a maximum score of 100%. The scene confidence score is the average of the scores from the 10 consecutive frames.
[0032] The system sets a confidence threshold to determine the current scene category: if the confidence of a scene is ≥90%, the current scene is confirmed as a preliminarily identified scene; if the confidence of all scenes is <70%, data supplementation is triggered, extending the data collection time to 5 seconds, supplementing personnel and environmental data, and recalculating the confidence; if the confidence is between 70% and 90%, it is determined by combining historical scene inertia, that is, relying on the recently confirmed historical scene identification results to assist in completing the final determination of the current scene. In essence, it utilizes the continuity and stability of building scene changes to reduce misjudgments caused by instantaneous data fluctuations, ensuring the consistency and reliability of scene identification. For example, if the first 5 minutes are all office areas, it is prioritized as an office area. At the same time, it continuously monitors data changes and sets scene trigger conditions to dynamically update the identified scene to ensure real-time performance.
[0033] Energy consumption analysis unit: used to analyze energy consumption data, monitor loop energy consumption in real time, and construct energy consumption distribution map; Specifically, the system receives real-time voltage / current data and timestamps from the data acquisition module, while simultaneously recording loop identifiers and associated regions / equipment. It then performs noise reduction, outlier removal, and standardization on the data, converting the acquired voltage / current into quantifiable energy consumption indicators. Instantaneous active power P = U(t) × I(t) × cosφ; where U(t) and I(t) are instantaneous voltage / current, and cosφ is the power factor with an accuracy of ±2%, reflecting the current energy consumption intensity of the circuit in real time; Cumulative energy consumption ;in, The instantaneous power of the nth time, Δt=0.1 seconds, is automatically archived by minute / hour / day, quantifying the total energy consumption of the loop in the specified time period; Energy consumption per unit area E / ㎡ = Cumulative energy consumption of the area ÷ Area area (the area area needs to be configured in the system in advance, such as 1F office area = 200㎡), compare the energy efficiency of different areas; Energy consumption percentage = Energy consumption of a certain loop / area ÷ Total energy consumption × 100%, clarifying the contribution of each loop / area to the total energy consumption.
[0034] Energy consumption data is analyzed from three dimensions: time, space, and equipment. Time dimension: Analyze energy consumption trends in real time / hourly / daily / weekly / monthly (e.g., energy consumption during office circuit working hours from 9:00 to 18:00 accounts for 80% of the day's energy consumption) and identify peak energy consumption periods; Spatial dimension: Analyze according to the hierarchy of "floor → area → loop" (e.g., "1F → East office area → No. 1 loop") to locate high-energy-consuming spaces; Equipment dimension: Analyze the energy consumption ratio by equipment type (lighting / air conditioning / office equipment / data center equipment) (e.g., data center equipment accounts for 30% of the total energy consumption) to identify high-energy-consuming equipment types.
[0035] Energy consumption distribution maps are constructed and updated in real time according to management scenario requirements, including: Overall hierarchical energy consumption distribution map: A tree-like data structure is established according to "total circuit → floor circuit → area circuit → single circuit", the energy consumption ratio of each level is calculated, real-time power is associated, and abnormal circuits are marked, which can quickly locate high energy consumption branches; the hierarchical relationship can be displayed by combining tree diagrams and ring diagrams.
[0036] Regional physical space energy consumption distribution map: Combined with the building floor plan, the location coordinates of each area are marked, and the energy consumption per unit area (E / ㎡) of each area is associated with the corresponding coordinates. The energy consumption level is divided according to the E / ㎡ threshold, and the energy consumption distribution of each physical area is displayed, intuitively locating high energy consumption areas; the floor plan is used as the base map, and a heat map is superimposed to represent the energy consumption level.
[0037] Equipment type energy consumption distribution map: The circuits are classified according to equipment type, the total energy consumption and proportion of each equipment type are calculated, real-time power is correlated, the number of abnormal circuits of each equipment type is counted, the energy consumption proportion and trend of different equipment types are displayed, and high energy consumption equipment is identified; it can be displayed using a combination of pie charts and line charts.
[0038] Power quality monitoring unit: It monitors the quality of collected real-time power data by constructing a power quality monitoring model, compares it with standard data, and predicts whether the quality is up to standard; Process the real-time collected data: Instantaneous current, instantaneous voltage, frequency, and phase information are collected, and timestamps, load types, and power supply modes are recorded synchronously. Peak suppression, phase calibration, and missing value filling are performed on these data, and all basic indicators are mapped to the [0,1] interval.
[0039] Calculate the basic characteristic indicators, including voltage deviation (ΔU%), frequency deviation (Δf), voltage distortion rate (THD-u), current distortion rate (THD-i), power factor (cosφ), and voltage fluctuation and flicker (Pst).
[0040] Extracting time-series derived features: Calculate the mean, maximum, volatility, and slope of the indicator over the past 1 / 5 / 10 minutes using a sliding window with a step size of 1 minute.
[0041] Scene feature encoding: The load type (lighting=0, air conditioning=1, computer room equipment=2), power supply mode (single fire=0, neutral fire=1), and time period label (working hours=0, non-working hours=1, holidays=2) are encoded using one-hot encoding and converted into numerical features.
[0042] Set thresholds, including: Basic national standard thresholds: Based on national standards such as GB / T12325-2022 and GB / T14549-1993, the mandatory thresholds of core indicators (such as voltage deviation ±7%, THD-u≤5%, frequency deviation ±0.2Hz) are clearly defined and are applicable to all circuits, serving as a hard benchmark for "qualified / unqualified".
[0043] Customizable thresholds for different scenarios: Adjust thresholds for different loads / areas (e.g., the THD-u threshold is adjusted to ≤3% for equipment in the computer room that is more sensitive to harmonics; the voltage fluctuation threshold is relaxed to ±10% for single-wire circuits with small loads), and automatically match based on scenario auxiliary features to improve the accuracy of judgment.
[0044] Dynamic trend threshold: The normal fluctuation range calculated based on historical data (e.g., the normal range of power factor during working hours in the office area is 0.9-0.95). If the indicator exceeds this range and continues to deteriorate, it is judged as "potential non-compliance" and used for compliance prediction to capture the trend risk of the indicator.
[0045] The real-time comparison process is as follows: Step 1 (Basic Threshold Comparison): Compare the pre-processed 6 core indicators with the basic national standard thresholds one by one. If any indicator exceeds the threshold (e.g., THD-u=6%>5%), it will be directly judged as unqualified and trigger a level 1 warning. Step 2 (Scene Threshold Calibration): If the basic threshold comparison is qualified, then compare it with the scene-defined threshold (e.g., data center loop THD-u=4%>3%). If the indicator exceeds the scene-defined threshold, it is determined that the scene adaptation is unqualified and a level 2 warning is triggered. Step 3 (Trend Threshold Verification): If the first two steps are both qualified, check whether the indicator exceeds the dynamic trend threshold (e.g., office area power factor = 0.88 < 0.9). If it exceeds the threshold and the slope of change is negative (continuously decreasing), it is marked as potentially unqualified.
[0046] A power quality monitoring model is constructed, and the model architecture is as follows: Input layer: Real-time basic power characteristics (voltage deviation, frequency deviation, THD-u, THD-i, power factor, voltage flicker Pst), time-series derived characteristics (mean, maximum, volatility, and slope of each indicator in the last 1 minute / 5 minutes / 10 minutes), and scenario auxiliary characteristics (load type, power supply mode, and time period label). First layer: Temporal feature extraction layer (LSTM network): Input the time-series energy data of the past 10 minutes, capture the trend of index change, and output a 256-dimensional temporal feature vector; The second layer: Feature fusion layer (fully connected network): The temporal features output by LSTM are concatenated with scene auxiliary features, and normalized by BatchNorm to reduce interference caused by scene differences; Third layer: Predictive output layer (dual-branch structure): Branch 1 (Classification Branch): Uses a random forest classifier to output the "current qualified / unqualified" judgment result (based on the mapping relationship between features and standard thresholds). Branch 2 (Regression Branch): Uses LightGBM regressor to output "future qualification probability" (fitting prediction based on historical trends and scenario patterns). Constraint layer: Introduce hard constraints based on national standard thresholds. If the real-time value of a certain indicator exceeds the mandatory threshold of the national standard (such as THD-u > 5%), it will be directly judged as "unqualified" and will have higher priority than the model output.
[0047] Collect at least 3 months of historical building electricity data, divide qualified / unqualified samples according to national standard thresholds and manual annotation to construct a training set, and use a joint loss function of cross-entropy loss (classification) and MSE loss (regression) to train the model end-to-end.
[0048] The predictive inference process is as follows: Step 1 (Feature Input): Combine the basic features, time-series derived features, and scene features into a 13-dimensional input vector and input it into the power quality monitoring model; Step Two (Model Reasoning): The classification branch outputs "Current State Correction Result": If the real-time comparison shows "Potentially Unqualified", the model combines time-series features to determine whether it is a misjudgment (e.g., if the power factor drops briefly and then rises rapidly, the model corrects it to "Qualified"). The regression branch outputs "probability of passing in the next 5-10 minutes": based on historical similar time series patterns (e.g., if the voltage deviation has slowly increased in the past 3 times and then exceeded the standard, and the current trend is the same, the probability of passing is predicted to be ≤30%). Step 3: Combine the real-time comparison results with the model prediction results to output the final conclusion: If the current pass rate and the probability of future pass rate are ≥90%, then the status is: Normal. If the current pass rate is 60%-90% and the probability of passing in the future is 60%-90% → Status: Watch (Trend Warning); If the current pass rate and the probability of future pass rate are less than 60%, the status is: high risk (predicted exceedance). If the current condition is unqualified → Status: Unqualified (Immediate warning).
[0049] The application module provides real-time visualization of "current status, pass rate, and key influencing indicators," and plots indicator trend curves and standard threshold lines.
[0050] Control Decision Unit: Formulates exclusive control rules according to different scenarios, generates a set of control strategies based on reinforcement learning algorithms and searches for the optimal solution set, and integrates the decisions of fuzzy scenarios to generate the final control commands.
[0051] The control decision unit generates control commands by including the following steps: Set scene-specific control rules and assign priorities, with the priorities from high to low being: safety rules, basic scene rules, and energy-saving rules; First, the Level 1 safety rules are verified. If they are triggered (e.g., severe power quality anomalies), an "emergency power outage" command is generated directly, skipping subsequent learning and optimization steps. If the Level 1 safety rules are not triggered, the Level 2 scenario basic rules are matched to determine the basic control strategy for the current scenario (e.g., maintaining power supply during office hours). Finally, the Level 3 energy-saving rules are loaded as the initial control parameters for reinforcement learning (e.g., a default power outage delay of 5 minutes).
[0052] A scene weight factor and a feedback adaptive mechanism are introduced into the reward function to dynamically balance the weights of multiple objectives and adapt to scene changes. The scene weights are dynamically adjusted by the scene recognition unit. For example, they can be adjusted according to the time period, such as working hours / overtime hours (experience weight 0.6, energy consumption weight 0.3, power quality weight 0.1); holidays / non-working hours (energy consumption weight 0.6, experience weight 0.2, power quality weight 0.2).
[0053] Feedback Adaptive Mechanism: If the frequency of user manual correction commands is ≥3 times / day (such as frequent restarts of power outage circuits), the experience weight will be automatically increased; if the power quality is abnormal ≥2 times / week, the power quality weight will be increased.
[0054] Based on the power quality time series data after Kalman filtering, linear regression is used to predict the trend of power quality index changes in the next 3 and 5 minutes. Specifically, the system directly retrieves six types of core power quality time-series data processed by the power quality monitoring unit. Targeting the short-term linear trend characteristics of power quality indicators, it employs independent modeling for each indicator to avoid interference from inter-indicator correlations and simplify the model structure. Filtered time-series data from the past 10 minutes is selected as input to the historical feature window. The prediction targets are clearly defined as the indicator values at two key time points: the next 3 minutes and the next 5 minutes. Multivariate linear regression (for a single prediction indicator) is used for training. Based on the trained model and the statistical characteristics of the time-series data within the historical feature window, such as the mean, maximum value, slope, and volatility within 10 groups, the predicted indicator values for future time points are calculated.
[0055] By comparing the predicted values for the next 3 minutes and 5 minutes, and combining them with historical trends, the system outputs a trend conclusion of "rising / falling / stable," providing a clear basis for subsequent early warning and control. Simultaneously, the trend judgment results are synchronized to the power quality monitoring unit. For example, the voltage deviation trend judgment conditions are: predicted value for the next 5 minutes > predicted value for the next 3 minutes, and historical slope k > 0 → judged as rising; predicted value for the next 5 minutes < predicted value for the next 3 minutes, and historical slope k < 0 → judged as falling; the difference between the predicted values for the next 5 minutes and 3 minutes ≤ 0.1%, and historical slope k ≤ 0.005% / min → judged as stable.
[0056] With the objectives of minimizing energy consumption, optimizing user experience, and ensuring adequate power quality, the system optimizes regional cooperative control based on the Multi-Agent Reinforcement Learning (MARL) algorithm to generate a set of control strategies. The process of generating a control policy set includes the following steps: Based on the physical division and functional attributes of building areas / loops, a two-layer architecture of local execution agents and global coordination agents is constructed. Based on the correlation between loops / functional areas, each loop / area is set as a local execution agent, which is used to collect local status (energy consumption of its own loop, personnel status, power quality); execute local control actions (on / off, delay, power supply mode switching); and report local status and action feedback to the global coordination agent.
[0057] The overall decision-making unit is set as a global coordination agent, which is used to receive the state data of all local agents, calculate the achievement of global goals (total energy consumption, overall power quality); detect and resolve control conflicts between local agents (such as voltage fluctuations caused by the simultaneous start of high-power equipment in multiple loops); and issue global coordination instructions to local agents (such as peak-shifting start and priority adjustment).
[0058] Each agent's state space, action space, and reward function are defined based on the goals of minimum energy consumption, optimal user experience, and acceptable power quality. The state space includes local states and global states, and the state dimensions include: Energy consumption related: Local (real-time power P of its own circuit, cumulative energy consumption E, load type label, such as lighting / air conditioning / computer room equipment); Global (total building energy consumption E_total, number of high energy consumption circuits); Experience-related factors: Local (personnel presence status S, number of manual corrections by users C); Global (average satisfaction score of all users in the building, calculated in reverse based on the number of manual corrections: satisfaction = 1 - C / total number of actions); Power quality: Local (power quality indicators of the circuit itself ΔU%, THD-u, cosφ); Global (percentage of circuits with qualified power quality in the entire building Q_total = number of qualified circuits / total number of circuits, number of circuits with serious abnormalities); Scene and power supply related: Local (current scene label, power supply mode); Global (global power supply mode distribution, number of abnormal power supply circuits).
[0059] The action space includes power on / off actions, hierarchical control actions, and coordinated actions.
[0060] The reward function is the sum of local and global rewards, quantifying the contribution of an action to the goal. Specifically: Local reward (R_local): The score of each agent's own objective, expressed as follows: R_local = w1×R_energy + w2×R_exp + w3×R_power; R_energy represents the energy consumption score, which is calculated based on the ratio of the baseline energy consumption to the actual energy consumption. The lower the actual energy consumption, the higher the score. The baseline energy consumption is the best historical energy consumption of this circuit. R_exp represents the experience score, R_exp=100-C×20, where C is the number of manual corrections made that day. The fewer corrections, the higher the score; ≥5 corrections result in 0 points. R_power represents the power quality score, R_power = 100 × Q_local, where Q_local = 1 is acceptable and 0 is unacceptable; 50 points are deducted for serious abnormalities. w1 / w2 / w3 represent the target weights, which are dynamically assigned by the scene recognition unit. For example, during working hours, w1=0.3, w2=0.6, w3=0.1; during holidays, w1=0.6, w2=0.2, w3=0.2.
[0061] Global Reward (R_global): The collaborative score given by the global coordinating agent to all executing agents, formula: R_global = 50×(E_base / E_total) + 30×Q_total + 20×S_satisfaction; Among them, E_base is the lowest historical total energy consumption of the entire building, E_total is the current total energy consumption, and the lower the total energy consumption, the higher the score; Q_total is the percentage of the entire building with qualified power quality; S_satisfaction is the user satisfaction of the entire building; if the action of a certain agent causes the global objective to deteriorate (such as a single loop high-power start causing the total THD-u to exceed the standard), then the R_global of that agent will be deducted 100 points.
[0062] Total reward (R_total): R_total = R_local + R_global (Score range: -100~200, negative scores indicate harmful actions, positive scores indicate beneficial actions).
[0063] Training is performed using the Multi-Agent Deep Deterministic Policy Gradient (MADDPG) algorithm; The centralized Critic network utilizes the global state and the actions of all agents to calculate the total reward value and optimize policy evaluation accuracy. Each executing agent independently has its own Actor network, updating its own action policy based on its local state and the global Critic's evaluation results. The global coordinating agent trains a separate conflict resolution network, taking action requests from multiple agents as input and outputting conflict priorities.
[0064] Each executing agent collects its local state (S_local) in real time, inputs it into its own Actor network, and outputs the optimal action. Before executing an action, it checks for conflicts with local security rules. If there are no conflicts, the action is sent to the execution module; otherwise, a safety fallback action is triggered. The global coordinating agent monitors the action requests of all executing agents in real time. If a conflict is detected, it issues staggered instructions based on the conflict resolution network's output priority. After receiving the global instructions, the executing agents adjust their actions and report the execution results.
[0065] Design conflict detection logic based on conflict type and set conflict resolution priority rules; The conflict types include load conflicts (if the total predicted current of multiple agent action requests is ≥ 63A of the circuit rated current, it is determined to be a load conflict), power quality conflicts (if multiple agent action requests result in predicted THD-u ≥ 5% or ΔU% ≥ ±7%, it is determined to be a power quality conflict), and scenario conflicts (conflicting agent action requests in different scenarios). Actions are ordered in order of security > core functions > energy saving > general functions, with higher priority actions executed first.
[0066] The optimal strategies of each agent are integrated with global coordination rules to form a set of scenario-based control strategies.
[0067] It adopts a three-level index structure of scene-agent-action. The policy set includes scene-specific policies, which are triggered by the scene recognition unit outputting the corresponding scene label; global coordination policies, which are triggered when the global coordination agent detects that the total energy consumption is ≥110% of the baseline, or the percentage of qualified power quality is ≤85%; and anomaly emergency policies, which are triggered when the anomaly handling module triggers the local emergency mode.
[0068] The optimal solution set is searched among the three objectives of minimum energy consumption, optimal user experience, and qualified power quality based on the non-dominated sorting genetic algorithm (NSGA-II), and the final control strategy is selected by combining the scene weight factor. The optimal solution set is searched based on the NSGA-II algorithm, and the final control strategy is selected by combining the scene weight factor, including the following steps: The three objectives of energy consumption, user experience, and power quality are uniformly quantified into a maximum objective score, and decision variables and constraints are defined. Minimum energy consumption F1 = [ (E_max - E_current) / (E_max - E_min) ] × 100; Where E_current is the estimated total energy consumption under the current control strategy, E_max is the highest historical energy consumption in this scenario, and E_min is the lowest historical energy consumption.
[0069] The optimal F2 value is 100 - (C × 10) - (T_wait × 5). Where C represents the number of times the user manually corrects control commands on that day, and T_wait represents the average time the user waits for power.
[0070] Power quality qualified F3 = Q_total × 100 - (N_severe × 20); Where Q_total is the estimated percentage of qualified power quality under this strategy, and N_severe is the estimated number of severe anomalies.
[0071] Define the names of the decision variables, including power outage delay X1 (discrete integer, range 3-10 minutes), lighting turn-on light threshold X2 (continuous real number, range 300-500 lux), air conditioning power supply temperature threshold X3 (continuous real number, summer 24-28℃ / winter 16-20℃), and branch circuit priority X4 (discrete integer, range 1-3, 1=core circuit such as computer room, 2=office circuit, 3=public corridor circuit).
[0072] During the optimization process, individuals that violate safety / hardware rules (control strategies) must be removed to ensure the feasibility of the solution set. Current constraints must be set (estimated loop current ≤ 63A under any strategy); power supply mode constraints (minimum load power of single-fire loop ≤ 1W); and safety rule constraints (the core loop of the equipment room must not be immediately disconnected).
[0073] The control strategy is encoded into chromosomes using real-number encoding, and the population size is set and initialized. Each chromosome corresponds to a complete control strategy. The chromosome length is equal to the number of decision variables (4). Each gene on the chromosome corresponds to a value of one decision variable. Set up 50-100 individuals, randomly generate individuals within the range of decision variable values, remove invalid individuals and add new individuals to ensure that the initial population is 100% feasible.
[0074] For all individuals in the current population, stratify them according to dominance relationship and select the top-level individuals that are not dominated by any other individuals; The dominance relationship is defined as follows: if individual A's three objective scores (F1, F2, F3) are all greater than or equal to individual B's, and at least one objective score is greater than B's, then A dominates B (B is an inferior solution and can be eliminated). The population is traversed, and for each individual, the number of times it is dominated and the set of dominating individuals are calculated. Individuals with a dominance count of 0 are assigned to Layer 1 (the top layer, where no individual dominates it, and it is the current optimal candidate). For all individuals dominated by individuals in Layer 1, their dominance count is decremented by 1. If it decreases to 0, it is assigned to Layer 2. This process is repeated for all individuals in all layers. Layer 1 is the Pareto optimal candidate solution for the current generation.
[0075] Calculate the crowding degree of each individual and generate a better strategy through genetic operations; For each layer of individuals, sort them according to each objective function (F1, F2, F3). For the sorted individuals, calculate the distance between them and their neighboring individuals on each objective, and sum them to obtain the crowding degree.
[0076] Selection operation: Two individuals are randomly selected from the population using the tournament selection method, prioritizing individuals with higher strata; if the strata are the same, the individual with greater crowding is selected, and this selection is repeated 50 times (population size) to obtain the parent population. Crossover operation: Simulated binary crossover (SBX) is used to pair parent populations with a crossover probability of 0.8; Mutation operation: The offspring population is treated with a mutation probability of 0.1, and each gene (decision variable) is mutated slightly within the constraints. For example, X1=5 is mutated to 6 (still within 3-10 minutes). Offspring selection: Remove individuals from the offspring that violate the hard constraints, and add high-quality individuals (first-level individuals) from the parent generation to ensure that the size of the new generation population is still 50.
[0077] When the iteration reaches the maximum number of iterations (e.g., 100 generations), or when there is no significant change in the Pareto front (individuals in the first layer) for 10 consecutive generations (target score fluctuation ≤ 3%), the iteration stops, and the final set of individuals in the first layer is taken as the Pareto optimal solution set.
[0078] Calculate the weighted total score of the three objectives and the scene weights, select the strategy with the highest total score as the final control strategy, and convert it into control command output.
[0079] The decision variables of the final strategy are transformed into control commands that can be recognized by the execution module and sent to the P1 control module via RS485 / WiFi. After execution, the energy consumption analysis unit and the power quality monitoring unit collect the actual results in real time. If the deviation from the predicted score is >10%, the strategy is included in the sample to be optimized for the next NSGA-Ⅱ iteration optimization.
[0080] For fuzzy scenarios, qualitative descriptions are transformed into quantitative decisions based on fuzzy logic algorithms, and the quantitative decisions are integrated with the final control strategy to generate the final control instructions.
[0081] First, define fuzzy input variables, including personnel departure time (short / medium / long), load power (low / medium / high), and time period type (working / non-working); the fuzzy output variable is power outage delay (short / medium / long). Then, establish a fuzzy rule base, such as "working period, short personnel departure time, medium load power → medium power outage delay (10 minutes)" and "non-working period, medium personnel departure time, low load power → short power outage delay (3 minutes)". Output quantitative control parameters through fuzzy inference to handle decisions in uncertain scenarios. Integrate the quantitative decision parameters under fuzzy scenarios with the global / scenario-optimal control strategy to form structured instructions that can be directly issued to the execution module, possessing both accuracy and feasibility. The control instructions include: Identification information: Unique instruction ID, including timestamp and execution area code; Execution object, precisely locating the controlled loop / area / device, such as loop level, device type, and area range; Trigger scenario; Instruction priority, in order of security > core function > energy saving > general function, with higher priority instructions overriding lower priority instructions.
[0082] Core control action commands: power on / off action commands, corresponding to the combined drive of relays and MOSFETs, specifying the action type and execution timing, such as delayed power-off, immediate power-on, and tiered on / off; power supply mode adaptation action commands, corresponding to the dual-mode power supply switching unit, adjusting action parameters based on the current power supply mode; and coordination action commands, corresponding to MARL's regional coordination rules, complying with global coordination requirements, such as off-peak execution and priority yielding.
[0083] Quantitative decision parameters: These parameters transform the qualitative conclusions output by algorithms such as fuzzy logic into specific, executable numerical values, while also incorporating decision variables selected by NSGA-II. Specifically, they include: Delay-related parameters: quantified by fuzzy logic algorithms, such as a power outage delay of 6 minutes, which corresponds to the quantitative result of fuzzy logic "working period, short time away from personnel, medium load power → medium delay"; Threshold parameters: Optimized and generated by NSGA-II to balance energy consumption and user experience in suitable scenarios; Load parameters: determined by MARL coordination rules to avoid global overload, such as the number of concurrent harmonic source loads ≤ 2 LED circuits to avoid THD-u exceeding the limit.
[0084] Safety and Constraints: Hardware protection constraints, scenario safety constraints, and power quality constraints.
[0085] Instruction execution timing and logic: Trigger condition logic (condition / state trigger); multi-action execution timing, such as power-on timing "first slightly turn on the MOSFET (5% conduction) → detect no short circuit → fully turn on the MOSFET → engage the relay → turn off the MOSFET (the relay carries the main current)", power-off timing "first turn on the MOSFET → disconnect the relay → delay 10μs to turn off the MOSFET (eliminate the arc)"; abnormal retry logic, such as if the relay does not engage, retry 2 times, if it still fails, trigger the equipment fault warning and switch to the backup circuit power supply.
[0086] Feedback requirements: Real-time feedback requirements, specifying the status data that the execution module needs to return, such as action results, running status, and user experience feedback; Data traceability requirements, specifying the content to be stored in the instruction execution log.
[0087] The complete final control command is as follows: Command ID: CMD-202405221530-1F-BG01 Target area: Branch circuit #2 in the 1F office area (office equipment + air conditioning) Triggering scenario: Office area - overtime hours Instruction priority: Level 3 (Scenario adaptation type) 1. Core action: Six minutes after personnel leave, disconnect only the air conditioning sub-circuit, while maintaining power supply to office equipment; 2. Quantitative parameters: Power outage delay of 6 minutes (fuzzy logic quantization result), air conditioner power supply threshold of 26℃ (NSGA-Ⅱ optimized value); 3. Power supply adaptation: This circuit is in neutral-live mode, supports tiered power outages, and performs rapid on / off switching; 4. Safety constraints: If the current is ≥63A or the voltage is ≥275V, immediately disconnect the entire circuit and issue a warning; if THD-u is ≥5%, temporarily suspend the start of the air conditioner; 5. Execution sequence: The timer starts 5 minutes after the personnel leave, and after 6 minutes, the MOSFET is turned on first → the air conditioning relay is turned off → the MOSFET is turned off. 6. Feedback requirements: Within 10 seconds of execution, transmit the on / off status and current / THD-u data. If it fails, retry twice and issue an alert. Logs are retained for 1 year. If the deviation exceeds 10%, perform backflow optimization.
[0088] Regarding the hardware of this switch companion invention, without replacing the original non-smart panel, a P1 control module is added to the panel base box to achieve single-wire / zero-wire dual-mode power supply, precise drive, and multiple protection functions. The main control unit of the P1 control module uses an STM32L051C8T6 ultra-low-power MCU with a main frequency of 32MHz. It has a 12-bit ADC acquisition interface, a UART interface, and a GPIO interface, and supports sleep mode and wake-up functions to further reduce power consumption.
[0089] Various sensors in the data acquisition module are directly connected to the main control unit of the P1 control module via ADC and GPIO interfaces to achieve local data acquisition. After preprocessing, the acquired raw data is synchronized to all sub-units of the intelligent control module through a shared data buffer.
[0090] The scene recognition unit prioritizes acquiring pre-processed personnel, environmental, and electricity consumption data. After completing scene determination, it synchronizes scene tags and confidence levels to the energy consumption analysis unit, power quality monitoring unit, and control decision unit. The energy consumption analysis unit receives the collected data and scene tags, calculates energy consumption indicators, constructs an energy consumption distribution map, and synchronizes energy consumption data and high-energy-consumption area identifiers to the control decision unit. The power quality monitoring unit receives the collected electrical parameter data, completes quality monitoring and trend prediction, and synchronizes the power quality status and pass probability to the control decision unit. The control decision unit integrates the three types of data—scene, energy consumption, and power quality—and ultimately generates control commands based on reinforcement learning algorithms, which are then sent to the execution module through the command buffer.
[0091] The control command is transmitted to the power supply mode switching unit via the UART interface to complete the determination and adaptation of single-wire / zero-wire power supply mode, and feeds back the power supply mode confirmation signal to the drive unit. After receiving the power supply mode signal and the control command (transmitted through the GPIO interface of the P1 control module), the drive unit starts the composite drive process of MOSFET and relay to perform power on / off actions. The circuit protection unit monitors the electrical parameters in real time during the execution process. If overcurrent / overvoltage / short circuit / surge is triggered, it directly issues an emergency power-off command to the drive unit (with higher priority than the regular command of the control decision unit).
[0092] Execution module: Used to drive the corresponding equipment to operate according to the control commands generated by the intelligent module, so as to realize the on and off control of the circuit power supply.
[0093] The execution module includes a power supply mode switching unit, a drive unit, and a circuit protection unit; Power supply mode switching unit: used to detect the neutral and live wires in the circuit, and switch to the corresponding power supply mode according to the detection result. The power supply modes include neutral-live power supply mode and single-live power supply mode. To address the issue of coexistence of single-live and neutral-live wires in existing building wiring, an adaptive dual-mode power supply circuit is designed. It eliminates the need for manual switching and uses a voltage detection chip to monitor the neutral wire voltage in real time. When the neutral wire voltage is ≥10V, it is determined to be in neutral-live mode; otherwise, it is in single-live mode. The switching response time is ≤10ms, and the unit continues to supply power during the switching process without any control interruption.
[0094] Neutral-live power supply mode: When a neutral wire connection is detected, it automatically switches to a linear voltage regulator circuit with an input voltage of 170-250V AC and an output voltage of 5V DC / 1A to power components such as sensors.
[0095] Single-wire power supply mode: When only the live wire is detected, intermittent power supply is provided by storing electrical energy through a high-voltage filter capacitor; at the same time, an ultra-low power MCU (standby current ≤10μA) is used, along with a dynamic power management strategy, to avoid the problem of lamp flickering caused by insufficient load when using single-wire power supply, and supports a minimum load power ≤1W (compatible with low-power LED lamps).
[0096] Drive unit: It adopts a composite drive method combining relays and MOSFETs to drive and execute equipment actions according to control commands; The magnetic latching relay features dual-coil holding capability, eliminating the need for continuous power supply during on / off states, thus reducing power consumption and supporting high-load control in both main and branch circuits. An N-channel MOSFET is connected in series at the relay's front end. The MOSFET's conduction is adjusted via a PWM signal to achieve soft switching between relay engagement and disengagement, preventing contact erosion caused by current surges. Simultaneously, a current sensor provides real-time feedback of the circuit current. When a current ≥63A is detected, the MOSFET is turned off prematurely to protect the relay. The control signal output from the intelligent control module is isolated by an optocoupler before driving the relay coil and MOSFET, achieving electrical isolation between high and low voltage currents. The isolation voltage is ≥2500V AC, enhancing circuit safety.
[0097] Circuit protection unit: It realizes the circuit protection function through a four-fold circuit protection mechanism, which includes circuit overcurrent, overvoltage, short circuit and surge.
[0098] Overcurrent protection: When the current sensor detects a loop current ≥63A (configurable via software), it immediately controls the MOSFET to disconnect from the relay and triggers an overcurrent warning. The protection threshold error is ≤5%.
[0099] Overvoltage protection: A transient voltage suppressor diode (TVS) is connected in parallel with a varistor. When the input voltage is ≥275V AC, the TVS and varistor break down rapidly, clamping the voltage within a safe range. At the same time, the fuse (10A / 250V) blows, cutting off the power supply circuit.
[0100] Short circuit protection: Real-time monitoring via current sensor. When a current surge rate ≥10A / ms is detected (determined as a short circuit), the MOSFET is quickly turned off within 10μs, and the relay is subsequently disconnected. The response speed is faster than that of traditional circuit breakers, avoiding safety hazards caused by short circuit arcs.
[0101] Surge protection: Compliant with IEC 61000-4-5 standard, a surge protector is connected between the live wire and the neutral wire, which can withstand surge current of ≥60kA with a 10 / 350μs waveform, effectively resisting surge impacts caused by lightning strikes and power grid fluctuations.
[0102] It also includes an anomaly handling module, which is electrically connected to the data acquisition module, intelligent control module, and execution module. It is used to monitor the status of the entire system in real time, issue an early warning when an anomaly is detected, and automatically switch to local emergency mode. The anomalies include hardware anomalies, communication anomalies, data anomalies, and control anomalies. It executes control based on preset basic rules and attempts to automatically recover from the fault.
[0103] Specifically, hardware anomalies include: monitoring the MCU operating status of the P1 control module, relay / MOSFET drive failure, sensor failure, and power supply mode switching failure. Communication anomaly: Communication between the monitoring module and the building management platform and IoT gateway is interrupted, and the data transmission packet loss rate exceeds the standard; Data anomalies: monitoring and data collection exceeding the range, continuous data loss, and severe power quality anomalies; Control anomalies: Monitor for control command execution failures and policy conflicts.
[0104] When the system experiences a global failure (such as a complete communication outage or a malfunction of the intelligent control module), it will automatically disconnect from cloud / platform control and switch to local emergency mode, executing control based on preset basic rules to prevent the system from going out of control. Emergency response to communication interruption: When the network is interrupted, the basic control rules of the local cache are invoked. It does not rely on platform instructions and the local cache contains data of the past 7 days. The data will be automatically retransmitted after communication is restored. Emergency response to intelligent module failure: If the intelligent control module fails, the minimum guarantee rule will be activated to prioritize power supply to core loads (such as equipment room servers and fire alarm linkage equipment) and cut off non-essential loads. Sensor failure emergency: When a certain type of sensor fails, the backup sensor data or historical average value will be automatically used to fill the gap, and the "time + base load" control logic will be switched (e.g., the office area will be powered by default from 9:00 to 18:00 on weekdays).
[0105] The exception handling module continuously executes recovery strategies for self-healing exceptions, reducing the cost of manual intervention. Communication recovery: After a communication interruption, a reconnection request is automatically initiated every 30 seconds for 30 minutes. After successful recovery, the system automatically switches back to normal control mode. Sensor recovery: When sensor data is abnormal, a hardware reset is performed first. If the failure persists, the system switches to a backup sensor channel. Execution unit recovery: When the relay / MOSFET fails to execute the instruction, it will automatically retry twice. If the retry is successful, the control will continue to be executed. If it fails, a hardware fault warning will be triggered.
[0106] It also includes an application module, which is electrically connected to the data acquisition module, intelligent control module, and execution module. This module provides a visual management interface and function entry point for managers and maintenance personnel, enabling equipment management, real-time monitoring, remote control, fault warning, and policy configuration. It also supports integration with smart city energy management platforms to achieve collaborative optimization of energy consumption across multiple buildings.
[0107] The application module is developed based on a B / S architecture, supporting access from both web and mobile devices. The front-end uses Vue.js and ECharts frameworks for visualization, while the back-end uses Spring Boot and MyBatis frameworks. MySQL is used for data storage, enabling the following: Device management: Supports device registration, binding, and deregistration; displays device online status, installation location, model, and other information; allows remote firmware upgrades and batch configuration of control policies.
[0108] Real-time monitoring: The system uses a visual dashboard to display total energy consumption (supports energy consumption comparison between different areas and different circuits, identifies high-energy-consuming circuits and marks optimization suggestions), the on / off status of each circuit, power quality, number of abnormal devices and other core indicators, and supports viewing data for single circuits and total circuits.
[0109] Remote control: Supports manual remote start / stop of specified circuits and setting timed control tasks (such as differentiated power supply strategies for weekdays and holidays).
[0110] Fault warning: When abnormal conditions such as overcurrent, overvoltage, or module failure are detected, real-time warnings are issued through platform pop-ups, SMS, and APP push notifications, and protection measures are automatically implemented.
[0111] Strategy configuration: Supports custom control strategies based on different scenarios, such as automatically cutting off power after 5 minutes of personnel leaving, or turning off lighting power when the light intensity is ≥500 lux.
[0112] The above embodiments are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A smart switch companion system for controlling power on / off, characterized in that, It includes a data acquisition module, an intelligent control module, and an execution module for communication connections; Data acquisition module: used to collect multi-dimensional data such as personnel status, environmental parameters, and electrical load, and to preprocess the collected data; Intelligent control module: It is used to analyze the collected data, combine the identified current scene, the constructed energy consumption distribution map, and the predicted power quality, and dynamically adjust the control parameters based on the reinforcement learning algorithm to generate power on / off control commands; Execution module: Used to drive the corresponding equipment to perform actions according to the control commands generated by the intelligent module, so as to realize the on and off control of the circuit power supply; The intelligent control module includes a scene recognition unit, an energy consumption analysis unit, a power quality monitoring unit, and a control decision unit. Scene recognition unit: Based on preprocessed data and combined with time dimension information, it automatically recognizes building scenes, including office areas, public corridors and equipment rooms; Energy consumption analysis unit: used to analyze energy consumption data, monitor loop energy consumption in real time, and construct energy consumption distribution map; Power quality monitoring unit: It monitors the quality of collected real-time power data by constructing a power quality monitoring model, compares it with standard data, and predicts whether the quality is up to standard; Control Decision Unit: Formulates exclusive control rules according to different scenarios, generates a set of control strategies based on reinforcement learning algorithms and searches for the optimal solution set, and integrates the decisions of fuzzy scenarios to generate the final control commands.
2. The intelligent power supply switching companion system according to claim 1, characterized in that, In the scene recognition unit, for three target scenes—office area, public corridor, and equipment room—distinctive features are extracted, and multi-condition combination matching rules are established. The integrated scene data frames are compared one by one to initially determine the scene category. A confidence calculation mechanism is introduced to assign weights to the matching rule items of each scene, calculate the matching score of each frame for multiple frames of data, and the scene confidence is the average of the scores of multiple frames. A confidence threshold is set to determine the current scene category. At the same time, data changes are monitored in real time, and scene trigger conditions are set to dynamically update the recognized scene.
3. The intelligent power supply switching companion system according to claim 1, characterized in that, Energy consumption data is analyzed from three dimensions: time, space, and equipment. An energy consumption distribution map is constructed based on the management scenario requirements. The energy consumption distribution map includes three types: overall hierarchical energy consumption distribution map, regional physical space energy consumption distribution map, and equipment type energy consumption distribution map.
4. The intelligent power supply switching companion system according to claim 1, characterized in that, The power quality monitoring model includes a dual-branch structure. It outputs the current qualified / unqualified judgment result through a random forest classifier and outputs the future qualified probability through a LightGBM regressor. The real-time data is preprocessed and compared with the set thresholds, which include basic national standard thresholds, scenario-defined thresholds, and dynamic trend thresholds. The final conclusion is output by combining the real-time comparison results with the model prediction results.
5. A switch companion system for intelligent power supply switching according to claim 1, characterized in that, The control decision unit generates control commands by including the following steps: Set scene-specific control rules and assign priorities, with the priorities from high to low being: safety rules, basic scene rules, and energy-saving rules; A scene weight factor and a feedback adaptive mechanism are introduced into the reward function to dynamically balance the weights of multiple objectives and adapt to scene changes. Based on the power quality time series data after Kalman filtering, linear regression is used to predict the trend of power quality index changes in the next 3 and 5 minutes. With the objectives of minimizing energy consumption, optimizing user experience, and ensuring qualified power quality, the MARL algorithm is used to optimize regional cooperative control and generate a set of control strategies. Based on the NSGA-II algorithm, the optimal solution set is searched among the three objectives of minimum energy consumption, optimal user experience, and qualified power quality. The final control strategy is selected by combining the scene weight factor. For fuzzy scenarios, qualitative descriptions are transformed into quantitative decisions based on fuzzy logic algorithms, and the quantitative decisions are integrated with the final control strategy to generate the final control instructions.
6. The intelligent power supply switching companion system according to claim 5, characterized in that, Generating a set of control policies includes the following steps: Based on the physical division and functional attributes of building areas / loops, a two-layer architecture of local execution agents and global coordination agents is constructed. Each agent's state space, action space, and reward function are defined based on the goals of minimum energy consumption, optimal user experience, and acceptable power quality. Training is performed based on a multi-agent deep deterministic policy gradient algorithm; Design conflict detection logic based on conflict type and set conflict resolution priority rules; The optimal strategies of each agent are integrated with global coordination rules to form a set of scenario-based control strategies.
7. A smart power supply switching companion system according to claim 5, characterized in that, The optimal solution set is searched based on the NSGA-II algorithm, and the final control strategy is selected by combining the scene weight factor, including the following steps: The three objectives of energy consumption, user experience, and power quality are uniformly quantified into a maximum objective score, and decision variables and constraints are defined. The control strategy is encoded into chromosomes using real-number encoding, and the population size is set and initialized. For all individuals in the current population, stratify them according to dominance relationship and select the top-level individuals that are not dominated by any other individuals; Calculate the crowding degree of each individual and generate a better strategy through genetic operations; Calculate the weighted total score of the three objectives and the scene weights, select the strategy with the highest total score as the final control strategy, and convert it into control command output.
8. The intelligent power supply switching companion system according to claim 1, characterized in that, The execution module includes a power supply mode switching unit, a drive unit, and a circuit protection unit; Power supply mode switching unit: used to detect the neutral and live wires in the circuit, and switch to the corresponding power supply mode according to the detection result. The power supply modes include neutral-live power supply mode and single-live power supply mode. Drive unit: It adopts a composite drive method combining relays and MOSFETs to drive and execute equipment actions according to control commands; Circuit protection unit: It realizes the circuit protection function through a four-fold circuit protection mechanism, which includes circuit overcurrent, overvoltage, short circuit and surge.
9. A smart power supply switching companion system according to claim 1, characterized in that, It also includes an anomaly handling module, which is electrically connected to the data acquisition module, intelligent control module, and execution module. It is used to monitor the system status in real time, issue an early warning when an anomaly is detected, and automatically switch to the local emergency mode. It executes control based on preset basic rules and continuously attempts to restore communication and sensor functions.
10. A smart power supply switching companion system according to claim 1, characterized in that, It also includes an application module, which is electrically connected to the data acquisition module, intelligent control module, and execution module. This module provides a visual management interface and function entry point for managers and maintenance personnel, enabling equipment management, real-time monitoring, remote control, fault warning, and policy configuration. It also supports integration with smart city energy management platforms to achieve collaborative optimization of energy consumption across multiple buildings.