Flexible resource aggregation method and device considering communication latency and data attack
By combining graph neural network models with physical rules for anomaly detection and data reconstruction, the problems of communication latency and data attacks in flexible resource aggregation are solved, achieving high-precision and secure aggregation in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI UNIV OF TECH
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies have failed to effectively address communication delays and data attacks during the aggregation of flexible resources, resulting in distorted aggregation results, increased scheduling risks, and a lack of proactive compensation for communication delays and reliable data measurement.
Anomaly detection is performed using a graph neural network model combined with physical rules to calculate data credibility. The data is then reconstructed and compensated using a time series prediction and weighted fusion strategy. Finally, a robust optimization model is used for aggregation to generate an aggregated result with credibility constraints.
It improves the accuracy of resource aggregation and system security, is suitable for smart grids and electricity markets, and effectively addresses data attacks and latency issues in complex communication environments.
Smart Images

Figure CN122174153A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system dispatching and control technology, specifically a robust aggregation method that ensures the security and accuracy of aggregation in scenarios with communication delays and potential data attacks, namely a flexible resource aggregation method that takes into account communication delays and data attacks. Background Technology
[0002] With the widespread integration of distributed energy resources, the aggregated management of flexible resources has become a key means to improve the grid's regulation capabilities. Through aggregation, multiple dispersed resources can be equivalent to a controllable unit, participating in the electricity market or providing ancillary services.
[0003] However, in actual operation, communication delays exist between flexible resources and the aggregation platform, leading to data lag and affecting the real-time nature of state estimation. More seriously, the communication link may be vulnerable to data attacks, with attackers tampering with reported data and misleading aggregation decisions, potentially causing equipment damage, market settlement errors, or grid security risks.
[0004] In existing technologies, most aggregation methods assume reliable communication and trustworthy data, without fully considering the impact of non-ideal communication environments. Some studies introduce anomaly detection mechanisms, but these often rely on statistical thresholds or simple rules, lacking proactive compensation for communication delays and failing to quantify data trustworthiness and integrate it into the aggregation optimization model, making it difficult to achieve truly robust aggregation.
[0005] Therefore, there is an urgent need for a flexible resource aggregation method that can simultaneously address communication latency and data attacks, thereby improving the security, real-time performance, and cost-effectiveness of the aggregation system. Summary of the Invention
[0006] The present invention proposes a flexible resource aggregation method that takes into account communication latency and data attacks, which can at least solve one of the technical problems in the background art.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: This invention provides a flexible resource aggregation method, comprising the following steps: S 1. Receive operational status data reported from multiple flexible resources. The data may experience communication delays during transmission and may be affected by data attacks. S2. Collect data from distribution network nodes and make preliminary anomaly judgments to eliminate obvious interference. Use historical data after removing obvious anomalies to train a graph neural network model that integrates physical mechanisms. Construct a total loss function that includes data-driven loss terms and physical mechanism loss terms to force the model to learn the physical laws of the power grid. Then, combine physical rule constraints and deep learning models to identify anomalies in the received operating status data and calculate the data credibility of each flexibility resource. S 3. Based on communication delay information and data reliability, the operational status data is reconstructed; for data that is judged to be abnormal, time series predicted values are used for replacement; for data that is not abnormal but has delay, a weighted fusion strategy of predicted values and delay measurement values is used for correction. S 4. Based on the corrected operating status data, calculate the aggregation capability of flexibility resources and generate aggregation results.
[0008] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0009] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0010] This invention discloses a flexible resource aggregation method considering communication latency and data attacks, belonging to the field of distributed energy management technology in power systems. Addressing the problem that existing flexible resources (such as distributed photovoltaics, energy storage, and controllable loads) suffer from distorted aggregation results and increased scheduling risks due to communication link delays and susceptibility to network attacks such as spoofed data injection during aggregation, this invention proposes a collaborative aggregation method integrating anomaly detection, data reconstruction, and robust optimization. This method first receives operational status data reported by each resource, performs anomaly detection using a combination of physical rules and other methods, and generates a credibility score. Then, based on communication latency length and credibility information, it uses time series prediction and a weighted fusion strategy to reconstruct and compensate the data. Finally, the corrected data is input into a robust optimization model based on a safety margin constraint of data credibility to calculate the aggregation up / down capability. This invention effectively improves the accuracy of resource aggregation and system security in complex communication environments, and is applicable to smart grid, virtual power plant, and power market operation scenarios. Attached Figure Description
[0011] Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 This is the anomaly detection module of the present invention; Figure 3 This is the data reconstruction module of the present invention; Figure 4 This is a diagram of the IEEE 33-node system. Figure 5 This is a bar chart comparing the performance indicators of the three detection methods in the composite scenario of this invention. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0014] like Figure 1 As shown in this embodiment, a flexible resource aggregation method that considers communication latency and data attacks includes the following steps: S 1. Receive operational status data reported from multiple flexible resources. The data is subject to communication delays during transmission and may be affected by data attacks. S 2. Collect data from distribution network nodes and make preliminary anomaly judgments to eliminate obvious interference. Use historical data after removing obvious anomalies to train a graph neural network model that integrates physical mechanisms. Construct a total loss function that includes data-driven loss terms and physical mechanism loss terms to force the model to learn the physical laws of the power grid. Then, combine physical rule constraints and deep learning models to identify anomalies in the received operating status data and calculate the data credibility of each flexibility resource. S 3. Based on communication delay information and data reliability, the operational status data is reconstructed; for data that is judged to be abnormal, time series predicted values are used for replacement; for data that is not abnormal but has delay, a weighted fusion strategy of predicted values and delay measurement values is used for correction. S 4. Based on the corrected operating status data, calculate the aggregation capability of flexibility resources and generate aggregation results.
[0015] The following provides a detailed explanation of each step: S1. Receive operational status data reported from multiple flexible resources. The data is subject to communication delays during transmission and may be affected by data attacks. Every second, the aggregation platform receives operational status data on flexibility resources from various nodes in the distribution network, including active power. P i ( t reactive power Q i ( t Terminal voltage V i ( t (per unit value, p . u ), state of charge SOC i ( t ),frequency f i ( t ).
[0016] S 2. Perform multi-dimensional anomaly detection on the received operational status data. Use a deep learning model that combines physical rule constraints with fusion physical mechanisms to identify anomalous data and calculate the comprehensive data credibility score for each resource. Specific steps are as follows: Figure 2 As shown; The distribution network collects data on the flexibility resources of each node every second, thereby constructing a data structure for each node. i The feature vector of the flexible resources is used; and a buffer with a time length of 10 is maintained on the aggregation platform to store the full-dimensional state of the distribution network system over the past 10 time steps.
[0017] (1) In the formula, P i ( t )and Q i ( t ) are nodes i flexibility resources in t Active power and reactive power at any given time; V i ( t ) is a node i flexibility resources in t The per-unit value of the terminal voltage at any given time; f i ( t ) is a node i flexibility resources in t Frequency of time.
[0018] For each node in the distribution network i If this node is connected to a flexible resource, the feature vector is taken from the actual reported data of that resource; if this node is not connected to a flexible resource, its flexible resource output feature is forcibly set to 0.
[0019] The collected data undergoes preliminary anomaly detection, and logical consistency verification is performed as follows: like (Discharge), then ; like (Charging), then ; SOC i ( t ) represents a node i flexibility resources in t The state of charge at time t.
[0020] If the direction is reversed, the data is determined to have been attacked and tampered with.
[0021] Establish power constraints that follow the physical rules of distribution network operation, as follows: (2) (3) in, Pmin i , Pmax i For nodes i The flexibility of resources allows for minimum / maximum adjustable active power output; Qmin i and Qmax i For nodes i The flexibility of resources allows for minimum / maximum adjustable reactive power output.
[0022] Establish SOC Operational constraints, due to SOC It is difficult to measure directly and requires simple estimation through other observable measurements, so the terminal voltage is used. V and SOC Establish nonlinear mapping relationships VB Model.
[0023] The open-circuit voltage-state-of-charge mapping relationship is as follows: (4) According to the node i The flexibility of resources at the present moment t terminal voltage value V i ( t The state of charge of this flexibility resource is obtained through the above mapping relationship.
[0024] State of charge ( SOC The constraints are as follows: (5) A safe operating range is typically set, and can be configured as follows: SOCmin i =10%, SOCmax i =90%.
[0025] The voltage amplitude constraint is as follows: (6) According to the power distribution network operation standards, it is usually set Vmin i =0.95, Vmin i =1.05.
[0026] The power change rate (grade rate) constraint is as follows: (7) in, Rmax i For the maximum gradeability, kW / min ; t The sampling time interval, min .
[0027] Initial anomaly detection and credibility output are performed on the operational status data of flexibility resources, and the anomaly flag vector is defined as follows: (8) Anomaly flag vector at i A value of 1 indicates that the data exceeds the limit, while a value of 0 indicates that the data does not exceed the limit; if at i If any value in the array is 1, then it represents a node. i flexibility resources in t The data at that moment is abnormal. Furthermore, the initial flexibility resources of node i are generated. t Data reliability at any given time c(rule) i,t ∈[0,1]; (9) Training a graph neural network that incorporates physical mechanisms using historical data ( Physics-InformedGNN The model is used to capture the spatiotemporal correlation characteristics of resources and reconstruct their operational state; First, a graph structure is constructed, mapping the flexibility resources on each node to graph nodes, and the electrical connections between resources to edges, thus building an adjacency matrix. A Then, spatiotemporal feature extraction is performed using graph convolutional layers (…). GCN Extract spatial topological features, and combine them with Long Short-Term Memory (LSTM) networks. LSTM Extract time series features and output the current time. t State prediction reconstruction value Then, physical mechanism constraint training is performed. During the model training phase, a total loss function that includes data error and physical mechanism constraints is constructed. L total This forces the model to learn the physical laws of the power grid. (10) in, L total For the data-driven loss term, calculate the predicted value. Compared with actual measured value The mean square error (MSE) between them; λ This is the physical penalty weight coefficient, used to adjust the strength of physical constraints; L phy The physical mechanism loss term is constructed based on the node power imbalance residuals defined by Kirchhoff's laws: (11) in, Ω Represents the set of all nodes; N i Represents a node i The set of neighboring nodes; and These are the nodes predicted by the model. i At any moment t Active power and voltage amplitude; Neighbor nodes predicted by the model j At any moment t The voltage amplitude; and They are nodes i With nodes j The real and imaginary parts of the line admittance matrix; θ ij,t For the nodes predicted by the model i With nodes j At any moment t The voltage phase angle difference; ||·|| 2 This represents taking the square of the Euclidean norm.
[0028] To counter covert attacks where the value does not exceed the limit at a single moment but exhibits continuous small deviations, a sliding window-based approach is employed. KL divergence ( Kullback-LeiblerDivergence Analysis and cumulative sum ( CUSUM The detection algorithm is used for identification.
[0029] Conduct based on KL The consistency detection of divergence distribution uses a sliding window to extract the predicted residual sequence at the current moment and over a past period, calculates the difference between its probability distribution and the historical normal baseline distribution, and identifies small perturbation attacks that cause data distribution drift.
[0030] (12) in, DKL ( P || Q ) represents the current data distribution P Normal distribution relative to the baseline Q of KL The divergence value indicates that the larger the value, the more severely the current data distribution deviates from the normal pattern. K This represents the total number of intervals into which the residual value range is divided; z k Indicates the first k A range of values; P ( z k This indicates that within the current sliding window, the model prediction residual falls on the [number]th [number]. k The probability of each interval; Q ( z k ) indicates that the residual obtained statistically from the historical normal operation dataset falls on the th . k The baseline probability for each interval.
[0031] like D KL Exceeding the preset distribution drift threshold τ KL If so, it is determined that there is a covert attack targeting statistical characteristics.
[0032] To counter attacks that cause slight shifts in the mean, a cumulative sum control graph is used. CUSUM The algorithm monitors the cumulative effect of predicted residuals. The forward cumulative sum is defined. S+ t and negative cumulative sum S-t .
[0033] (13) in, S+ t Indicates time t The positive cumulative deviation value is used to detect whether there is a small positive drift in the data; S-t Indicates time t The negative cumulative deviation value is used to detect whether there is a small negative drift in the data; S+ t 1 , S t 1 They represent the previous time step, respectively. t The positive and negative cumulative deviation values of 1, initial value S 0 is usually set to 0;e t Indicates time t The standardized prediction residuals, i.e. ,in σ The historical noise standard deviation; δ This represents the drift tolerance parameter, which is typically set to half of the minimum allowable offset to ignore normal background noise fluctuations. max (0, The expression indicates taking the larger of 0 and the value within the parentheses, ensuring cumulative and non-negative values.
[0034] like S+ t or S-t Exceeding the preset cumulative alarm threshold τ sum If this is detected, a small-scale perturbation attack is determined, and the "data-driven trustworthiness" of the resource is adjusted accordingly. c(data) i Forced to a low value.
[0035] The platform calculates communication latency and parses the data received from each node. i The data packets reported by the resource terminal demonstrate the flexibility of resource reporting. The sending timestamps appended by the resource terminal to the data packets are extracted. t send,i And record the timestamp of the data packet received by the aggregation platform. t recv,i Calculate the communication delay time of the current data packet. d i .
[0036] (14) For cases with communication delays d i When performing data analysis, data is extracted from the aggregation platform's buffer. d i The data of each node before the specified time is used to perform anomaly detection on this data according to the method described above.
[0037] Based on the results of the above model, the overall data credibility of each resource is calculated. c i First, calculate the data-driven reconstruction error. e i ( t ): (15) Then, the reconstruction error is mapped to data-driven credibility. c(data) i ,use Sigmoid Variant forms of functions (16) in, ei ( t The value represents the reconstruction error between the measured value and the model prediction at the current moment. μ This is the error tolerance threshold, representing the acceptable normal noise level; β The sensitivity coefficient controls the rate at which confidence decreases as error increases.
[0038] Finally, by combining the credibility of physical rules and the credibility of data-driven approaches, the final comprehensive credibility is obtained. c i : (17) S 3. Based on communication delay information and anomaly detection results, the operational status data is reconstructed to obtain corrected operational status data, such as... Figure 3 As shown, it specifically includes: Weighted fusion correction of delayed data during the step S 2. The data was determined to be normal (i.e., highly reliable), but the calculated communication delay... d i A value greater than zero indicates that the currently received data x i ( t d i The data is lagging. Therefore, a weighted fusion strategy is used to combine the delayed observations with the current forecasts to obtain the corrected operational status data. xcorr i ( t The weighted fusion calculation formula is as follows: (18) xcorr i ( t (This is the corrected version) t Real-time running status data; x i ( t d i ) is the received data with a delay d i Actual observation data (i.e.) t d i (the true value of a moment); The current result obtained through the prediction model t The predicted state value at time; w ( d i ) is the confidence weight (or attenuation coefficient) calculated based on communication delay, with a value range of (0,1).
[0039] The weight w ( d i ) adopts a logic stori function-based approach ( LogisticFunction The adaptive delay decay model is calculated as follows: (19) in, w ( d i This represents the trust weight for delayed data; d i This represents the actual calculated communication delay time; d th This indicates the system's preset maximum allowable latency threshold; k Indicates the attenuation slope coefficient ( k >0), used to control the rate at which the weight decreases as the delay increases; exp Represented by natural constant e An exponential function with base 0.5. When delayed... d i Much smaller than the threshold d th When the exponent term approaches 0, the weight... w ( d i When the delay approaches 1, the system primarily relies on observational data; when the delay... d i When the threshold is exceeded, the weights drop rapidly, and the system smoothly transitions to the main accepted prediction data, thereby eliminating the state estimation bias caused by time delay.
[0040] When steps S 2. Determine if the received data is abnormal (i.e., overall credibility). c i When the data falls below a preset threshold, the abnormal data is reconstructed using normal historical data fragments and synchronous data from spatially adjacent nodes as contextual information. This is achieved through a graph neural network model that integrates physical mechanisms, and the reconstructed value is output. Finally, the reconstructed value is used as the corrected data at that moment: (20) S 4. According to S 1~ S The results of step 3 are used to aggregate flexibility resources and input the corrected operational status data into the robust optimization model. (twenty one) in, N Indicates the total number of flexibility resources; T Indicates the number of scheduling periods; Pagg i ( t ) represents resources i During the period t Aggregated scheduling power; Indicates time period t The market clearing price.
[0041] The objective function of the robust optimization model includes maximizing aggregation benefits, and the constraints include physical constraints on each flexibility resource and security margin constraints based on data credibility.
[0042] Let the overall data reliability of the resources be... c i This is output by the preceding reliability assessment module. To prevent equipment overload caused by inflated power reports, a reliability reduction is applied to the original physical power boundary: (twenty two) Limit the rate of power change for low-reliability resources to mitigate the risk of power abrupt changes: (twenty three) When the credibility is low, a smoother adjustment should be adopted.
[0043] If there is a risk of communication delays in resources, reserve unschedulable capacity to ensure that a portion of capacity is always unscheduled, in order to cope with lost instructions or delayed responses. (twenty four) in This is the delay compensation coefficient.
[0044] The following are examples: Figure 4 This demonstrates the test cases and network topology of this study. The reference voltage is 12.66kV, the reference power is 10MVA, there are 7 flexible resource connections, and the operating cycle is 1. h Assume that during operation, flexible resource data is attacked, and there is communication latency, with a mean of 200. ms The variance is 50. ms The dynamic distribution. Employing the "multi-timescale" strategy described in this invention, the sampling interval is 1. s And take 10 for each node s The full-dimensional state within is used as a buffer for real-time anomaly detection and delay calculation, with a scheduling cycle of 5. min Used for aggregation operations.
[0045] To verify the flexible resource aggregation method for communication latency and data attacks proposed in this study, the following three scenarios are set up for comparative analysis: (1) Scenario 1: Distribution network data is subjected to a strong attack; (2) Scenario 2: Distribution network data is subjected to covert small disturbance attacks; (3) Scenario 3: Distribution network data is subjected to covert small disturbance attacks and there is communication delay.
[0046] For the steps S 2. Abnormal data removal: This invention employs... LSTM The prediction method performs high-precision real-time reconstruction, training a method for each node. LSTM Sequence prediction model, input is past M Historical normal data at each time step { x t M,. .., x t 1}, the output is the estimated value at the current moment. In addition to its own historical data, it also incorporates the voltage / power data of neighboring nodes as auxiliary features to enhance the output. LSTM Perception of topological dependence. This invention... LSTM The reconstruction method is compared with the traditional linear interpolation method and the previous time-hold method, as shown in the table below.
[0047]
[0048] The proposed method of "integrating physical mechanism and micro-perturbation detection" is compared with the traditional "residual threshold-based detection method" and "ordinary LSTM detection method".
[0049]
[0050] The bar chart comparing the performance indicators of the three detection methods in composite scenarios is shown below. Figure 5 As shown in the figure. Comparing different detection methods in the same scenario, the "method integrating physical mechanisms and micro-disturbance detection" proposed in this invention improves the detection accuracy of abnormal data compared to other traditional methods, especially for attacks involving concealed micro-disturbances. For "composite attack scenarios," this invention uses a "timestamp backtracking verification" mechanism to first align delayed data to historical moments to eliminate time errors, and then performs physical verification, thereby accurately pinpointing the attack behavior and reducing the false positive rate to 1.2%. The performance metrics comparison of the three detection methods in composite scenarios is shown in the bar chart below. Figure 5 As shown.
[0051] For data that is judged to be abnormal or severely delayed, use LSTMThe time-series forecasting method reconstructs the data at the time of demand by collecting historical data from nodes. Finally, the corrected data is input into a robust optimization model to calculate the aggregated adjustable power range of the entire grid's photovoltaic and energy storage systems. Considering communication delays and data attacks, the aggregation uses credibility constraints on the boundaries to ensure the safe operation of the system.
[0052] The anomaly detection method proposed in this invention, which integrates physical mechanisms, improves the detection rate by more than 60% compared with traditional methods under covert small-disturbance attacks. Furthermore, the robust aggregation model based on data credibility can automatically shrink the security boundary when facing network attack threats, thus avoiding voltage over-limit accidents caused by data distortion.
[0053] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0054] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0055] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the mobile source emission prediction methods based on time-series feature migration described in the above embodiments.
[0056] It is understood that the systems, devices, and storage media provided in the embodiments of the present invention correspond to the methods provided in the embodiments of the present invention, and the explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.
[0057] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0058] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0059] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0060] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A flexible resource aggregation method considering communication latency and data attacks, characterized in that, Includes the following steps: S 1. Receive operational status data reported from multiple flexible resources. The data may experience communication delays during transmission and may be affected by data attacks. S 2. Collect data from distribution network nodes and make preliminary anomaly judgments to eliminate obvious interference. Use historical data after removing obvious anomalies to train a graph neural network model that integrates physical mechanisms. Construct a total loss function that includes data-driven loss terms and physical mechanism loss terms to force the model to learn the physical laws of the power grid. Then, combine physical rule constraints and deep learning models to identify anomalies in the received operating status data and calculate the data credibility of each flexibility resource. S 3. Based on communication delay information and data reliability, reconstruct the operational status data; for data identified as abnormal, use time series forecast values as replacements; For data without anomalies but with delays, a weighted fusion strategy of predicted values and delay measurements is used for correction. S 4. Based on the corrected operating status data, calculate the aggregation capability of flexibility resources and generate aggregation results.
2. The flexible resource aggregation method considering communication latency and data attacks according to claim 1, characterized in that, S 1 includes, Every second, the aggregation platform receives operational status data on flexibility resources from various nodes in the distribution network, including active power. P i ( t reactive power Q i ( t Terminal voltage V i ( t ), per unit value, p . u State of charge SOC i ( t ),frequency f i ( t ).
3. The flexible resource aggregation method considering communication latency and data attacks according to claim 2, characterized in that, S 2. Collect data from distribution network nodes and perform preliminary anomaly assessment to eliminate obvious interference. include, The distribution network collects data on the flexibility resources of each node every second, thereby constructing a data structure for each node. i The feature vectors of the flexible resources are used; and a buffer with a time length of 10 is maintained on the aggregation platform to store the full-dimensional state of the distribution network system over the past 10 time steps. (1) In the formula, P i ( t )and Q i ( t ) are nodes i flexibility resources in t Active power and reactive power at any given time; V i ( t ) is a node i flexibility resources in t The per-unit value of the terminal voltage at any given time; f i ( t ) is a node i flexibility resources in t Frequency of time; For each node in the distribution network i If this node is connected to a flexible resource, the feature vector is taken from the actual reported data of that resource; if this node is not connected to a flexible resource, its flexible resource output feature is forcibly set to 0. The collected data undergoes preliminary anomaly detection, and logical consistency verification is performed as follows: like That is, discharge, then ; like That is, charging, ; If the direction is reversed, the data is determined to have been attacked and tampered with; Establish power constraints that follow the physical rules of distribution network operation, as follows: (2) (3) in, Pmin i , Pmax i For nodes i The flexibility of resources allows for minimum / maximum adjustable active power output; Qmin i and Qmax i For nodes i The flexibility of resources allows for minimum / maximum adjustable reactive power output; Establish SOC Operating constraints, utilizing terminal voltage V and SOC Establish nonlinear mapping relationships VB Model; The open-circuit voltage-state-of-charge mapping relationship is as follows: (4) According to the node i The flexibility of resources at the present moment t terminal voltage value V i ( t The state of charge of this flexibility resource is obtained through the above mapping relationship; State of charge SOC The constraints are as follows: (5) SOC i ( t ) represents a node i flexibility resources in t The state of charge at time t; The voltage amplitude constraint is as follows: (6) The power change rate constraint is as follows: (7) in, Rmax i For the maximum gradeability, kW / min ; t The sampling time interval, min ; Initial anomaly detection and credibility output are performed on the operational status data of flexibility resources, and the anomaly flag vector is defined as follows: (8) Anomaly flag vector at i A value of 1 indicates that the data exceeds the limit, while a value of 0 indicates that the data does not exceed the limit; if at i If any value in the array is 1, then it represents a node. i flexibility resources in t Data anomalies at any given time; Generate the initial flexibility resources of node i in t Data reliability at any given time c(rule) i,t ∈[0,1]; (9)。 4. The flexible resource aggregation method considering communication latency and data attacks according to claim 3, characterized in that, S 2. Training a graph neural network model that integrates physical mechanisms using historical data after removing obvious anomalies, including: A graph neural network model incorporating physical mechanisms is trained using historical data to capture the spatiotemporal correlation characteristics of resources and reconstruct their operational status. First, a graph structure is constructed, mapping the flexibility resources on each node to graph nodes, and the electrical connections between resources to edges, thus building an adjacency matrix. A Then, spatiotemporal feature extraction is performed. Graph convolutional layers are used to extract spatial topological features, and a long short-term memory network is combined to extract time series features, outputting the current time step. t State prediction reconstruction value ; Then, physical mechanism constraint training is performed. During the model training phase, a total loss function that includes data error and physical mechanism constraints is constructed. L total This forces the model to learn the physical laws of the power grid. (10) in, L total For the data-driven loss term, calculate the predicted value. Compared with actual measured value The mean square error (MSE) between them; λ This is the physical penalty weight coefficient, used to adjust the strength of physical constraints; L phy The physical mechanism loss term is constructed based on the node power imbalance residuals defined by Kirchhoff's laws: (11) in, Ω Represents the set of all nodes; N i Represents a node i The set of neighboring nodes; and These are the nodes predicted by the model. i At any moment t Active power and voltage amplitude; Neighbor nodes predicted by the model j At any moment t The voltage amplitude; and They are nodes i With nodes j The real and imaginary parts of the line admittance matrix; θ ij,t For the nodes predicted by the model i With nodes j At any moment t The voltage phase angle difference; ||·|| 2 This represents taking the square of the Euclidean norm.
5. The flexible resource aggregation method considering communication latency and data attacks according to claim 4, characterized in that, S 2. Construct a total loss function that includes data-driven loss terms and physical mechanism loss terms, forcing the model to learn the physical laws of the power grid. Then, combine physical rule constraints and a deep learning model to identify anomalies in the received operating status data, including... To counter covert attacks where the value does not exceed the limit at a single moment but exhibits continuous small deviations, a sliding window-based approach is employed. KL Identification is performed using divergence analysis and cumulative sum detection algorithms; Conduct based on KL The consistency detection of divergence distribution uses a sliding window to extract the predicted residual sequence at the current time and over a past period, calculates the difference between its probability distribution and the historical normal baseline distribution, and identifies small perturbation attacks that cause data distribution drift. (12) in, DKL ( P || Q ) represents the current data distribution P Normal distribution relative to the baseline Q of KL The divergence value indicates that the larger the value, the more severely the current data distribution deviates from the normal pattern. K This represents the total number of intervals into which the residual value range is divided; z k Indicates the first k A range of values; P ( z k This indicates that within the current sliding window, the model prediction residual falls on the [number]th [number]. k The probability of each interval; Q ( z k ) indicates that the residual obtained statistically from the historical normal operation dataset falls on the th . k The baseline probability for each interval; like D KL Exceeding the preset distribution drift threshold τ KL If so, it is determined that there is a covert attack targeting statistical characteristics; To counter attacks that cause small shifts in the mean, a cumulative sum control chart algorithm is employed to monitor the cumulative effect of the predicted residuals; a positive cumulative sum is defined. S+ t and negative cumulative sum S-t ; (13) in, S+ t Indicates time t The positive cumulative deviation value is used to detect whether there is a small positive drift in the data; S- t Indicates time t The negative cumulative deviation value is used to detect whether there is a small negative drift in the data; S+ t 1 , S t 1 They represent the previous time step, respectively. t The positive and negative cumulative deviation values of 1, initial value S 0 is usually set to 0; e t Indicates time t The standardized prediction residuals, i.e. ,in σ The historical noise standard deviation; δ This represents the drift tolerance parameter, used to ignore normal background noise fluctuations; max (0, The parentheses indicate that the larger value between 0 and the value within the parentheses is selected, ensuring cumulative and non-negative results. like S+ t or S-t Exceeding the preset cumulative alarm threshold τ sum If this is detected, a small-scale perturbation attack is deemed to exist, and the "data-driven trustworthiness" of the resource is adjusted accordingly. c(data) i Forced to a low value; The platform calculates communication latency and parses the data received from each node. i The data packets reported by the resource terminal are used to improve the flexibility of resource reporting; the sending timestamps marked by the resource terminal in the data packets are extracted. t send,i And record the timestamp of the data packet received by the aggregation platform. t recv,i ; Calculate the communication delay time of the current data packet d i ; (14) For cases with communication delays d i When performing data analysis, data is extracted from the aggregation platform's buffer. d i The data of each node before the specified time is used to perform anomaly detection on this data according to the method described above.
6. The flexible resource aggregation method considering communication latency and data attacks according to claim 5, characterized in that, S 2. The data reliability of each flexibility resource is calculated. include, Calculate the overall data credibility of each resource. c i First, calculate the data-driven reconstruction error. e i ( t ): (15) Then, the reconstruction error is mapped to data-driven credibility. c(data) i ,use Sigmoid Variant forms of functions (16) in, e i ( t The value represents the reconstruction error between the measured value and the model prediction at the current moment. μ This is the error tolerance threshold, representing the acceptable normal noise level; β The sensitivity coefficient controls the rate at which confidence decreases as error increases; Finally, by combining the credibility of physical rules and the credibility of data-driven approaches, the final comprehensive credibility is obtained. c i : (17)。 7. The flexible resource aggregation method considering communication latency and data attacks according to claim 6, characterized in that, S 3 includes, Weighted fusion correction of delayed data during the step S 2. If the data shows no abnormalities, the reliability is relatively high, but the calculated communication delay... d i A value greater than zero indicates that the currently received data x i ( t d i The data is lagging; therefore, a weighted fusion strategy is used to combine the delayed observations with the current forecasts to obtain the corrected operational status data. xcorr i ( t The weighted fusion calculation formula is as follows: (18) xcorr i ( t (This is the corrected version) t Real-time running status data; x i ( t d i ) is the received data with a delay d i The actual observation data t d i The true value of a moment; The current result obtained through the prediction model t The predicted state value at time; w ( d i ) is the confidence weight or attenuation coefficient calculated based on communication delay, with a value range of (0,1); The weight w ( d i The adaptive delay decay model based on the logistic function is used for calculation: (19) in, w ( d i This represents the trust weight for delayed data; d i This represents the actual calculated communication delay time; d th This indicates the system's preset maximum allowable latency threshold; k This represents the attenuation slope coefficient. k >0 is used to control the rate at which the weight decreases as the delay increases; exp Represented by natural constant e An exponential function with base 0; when delayed d i Much smaller than the threshold d th When the exponent term approaches 0, the weight... w ( d i When the value approaches 1, the system accepts the observation data; when the delay... d i When the threshold is exceeded, the weight drops rapidly, and the system smoothly transitions to accepting the predicted data, thereby eliminating the state estimation bias caused by time delay. When steps S 2. Determine if the received data is abnormal, i.e., overall credibility. c i When the data falls below a preset threshold, normal historical data fragments and synchronous data from spatially adjacent nodes are used as contextual information. A graph neural network model that integrates physical mechanisms is used to reconstruct the abnormal data, and the reconstructed value is output. Finally, the reconstructed value is used as the corrected data at that moment: (20)。 8. The flexible resource aggregation method considering communication latency and data attacks according to claim 7, characterized in that, S 4 includes, according to S 1~ S The results of step 3 are used to aggregate flexibility resources and input the corrected operational status data into the robust optimization model. (21) in, N Indicates the total number of flexibility resources; T Indicates the number of scheduling periods; Pagg i ( t ) represents resources i During the period t Aggregated scheduling power; Indicates time period t Market clearing price; The objective function of the robust optimization model includes maximizing the aggregation benefit, and the constraints include physical constraints on each flexibility resource and security margin constraints based on data credibility. Let the overall data reliability of the resources be... c i Outputted by the preceding reliability assessment module; to prevent equipment overload due to inflated power reports, a reliability reduction is applied to the original physical power boundary: (22) Limit the rate of power change for low-reliability resources to mitigate the risk of power abrupt changes: (23) When the credibility is low, a smoother adjustment is used; If there is a risk of communication delays in resources, reserve unschedulable capacity to ensure that a portion of capacity is always unscheduled, in order to cope with lost instructions or delayed responses. (24) in This is the delay compensation coefficient.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 8.