Intelligent power grid state monitoring method and system based on digital twinning

By using a semi-supervised learning model and Bayesian network optimization, a digital twin model of the power grid is constructed, which solves the problem of insufficient adaptability of traditional methods in complex scenarios and realizes accurate risk assessment and reliable decision support for smart grid state monitoring.

CN121998416APending Publication Date: 2026-05-08HUBEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUBEI UNIV OF TECH
Filing Date
2026-01-14
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Traditional smart grid condition monitoring methods based on digital twins cannot adapt to complex and ever-changing operating scenarios, resulting in an inability to accurately reflect the actual operating status of the power grid, thus limiting the adaptability of condition monitoring and the effectiveness of risk warning.

Method used

A semi-supervised learning model is used to generate scene labels and model templates. By combining association rule mining to optimize the Bayesian network, a digital twin model of the power grid is constructed. Abnormal paths are identified through causal scoring and the independent risk values ​​of equipment are calculated to generate a comprehensive risk value for the smart grid.

Benefits of technology

It improves the robustness of scene recognition and the accuracy of risk assessment, supports smart grid status monitoring and operation and maintenance decisions, and provides intuitive visualization results and reliable decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998416A_ABST
    Figure CN121998416A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent power grid state monitoring method and system based on digital twinning, and the method comprises the steps: firstly generating a scene label based on a semi-supervised learning model according to collected power grid data, and generating a model template matched with the scene label according to the scene label and a semi-supervised learning model template library; constructing a power grid digital twinborn model based on the model template, and generating an abnormal path set based on the power grid digital twinborn model; calculating an independent risk value of a single power grid device based on the abnormal path set; and finally, generating a comprehensive risk value of the intelligent power grid according to the independent risk value of each power grid device. According to the method, seamless conversion from equipment-level risks to system-level risks is ensured, and visual and reliable decision support is provided for state monitoring of the intelligent power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of power grid monitoring technology, and relates to a smart grid condition monitoring method and system, particularly a smart grid condition monitoring method and system based on digital twins. Background Technology

[0002] With the continuous expansion of the smart grid's scale and the increasing complexity of its operation, real-time status monitoring and risk early warning of grid equipment have become core requirements for ensuring the safe and stable operation of the power system. Digital twin technology, with its precise mapping and simulation capabilities of physical systems, has been widely applied in the field of smart grid status monitoring. By integrating multi-source information such as meteorological data, load data, and equipment status data, it constructs a virtual model synchronized with the physical grid, providing support for operational status analysis and anomaly early warning. In this process, scene identification based on multi-source grid data and matching corresponding digital twin model templates is a key prerequisite for achieving efficient monitoring. Its core lies in the precise docking of scene tags with the template library to quickly construct a simulation model that fits actual operating conditions.

[0003] Traditional smart grid condition monitoring methods based on digital twins first collect multi-source data during the grid operation process, obtain corresponding scene labels through data processing and feature extraction, then compare the scene labels with a pre-built model template library one by one, and then directly call the corresponding model template in the library to complete the construction of the digital twin model based on the template, and then carry out subsequent condition simulation and monitoring work.

[0004] However, traditional methods rely solely on predefined fixed templates in template libraries. When the scenario labels obtained through multi-source data belong to new operating scenarios, they cannot generate suitable model templates based on the unique characteristics of the current scenario. This results in a lack of effective basis for the construction of digital twin models, making it difficult to accurately reflect the actual operating status of the power grid. Ultimately, this limits the adaptability of smart grid status monitoring to complex and ever-changing operating scenarios, and makes it impossible to achieve comprehensive and accurate status coverage and risk warning. Summary of the Invention

[0005] To address the aforementioned technical issues, this invention provides a smart grid status monitoring method and system based on digital twins. By combining association rule mining to optimize the Bayesian network and integrating equipment risks to obtain a comprehensive risk value, the robustness of scene recognition and the accuracy of risk assessment are improved, effectively supporting smart grid status monitoring and operation and maintenance decisions.

[0006] The technical solution adopted by the method of the present invention is: a smart grid condition monitoring method based on digital twins, comprising the following steps: Step 1: Generate scene labels based on the collected power grid data using a semi-supervised learning model, and generate model templates that match the scene labels based on the scene labels and the semi-supervised learning model template library; Step 2: Construct a digital twin model of the power grid based on the model template, and generate a set of abnormal paths based on the digital twin model of the power grid; Step 3: Calculate the independent risk value of individual power grid equipment based on the abnormal path set; Step 4: Generate a comprehensive risk value for the smart grid based on the independent risk values ​​of each of the aforementioned power grid devices.

[0007] Preferably, in step 1, the semi-supervised learning model consists of an input processing module, a feature extraction module, a dynamic threshold self-training module, a prototype consistency constraint module, and an output layer. The input processing module receives scene feature vectors and applies standardization and data augmentation techniques to generate diverse input views. The feature extraction module, based on a deep neural network, maps the input data to a high-dimensional feature space and extracts semantic features. The dynamic threshold self-training module integrates the STDCT algorithm, including a confidence calculator and a threshold adjuster. The confidence calculator evaluates the predictive certainty of unlabeled samples, and the threshold adjuster dynamically updates the confidence threshold to adapt to the current training state. The prototype consistency constraint module applies consistency constraints by calculating the similarity between unlabeled samples and prototypes to ensure prediction reliability. The output layer uses fully connected layers and the Softmax activation function to generate a class probability distribution for final prediction.

[0008] Preferably, in step 1, the scene label is compared with the label set in the semi-supervised learning model template library to determine whether there is a template that matches the scene label; the semi-supervised learning model template library is pre-built by expert experience and contains several basic model templates, each model template being associated with a specific scene label; If so, the corresponding template is called from the semi-supervised learning model template library as the model template for the scene label; If not, the scene feature vector is mapped to a high-dimensional encoded representation based on the semi-supervised learning model. The similarity between the high-dimensional encoded representation and the prototype vectors of each template in the semi-supervised learning model template library is calculated. The model template with the highest similarity is selected as the transition template. A temporary template is generated based on the transition template and used as the model template that matches the scene label.

[0009] Preferably, in step 2, a state vector set is constructed based on the power grid digital twin model; the causal influence intensity between device nodes is generated according to the state vector set and a preset causal scoring function, and a directed causal graph is generated; abnormal nodes are identified, and in the directed causal graph, the influence path is traced backward from each abnormal node, and the abnormal influence intensity of each influence path is calculated; an abnormal path set is generated according to the abnormal influence intensity.

[0010] Preferably, the causal scoring function is: ; in, Represents a node right The strength of the causal influence; Real-time state variables and The mutual information between them is used to measure nonlinear dependencies and is estimated by the multi-time state sequence within a historical sliding window. It is the ratio of the current temperature rise of the equipment to its upper operating limit. It is a node The maximum permissible temperature rise value is obtained from the equipment specifications or historical safety thresholds; It is the L1 distance of the state difference, representing the degree to which the node state deviates from the stable coupling relationship; It is a node The historical average operating status value is obtained from long-term operating data. It is a very small constant used to avoid the denominator being zero; , , It is a weighting factor that controls the balance between mutual information strength, temperature rise risk sensitivity, and state deviation penalty.

