Demand defense control method and system based on digital twinning

By constructing a digital twin model that couples the electrical and thermal fields, and combining machine learning and Kalman filtering algorithms, the problems of large model prediction errors and single strategy objectives in power system demand control are solved, and efficient and accurate demand defense control is achieved.

CN120955632APending Publication Date: 2025-11-14主力能源有限公司
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511116119.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing digital twin models do not fully consider the multi-physics coupling relationship in power system demand control, have insufficient real-time data utilization, and lack dynamic calibration mechanisms, resulting in large model prediction errors and an inability to provide reliable support. Traditional control strategies have single objectives, inefficient resource allocation, and delayed evaluation feedback, making it difficult to form efficient closed-loop control.

Method used

A digital twin model considering the coupling relationship between the electrical field and the thermal field is constructed. The time-series characteristics of real-time operating data are extracted by combining machine learning technology, and the model parameters are dynamically calibrated by using the Kalman filter algorithm. The demand change trend is predicted by time series analysis and neural network algorithm, and the optimal regulation strategy is determined by multi-objective optimization algorithm to form closed-loop control.

Benefits of technology

It improves the model's prediction accuracy under distributed power source fluctuations and load mutation scenarios, realizes multi-dimensional control effect evaluation, forms efficient closed-loop control, and improves resource allocation efficiency and feedback response capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120955632A_ABST
    Figure CN120955632A_ABST
Patent Text Reader

Abstract

The invention discloses a demand defense control method and system based on digital twinning, and the method comprises the steps: building a digital twinning model through the multi-physics coupling and machine learning technology according to processed real-time operation data in combination with a power system topological structure and equipment parameters, and carrying out the dynamic calibration and optimization of the digital twinning model through the real-time operation data. According to the method, an electrical field and thermal field coupled digital twinborn model is constructed, time sequence features are extracted in combination with machine learning, and parameters are dynamically calibrated by using Kalman filtering, so that the problems of lack of multi-physical field interactive simulation, insufficient real-time data utilization and lack of a dynamic calibration mechanism of a traditional model are solved; the prediction accuracy of the model in a distributed power supply fluctuation and load sudden change scene is improved; according to the method, demand control, cost and user experience are taken as multi-objective optimization functions, an adjustment strategy is determined by adopting a particle swarm algorithm and the like, and closed-loop control from prediction, strategy generation to evaluation optimization is formed by calculating and controlling a multi-dimensional index evaluation effect such as response time and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system automation control technology, specifically to a demand defense control method and system based on digital twins. Background Technology

[0002] In the operation of power systems, demand control plays a crucial role in balancing power supply and demand, reducing electricity costs, and ensuring the stable operation of the power grid. Traditional demand control methods mostly rely on empirical rules and simple threshold judgments, lacking the ability to accurately perceive and dynamically respond to the complex operating states of the power system. With the continuous expansion of power system scale and the large-scale integration of distributed energy resources and smart devices, the uncertainty and complexity of system operation have increased significantly, making traditional methods insufficient to meet the requirements of refined demand control in modern power systems. In recent years, digital twin technology has seen some application in the power sector. By constructing a virtual mapping of the physical system, it can reflect the operating state of the physical system in real time and perform simulation analysis and optimization decisions. However, there are still some problems with applying digital twin technology to demand defense control: I. Existing digital twin models do not fully consider the multi-physics coupling relationship of the power system during construction. They lack simulation of the interaction between electric field, thermal field and magnetic field, and do not make full use of real-time data and lack dynamic calibration mechanism. As a result, the model prediction error is large in the scenario of distributed power source fluctuation and load change, and cannot provide reliable support for demand control. Second, traditional control strategies have a single objective, focusing only on reducing peak demand while neglecting control costs and user experience, resulting in inefficient resource allocation. At the same time, the control effect evaluation indicators are singular and feedback is delayed, making it difficult to use the evaluation results to optimize models and strategies, and thus failing to form an efficient closed-loop control. To address this, a demand defense control method and system based on digital twins are proposed. Summary of the Invention

[0003] The purpose of this invention is to provide a demand defense control method and system based on digital twins to solve one of the problems mentioned in the background art.

[0004] To address the aforementioned technical problems, this application adopts the following technical solution: a demand defense control method based on digital twins, comprising the following steps: Step 1: Obtain real-time operating data of the power system and perform cleaning, noise reduction, and Min-Max normalization processing; Based on the processed real-time operating data and combined with the power system topology and equipment parameters, a digital twin model is constructed using multiphysics coupling and machine learning techniques, and the digital twin model is dynamically calibrated and optimized using real-time operating data. Step 2: Based on the digital twin model, integrate historical demand data, meteorological data, and load characteristic data, and use time series analysis and neural network algorithms to predict future demand and identify demand change trends and potential risks; Step 3: Based on the demand change trend and potential risks, determine the optimal adjustment strategy by adjusting the operating parameters of controllable power equipment or interacting with the external power network, and generate a demand defense control scheme. Step 4: Convert the demand defense control scheme into control commands and send them to the control equipment. The control equipment then operates according to the commands to control the demand. Step 5: Collect real-time data on the operating status of control equipment and the actual demand data of the power system, and feed it back to the digital twin model. Evaluate the control effect by calculating the error value and comparing it with the preset threshold, and generate evaluation results. Step 6: Based on the evaluation results, adjust and optimize the parameters and defense control strategies of the digital twin model.

[0005] As a further preferred embodiment of this technical solution: In step two, the method for predicting future demand using time series analysis and neural network algorithms includes the following steps: Step 301: Perform time series decomposition on historical demand data to separate the trend component, seasonal component, and random component, and generate time series decomposition results; Step 302: Perform feature engineering on meteorological data and load characteristic data to construct multidimensional feature vectors; Step 303: Fuse the time series decomposition results and multidimensional feature vectors to form a fused feature dataset, and divide the fused feature dataset into a training set and a test set in a 7:3 ratio; Step 304: Build a demand prediction model based on the Long Short-Term Memory network in the neural network algorithm, and train and validate the demand prediction model using the training set and the test set. Step 305: Input the real-time acquired meteorological data, load characteristic data and current demand data into the trained prediction model, output the demand forecast value for the next 15 minutes to 24 hours, and generate the demand forecast curve.

[0006] As a further preferred embodiment of this technical solution: In step three, the determination of the optimal adjustment strategy using an optimization algorithm is based on demand control targets, control costs, and user electricity experience as optimization objectives. A particle swarm optimization algorithm or a genetic algorithm is used to optimize the adjustment range, adjustment priority, and power interaction with the external power network of the controllable power equipment. The controllable power equipment includes adjustable load equipment, distributed power generation equipment, and energy storage equipment. The adjustment priority is set in the order that adjustable load equipment is adjusted first, followed by distributed power generation equipment and then energy storage equipment.

[0007] As a further preferred embodiment of this technical solution: Step three, the method for constructing the digital twin model includes the following steps: Step 201: Based on the power system topology and equipment parameters, and the coupling relationship between electrical and thermal fields, establish a digital twin model framework; Step 202: Extract time-series features from real-time operating data using Long Short-Term Memory (LSTM) networks in machine learning techniques to obtain time-varying feature vectors of the power system's operating state; Step 203: Input the time-varying feature vector into the digital twin model framework, train the digital twin model using historical running data, and optimize the digital twin model parameters through cross-validation; Step 204: Based on the deviation between the real-time running data and the prediction results of the digital twin model, dynamically calibrate the parameters of the digital twin model using the Kalman filter algorithm.

[0008] As a further preferred embodiment of this technical solution: In step one, the real-time operating data is acquired in real time through current sensors, voltage sensors, and power sensors deployed in the power system; the real-time operating data includes bus voltage, line current, load power, and equipment status signals.

[0009] As a further preferred embodiment of this technical solution: In step four, the control device includes an intelligent load controller, a distributed power management unit, and an energy storage converter; the control commands are sent to the control device via MQTT or Modbus communication protocols, and the command response time does not exceed 500ms.

[0010] As a further preferred embodiment of this technical solution: in step five, when evaluating the control effect, in addition to comparing the calculated error value with the preset threshold, the calculation also includes the control response time, the demand fluctuation range, and the energy consumption change rate.

