A power grid monitoring and risk early warning method and system based on digital twinning and AI

By combining digital twin and AI technologies in the power grid monitoring system, comparing data node by node and branch by branch and constructing an impact relationship matrix, the problems of misjudgment of power grid anomalies and inaccurate load forecasting are solved, and accurate attribution of power grid operation deviations and reliable identification of risks are achieved.

CN122155440AInactive Publication Date: 2026-06-05ZHUHAI HUACHENG ELECTRIC POWER DESIGN INST CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUHAI HUACHENG ELECTRIC POWER DESIGN INST CO LTD
Filing Date
2026-05-08
Publication Date
2026-06-05
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing power grid monitoring systems are prone to repeated alarms and misjudgments when dealing with power grid anomalies. They have difficulty accurately distinguishing between different causes such as abnormal measuring devices, topology errors, equipment parameter deviations, abnormal loads, and suspected electricity theft. The stability and accuracy of load forecasting models are also insufficient.

Method used

By comparing the synchronously collected data with the power flow calculation results of the digital twin power grid model node by node and branch by branch under the same time slice, residual vectors are generated, influence relationship matrix is ​​constructed, and the disturbance variables of the difference cause group are solved by weighted least squares estimation and sparse group constraints. The digital twin power grid model is corrected and the data credibility is updated. The load forecasting model is trained to output the predicted median value and credibility, and representative operating conditions are generated for risk ranking.

Benefits of technology

It effectively distinguishes the causes of power grid operation deviations, reduces duplicate alarms and misjudgments, improves the stability and accuracy of difference attribution, enhances the stability and risk identification capabilities of load forecasting models, and provides reliable risk ranking and operation and maintenance decision-making basis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122155440A_ABST
    Figure CN122155440A_ABST
Patent Text Reader

Abstract

The application discloses a power grid monitoring and risk early warning method and system based on digital twinning and AI, which comprises the following steps: comparing, under the same time slice, the synchronous acquisition data with the nodal and branch flow calculation results and reference quantities of the digital twinning power grid model, and generating a residual vector; constructing an influence relationship matrix based on the power flow Jacobian matrix, the branch power balance relationship and the upstream and downstream power conservation relationship; solving each cause group disturbance variable by using weighted least squares estimation and sparse group constraint, and determining the confidence; correcting the digital twinning power grid model according to the confidence, updating the data reliability and labeling the historical acquisition samples; training the load prediction model based on the labeled samples, generating representative working conditions, performing power flow calculation, counting the out-of-limit conditions and obtaining the risk ranking. The application can improve the accuracy of power grid anomaly attribution, load prediction and risk early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power system monitoring and risk early warning technology, and more specifically, to a power grid monitoring and risk early warning method and system based on digital twins and AI. Background Technology

[0002] With the expansion of distribution network scale and the increased integration of distributed power sources, charging loads, and flexible loads, the power grid operation exhibits characteristics such as strong volatility, numerous influencing factors, and hidden local risks. Existing power grid monitoring systems typically rely on data acquisition terminals, metering devices, and dispatching systems to obtain operational data such as voltage, current, and power, and identify anomalies through threshold judgment, manual verification, or simple statistical models. However, in actual operation, the acquired data is easily distorted due to factors such as device rate deviation, phase deviation, time synchronization error, and communication jitter. Furthermore, if model information such as switch status, tie-line status, line impedance, and transformer parameters is not updated in a timely manner, the calculated results will also be inconsistent with the actual on-site operating conditions.

[0003] Existing technologies for handling power grid anomalies often rely on individual measuring points or single indicators for judgment. When multiple nodes or branches experience deviations simultaneously due to the same cause, this easily leads to numerous duplicate alarms, making it difficult to accurately distinguish between different causes such as measuring device malfunctions, topology errors, equipment parameter deviations, abnormal loads, and suspected electricity theft. Furthermore, existing methods fail to adequately utilize the physical constraints between upstream and downstream power relationships, branch loss relationships, and node voltage variations in the distribution network, resulting in limited accuracy and interpretability in anomaly location.

[0004] Furthermore, load forecasting models are typically trained directly using historical data. If low-reliability data or data from abnormal scenarios are mixed into the historical samples, the stability of the forecast results will be affected. Some methods only output a single forecast value, which is insufficient to reflect the uncertainty of load changes and also makes it difficult to cover adverse operating conditions such as high load, low voltage sensitive areas, and poor data quality in subsequent power flow calculations. Summary of the Invention

[0005] This application provides a method and system for power grid monitoring and risk early warning based on digital twins and AI, in order to at least solve some of the technical problems existing in the related technologies described above.

[0006] According to a first aspect of the embodiments of this application, a method for power grid monitoring and risk early warning based on digital twins and AI is provided, including: Under the same time slice, the synchronously collected data is compared with the power flow calculation results and generated reference quantities of the digital twin power grid model node by node and branch by branch to generate residual vectors; Based on the power flow Jacobian matrix, branch power balance relationship and upstream and downstream power conservation relationship, the influence relationship of parameter disturbance on the residual vector is calculated, and the influence relationship matrix is ​​constructed. The causes of difference are divided into multiple cause groups. By combining weighted least squares estimation with sparse group constraints, the perturbation variables of each cause group are solved using the residual vector and the influence relationship matrix. The confidence level of each cause group is determined based on the perturbation variables. The digital twin power grid model is corrected based on the confidence level, the data confidence level of each node is updated, and the confidence level of historically collected samples is labeled. The load prediction model is trained using historical samples labeled with the aforementioned confidence level. The load prediction model outputs the predicted median, upper limit, and lower limit for each node. Representative operating conditions are generated based on the predicted median, upper limit, lower limit, and data reliability. Power flow calculations are performed on each representative operating condition to count the frequency and magnitude of limit violations, and a risk ranking is obtained.

[0007] As an optional approach, the components of the residual vector include the voltage residual of each node, the current residual of each branch, the active power residual, the reactive power residual, the line loss residual determined by the power difference between adjacent nodes or branches, and the harmonic residual determined by the measured harmonic components and the model harmonic reference value.

[0008] As an optional approach, the multiple cause groups include measurement device multiplier or phase deviation, inconsistent switch or contact point status, line impedance or transformer parameter deviation, local abnormal load, suspected electricity theft load, and abnormal losses caused by increased contact resistance; each column in the influence relationship matrix corresponds to the response mode of a disturbance variable on each component of the residual vector, and the same cause group corresponds to one or more columns of response modes, which constitute the response submatrix of the cause group.