[0011] Preferably, in step 3, for each power grid device, all individual abnormal paths containing that power grid device are selected from the abnormal path set; based on the individual abnormal paths, the independent risk value of the corresponding power grid device is calculated using a weighted aggregation method. The abnormal path set includes a path list, the device nodes involved in the path, and the abnormal impact intensity η(p) value of each path. ;in, This represents the product of the weights of all causal edges in path p; is the causal edge weight, representing the strength of the influence of node u on node v; j is the index of the endpoint node; It is the end node of the path. The current status value is read from real-time monitoring data; and These are the path endpoint nodes. The historical mean and standard deviation are statistically obtained from long-term operating data and are used to standardize the degree of anomalies. For each device node Its weighted risk value Where p is a single abnormal path; It is a device index; It includes all devices The set of abnormal paths, that is, selecting those abnormal paths from the set that meet the criteria. The set of paths p ∈ p; It is equipment The position weights in path p are used to adjust the contribution of η(p). Based on the device's role definition in the path, the rules are defined as follows: If the device If the endpoint of path p is [the position weight], then [the position weight] is [the position weight]. =1 indicates full contribution; If the device If it is the starting point of path p, then the position weight... =γ, where γ is the starting point weighting factor, 0<γ<1, reflecting the secondary nature of the source risk; If the device If it is the midpoint of path p, then the position weight... =δ, where δ is the intermediate point weighting factor, 0<δ<γ, reflecting the weak contribution of the risk transmission.

[0012] Preferably, in step 4, the independent risk value of each of the power grid devices is mapped to a discrete risk state; the discrete risk states are input into the optimized Bayesian network to calculate and generate the comprehensive risk value of the smart grid. The optimized Bayesian network is optimized in terms of structure and parameters by introducing association rule data mining technology. Association rule mining extracts strong dependencies between devices from historical data and calculates the support of rules using the Apriori algorithm. and confidence level ;in, It is a rule Support represents the frequency with which events X and Y occur simultaneously. It is an association rule, which represents the dependency relationship between events X and Y; It represents the number of times events X and Y occur simultaneously in historical data, and M is the total amount of data. It is a rule The confidence level represents the probability of event Y occurring given that event X has occurred; This represents the total number of times event X occurs; support and confidence are used to identify strongly associated rules, converting rules with confidence scores above a threshold into directed edges in the Bayesian network; during the parameter assignment phase, the frequent itemsets mined from the association rules guide the initialization of the conditional probability table, which is then optimized through Bayesian learning; Bayesian learning updates the parameters using posterior probabilities, as shown in the formula: ;in, It is the posterior probability, representing the parameter given the observed data D. The probability distribution; It is the likelihood function, representing the likelihood of the parameter The probability of observing data D; D is the parameter to be estimated; D is the training data, i.e., historical equipment status and fault records; P( ) is the prior distribution of the parameters, representing the parameters. The initial belief; P(D) is the marginal probability, representing the total probability of data D, and serves as a normalization function.

[0013] Preferably, in step 4, risk fusion calculation is performed based on the optimized Bayesian network; the independent risk values ​​are then... As evidence variables input into the network, the comprehensive risk value of the smart grid is calculated through Bayesian inference; Bayesian inference updates node probabilities based on Bayes' theorem.

[0014] Where N is the total number of devices, This represents the independent risk value of the k-th device; It is the comprehensive risk value of the smart grid, i.e., the posterior probability, which represents the probability of event A occurring under the condition of observed evidence B; It is the likelihood probability, representing the probability of observing evidence B under the condition that a system failure occurs, derived from the conditional probability table; A represents the system's overall risk event; B is the set of observed equipment risk evidence, i.e., the equipment's independent risk value. The mapped discrete state; P(A) is the prior probability, representing the initial probability of event A, obtained from historical system failure data statistics; P(B) is the marginal probability of evidence B, calculated as... The inference output is the posterior probability. This refers to the comprehensive risk value of the smart grid, which quantifies the overall risk level of the system.

[0015] The technical solution adopted by the system of this invention is: a smart grid condition monitoring system based on digital twins, comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the digital twin-based smart grid condition monitoring method.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) This invention generates scene labels based on the collected power grid data using a semi-supervised learning model, and generates model templates that match the scene labels based on the scene labels and the model template library. This enables the full utilization of the effective information of unlabeled samples in the multi-source power grid data, calculates the membership degree of samples and the dynamic confidence threshold to filter high-confidence pseudo-label samples, and gradually expands the scale of training data. It can also effectively filter noise pseudo-labels by introducing the consistency constraint between semantic prototype and prediction prototype in the semi-supervised learning model and using the prototype vector generated by labeled samples to correct the prediction results of unlabeled samples. (2) This invention constructs a digital twin model of the power grid based on the model template, and generates an abnormal path set based on the digital twin model of the power grid; constructs an initial Bayesian network, optimizes the initial Bayesian network, and generates an optimized Bayesian network, thereby mapping the independent risk values ​​of each device in the power grid to discrete state variables through the Bayesian network fusion algorithm, constructing a network structure that reflects the risk dependence relationship between devices, and using probabilistic reasoning to integrate the impact of individual device risks on the overall power grid. (3) Based on each individual abnormal path, this invention calculates the independent risk value of the corresponding power grid equipment using a weighted aggregation method. The visualization is presented in the form of heatmaps or probability distribution maps, for example, using the Echarts library to generate an interactive graphical interface. The visualization results also support drill-down analysis, such as clicking on equipment nodes to view detailed risk factors, which facilitates maintenance personnel in identifying high-risk areas and formulating response strategies. The entire process ensures a seamless transition from equipment-level risk to system-level risk, providing intuitive and reliable decision support for smart grid status monitoring; (4) This invention constructs a semi-supervised learning model that integrates self-training algorithms and prototype consistency constraints to accurately classify power grid operation scenarios and reduce data labeling costs; it matches the model template library and generates an adaptive temporary template when there is no match to adapt to complex and new scenarios; it constructs a digital twin model based on the template, identifies abnormal paths through causal scoring, and calculates the independent risk value of the equipment; it combines association rule mining to optimize the Bayesian network and integrates equipment risks to obtain a comprehensive risk value; the solution improves the robustness of scenario identification and the accuracy of risk assessment, and effectively supports the status monitoring and operation and maintenance decision-making of smart grids. Attached Figure Description

[0017] The technical solutions of the present invention will be further illustrated below using embodiments and specific implementation methods. In addition, some accompanying drawings are used in the description of the technical solutions. Those skilled in the art can obtain other drawings and the intent of the present invention from these drawings without any creative effort.

[0018] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention; Figure 2 This is a diagram of the network structure of a semi-supervised learning model according to an embodiment of the present invention; Figure 3 This is a Bayesian network structure diagram according to an embodiment of the present invention. Detailed Implementation

[0019] To facilitate understanding and implementation of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0020] Please see Figure 1 This embodiment provides a smart grid status monitoring method based on digital twins, which includes the following steps: Step 1: Generate scene labels based on the collected power grid data using a semi-supervised learning model, and generate model templates that match the scene labels based on the scene labels and the semi-supervised learning model template library; In one implementation, power grid data, including multi-source operational data, is collected to construct a scene feature vector. The multi-source operational data includes the following: Meteorological data, obtained from regional meteorological stations, includes parameters such as ambient temperature, humidity, and wind speed, denoted as vector w; Load data is acquired from the acquisition module of the main substation, including parameters such as active power, reactive power, and three-phase imbalance, denoted as vector l; Equipment status data, including temperature, voltage, and current, is acquired through sensors deployed in key equipment such as transformers and busbars, and is denoted as a vector. .

[0021] For the above subvectors w, l, Data standardization was performed separately to eliminate the impact of differences in physical units and numerical ranges on model training. The standardized sub-vectors were then concatenated to construct the scene feature vector. The standardization process employs the Z-score standardization method, and its calculation formula is as follows:

[0022] Where v is the original data vector, taking values ​​from three sub-vectors; μ is the mean of the historical data of the three sub-vectors; and σ is the standard deviation of the historical data of the three sub-vectors. It is a standardized data vector.

[0023] A scene feature vector is constructed by concatenating the data after standardization. Its expression is as follows:

[0024] Where [;] represents the vertical concatenation operation of vectors; It is a d-dimensional vector, which serves as the input to the subsequent semi-supervised learning model; It is standardized meteorological data w;l It is the standardized load data; It is standardized equipment status data. .