[0011] To solve the above-mentioned technical problems, another technical solution adopted in this application is: a demand defense control system based on digital twin, including a data acquisition and processing module, a digital twin model construction module, a demand prediction module, a strategy generation module, an instruction execution module, an effect evaluation module, and an optimization iteration module; The data acquisition and processing module is configured to acquire real-time operating data of the power system and perform cleaning, noise reduction and Min-Max normalization processing. The model building module is configured to construct a digital twin model based on the processed real-time operating data, combined with the power system topology and equipment parameters, using multi-physics coupling and machine learning technology, and to dynamically calibrate and optimize the digital twin model through real-time operating data. The demand forecasting module is configured to be based on a digital twin model, integrate historical demand data, meteorological data, and load characteristic data, and use time series analysis and neural network algorithms to predict future demand and identify demand change trends and potential risks. The strategy generation module is configured to determine the optimal adjustment strategy and generate a demand defense control scheme by adjusting the operating parameters of controllable power equipment or interacting with the external power network based on the demand change trend and potential risks and using an optimization algorithm. The instruction execution module is configured to convert the demand defense control scheme into control instructions and send them to the control device, and the control device performs demand control according to the instructions; The effect evaluation module is configured to collect the operating status of the control equipment and the actual demand data of the power system in real time, and feed them back to the digital twin model. The control effect is evaluated by calculating the error value and comparing it with the preset threshold, and an evaluation result is generated. The optimization iteration module is configured to adjust and optimize the parameters and defense control strategies of the digital twin model based on the evaluation results.

[0012] As a further preferred embodiment of this technical solution: the data acquisition and processing module performs real-time cleaning, noise reduction, and Min-Max normalization processing on the running data through an edge computing device.

[0013] As a further preferred embodiment of this technical solution: the digital twin model construction module and the demand prediction module use a message queue for data transmission.

[0014] Advantages of this invention: 1. This invention constructs a digital twin model that considers the coupling relationship between electrical and thermal fields, extracts the temporal features of real-time operating data by combining machine learning technology, and uses the Kalman filter algorithm to dynamically calibrate the model parameters. This solves the problems of lack of multi-physics interaction simulation, insufficient utilization of real-time data, and lack of dynamic calibration mechanism in traditional models, and improves the prediction accuracy of the model in scenarios of distributed power fluctuations and load changes. 2. This invention uses demand control objectives, control costs, and user electricity experience as multi-objective optimization functions, employs optimization algorithms such as particle swarm optimization to determine the controllable equipment adjustment strategy, and evaluates the control effect by calculating multi-dimensional indicators such as control response time and demand fluctuation amplitude, forming a closed-loop control from prediction, strategy generation to evaluation and optimization, thus solving the problems of single strategy objectives, inefficient resource allocation, and delayed evaluation feedback in traditional strategies. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart illustrating a demand defense control method based on digital twins according to the present invention. Figure 2 This is a flowchart illustrating the method for predicting future demand using time series analysis and neural network algorithms according to the present invention. Figure 3 This is a flowchart illustrating the method for constructing a digital twin model according to the present invention. Figure 4 This is a schematic diagram of the functional modules of a demand defense control system based on digital twins according to the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Example Figure 1 This is a flowchart illustrating a demand defense control method based on digital twins according to an embodiment of the present invention. It should be noted that if substantially the same result is achieved, the method of this application is not necessarily identical. Figure 1 The illustrated process sequence is limited. For example... Figures 1-3 As shown: A demand defense control method based on digital twins includes the following steps: Step 1: Obtain real-time operating data of the power system and perform cleaning, noise reduction, and Min-Max normalization processing; Specifically, firstly, current sensors, voltage sensors, and power sensors deployed at key nodes of the power system are used to collect data in real time, including bus voltage, line current, load power, and equipment status signals, at a sampling frequency of no less than 100ms. Among these, the bus voltage acquisition range covers voltage levels from 10kV to 500kV, the line current acquisition accuracy reaches 0.5 level, the load power sampling must include active power, reactive power, and apparent power, and the equipment status signals include key parameters such as circuit breaker open / close status and transformer oil temperature. Then, the collected raw data undergoes a three-stage cleaning process: The first step is to use a threshold judgment method to eliminate outliers that exceed 20% of the equipment's rated parameters; The second step uses linear interpolation to fill in missing data with a duration of no more than 15 minutes; The third step is to verify the data consistency to ensure the logical matching of the data from each sensor at the same time. For example, the phase difference between the bus voltage and the line current should conform to Kirchhoff's laws. Next, the cleaned data was denoised using a wavelet denoising algorithm. The db4 wavelet basis function was selected for 3-level decomposition to filter out 50Hz power frequency interference and high-frequency electromagnetic noise while retaining the effective signal features in the data. Finally, Min-Max normalization is performed, and a segmented mapping strategy is adopted for different types of data: For high-voltage parameters such as bus voltage, the mapping formula is: ; Reserve 10%-90% of the mapping range to avoid boundary value overflow; For binary signals such as device status, they are directly mapped to 0 or 1 to ensure that the normalized data can reflect the original features and meet the input requirements of the machine learning model.

[0019] Based on the processed real-time operating data and combined with the power system topology and equipment parameters, a digital twin model is constructed using multiphysics coupling and machine learning techniques, and the digital twin model is dynamically calibrated and optimized using real-time operating data. Specifically, firstly, based on power system topology files (such as CIM models) and equipment parameter databases (including transformer impedance, line parameters, etc.), a digital twin model framework is established by simultaneously solving circuit equations (such as Kirchhoff's laws) and heat conduction equations (such as Fourier's laws), which includes electrical equipment models, line models, and load models. The coupling between the electrical field and the thermal field is achieved through the equipment loss heating coefficient. For example, the heat generated by the copper loss of the transformer will affect the winding resistance parameters. Then, the Long Short-Term Memory (LSTM) network is used to extract time-series features from the processed real-time running data. The data sequences of bus voltage, line current and other data within a 15-minute sliding window are input into the LSTM network. Two hidden layers with a total of 128 neurons are set up, and the activation function is tanh. The weights are optimized through the backpropagation algorithm to extract time-varying feature vectors that reflect the dynamic changes of the system, such as the trend component and periodic component of load fluctuation. Next, the time-varying feature vectors are input into the digital twin model framework, and the model is trained using historical operating data from the past three months (including normal operating conditions, peak load scenarios, etc.). A 5-fold cross-validation method is used to optimize the model parameters with the root mean square error (RMSE) as the indicator. Specifically, the parameters include electrical parameters (such as line impedance) and thermal parameters (such as equipment heat dissipation coefficient). During training, the learning rate adaptively decays from 0.01 until the validation set RMSE converges to below 5%. Finally, based on the deviation between real-time operating data and model prediction results, the model parameters are dynamically calibrated using the Kalman filter algorithm; a state-space equation is established to describe the dynamic changes of the model parameters; the deviation between the real-time collected load power and the model prediction value is used as the observation value; the equivalent impedance, thermal resistance and other parameters of the electrical equipment are recursively updated; the calibration cycle is set to 1 minute to ensure that the model prediction error is always kept within 10%.

[0020] Step 2: Based on the digital twin model, integrate historical demand data, meteorological data, and load characteristic data, and use time series analysis and neural network algorithms to predict future demand and identify demand change trends and potential risks; Specifically, firstly, historical demand data from the past three years (sampling interval of 15 minutes) is retrieved from the database, and meteorological data (including temperature, humidity, and light intensity, with accuracies of 0.5℃, 2%RH, and 100lux) and load characteristic data (user type, electricity consumption period distribution, and equipment power curve) for the corresponding time period are obtained simultaneously. The three types of data are then aligned by timestamps using a data association algorithm to form a multi-source fusion dataset. Then, the historical demand data is seasonally decomposed (STL decomposition method). The LOESS smoothing algorithm is used to separate the long-term trend term (using a 30-day sliding window), the seasonal term (extracting daily / weekly / monthly periodic features), and the random term. The seasonal term is expanded into the fundamental frequency and the third harmonic component through Fourier series expansion to ensure that the root mean square error (RMSE) of each component after decomposition is less than 8%. Next, feature engineering processing is performed on the meteorological data and load characteristic data: Temperature data was converted into 12 thermal comfort ranges (e.g., ≤10℃, 10-20℃, etc.), humidity data was normalized and mapped to [0,1], and light intensity was divided into 4 levels using a binning method; The load characteristic data extracts 20 features such as peak load period ratio and power factor, and finally constructs a multi-dimensional feature vector containing 45 features. Next, the time series decomposition results and multidimensional feature vectors were concatenated along the time dimension to form a fused feature dataset, which was divided into a training set (containing 2.5 years of data) and a test set (containing 0.5 years of data) in a 7:3 ratio. A prediction model was built using a bidirectional long short-term memory network (BiLSTM) with 3 hidden layers (256 neurons per layer), ReLU activation function, and a dropout layer (dropout rate of 0.2) to prevent overfitting. The mean squared error (MSE) was used as the loss function, and the model was trained for 150 epochs using the Adam optimizer until the MSE of the test set converged to below 0.04. Then, the real-time collected meteorological data (updated every hour), load characteristic data (refreshed in real time), and current demand data (sampling interval of 5 minutes) are processed in the same step and input into the trained model to output the demand forecast value for the next 15 minutes to 24 hours (15-minute step size). The model then generates a prediction curve with a 95% confidence interval through Monte Carlo simulation (1000 iterations). Finally, demand trends and potential risks can be identified through the following methods: The predicted curve is processed by a 5-point moving average, and the rate of change between adjacent time periods is calculated. When the rate of change exceeds 15% / 15 minutes, it is marked as a rapid upward trend. Compare the predicted value with the 95th percentile of historical data for the same period; if it exceeds the 95th percentile, a peak warning will be triggered. Based on the digital twin model, power flow calculation is performed. When the load rate of the critical line exceeds 80%, an equipment overload risk alarm is generated. The risk identification results are synchronously fed back to the digital twin model for scenario simulation verification.