[0009] As an optional approach, in the weighted least squares estimation, each component of the residual vector is assigned a weight; the weight is determined based on the stability index of the corresponding acquisition device, the consistency index among similar measurements, the time synchronization quality index, and the historical error level, and is automatically calculated by the statistical analysis of the acquired data and updated as new acquired data accumulates.

[0010] As an optional approach, the sparse group constraint is achieved by adding a group sparse regularization term to the objective function; the objective function includes a weighted residual fitting term and the group sparse regularization term; the weighted residual fitting term is the weighted sum of squares of the differences between each component of the residual vector and the product of the influence relationship matrix and the perturbation variable; the group sparse regularization term is the product of the sum of the L2 norms of the perturbation variable subvectors corresponding to each cause group and the regularization coefficient; the regularization coefficient is adaptively selected according to the overall magnitude of the residual vector and the number of cause groups.

[0011] As an optional approach, when solving for the perturbation variables of each cause group, an adjacent time slice consistency check is introduced: the perturbation variables of each cause group are used as state vectors, and the residual vectors are used as observations to establish a state-space model; a process noise variance is set for each cause group, wherein the process noise variance of the slow-changing cause group is less than that of the fast-changing cause group; when each time slice arrives, the prediction and update steps of Kalman filtering are performed to obtain the time-smoothed estimate of the perturbation variables of each cause group; the confidence level of each cause group is determined based on the time-smoothed estimate.

[0012] As an optional approach, correcting the digital twin power grid model based on the confidence level includes: For measurement device deviation cause groups with confidence levels higher than a preset threshold, the data confidence level of the corresponding measurement point is reduced, and the reduction magnitude is positively correlated with the estimated deviation of the measurement point and the confidence level. For the group of reasons for inconsistency in topology state with a confidence level higher than a preset threshold, enumerate the candidate topology state of the corresponding switch or tie point, re-perform power flow calculation for each candidate topology state, and select the candidate topology state with the smallest overall residual error to update the digital twin power grid model. For the group of device parameter deviation reasons with a confidence level higher than the preset threshold, output the device parameters to be checked and their estimated deviation range.

[0013] As an optional approach, the confidence labeling of historical collected samples includes: for historical time slices where the confidence level indicates that the residuals are caused by measurement device deviations, or for historical time slices where the topology inconsistency cannot be explained and the correct topology cannot be determined, the collected values ​​of the affected measurement points are labeled as low-confidence samples, and the low-confidence samples are assigned a sample weight greater than 0 and less than 1 in the training loss calculation of the load prediction model; for historical time slices where the confidence level indicates that the residuals are explained by abnormal loads or suspected electricity theft, the corresponding samples are labeled as abnormal scenario samples and separated from the normal load training set.

[0014] As an optional approach, the load forecasting model adopts a time-series fusion transformer structure. The input features of the load forecasting model include historical load sequences of each node, meteorological data, holiday identifiers, and the reliability of the data. The temporal fusion transformer structure includes a variable selection network, a gated residual network, a long short-term memory (LSM) encoder and a LSM decoder, a multi-head attention mechanism layer, and a quantile output layer. The variable selection network evaluates the importance of the input features and outputs feature selection weights. The LSM encoder encodes the historical time-varying feature sequence processed by the variable selection network and outputs a hidden state sequence. The LSM decoder uses the hidden state at the end of the encoder as the initial state and decodes future known time-varying features. The multi-head attention mechanism layer uses the hidden state of the decoder as the query and the hidden state of the encoder as the key and value to generate an attention output. The quantile output layer maps the attention output to the predicted median, upper prediction limit, and lower prediction limit, respectively.

[0015] According to a second aspect of the embodiments of this application, a power grid monitoring and risk early warning system based on digital twins and AI is also provided, comprising: The residual generation module is used to compare the synchronously acquired data with the power flow calculation results and generated reference quantities of the digital twin power grid model node by node and branch by branch under the same time slice to generate residual vectors. The influence relationship matrix construction module is used to calculate the influence relationship of parameter disturbance on the residual vector based on the power flow Jacobian matrix, branch power balance relationship and upstream and downstream power conservation relationship, and construct the influence relationship matrix. The difference attribution module is used to divide the difference causes into multiple cause groups, and solve the perturbation variables of each cause group by weighted least squares estimation combined with sparse group constraints, using the residual vector and the influence relationship matrix, and determine the confidence level of each cause group based on the perturbation variables; The model correction and labeling module is used to correct the digital twin power grid model according to the confidence level, update the data confidence of each node, and label the confidence of historically collected samples. The load forecasting module is used to train a load forecasting model with historical collected samples labeled with the confidence level. The load forecasting model outputs the predicted median, upper limit, and lower limit for each node. The risk ranking module is used to generate representative operating conditions based on the predicted median, upper limit, lower limit and the data confidence level, perform power flow calculations on each representative operating condition, count the frequency and magnitude of exceeding the limit, and obtain the risk ranking.

[0016] This invention compares synchronously acquired data with power flow calculations from a digital twin power grid model on a node-by-node and branch-by-branch basis within the same time slice. It then constructs an influence relationship matrix by combining the power flow Jacobian matrix, branch power balance relationships, and upstream and downstream power conservation relationships. This transforms power grid operation deviations from single-point threshold judgments into a causal group solution based on physical constraints, effectively distinguishing between different causes such as measurement device deviations, topology inconsistencies, equipment parameter deviations, abnormal loads, suspected electricity theft, and abnormal losses, reducing duplicate alarms and false alarms. Through weighted least squares estimation, sparse group constraints, and consistency verification between adjacent time slices, the stability and accuracy of discrepancy attribution are improved. Furthermore, this invention corrects the digital twin power grid model based on the attribution results, updates data credibility, and labels historically acquired samples with credibility, enabling the load forecasting model to be trained on filtered and weighted data, reducing the impact of low-quality data on prediction results. By outputting the predicted median, upper limit, and lower limit, and combining this with data credibility to generate representative operating conditions for power flow calculations, it can more comprehensively identify over-limit risks, forming a reliable basis for risk ranking and operation and maintenance decisions.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Furthermore, no embodiment in this disclosure is required to achieve all the effects described above. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0019] Figure 1 This is a schematic diagram of a power grid monitoring and risk warning method based on digital twins and AI, provided as an embodiment of this disclosure.

[0020] Figure 2 A schematic diagram illustrating the process for determining the confidence level of the difference cause group provided in this embodiment of the disclosure.

[0021] Figure 3 This is a schematic diagram of the credibility labeling process provided in the embodiments of this disclosure.