[0025] In one implementation, a scene feature vector is first generated based on the collected power grid data. Then, a semi-supervised learning model is constructed based on a dynamic confidence threshold self-training algorithm. Finally, the scene feature vector is input into the trained semi-supervised learning model to output a scene label for the current operating scene of the power grid.

[0026] The algorithm design integrates self-training and consistency constraints, with the process proceeding iteratively. The semi-supervised learning model is built based on the dynamic confidence threshold self-training algorithm STDCT, and incorporates prototype consistency constraints to improve robustness.

[0027] In one implementation, please see Figure 2 The semi-supervised learning model's structural design includes several hierarchical components to ensure efficient processing of semi-supervised learning tasks. The overall framework consists of an input processing module, a feature extraction module, a dynamic threshold self-training module, a prototype consistency constraint module, and an output layer.

[0028] The input processing module is responsible for receiving scene feature vectors, applying standardization and various data augmentation techniques to generate diverse input views, and enhancing the model's generalization ability. The feature extraction module, based on a deep neural network architecture (such as a convolutional neural network), uses a semantic encoder to map the input data to a high-dimensional feature space and extract semantic features. This module typically contains multiple convolutional and pooling layers to capture local and global patterns; among them, the semantic encoder... It adopts an N-layer fully connected neural network structure, including an input layer containing dimensions and scene feature vectors. Consistent; Hidden layers: specific number of layers and neurons, such as 256-128-64; Activation function: such as ReLU; Output layer: dimension d (e.g., 128-dimensional). Encoder parameters θ are learned through optimization algorithms during model training.

[0029] The dynamic threshold self-training module integrates the STDCT algorithm, including a confidence calculator and a threshold adjuster. The confidence calculator evaluates the predictive certainty of unlabeled samples, and the threshold adjuster dynamically updates the confidence threshold to adapt to the current training state. The prototype consistency constraint module maintains a set of scene feature vectors (one for each category), representing the category feature centers. This module applies consistency constraints by calculating the similarity between unlabeled samples and prototypes to ensure prediction reliability. The output layer uses a fully connected layer and a Softmax activation function to generate a class probability distribution for final prediction.

[0030] In one implementation, the semi-supervised learning model is a pre-trained model; the training process is as follows: First, data preprocessing is performed, loading labeled and unlabeled datasets, applying normalization, and dividing the dataset into training batches. Data augmentation strategies are then applied to generate augmented views.

[0031] Next, model initialization is performed, randomly initializing the parameters of the feature extraction network and the output layer. The prototype vector is initialized based on the feature mean of the labeled samples, represented as: ; in, h refers to the prototype vector of category k; It is a sample Feature representation; It is the set of samples belonging to category k.

[0032] Then, the training loop is performed, with the specific steps being forward propagation, loss calculation, and backpropagation and optimization, as follows: Forward propagation involves inputting batch data, extracting features through a feature extraction module, and then generating predictions through the output layer. Loss calculation combines supervised loss, unsupervised loss, and prototype consistency loss. Backpropagation and optimization use gradient descent algorithms (such as stochastic gradient descent) to update parameters and minimize the total loss.

[0033] The optimization process is as follows ;in, These are model parameters; This represents the state of the model parameters at the current t-th iteration; This indicates the state of the model parameters in the next iteration, i.e., the (t+1)th iteration. The learning rate, verified through multiple rounds of experiments on the IEEE 118-node dataset, shows that when using the Adam optimizer in conjunction with a cosine annealing scheduling strategy, the initial value of the learning rate is set to... = 0.01; It is the total loss function with respect to all model parameters. gradient

[0034] After each training round, the prototype vector is recalculated based on the features of the currently labeled samples to ensure that it represents the latest class distribution.

[0035] Finally, a convergence check is performed, and the training loop is repeated until the loss function converges or the maximum number of iterations is reached. The entire process supports batch processing, improving computational efficiency.

[0036] After training the semi-supervised learning model, use the semi-supervised model to obtain scene labels. First, for unlabeled samples... Calculate its membership degree This indicates that the sample belongs to the category. The probability of membership. Membership degree calculation formula. ,in, It is the membership degree, i.e., the membership degree of unlabeled samples. Belongs to category The probability of; It is a sample Belongs to category The posterior probability is calculated by the membership function f; It is a sample Belongs to category The posterior probability; It is a sample The sum of the original membership values ​​for all possible categories is used for normalization; f is the membership function, usually calculated using the normal probability density function; K is the total number of categories (e.g., the number of categories in a power grid scenario, typically 5-8). Sample feature values, prior probability of the category P( The parameters include the conditional probabilities of the features, which are estimated from labeled samples. For example, prior probabilities are calculated using class frequencies, and conditional probabilities are based on the feature mean and variance.

[0037] The membership calculation formula is used to calculate the relative probability of an unlabeled sample belonging to each category, which is used to evaluate the category affiliation of the sample. This is the basis for generating pseudo-labels in self-training algorithms, helping to filter high-confidence samples.

[0038] Next, the confidence level of the sample is calculated. To assess the certainty of classification, among which, It is an unlabeled sample The confidence level reflects the certainty of the classification; and These are membership degrees. The confidence score is the maximum and second-largest value. This confidence score formula reflects the clarity of sample classification; high confidence indicates that the sample is easy to classify, while low confidence may be located on the decision boundary.

[0039] Then, a dynamic confidence threshold is introduced. To control sample selection, the threshold changes with the current iteration round t; where, It is the dynamic confidence threshold; t is the current iteration round; 'a' and 'a' are hyperparameters (usually...) =1, a=0.98); R( ) is the range of confidence scores for all unlabeled samples in the current iteration, which is the maximum value minus the minimum value; This is the mean confidence score of all unlabeled samples in the current iteration; these statistics are calculated in real-time from the current batch of samples. This dynamic confidence threshold is used to control sample selection; the dynamic threshold is higher in the early stages of training to rigorously screen samples, and gradually decreases in later stages to utilize more samples.

[0040] Building upon the basic framework, a prototype consistency constraint is incorporated, using a prototype of labeled samples to correct predictions for unlabeled samples. The prototype includes a semantic prototype (the average of the sample embedding features) and a predictive prototype. The mean of the predicted distribution is generated from labeled samples and stored in a memory buffer, and updated periodically. For unlabeled samples, the prototype consistency loss is calculated. ;in, It is a loss of prototype consistency; is the batch size of the unlabeled samples, b is the number of the unlabeled sample, i.e., the b-th unlabeled sample; i is the category index of the most similar semantic prototype; j is the category index of the most similar predicted prototype. It is an indicator function; its value is 1 when the condition is true, and 0 otherwise. It is a predictive prototype The predicted category, i.e. the category with the highest probability; H() is the cross-entropy loss function; is the predicted distribution of unlabeled samples under strong data augmentation; b is the number of the unlabeled sample, i.e., the b-th unlabeled sample; The most similar predicted prototype is selected from the predicted prototypes of labeled samples based on similarity. An indicator function ensures that the loss is calculated only if the true category and predicted category of the semantic prototype are consistent. Parameters, such as the prototype vector, are updated online from labeled samples, and similarity is calculated using cosine similarity.

[0041] Total loss function Combining supervised loss, unsupervised loss, and prototype consistency loss, it is defined as: ; ; in, It is a supervised loss method that uses cross-entropy to calculate the error between the prediction and the true label of a labeled sample. It is an unsupervised loss, based on the cross-entropy loss of high-confidence pseudo-labels; It is the predicted distribution of weak data augmentation samples; It is the confidence threshold (e.g., 0.95); and It refers to the weight hyperparameter, the unsupervised loss weight. The range is between 0.5 and 2. Initial value. =1, and the weights fluctuate based on the model's dependence on pseudo-labels; Prototype consistency loss weights Less than or equal to The range is between 0.1 and 1, with an initial value. =1. This loss design ensures the model's generalization ability on power grid data.