[0021] Step 3: Based on the demand change trend and potential risks, determine the optimal adjustment strategy by adjusting the operating parameters of controllable power equipment or interacting with the external power network, and generate a demand defense control scheme. Specifically, firstly, the demand forecast curve, rate of change index, and risk alarm data output from step two are imported into the strategy generation module to establish a multi-objective optimization model that includes demand control target (error ≤ 5%), control cost (unit regulation power cost ≤ 0.3 yuan / kW), and user electricity experience (interruptible load ratio ≤ 15%). Among them, the weight of demand control target is set to 0.5, control cost weight is 0.3, and user experience weight is 0.2. Then, determine the controllable device's adjustment range and the interaction boundary with external power: The power adjustment range of adjustable load equipment (air conditioners, water heaters, etc.) is 20%-80% of the rated power, and the adjustment dead zone is ≤5kW; The output adjustment range of distributed power generation equipment (photovoltaic, wind power) is 30%-100% of the current power; the charging and discharging power limit of energy storage equipment is 60% of the rated power, and it meets the SOC (state of charge) constraint in the range of 20%-80%. The upper limit of power exchange with the external power network is 15% of the distribution transformer capacity, and the electricity price fluctuation coefficient must be ≤1.2 times the benchmark electricity price; Next, a device adjustment sequence is constructed according to the priority order of "adjustable load devices > distributed power generation devices > energy storage devices". When the demand forecast exceeds the threshold, adjustable load devices are adjusted first (e.g., reducing the power of non-critical loads by 10%-30%), followed by the output of distributed power generation devices (e.g., adjusting the power factor of photovoltaic inverters from 0.9 to 1.0), and finally, the energy storage devices are activated for charging and discharging (charging power 100-500kW, discharging power 200-800kW). At the same time, the economics of purchasing / selling electricity from the external grid are calculated (purchase price 1.2 yuan / kWh, sales price 0.8 yuan / kWh). Then, the Particle Swarm Optimization (PSO) algorithm was used to solve for the optimal strategy, with 50 particles, 100 iterations, and the inertia weight decreasing linearly from 0.9 to 0.4, and the learning factor c1=c2=2.0. The optimization variables include: the adjustment power of each type of controllable device, the adjustment timing (with a time step of 15 minutes), and the external power interaction amount; The constraints include: equipment operating parameter limits, power grid safety constraints (line current ≤ 80% of rated current), and user agreement constraints (important loads cannot be interrupted). The optimization results are then verified through simulation using a digital twin model: the adjustment strategy is input into the model to simulate demand changes, equipment operating status, and power grid flow distribution over the next 24 hours, and the demand control compliance rate (target ≥ 90%), control cost saving rate (target ≥ 15%), and user experience satisfaction (target ≥ 85 points) are calculated; if any indicator fails to meet expectations, the optimization target weights are automatically adjusted (adjustment range ± 0.1) or the constraints are relaxed (e.g., the demand error is relaxed to 8%), and the PSO algorithm is rerun until a feasible solution is output; Finally, a demand defense control plan is generated, including: Equipment adjustment instruction set (e.g., reduce air conditioning load by 200kW from 10:00 to 11:00). External power exchange plan (e.g., purchasing 500kW of electricity at 14:00); Risk response plan (when demand suddenly increases by 20% more than the predicted value, activate energy storage for emergency discharge); The solution is stored in JSON format, including fields such as device ID, adjustment parameters, execution time, and priority identifier, and is synchronized to the instruction execution module for distribution.

[0022] Step 4: Convert the demand defense control scheme into control commands and send them to the control equipment. The control equipment then operates according to the commands to control the demand. Specifically, firstly, after the demand defense control scheme is generated, the information such as the equipment adjustment instruction set and external power interaction plan in the scheme is parsed and converted according to the communication protocol requirements of the control equipment through the protocol conversion module. For different types of control equipment such as intelligent load controllers, distributed power management units and energy storage converters, the corresponding communication protocols are used for conversion. Among them, the intelligent load controller uses the MQTT protocol, and the distributed power management unit and energy storage converter use the Modbus protocol. Then, the converted control commands are encoded and encapsulated, and information such as command headers and check codes are added to ensure the accuracy and integrity of the commands during transmission. The command header includes information such as command type, device type, and priority, and the check code uses the CRC-16 check algorithm to detect whether errors occur during command transmission. Next, the encapsulated control commands are sent to the control equipment via the communication network. The communication network adopts a redundant design, with the main communication link using a 5G network and the backup communication link using a fiber optic network. When the main communication link fails, it automatically switches to the backup communication link to ensure the reliability of command transmission. When commands are sent, they are sorted according to their priority, with higher priority commands sent first to ensure that control commands for critical equipment can be transmitted in a timely manner. After receiving the control command, the control equipment first decodes and verifies the command to ensure its legality and completeness. If the verification passes, the control equipment performs demand control operations according to the parameters and requirements in the command. For intelligent load controllers, the power of adjustable load devices is adjusted according to the command, such as adjusting the cooling capacity of air conditioners to reduce the load power accordingly. For distributed power management units, the output of distributed power devices is adjusted, such as adjusting the output power of photovoltaic inverters. For energy storage converters, the charging and discharging power of energy storage devices is controlled to achieve demand control. The system monitors the execution status of the control equipment in real time, including information such as instruction reception time, start execution time, and execution completion time, and feeds this status information back to the system so as to understand the execution status of the control instructions in a timely manner. If the control equipment fails to report the execution status within the specified time or an abnormality occurs during the execution process, the system automatically reissues the instruction or takes other remedial measures. Finally, the issuance and execution process of control commands is recorded, including command content, issuance time, execution results, and other information, forming a log file for subsequent querying and analysis. By analyzing the log file, the control command issuance strategy and the operation process of the control equipment can be continuously optimized to improve the efficiency and accuracy of demand control.

[0023] Step 5: Collect real-time data on the operating status of control equipment and the actual demand data of the power system, and feed it back to the digital twin model. Evaluate the control effect by calculating the error value and comparing it with the preset threshold, and generate evaluation results. Specifically, firstly, by using sensors and communication modules deployed in the control equipment and power system, real-time data on the operating status of the control equipment (including the regulating power of the intelligent load controller, the output parameters of the distributed power management unit, the charging and discharging current of the energy storage converter, etc.) and the actual demand data of the power system (including the real-time power of each bus, line current, system frequency, etc.) are collected at a sampling frequency of 50ms. The demand data acquisition accuracy reaches 0.2 level, and the sampling resolution of the equipment status signal is 16 bits. Then, the collected raw data is preprocessed in real time: a median filtering algorithm (window size 5) is used to remove sudden interference data, and data consistency verification is used to ensure that the timestamps of the control equipment execution parameters and the system demand data are aligned (error ≤ 100ms). The preprocessed data is fed back to the input layer of the digital twin model through a message queue (Kafka) at a frequency of 10 times per second, and the equipment operating status parameters and system load node data in the model are updated synchronously. Next, an error calculation module is built into the digital twin model to calculate the error between the actual demand and the predicted demand based on the following formula: ; Simultaneously calculate the control response time (the time interval from the issuance of the command to the change of equipment status), demand fluctuation range (the difference between the maximum and minimum values ​​of actual demand within 15 minutes), and energy consumption change rate (the ratio of the energy consumption difference per unit time before and after control to the energy consumption before control). The calculation cycle for each indicator is 15 minutes. Next, the calculated error value is compared with the preset threshold: when the error value exceeds 5%, it is marked as a demand control deviation warning; when the control response time exceeds 1 second, a communication link optimization prompt is triggered; when the demand fluctuation exceeds ±8% of the predicted value, a load stability alarm is generated; when the energy consumption change rate exceeds 12%, the energy consumption anomaly analysis process is initiated; the preset threshold can be dynamically adjusted through the model optimization iteration module, with an adjustment step of 0.5%. Based on the comparison between the above indicator calculation results and the thresholds, a multi-dimensional control effect evaluation result is generated, including: Demand control compliance rate (the percentage of time during which actual demand is within ±5% of the predicted value). Equipment response timeliness (percentage of commands with a control response time ≤ 500ms); Demand fluctuation coefficient (the ratio of fluctuation range to the predicted value). Energy consumption control efficiency (the ratio of energy consumption change rate to demand control quantity); The evaluation results are stored in the form of visual charts (such as radar charts and trend curves), with a time granularity of 15 minutes per item; Finally, the evaluation results are synchronized to the optimization iteration module as the basis for adjusting the parameters of the digital twin model and optimizing the defense control strategy. When the demand control compliance rate is less than 80% for three consecutive evaluation cycles (45 minutes), the model parameter recalibration process is automatically triggered. If the energy consumption change rate exceeds 15% for two consecutive cycles, a special adjustment for energy consumption optimization of the control strategy is initiated to ensure that the evaluation results provide real-time guidance for system optimization.