[0022] Figure 4 This is a schematic diagram of the load forecasting model structure provided in an embodiment of this disclosure.

[0023] Figure 5 This is a schematic diagram of the structure of a power grid monitoring and risk early warning system based on digital twins and AI, provided in an embodiment of this disclosure.

[0024] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0026] According to embodiments of this disclosure, a power grid monitoring and risk early warning method based on digital twins and AI is provided. This method is applicable to distribution network systems with multi-level nodes, including substation outlets, feeder branch points, distribution transformer substations, and user nodes. Each node is equipped with a status monitoring device, which is connected to a receiving and aggregating device via a communication link. The receiving and aggregating device establishes a communication connection with an intelligent management and control platform. The intelligent management and control platform runs a digital twin power grid model, a power flow calculation module, a differential attribution module, a load forecasting module, and a scheme evaluation module. This method is executed by the intelligent management and control platform, and the differential attribution module and the load forecasting module can be deployed on the computing nodes of the intelligent management and control platform.

[0027] The implementation process of the method described in this application will be described in detail below with reference to specific embodiments. It should be noted that this embodiment is only used to explain this application and is not intended to limit the scope of protection of this application. Conventional adjustments or substitutions of each step by those skilled in the art without departing from the concept of this application should be included in the scope of protection of this application.

[0028] Please see Figure 1 , Figure 1 A flowchart of a power grid monitoring and risk warning method based on digital twins and AI, according to an embodiment of the present invention, is shown. Figure 1 As shown, the method includes steps S1-S6: In step S1, under the same time slice, the synchronously collected data is compared with the power flow calculation results and generated reference quantities of the digital twin power grid model node by node and branch by branch to generate residual vectors.

[0029] In some embodiments, the condition monitoring devices deployed at key nodes of the power grid integrate a satellite timing module, which receives time signals from the satellite navigation system to obtain a high-precision absolute time reference. When satellite signals are unavailable, the condition monitoring devices perform clock calibration by receiving broadcast time synchronization signals periodically emitted by the aggregating receiving equipment, thereby keeping the local clocks of all condition monitoring devices synchronized with a unified time reference.

[0030] At the same millisecond interval, all status monitoring devices synchronously sample, collecting parameters including node voltage, branch current, active power, reactive power, power factor, harmonic components, and corresponding timestamps. The collected data is aggregated via a communication link to a receiving device and then uploaded to the intelligent management platform. The intelligent management platform aligns the collected data from each node at the same time based on the timestamps carried by each data entry, forming a network-wide synchronous data snapshot. In this embodiment, this snapshot is referred to as a time slice, and each time slice contains the electrical parameters of all monitored nodes and branches at that time. Synchronously collected data refers to the full collection of parameters from all nodes and branches within the same time slice.

[0031] The intelligent management and control platform uses BeiDou positioning data and as-built measurement data to determine the geographical coordinates of each power facility and digitizes the electrical wiring relationships and equipment parameters from the as-built drawings. Equipment ledger parameters include transformer rated capacity, impedance percentage, turns ratio, and connection group; conductor type, length, impedance per unit length, and admittance of lines; rated current and current status of switches and tie points; and rated capacity and switching status of reactive power compensation devices. The intelligent management and control platform integrates the above geographical information, electrical topology, equipment ledger parameters, and real-time synchronously collected data to construct a digital twin power grid model. This model corresponds one-to-one with each node of the physical power grid and continuously updates the operating parameters of each node based on the collected data; when the power grid topology changes due to switch operations or line switching, the model updates the topology structure synchronously.

[0032] At the same data acquisition moment, the intelligent management and control platform uses the digital twin power grid model as the calculation object, employing equipment ledger parameters and the current operating mode to invoke the power flow calculation module to perform power flow calculations on the power grid state at that moment. The power flow calculation outputs the voltage amplitude and phase angle of each node. For harmonic components, the digital twin power grid model generates model harmonic reference values ​​corresponding to the monitored node or branch based on equipment ledger parameters, topological connections, and harmonic statistics from historical normal operating time slices at the same time slice. These model harmonic reference values ​​are used to form harmonic residuals with the measured harmonic components. For line loss components, the system calculates the line loss residuals based on the measured power difference and the power flow calculation power difference between adjacent nodes or branches; as well as the active power, reactive power, and current of each branch. These outputs constitute the power flow calculation results. The power flow calculation results, together with the synchronously acquired data at the same time, form the basis for subsequent difference comparisons.

[0033] In some embodiments, during actual operation of a distribution network, a deviation in the multiplier of a measuring device, a failure to update the status of a switch in a timely manner, or an error in the input of impedance parameters for a section of a line can all cause simultaneous voltage, current, and power deviations at multiple upstream and downstream nodes. If each point is judged individually according to a single-point threshold, the same root cause will be split into multiple independent alarms, and model parameter errors may also be misjudged as load anomalies or electricity theft. To address this, embodiments of this disclosure transform the difference between synchronously collected data and power flow calculation results into a computable cause set problem, using the physical relationships of power flow to infer the source of the difference, and on this basis, correct the digital twin power grid model and provide purified data for subsequent predictions.

[0034] Specifically, under the same time slice, the intelligent management and control platform subtracts the synchronously collected data from the power flow calculation results of the digital twin power grid model node by node and branch by branch to generate a residual vector. The components of the residual vector include the voltage residual of each node, the current residual of each branch, the active power residual, the reactive power residual, the line loss residual, and the harmonic residual. Specifically, the voltage residual is the difference between the synchronously collected voltage value and the power flow calculation voltage value at the same node; the current residual is the difference between the synchronously collected current value and the power flow calculation current value at the same branch; the active power residual and reactive power residual are the differences between the measured power value and the calculated power value at the same branch, respectively. The line loss residual consists of the difference between the measured power difference and the calculated power difference between adjacent nodes, and the harmonic residual is the difference between the measured harmonic component and the model harmonic reference value corresponding to the same time slice. The above residual vector summarizes the deviation information between the synchronously collected data and the power flow calculation results under the current time slice across various measurement dimensions.

[0035] In step S2, based on the power flow Jacobian matrix, branch power balance relationship and upstream and downstream power conservation relationship, the influence relationship of parameter disturbance on the residual vector is calculated, and the influence relationship matrix is ​​constructed.

[0036] In some embodiments, the intelligent management and control platform uses the power flow calculation results of the current digital twin power grid model as the working point to calculate the influence relationship of various parameter disturbances on each component of the residual vector and construct an influence relationship matrix. The construction of the influence relationship matrix is ​​based on three physical relationships: the power flow Jacobian matrix, the branch power balance relationship, and the upstream and downstream power conservation relationship.