[0042] Ultimately, the scene feature vector The input is fed into a semi-supervised learning model, which outputs the probability distribution for each category. The scene label is obtained through the argmax operation. Where S is the output scene label; It is the model's predicted feature vector. The probability of belonging to category k; This is the preset number of categories. The model is reused in subsequent step S2 to generate temporary templates based on scene labels, thus emphasizing lightweight design and adaptability. Sample utilization efficiency is optimized through dynamic thresholding and prototype consistency.

[0043] This step, as the initial stage of the entire smart grid condition monitoring process, has the core function of collecting multi-source data (including meteorological, load, and equipment status information) from the power grid operating environment, constructing scene feature vectors, and then using a semi-supervised learning model that integrates dynamic confidence thresholds and prototype consistency constraints to classify scenes, ultimately outputting accurate operating scene labels.

[0044] This step not only enables intelligent perception and classification of the current power grid operating environment, but also optimizes the model's generalization ability under limited labeled data through dynamic threshold mechanism and prototype consistency, ensuring the robustness and accuracy of scene recognition.

[0045] The scene labels output in this step are key inputs for subsequent steps, driving the selection of basic digital twin model templates and parameter adaptation. This provides fundamental support for the dynamic modeling and anomaly monitoring of the entire digital twin system, enabling the system to adapt to different operating conditions and improving the efficiency and reliability of subsequent causal analysis and risk warning.

[0046] In one implementation, the scene label is compared with a label set in a semi-supervised learning model template library to determine whether there is a template that matches the scene label; If so, the corresponding template is called from the semi-supervised learning model template library as the model template for the scene label; If not, the scene feature vector is mapped to a high-dimensional encoded representation based on the semi-supervised learning model. The similarity between the high-dimensional encoded representation and the prototype vectors of each template in the semi-supervised learning model template library is calculated. The model template with the highest similarity is selected as the transition template. A temporary template is generated based on the transition template and used as the model template that matches the scene label.

[0047] The model template library is pre-built based on expert experience and contains multiple basic model templates. Each model template is associated with a specific scene label, and this library is referred to as the model template library. ,in These are scene tags (such as high temperature and high load, thunderstorm warning, etc.). It is related to scene tags The corresponding model template consists of a set of device nodes V and a set of connection edges E, representing the basic structure of the digital twin model in this scenario. K is the total number of model templates. These model templates are defined based on historical operating data and domain knowledge and are used to cover typical power grid scenarios.

[0048] The matching process first compares the scene label S with the label set in the model template library. , ,…, } Compare. If there exists an index k such that scene label S = Then directly call the corresponding model template G= This model template serves as the basis for subsequent digital twin instantiation. Upon successful matching, the model template... It already includes predefined device node parameters and physical connection relationships, and can be directly applied to the current scenario.

[0049] When a match fails, meaning the scene label S is not in the model template library, a temporary template needs to be generated based on the semi-supervised learning model. In this case, the feature extraction capability of the semantic encoder in the semi-supervised learning model is utilized to extract the scene feature vector. Mapping to high-dimensional encoded representation This is to capture the deep characteristics of a scene. Specifically, high-dimensional encoding representation... The calculation formula is obtained through the semantic encoder of the model: ; in, It is a scene feature vector; It is a scene feature vector The high-dimensional encoding representation is a d-dimensional vector that condenses the deep features of the power grid scenario; It is the encoder function, responsible for feature extraction; These are the model parameters, learned during the training process in step 1. High-dimensional encoding representation. The dimensions are consistent with the encoder output (such as 128-dimensional or 256-dimensional), which encapsulates the comprehensive characteristics of meteorological, load, and equipment status information.

[0050] Next, we compute the high-dimensional encoded representation. With each template prototype vector in the model template library The similarity is used to select the most suitable temporary template. Template prototype vector Representing scene tags Typical characteristics of the corresponding scenario; The formula is calculated by averaging the sample codes belonging to this scenario in historical data: ; in, It is the template prototype vector of the k-th scene, a d-dimensional vector representing the scene label. Typical feature centers corresponding to the scene; It is the high-dimensional encoded representation of the i-th sample; The scene labels in the training set are A set of samples, containing high-dimensional encoded representations of multiple samples. ;∣ | represents the number of samples. Template prototype vector. Dimensionality and high-dimensional encoding representation Similarly, it calculates and stores data offline from historical operational data.

[0051] The similarity is measured using cosine similarity, and the formula is: ; in, It is a high-dimensional encoded representation of the current scene. and the template prototype vector of the kth scene The cosine similarity between them has a range of [-1, 1], and the larger the value, the more similar they are; Represents the vector dot product. This represents the L2 norm.

[0052] Based on the similarity results, the model template with the highest similarity is selected as the transition template, i.e., the transition template. ,in It is the index of the selected model template, corresponding to the scene with the highest similarity. ; This is a parameter operation that retrieves the maximum value; It is a model template index.

[0053] Selected transition template It inherits the topology of its source scene, but its internal device parameters need to be represented by high-dimensional encoding based on the current scene. Dynamic adjustments are made to generate a temporary template for final use. This adaptation process is achieved through a parameterized adaptation function. The specific process is as follows: Set transition template The original parameter set of a certain device i is The adapted temporary template. The new parameter set P(i) of the device is given by the following formula: ; Parameter adaptation function The specific form is defined according to the feature-weighted linear scaling strategy, as follows: set up and Let represent the j-th component (representing a specific feature, such as "total load") of the feature vectors of the current scene and the baseline scene, respectively. Then, the adjusted parameter p can be calculated as follows:

[0054] in, α is the baseline parameter; α is the scaling factor, which can be set according to equipment characteristics and engineering experience, α=1.2; It is a smoothing factor. This ensures that the denominator is never zero. For example, this strategy can be used to adjust the node load limit when the current total load is monitored. Higher than the baseline scenario At that time, the load limit of the corresponding upper adjustment point is adjusted.

[0055] Through the above parameter adaptation process, temporary template Inheriting transition templates While offering structural advantages, its internal parameters can accurately reflect the uniqueness of the current scenario, and then a temporary template will be used. As a model template Input is used in subsequent steps. The entire matching and generation process ensures the flexibility of the model template, providing a high-fidelity model foundation for the construction of causal graphs in subsequent steps. At the same time, the feature utilization of the semi-supervised learning model enhances the system's ability to generalize to unknown scenarios.

[0056] This step, a crucial juncture in the smart grid condition monitoring process, plays a key role in achieving the intelligent transformation from scene recognition to model instantiation. This step establishes a dynamic model template matching mechanism to precisely connect the scene labels generated in step 1 with a pre-set expert knowledge base: when a known scene is identified, existing templates are directly invoked to ensure efficiency; when facing an unknown scene, a temporary template generation algorithm based on semi-supervised learning is activated. Through feature encoding, prototype similarity calculation, and adaptive parameter adjustment, a temporary template tailored to the current operating conditions is constructed. This process not only addresses the pain point of traditional fixed templates' insufficient adaptability to new operating scenarios, but more importantly, it provides a structurally standardized and parameter-variable digital twin instance foundation for subsequent steps of causal graph construction and state analysis. This enables the system to perform accurate causal dependency modeling between devices and anomaly propagation path tracing, thereby providing a fundamental guarantee for the reliability and interpretability of the entire monitoring chain.

[0057] Step 2: Construct a digital twin model of the power grid based on the model template, and generate a set of abnormal paths based on the digital twin model of the power grid; In one implementation, based on the model template G (a graph structure consisting of a set of nodes V and a set of edges E, representing the physical connections and operational constraints of power grid equipment) output in step 1, and combined with real-time power grid data (such as state variables of equipment current, voltage, temperature, etc., collected from SCADA systems or sensors, consistent with the data source in step 1), a power grid digital twin model is instantiated and simulated to generate a set of abnormal paths.