[0024] Step Six: Based on the evaluation results, adjust and optimize the parameters and defense control strategies of the digital twin model; Specifically, firstly, the evaluation results are analyzed from multiple dimensions to extract key indicators such as demand control compliance rate, model prediction error, and equipment response efficiency. When the demand prediction error exceeds 8% for three consecutive evaluation cycles (45 minutes), the digital twin model parameter recalibration mechanism is triggered to optimize the model parameters through the following process: For the electrical and thermal field parameters of the digital twin model, based on the demand deviation data in the evaluation results, the Kalman filter algorithm is used to recursively update the core parameters such as the equivalent impedance and thermal resistance coefficient of the equipment. For example, when the actual operating temperature of the transformer deviates from the model prediction value by more than 5°C, the winding thermal resistance parameter adjustment coefficient is set to 1.05, and the convective heat transfer coefficient in the heat conduction equation is updated simultaneously. Hyperparameter optimization is performed on the machine learning module (LSTM network) in the model: if the RMSE on the test set exceeds 10%, the Bayesian optimization algorithm is automatically started. Within the search space of learning rate [0.001, 0.01], number of hidden layer nodes [64, 256], and Dropout rate [0.1, 0.3], the model is retrained with mean squared error as the objective function, and the optimization period is set to 1 hour. To optimize the defense control strategy, when the evaluation results show that the cost savings rate is less than 10%, the weight allocation of the multi-objective optimization model is adjusted: the weight of the demand control objective is reduced from 0.5 to 0.4, the weight of control cost is increased from 0.3 to 0.4, and the weight of user experience remains unchanged at 0.2; at the same time, the equipment adjustment priority parameters are optimized, for example, the power adjustment dead zone of adjustable load equipment is reduced from 5kW to 3kW to improve adjustment sensitivity; The strategy is then validated through digital twin model simulation: the adjusted model parameters and control strategy are input into the model to simulate demand changes over the next 24 hours, with a focus on verifying the demand control effect during high-load periods (e.g., 18:00-22:00). If the peak demand control compliance rate is still below 90% in the simulation results, the strategy iteration mechanism is activated, increasing the upper limit of external power interaction from 15% to 20% of the transformer capacity, and the particle swarm optimization algorithm is rerun to generate the regulation strategy. Finally, an optimization effect tracking mechanism is established: after each adjustment of model parameters or strategy, the changes in indicators are continuously monitored for the next 5 evaluation cycles (1.25 hours); if the demand prediction error decreases by more than 20% and the control cost does not increase significantly, the current optimization parameters are saved; otherwise, the parameters are rolled back to the previous version and a manual intervention process is triggered to adjust the optimization direction in combination with expert experience to ensure the stability and effectiveness of the optimization process.

[0025] In this embodiment, specifically: the method for predicting future demand using time series analysis and neural network algorithms in step two includes the following steps: Step 301: Perform time series decomposition on historical demand data to separate the trend component, seasonal component, and random component, and generate time series decomposition results; Specifically, firstly, the historical demand data is decomposed using the Seasonal Decomposition (STL) method; historical demand data from the past 3 years with a sampling interval of 15 minutes are imported into the decomposition module, and a 7-day seasonal cycle is set. The data is then decomposed into three levels using the Local Weighted Regression (LOESS) smoothing algorithm. Then, extract the long-term trend: use a 30-day sliding window to smooth the original data, eliminate the impact of short-term fluctuations, and obtain the long-term trend that reflects the overall trend of demand changes, such as the continuous upward trend of demand caused by the summer peak electricity consumption. Next, the seasonal component is separated: through Fourier series expansion, the daily, weekly, and monthly periodic features in the demand data are decomposed into the fundamental frequency and third harmonic components; for example, the periodic features of the daily peak electricity consumption from 8:00 to 22:00, as well as the demand difference features between weekdays and weekends, are extracted to form the seasonal component. Next, obtain the random term: subtract the long-term trend term and seasonal term from the original demand data to obtain the random term that reflects the impact of sudden factors (such as extreme weather and equipment failure). This component reflects the unpredictable part of demand changes. Finally, the validity of the trend, seasonal and random components obtained from the decomposition is verified; the root mean square error (RMSE) between the reconstructed demand data and the original data is calculated. When the RMSE is less than 8%, the decomposition result is confirmed to be valid and the time series decomposition result is generated; if the error exceeds the threshold, the LOESS smoothing parameters (such as window width and smoothness) are adjusted and the decomposition is repeated until the accuracy requirements are met.

[0026] Step 302: Perform feature engineering on meteorological data and load characteristic data to construct multidimensional feature vectors; Specifically, firstly, multi-dimensional feature extraction and transformation are performed on the meteorological data, as follows: Temperature data processing: The collected temperature data (accuracy 0.5℃) is divided into 12 thermal comfort intervals, as follows: ≤10℃, 10-15℃, 15-20℃, 20-25℃, 25-30℃, 30-35℃, >35℃ (cold / cool / comfortable / slightly warm / hot / extremely hot), and each interval is uniquely thermally encoded to generate 12-dimensional features; Humidity data processing: The Z-Score normalization method is used to map the humidity data (accuracy 2%RH) to the [-1,1] interval. The calculation formula is as follows: ; in, This is the historical average humidity value. Generate a 1D feature for the standard deviation; Light intensity processing: The light intensity was divided into four levels (<200 lux, 200-500 lux, 500-1000 lux, >1000 lux) using a binning method. A 1D feature was generated by label encoding (0-3). At the same time, the light intensity change rate (Δlux / h) over the past 2 hours was calculated to generate a 1D dynamic feature. Then, the load characteristic data undergoes feature engineering processing, as follows: User type features: Users are divided into three categories: residential, commercial and industrial. Three-dimensional features are generated using one-hot encoding. At the same time, the power grid load density (kW / km²) of the user’s area is extracted to generate one-dimensional continuous features. Electricity consumption period characteristics: Divide a 24-hour day into 6 time periods (0-4h, 4-8h, ..., 20-24h) in 4-hour intervals, extract the electricity consumption percentage of each time period (sliding window of 7 days) to generate 6-dimensional features; calculate the electricity consumption percentage of the peak load period (8-22h) to generate 1-dimensional features; Equipment power characteristics: For adjustable load equipment (such as air conditioners and heat pumps), extract 8-dimensional operating parameter characteristics such as power adjustment range (20%-80% of rated power) and adjustment dead zone (≤5kW); for distributed power equipment, extract 5-dimensional characteristics such as output fluctuation coefficient (power change rate in the past 1 hour) and power factor (0.9-1.0). Next, we construct derived features to enhance data representation capabilities, as follows: Meteorological-load correlation characteristics: Calculate the correlation coefficient (Pearson coefficient) between temperature and residential load to generate a 1D feature; when the temperature is >30℃, generate an air conditioning load activation flag (0 / 1) to generate a 1D binary feature; Time series derived features: Extract lagged features (the same period of the previous 15 minutes, 1 hour, and 1 day) from historical demand data to generate 3D features; calculate the moving average (past 3 time periods) and standard deviation of demand data to generate 2D features; Next, feature selection and dimensionality reduction are performed, as follows: Correlation filtering: Features with a correlation greater than 0.3 with demand forecast are screened using Spearman correlation coefficient, and redundant features (such as features with a correlation between light intensity and industrial load of less than 0.1) are removed. Principal Component Analysis (PCA): Dimensionality reduction of high-dimensional features is performed, retaining principal components with a cumulative variance contribution rate >90%, and finally constructing a multidimensional feature vector containing 45 dimensions of features, including 15 dimensions of meteorological-related features, 25 dimensions of load characteristic features, and 5 dimensions of derived features; Finally, the feature vectors are normalized as follows: Continuous features are normalized using Min-Max and mapped to the [0,1] interval; binary features are encoded using 0 / 1; and the one-hot encoding results of categorical features are kept sparse to ensure that the feature vectors meet the input requirements of the neural network. At the same time, the contribution of each feature to demand prediction is verified through feature importance analysis (such as SHAP value) to ensure the effectiveness of feature engineering.