[0037] The power flow Jacobian matrix describes the linearized relationship between changes in node injected power and changes in node voltage magnitude and phase angle. When the parameters of a node or branch are disturbed, the disturbance propagates to other connected nodes via the Jacobian matrix, forming a specific distribution pattern on the residual vector. The branch power balance relationship constrains the power inflow and outflow at both ends of the same branch to satisfy the line loss equation. The upstream and downstream power conservation relationship constrains the sum of the power distribution at each branch point of the feeder to equal the output power of the upstream node minus the line loss of that segment.

[0038] In this system, each column of the influence matrix corresponds to the response pattern of a disturbance variable on each component of the residual vector. The same cause group corresponds to one or more columns of response patterns. Taking the measurement device scaling deviation as an example, this column vector reflects the contribution of the measured value at that point to the residual vector after scaling, and only takes non-zero values ​​on the components directly related to that point. For line impedance deviation, the system linearizes the power flow equation at the current operating point and calculates the impact of the branch impedance change on voltage drop, reactive power loss, and active power loss at each node along the line, thus forming a column vector with non-zero values ​​on multiple residual components. For inconsistent switch states, the system calculates the difference in power flow distribution under both closed and open topologies, using this difference as the response pattern of the topology cause group. For increased contact resistance, the system treats it as an equivalent additional resistor connected in series at the contact point and calculates the impact of this additional resistance on line current, voltage drop, and losses.

[0039] The input for calculating the influence relationship matrix comes from the existing topology model, equipment ledger parameters, and power flow calculation results. When each time slice arrives, the system recalculates or incrementally updates the matrix based on the current operating point.

[0040] In step S3, the causes of difference are divided into multiple cause groups. A method combining weighted least squares estimation and sparse group constraints is used to solve the perturbation variables of each cause group using the residual vector and the influence relationship matrix. The confidence level of each cause group is determined based on the perturbation variables.

[0041] Specifically, please refer to Figure 2 , Figure 2 A schematic diagram illustrating the process for determining the confidence level of difference cause groups provided in an embodiment of this disclosure is shown. Figure 2 As shown, in step S201, the causes that may cause differences are divided into multiple cause groups.

[0042] In some embodiments, the cause group includes: measurement device ratio or phase deviation, inconsistency in switch or tie-in status, line impedance or transformer parameter deviation, local abnormal load, suspected electricity theft load, and abnormal losses due to increased contact resistance. Each type of cause corresponds to a different set of residual distribution characteristics, which are represented by the corresponding column vectors of the influence relationship matrix. During the risk source identification stage, if the residual, after model correction, is no longer explained by measurement device deviation, topology inconsistency, or equipment parameter deviation, but still exhibits residuals related to load input, it is classified as a load change cause.

[0043] For example, the measurement device's magnification deviation usually causes the relevant quantity at the measurement point to maintain the same direction and proportion of deviation in multiple consecutive time slices; the inconsistency of the topology state causes the power flow distribution on both sides of the switch to change simultaneously; the line impedance deviation simultaneously affects the voltage drop and reactive power distribution along the line; and the increase in contact resistance is more likely to manifest as a synchronous increase in loss residuals during periods of increased current.

[0044] In step S202, the system assigns weights to each component of the residual vector. The weights are determined based on four indicators for the corresponding acquisition device: stability index, consistency index among similar measurements, time synchronization quality index, and historical error level. Specifically, the stability index is characterized by the standard deviation of the recent multiple time slice acquisition values ​​of the device; a smaller standard deviation indicates higher stability and a larger weight. The consistency index is characterized by the magnitude of difference between similar measurements at the same node or adjacent nodes; a smaller magnitude of difference indicates higher consistency. The time synchronization quality index is characterized by timing error or broadcast time synchronization delay; a smaller delay indicates higher synchronization quality. The historical error level is characterized by the statistical mean and variance of the device's past residuals; a lower historical error level results in a larger weight.

[0045] The aforementioned weights are automatically calculated through statistical analysis of the collected data. Before calculating the weights, the system standardizes the stability index, the consistency index among similar measurements, the time synchronization quality index, and the historical error level, and combines the four standardized indicators into the weights of the corresponding residual components. These weights are positive real numbers and can be further normalized to a preset weight range. The more stable the recent performance of the acquisition device, the more consistent it is among similar measurements, the higher the time synchronization quality, and the lower the historical error, the greater the weight of that component in the solution; conversely, the smaller the weight. In this way, weighted least squares estimation based on weights to weaken the influence of outliers can reduce the impact of occasional noise, communication jitter, and single-point outliers on the solution results.

[0046] In step S203, the sparse group constraint causes the system to preferentially select a few groups of causes that can collectively explain most of the residuals during the solution process. In one implementation, the sparse group constraint is achieved by adding a group sparsity regularization term to the objective function. The objective function consists of two parts: a weighted residual fitting term and a group sparsity regularization term. Before substituting into the objective function, the system standardizes each component of the residual vector according to the nominal value, historical standard deviation, or preset benchmark value of the corresponding measurement type, and standardizes the disturbance variable according to the benchmark value of the corresponding parameter. The specific form is as follows:

[0047] in The first element of the standardized residual vector is... One portion, The first part of the influence relationship matrix corresponding to the standardized perturbation variables. OK, Let be the vector of perturbation variables of the cause group to be solved. The first step determined in the preceding steps The weights of each residual component For belonging to the first The perturbation variable subvectors of each cause group The regularization coefficient is . Let be the 2-norm of the vector.

[0048] The weighted residual fitting term is the weighted sum of squares of the differences between each component of the residual vector and the product of the influence relationship matrix and the perturbation variable. The group sparsity regularization term is the product of the sum of the L2 norms of the perturbation variable subvectors corresponding to each cause group and the regularization coefficient. The value of the regularization coefficient is determined based on the overall magnitude of the residual vector and the number of cause groups. The system first forms a candidate range of regularization coefficients based on the overall magnitude of the residual vector and the number of cause groups, and then selects the regularization coefficient within this candidate range based on the residual fitting error and the number of non-zero cause groups corresponding to the candidate regularization coefficients. Optionally, the selection process is implemented using cross-validation or an information criterion-based method. The role of this regularization term is to retain only a few non-zero cause groups in the solution results, and each perturbation variable within each non-zero cause group can take non-zero values, thereby avoiding the simultaneous labeling of multiple adjacent nodes as independent anomalies.

