Comprehensive energy management method and platform based on digital twinning
By combining edge computing and digital twin technologies with Markov decision models and ensemble learning algorithms, the flexibility and adaptability issues of traditional energy management systems in large-scale power data processing have been solved, enabling efficient and accurate detection and visual management of power anomalies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional energy management systems struggle to handle large-scale, high-frequency electricity data, lack flexibility and adaptability, are unable to effectively identify complex electricity anomalies, and have data processing architectures that make it difficult to achieve real-time analysis and accurate energy management.
A comprehensive energy management approach based on digital twins is adopted. By utilizing edge computing devices and a distributed architecture, combined with Markov decision models and ensemble learning algorithms, power grid data is collected through sensor networks. Power grid topology spatial features and multi-cycle electricity consumption time-series features are extracted, and a digital twin mapping strategy is constructed to detect and visualize electricity consumption anomalies.
It improves data processing efficiency and real-time performance, enhances adaptability to dynamic changes in the power grid, significantly improves the accuracy and comprehensiveness of anomaly detection, provides an intuitive operating interface, and promotes the efficiency improvement of energy management.
Smart Images

Figure CN120746380B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart energy management technology, specifically relating to a comprehensive energy management method and platform based on digital twins. Background Technology
[0002] Energy management systems need to monitor a large number of electrical parameters in real time, including voltage, current, power, and power factor. Simultaneously, they need to analyze electricity consumption patterns, identify abnormal electricity usage behavior, optimize energy allocation, and improve energy efficiency. This requires the system to process massive amounts of real-time data, perform complex analysis and calculations, and make timely decisions.
[0003] In recent years, digital twin technology has been gradually applied in the field of energy management. By creating virtual models of physical entities, digital twins can reflect the state and behavior of actual systems in real time. This technology offers new possibilities for monitoring and optimizing energy systems, and theoretically can more comprehensively and accurately simulate and predict system behavior. However, in practical applications, how to effectively construct and maintain digital twin models of large-scale, complex power systems, and how to achieve real-time data processing and decision-making with limited computing resources, still face significant challenges.
[0004] Traditional energy management systems rely primarily on simple threshold judgments or fixed rule sets to analyze electricity consumption anomalies. While simple and direct, this approach lacks flexibility and adaptability. The main reason is that traditional systems are designed with relatively stable and simple electricity consumption patterns in mind, making them inadequate for handling complex and variable electricity situations. Furthermore, traditional systems often focus only on anomalies in single parameters or devices, lacking the ability to comprehensively analyze the overall system status. In modern power systems, a seemingly normal parameter may conceal system-level anomalies, which are difficult to detect using only single-parameter analysis. On the other hand, with the widespread deployment of smart meters and various sensors, the amount of data that systems need to process is growing exponentially. The data processing architecture and algorithms of traditional systems struggle to handle this large-scale, high-frequency data flow, making it difficult for them to conduct timely and in-depth analysis of large-scale data and accurately address abnormal electricity consumption issues in energy management. Summary of the Invention
[0005] This invention provides a comprehensive energy management method and platform based on digital twins, which solves the technical problem that traditional systems struggle to perform timely and in-depth analysis of large-scale data and accurately address abnormal electricity consumption issues in energy management.
[0006] In a first aspect, the present invention provides a comprehensive energy management method based on digital twins, applied to a smart energy management system configured in a target campus. The smart energy management system includes a campus energy visualization platform, edge computing devices deployed in the target campus, and a sensor network deployed in the power supply circuit of the target campus. The method includes the following steps:
[0007] Obtain the power supply topology of the power supply circuit, and import the power supply topology into the edge computing device and the campus energy visualization platform respectively;
[0008] The power grid operation data of the power supply circuit is collected through the sensor network, and the power grid operation data is transmitted to the edge computing device;
[0009] The power grid operation data is preprocessed using the edge computing device, a digital twin mapping strategy is constructed in the edge computing device based on the Markov decision model, and the preprocessed power grid operation data is adaptively mapped to the campus energy visualization platform through the digital twin mapping strategy.
[0010] The campus energy visualization platform is used to obtain abnormal electricity consumption detection commands from target users.
[0011] In response to the power consumption anomaly detection command, the power consumption anomaly detection task is executed through the edge computing device to obtain the power consumption anomaly detection result, and the power consumption anomaly detection result is imported into the campus energy visualization platform for visualization display.
[0012] The power consumption anomaly detection task includes the following steps:
[0013] Based on the power grid operation data, the power grid topology spatial features are extracted from the power supply topology.
[0014] Multi-cycle electricity consumption time-series features are extracted from the preprocessed power grid operation data;
[0015] The power grid topology spatial characteristics and the multi-cycle electricity consumption time series characteristics are combined, and an electricity consumption anomaly detection algorithm based on ensemble learning algorithm is used to analyze and obtain the electricity consumption anomaly detection results.
[0016] Optionally, the step of constructing a digital twin mapping strategy in the edge computing device based on a Markov decision model, and adaptively mapping the preprocessed power grid operation data to the campus energy visualization platform through the digital twin mapping strategy, includes the following steps:
[0017] The preprocessed power grid operation data is fitted into a power grid state reference curve for the power supply circuit using the edge computing device and cubic spline interpolation.
[0018] N sensors in the sensor network are randomly selected as mapping sensors. The target power grid operation data corresponding to the mapping sensors is the mapping object of the digital twin mapping. N is less than the total number of sensors in the sensor network.
[0019] Based on all the target power grid operation data, predict the complete power grid operation data of the power supply circuit, and fit the power grid state prediction curve of the power supply circuit according to the complete power grid operation data and through a reconstruction algorithm;
[0020] The power grid state prediction curve is used as the model state space of the Markov decision model, and the action of the i-th sensor in the sensor network selected by the edge computing device as the mapping sensor is used as the model action space of the Markov decision model.
[0021] A digital twin mapping strategy is constructed in the edge computing device with the reward functions being minimizing the number of mapping sensors and minimizing the curve similarity difference. The curve similarity difference is the similarity difference value between the power grid state baseline curve and the power grid state prediction curve.
[0022] The near-end policy optimization algorithm is used to optimize the digital twin mapping strategy to obtain the optimal mapping strategy;
[0023] The optimal power grid operation data corresponding to the optimal mapping sensor selected in the optimal mapping strategy is mapped to the campus energy visualization platform for visualization display.
[0024] Optionally, mapping the optimal power grid operation data corresponding to the optimal mapping sensor selected in the optimal mapping strategy to the campus energy visualization platform for visualization includes the following steps:
[0025] Principal component analysis is used to extract the features of the data to be mapped from the optimal power grid operation data corresponding to the optimal mapping sensor selected in the optimal mapping strategy.
[0026] A fake data detection model based on a convolutional neural network is deployed in the edge computing device, and the fake data detection model is trained using historical power grid operation data of the power supply circuit collected by the sensor network.
[0027] The trained fake data detection model identifies whether there are fake injected data features in the features of the data to be mapped.
[0028] If it is found that the false injected data feature does not exist in the data features to be mapped, then all the optimal power grid operation data are mapped to the campus energy visualization platform, and all the optimal power grid operation data are associated and matched with the power supply topology for visualization display.
[0029] Optionally, the step of extracting the power grid topology spatial features from the power supply topology based on the power grid operation data includes the following steps:
[0030] The power supply topology is converted into power supply topology graph data. The graph nodes in the power supply topology graph data represent the power supply equipment and electrical equipment in the power supply circuit, and the graph node edges in the power supply topology graph data represent the electrical connection relationship between the power supply equipment and the electrical equipment.
[0031] Based on the association between the sensors and each of the power supply devices or the power consumption devices in the sensor network, a first graph node attribute is added to all the graph nodes based on the power grid operation data;
[0032] Based on the first graph node attributes, the key node features of each graph node in the power supply topology graph data are extracted and integrated into a node feature set. The key node features include the node degree and node centrality of the graph node.
[0033] Clustering coefficients of the power supply topology data are calculated using a clustering algorithm to obtain the global clustering features of the power supply topology data;
[0034] The spatial distribution pattern of the power supply topology data is evaluated using an autocorrelation index to obtain the spatial distribution characteristics of the power supply topology data.
[0035] The node feature set, the global clustering feature, and the spatial distribution feature are combined into a complete feature vector as the power grid topology spatial feature of the power supply topology.
[0036] Optionally, extracting multi-cycle electricity consumption time-series features from the preprocessed power grid operation data includes the following steps:
[0037] Multiple time decomposition scales of different sizes are determined based on the time span of the power grid operation data;
[0038] The power grid operation data is decomposed into multiple power grid operation sequence data according to each of the aforementioned time decomposition scales;
[0039] Based on the number of data points in the power grid operation sequence data, multiple copies of the power supply topology data are obtained in the same quantity, and multiple copies of the power supply topology data are randomly matched with the multiple copies of the power grid operation sequence data.
[0040] For each set of the power grid operation sequence data and the power supply topology data, based on the association between the sensors and each power supply device or the power consumption device in the sensor network, a second graph node attribute is added to all the graph nodes based on the power grid operation sequence data;
[0041] By extracting the power grid time-series dependency features from each of the power supply topology data using a pre-deployed long short-term memory network model, and fusing all the power grid time-series dependency features, the multi-cycle power consumption time-series features of the power grid operation data are obtained.
[0042] Optionally, the step of combining the power grid topology spatial features and the multi-cycle electricity consumption time series features and using an electricity consumption anomaly detection algorithm based on ensemble learning to analyze and obtain the electricity consumption anomaly detection result includes the following steps:
[0043] The power grid topology spatial features and the multi-cycle electricity consumption time series features are fused to obtain the comprehensive spatiotemporal features of electricity consumption.
[0044] A power consumption anomaly detection model based on gradient boosting decision tree is deployed in the edge computing device, and a model loss function for the power consumption anomaly detection model is constructed. The power consumption anomaly detection model uses a symmetric binary tree as the base model.
[0045] With the goal of minimizing the model loss function, the power consumption anomaly detection model is trained using historical power grid operation data of the power supply circuit collected by the sensor network, and gradient estimation error is reduced during the model training process by using a ranking boosting method.
[0046] The comprehensive spatiotemporal features of electricity consumption are input into the trained electricity consumption anomaly detection model, and the electricity consumption anomaly detection results are output through the electricity consumption anomaly detection model.
[0047] Optionally, the formula for the model loss function is as follows:
[0048]
[0049] In the formula: L represents the model loss function, This represents the probability that a sample is a positive sample. Indicates the positive adjustment parameter. This represents the function that maximizes the value, where m represents the adjustable hyperparameter. represents the negative adjustment parameter, and y represents the true label of the sample.
[0050] Optionally, the step of training the power consumption anomaly detection model using historical power grid operation data of the power supply circuit collected by the sensor network with the objective of minimizing the model loss function, and reducing gradient estimation error through a ranking boosting method during model training, includes the following steps:
[0051] Acquire and preprocess historical power grid operation data of the power supply circuit collected by the sensor network;
[0052] Historical power supply topology data is constructed by combining the power supply topology and the preprocessed historical power grid operation data;
[0053] Historical spatiotemporal features of electricity consumption are extracted from the historical power supply topology data using a pre-deployed GNN-LSTM model, and feature annotations are performed on the historical spatiotemporal features of electricity consumption.
[0054] Initialize the original model parameters in the power consumption anomaly detection model, and generate an initial population for the parameter optimization algorithm based on the model parameters and using the Tent chaotic mapping method. The model parameters include the maximum number of decision trees, learning rate, regularization sub-parameters, and decision tree depth.
[0055] Set the maximum number of iterations T for the parameter optimization algorithm;
[0056] Based on the maximum number of iterations T, the initial population is iteratively optimized using the parameter optimization algorithm until the current number of iterations t of the parameter optimization algorithm reaches the maximum number of iterations T, thereby obtaining the optimal model parameters;
[0057] The original model parameters in the power consumption anomaly detection model are updated using the optimal model parameters.
[0058] The electricity anomaly detection model is trained using the historical spatiotemporal features of electricity consumption after feature annotation. During the model training process, the gradient estimation error is reduced by the ranking boosting method until the model loss function is trained to the minimum value, thus completing the training process of the electricity anomaly detection model.
[0059] Optionally, the step of iteratively optimizing the initial population based on the maximum number of iterations T and using the parameter optimization algorithm until the current number of iterations t of the parameter optimization algorithm reaches the maximum number of iterations T, to obtain the optimal model parameters, includes the following steps:
[0060] The initial population is used as the current generation population when the current iteration number t=1;
[0061] For any round of iterative update process, calculate the individual fitness value of all individuals in the current generation population when the current iteration number t is reached;
[0062] If t < T, then based on the individual fitness value and by using the improved reptile search algorithm, update the individual position of the population in the current generation, and use the population with the updated individual position as the current generation population in the next iteration.
[0063] Increment the value of the current iteration number t by 1, and repeat the next iteration update process;
[0064] If t=T, then based on the individual fitness value, the individual position of the population in the current generation is updated by the improved reptile search algorithm, and the individual fitness value of the population in the current generation is recalculated. The population individual with the best individual fitness is output as the optimal model parameter.
[0065] The step of updating the individual positions of individuals in the current generation population based on the individual fitness value and using an improved reptile search algorithm, and then using the population with updated individual positions as the current generation population for the next iteration, specifically includes the following steps:
[0066] If the current iteration number t≤T / 4, then the high-stepping strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration.
[0067] If the current iteration number T / 4 < t ≤ T / 2, then based on the individual fitness value, the abdominal crawling strategy in the reptile search algorithm is executed to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration.
[0068] If the current iteration number T / 2 < t ≤ 3T / 4, then the hunting coordination strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration.
[0069] If the current iteration number 3T / 4 < t < T, then the hunting cooperation strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration.
[0070] For any current generation of the basic population, the individual positions of the population individuals in the current generation are adjusted using a t-distribution mutation perturbation strategy.
[0071] In a second aspect, the present invention also provides a digital twin-based integrated energy management platform, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the digital twin-based integrated energy management method as described in the first aspect.
[0072] The beneficial effects of this invention are:
[0073] This invention significantly improves the efficiency and real-time performance of data processing by introducing edge computing devices and a distributed architecture. Edge computing devices can perform preliminary processing and analysis closer to the data source, reducing the burden on the central server and lowering network transmission pressure, thereby enabling faster anomaly detection and response. Secondly, this invention employs a digital twin mapping strategy based on a Markov decision model, enabling the system to more intelligently adapt to dynamic changes in the power grid and improving the accuracy of data processing and analysis. This strategy can dynamically adjust the data processing method according to real-time status, ensuring the timely transmission and processing of critical information. By combining the characteristics of the power grid topology and multi-cycle electricity consumption time series, and using an ensemble learning algorithm for anomaly detection, the accuracy and comprehensiveness of anomaly detection are significantly improved. This method can capture complex anomaly patterns, reduce false alarms and missed alarms, and provide operators with more reliable power management decision support. Furthermore, the campus energy visualization platform of this invention provides an intuitive and interactive user interface, allowing non-technical managers to easily operate and monitor complex power systems. This not only improves system availability but also promotes efficiency improvements in energy management. Attached Figure Description
[0074] Figure 1 This is a flowchart illustrating one embodiment of the integrated energy management method based on digital twins in this application.
[0075] Figure 2 This is a schematic diagram comparing population initialization in one embodiment of this application.
[0076] Figure 3 This is a flowchart illustrating the parameter optimization algorithm in one embodiment of this application. Detailed Implementation
[0077] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0078] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0079] Figure 1 This is a flowchart illustrating an integrated energy management method based on digital twins in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0080] The integrated energy management method based on digital twins disclosed in this invention is applied to a smart energy management system configured in a target campus. The smart energy management system includes a campus energy visualization platform, edge computing devices deployed in the target campus, and a sensor network deployed in the power supply circuits of the target campus. For example... Figure 1 As shown, the integrated energy management method based on digital twins disclosed in this invention specifically includes the following steps:
[0081] S101. Obtain the power supply topology of the power supply circuit and import the power supply topology into the edge computing device and the campus energy visualization platform respectively.
[0082] The process involves acquiring power system drawings of the target campus through its smart energy management system. These drawings detail the location, specifications, and connections of all electrical components, including substations, distribution cabinets, and electrical equipment. Then, professional power system modeling software (such as ETAP or PowerWorld) is used to digitize this information, constructing a complete power supply topology model. This model includes node (representing various electrical devices) and edge (representing electrical connections between devices) information, as well as the attributes of each node (such as rated voltage and capacity). This topology is then converted to a standard format (such as GraphML or JSON). Next, using secure data transmission protocols (such as HTTPS or MQTT), the topology data is simultaneously sent to edge computing devices and the campus energy visualization platform. The edge computing devices store the data in a local cache for fast access, while the visualization platform stores the data in a cloud database for global analysis and visualization. This approach ensures real-time processing capabilities at the edge while providing a foundation for comprehensive cloud analysis, laying a solid foundation for subsequent data processing and anomaly detection.
[0083] S102. Collect power grid operation data of the power supply circuit through a sensor network and transmit the power grid operation data to the edge computing device.
[0084] Smart sensors are installed at key nodes in the power supply circuit (such as substation outgoing lines, main distribution cabinets, and entrances to large electrical equipment). These sensors include voltage sensors, current sensors, and power factor sensors. Each sensor has a specific measurement range and accuracy; for example, a voltage sensor may have a range of 0-1000V and an accuracy of ±0.5%. The sensors use a high sampling rate to collect real-time power grid operating parameters such as voltage, current, active power, reactive power, and harmonics. The collected raw data is converted into digital signals by an analog-to-digital converter inside the sensor and then transmitted to the nearest edge computing device via a preset wireless communication protocol (such as ZigBee, LoRa, or NB-IoT). To ensure the reliability and security of data transmission, the data is encrypted using the AES-128 encryption algorithm. The edge computing device is equipped with a high-performance processor and large-capacity storage, enabling it to simultaneously receive data streams from multiple sensors and perform real-time decryption and preliminary processing. The received data is immediately stored in a time-series database for subsequent rapid querying and analysis. This distributed data acquisition and edge processing approach significantly reduces data transmission latency and improves the system's real-time response capability.
[0085] S103. Use edge computing devices to preprocess power grid operation data, construct a digital twin mapping strategy in the edge computing devices based on Markov decision models, and adaptively map the preprocessed power grid operation data to the campus energy visualization platform through the digital twin mapping strategy.
[0086] The preprocessing includes the following steps: (1) Denoising: removing random noise using median filtering or wavelet transform; (2) Interpolation: filling missing data points using linear interpolation or spline interpolation; (3) Normalization: unifying data of different dimensions to the [0,1] interval, such as using the Min-Max normalization method. Next, a digital twin mapping strategy is constructed based on the Markov decision model. The state space S is defined as the state vector of each node in the power grid, the action space A is the sensor selection set, and the reward function R(s,a) can comprehensively consider the data representation accuracy and the number of sensors. Then, the optimal strategy π is solved using algorithms such as value iteration or policy gradient. (s). After determining the optimal strategy, for each time step t, the optimal subset of sensors is selected based on the current state st. Data from these sensors is then transmitted in real-time to the campus energy visualization platform via a secure network channel. Upon receiving the data, the platform uses digital twin technology to map it onto a virtual power grid model, enabling real-time status updates and visualization. This adaptive mapping strategy ensures data comprehensiveness while significantly reducing data transmission volume and improving system efficiency.
[0087] S104. Obtain the target user's power consumption anomaly detection command through the campus energy visualization platform.
[0088] The campus energy visualization platform provides a web interface, using HTML5 and JavaScript technologies to build an intuitive interactive dashboard. Users can access the platform through a browser or mobile application. The interface displays real-time energy consumption data, historical trend charts, and other information, and uses visualization libraries such as ECharts to draw dynamic charts. When users need to detect abnormal electricity consumption, they can operate through the graphical interface: (1) Select the detection range: Select a specific building or area through the drop-down menu or map; (2) Set the time period: Use the date picker to specify the start and end time of the detection; (3) Adjust the detection parameters: Set the abnormal judgment threshold (such as a deviation of more than 20% from the historical data of the same period) through the slider; (4) Select the detection algorithm: Select a suitable detection method (such as statistical methods, machine learning methods, etc.) from the preset algorithm list. After completing the settings, the user clicks the "Start Detection" button. The platform encodes these settings into detection instructions in JSON format, for example: {"building_id": "A01", "start_time": "2023-01-01 00:00:00", "end_time": "2023-01-07 23:59:59", "threshold": 0.2, "algorithm": "isolation_forest"}. These instructions are then securely sent to the edge computing device via HTTPS, triggering the anomaly detection process.
[0089] S105. Responding to the power consumption anomaly detection command and executing the power consumption anomaly detection task through the edge computing device, obtaining the power consumption anomaly detection result, and importing the power consumption anomaly detection result into the campus energy visualization platform for visualization display.
[0090] The process begins by retrieving preprocessed power grid operation data within a specified time range from local storage. Then, sub-steps S1051-S1053 are executed to extract power grid topology spatial features and multi-cycle electricity consumption time-series features, as well as perform anomaly detection and analysis based on these features. The detection results include information such as the time, location, type, and severity of the anomaly. Edge devices package these results into structured data (e.g., JSON format) and upload them to the campus energy visualization platform via a secure, encrypted network connection. Upon receiving the results, the platform uses data visualization technology to present the anomaly detection results to users in an intuitive and easy-to-understand manner, facilitating the rapid location and handling of potential electricity consumption problems.
[0091] The task of detecting abnormal electricity usage includes the following steps:
[0092] S1051. Extract the topological spatial features of the power grid from the power supply topology based on the power grid operation data.
[0093] The power supply topology is converted into a graph data structure, where nodes represent equipment such as substations, distribution cabinets, and classroom electrical equipment, and edges represent the electrical connections between them. This graph can be represented using an adjacency matrix A, where Aij=1 indicates a connection between nodes i and j, otherwise Aij=0. Next, attributes such as voltage level and load rate are added to each node based on grid operation data. Then, at least one or more of the following key features can be extracted: (1) Node degree: Calculate the number of connections for each node, reflecting the importance of the equipment. (2) Centrality: Calculate the global importance of a node using the eigenvector centrality algorithm, with the formula: , where x is the centrality vector and λ is the largest eigenvalue. (3) Clustering coefficient: Calculates the degree of clustering of the entire network, reflecting the local connection density. For node i, its clustering coefficient is λ = λ / λ. , where ei is the number of edges between the neighbors of node i, and ki is the degree of node i. The global clustering coefficient of the network is the average of the clustering coefficients of all nodes. (4) Spatial autocorrelation: Moran's I index is used to evaluate the spatial distribution pattern of the power grid characteristics. Finally, these features are combined into a feature vector as a comprehensive representation of the spatial characteristics of the power grid topology. This method not only captures the static structural information of the power grid, but also combines dynamic operating data, providing rich spatial dimension information for subsequent anomaly detection.
[0094] S1052. Extract multi-cycle electricity consumption time series features from the preprocessed power grid operation data.
[0095] Based on the time span of the power grid operation data, multiple time scales are defined, such as hourly, daily, weekly, and monthly. Time-series features are extracted for each scale, and finally, the time-series features from all scales are merged into multi-cycle electricity consumption time-series features.
[0096] S1053. The power consumption anomaly detection results are obtained by combining the power grid topology spatial characteristics and multi-cycle power consumption time series characteristics and using a power consumption anomaly detection algorithm based on ensemble learning algorithm.
[0097] Among them, the topological spatial features extracted from S1051 and the temporal features extracted from S1052 are fused to form a comprehensive feature vector. The fusion method can be a simple feature concatenation or a more complex feature fusion technique, such as an autoencoder. Next, an anomaly detection model based on gradient boosting decision tree (GBDT) is constructed. GBDT is a powerful ensemble learning algorithm that can effectively handle high-dimensional features and complex nonlinear relationships. The basic idea of the model is to iteratively train multiple weak learners (decision trees), and each training focuses on samples with poor prediction performance of the previous model. The specific steps are as follows: (1) Initialize the model , where L is the loss function and yi is the true label.
[0098] (2) For (M is the total number of iterations), calculate the negative gradient:
[0099]
[0100] Fit a regression tree hm(x) to the residuals Above, calculate the step size:
[0101]
[0102] Update model .
[0103] (3) The final model is obtained To improve the model's sensitivity to anomalies, special loss functions, such as Huber loss or custom asymmetric loss functions, can be used. Furthermore, cross-validation is applied during training to tune hyperparameters, such as tree depth and learning rate. Finally, for each data point, the model outputs an anomaly score. The final anomaly is determined by setting an appropriate threshold or using clustering techniques (such as DBSCAN). This ensemble learning-based approach not only effectively utilizes the spatial and temporal characteristics of the power grid but also possesses strong generalization ability and robustness, adapting to various complex situations in power grid operation and improving the accuracy and reliability of anomaly detection.
[0104] In one implementation, a digital twin mapping strategy is constructed in an edge computing device based on a Markov decision model, and the preprocessed power grid operation data is adaptively mapped to the campus energy visualization platform through the digital twin mapping strategy, including the following steps:
[0105] Using edge computing devices and cubic spline interpolation, the preprocessed power grid operation data is fitted into a power grid state reference curve for the power supply circuit;
[0106] N sensors in the sensor network are randomly selected as mapping sensors. The target power grid operation data corresponding to the mapping sensors is the mapping object of the digital twin mapping. N is less than the total number of sensors in the sensor network.
[0107] Based on all target power grid operation data, predict the complete power grid operation data of the power supply circuit, and fit the power grid state prediction curve of the power supply circuit according to the complete power grid operation data and the reconstruction algorithm.
[0108] The power grid state prediction curve is used as the model state space of the Markov decision model, and the action of the i-th sensor in the sensor network selected by the edge computing device as the mapping sensor is used as the model action space of the Markov decision model.
[0109] A digital twin mapping strategy is constructed in edge computing devices with the reward functions of minimizing the number of mapping sensors and minimizing the curve similarity difference. The curve similarity difference is the similarity difference value between the power grid state baseline curve and the power grid state prediction curve.
[0110] The near-end policy optimization algorithm is used to optimize the digital twin mapping strategy and obtain the optimal mapping strategy.
[0111] The optimal power grid operation data corresponding to the optimal mapping sensor selected in the optimal mapping strategy is mapped to the campus energy visualization platform for visualization display.
[0112] In this embodiment, the preprocessed power grid operation data includes key parameters such as voltage, current, and power. These data points may have uneven spacing or be missing. Cubic spline interpolation can create smooth curves between these discrete data points while maintaining data continuity and differentiability. In specific implementation, the data points are divided into several intervals, and a cubic polynomial function is used in each interval. The data is fitted using a method that maintains the continuity of the first and second derivatives of functions at the boundaries between adjacent intervals, ensuring the smoothness of the overall curve. The coefficients of the polynomial for each interval are obtained by solving a system of linear equations. This method not only accurately reflects the information of known data points but also provides reasonable interpolation estimates between data points. The resulting power grid state baseline curve comprehensively reflects the dynamic characteristics of the power supply circuit, providing a reliable reference for subsequent digital twin mapping.
[0113] Next, N sensors from the sensor network are randomly selected as mapping sensors. Specifically, a suitable value for N is first determined, which requires a trade-off between the comprehensiveness of the data representation and the limitations of computational resources. For example, if the total number of sensors is 100, N=20 is chosen as the starting value. The selection process uses random sampling algorithms, such as simple random sampling or stratified random sampling. Simple random sampling can use a random number generator to assign a random number to each sensor and then select the first N. Stratified random sampling first groups the sensors by type or location and then randomly selects from each group. The selected N sensors are labeled as mapping sensors, and their data will be used for digital twin mapping. The target power grid operating data for these mapping sensors includes time series of key parameters such as voltage, current, and power.
[0114] Then, based on all target grid operation data, the complete grid operation data of the power supply loop is predicted, and the grid state prediction curve of the power supply loop is fitted through a reconstruction algorithm. First, using target grid operation data from N selected mapping sensors as input, a machine learning algorithm (such as a Long Short-Term Memory network, LSTM) is employed to predict the complete grid operation data of the entire power supply loop. The LSTM model effectively captures long-term dependencies in time-series data, resulting in high prediction accuracy. During the prediction process, the model considers historical data patterns, current observations, and possible periodic variations. Next, a reconstruction algorithm (such as Principal Component Analysis (PCA) or an autoencoder) is used to reduce the dimensionality of the predicted high-dimensional data and reconstruct the grid state prediction curve. The PCA method first calculates the data covariance matrix, then selects the principal eigenvectors as new bases and projects the original data. The autoencoder learns a low-dimensional representation of the data through a neural network. The final grid state prediction curve can express the dynamic characteristics of the entire power supply loop in a compact form, providing important input for subsequent decision-making.
[0115] Next, the power grid state prediction curve is used as the model state space of the Markov decision model, and the action of the edge computing device selecting the i-th sensor in the sensor network as the mapping sensor is used as the model action space of the Markov decision model. This step lays the foundation for building an intelligent decision system. The state space S is defined as the discretized representation of the power grid state prediction curve. For example, the curve can be divided into m points, and the value of each point constitutes a state vector s∈S. The action space A is defined as the decision of selecting a sensor, i.e., A={1,2,...,K}, where K is the total number of sensors. At each time step t, the system selects an action at (i.e., selects a sensor) based on the current state st, and then observes the new state st+1 and the obtained reward rt. The transition probability P(st+1|st,at) describes the change of the system state after selecting a certain sensor, which can be obtained through historical data statistics. In this way, the sensor selection problem is formalized into a sequential decision problem, providing a theoretical basis for applying reinforcement learning algorithms. This modeling method can capture the dynamic changes of the power grid state and the long-term impact of the decision, which is beneficial for obtaining the globally optimal sensor selection strategy.
[0116] In the aforementioned intelligent decision-making system, the reward functions are minimizing the number of mapped sensors and minimizing the curve similarity difference, thereby constructing a digital twin mapping strategy in edge computing devices. The reward function R is defined as follows: Where N is the number of selected mapping sensors, D(C_b,C_p) is the similarity difference between the grid state baseline curve C_b and the grid state prediction curve C_p, and α and β are trade-off factors. The similarity difference can be calculated using the Dynamic Time Warping (DTW) algorithm, which can handle the nonlinear alignment problem of time series. The DTW distance is defined as... , where w_i is the Euclidean distance on the alignment path. The goal of constructing the digital twin mapping strategy is to find a policy π: S→A that maximizes the expected cumulative reward. This optimization problem can be solved using dynamic programming methods (such as value iteration or policy iteration). In this way, the system can minimize the number of sensors required while ensuring data accuracy, thereby improving overall efficiency.
[0117] Next, the Proximal Policy Optimization (PPO) algorithm is used to optimize the digital twin mapping policy and obtain the optimal mapping policy. PPO is an advanced policy gradient algorithm that improves training stability by introducing a pruning mechanism to limit the magnitude of each policy update. The specific implementation steps are as follows:
[0118] (1) Initialize the policy network πθ and the value function network Vφ.
[0119] (2) In each iteration, a batch of trajectory data {(st,at,rt,st+1)} is collected using the current strategy πθ.
[0120] (3) Calculate the advantage estimate .
[0121] (4) Update the policy network, with the objective function as follows:
[0122]
[0123] in ε is the clipping parameter.
[0124] (5) Update the value function network and minimize it. .
[0125] (6) Repeat steps 2-5 above until convergence. The PPO algorithm can ensure monotonic performance improvement while avoiding excessive policy updates, making it particularly suitable for complex continuous control tasks. Through multiple iterations, the final optimal mapping strategy can select the most suitable sensor set under different power grid conditions, achieving the best balance between data acquisition efficiency and accuracy.
[0126] The final step in the entire process, and a crucial one directly facing users, is mapping the optimal grid operation data corresponding to the optimal mapping sensors selected in the optimal mapping strategy to the campus energy visualization platform for visualization. First, based on the optimal mapping sensor set determined by the optimal mapping strategy, the corresponding grid operation data is extracted from edge computing devices. This data typically includes time series data for key parameters such as voltage, current, power, and power factor. Next, this data is transmitted to the campus energy visualization platform via secure network protocols (such as HTTPS or WebSocket). The visualization platform uses various chart types to display the data, such as line charts showing parameter trends over time, heat maps showing energy consumption distribution in different areas, and Sankey diagrams showing energy flow. Furthermore, 3D models combined with augmented reality technology can be used to visually overlay data onto campus building models. The platform should also provide interactive functions, allowing users to perform operations such as data filtering, time period selection, and parameter comparison. Through this intuitive and interactive visualization method, managers can quickly understand the campus's energy usage, promptly identify anomalies, and make correct decisions, thereby improving energy management efficiency.
[0127] In one implementation, mapping the optimal power grid operation data corresponding to the optimal mapping sensor selected in the optimal mapping strategy to the campus energy visualization platform for visualization includes the following steps:
[0128] Principal component analysis is used to extract the features of the data to be mapped from the optimal power grid operation data corresponding to the optimal mapping sensor selected from the optimal mapping strategy;
[0129] Deploy a fake data detection model based on convolutional neural networks in edge computing devices, and train the fake data detection model using historical power grid operation data of power supply circuits collected by sensor networks;
[0130] The trained fake data detection model identifies whether there are fake injected data features in the features of the data to be mapped.
[0131] If it is found that there are no false injected data features in the data to be mapped, then all the optimal power grid operation data are mapped to the campus energy visualization platform, and all the optimal power grid operation data are associated and matched with the power supply topology for visualization display.
[0132] In this embodiment, network attacks may occur by attacking measuring instruments such as sensors, smart meters, or remote terminal units, interfering with communication between the sensor network and edge computing devices, or infiltrating edge computing devices to inject erroneous data. This erroneous data leads to incorrect estimates of campus power consumption, causing administrators to make incorrect decisions and impacting overall campus energy management. Such operations can result in equipment failure, widespread power outages, and even threats to life and property. Therefore, ensuring the sensor network and edge computing devices are protected from spoofed data injection attacks is crucial. Since spoofed data injection attacks typically disrupt data distribution characteristics, causing significant differences between the data distribution and normal data distribution, spoofed data in the power grid operation data can be identified by analyzing the data distribution characteristics of the power grid operation data.
[0133] Specifically, the optimal power grid operation data is first organized into a matrix X, where each row represents an observation at a specific time point, and each column represents a power grid parameter (such as voltage, current, power, etc.). Next, the covariance matrix of the data is calculated. , where n is the number of observations. Then, solve the eigenvalue equations of the covariance matrix. This yields the eigenvalues λ and their corresponding eigenvectors v. The eigenvectors are then sorted in descending order of their eigenvalues, and the first k eigenvectors are selected to form the projection matrix P. Finally, through... The original data is projected onto a new k-dimensional space to obtain the features of the data to be mapped. The choice of k can be based on the cumulative variance contribution rate, typically selecting a k value that achieves a cumulative variance contribution rate of 85% to 95%. This method not only effectively reduces data dimensionality and computational complexity in subsequent processing but also preserves the main information in the data, improving analytical efficiency. For example, if the original data has 100 dimensions, PCA may only need to retain 10-20 principal components to explain most of the data variation. The resulting features of the data to be mapped are more compact, facilitating subsequent fake data detection and visualization.
[0134] Next, a convolutional neural network-based fake data detection model is deployed on an edge computing device, and trained using historical power grid operation data collected by a sensor network. Specifically, a CNN architecture suitable for the characteristics of power grid data is designed, including multiple convolutional layers, pooling layers, and fully connected layers. Convolutional layers use kernels of different sizes to capture local features and temporal patterns in the power grid data, while pooling layers reduce feature dimensionality and improve the model's translation invariance. The input layer receives normalized historical power grid operation data, with the data shape being [batch size, time step, number of features]. The output layer uses the sigmoid activation function, outputting a value between 0 and 1 representing the probability that the data is real. Next, a large amount of historical power grid operation data is collected and labeled, including normal data and artificially generated fake data. The dataset is divided into training, validation, and test sets. Cross-entropy is used as the loss function, and the Adam optimizer is employed for model training. During training, early stopping is used to prevent overfitting, and model performance is optimized by adjusting hyperparameters such as learning rate and batch size. After training, the model is deployed to an edge computing device to detect the authenticity of the collected data in real time.
[0135] The extracted features of the data to be mapped are preprocessed according to the format required by the model, including data normalization and time window division. For example, a sliding window method can be used, with each window containing data from T time steps. The data from each window is then input into the trained CNN model. The forward propagation process of the model is as follows:
[0136] 1) The input layer receives data with a shape of [1,T,F], where F is the number of features.
[0137] 2) The data passes through multiple convolutional layers, and the operation of each layer can be represented as output = ReLU(conv(input,kernel) + bias).
[0138] 3) The pooling layer performs downsampling, such as max_pool(input, pool_size).
[0139] 4) Finally, the output value p, between 0 and 1, is obtained through a fully connected layer. If p is greater than a preset threshold (e.g., 0.5), the data in that window is considered real; otherwise, it is marked as potentially false data. To improve reliability, the detection results of multiple consecutive windows can be comprehensively judged, for example, using a majority voting method. If false data is detected, the system will immediately issue a warning and mark the corresponding time period and data characteristics. This real-time detection method can quickly identify potential data injection attacks and simultaneously detect sensor faults, providing reliable assurance for subsequent data processing and decision-making. At the same time, the detection results can also be used to continuously improve and update the detection model, enhancing the long-term security of the system.
[0140] If no spurious injected data features are identified in the data to be mapped, all optimal power grid operation data are mapped to the campus energy visualization platform. After associating and matching all optimal power grid operation data with the power supply topology, the data is then visualized. This step is crucial for transforming data into intuitive and understandable information. First, the optimal power grid operation data, verified by security, is transmitted from the edge computing device to the campus energy visualization platform. Encryption protocols (such as TLS) are used during transmission to ensure data security. Upon arrival at the platform, the data is first stored in a time-series database (such as InfluxDB) for efficient querying and analysis. Next, the power grid operation data is associating and matching it with the pre-stored power supply topology. The matching process utilizes a graph database (such as Neo4j), linking each data point to the corresponding node in the topology (such as substations, distribution cabinets, etc.). The visualization can include multiple levels: macro, meso, and micro. Macro view: A campus map is used as the base map, overlaid with a heat map to display the energy consumption of different areas. Meso view: A Sankey diagram is used to show the energy flow, intuitively expressing the distribution of energy among different buildings. Microscopic View: For specific devices or circuits, real-time updated line graphs display the changing trends of key parameters (such as voltage and current). In addition, the platform provides interactive functions such as time period selection, parameter comparison, and anomaly alarms. Through this multi-dimensional and interactive visualization method, managers can quickly grasp the overall picture of campus energy usage, promptly identify potential problems, and thus improve energy management efficiency and economic benefits.
[0141] In one implementation, extracting the power grid topology spatial features from the power supply topology based on power grid operation data includes the following steps:
[0142] The power supply topology is converted into power supply topology graph data. The graph nodes in the power supply topology graph data represent the power supply equipment and the electrical equipment in the power supply circuit, and the graph node edges in the power supply topology graph data represent the electrical connection relationship between the power supply equipment and the electrical equipment.
[0143] Based on the relationship between sensors and various power supply or power consumption devices in the sensor network, first graph node attributes are added to all graph nodes based on power grid operation data;
[0144] Based on the node attributes of the first graph, the key node features of each graph node in the power supply topology graph data are extracted and integrated into a node feature set. The key node features include the node degree and node centrality of the graph node.
[0145] Clustering algorithms are used to calculate the clustering coefficients of the power supply topology data, thereby obtaining the global clustering characteristics of the power supply topology data.
[0146] The spatial distribution pattern of power grid characteristics in power supply topology data is evaluated using autocorrelation index, thus obtaining the spatial distribution characteristics of power supply topology data.
[0147] The node feature set, global clustering features, and spatial distribution features are combined into a complete feature vector as the power grid topology spatial features of the power supply topology.
[0148] In this implementation, the physical world's power system can be abstracted into a mathematical model. Specifically, each power supply device (such as a substation or distribution cabinet) and power consumption device (such as a building or large appliance) is represented as a node in the graph. These nodes are connected by edges, which represent the electrical connections between the devices. For example, a simple power supply topology includes a main substation node connected to multiple distribution cabinet nodes, which in turn connect to various building nodes. In practice, an adjacency matrix or adjacency list can be used to store this graph structure. For a system with n nodes, the adjacency matrix A is an n×n matrix, where Aij=1 indicates that there is a connection between nodes i and j, otherwise Aij=0. Through this transformation, the complex power supply system is simplified into a computable data structure, facilitating advanced operations such as topology analysis, fault diagnosis, and optimized control.
[0149] Next, the static topology is combined with dynamic power grid operation data. In practice, a mapping relationship between sensors and devices is first established, for example, using a hash table to store the device node ID corresponding to each sensor ID. Then, for each point in time in the power grid operation data, the measurements of all sensors are traversed, and these values are assigned to the corresponding graph nodes as the first graph node attributes. Typical node attributes might include voltage level (V), current (A), active power (kW), reactive power (kVar), power factor, etc. For example, if sensor S1 measures a voltage of 10kV at substation A, the attribute "voltage:10kV" is added to the node representing substation A in the graph data. These attributes can be dynamically updated over time, reflecting the real-time state of the power grid. In this way, the static topology graph is transformed into a dynamic attribute graph, where each node not only represents a physical device but also carries the device's operating status information.
[0150] Next, based on the node attributes of the first graph, the key node features of each graph node in the power supply topology graph data are extracted and integrated into a node feature set. The key node features mainly include node degree and node centrality. Node degree refers to the number of edges directly connected to the node, reflecting the degree of connectivity of the device in the network. For node i, its degree ki can be calculated using the adjacency matrix A: Node centrality measures the importance of a node in a network, with eigenvector centrality being a commonly used method. Eigenvector centrality is based on the idea that nodes connected to important nodes are also important. It can be determined by solving the characteristic equation. Let x be the centrality vector and λ be the largest eigenvalue. In practical calculations, the power iteration method can be used to solve this. Alternatively, other centrality indices can be considered, such as betweenness centrality or proximity centrality. These features are combined into a vector to form the feature set of each node. For example, the feature set of node i is [ki, xi, bi], where xi is the eigenvector centrality and bi is the betweenness centrality.
[0151] Next, clustering algorithms are used to calculate the clustering coefficients of the power supply topology graph data, thereby obtaining the global clustering characteristics of the power supply topology graph data. The clustering coefficients reflect the degree of clustering of nodes in the graph, that is, the degree of interconnection between the nodes' neighbors. For an undirected graph, the local clustering coefficient Ci of node i is defined as: , where ei is the number of actual edges between the neighbors of node i, and ki is the degree of node i. The global clustering coefficient C of the entire network can be obtained by averaging the local clustering coefficients of all nodes: Here, n is the total number of nodes. In practical calculations, efficient graph traversal algorithms (such as depth-first search) can be used to calculate the local clustering coefficient for each node. For large-scale networks, approximation algorithms or sampling methods can be used to improve computational efficiency. The global clustering coefficient has a range of [0,1], with larger values indicating stronger network clustering. By calculating and analyzing the clustering coefficient, a deeper understanding of the local connectivity characteristics of the power grid can be achieved.
[0152] Next, the autocorrelation index is used to evaluate the spatial distribution pattern of power grid characteristics in the power supply topology data, thus obtaining the spatial distribution characteristics of the power supply topology data. The autocorrelation index can reveal the spatial dependence of power grid characteristics. A commonly used index is the Moran's I statistic, whose calculation formula is as follows:
[0153]
[0154] Where N is the number of nodes, W is the sum of spatial weights, wij is the spatial weight between nodes i and j, xi is the attribute value of node i (such as voltage or load), and x is the attribute mean. The spatial weight wij can be defined based on the distance or topological relationship between nodes; for example, inverse distance weights or fixed distance thresholds can be used. Moran's I has a range of [-1, 1], where positive values indicate positive correlation (clustering of similar values), negative values indicate negative correlation (clustering of dissimilar values), and 0 indicates random distribution. In practical calculations, Monte Carlo simulation methods can be used to assess statistical significance. By calculating Moran's I for different grid characteristics (such as voltage levels and load rates), the spatial distribution patterns of these characteristics can be identified. For example, a highly positively correlated voltage distribution may indicate good system voltage control, while a negatively correlated load distribution may suggest that load balancing needs improvement.
[0155] Finally, the node feature set, global clustering features, and spatial distribution features are combined into a complete feature vector, which serves as the power grid topology spatial feature of the power supply topology. This process integrates the various features extracted in the previous steps to form a vector that comprehensively reflects the spatial characteristics of the power grid topology. Specifically, the feature vector can be represented as: F=[F_node,C,I], where F_node is the node feature set, C is the global clustering coefficient, and I is the spatial autocorrelation index. The node feature set F_node can be further subdivided into features for each node, for example, F_node=[k1,x1,k2,x2,...,kn,xn], where ki and xi are the degree and centrality of node i, respectively. To make features comparable at different scales, the features need to be standardized, for example, using Z-score standardization: z=(x-μ) / σ, where μ is the mean of the features and σ is the standard deviation. The final feature vector F provides a multi-dimensional description of the power grid topology, including local information at the node level, global clustering information at the network level, and spatial distribution information. This comprehensive feature representation provides rich input for subsequent power grid analysis tasks, capturing the complexity and diversity of the power grid, thereby supporting more accurate and comprehensive decision-making.
[0156] In one embodiment, extracting multi-cycle electricity consumption time-series features from preprocessed power grid operation data includes the following steps:
[0157] Multiple time decomposition scales of different sizes are determined based on the time span of power grid operation data;
[0158] The power grid operation data is decomposed into multiple power grid operation sequence data according to various time decomposition scales;
[0159] Based on the number of data points in the power grid operation sequence data, multiple power supply topology data sets of the same number are obtained, and these multiple power grid operation sequence data sets are randomly matched with the multiple power supply topology data sets.
[0160] For each set of power grid operation sequence data and power supply topology data, based on the relationship between sensors and various power supply equipment or power consumption equipment in the sensor network, a second graph node attribute is added to all graph nodes based on the power grid operation sequence data;
[0161] By extracting the power grid time-series dependency features from each power supply topology data using a pre-deployed long short-term memory network model, and fusing all the power grid time-series dependency features, the multi-cycle power consumption time-series features of the power grid operation data are obtained.
[0162] In this implementation, multiple time decomposition scales of varying sizes are determined based on the time span of the power grid operation data. This step aims to capture the changing characteristics of the power grid at different time scales. Specifically, the total time span of the power grid operation data is first determined, for example, it might be one year of data. Then, multiple time scales are set, taking into account the periodic characteristics of power grid operation, such as intraday load variations, differences between weekdays and weekends, and seasonal variations. For example, the following time scales can be set: 1 hour, 24 hours (1 day), 168 hours (1 week), and 720 hours (1 month). Next, the power grid operation data is decomposed into multiple power grid operation sequence data according to each time decomposition scale. This multi-scale decomposition allows for the simultaneous analysis of short-term fluctuations and long-term trends, providing a foundation for a comprehensive understanding of the power grid's dynamic behavior. Through this method, electricity consumption patterns, abnormal events, and periodic changes at different time scales can be identified, providing multi-dimensional time information for subsequent prediction and optimization.
[0163] The number of power grid runtime time series datasets obtained in the previous step is counted, let's say N. Then, the original power supply topology data is copied N times. The topology structure remains unchanged during copying, but each copy can be assigned a unique identifier. Next, a random sequence from 1 to N is generated using a random permutation algorithm (such as Fisher-Yates shuffle). Based on this random sequence, the N power grid runtime time series datasets are matched one-to-one with the N power supply topology data. In this way, each time series dataset is associated with a topology structure, providing rich input for subsequent spatiotemporal feature extraction. For each set of power grid runtime time series data and power supply topology data, adding a second graph node attribute to all graph nodes based on the association between sensors and various power supply or power consumption devices in the sensor network is a key step in combining time series information with the topology structure. This process aims to create a dynamic attribute graph that reflects the changes in power grid state over time. The specific implementation method is as follows: First, establish the mapping relationship between sensors and graph nodes, which can be stored using a hash table, with the sensor ID as the key and the corresponding graph node ID as the value. Then, for the power grid operation data at each time point, the measured values of all sensors are traversed, and these values are assigned to the corresponding graph nodes as attributes of the second graph nodes.
[0164] Finally, the pre-deployed Long Short-Term Memory (LSTM) network model is used to extract the power grid time-series dependency features from each power supply topology data, and all power grid time-series dependency features are fused to obtain the multi-cycle power consumption time-series features of the power grid operation data. The LSTM model is chosen because it can effectively handle long-term dependencies. The specific implementation method is as follows: First, for each power supply topology data, its node attribute sequence is used as the input of the LSTM. The LSTM model structure includes an input layer, one or more LSTM layers, and an output layer. For example, a two-layer LSTM can be used, with 128 hidden units per layer. The core formulas of the LSTM unit include: forget gate ft = σ(Wf·[ht-1,xt] + bf), input gate it = σ(Wi·[ht-1,xt] + bi), output gate ot = σ(Wo·[ht-1,xt] + bo), and unit state update Ct = ft. Ct-1+it tanh(Wc·[ht-1,xt]+bc), where σ is the sigmoid function. This represents element-wise multiplication. The output of the LSTM model can be viewed as the time-series dependency features of the power grid. This process is repeated for data at all time scales, resulting in multiple sets of time-series dependency features. Finally, these features are fused using an attention mechanism or a simple connection method to obtain the final multi-cycle electricity consumption time-series features. This method can capture the complex dependencies of power grid operation data at different time scales, providing rich time-series information for subsequent tasks such as anomaly detection and load forecasting.
[0165] In one implementation, the process of combining power grid topology spatial characteristics and multi-cycle electricity consumption time series characteristics with an electricity consumption anomaly detection algorithm based on ensemble learning to obtain electricity consumption anomaly detection results includes the following steps:
[0166] By fusing the topological spatial characteristics of the power grid and the time-series characteristics of electricity consumption over multiple periods, a comprehensive spatiotemporal characteristic of electricity consumption is obtained.
[0167] A power consumption anomaly detection model based on gradient boosting decision tree is deployed in an edge computing device, and a model loss function for the power consumption anomaly detection model is constructed. The power consumption anomaly detection model uses a symmetric binary tree as the base model.
[0168] With the goal of minimizing the model loss function, a power consumption anomaly detection model is trained using historical power grid operation data of power supply circuits collected by a sensor network, and gradient estimation error is reduced during the model training process by using a ranking boosting method.
[0169] The comprehensive spatiotemporal features of electricity consumption are input into the trained electricity anomaly detection model, and the electricity anomaly detection results are output through the electricity anomaly detection model.
[0170] In this embodiment, feature fusion is performed on the power grid topology spatial features and multi-cycle electricity consumption time-series features. This process aims to create a feature representation that comprehensively reflects the static structure and dynamic behavior of the power grid. The specific implementation method is as follows: First, the power grid topology spatial features are represented as a vector Fs=[s1,s2,...,sn], where si may include topological features such as node degree and centrality. The multi-cycle electricity consumption time-series features are represented as a vector Ft=[t1,t2,...,tm], containing time-series patterns at different time scales. Then, feature fusion techniques are used to combine these two sets of features. A simple method is direct concatenation: F=[Fs,Ft]. More complex methods include using autoencoders or attention mechanisms. For example, nonlinear feature fusion is performed using a multilayer perceptron (MLP): F=MLP([Fs,Ft]). The resulting comprehensive spatiotemporal feature F of electricity consumption contains information about the power grid's topology and time-series behavior patterns, providing rich input for subsequent anomaly detection. It can capture complex spatiotemporal correlations, improving the accuracy and interpretability of anomaly detection.
[0171] Next, a power consumption anomaly detection model based on Gradient Boosting Decision Tree (GBDT) is deployed in the edge computing device, and a model loss function is constructed based on the focus loss function. The GBDT model uses a symmetric binary tree as the base model, a structure that is beneficial for capturing complex nonlinear relationships between features. The basic idea of the model is to iteratively train multiple weak learners (decision trees), focusing on samples where the previous model predictions were poor each time. The focus loss function is introduced to address the class imbalance problem; this implementation uses an improved focus loss function, and the formula for the model loss function is as follows:
[0172]
[0173] In the formula: L represents the model loss function, This represents the probability that a sample is a positive sample. Indicates the positive adjustment parameter. This represents the function that maximizes the value, where m represents the adjustable hyperparameter. represents the negative adjustment parameter, and y represents the true label of the sample.
[0174] In the loss function of the above model, negative samples with high confidence are subject to hard thresholding. m is typically set to 0.2, representing the probability of predicting a positive sample. When the probability is less than the set hyperparameter m, it indicates that the probability of the current sample being a negative sample is extremely high. Therefore, the probability of predicting the sample as a positive sample can be directly set to 0. Model training is then performed based on the above model loss function. Since the predicted probability is a value between 0 and 1, the value after the cube is less than the value after the square, thus reducing the impact of negative samples on the loss function. Furthermore, for a negative sample, if the predicted result is 0.1, its confidence in being a negative sample is extremely high, and the loss function will determine it as a negative sample. Therefore, the sample's weight on the loss function has zero impact. Thus, the improved model loss function focuses on training hard-to-detect samples and positive samples, ultimately improving the model's accuracy in detecting abnormal data.
[0175] The training process of the GBDT model can be represented as follows: Where F_m is the model after the m-th iteration, h_m is the newly added decision tree, and η is the learning rate. Each decision tree minimizes the objective function. The model is constructed using the formula L, where L is the focus loss function and Ω is the regularization term. This design enables the model to effectively handle high-dimensional features and accurately detect anomalies even in cases of class imbalance, making it particularly suitable for scenarios like power grids where anomalies are relatively rare.
[0176] Next, with the goal of minimizing the model loss function, a power anomaly detection model is trained using historical power grid operation data of the power supply circuit collected by the sensor network. During model training, a ranking boosting method is used to reduce gradient estimation errors. The training process employs gradient descent, updating the model parameters in each iteration. Where α is the learning rate, This is the gradient of the loss function. To improve training efficiency, mini-batch gradient descent is used, calculating the gradient using a small batch of data each time. The core idea of the sorting boosting method is to reduce the variance of the gradient estimate by sorting the samples. The specific steps are as follows:
[0177] (1) For each feature, calculate its first derivative. and second derivative .
[0178] (2) According to Sort the samples.
[0179] (3) Select the optimal split point to maximize the gain after splitting. The gain calculation formula is:
[0180]
[0181] Where GL, GR, HL, and HR are the sums of the first and second derivatives of the left and right subtrees, respectively, and λ and γ are regularization parameters. This method can significantly improve the training speed and prediction accuracy of the model, and is particularly suitable for handling large-scale, high-dimensional data such as power grids. Through iterative training and fine-tuning, a powerful model capable of accurately identifying power consumption anomalies is finally obtained.
[0182] Finally, the comprehensive spatiotemporal features of electricity consumption are input into the trained electricity anomaly detection model, which then outputs the electricity anomaly detection results. This step transforms the results of all previous work into practically usable anomaly detection results. The specific implementation process is as follows: First, the comprehensive spatiotemporal features F obtained in the previous steps are passed as input to the trained GBDT model. Each decision tree in the model performs a series of binary decisions on the input features, eventually reaching a leaf node. Each tree in the GBDT model provides a predicted value, and the final prediction result is the weighted sum of the predictions from all trees: , where w_i is the weight of the i-th tree. The model outputs a score between 0 and 1, representing the probability that a sample is an anomaly. By setting an appropriate threshold (e.g., 0.5), continuous prediction scores can be transformed into binary anomaly / normal classification results. Furthermore, the model can also output feature importance scores to help explain the reasons for the anomalies.
[0183] In one implementation, with the goal of minimizing the model loss function, a power consumption anomaly detection model is trained using historical power grid operation data of the power supply circuit collected by a sensor network. The gradient estimation error is reduced during model training using a ranking boosting method, including the following steps:
[0184] Acquire and preprocess historical power grid operation data of the power supply circuits collected by the sensor network;
[0185] Historical power supply topology data is constructed by combining the power supply topology structure with preprocessed historical power grid operation data.
[0186] Historical spatiotemporal features of electricity consumption are extracted from historical power supply topology data using a pre-deployed GNN-LSTM model, and feature annotations are performed on the historical spatiotemporal features of electricity consumption.
[0187] Initialize the original model parameters in the power consumption anomaly detection model, and generate the initial population of the parameter optimization algorithm based on the model parameters and using the Tent chaotic mapping method. The model parameters include the maximum number of decision trees, learning rate, regularization sub-parameters, and decision tree depth.
[0188] Set the maximum number of iterations T for the parameter optimization algorithm;
[0189] Based on the maximum number of iterations T, the initial population is iteratively optimized using a parameter optimization algorithm until the current iteration number t of the parameter optimization algorithm reaches the maximum number of iterations T, thus obtaining the optimal model parameters;
[0190] Update the original model parameters in the power consumption anomaly detection model using the optimal model parameters;
[0191] The electricity anomaly detection model is trained using historical spatiotemporal features with labeled features. During the model training process, the gradient estimation error is reduced by ranking and boosting methods until the model loss function is trained to the minimum value, thus completing the training process of the electricity anomaly detection model.
[0192] In this embodiment, historical power grid operation data of the power supply circuit collected by the sensor network is acquired and preprocessed. Data preprocessing involves multiple steps such as data cleaning and data standardization. The power supply topology is represented as a graph G(V,E), where V is the set of nodes (representing equipment such as substations and distribution cabinets), and E is the set of edges (representing connections between devices). Then, the preprocessed historical power grid operation data is associated with the nodes in the graph. In this way, the historical power supply topology data is represented as a series of time series graphs. The historical spatiotemporal features of electricity consumption are extracted from the historical power supply topology data using a pre-deployed GNN-LSTM model. The GNN-LSTM model combines the ability of graph neural networks (GNN) to process spatial relationships with the advantage of long short-term memory networks (LSTM) to capture temporal dependencies. The specific implementation process is as follows: (1) For each time step t, the graph instance G_t is processed using the GNN layer. (2) The output sequence of the GNN is fed into the LSTM layer. (3) The output of the last LSTM unit is used as the feature representation of the entire spatiotemporal graph sequence. For feature annotation, labels can be assigned to extracted features based on domain knowledge or statistical methods, such as "normal," "slightly abnormal," and "severely abnormal." This can be achieved by setting thresholds or using clustering algorithms. For example, the K-means algorithm can be used to cluster features, and then annotations can be performed based on the clustering results and expert knowledge.
[0193] Next, the original model parameters in the power consumption anomaly detection model are initialized. Then, based on these parameters, an initial population for the parameter optimization algorithm is generated using the Tent chaotic mapping method. Specifically, the original model parameters include the maximum number of decision trees, the learning rate, the regularization parameter, and the decision tree depth. The Tent chaotic mapping is a nonlinear dynamical system, and its iterative formula is: , where μ is a control parameter, typically set to 2. The specific implementation method is as follows:
[0194] (1) Set a reasonable initial value and range for each parameter. For example, the maximum number of decision trees can be set to 100-500, and the learning rate can be set to 0.01-0.1.
[0195] (2) Use Tent mapping to generate the initial population: First, select a random x_0∈(0,1), and then iteratively generate the required number of random numbers.
[0196] (3) Map the generated random numbers to the value range of each parameter to form the initial population. For example, if the generated random number is 0.3 and the number of decision trees ranges from 100 to 500, then the corresponding parameter value is 100 + 0.3. (500-100)=220.
[0197] (4) Repeat this process until a sufficient number of initial solutions are generated. For example... Figure 2 As shown, Figure 2 Figure (a) in the figure is a schematic diagram of the results of random population initialization. Figure 2 Figure (b) in the diagram shows the results of population initialization based on the Tent chaotic mapping method. This method can generate a uniformly distributed initial population with good randomness, providing a diverse starting point for subsequent parameter optimization, helping to find the global optimum and avoid getting trapped in local optima.
[0198] Next, we set the maximum number of iterations T for the parameter optimization algorithm. The choice of the maximum number of iterations T needs to balance computational resources and optimization efficiency. Generally, the value of T should be large enough to ensure the algorithm has sufficient time to converge, but not so large as to waste computational resources. By setting T appropriately, we can ensure that the optimization algorithm has enough time to explore the parameter space while avoiding unnecessary computational overhead, thus efficiently finding near-optimal model parameters. Then, based on the maximum number of iterations T, we use the parameter optimization algorithm to iteratively optimize the initial population until the current iteration number t of the parameter optimization algorithm reaches the maximum number of iterations T, obtaining the optimal model parameters. Finally, we use the optimal model parameters to update the original model parameters in the power anomaly detection model.
[0199] Finally, the updated power consumption anomaly detection model is trained using the historical spatiotemporal features with labeled characteristics. During model training, the ranking boosting method is used to reduce gradient estimation errors until the model loss function is trained to its minimum, completing the training process of the power consumption anomaly detection model. The specific implementation method is as follows: The historical spatiotemporal features with labeled characteristics are divided into training and validation sets; the GBDT model is initialized using the updated parameters, and then iterative training begins. In each iteration, the negative gradient is calculated as the target of the current tree, and the ranking boosting method is used to select the optimal split point. The core of the ranking boosting method is to sort the feature values and then find the optimal split point on the ordered features, which can reduce gradient estimation errors; the loss function is minimized using gradient descent; the performance on the validation set is monitored, and if there is no improvement after several consecutive iterations, training is stopped to prevent overfitting; the model performance is evaluated using metrics such as confusion matrix and ROC curve. Through this training process, the model can learn the complex patterns of power grid anomalies, improving the accuracy and reliability of anomaly detection.
[0200] In one implementation, the initial population is iteratively optimized using a parameter optimization algorithm based on the maximum number of iterations T until the current iteration number t of the parameter optimization algorithm reaches the maximum number of iterations T, thereby obtaining the optimal model parameters. This includes the following steps:
[0201] Use the initial population as the current generation population when the current iteration number t=1;
[0202] For any round of iterative update process, calculate the individual fitness value of all individuals in the current generation population when the current iteration number t is reached;
[0203] If t < T, then based on the individual fitness value and by using an improved reptile search algorithm, update the individual position of the population in the current generation, and use the population with the updated individual position as the current generation population in the next iteration.
[0204] Increment the value of the current iteration number t by 1, and repeat the next iteration update process;
[0205] If t=T, then based on the individual fitness value and by improving the reptile search algorithm, update the individual position of the population in the current generation, recalculate the individual fitness value of the population in the current generation, and output the population individual with the best individual fitness as the optimal model parameter.
[0206] The process of updating the individual positions of individuals in the current generation population based on their fitness values and using an improved reptile search algorithm, and then using the updated population positions as the current generation population for the next iteration, specifically includes the following steps:
[0207] If the current iteration number t≤T / 4, then the high-stepping strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration.
[0208] If the current iteration number T / 4 < t ≤ T / 2, then the belly crawling strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration.
[0209] If the current iteration number T / 2 < t ≤ 3T / 4, then the hunting coordination strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration.
[0210] If the current iteration number 3T / 4 < t < T, then the hunting cooperation strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration.
[0211] For any current generation of the basic population, the individual positions of the population individuals in the current generation are adjusted using a t-distribution mutation perturbation strategy.
[0212] In this embodiment, refer to Figure 3 The initial population generated earlier using the Tent chaotic mapping is designated as the first-generation population. This initial population typically contains multiple individuals, each representing a possible set of model parameters. For the GBDT model, an individual is represented as [n_trees, learning_rate, reg_lambda, max_depth]. The diversity of the initial population is crucial for the algorithm's performance, as it affects the coverage of the search space. For any iteration, the fitness values of all individuals in the current generation population are calculated at the current iteration number t. Fitness values reflect the quality of each individual (i.e., parameter combination) in solving the problem. These fitness values guide subsequent search processes, helping the algorithm identify and retain high-quality solutions while eliminating poorly performing parameter combinations. In this way, the algorithm can gradually converge towards the optimal solution.
[0213] If \(t < T\), then based on the individual fitness values and by improving the reptile search algorithm, update the individual positions of the population individuals in the current generation population, and use the population after updating the individual positions as the current generation population for the next iteration. This step is the core of the optimization algorithm. The reptile search algorithm simulates the movement patterns of reptiles, including four strategies: high - altitude walking, belly crawling, hunting coordination, and hunting cooperation. Specifically, select an appropriate crawling strategy according to the current iteration number \(t\).
[0214] If \(t\leq T / 4\), use the high - altitude walking strategy:
[0215] 。
[0216] If \(T / 4 < t\leq T / 2\), use the belly crawling strategy:
[0217] 。
[0218] For \(T / 2 < t\leq 3T / 4\), adopt the hunting coordination strategy:
[0219] , where \(X_{mean}\) is the average position of the population.
[0220] Finally, when \(3T / 4 < t < T\), use the hunting cooperation strategy:
[0221] 。
[0222] In each strategy, \(\alpha\), \(\beta\), \(\gamma\), \(\delta\) and \(\varepsilon\) are control parameters that need to be adjusted according to the problem characteristics. After updating the position, use the t - distribution mutation perturbation strategy to further adjust the individual position: , where \(t(v)\) is a t - distribution random number with degrees of freedom \(v\), and \(\lambda\) is a scaling factor. Introducing Gaussian mutation and Cauchy mutation has been proven to effectively improve the population search speed of the algorithm and the ability to jump out of local optima. At the initial stage of algorithm iteration, the degrees of freedom parameter \(n\) is set to a small value. At this time, the t - distribution approaches the Gaussian distribution, and this distribution can effectively improve the diversity of the population and the global search ability of the algorithm. When the algorithm iterates to the later stage, the degrees of freedom parameter \(t\) continuously increases, and the t - distribution approaches the Cauchy distribution. At this time, the population search range is reduced, which can effectively improve the development ability of the algorithm in the local space. In this way, the algorithm can effectively explore in the parameter space, balance local search and global exploration, and gradually improve the quality of the solution. After each round of population update is completed, the iteration counter \(t\) is incremented by 1. This counting mechanism is not only used to control the termination of the algorithm but also to determine which crawling strategy to adopt. For example, when \(t\) increases to \(T / 4\), the algorithm will switch from the high - altitude walking strategy to the belly crawling strategy.
[0223] If t=T, then based on the individual fitness value, the individual positions of the population in the current generation are updated using the improved reptile search algorithm, and the individual fitness values of the population in the current generation are recalculated. The population individual with the best individual fitness is output as the optimal model parameter. This is the last step of the algorithm and the key step in outputting the final result. In the last iteration, the algorithm performs the following operations: (1) Update the positions of all individuals using the hunting cooperation strategy. (2) Recalculate the fitness values of the updated individuals. The calculation method is the same as before, but this time it is to determine the final optimal solution. (3) Select the individual with the highest fitness value from the updated population as the optimal solution. For example, if there are n individuals in the population with fitness values of [f1, f2, ..., fn], then the index of the optimal individual is i_best = argmax([f1,f2, ..., fn]). (4) Output Xi_best as the optimal model parameter. This optimal individual contains the best parameter combination of the GBDT model.
[0224] The present invention also discloses a digital twin-based integrated energy management platform, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the digital twin-based integrated energy management method as described in any of the above embodiments.
[0225] The processor can be a central processing unit (CPU). Of course, depending on the actual use, it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it.
[0226] The memory can be an internal storage unit of a computer device, such as a hard disk or RAM, or an external storage device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD), or flash memory card (FC) provided on the computer device. Furthermore, the memory can be a combination of internal storage units and external storage devices of a computer device. The memory is used to store computer programs and other programs and data required by the computer device. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.
[0227] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.
[0228] One or more embodiments in this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments in this application should be included within the protection scope of this application.
Claims
1. A comprehensive energy management method based on digital twins, characterized in that, An application is made to a smart energy management system configured in a target campus, the smart energy management system including a campus energy visualization platform, edge computing devices deployed in the target campus, and a sensor network deployed in the power supply circuit of the target campus, the method comprising the following steps: Obtain the power supply topology of the power supply circuit, and import the power supply topology into the edge computing device and the campus energy visualization platform respectively; The power grid operation data of the power supply circuit is collected through the sensor network, and the power grid operation data is transmitted to the edge computing device; The power grid operation data is preprocessed using the edge computing device. The preprocessed power grid operation data is fitted into a power grid state reference curve for the power supply circuit using the edge computing device and cubic spline interpolation. N sensors in the sensor network are randomly selected as mapping sensors. The target power grid operation data corresponding to the mapping sensors is the mapping object of the digital twin mapping. N is less than the total number of sensors in the sensor network. Based on all the target power grid operation data, predict the complete power grid operation data of the power supply circuit, and fit the power grid state prediction curve of the power supply circuit according to the complete power grid operation data and through a reconstruction algorithm; The power grid state prediction curve is used as the model state space of the Markov decision model, and the action of the i-th sensor in the sensor network selected by the edge computing device as the mapping sensor is used as the model action space of the Markov decision model. A digital twin mapping strategy is constructed in the edge computing device with the reward functions being minimizing the number of mapping sensors and minimizing the curve similarity difference. The curve similarity difference is the similarity difference value between the power grid state baseline curve and the power grid state prediction curve. The near-end policy optimization algorithm is used to optimize the digital twin mapping strategy to obtain the optimal mapping strategy; The optimal power grid operation data corresponding to the optimal mapping sensor selected in the optimal mapping strategy is mapped to the campus energy visualization platform for visualization display; The campus energy visualization platform is used to obtain abnormal electricity consumption detection commands from target users. In response to the power consumption anomaly detection command, the power consumption anomaly detection task is executed through the edge computing device to obtain the power consumption anomaly detection result, and the power consumption anomaly detection result is imported into the campus energy visualization platform for visualization display. The power consumption anomaly detection task includes the following steps: Based on the power grid operation data, the power grid topology spatial features are extracted from the power supply topology. Multi-cycle electricity consumption time-series features are extracted from the preprocessed power grid operation data; The power grid topology spatial characteristics and the multi-cycle electricity consumption time series characteristics are combined, and an electricity consumption anomaly detection algorithm based on ensemble learning algorithm is used to analyze and obtain the electricity consumption anomaly detection results.
2. The integrated energy management method based on digital twins according to claim 1, characterized in that, The step of mapping the optimal power grid operation data corresponding to the optimal mapping sensor selected in the optimal mapping strategy to the campus energy visualization platform for visualization includes the following steps: Principal component analysis is used to extract the features of the data to be mapped from the optimal power grid operation data corresponding to the optimal mapping sensor selected in the optimal mapping strategy. A fake data detection model based on a convolutional neural network is deployed in the edge computing device, and the fake data detection model is trained using historical power grid operation data of the power supply circuit collected by the sensor network. The trained fake data detection model identifies whether there are fake injected data features in the features of the data to be mapped. If it is found that the false injected data feature does not exist in the data features to be mapped, then all the optimal power grid operation data are mapped to the campus energy visualization platform, and all the optimal power grid operation data are associated and matched with the power supply topology for visualization display.
3. The integrated energy management method based on digital twins according to claim 1, characterized in that, The step of extracting power grid topology spatial features from the power supply topology based on the power grid operation data includes the following steps: The power supply topology is converted into power supply topology graph data. The graph nodes in the power supply topology graph data represent the power supply equipment and electrical equipment in the power supply circuit, and the graph node edges in the power supply topology graph data represent the electrical connection relationship between the power supply equipment and the electrical equipment. Based on the association between the sensors and each of the power supply devices or the power consumption devices in the sensor network, a first graph node attribute is added to all the graph nodes based on the power grid operation data; Based on the first graph node attributes, the key node features of each graph node in the power supply topology graph data are extracted and integrated into a node feature set. The key node features include the node degree and node centrality of the graph node. Clustering coefficients of the power supply topology data are calculated using a clustering algorithm to obtain the global clustering features of the power supply topology data; The spatial distribution pattern of the power supply topology data is evaluated using an autocorrelation index to obtain the spatial distribution characteristics of the power supply topology data. The node feature set, the global clustering feature, and the spatial distribution feature are combined into a complete feature vector as the power grid topology spatial feature of the power supply topology.
4. The integrated energy management method based on digital twins according to claim 3, characterized in that, The process of extracting multi-cycle electricity consumption time-series features from the preprocessed power grid operation data includes the following steps: Multiple time decomposition scales of different sizes are determined based on the time span of the power grid operation data; The power grid operation data is decomposed into multiple power grid operation sequence data according to each of the aforementioned time decomposition scales; Based on the number of data points in the power grid operation sequence data, multiple copies of the power supply topology data are obtained in the same quantity, and multiple copies of the power supply topology data are randomly matched with the multiple copies of the power grid operation sequence data. For each set of the power grid operation sequence data and the power supply topology data, based on the association between the sensors and each power supply device or the power consumption device in the sensor network, a second graph node attribute is added to all the graph nodes based on the power grid operation sequence data; By extracting the power grid time-series dependency features from each of the power supply topology data using a pre-deployed long short-term memory network model, and fusing all the power grid time-series dependency features, the multi-cycle power consumption time-series features of the power grid operation data are obtained.
5. The integrated energy management method based on digital twins according to claim 1, characterized in that, The process of combining the power grid topology spatial features and the multi-cycle electricity consumption time series features, and using an electricity consumption anomaly detection algorithm based on ensemble learning to analyze and obtain the electricity consumption anomaly detection results includes the following steps: The power grid topology spatial features and the multi-cycle electricity consumption time series features are fused to obtain the comprehensive spatiotemporal features of electricity consumption. A power consumption anomaly detection model based on gradient boosting decision tree is deployed in the edge computing device, and a model loss function for the power consumption anomaly detection model is constructed. The power consumption anomaly detection model uses a symmetric binary tree as the base model. With the goal of minimizing the model loss function, the power consumption anomaly detection model is trained using historical power grid operation data of the power supply circuit collected by the sensor network, and gradient estimation error is reduced during the model training process by using a ranking boosting method. The comprehensive spatiotemporal features of electricity consumption are input into the trained electricity consumption anomaly detection model, and the electricity consumption anomaly detection results are output through the electricity consumption anomaly detection model.
6. The integrated energy management method based on digital twins according to claim 5, characterized in that, The formula for the model loss function is as follows: , In the formula: L represents the model loss function, This represents the probability that a sample is a positive sample. Indicates the positive adjustment parameter. This represents the function that maximizes the value, where m represents the adjustable hyperparameter. represents the negative adjustment parameter, and y represents the true label of the sample.
7. The integrated energy management method based on digital twins according to claim 6, characterized in that, The step of training the power consumption anomaly detection model using historical power grid operation data of the power supply circuit collected by the sensor network with the objective of minimizing the model loss function, and reducing gradient estimation error through a ranking boosting method during model training, includes the following steps: Acquire and preprocess historical power grid operation data of the power supply circuit collected by the sensor network; Historical power supply topology data is constructed by combining the power supply topology and the preprocessed historical power grid operation data; Historical spatiotemporal features of electricity consumption are extracted from the historical power supply topology data using a pre-deployed GNN-LSTM model, and feature annotations are performed on the historical spatiotemporal features of electricity consumption. Initialize the original model parameters in the power consumption anomaly detection model, and generate an initial population for the parameter optimization algorithm based on the model parameters and using the Tent chaotic mapping method. The model parameters include the maximum number of decision trees, learning rate, regularization sub-parameters, and decision tree depth. Set the maximum number of iterations T for the parameter optimization algorithm; Based on the maximum number of iterations T, the initial population is iteratively optimized using the parameter optimization algorithm until the current number of iterations t of the parameter optimization algorithm reaches the maximum number of iterations T, thereby obtaining the optimal model parameters; The original model parameters in the power consumption anomaly detection model are updated using the optimal model parameters. The electricity anomaly detection model is trained using the historical spatiotemporal features of electricity consumption after feature annotation. During the model training process, the gradient estimation error is reduced by the ranking boosting method until the model loss function is trained to the minimum value, thus completing the training process of the electricity anomaly detection model.
8. The integrated energy management method based on digital twins according to claim 7, characterized in that, The step of iteratively optimizing the initial population based on the maximum number of iterations T and using the parameter optimization algorithm until the current iteration number t of the parameter optimization algorithm reaches the maximum number of iterations T, to obtain the optimal model parameters, includes the following steps: The initial population is used as the current generation population when the current iteration number t=1; For any round of iterative update process, calculate the individual fitness value of all individuals in the current generation population when the current iteration number t is reached; If t < T, then based on the individual fitness value and by using the improved reptile search algorithm, update the individual position of the population in the current generation, and use the population with the updated individual position as the current generation population in the next iteration. Increment the value of the current iteration number t by 1, and repeat the next iteration update process; If t=T, then based on the individual fitness value, the individual position of the population in the current generation is updated by the improved reptile search algorithm, and the individual fitness value of the population in the current generation is recalculated. The population individual with the best individual fitness is output as the optimal model parameter. The step of updating the individual positions of individuals in the current generation population based on the individual fitness value and using an improved reptile search algorithm, and then using the population with updated individual positions as the current generation population for the next iteration, specifically includes the following steps: If the current iteration number t≤T / 4, then the high-stepping strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration. If the current iteration number T / 4 < t ≤ T / 2, then based on the individual fitness value, the abdominal crawling strategy in the reptile search algorithm is executed to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration. If the current iteration number T / 2 < t ≤ 3T / 4, then the hunting coordination strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration. If the current iteration number 3T / 4 < t < T, then the hunting cooperation strategy in the reptile search algorithm is executed based on the individual fitness value to update the individual position of the population in the current generation, and the population with the updated individual position is used as the current generation base population in the next iteration. For any current generation of the basic population, the individual positions of the population individuals in the current generation are adjusted using a t-distribution mutation perturbation strategy.
9. A digital twin-based integrated energy management platform, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the integrated energy management method based on digital twins as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Intelligent elevator edge digital twinning construction method and system based on cloud edge collaboration
CN118255219A
Power grid digital twin modeling method and platform based on cloud edge collaboration
CN118797966A