[0058] Specifically, real-time data is used to parameterize the model template G, assigning specific operating state values ​​to each node to form a digital twin model of the power grid. For example, for equipment nodes (such as transformers and buses) in the model template, their real-time state variables... (Such as winding temperature and current values) are mapped from real-time monitoring data and normalized to eliminate the influence of dimensions, ensuring that the model instance reflects the actual operating status of the current power grid. This instantiation process transforms the static model template into a dynamic model, providing a foundation for subsequent causal analysis.

[0059] In one implementation, a state vector set is constructed based on the power grid digital twin model; the causal influence strength between device nodes is generated according to the state vector set and a preset causal scoring function, and a directed causal graph is generated; abnormal nodes are identified, and in the directed causal graph, the influence path is traced backward from each abnormal node, and the abnormal influence strength of each influence path is calculated; an abnormal path set is generated according to the abnormal influence strength, thereby realizing the source tracing and propagation path visualization analysis of abnormal states. This step not only improves the accuracy and interpretability of state monitoring, but also provides structured input for trend risk judgment in subsequent steps, ensuring the accuracy of risk warning and response efficiency, and ultimately supporting the closed-loop decision-making of the entire system.

[0060] In this embodiment, a state vector set is constructed based on the power grid digital twin model. ,in Represents a node The real-time state variables (such as temperature, current, etc.) are represented by N, where N is the total number of nodes. The state vector set x encapsulates the overall operational information of the power grid and serves as the input for constructing the causal graph.

[0061] Subsequently, the causal influence strength between device nodes is quantified by a causal scoring function, which is used to transform physical connections in the model template G into weighted directed causal edges.

[0062] The causal scoring function is defined as follows:

[0063] in, Represents a node right The strength of the causal influence; Real-time state variables and The mutual information between nodes is used to measure nonlinear dependencies. It is estimated by the state sequence at multiple time points within a historical sliding window, for example, by using the kernel density estimation method. The larger the value, the stronger the association between nodes. It is the ratio of the current temperature rise of the equipment to its upper operating limit. It is a node The maximum allowable temperature rise value is obtained from the equipment specifications or historical safety thresholds. This ratio reflects the criticality of the node to abnormal states. It is the L1 distance of the state difference, representing the degree to which the node state deviates from the stable coupling relationship; It is a node The historical average operating status value is obtained from long-term operating data. It is a very small constant used to avoid the denominator being zero. = ; , , These are weighting factors that control the balance between mutual information strength, temperature rise risk sensitivity, and state deviation penalty. These hyperparameters are determined through grid search on historical data, with typical values ​​being... =1.2、 =0.6、 =0.4.

[0064] The ReLU activation function on the outer layer of the function ensures that the score is non-negative and only preserves significant causal relationships.