[0049] In step S204, the system uses the residual vector as the observation and the influence relationship matrix as the coefficient matrix to obtain the perturbation variables for each cause group by solving the objective function. The perturbation variable corresponding to the same cause group is represented by a sub-vector of the perturbation variable vector and corresponds to the corresponding column set in the influence relationship matrix.

[0050] After obtaining the solution results of the disturbance variables for a single time slice, the system introduces a consistency check between adjacent time slices, applying different time constraints to the causes of different rates of change. Measurement device deviations and equipment parameter deviations are considered slow-changing causes, and their disturbance variables should remain relatively stable between adjacent time slices; local abnormal loads, suspected electricity theft loads, and changes in switch status are considered fast-changing causes, and their disturbance variables are allowed to undergo abrupt changes within a short period of time.

[0051] In one implementation, the time consistency check is achieved through Kalman filtering. Kalman filtering is a recursive state estimation method that performs optimal linear estimation of noisy observation sequences given the known system state transition relationships and observation relationships. Specifically, it involves establishing a state-space model by treating the disturbance variables of each cause group as state vectors and the residual vectors as observations. The state transition equations assume that each disturbance variable remains approximately unchanged between adjacent time slices, i.e., the state transition matrix is ​​taken as the identity matrix; the observation equations represent the residual vector as the product of the influence relationship matrix and the state vector plus observation noise.

[0052] For slow-changing cause groups, the system sets a smaller process noise variance; the smaller the process noise variance, the slower the state estimate changes between adjacent time slices. For fast-changing cause groups, the system sets a larger process noise variance, allowing the estimated value to change significantly within a short period. The initial value of the process noise variance can be preset according to the physical change rate of each cause group, and the process noise variance of the slow-changing cause group must be less than that of the fast-changing cause group. In some embodiments, the system adaptively adjusts the process noise variance based on the variance of the change of the corresponding cause group's disturbance variable within the historical time window.

[0053] At the arrival of each time slice, the Kalman filter performs a prediction step and an update step. The prediction step, based on the posterior state estimate and process noise variance of the previous time slice, obtains the prior state estimate and prior covariance for the current time slice. The update step calculates the Kalman gain based on the residual vector and influence matrix of the current time slice, and uses the Kalman gain to correct the prior estimates, obtaining the posterior state estimate and posterior covariance. The posterior estimate is the time-smoothed estimate of the disturbance variables for each cause group in the current time slice.

[0054] In step S205, the system determines the confidence level of each cause group based on the time-smoothed estimates. The confidence level is calculated based on two aspects: first, the stability of the estimated values ​​of the disturbance variables in the cause group across multiple continuous time slices; the smaller the variance of the estimated values, the higher the confidence level. Second, the contribution ratio of the cause group to the overall fitting of the residual vector; the larger the proportion of the increase in residual fitting error after removing the cause group relative to the total residual, the higher the confidence level. The confidence level of each cause group is determined by combining these two aspects. The confidence level is a normalized value, obtained by combining the stability index of the disturbance variables in continuous time slices and the contribution ratio of the cause group to the residual fitting error; the preset threshold is determined by historical attribution results, operation and maintenance verification results, or preset operating rules.

[0055] Alternatively, a sliding time window smoothing method can be used instead of Kalman filtering. This method solves uniformly on the residual data of the most recent time slices and applies a difference penalty term between adjacent time slices to the slow-changing cause group. This can also prevent short-term noise from being misjudged as equipment parameter errors and persistent parameter errors from being misjudged as load anomalies.

[0056] In step S4, the digital twin power grid model is corrected according to the confidence level, the data confidence level of each node is updated, and the confidence level of historically collected samples is labeled.

[0057] In some embodiments, specifically, please refer to Figure 3 , Figure 3 A schematic diagram of the credibility labeling process provided in an embodiment of this disclosure is shown. For example... Figure 3 As shown, in step S301, after completing the difference attribution, the system classifies the digital twin power grid model according to the confidence level of each cause group and performs difference correction.

[0058] The classification process includes topology updates, output of equipment parameter verification information, data reliability updates, and parameter reliability tag updates. Data reliability is a reliability coefficient maintained by the system for each measuring point or measuring points associated with nodes; parameter reliability tags are reliability tags maintained by the system for equipment parameters in the digital twin power grid model. The initial value is a preset standard value used to quantify the reliability of the data collected at that measuring point, and is subsequently used in load forecasting and future state simulation.

[0059] For measurement device deviation cause groups with confidence levels higher than a preset threshold, the system reduces the data confidence level of the corresponding measurement point. The reduction is positively correlated with the estimated deviation and confidence level of that measurement point: the larger the deviation estimate and the higher the confidence level, the greater the reduction in data confidence. However, the data confidence level is maintained at no lower than a preset lower limit to ensure that the data from that measurement point can still participate in subsequent calculations. The preset threshold is determined based on historical attribution results, maintenance verification results, or preset operating rules.

[0060] For groups of inconsistencies in topology states with a confidence level higher than a preset threshold, the system enumerates possible state combinations at the switch or tie-line location indicated by the attribution result, generating a candidate topology state set. In a distribution network, a single switch has two states: closed and open. When the attribution result points to multiple switches, the number of candidate topology states increases with the number of combinations. The system updates each candidate topology state in the digital twin power grid model and re-executes power flow calculations. The recalculated simulation values ​​are compared with synchronously acquired data to calculate the overall error of the residual vector. The candidate topology state with the smallest overall residual error is selected to update the digital twin power grid model, and the topology update record is synchronized to the operation and maintenance management system for on-site verification.

[0061] For equipment parameter deviation groups with a confidence level higher than a preset threshold, the system outputs the equipment parameters to be verified and their estimated deviation ranges for on-site inspection by maintenance personnel. For suspected electricity theft or abnormal loads, the system locates the smallest identifiable power supply section and issues an alarm.

[0062] After the above corrections are completed, the parameter confidence labels of the corresponding nodes and branches in the model are updated, so that the power flow calculation and difference attribution of subsequent time slices can refer to the identified deviation information.

[0063] In step S302, the system assigns confidence labels to historically acquired samples based on the confidence level of each historical time slice. For historical time slices where the confidence level indicates that the residuals are explained by measurement device bias or topological inconsistency, the system labels the acquired values ​​of the affected measurement points as low-confidence samples. If the residuals are explained by topological inconsistency, and the difference attribution module outputs candidate topologies, the system corrects the acquired data of the time slice according to the candidate topologies before including it in the training, and redetermines the confidence label of the time slice based on the corrected residuals; if the correct topology cannot be determined, the time slice is also labeled as low-confidence.