[0027] Step 303: Fuse the time series decomposition results and multidimensional feature vectors to form a fused feature dataset, and divide the fused feature dataset into a training set and a test set in a 7:3 ratio; Specifically, firstly, the time series decomposition results (trend, seasonal, and random components) obtained in step 301 are aligned and concatenated with the 45-dimensional multi-dimensional feature vector constructed in step 302 in terms of time dimension; wherein, the time granularity of the time series decomposition results is 15 minutes, which is consistent with the timestamp of the multi-dimensional feature vector, ensuring that the decomposition components at each time point correspond one-to-one with the corresponding meteorological and load features, forming a 48-dimensional fused feature vector containing time series features (3-dimensional) and multi-dimensional features (45-dimensional); Then, the fused feature vector is processed to ensure its continuity over time. For each time point t, a sliding window feature of the previous hour (4 time points) is added, including the rate of change of the trend term ((trend_t-trend_{t-4}) / trend_{t-4}), the periodic offset of the seasonal term, the cumulative variance of the random term, and other derived features. Eight dynamic features are added, expanding the fused feature dimension to 56 dimensions and enhancing the model's ability to capture demand change trends. Next, a fused feature dataset is constructed. The 56-dimensional feature vectors of all processed time points are arranged in chronological order to form an N×56 dataset (N is the total number of time points, such as approximately 17,520 time points corresponding to the past 3 years of data). To avoid the influence of data order on model training, the dataset is shuffled by time window, with 7 days as a window. The data order is randomly shuffled within each window, while maintaining the feature correlation between adjacent time points to prevent disruption of the inherent regularity of the time series. Next, the training and test sets were divided in a 7:3 ratio. The first 70% of the data (approximately 12,264 time points) was used as the training set for model parameter optimization, and the last 30% of the data (approximately 5,256 time points) was used as the test set to evaluate the model's generalization ability. When dividing the data, it was ensured that the training and test sets did not overlap in the time dimension and covered various scenarios such as different seasons and weekdays / weekends. For example, the training set contained complete data for all four seasons, and the test set contained data for the corresponding season of the following year to ensure the representativeness of the test scenarios. Next, standardize the training and test sets; calculate the mean and standard deviation of all features in the training set, and uniformly standardize the continuous features in both the training and test sets using Z-Score, with the following formula: ; in, and The statistics for the training set are used to avoid the test set data from participating in the standardization process and to prevent data leakage; for binary features and categorical features, the original encoding format remains unchanged. Finally, the dataset is balanced. For peak demand scenarios (accounting for approximately 15%), oversampling techniques (SMOTE algorithm) are used to generate synthetic samples, ensuring that the ratio of peak to non-peak scenarios in the training set reaches 1:3, alleviating the class imbalance problem. At the same time, time labels (year / month / day / hour / minute) and scene labels (normal / peak / abnormal) are added to each sample to facilitate scene-based evaluation during subsequent model training. Ultimately, a fused feature dataset is formed, structured as [time label, scene label, 56-dimensional feature vector, actual demand value], which meets the input requirements of the neural network model.