[0065] Generate a directed causal graph based on the causal scoring function. Where V is the set of device nodes, It is an edge set that contains all edges that satisfy... The edge ( This is a preset threshold (e.g., 0.05); edges below this threshold are pruned to maintain the sparsity of the graph structure. Directed causal graph. It inherits the topology of the model template G, but reflects the causal dependency path in real time through dynamic weights, such as the chain reaction that the transformer overheating may cause abnormal feeder current.

[0066] Next, abnormal path identification is performed. An abnormal node set is identified from the current state data. ,in and These are nodes The historical mean and standard deviation were calculated offline based on long-term running data in the training set of step 1, and are consistent with the feature normalization process in step 1. It is the j-th node. It is a node The current real-time status value.

[0067] Abnormal nodes indicate that their state deviates significantly from the historical normal range.

[0068] Combining cause-and-effect diagrams The algorithm executes a maximum path tracing algorithm (such as depth-first search), starting from each anomalous node and tracing backwards to find all possible influencing paths, forming a set of anomalous paths. For each path... Calculate the intensity of its abnormal impact to quantify the risk: ; in, From node arrive The path; It is a path The intensity of the abnormal impact; It is the causal edge weight of the edge (u→v) in the path; It is the product of the weights of all causal edges in the path, representing the efficiency of information transmission. The larger the product value, the stronger the causal chain. This is a standardized value representing the degree of anomaly at the endpoint, reflecting the historical significance of the current state deviation. Anomaly impact strength. The algorithm combines the cumulative causal effect of the path with the level of terminal anomalies; a higher value indicates a greater contribution of the path to system risk. Finally, several paths with the strongest anomaly impact (e.g., Top-K paths, where K is set by the system) are selected as the output set of anomaly paths, along with an intensity index for each path. This set serves as input to step 3 for trend risk assessment, ensuring the coherence and practicality of the entire process.

[0069] Step 3: Calculate the independent risk value of individual power grid equipment based on the abnormal path set; In one implementation, for each power grid device, all individual abnormal paths containing that power grid device are selected from the set of abnormal paths; based on the individual abnormal paths, the independent risk value of the corresponding power grid device is calculated using a weighted aggregation method.

[0070] In this embodiment, based on the abnormal path set generated in step 2, the independent risk value of each power grid device is calculated. The independent risk value is used to quantify the individual risk exposure of the device in the abnormal propagation network.

[0071] The set of abnormal paths contains multiple abnormal causal paths and their corresponding abnormal impact strengths η(p), where the abnormal impact strength η(p) reflects the overall risk level of the path.

[0072] The goal of this step is to aggregate all path risks involving specific devices, generate independent risk indicators for each power grid device, and provide a basis for subsequent risk ranking and early warning.

[0073] Specifically, the abnormal path set includes a path list, the device nodes involved in the path, and the abnormal impact intensity η(p) value of each path. These data come from the cause-effect graph analysis and anomaly identification process in step 3, ensuring the consistency and interpretability of the data.

[0074] First, for each device node Its independent risk value By aggregating all included devices The η(p) value of the abnormal path is used for calculation.

[0075] Independent Risk Value The calculation formula uses a direct summation method and is defined as follows: ; in, Indicates device The independent risk value is indicated by the value; a larger value indicates a higher risk to the device in an abnormal propagation network. p represents a single abnormal path. This is the device index; N is the total number of devices. It includes all devices The set of abnormal paths, that is, selecting those abnormal paths from the set that meet the criteria. The set of paths p ∈ p; η(p) represents the intensity of the anomalous influence of the abnormal path p, derived from the calculation results of S3. Its specific calculation formula is:

[0076] in, This represents the product of the weights of all causal edges in path p, used to measure the efficiency of information transmission; the larger the product value, the stronger the causal chain. These are the causal edge weights, derived from the directed causal graph in step 2. , represents the strength of the influence of node u on node v; j is the index of the endpoint node; It is the end node of the path. The current status value is read from real-time monitoring data; and These are the path endpoint nodes. The historical mean and standard deviation are statistically obtained from long-term operating data and used to standardize the degree of anomaly. The entire η(p) value integrates the cumulative causal effect of the path and the level of anomaly at the endpoint. Its calculation depends on the intermediate results of step 2, ensuring the connection with the previous steps.

[0077] Basic Formulas Simply put all the involved devices The formula simply adds up the risks along the path, without distinguishing the role of each device in the path (e.g., start point, intermediate point, or end point), which may lead to biased risk estimation. For example, intermediate point devices may only transmit anomalies and have a lower actual risk, yet they are accumulated equally; while end point devices, as anomaly accumulation points, have a higher risk but are not emphasized. To solve this problem, a location weighting factor needs to be introduced to optimize the formula.

[0078] Next, a weighted risk formula is used to more accurately reflect the actual risk contribution of equipment in the propagation of anomalies. The location of the equipment in the path affects its risk exposure: the terminal equipment directly bears the accumulation of anomalies and has the highest risk; the starting equipment, as the source of anomalies, has the next highest risk; and intermediate equipment only transmits anomalies and has a relatively low risk.

[0079] Therefore, the weighted risk formula is defined as follows:

[0080] Where η(p) is the influence intensity of the abnormal path p; It is equipment The position weights in path p are used to adjust the contribution of η(p). Based on the device's role definition in the path, the default definition rules are as follows: If the device If the endpoint of path p is the terminating device, then the position weight is... =1 indicates full contribution; If the device If the starting point of path p (i.e., the starting device) is the location weight. =γ, where γ is the starting point weighting factor (0<γ<1, typical value γ=0.6), reflecting the secondary importance of the source risk; If the device If a point is a midpoint of path p (neither the start nor the end point), then the position weight is... =δ, where δ is the intermediate point weighting factor (0<δ<γ, typical value δ=0.4), reflecting the weak contribution of the risk transmission; Weighting factors γ and δ are hyperparameters determined through cross-validation grid search: on a historical failure dataset, with risk prediction accuracy as the objective function, a parameter search is performed within the ranges of γ∈[0.3,0.9] and δ∈[0.1,0.5], selecting the combination that maximizes accuracy to ensure the weights conform to the actual risk distribution. Location weights. The model is generated based on the path topology; γ and δ are derived from historical data, ensuring the model's practicality.

[0081] The weighted formula described above avoids overestimating risk, highlights the core risks of the endpoint equipment, and improves the accuracy and interpretability of the independent risk value.

[0082] Finally, this step outputs a set of independent risk values ​​for each device. Where N is the total number of devices. These risk values ​​can be used for device prioritization, maintenance plan formulation, or real-time early warning triggering, providing direct support for risk management in smart grids. The entire process inherits from the abnormal path analysis in step 2, and achieves risk transformation from the path level to the device level through risk aggregation, ensuring the continuity of the monitoring process.

[0083] This step is a key part of the smart grid condition monitoring process. Its core function is to calculate the independent risk value of each grid device based on the abnormal path set generated in step 2 through weighted aggregation and location weight adjustment, thereby quantifying the individual risk exposure degree of the device in the anomaly propagation network.

[0084] This step not only converts the impact intensity of path-level anomalies into device-level risk indicators, but also optimizes the accuracy of risk estimation by distinguishing the role of devices in the path (such as start point, intermediate point, or end point), avoiding the bias that may be caused by simple summation. The set of independent risk values ​​output by this step provides direct data support for subsequent risk prioritization, early warning threshold setting, and maintenance strategy formulation, ensuring a smooth transition from anomaly identification to risk decision-making throughout the entire monitoring process, and enhancing the system's practicality and response efficiency.

[0085] Step 4: Generate a comprehensive smart grid risk value based on the independent risk value of each of the aforementioned power grid devices, and output the comprehensive smart grid risk value through a visualization interface.

[0086] In one implementation, the independent risk values ​​of each of the power grid devices are mapped to discrete risk states; each of the discrete risk states is input into an optimized Bayesian network to calculate and generate a comprehensive risk value for the smart grid.

[0087] First, the continuous risk value, i.e., the independent risk value of the kth device. The data is mapped to discrete states, which are then used by Bayesian networks for probabilistic reasoning.

[0088] Continuous values ​​are segmented using thresholding, with each segment corresponding to a discrete state. Let... For warning thresholds, Fault threshold ( < The preset discretization rule is as follows: when the independent risk value Warning threshold When the warning threshold is reached, the device is determined to be in normal condition; when the warning threshold is reached... ≤ Independent Risk Value Fault threshold When the independent risk value is [value missing], the device is determined to be in a warning state; When this happens, the equipment is determined to be in a faulty state.

[0089] The threshold needs to be set based on historical data science. For example, a warning threshold... Take the 95th percentile of the risk value of normal equipment in historical data; fault threshold. We take the 5th percentile of the equipment risk value from historical failure cases to avoid the influence of extreme values.

[0090] Subsequently, an optimized Bayesian network structure is constructed, where nodes represent the risk states of devices, and edges represent the risk dependencies between devices. The joint probability distribution of the Bayesian network is then determined. Represented as:

[0091] in, It is the joint probability distribution of the Bayesian network, representing the probability that all node states occur simultaneously; L={ , ,…, } is the set of all nodes in the network, each node A risk status variable representing a device, whose values ​​include discrete states such as "normal", "warning", and "fault". It is a node The set of parent nodes represents other devices that directly affect the risk of this device; P It is a conditional probability, representing the probability distribution of the risk state of the device given the state of the parent node; This refers to the total number of devices. The network structure is determined based on the physical connections and functional dependencies between devices; for example, a transformer failure may increase the risk on connected buses. The parameters in the conditional probability table are learned from historical fault data, such as by calculating prior probabilities through maximum likelihood estimation. and conditional probability P The historical data includes equipment operating status, fault records, and maintenance logs.

[0092] In one implementation, please see Figure 3 The optimized Bayesian network incorporates association rule data mining techniques to optimize its structure and parameters. Association rule mining extracts strong dependencies between devices from historical data, for example, by calculating the support and confidence of rules using the Apriori algorithm. Support is defined as:

[0093] in, It is a rule Support represents the frequency with which events X and Y occur simultaneously. It is an association rule, which represents the dependency relationship between events X and Y; is the number of times events X and Y occur simultaneously in historical data, and M is the total amount of data. Confidence level is defined as:

[0094] in, It is a rule The confidence level represents the probability of event Y occurring given that event X has occurred; This represents the total number of times event X occurs. Support and confidence are used to identify strongly associated rules. For example, rules with confidence scores above a threshold (e.g., 0.8) are converted into directed edges in a Bayesian network, thereby simplifying the network structure and improving inference efficiency. During the parameter assignment phase, the frequent itemsets mined from the association rules guide the initialization of the conditional probability table, which is then optimized using Bayesian learning. Bayesian learning updates the parameters using posterior probabilities, as shown in the formula:

[0095] in, It is the posterior probability, representing the parameter given the observed data D. The probability distribution; It is the likelihood function, representing the likelihood of the parameter The probability of observing data D; D is the parameter to be estimated; D is the training data, i.e., historical equipment status and fault records; P( ) is the prior distribution of the parameters, representing the parameters. The initial belief is given by P(D); P(D) is the marginal probability, representing the total probability of data D, and serves as a normalization function. This fusion method utilizes the implicit patterns in the data to optimize the network and improve its ability to handle uncertain information.

[0096] Risk fusion calculation is performed based on the optimized Bayesian network. The independent risk values ​​output in step 3 are then used. As evidence variables input into the network, the comprehensive risk value of the smart grid is calculated through Bayesian inference. Bayesian inference updates node probabilities based on Bayes' theorem.

[0097] in, It is the comprehensive risk value of the smart grid, i.e., the posterior probability, which represents the probability of event A occurring under the condition of observed evidence B; It is the likelihood probability, representing the probability of observing evidence B given the occurrence of a system failure, derived from the conditional probability table; A represents the overall risk event of the system (such as "system failure"), which is a discrete variable; B is the set of observed equipment risk evidence, i.e., the equipment's independent risk value. The mapped discrete state; P(A) is the prior probability, representing the initial probability of event A, obtained from historical system failure data statistics; P(B) is the marginal probability of evidence B, calculated as... The inference output is the posterior probability. The comprehensive risk value of a smart grid quantifies the overall risk level of the system. For example, the comprehensive risk value of a high-voltage substation can be represented as a probability distribution to assess the likelihood of a failure.

[0098] In one implementation, risk fusion calculation is performed based on the optimized Bayesian network. The independent risk values ​​output in step 3 are then used... As evidence variables input into the network, the comprehensive risk value of the smart grid is calculated through Bayesian inference. Bayesian inference updates node probabilities based on Bayes' theorem.

[0099] in, It is the comprehensive risk value of the smart grid, i.e., the posterior probability, which represents the probability of event A occurring under the condition of observed evidence B; It is the likelihood probability, representing the probability of observing evidence B given the occurrence of a system failure, derived from the conditional probability table; A represents the overall risk event of the system (such as "system failure"), which is a discrete variable; B is the set of observed equipment risk evidence, i.e., the equipment's independent risk value. The mapped discrete state; P(A) is the prior probability, representing the initial probability of event A, obtained from historical system failure data statistics; P(B) is the marginal probability of evidence B, calculated as... The inference output is the posterior probability. The comprehensive risk value of a smart grid quantifies the overall risk level of the system. For example, the comprehensive risk value of a high-voltage substation can be represented as a probability distribution to assess the likelihood of a failure.

[0100] Ultimately, the overall risk value of the smart grid and the risk contribution of each device are output through a visualization interface. The visualization takes the form of heatmaps or probability distribution maps, for example, using the Echarts library to generate an interactive graphical interface. In the heatmap, device risk values ​​are mapped to color gradients, with darker colors indicating higher risk; the probability distribution map displays the confidence interval of system risk. The visualization results also support drill-down analysis, such as clicking on device nodes to view detailed risk factors, facilitating maintenance personnel to identify high-risk areas and develop response strategies. The entire process ensures a seamless transition from device-level risk to system-level risk, providing intuitive and reliable decision support for smart grid condition monitoring.

[0101] This step, a crucial component of the smart grid fault diagnosis process, plays a key role in integrating the independent risk values ​​of each device output from step 3 using a Bayesian network fusion algorithm. This results in a comprehensive smart grid risk value, which is then presented intuitively using visualization technology. This step not only transforms fragmented device risk information into a unified overall risk assessment but also enhances the interpretability of the system status through probabilistic reasoning and graphical representation. It provides data support and interactive interfaces for subsequent precise fault location, maintenance strategy formulation, and system optimization decisions, thus constructing a closed loop from data fusion to application feedback and improving the intelligence level and response efficiency of smart grid management.

[0102] The invention will be further illustrated below through specific experiments; To verify the effectiveness and engineering applicability of the "Smart Grid Condition Monitoring Method and System Based on Digital Twin" of this invention, a comprehensive experimental platform integrating simulation and measured data was constructed. Based on the IEEE 118-node standard system and combined with the full-year operation data of a provincial regional power grid in 2023, a multi-source feature vector was constructed, including meteorological (temperature, humidity, wind speed), load (active / reactive power, three-phase imbalance), and equipment status (transformer winding temperature, bus voltage fluctuation, etc.). A total of 12,000 time window samples were generated, of which only 15% had expert annotations, covering six typical scenarios including normal operation, high temperature and high load, thunderstorm interference, and partial short circuit.

[0103] The experiment first uses the proposed semi-supervised learning model (integrating dynamic threshold self-training STDCT and prototype consistency constraints) to identify the scene; then, based on the identification results, it matches or generates suitable digital twin templates, and constructs a directed causal graph based on the causal scoring function to trace the anomaly propagation path in reverse; next, it assigns different weights (γ=0.6, δ=0.4) to the device positions (start point, intermediate point, and end point) in the path, and calculates the independent risk value of each device; finally, it fuses the device risks through a Bayesian network optimized by association rules and outputs the overall system risk probability.

[0104] Experimental results show that: (1) Under low labeling rate (15%), the scene classification accuracy reaches 86.9%, which is significantly better than the traditional template matching method (+18.7%) and the ordinary semi-supervised model (+7.5%); (2) The abnormal path recall rate (Recall@10) reaches 83.7%, which can effectively trace the source of compound faults such as "main transformer overheating → feeder cascading trip"; (3) The equipment independent risk ranking is highly consistent with the expert evaluation (Spearman's ρ=0.89); (4) The system comprehensive risk prediction AUC reaches 0.92, which can provide early warning of regional voltage collapse events 5-10 minutes in advance. The visualization interface is based on ECharts to realize equipment heat map and risk drill-down analysis, which supports maintenance personnel to quickly locate high-risk areas and formulate response strategies, fully verifying the robustness, accuracy and practicality of the present invention in complex and new operating scenarios.

[0105] This invention generates scene labels based on collected power grid data using a semi-supervised learning model. It then generates model templates matching these scene labels using a model template library. By introducing consistency constraints between semantic prototypes and predicted prototypes into the semi-supervised learning model, and using prototype vectors generated from labeled samples to correct predictions for unlabeled samples, it effectively filters out noise and pseudo-labels. A power grid digital twin model is constructed based on these model templates, and an abnormal path set is generated from this model. An initial Bayesian network is built, optimized, and an optimized Bayesian network is generated. Through a Bayesian network fusion algorithm, the independent risk values ​​of each device in the power grid are mapped to discrete state variables, constructing a network structure reflecting the risk dependencies between devices. Probabilistic reasoning is used to integrate the impact of individual device risks on the overall power grid. Based on each individual abnormal path, the independent risk value of the corresponding power grid device is calculated using a weighted aggregation method. Visualization is achieved using heatmaps or probability distribution maps, for example, using the Echarts library to generate an interactive graphical interface. The visualization results also support drill-down analysis; for example, clicking on a device node allows viewing detailed risk factors, facilitating maintenance personnel to identify high-risk areas and formulate response strategies. The entire process ensures a seamless transition from equipment-level risks to system-level risks, providing intuitive and reliable decision support for smart grid condition monitoring.

[0106] It should be understood that the embodiments described above are only some, not all, of the embodiments of the present invention. Furthermore, the technical features of the various embodiments or individual embodiments provided by the present invention can be arbitrarily combined to form feasible technical solutions. Such combinations are not constrained by the order of steps and / or structural composition patterns, but must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0107] It should be understood that the above description of the preferred embodiments is quite detailed, but it should not be considered as a limitation on the scope of protection of this invention. Those skilled in the art, under the guidance of this invention, can make substitutions or modifications without departing from the scope of protection of the claims of this invention, and all such substitutions or modifications fall within the scope of protection of this invention. The scope of protection of this invention should be determined by the appended claims.

Claims

1. A smart grid condition monitoring method based on digital twins, characterized in that, Includes the following steps: Step 1: Generate scene labels based on the collected power grid data using a semi-supervised learning model, and generate model templates that match the scene labels based on the scene labels and the semi-supervised learning model template library; Step 2: Construct a digital twin model of the power grid based on the model template, and generate a set of abnormal paths based on the digital twin model of the power grid; Step 3: Calculate the independent risk value of individual power grid equipment based on the abnormal path set; Step 4: Generate a comprehensive risk value for the smart grid based on the independent risk values ​​of each of the aforementioned power grid devices.

2. The smart grid condition monitoring method based on digital twin according to claim 1, characterized in that: In step 1, the semi-supervised learning model consists of an input processing module, a feature extraction module, a dynamic threshold self-training module, a prototype consistency constraint module, and an output layer. The input processing module is responsible for receiving scene feature vectors and applying standardization and data augmentation techniques to generate diverse input views. The feature extraction module, based on a deep neural network architecture (such as a convolutional neural network), maps the input data to a high-dimensional feature space and extracts semantic features. This module typically contains multiple convolutional and pooling layers to capture local and global patterns; The dynamic threshold self-training module integrates the STDCT algorithm, including a confidence calculator and a threshold adjuster; the confidence calculator evaluates the predictive determinism of unlabeled samples, and the threshold adjuster dynamically updates the confidence threshold to adapt to the current training state. The prototype consistency constraint module applies consistency constraints by calculating the similarity between unlabeled samples and prototypes to ensure prediction reliability. The output layer uses a fully connected layer and a softmax activation function to generate the probability distribution for each category, and obtains the scene label through an argmax operation. Where S is the output scene label; It is the probability that the model predicts the feature vector fs to belong to category k; K is the preset number of categories.

3. The smart grid condition monitoring method based on digital twin according to claim 1, characterized in that: In step 1, the scene label is compared with the label set in the semi-supervised learning model template library to determine whether there is a template that matches the scene label; the semi-supervised learning model template library is pre-built by expert experience and contains several basic model templates, each model template being associated with a specific scene label; If so, the corresponding template is called from the semi-supervised learning model template library as the model template for the scene label; If not, the scene feature vector is mapped to a high-dimensional encoded representation based on the semi-supervised learning model. The similarity between the high-dimensional encoded representation and the prototype vectors of each template in the semi-supervised learning model template library is calculated. The model template with the highest similarity is selected as the transition template. A temporary template is generated based on the transition template and used as the model template that matches the scene label.

4. The smart grid condition monitoring method based on digital twin according to claim 1, characterized in that: In step 2, a state vector set is constructed based on the power grid digital twin model; the causal influence strength between equipment nodes is generated according to the state vector set and the preset causal scoring function, and a directed causal graph is generated; abnormal nodes are identified, and in the directed causal graph, the influence path is traced backward from each abnormal node, and the abnormal influence strength of each influence path is calculated. An abnormal path set is generated based on the intensity of the abnormal impact.

5. The smart grid condition monitoring method based on digital twin according to claim 4, characterized in that: The causal scoring function is: ; in, Represents a node right The strength of the causal influence; Real-time state variables and The mutual information between them is used to measure nonlinear dependencies and is estimated by the multi-time state sequence within a historical sliding window. It is the ratio of the current temperature rise of the equipment to its upper operating limit. It is a node The maximum permissible temperature rise value is obtained from the equipment specifications or historical safety thresholds; It is the L1 distance of the state difference, representing the degree to which the node state deviates from the stable coupling relationship; It is a node The historical average operating status value is obtained from long-term operating data. It is a very small constant used to avoid the denominator being zero; , , It is a weighting factor that controls the balance between mutual information strength, temperature rise risk sensitivity, and state deviation penalty.

6. The smart grid condition monitoring method based on digital twin according to claim 1, characterized in that: In step 3, for each power grid device, all individual abnormal paths containing that power grid device are selected from the abnormal path set; based on the individual abnormal paths, the independent risk value of the corresponding power grid device is calculated using a weighted aggregation method. The abnormal path set includes a path list, the device nodes involved in the path, and the abnormal impact intensity η(p) value of each path. ;in, This represents the product of the weights of all causal edges in path p; is the causal edge weight, representing the strength of the influence of node u on node v; j is the index of the endpoint node; It is the end node of the path. The current status value is read from real-time monitoring data; and These are the path endpoint nodes. The historical mean and standard deviation are statistically obtained from long-term operating data and are used to standardize the degree of anomalies. For each device node Its weighted risk value Where p is a single abnormal path; It is a device index; It includes all devices The set of abnormal paths, that is, selecting those abnormal paths from the set that meet the criteria. The set of paths p ∈ p; It is equipment The position weights in path p are used to adjust the contribution of η(p). Based on the device's role definition in the path, the rules are defined as follows: If the device If the endpoint of path p is [the position weight], then [the position weight] is [the position weight]. =1 indicates full contribution; If the device If it is the starting point of path p, then the position weight... =γ, where γ is the starting point weighting factor, 0<γ<1, reflecting the secondary nature of the source risk; If the device If it is the midpoint of path p, then the position weight... =δ, where δ is the intermediate point weighting factor, 0<δ<γ, reflecting the weak contribution of the risk transmission.

7. The smart grid condition monitoring method based on digital twin according to claim 1, characterized in that: In step 4, the independent risk values ​​of each of the power grid devices are mapped to discrete risk states; each discrete risk state is input into the optimized Bayesian network to calculate and generate the comprehensive risk value of the smart grid. The optimized Bayesian network is optimized in terms of structure and parameters by introducing association rule data mining technology. Association rule mining extracts strong dependencies between devices from historical data and calculates the support of rules using the Apriori algorithm. and confidence level ;in, It is a rule Support represents the frequency with which events X and Y occur simultaneously. It is an association rule, which represents the dependency relationship between events X and Y; It represents the number of times events X and Y occur simultaneously in historical data, and M is the total amount of data. It is a rule The confidence level represents the probability of event Y occurring given that event X has occurred; This represents the total number of times event X occurs; support and confidence are used to identify strongly associated rules, converting rules with confidence scores above a threshold into directed edges in the Bayesian network; during the parameter assignment phase, the frequent itemsets mined from the association rules guide the initialization of the conditional probability table, which is then optimized through Bayesian learning; Bayesian learning updates the parameters using posterior probabilities, as shown in the formula: ;in, It is the posterior probability, representing the parameter given the observed data D. The probability distribution; It is the likelihood function, representing the likelihood of the parameter The probability of observing data D; D is the parameter to be estimated; D is the training data, i.e., historical equipment status and fault records; P( ) is the prior distribution of the parameters, representing the parameters. The initial belief; P(D) is the marginal probability, representing the total probability of data D, and serves as a normalization function.

8. The smart grid condition monitoring method based on digital twin according to claim 1, characterized in that: In step 4, risk fusion calculation is performed based on the optimized Bayesian network; the independent risk values ​​are then... As evidence variables input into the network, the comprehensive risk value of the smart grid is calculated through Bayesian inference; Bayesian inference updates node probabilities based on Bayes' theorem. Where N is the total number of devices, This represents the independent risk value of the k-th device; It is the comprehensive risk value of the smart grid, i.e., the posterior probability, which represents the probability of event A occurring under the condition of observed evidence B; It is the likelihood probability, representing the probability of observing evidence B under the condition that a system failure occurs, derived from the conditional probability table; A represents the system's overall risk event; B is the set of observed equipment risk evidence, i.e., the equipment's independent risk value. The mapped discrete state; P(A) is the prior probability, representing the initial probability of event A, obtained from historical system failure data statistics; P(B) is the marginal probability of evidence B, calculated as... The inference output is the posterior probability. This refers to the comprehensive risk value of the smart grid, which quantifies the overall risk level of the system.

9. The smart grid condition monitoring method based on digital twin according to any one of claims 1-8, characterized in that: The semi-supervised learning model is a pre-trained model; the training process is as follows: First, data preprocessing is performed by loading labeled and unlabeled datasets, applying normalization and data augmentation, and dividing the dataset into training batches. Then, model initialization is performed, randomly initializing the parameters of the feature extraction network and the output layer; the prototype vector is initialized based on the feature mean of the labeled samples, represented as: ; in, h refers to the prototype vector of category k; It is a sample Feature representation; It is the set of samples belonging to category k; Then, a training loop is performed, including forward propagation, loss calculation, and backpropagation and optimization. Forward propagation involves inputting batch data, extracting features through a feature extraction module, and then generating predictions through the output layer. Loss calculation combines supervised loss, unsupervised loss, and prototype consistency loss. Backpropagation and optimization use the gradient descent algorithm to update parameters and minimize the total loss. The optimization process is as follows: ,in, This represents the state of the model parameters at the current t-th iteration; This indicates the state of the model parameters in the next iteration, i.e., the (t+1)th iteration. It is the learning rate; It is the total loss function with respect to all model parameters. The gradient; After each training round, the prototype vector is recalculated based on the features of the currently labeled samples to ensure that it represents the latest class distribution; Finally, a convergence check is performed, and the training loop is repeated until the loss function converges or the maximum number of iterations is reached.

10. A smart grid condition monitoring system based on digital twins, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the smart grid condition monitoring method based on digital twins as described in any one of claims 1 to 9.