[0064] For historical time slices where the confidence level indicates that the residuals are explained by abnormal loads or suspected electricity theft, the system labels the corresponding samples as abnormal scenario samples and separates them from the normal load training set. Abnormal scenario samples are retained separately and can be used for training or validation of the anomaly detection model, but are not mixed into the normal load prediction training set.

[0065] In step S5, the load prediction model is trained using historical samples labeled with the confidence level. The load prediction model outputs the predicted median, upper limit, and lower limit for each node.

[0066] In some embodiments, the load forecasting model employs a Time-Series Fusion Converter (TFT) structure. The model's input features include historical load sequences for each node, meteorological data (temperature, humidity, wind speed, solar radiation intensity), holiday identifiers, and the updated reliability of the node data from the preceding steps. The input features are divided into two categories: time-varying features and static features. Time-varying features include historical load sequences, meteorological data, holiday identifiers, and the reliability of the measurement point data associated with each node. Static features include node type, power supply area attributes, and historical load statistics.

[0067] Please see Figure 4 , Figure 4 A schematic diagram of the load forecasting model structure provided in an embodiment of this disclosure is shown. Figure 4As shown, the structure of the TFT model consists of the following modules: variable selection network, gated residual network, long short-term memory network (LSTM) encoder and decoder, multi-head attention mechanism layer, and quantile output layer. The modules are connected in the order of static feature processing, time-varying feature selection, temporal encoding and decoding, attention fusion, and quantile output.

[0068] Specifically, static features are input into a static variable selection network, and after nonlinear transformation by a gated residual network, a static context vector is generated. This static context vector is then passed to the variable selection network for time-varying features, the initial state of the LSTM encoder, and the initial state of the LSTM decoder, providing node-level prior information for time-series processing.

[0069] The input of time-varying features is processed by a time-varying variable selection network. This network evaluates the importance of the input features and outputs feature selection weights. Internally, each input feature is transformed through a gated residual network. Then, the Softmax function is used to calculate the selection weights for each feature, and the weighted features are combined to form the input sequence for the encoder or decoder. The internal structure of the gated residual network includes two fully connected layers, an exponential linear unit (ELU) activation function, a gated linear unit (GLU), and layer normalization. The gated linear unit controls the proportion of information passing through by element-wise gating signals.

[0070] The LSTM encoder encodes the historical time-varying feature sequence processed by the variable selection network, calculates the hidden state and cell state step by step, and outputs the hidden state sequence for each time step. The LSTM decoder takes the hidden state and cell state at the end of the encoder as the initial state, receives known future time-varying features (such as weather forecast data and holiday identifiers for future periods), and outputs the hidden state sequence for each future time step.

[0071] The multi-head attention mechanism layer uses the hidden states of the decoder at each time step as queries and the hidden states of the encoder at each time step as keys and values ​​to calculate attention weights and generate attention outputs. The attention outputs and decoder hidden states are then processed through residual connections and layer normalization before being input into a feedforward gated residual network for further transformation.

[0072] The quantile output layer consists of multiple parallel fully connected layers, corresponding to the preset upper quantile, median, and lower quantile, respectively. The lower quantile is less than the median, and the upper quantile is greater than the median. Each fully connected layer maps the output of the multi-head attention mechanism layer to the predicted value at the corresponding quantile, thereby outputting the predicted median, upper bound, and lower bound, respectively.

[0073] In some embodiments, the system trains the load prediction model using historically collected samples labeled with confidence levels. During training, the historical samples are divided into training and validation sets in chronological order, and parameters are updated using backpropagation and an adaptive learning rate optimizer. The model training employs a quantile loss function, which applies different penalty weights for predicted values ​​higher than or lower than the true values, with the penalty weights correlated with the corresponding quantile values.

[0074] In the training loss calculation, samples that remain low-confidence after confidence labeling are assigned smaller sample weights; for example, the weight of such a sample is greater than 0 and less than 1, while samples not labeled as low-confidence have a weight of 1. The smaller the sample weight, the lower the model's constraint on that sample, but the sample's contribution to the overall temporal continuity is still preserved. Since data confidence is one of the model's input features, the load forecasting model can use data confidence as one of the feature factors influencing the prediction interval; the distance between the upper and lower prediction limits of the corresponding node is determined by the quantile output layer obtained through training.

[0075] The load forecasting model outputs the forecast median, upper forecast limit, and lower forecast limit for each node. In actual implementation, the length of the forecast period can be configured to be from several hours to several days in the future.

[0076] In step S6, representative operating conditions are generated based on the predicted median, upper limit, lower limit and data confidence level. Power flow calculation is performed on each representative operating condition to count the frequency and magnitude of limit violations and obtain the risk ranking.

[0077] In some embodiments, the system generates multiple representative operating conditions based on the predicted median, upper limit, lower limit, and data reliability of each node output by the load forecasting model. For example, the representative operating conditions are configured as follows.

[0078] Normal median operating condition: All nodes use the predicted median value as the load input, reflecting the most likely operating state of the power grid under predicted conditions.

[0079] Localized high load conditions: For nodes whose historical load peak values ​​meet the preset screening conditions, the upper limit of the prediction is used, and the median value of the prediction is used for the remaining nodes, in order to cover localized overload scenarios; the preset screening conditions include the historical load peak ranking or the historical load peak quantile threshold.

[0080] Low-voltage sensitive conditions: The upper limit of the prediction is used as the load input for the feeder end nodes determined according to the topology relationship of the digital twin power grid model to examine the low-voltage risk at the end of the line.

[0081] Conservative operating condition: For nodes with data reliability below a preset threshold, the upper limit of the prediction is used, and for the remaining nodes, the median value of the prediction is used to cover the worst-case operating situation under conditions of unsatisfactory data quality. The preset threshold is determined based on historical attribution results, operation and maintenance verification results, or preset operating rules.

[0082] The number and combination of representative operating conditions can be flexibly configured according to the power grid scale and computing resources. The system performs power flow calculations for each representative operating condition to obtain the voltage of each node, the current of each branch, and the power distribution. For each device or node, the system counts the frequency and magnitude of limit violations under different operating conditions, with limit violation determination based on the device's rated parameters and the allowable voltage deviation range. The system combines the frequency and magnitude of limit violations into a risk score; nodes with higher frequency and larger magnitude violations have higher risk scores, thus obtaining a risk ranking.