[0028] Step 304: Build a demand prediction model based on the Long Short-Term Memory network in the neural network algorithm, and train and validate the demand prediction model using the training set and the test set. Specifically, firstly, a three-layer bidirectional long short-term memory (BiLSTM) demand prediction model is built based on the PyTorch framework. The network structure is designed as follows: Input layer: Receives the 56-dimensional fused feature vector generated in step 303, organized into a tensor format of (batch_size, sequence_length, 56) according to the time step, where sequence_length is set to 24 (i.e., 4 hours of historical data). Hidden layers: A three-layer BiLSTM structure is used, with 256 neurons in each layer and ReLU activation function. A Dropout layer (dropout rate of 0.2) is added to each layer to prevent overfitting; BatchNorm1d is used for normalization between layers to improve training stability. Attention Mechanism Layer: An attention layer is added after the BiLSTM output to calculate the importance weight at each time step, using the following formula: ; in, Let be the hidden state at time t. For the corresponding weights; Output layer: The attention-weighted features are mapped to the demand prediction values ​​for the next 15 minutes to 24 hours through a fully connected layer, with an output dimension of 96 (96 prediction points in a 15-minute step). Next, configure the model training parameters as follows: Loss function: Weighted mean squared error loss (WMSE) is used, with a weight of 2 for peak demand prediction error and a weight of 1 for normal value error. The formula is as follows: ; in, (when (for peak value) (Other situations); Optimizer: The Adam optimizer is used, with an initial learning rate of 0.001, a cosine annealing learning rate scheduler, a period of 10 epochs, and a minimum learning rate of 0.00001. Training configuration: Batch size is set to 64, training epochs are 100, and the early stopping strategy is set to stop training and save the best model parameters when the loss on the validation set has not decreased for 10 consecutive epochs. Next, the model training process is executed, as follows: The training set is divided into an internal training set and a validation set in an 8:2 ratio to ensure that the validation set and the test set do not overlap in time. In each epoch, the training data is augmented with: random time offset (±2 hours), feature noise injection (Gaussian noise, standard deviation 0.05), and sample weight perturbation (±10%). Every 5 epochs of training, the model performance is evaluated on the validation set, and the metrics include: mean absolute error (MAE), root mean square error (RMSE), mean absolute percentage error (MAPE), and peak prediction error (Peak Error). Next, model validation and optimization will be performed, as follows: The trained model is evaluated using the test set to generate a comparison chart between the predicted curve and the actual demand. Evaluation metrics are calculated separately for different scenarios (weekdays / weekends, summer / winter, normal / abnormal) to ensure the stability of the model under various scenarios; If the test set error exceeds a preset threshold (e.g., MAPE > 8%), the automatic tuning process will be initiated, as follows: Adjust the network structure (increase / decrease the number of neurons in the hidden layers); Modify the weight calculation method for the attention mechanism; Redesign feature engineering (e.g., add / remove certain features); Finally, save and deploy the optimal model as follows: Save the trained model parameters as a .pt file and generate model metadata (including feature list, standardized parameters, and evaluation metrics). Deploy the model API in the digital twin platform to support real-time reception of fused feature data and return demand prediction results, with a response time requirement of ≤200ms; Establish a model monitoring mechanism to continuously collect the deviation between actual demand data and predicted values. When the deviation exceeds 15% for five consecutive evaluation cycles (75 minutes), trigger the model retraining process.

[0029] Step 305: Input the real-time acquired meteorological data, load characteristic data and current demand data into the trained prediction model, output the demand forecast value for the next 15 minutes to 24 hours, and generate the demand forecast curve. Specifically, firstly, meteorological data, load characteristic data, and current demand data are collected in real time through sensors and communication networks deployed in the power system. The meteorological data includes hourly temperature, humidity, and light intensity for the next 24 hours, which are updated hourly by the meteorological service platform. The load characteristic data covers adjustable load power, distributed power output, and energy storage status charge, and is collected at 5-minute intervals through smart terminals. The current demand data reads 15-minute sampling values ​​from the past 4 hours to form a historical sequence. Then, feature processing is performed on the real-time data; the temperature is divided into bins according to thermal comfort range and individually thermally encoded, the humidity is standardized, and the rate of change is calculated after the light intensity is classified to obtain the meteorological feature vector; at the same time, load characteristic features such as load type, peak load ratio, and equipment adjustment parameters are extracted and fused with the trend, seasonal, and random items obtained from historical demand decomposition to construct a 56-dimensional input feature vector. Next, the feature vectors are input into the trained long short-term memory network model. The model, trained based on historical data, can capture the demand change pattern and output the demand prediction value for the next 15 minutes to 24 hours. The time step is 15 minutes, and a total of 96 prediction points are generated. During the prediction process, a 95% confidence interval is generated through Monte Carlo simulation to reflect the prediction uncertainty. Next, a demand forecast curve is generated based on the predicted values; the predicted mean curve and confidence interval boundaries are plotted with time as the horizontal axis and demand as the vertical axis, and historical demand for the same period is superimposed as a reference; when the predicted value exceeds the historical high or the rate of change is abnormal, the risk area is marked on the curve to intuitively show the demand change trend and potential risk points. Finally, the prediction results are stored and transmitted in the form of structured data, including the predicted values, confidence intervals, risk levels and trends at each time point, for use by the subsequent strategy generation module. At the same time, the actual demand is compared with the predicted values ​​in real time. If large errors occur continuously, short-term prediction corrections are triggered to ensure the accuracy and timeliness of the prediction results.

[0030] In this embodiment, specifically: In step three, the optimal adjustment strategy is determined using an optimization algorithm. The optimization objectives are demand control, control cost, and user electricity experience. Particle swarm optimization or genetic algorithm is used to optimize the adjustment range, adjustment priority, and power interaction of the controllable power equipment's operating parameters. The controllable power equipment includes adjustable load equipment, distributed power generation equipment, and energy storage equipment. The adjustment priority is set in the order that adjustable load equipment is adjusted first, followed by distributed power generation equipment and energy storage equipment. Specifically, a multi-objective optimization model is first constructed with demand control target, control cost and user electricity experience as the core. The basic objective is to keep the demand control error below 5%. The control cost is calculated at 0.3 yuan / kW per unit of adjustable power. The user electricity experience is quantified by the proportion of interruptible load not exceeding 15%. The weights of the three are set to 0.5, 0.3 and 0.2 respectively. Then, the controllable equipment adjustment boundaries and external interaction constraints are defined; the power adjustment range of adjustable load equipment is 20%-80% of the rated power, the output adjustment range of distributed power sources is 30%-100% of the current power, the upper limit of the charging and discharging power of energy storage equipment is 60% of the rated power and the SOC must be maintained at 20%-80%; the power interaction with the external power grid shall not exceed 15% of the distribution transformer capacity, and the purchase and sale electricity prices shall be calculated at RMB 1.2 / kWh and RMB 0.8 / kWh respectively; Next, an equipment adjustment sequence is constructed according to the priority of "adjustable load > distributed power generation > energy storage"; when demand exceeds the limit, non-critical loads are adjusted first (such as reducing air conditioning power by 10%-30%), then the output of distributed power generation is adjusted (such as adjusting the power factor of photovoltaic inverters within the range of 0.9-1.0), and finally the energy storage equipment is activated (charging power 100-500kW, discharging power 200-800kW). Then, the particle swarm optimization algorithm was used to solve the optimal strategy; 50 particles and 100 iterations were set, the inertia weight was linearly decreased from 0.9 to 0.4, and the learning factor was 2.0; the optimization variables included the power adjustment of various equipment, the adjustment timing of 15-minute step size and the amount of external power interaction, while constraining the line current to not exceed 80% of the rated value and important loads to not be interrupted. The optimization results are then verified through digital twin model simulation; the demand changes and equipment operating status in the next 24 hours are simulated to calculate the demand control compliance rate (target ≥ 90%), cost saving rate (target ≥ 15%), and user satisfaction (target ≥ 85 points); if the indicators are not met, the target weights are adjusted (±0.1) or the constraints are relaxed (such as the error is widened to 8%) and then optimized again; Finally, a control scheme is generated, including a set of equipment adjustment instructions (such as reducing the air conditioning load by 200kW from 10:00 to 11:00), an external power interaction plan (such as purchasing 500kW of electricity at 14:00), and a risk contingency plan (activating emergency energy storage discharge when demand increases by more than 20%), which is stored in JSON format and synchronized to the execution module.

[0031] In this embodiment, specifically: Step three, the method for constructing a digital twin model includes the following steps: Step 201: Based on the power system topology and equipment parameters, and the coupling relationship between electrical and thermal fields, establish a digital twin model framework; Specifically, firstly, the topology file is extracted from the power system information model (CIM) database to obtain the connection relationships of equipment such as buses, lines, and transformers. At the same time, physical parameters such as transformer impedance and line length / cross-sectional area are retrieved from the equipment parameter library to construct a topology network including electrical nodes and branches. Then, an electrical field model is established based on Kirchhoff's voltage / current law, and power flow equations are written for each node to solve for electrical quantities such as bus voltage and line current. The transformer adopts a π-type equivalent circuit, and the distributed parameter characteristics of resistance, inductance, and capacitance of the line are considered. Next, a thermal field model is established for electrical equipment (such as transformers and cables). The temperature distribution of the equipment is calculated based on the Fourier heat conduction equation, taking into account heat source terms such as copper loss and iron loss, as well as heat dissipation conditions such as natural convection / forced air cooling, such as the coupled calculation of the thermal resistance of transformer windings and the heat dissipation coefficient of oil channels. Finally, the electrical field and thermal field are coupled and mapped by the heat generation coefficient of equipment loss. The power loss calculated by the electrical model is used as the heat source input of the thermal field model. At the same time, the temperature change calculated by the thermal field is fed back to the impedance parameters of the electrical equipment (such as the resistance of copper wires increases with temperature). This forms a digital twin model framework with multi-physics coupling. The accuracy of the framework is verified by power flow calculation under typical operating conditions and equipment temperature rise test data.

[0032] Step 202: Extract time-series features from real-time operating data using Long Short-Term Memory (LSTM) networks in machine learning techniques to obtain time-varying feature vectors of the power system's operating state; Specifically, firstly, real-time operating data, including bus voltage, line current, equipment temperature, and load power, are collected from the power system's SCADA system, smart meters, and IoT sensors, with a sampling frequency of 5 seconds per sampling, to construct a time-series dataset. Then, the raw data is preprocessed as follows; A sliding window (window size 1440, step size 1) is used to extract historical data segments, and the data in each window is standardized by Z-Score. Two-way imputation is used to handle missing values, and outliers (more than 3σ) are replaced by interpolation with adjacent values. Next, a three-layer bidirectional LSTM network architecture is constructed, as follows: The input layer receives preprocessed multidimensional time-series data (such as voltage, current, temperature, etc., 10 dimensions), and the hidden layer has 256 neurons. Dropout (dropout rate 0.2) and BatchNorm layers are added to each layer. The output layer is mapped to a time-varying feature vector (64 dimensions) through a fully connected network to capture long-term dependencies (such as daily / weekly periodic load changes) and short-term dynamic characteristics (such as power fluctuations caused by equipment start-up and shutdown) in the data. Next, an attention mechanism is used to enhance key feature extraction: attention weights are calculated on the LSTM output to focus the model on the time step corresponding to the anomalous event (such as a sudden voltage drop or temperature rise). The calculation formula is as follows: ; in, Let be the hidden state at time t. For the corresponding weights, the final feature vector is ; Then, feature representation is optimized through comparative learning: positive samples (similar operating states of the same device at different times) and negative samples (operating data of different devices or fault states) are constructed, and the InfoNCE loss function is designed to maximize the similarity of positive sample pairs and minimize the similarity of negative sample pairs. The formula is as follows: ; in, , For positive sample pairs, For temperature parameters; Finally, the trained LSTM model is deployed as a real-time feature extraction service to generate time-varying feature vectors online for newly collected data. The vector dimension is compressed to 32 dimensions (through PCA dimensionality reduction) and output in JSON format, including timestamp, device ID, feature vector values, and anomaly scores (calculated based on reconstruction error), providing input for subsequent state evaluation and prediction.

[0033] Step 203: Input the time-varying feature vector into the digital twin model framework, train the digital twin model using historical running data, and optimize the digital twin model parameters through cross-validation; Specifically, first, the time-varying feature vector (32-dimensional) obtained in step 202 is timestamped with the historical operating data (including data from 100+ monitoring points such as bus voltage, line current, and equipment temperature, spanning 3 years with a sampling interval of 5 minutes) to construct an input-output mapping pair; the dataset is divided into a training set and a test set in a 7:3 ratio, and the training set is further divided into an internal training set and a validation set in an 8:2 ratio. Then, for the electrical field parameters (such as line impedance and transformer turns ratio) and thermal field parameters (such as equipment thermal resistance and convective heat transfer coefficient) in the digital twin model, a parameter optimization objective function is designed: ; in, For parameters to be optimized, The sample weights are calculated as follows (1.5 for peak load periods and 1 for normal periods). , These are the error weights for the electrical field and the thermal field, respectively. Bus voltage For equipment temperature; Next, the Bayesian optimization algorithm is used to globally optimize the model parameters, as follows: Parameter space definition: line resistance / reactance fluctuates within ±15%, transformer iron loss coefficient is in the range of [0.9, 1.1], and equipment thermal resistance is in the range of ±20%; Objective function evaluation: Each parameter combination is run in the digital twin model, calculating the error compared to historical data, for example: ; Iterative optimization: Set 50 main iterations, with 8 candidate parameter combinations generated in each iteration. Predict parameter performance through Gaussian process regression, and select the combination with the greatest expected improvement for evaluation. Then perform K-fold cross-validation (K=5); divide the training set into 5 subsets, use 4 subsets to train the model and 1 subset to validate each time, and calculate the average validation error; for scenarios with large validation errors (such as during the high temperature period in summer), increase the weight of the samples during that period to 2.0 and retrain the model; Next, sensitivity analysis was used to screen key parameters; the impact of changes in each parameter on the objective function was calculated, for example: ; Retain parameters with a sensitivity greater than 0.1 (such as transformer winding thermal resistance and line contact resistance), and fix other parameters to reduce the number of optimization dimensions; Finally, the performance of the optimized model is evaluated using the test set; the voltage prediction error (target ≤3%), temperature prediction error (target ≤5℃), and demand prediction error (target ≤8%) are calculated; if the indicators do not meet the targets, the optimization weights are adjusted (e.g., the thermal field error weight is increased to 0.6) or the parameter search space is expanded until the model error in various typical scenarios converges to the target range; finally, the optimized parameters are stored in a JSON format configuration file, including parameter names, optimal values, confidence intervals, and other information.

[0034] Step 204: Based on the deviation between the real-time running data and the prediction results of the digital twin model, dynamically calibrate the parameters of the digital twin model using the Kalman filter algorithm; Specifically, first, establish the state-space representation of the digital twin model: ; in, This refers to the system state vector (such as bus voltage phasor, equipment temperature distribution). For control inputs (such as load regulation). The parameters to be calibrated (such as line impedance and thermal resistance coefficient). For observation vectors (real-time measurement data). and These are process noise and measurement noise, both assumed to be Gaussian white noise. Then, define the parameter calibration process: Initialization: Sets the initial values ​​of parameters. and its covariance matrix Noise covariance Q and R (estimated statistically from historical data); Prediction steps: ; Update steps: ; in, The observation matrix (Jacobi matrix). Kalman gain; Next, different calibration strategies are designed based on the characteristics of the electrical and thermal field parameters, as follows: Electrical parameter calibration: Focus on calibrating line resistance R and reactance X, using bus voltage amplitude and phase observations; calibration is triggered when the voltage deviation exceeds 0.5%, and the step size for each iteration is ±2% of the current value; Thermal field parameter calibration: mainly calibrating the thermal resistance of the equipment. and heat capacity Based on temperature observations; triggered when temperature deviation exceeds 2℃, with an adjustment step size of ±5%; Then implement adaptive noise covariance adjustment: ; in, Forgetting factor , This allows the algorithm to adapt to slow changes in system characteristics; Next, set the parameter constraints as follows: Line resistance ( (Design value); Transformer iron loss coefficient ; Equipment thermal resistance ; When the parameter update exceeds the constraint range, it is pulled back to the boundary value and the corresponding noise covariance is increased; Finally, a multi-rate calibration mechanism is implemented, as follows: For rapidly changing electrical parameters (such as line impedance), the calibration cycle is 1 minute; For slowly changing thermal field parameters (such as changes in thermal resistance due to equipment aging), the calibration cycle is 1 hour. When a change in device status is detected (such as a switch action), the relevant parameters are immediately recalibrated. The calibrated parameters are updated to the digital twin model in real time, and the trend of parameter changes is recorded. When the parameters change in the same direction for 10 consecutive calibrations, an equipment status warning is triggered (such as a continuous increase in line contact resistance indicating poor contact).

[0035] In this embodiment, specifically: in step one, real-time operating data is collected in real time through current sensors, voltage sensors, and power sensors deployed in the power system; Among them, the current sensor is installed in the transmission line, transformer branch and other locations, and adopts electromagnetic or electronic principle to measure the line current in real time; the acquisition accuracy reaches 0.5 level (that is, the measurement error ≤ ±0.5%), which can accurately reflect the dynamic changes of load current (such as the inrush current when the motor starts). The voltage sensor covers busbars of all voltage levels from 10kV to 500kV, and acquires busbar voltage signals through voltage transformers (PT) or capacitive voltage transformers (CVT). The acquisition range includes voltage amplitude (such as the real-time value of 10kV busbar voltage) and phase information, which are used to monitor system voltage stability (such as voltage sag and harmonic distortion). The power sensor calculates active power, reactive power, and apparent power based on synchronous sampling data of voltage and current; it supports phase-by-phase measurement (A, B, and C phases) and can accurately capture abnormal operating conditions such as three-phase load imbalance (e.g., three-phase power deviation caused by the operation of single-phase equipment in industrial users).

[0036] Real-time operating data includes bus voltage, line current, load power, and equipment status signals; Among them, bus voltage refers to the voltage value of the bus node in the power system, which is one of the core indicators for measuring power quality. For example, the high-voltage bus voltage of a 220kV substation needs to be maintained within ±5% of the rated value. Real-time acquisition of its amplitude and phase can promptly detect voltage overruns (such as voltage drops caused by system short-circuit faults). Line current reflects the magnitude of the current transmitted in the transmission line and is directly related to the line load factor and safety margin. For example, the rated current of a 110kV line is 1200A. Real-time monitoring of the current value (such as 800A at present) can assess the line load and avoid overload and overheating. Load power includes active power (actual power consumed, in kW) and reactive power (power consumed by inductive / capacitive equipment, in kvar). By analyzing load power curves (such as daily load curves in residential areas), peak electricity consumption periods (such as 18:00-22:00) and load characteristics (inductive / capacitive load ratio) can be identified. The equipment status signals cover key parameters such as the circuit breaker's open / closed status, transformer oil temperature, and energy storage status of switchgear; for example, an early warning is triggered when the transformer oil temperature exceeds 85°C, and an abnormal circuit breaker open / closed position (such as "sneak trip") is reported in real time to ensure that the equipment's operating status is controllable.

[0037] In this embodiment, specifically: in step four, the control device includes an intelligent load controller, a distributed power management unit, and an energy storage converter; Among them, the intelligent load controller is installed in the user-side distribution box or at the front end of large electrical equipment (such as air conditioners and heat pumps) to realize the power control of adjustable loads; for example, when the demand forecast exceeds the limit, the received instruction will reduce the power of non-critical loads (such as office building air conditioners) by 20%, with a response time of ≤300ms; The Distributed Power Management Unit (DPU) is used to manage distributed power sources such as photovoltaic inverters and small wind power, and to adjust their output and power factor. For example, when the grid voltage is too high, the DPU is instructed to raise the power factor of the photovoltaic inverter from 0.95 to 1.0 and absorb reactive power to stabilize the voltage. The energy storage converter (PCS) is used to control the charging and discharging process of the energy storage battery and adjust the power magnitude and direction; for example, charging during off-peak hours (power 500kW) and discharging during peak hours (power 800kW), with a response time ≤200ms, to meet the requirements of fast power compensation.

[0038] Control commands are sent to the control device via MQTT or Modbus communication protocols, with a command response time of no more than 500ms; Among them, the MQTT protocol is based on the publish / subscribe model, supports low bandwidth and high concurrency scenarios, and is suitable for a large number of distributed load controllers (such as hundreds of nodes in a residential community). Modbus protocol: master-slave communication mode, supports RS485 or Ethernet transmission, suitable for centralized equipment in industrial environments (such as energy storage systems in substations).

[0039] In this embodiment, specifically: in step five, when evaluating the control effect, in addition to comparing the calculated error value with the preset threshold, the calculation also includes the control response time, the demand fluctuation amplitude, and the energy consumption change rate; Control response time refers to the time interval from the issuance of a control command to the actual change in the device's execution state, usually measured in milliseconds (ms). For example, when the system sends a command to adjust the load, the difference between the timestamp of the command issuance and the timestamp of the device's feedback state change is the response time. This indicator reflects the system's efficiency in executing control commands. In power demand control, if the response time exceeds a preset threshold (such as 500ms), it will lead to untimely load adjustment and affect the peak demand reduction effect. Demand fluctuation range refers to the difference between the maximum and minimum actual demand within a certain time period (e.g., 15 minutes), expressed in kilowatts (kW). For example, if the demand data monitored during a certain period are 1000kW, 1030kW, and 980kW, then the fluctuation range is 1030kW - 980kW = 50kW. This indicator is used to measure the stability of load control. If the fluctuation range is too large, it will lead to frequent start-ups and shutdowns of equipment, affecting its lifespan or increasing the burden on the power grid. It is necessary to reduce the oscillation by optimizing the control strategy. The energy consumption change rate refers to the ratio of the change in energy consumption per unit time before and after control to the energy consumption before control, usually expressed as a percentage. For example, if the energy consumption in 1 hour before control is 200 kWh and after control it is 180 kWh, the energy consumption change rate is [(180-200) / 200]×100%=-10% (a negative value indicates a reduction in energy consumption). This indicator is used to assess the impact of control measures on energy consumption. It is necessary to reduce demand while avoiding a significant increase in energy consumption. If the change rate exceeds the threshold (such as ±12%), the equipment regulation priority needs to be adjusted to balance economic efficiency.

[0040] In summary, the demand defense control method based on digital twins provided by this invention collects and preprocesses power system operation data through sensors, combines topology and equipment parameters, and constructs a digital twin model using multiphysics coupling and LSTM, followed by dynamic calibration via Kalman filtering. Based on the model, multiple types of data are fused, and demand is predicted and risks are identified using time series analysis and BiLSTM. A particle swarm optimization algorithm is used to determine strategies targeting demand control, cost, and user experience, and instructions are generated and executed via MQTT / Modbus. Control status and demand data are collected, indicators are calculated to evaluate the effect, and model parameters and control strategies are optimized accordingly, forming a closed-loop control of "data acquisition - model construction - predictive analysis - strategy generation - control execution - evaluation and optimization," thereby achieving precise demand defense control of the power system.

[0041] Figure 4 This is a functional module diagram of a demand defense control system based on digital twins according to an embodiment of this application, as shown below. Figure 4 As shown, a demand defense control system based on digital twins includes a data acquisition and processing module, a digital twin model construction module, a demand prediction module, a strategy generation module, an instruction execution module, an effect evaluation module, and an optimization iteration module. The data acquisition and processing module is configured to acquire real-time operating data of the power system and perform cleaning, noise reduction, and Min-Max normalization processing. The model building module is configured to build a digital twin model based on the processed real-time operating data, combined with the power system topology and equipment parameters, using multi-physics coupling and machine learning technology, and dynamically calibrate and optimize the digital twin model through real-time operating data. The demand forecasting module is configured to be based on a digital twin model, integrating historical demand data, meteorological data, and load characteristic data, and using time series analysis and neural network algorithms to predict future demand and identify demand change trends and potential risks. The strategy generation module is configured to determine the optimal adjustment strategy and generate a demand defense control scheme by adjusting the operating parameters of controllable power equipment or interacting with the external power network based on demand change trends and potential risks and using optimization algorithms. The instruction execution module is configured to convert the demand defense control scheme into control instructions and send them to the control equipment, which then performs demand control according to the instructions. The effect evaluation module is configured to collect the operating status of the control equipment and the actual demand data of the power system in real time, and feed them back to the digital twin model. It evaluates the control effect by calculating the error value and comparing it with the preset threshold, and generates the evaluation result. The optimization iteration module is configured to adjust and optimize the parameters and defense control strategies of the digital twin model based on the evaluation results.

[0042] In this embodiment, specifically: the data acquisition and processing module performs real-time data cleaning, noise reduction, and Min-Max normalization processing through edge computing devices.

[0043] In this embodiment, specifically, a message queue is used for data transmission between the digital twin model construction module and the demand prediction module.

[0044] In summary, the demand defense control system based on digital twin provided by this invention acquires and preprocesses real-time operating data of the power system through a data acquisition and processing module, constructs and calibrates a digital twin model by combining topology and equipment parameters through a digital twin model construction module, integrates multiple types of data to predict demand and identify risks through a demand prediction module, generates optimal adjustment strategies based on risks through a strategy generation module, converts the plan into commands for execution through an instruction execution module, collects data to evaluate the control effect through an effect evaluation module, and optimizes model parameters and strategies based on the evaluation results through an optimization iteration module. The collaboration of these modules achieves precise demand defense control of the power system.

[0045] For further details regarding the implementation of the technical solutions for each module in the demand defense control system based on digital twins in the above embodiments, please refer to the description of the demand defense control method based on digital twins in the above embodiments, which will not be repeated here.

[0046] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system-type embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

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

Claims

1. A demand defense control method based on digital twins, characterized in that, Includes the following steps: Acquire real-time operation data of the power system, and based on the processed real-time operation data combined with the power system topology and equipment parameters, construct a digital twin model using multiphysics coupling and machine learning techniques, and dynamically calibrate and optimize the digital twin model using real-time operation data; Based on the digital twin model, historical demand data, meteorological data, and load characteristic data are integrated, and time series analysis and neural network algorithms are used to predict future demand and identify demand change trends and potential risks. Based on demand change trends and potential risks, the optimal adjustment strategy is determined by adjusting the operating parameters of controllable power equipment or interacting with the external power network, and a demand defense control scheme is generated. The demand defense control scheme is converted into control commands and sent to the control equipment, which then performs demand control according to the commands. The system collects real-time data on the operating status of control equipment and the actual demand of the power system, and feeds it back to the digital twin model. The system evaluates the control effect by calculating the error value and comparing it with the preset threshold, and generates evaluation results.

2. The demand defense control method based on digital twins according to claim 1, characterized in that, The method for predicting future demand using time series analysis and neural network algorithms includes the following steps: Perform time series decomposition on historical demand data to separate trend, seasonal and random components, and generate time series decomposition results; Feature engineering is performed on meteorological data and load characteristic data to construct multidimensional feature vectors; The time series decomposition results and multidimensional feature vectors are fused to form a fused feature dataset, which is then divided into a training set and a test set in a 7:3 ratio. A demand prediction model is built based on the Long Short-Term Memory network in the neural network algorithm, and the demand prediction model is trained and validated using the training set and the test set. Real-time meteorological data, load characteristic data, and current demand data are input into the trained prediction model, which outputs demand forecast values ​​for the next 15 minutes to 24 hours and generates demand forecast curves.

3. The demand defense control method based on digital twins according to claim 1, characterized in that, The method of determining the optimal regulation strategy using optimization algorithms takes demand control targets, control costs, and user electricity experience as optimization objectives. It employs particle swarm optimization or genetic algorithms to optimize the adjustment range, adjustment priority, and power interaction of controllable power equipment and external power network. The controllable power equipment includes adjustable load equipment, distributed power generation equipment, and energy storage equipment. The adjustment priority is set in the order of adjustable load equipment being adjusted first, followed by distributed power generation equipment and energy storage equipment.

4. The demand defense control method based on digital twins according to claim 1, characterized in that, The method for constructing a digital twin model includes the following steps: A digital twin model framework is established based on the coupling relationship between the power system topology and equipment parameters and the electrical and thermal fields. Based on the Long Short-Term Memory network in machine learning technology, time-series features are extracted from real-time operating data to obtain the time-varying feature vector of the power system operating state; The time-varying feature vector is input into the digital twin model framework, the digital twin model is trained using historical running data, and the parameters of the digital twin model are optimized through cross-validation. Based on the deviation between real-time operational data and the prediction results of the digital twin model, the parameters of the digital twin model are dynamically calibrated using the Kalman filter algorithm.

5. The demand defense control method based on digital twins according to claim 1, characterized in that, The real-time operating data is collected in real time through current sensors, voltage sensors, and power sensors deployed in the power system; the real-time operating data includes bus voltage, line current, load power, and equipment status signals.

6. The demand defense control method based on digital twins according to claim 1, characterized in that, The control device includes an intelligent load controller, a distributed power management unit, and an energy storage converter; the control commands are sent to the control device via MQTT or Modbus communication protocols, and the command response time does not exceed 500ms.

7. The demand defense control method based on digital twins according to claim 1, characterized in that, The method also includes adjusting and optimizing the parameters of the digital twin model and the defense control strategy based on the evaluation results. When evaluating the control effect, in addition to comparing the error value with the preset threshold, the method also includes calculating the control response time, the demand fluctuation range, and the energy consumption change rate.

8. A demand defense control system based on digital twins, applied to a demand defense control method based on digital twins according to any one of claims 1-7, characterized in that, It includes a data acquisition and processing module, a digital twin model construction module, a demand forecasting module, a strategy generation module, an instruction execution module, an effect evaluation module, and an optimization iteration module; The data acquisition and processing module is configured to acquire real-time operating data of the power system and perform cleaning, noise reduction and Min-Max normalization processing. The model building module is configured to construct a digital twin model based on the processed real-time operating data, combined with the power system topology and equipment parameters, using multi-physics coupling and machine learning technology, and to dynamically calibrate and optimize the digital twin model through real-time operating data. The demand forecasting module is configured to be based on a digital twin model, integrate historical demand data, meteorological data, and load characteristic data, and use time series analysis and neural network algorithms to predict future demand and identify demand change trends and potential risks. The strategy generation module is configured to determine the optimal adjustment strategy and generate a demand defense control scheme by adjusting the operating parameters of controllable power equipment or interacting with the external power network based on the demand change trend and potential risks and using an optimization algorithm. The instruction execution module is configured to convert the demand defense control scheme into control instructions and send them to the control device, and the control device performs demand control according to the instructions; The effect evaluation module is configured to collect the operating status of the control equipment and the actual demand data of the power system in real time, and feed them back to the digital twin model. The control effect is evaluated by calculating the error value and comparing it with the preset threshold, and an evaluation result is generated. The optimization iteration module is configured to adjust and optimize the parameters and defense control strategies of the digital twin model based on the evaluation results.

9. A demand defense control system based on digital twins according to claim 8, characterized in that, The data acquisition and processing module performs real-time cleaning, noise reduction, and Min-Max normalization of the running data through edge computing devices.

10. A demand defense control system based on digital twins according to claim 8, characterized in that, The digital twin model building module and the demand forecasting module use a message queue for data transmission.

Citation Information

Cited By

  • User side load abnormity situation awareness method and system based on radar map multi-dimensional evaluation

    CN121786668A

  • Heat supply system dispatching and control method and system based on digital twinning

    CN121903226A