[0083] In some embodiments, if there are nodes exceeding the limits in the risk ranking, the system determines the source of the exceedance based on the confidence level of each cause group. Specifically, the system checks the attribution output of the exceedance node and its upstream and downstream nodes in multiple recent time slices: if the residual of the segment where the exceedance node is located is attributed to measurement device deviation or equipment parameter deviation in multiple time slices, and the corresponding confidence level is higher than a preset threshold, the system outputs a verification suggestion, which includes the verification object corresponding to the attribution result; when attributed to measurement device deviation, it includes the measurement device number that needs to be verified; when attributed to inconsistent topology status, it includes the switch status that needs to be confirmed on-site; when attributed to equipment parameter deviation, it includes the equipment parameters that need to be recalibrated, without directly proposing capacity expansion or line modification, to avoid unnecessary investment due to data quality issues.

[0084] If the residuals of the out-of-limit nodes, after correction, are still attributed to load variation reasons (meaning reasons that, after excluding measurement device deviations, topology inconsistencies, and equipment parameter deviations, are still explained by load variation, and the out-of-limit occurs under multiple representative operating conditions), the system selects modification measures from the modification measure library to generate a modification plan. The modification measure library includes typical measures such as line modification, transformer capacity expansion, and the installation of reactive power compensation devices. The system combines the location of the risk node, the type of out-of-limit violation, and its severity to select applicable combinations of measures.

[0085] For the generated modification schemes, the system updates the parameter changes involved in the scheme to the digital twin power grid model, and re-executes power flow calculations for each representative operating condition to verify the elimination of limits. If a scheme eliminates limits only under the normal median operating condition but still has limits under the conservative operating condition, the priority of the scheme is reduced; if a scheme eliminates limits under all representative operating conditions, and the simulation results remain safe after applying a certain amount of disturbance to the predicted values ​​of key nodes, the priority of the scheme is increased. During the verification process, the system retains the power flow calculation results before and after the modification, and retains the historical or current time slice residual interpretation results related to the limit node for operation and maintenance personnel to compare. Finally, it outputs the modification scheme verified by multi-condition simulation and its expected effect evaluation.

[0086] Using the above method, this invention transforms the difference between synchronously acquired data and the digital twin power grid model from single-point threshold judgment to cause group solution based on power flow physical relationship, thereby reducing repeated alarms and error location; the attribution results are used to correct the model and purify the prediction training data, making the load forecast and future state simulation results more stable; the representative operating conditions generated based on the prediction interval and data credibility cover prediction uncertainty and data quality differences, enabling risk ranking and transformation scheme evaluation to have tolerance for operational fluctuations.

[0087] Please see Figure 5 , Figure 5 This is a schematic diagram of a power grid monitoring and risk early warning system based on digital twins and AI, provided in an embodiment of this application. As shown in the figure, the system includes: The residual generation module 501 is used to compare the synchronously acquired data with the power flow calculation results and generated reference quantities of the digital twin power grid model node by node and branch by branch under the same time slice to generate residual vectors. The influence relationship matrix construction module 502 is used to calculate the influence relationship of parameter disturbance on the residual vector based on the power flow Jacobian matrix, branch power balance relationship and upstream and downstream power conservation relationship, and construct the influence relationship matrix. The difference attribution module 503 is used to divide the difference causes into multiple cause groups, solve the perturbation variables of each cause group by weighted least squares estimation combined with sparse group constraints, and determine the confidence level of each cause group based on the perturbation variables. The model correction and labeling module 504 is used to correct the digital twin power grid model according to the confidence level, update the data confidence of each node, and label the confidence of historically collected samples. The load prediction module 505 is used to train a load prediction model with historical collected samples labeled with the confidence level. The load prediction model outputs the predicted median, upper prediction limit and lower prediction limit for each node. The risk ranking module 506 is used to generate representative operating conditions based on the predicted median, upper limit, lower limit and the data confidence level, perform power flow calculation on each representative operating condition, count the frequency and magnitude of exceeding the limit, and obtain the risk ranking.

[0088] Each processing unit and / or module in the embodiments of this application can be implemented by an analog circuit that implements the functions described in the embodiments of this application, or by software that executes the functions described in the embodiments of this application.

[0089] Please see Figure 6 It shows a schematic diagram of the structure of an electronic device according to an embodiment of this application, which can be used to implement... Figure 1 The method in the illustrated embodiment. (As shown) Figure 6 As shown, the electronic device may include: The system includes at least one processor 601, at least one network interface 604, a user interface 603, a memory 605, and at least one communication bus 602. The communication bus 602 is used to enable connection and communication between the components. The user interface 603 may include buttons, and optionally include a standard wired or wireless interface. The network interface 604 may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, etc.

[0090] The processor 601 may include one or more processing cores and connect to various parts within the electronic device through various interfaces and lines. It implements various functions and data processing of the electronic device by running or executing instructions, programs, code sets, or instruction sets stored in the memory 605, and by accessing data in the memory 605. Optionally, the processor 601 may be implemented using at least one hardware form of DSP, FPGA, or PLA. The processor 601 may also integrate one or more combinations of CPU, GPU, and modem.

[0091] Memory 605 may include random access memory (RAM) or read-only memory (ROM). Optionally, memory 605 includes a non-transitory computer-readable medium for storing instructions, programs, code, code sets, or instruction sets. Memory 605 may be divided into a program storage area and a data storage area, wherein the program storage area can be used to store instructions for implementing an operating system and instructions for implementing the foregoing method embodiments; the data storage area can be used to store data related to the relevant method embodiments. Memory 605 may also be at least one storage device located remotely from processor 601. Figure 6 As shown, the memory 605, which serves as a computer storage medium, may contain an operating system, a network communication module, a user interface module, and program instructions.

[0092] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by processor 601, it performs the functions defined in the methods of this application.

[0093] Another embodiment of this application provides a storage medium storing computer program instructions thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application.

[0094] In the above embodiments, the descriptions of each embodiment have different focuses. Parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments. The above descriptions are merely preferred embodiments of this application and explanations of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by specific combinations of the above technical features, but should also cover other technical solutions formed by arbitrary combinations of the above technical features or their equivalent features without departing from the inventive concept.

Claims

1. A power grid monitoring and risk early warning method based on digital twins and AI, characterized in that, include: Under the same time slice, the synchronously collected data is compared with the power flow calculation results and generated reference quantities of the digital twin power grid model node by node and branch by branch to generate residual vectors; Based on the power flow Jacobian matrix, branch power balance relationship and upstream and downstream power conservation relationship, the influence relationship of parameter disturbance on the residual vector is calculated, and the influence relationship matrix is ​​constructed. The causes of difference are divided into multiple cause groups. By combining weighted least squares estimation with sparse group constraints, the perturbation variables of each cause group are solved using the residual vector and the influence relationship matrix. The confidence level of each cause group is determined based on the perturbation variables. The digital twin power grid model is corrected based on the confidence level, the data confidence level of each node is updated, and the confidence level of historically collected samples is labeled. The load prediction model is trained using historical samples labeled with the aforementioned confidence level. The load prediction model outputs the predicted median, upper limit, and lower limit for each node. Representative operating conditions are generated based on the predicted median, upper limit, lower limit, and data reliability. Power flow calculations are performed on each representative operating condition to count the frequency and magnitude of limit violations, and a risk ranking is obtained.

2. The method according to claim 1, characterized in that, The components of the residual vector include the voltage residual of each node, the current residual of each branch, the active power residual, the reactive power residual, the line loss residual determined by the power difference between adjacent nodes or branches, and the harmonic residual determined by the measured harmonic components and the model harmonic reference value.

3. The method according to claim 1, characterized in that, The multiple cause groups include measurement device magnification or phase deviation, inconsistent switch or contact point status, line impedance or transformer parameter deviation, local abnormal load, suspected electricity theft load, and abnormal loss caused by increased contact resistance; each column in the influence relationship matrix corresponds to the response mode of a disturbance variable on each component of the residual vector, and the same cause group corresponds to one or more columns of response modes, which constitute the response submatrix of the cause group.

4. The method according to claim 1, characterized in that, In the weighted least squares estimation, each component of the residual vector is assigned a weight. The weight is determined based on the stability index of the corresponding acquisition device, the consistency index among similar measurements, the time synchronization quality index, and the historical error level. It is automatically calculated by the statistical analysis of the acquired data and updated as new acquired data accumulates.

5. The method according to claim 1, characterized in that, The sparse group constraint is achieved by adding a group sparse regularization term to the objective function; the objective function includes a weighted residual fitting term and the group sparse regularization term; the weighted residual fitting term is the weighted sum of squares of the differences between each component of the residual vector and the product of the influence relationship matrix and the perturbation variable; the group sparse regularization term is the product of the sum of the L2 norms of the perturbation variable subvectors corresponding to each cause group and the regularization coefficient; the regularization coefficient is adaptively selected according to the overall magnitude of the residual vector and the number of cause groups.

6. The method according to claim 1, characterized in that, When solving for the perturbation variables of each cause group, a consistency check between adjacent time slices is introduced: the perturbation variables of each cause group are used as state vectors, and the residual vectors are used as observations to establish a state-space model; a process noise variance is set for each cause group, wherein the process noise variance of the slow-changing cause group is less than that of the fast-changing cause group; when each time slice arrives, the prediction step and update step of Kalman filtering are performed to obtain the time-smoothed estimate of the perturbation variables of each cause group; the confidence level of each cause group is determined based on the time-smoothed estimate.

7. The method according to claim 1, characterized in that, The step of correcting the digital twin power grid model based on the confidence level includes: For measurement device deviation cause groups with confidence levels higher than a preset threshold, the data confidence level of the corresponding measurement point is reduced, and the reduction magnitude is positively correlated with the estimated deviation of the measurement point and the confidence level. For the group of reasons for inconsistency in topology state with a confidence level higher than a preset threshold, enumerate the candidate topology state of the corresponding switch or tie point, re-perform power flow calculation for each candidate topology state, and select the candidate topology state with the smallest overall residual error to update the digital twin power grid model. For the group of device parameter deviation reasons with a confidence level higher than the preset threshold, output the device parameters to be checked and their estimated deviation range.

8. The method according to claim 1, characterized in that, The confidence labeling of historical collected samples includes: for historical time slices where the confidence level indicates that the residuals are caused by measurement device deviations, or for historical time slices where the topology inconsistency cannot be explained and the correct topology cannot be determined, the collected values ​​of the affected measurement points are labeled as low-confidence samples, and the low-confidence samples are assigned a sample weight greater than 0 and less than 1 in the training loss calculation of the load prediction model; for historical time slices where the confidence level indicates that the residuals are explained by abnormal loads or suspected electricity theft, the corresponding samples are labeled as abnormal scenario samples and separated from the normal load training set.

9. The method according to claim 1, characterized in that, The load forecasting model adopts a time-series fusion transformer structure. The input features of the load forecasting model include the historical load sequence of each node, meteorological data, holiday identifiers, and the reliability of the data. The temporal fusion transformer structure includes a variable selection network, a gated residual network, a long short-term memory (LSM) encoder and a LSM decoder, a multi-head attention mechanism layer, and a quantile output layer. The variable selection network evaluates the importance of the input features and outputs feature selection weights. The LSM encoder encodes the historical time-varying feature sequence processed by the variable selection network and outputs a hidden state sequence. The LSM decoder uses the hidden state at the end of the encoder as the initial state and decodes future known time-varying features. The multi-head attention mechanism layer uses the hidden state of the decoder as the query and the hidden state of the encoder as the key and value to generate an attention output. The quantile output layer maps the attention output to the predicted median, upper prediction limit, and lower prediction limit, respectively.

10. A power grid monitoring and risk early warning system based on digital twins and AI, characterized in that, include: The residual generation module is used to compare the synchronously acquired data with the power flow calculation results and generated reference quantities of the digital twin power grid model node by node and branch by branch under the same time slice to generate residual vectors. The influence relationship matrix construction module is used to calculate the influence relationship of parameter disturbance on the residual vector based on the power flow Jacobian matrix, branch power balance relationship and upstream and downstream power conservation relationship, and construct the influence relationship matrix. The difference attribution module is used to divide the difference causes into multiple cause groups, and solve the perturbation variables of each cause group by weighted least squares estimation combined with sparse group constraints, using the residual vector and the influence relationship matrix, and determine the confidence level of each cause group based on the perturbation variables; The model correction and labeling module is used to correct the digital twin power grid model according to the confidence level, update the data confidence of each node, and label the confidence of historically collected samples. The load forecasting module is used to train a load forecasting model with historical collected samples labeled with the confidence level. The load forecasting model outputs the predicted median, upper limit, and lower limit for each node. The risk ranking module is used to generate representative operating conditions based on the predicted median, upper limit, lower limit and the data confidence level, perform power flow calculations on each representative operating condition, count the frequency and magnitude of exceeding the limit, and obtain the risk ranking.