A substation analog through-flow test method based on contrast learning

By constructing a substation current flow simulation and anomaly detection model using the SimCLR contrastive learning framework and Transformer encoder, the problem of insufficient adaptability in traditional methods is solved. This achieves accurate simulation of substation current flow and efficient anomaly detection, improving simulation accuracy and adaptability, and supporting intelligent operation and maintenance of substations.

CN121598272BActive Publication Date: 2026-05-15STATE GRID JIANGSU ELECTRIC POWER CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID JIANGSU ELECTRIC POWER CO LTD
Filing Date
2026-01-29
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Traditional methods for simulating current flow and detecting anomalies in substations are difficult to adaptively learn from historical and real-time monitoring data, and cannot accurately reflect complex current flow conditions. Furthermore, traditional methods are poorly adaptable to complex data environments and cannot meet the needs of intelligent operation and maintenance.

Method used

A method based on the SimCLR contrastive learning framework and Transformer encoder, combined with deep learning technology, is used to construct a substation current flow simulation model and anomaly detection model. Feature extraction and anomaly identification are performed using multi-source heterogeneous monitoring data to generate a structured test report.

Benefits of technology

It achieves accurate simulation and efficient anomaly detection of substation current flow, improves the accuracy and adaptability of simulation results, and can identify anomalies under complex operating conditions such as equipment failure and load fluctuation in real time, providing detailed data support and decision-making basis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121598272B_ABST
    Figure CN121598272B_ABST
Patent Text Reader

Abstract

The application provides a substation simulation through-flow test method based on contrast learning, and relates to the field of substation simulation test. The method comprises the following steps: collecting multi-source heterogeneous monitoring data of a substation to construct a data set; training a feature extraction network by using a SimCLR contrast learning framework; constructing a simulation preliminary model with a Transformer encoder as the core; optimizing by using a gradient descent algorithm to obtain a substation current flow simulation model; constructing a substation operation state anomaly identification model; generating corresponding simulation monitoring data according to a target test scene; obtaining a prediction output through the simulation model, and then obtaining an abnormal diagnosis result through the anomaly identification model; and generating a structured test report. The application adopts contrast learning, Transformer simulation and SVM anomaly identification technology, realizes accurate simulation of substation current flow and efficient anomaly detection, and has the advantages of strong self-adaptability, high precision and good real-time performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of substation simulation testing, and more particularly to a substation simulation current-carrying test method based on contrastive learning. Background Technology

[0002] As a crucial component of the power system, the stability and safety of substations directly impact the operation of the entire power grid. Traditional substation current flow simulations typically rely on fixed physical models and manual adjustments, making it difficult to accurately reflect complex current flow conditions. Especially under fault or abnormal circumstances, the simulation results are often unsatisfactory. Furthermore, existing anomaly detection methods largely depend on manual rules or traditional statistical models, which cannot effectively handle the complex, multi-dimensional data in substations. This results in insufficient accuracy and timeliness in anomaly detection, failing to meet the demands of intelligent operation and maintenance.

[0003] The shortcomings of existing technologies in substation current flow simulation and anomaly detection are mainly reflected in two aspects: First, they lack adaptive learning capabilities and cannot make full use of historical data and real-time monitoring data during substation operation for accurate simulation; second, traditional anomaly detection methods are poorly adaptable to complex data environments and cannot flexibly cope with various complex operating conditions and fault types. Summary of the Invention

[0004] Purpose of the invention: To propose a substation current flow simulation test method based on contrastive learning, which realizes accurate simulation of substation current flow and efficient anomaly detection, and has stronger adaptability, higher accuracy and better real-time performance.

[0005] To achieve the above objectives, this invention provides a substation simulated current-carrying test method based on contrastive learning, comprising the following steps:

[0006] Collect and preprocess multi-source heterogeneous monitoring data during substation operation to construct training and validation datasets;

[0007] The SimCLR contrastive learning framework is used to construct positive and negative sample pairs based on the training dataset for representation learning, thereby training a feature extraction network and deep feature vectors of the training and validation datasets.

[0008] A preliminary simulation model with a Transformer encoder as its core is constructed, and the deep feature vectors of the training dataset are used as input for training.

[0009] The prediction error of the preliminary simulation model is calculated based on the verification dataset, and the model parameters are optimized using the gradient descent algorithm to obtain the substation current flow simulation model.

[0010] Based on the predicted output of the verification dataset on the substation current flow simulation model, an unsupervised anomaly detection algorithm is used to train and construct a substation operation status anomaly identification model.

[0011] Generate corresponding simulated monitoring data based on the target test scenario;

[0012] The feature extraction network is used to extract features from the simulated monitoring data, the predicted output of the simulated monitoring is obtained through the substation current flow simulation model, and the abnormal diagnosis result is obtained through the substation operation status abnormal identification model.

[0013] Integrate the predicted outputs from simulation monitoring and the results of anomaly diagnosis to generate a structured test report.

[0014] As a preferred embodiment, the multi-source heterogeneous monitoring data includes historical data from the SCADA system, real-time sensor monitoring data, and equipment status data;

[0015] The historical data of the SCADA system includes historical current values, historical voltage values, historical power values, and historical event logs;

[0016] The real-time sensor monitoring data includes real-time current values, real-time voltage values, and real-time power values;

[0017] The equipment status data includes transformer oil temperature, circuit breaker status signals, and partial discharge signals.

[0018] As a preferred embodiment, the construction of the training dataset and validation dataset specifically includes:

[0019] For continuous data in multi-source heterogeneous monitoring data, including current values, voltage values, power values, transformer oil temperature and partial discharge signals, the nearest neighbor interpolation method is used to fill missing values, median filtering is used to filter out noise, and Z-score standardization is used for standardization.

[0020] For discrete data in multi-source heterogeneous monitoring data, including circuit breaker status signals and historical event logs, the missing values ​​are filled by forward filling, abnormal state jumps are filtered out by mode filtering, and vectorization is performed by one-hot encoding.

[0021] Based on the timestamps of the preprocessed multi-source heterogeneous monitoring data, data from the same time point are horizontally spliced ​​to obtain a multi-dimensional time-series feature vector.

[0022] The multidimensional temporal feature vectors are arranged in chronological order, and the sliding window method is used to sample them to generate multiple consecutive temporal sample segments, which are then divided into training datasets and validation datasets.

[0023] The training dataset precedes the validation dataset in the timeline.

[0024] As a preferred embodiment, the training yields a feature extraction network and deep feature vectors from the training and validation datasets, specifically including:

[0025] A SimCLR contrastive learning framework is constructed, and two random data augmentations are performed on one sample in each batch of the training dataset. The data augmentation is to randomly truncate the sample in sequence, sample with random step size, and inject random noise to obtain two augmented views as positive sample pairs, while the augmented views of other samples in the same batch are used as negative sample pairs.

[0026] Feature vectors are obtained by extracting features from all positive and negative sample pairs using a deep convolutional neural network. The NT-Xent loss function is used to maximize the similarity between positive sample pairs and minimize the similarity between negative sample pairs. The average loss of all positive sample pairs in a batch is taken as the total loss. :

[0027]

[0028] Where N represents the number of samples in a batch; and These represent the feature vectors of positive sample pairs; This represents the feature vector among all negative sample pairs; This indicates the temperature coefficient used to adjust the contrast loss sensitivity. Indicates an indicator function, The value is 1 when the time is right, and 0 otherwise. Cosine similarity between two vectors;

[0029] Based on the gradient of the loss function, the Adam optimizer is used to optimize the parameters in the deep convolutional neural network to obtain a trained feature extraction network.

[0030] By using a feature extraction network to extract features from the training and validation datasets, deep feature vectors of the training and validation datasets are obtained.

[0031] As a preferred option, a preliminary simulation model is constructed with the Transformer encoder as the core, including a position calculation layer, an encoder layer, and a decoder layer;

[0032] By using the position of the time step of the deep feature vector in the training dataset within the dataset, and employing sine and cosine functions to provide positional information for the feature vector, the enhanced deep feature vector is obtained.

[0033] The enhanced deep feature vector is fed into the encoder layer. The encoder layer consists of multiple identical stacked layers, each composed of a multi-head self-attention sub-layer and a feedforward neural network sub-layer. The multi-head self-attention sub-layer linearly projects the input of the encoder layer onto the query, key, and value space through a randomly generated training parameter matrix of query, key, and value to obtain the projection of the deep feature vector. The projection is then calculated through the multi-head self-attention mechanism, and the outputs of all attention heads are concatenated and linearly transformed to obtain the attention output.

[0034] The attention output is nonlinearly transformed through a feedforward neural network sublayer to obtain the neural network output. The feedforward neural network sublayer includes two linear transformations and an activation function.

[0035] The output of the neural network is processed by residual connections and layer normalization to obtain the output of one layer in the encoder layer. The output of the previous layer is used as the input of the next layer. After multiple layers of encoding, the feature matrix is ​​obtained.

[0036] The feature matrix output by the encoder layer is decoded by the decoder layer to obtain the prediction results of the training dataset. The decoder layer consists of a fully connected layer.

[0037] As a preferred embodiment, the obtained substation current flow simulation model specifically includes:

[0038] The preliminary simulation model is forward-propagated on the deep feature vectors of the validation dataset to obtain the prediction results of the preliminary simulation model.

[0039] Evaluation metrics between the prediction results of the preliminary simulation model and the actual values ​​of the validation dataset are calculated, including mean squared error, mean absolute error, and coefficient of determination.

[0040] Based on the evaluation metrics, a multi-objective optimization decision is adopted, with minimizing the mean squared error as the main optimization objective. At the same time, the mean absolute error is required to be lower than a preset threshold and the coefficient of determination is required to be higher than a preset threshold. When the three metrics simultaneously meet the preset performance conditions, the model is judged to have the best performance.

[0041] The parameters of the preliminary simulation model are optimized using the momentum stochastic gradient descent algorithm. By calculating the gradient of the loss function with respect to the parameters and combining the momentum term and historical gradient information, all parameters in the preliminary simulation model are updated.

[0042] An adaptive learning rate adjustment strategy based on the performance of the validation dataset is adopted. When the improvement of the mean squared error is less than a preset threshold, the learning rate is reduced by a predetermined ratio, and all parameters in the preliminary simulation model are updated again.

[0043] When the performance of the preliminary simulation model simultaneously meets the multi-objective optimization conditions, and the mean square error and mean absolute error are lower than the preset thresholds, and the coefficient of determination is higher than the preset threshold, the current model is saved as a candidate optimal model.

[0044] If the performance of the preliminary simulation model no longer improves after several consecutive training cycles, parameter updates are stopped, and the candidate optimal model with the smallest mean square error is selected as the final substation current flow simulation model.

[0045] As a preferred embodiment, the construction of the substation operation status anomaly identification model specifically includes:

[0046] Based on the radial basis function kernel function SVM, a substation operation status anomaly identification model is constructed. The substation current flow simulation model is forward propagated on the deep feature vector of the validation dataset. The residual sequence between the prediction results of the substation current flow simulation model and the true values ​​of the validation dataset is calculated and used as the anomaly identification training dataset.

[0047] A class of SVM algorithms based on radial basis function kernels is adopted to map the anomaly detection training dataset to a high-dimensional feature space through kernel functions;

[0048] For the three types of abnormal operating states, three binary classification SVM sub-models are constructed. The abnormal operating states include equipment failure, load overload, and current deviation.

[0049] Each binary SVM sub-model is trained separately. On the anomaly recognition training dataset, the optimal classification hyperplane in the high-dimensional feature space that maximizes the classification margin and minimizes misclassification is found by solving an optimization problem.

[0050] Based on the optimal hyperplane obtained by the solution, an anomaly recognition decision function is constructed for each binary SVM sub-model to obtain the anomaly operation state classification output by each binary SVM sub-model. The distance from the training samples of the anomaly recognition training dataset to the optimal hyperplane is calculated as the confidence score of anomaly recognition.

[0051] The abnormal operating state classification and confidence score output by each binary SVM sub-model are superimposed and normalized. The abnormal operating state with the highest confidence score and its confidence score are taken as the final output of the substation operating state anomaly identification model.

[0052] The kernel function parameters and penalty parameters were optimized using cross-validation, and the model with the highest F1 score was selected as the final substation operation status anomaly identification model after training.

[0053] As a preferred embodiment, the generation of corresponding simulated monitoring data based on the target test scenario specifically includes:

[0054] Based on the actual operation requirements of substations, the target test scenario is abstracted and quantified into specific parameters. For different operating conditions, the corresponding reference voltage, rated current, maximum power, reference power factor, load fluctuation amplitude, load fluctuation cycle parameter, load fluctuation random factor, fault type, fault start time, fault duration, and fault severity are specified to obtain the parameters corresponding to the target test scenario.

[0055] Based on the dynamic equations of the power system, current, voltage, and power values ​​are generated according to the parameters corresponding to the target test scenario.

[0056] Based on thermodynamic equations and equipment characteristics, a transformer oil temperature model is constructed to generate transformer oil temperature data;

[0057] The circuit breaker operation sequence is generated based on changes in current, voltage, and power values. The circuit breaker operation sequence includes three states: open, closed, and in operation. The circuit breaker status signal is generated according to the correspondence between the circuit breaker status and the circuit breaker status signal.

[0058] Generating partial discharge signals based on random pulse sequences:

[0059]

[0060] in, Indicates the discharge amplitude. This indicates the time of the i-th discharge. Indicates a discharge pulse. This represents the discharge decay time constant, and N represents the total number of discharge pulses. This represents the intensity of the partial discharge signal at time t;

[0061] Based on the fault type, fault start time, fault duration, and fault severity, an event log is generated based on circuit breaker status changes and threshold triggers.

[0062] The current, voltage, power values, transformer oil temperature, circuit breaker status signals, partial discharge signals, and event logs are combined into multi-source heterogeneous simulation monitoring data.

[0063] As a preferred embodiment, the generation of the abnormal diagnostic results specifically includes:

[0064] The simulated monitoring data is preprocessed to obtain the simulated monitoring dataset;

[0065] Based on the trained feature extraction network, features are extracted from the simulated monitoring dataset to obtain the deep feature vector of the simulated monitoring dataset;

[0066] The substation current flow simulation model is forward-propagated on the deep feature vector of the simulated monitoring dataset to obtain the prediction results of the simulated monitoring data.

[0067] The anomaly identification model for substation operation status is used to identify the predicted results of simulated monitoring data, and the anomaly diagnosis results of simulated monitoring data are obtained, including abnormal operation status and its confidence score.

[0068] As a preferred embodiment, the generation of the structured test report specifically includes:

[0069] Based on the prediction results of the simulation monitoring data, the current distribution matrix of each branch of the substation is calculated, and the Gaussian kernel density estimation method is used to generate the current distribution heat map.

[0070] Based on the anomaly diagnosis results of simulated monitoring data, the data are integrated according to the timestamp information of the abnormal operating state to construct an anomaly event time sequence map.

[0071] The current distribution heatmap and the time sequence map of abnormal events are integrated into a structured test report.

[0072] Compared with the prior art, the present invention has at least the following beneficial effects:

[0073] (1) By introducing the SimCLR contrastive learning framework, deep feature learning can be performed using a large amount of historical data and real-time monitoring data without manual annotation, so as to accurately extract the current flow pattern and equipment status of the substation. The adaptive learning method enables the model to dynamically adjust the simulation model according to the actual operating environment, improve the accuracy and adaptability of the simulation results, especially when facing complex operating conditions such as equipment failure and load fluctuation, it can better reflect the changes in actual current flow.

[0074] (2) Using the Transformer encoder as the core of the current flow simulation model can better handle long-distance dependencies in time series data and overcome the problem that traditional simulation methods are insufficient in expressing the complexity of current flow. The Transformer model, through the multi-head self-attention mechanism, enables the simulation model to comprehensively consider the mutual influence of various equipment and loads in the substation, and effectively simulate the current flow state of the substation under different operating conditions.

[0075] (3) By combining Support Vector Machine (SVM) and Radial Basis Function (RBF), this invention maps data to a high-dimensional feature space, enabling more accurate identification of anomalies under complex current flow conditions. Especially in cases of substation equipment failure, load overload, and current deviation, this method can detect anomalies in real time and provide confidence scores, offering more accurate fault warnings.

[0076] (4) By generating simulated monitoring data and combining it with a feature extraction network, this invention can not only accurately predict the current flow state in the simulation model, but also provide more refined input data for identifying abnormal operating conditions. At the same time, combined with the generated structured test report, it can provide detailed data support and decision-making basis for the intelligent operation and maintenance of substations, including current distribution heatmaps, abnormal event time series diagrams, and prediction deviation analysis, providing managers with a clear view of equipment operating status. Attached Figure Description

[0077] Figure 1 This is a flowchart of a substation simulation current-carrying test method based on contrastive learning proposed in this invention.

[0078] Figure 2 This is a schematic diagram of the substation current flow simulation model proposed in this invention. Detailed Implementation

[0079] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention can be practiced without one or more of these details. In other instances, certain technical features well-known in the art have not been described in order to avoid obscuring the invention.

[0080] refer to Figure 1 This embodiment discloses a substation simulated current-carrying test method based on contrastive learning, the steps of which are as follows:

[0081] Collect multi-source heterogeneous monitoring data during substation operation, preprocess the data, and construct training and validation datasets.

[0082] The SimCLR contrastive learning framework is adopted. Based on the training dataset, positive and negative sample pairs are constructed for representation learning. The feature extraction network and deep feature vectors of the training dataset and the validation dataset are trained.

[0083] A substation current flow simulation model with Transformer encoder as the core is constructed. The deep feature vector of the training dataset is used as input for training to obtain a preliminary simulation model.

[0084] The prediction error of the preliminary simulation model was calculated based on the validation dataset. The model parameters were optimized using the gradient descent algorithm to obtain the simulation model of substation current flow.

[0085] Based on the predicted output of the validation dataset on the substation current flow simulation model, an unsupervised anomaly detection algorithm is used for training to construct a substation operation status anomaly identification model.

[0086] Generate corresponding simulated monitoring data based on the target test scenario;

[0087] Feature extraction networks are used to extract features from simulated monitoring data, and prediction outputs are obtained through a substation current flow simulation model. Then, anomaly diagnosis results are obtained through a substation operation status anomaly identification model.

[0088] Integrate the predicted outputs from simulation monitoring and the results of anomaly diagnosis to generate a structured test report.

[0089] In this embodiment, the generation process of the training dataset and the validation dataset is as follows:

[0090] Collect multi-source heterogeneous monitoring data during substation operation, including historical data from the SCADA system, real-time sensor monitoring data, and equipment status data. The historical data from the SCADA system includes historical current values, historical voltage values, historical power values, and historical event logs. The real-time sensor monitoring data includes real-time current values, real-time voltage values, and real-time power values. The equipment status data includes transformer oil temperature, circuit breaker status signals, and partial discharge signals.

[0091] For continuous data in multi-source heterogeneous monitoring data, including current values, voltage values, power values, transformer oil temperature and partial discharge signals, the nearest neighbor interpolation method is used to fill missing values, median filtering is used to filter out noise, and Z-score standardization is used for standardization to obtain the processed continuous data in multi-source heterogeneous monitoring data.

[0092] For discrete data in multi-source heterogeneous monitoring data, including circuit breaker status signals and historical event logs, the missing values ​​are filled by forward filling, abnormal state jumps are filtered out by mode filtering, and vectorization is performed by one-hot encoding to obtain the processed discrete data in multi-source heterogeneous monitoring data.

[0093] Based on the timestamps of the processed multi-source heterogeneous monitoring data, data from the same time point are horizontally spliced ​​to obtain a multi-dimensional time-series feature vector.

[0094] The multidimensional temporal feature vectors are arranged in chronological order, and the sliding window method is used to sample them to generate multiple consecutive temporal sample segments, which are then divided into training datasets and validation datasets. The training datasets precede the validation datasets in the timeline.

[0095] In this embodiment, the process of generating the deep feature vectors of the feature extraction network, training dataset, and validation dataset is as follows:

[0096] A SimCLR contrastive learning framework is constructed, and two random data augmentations are performed on one sample in each batch of the training dataset. The data augmentation is to randomly truncate the sample in sequence, sample with random step size, and inject random noise to obtain two augmented views as positive sample pairs. The augmented views of other samples in the same batch are all used as negative sample pairs.

[0097] Feature vectors are obtained by extracting features from all positive and negative sample pairs using a deep convolutional neural network. The NT-Xent loss function is used to maximize the similarity between positive sample pairs and minimize the similarity between negative sample pairs. The average value of all positive sample pairs in a batch is used as the total loss, as shown in equation (1).

[0098]

[0099] in, This indicates the number of samples in a batch. and These represent the feature vectors of positive sample pairs. This represents the feature vector among all negative sample pairs. This indicates the temperature coefficient used to adjust the contrast loss sensitivity. Indicates an indicator function, The value is 1 when the time is right, and 0 otherwise. Cosine similarity between two vectors;

[0100] Based on the gradient of the loss function, the Adam optimizer is used to optimize the parameters in the deep convolutional neural network to obtain a trained feature extraction network.

[0101] By using a feature extraction network to extract features from the training and validation datasets, deep feature vectors of the training and validation datasets are obtained.

[0102] In this embodiment, the preliminary simulation model is built around the Transformer encoder and consists of a position calculation layer, an encoder layer, and a decoder layer.

[0103] By using the position of the time step of the deep feature vector in the training dataset within the dataset, and employing sine and cosine functions to provide positional information for the feature vector, the enhanced deep feature vector is obtained.

[0104] The enhanced deep feature vector is fed into the encoder layer, which is composed of multiple identical stacked layers. Each layer consists of a multi-head self-attention sub-layer and a feedforward neural network sub-layer. The multi-head self-attention sub-layer linearly projects the input of the encoder layer onto the query, key, and value space through a randomly generated training parameter matrix of query, key, and value to obtain the projection of the deep feature vector. Then, it is calculated through the multi-head self-attention mechanism. The outputs of all attention heads are concatenated and linearly transformed to obtain the attention output, as shown in the following equation (2).

[0105]

[0106] in, This represents the enhanced deep feature vector. , , This represents the training parameter matrix for the query, key, and value of the i-th attention head. To represent the transpose of a matrix, This represents the dimension of each head. Represents the normalized exponential function, This represents the output of the i-th attention head;

[0107] The attention output is nonlinearly transformed through a feedforward neural network sublayer to obtain the neural network output. The feedforward neural network sublayer includes two linear transformations and an activation function.

[0108] The output of the neural network is processed by residual connections and layer normalization to obtain the output of one layer in the encoder layer. The output of the previous layer is used as the input of the next layer. After multiple layers of encoding, the feature matrix is ​​obtained.

[0109] The feature matrix output by the encoder layer is decoded by the decoder layer to obtain the prediction results of the training dataset. The decoder layer consists of a fully connected layer.

[0110] During training, a Teacher-Forcing strategy is adopted, using the true value of the training dataset at the previous time point as the input of the Transformer encoder. The mean squared error loss between the prediction results of the training dataset and the true values ​​of the training dataset is calculated. The stochastic gradient descent algorithm is used to iteratively optimize all parameters of the Transformer encoder by minimizing the mean squared error loss.

[0111] See Figure 2 As shown in the figure, the generation process of the substation current flow simulation model in this embodiment is as follows:

[0112] The preliminary simulation model is forward-propagated on the deep feature vectors of the validation dataset to obtain the prediction results of the preliminary simulation model.

[0113] Evaluation metrics between the prediction results of the preliminary simulation model and the actual values ​​of the validation dataset are calculated, including mean squared error, mean absolute error, and coefficient of determination.

[0114] Based on the evaluation metrics, a multi-objective optimization decision is adopted, with minimizing the mean squared error as the main optimization objective. At the same time, the mean absolute error is required to be lower than a preset threshold and the coefficient of determination is required to be higher than a preset threshold. When the three metrics simultaneously meet the preset performance conditions, the model is judged to have the best performance.

[0115] The parameters of the preliminary simulation model are optimized by using the stochastic gradient descent algorithm with momentum. By calculating the gradient of the loss function with respect to the parameters, and combining the momentum term and historical gradient information, all parameters in the preliminary simulation model are updated, as shown in equations (3) and (4).

[0116]

[0117]

[0118] in, The momentum coefficient represents the rate at which historical gradient information decays. Indicates the first The momentum term at the next iteration The learning rate represents the step size for updating the control parameters. This indicates the parameter currently being updated. The mean squared error loss function represents the parameter gradient, This represents the momentum term at the t-th iteration. Indicates the first Model parameters after the next iteration Indicates the first Model parameters after the next iteration;

[0119] An adaptive learning rate adjustment strategy based on the performance of the validation dataset is adopted. When the improvement of the mean squared error is less than a preset threshold, the learning rate is reduced by a predetermined ratio, and all parameters in the preliminary simulation model are updated again.

[0120] When the performance of the preliminary simulation model simultaneously meets the multi-objective optimization conditions, and the mean square error and mean absolute error are lower than the preset thresholds, and the coefficient of determination is higher than the preset threshold, the current model is saved as a candidate optimal model.

[0121] If the performance of the preliminary simulation model no longer improves after several consecutive training cycles, parameter updates are stopped, and the candidate optimal model with the smallest mean square error is selected as the final substation current flow simulation model.

[0122] In this embodiment, the generation process of the substation operation status anomaly identification model is as follows:

[0123] Based on the radial basis function kernel function SVM, a substation operation status anomaly identification model is constructed. The substation current flow simulation model is forward propagated on the deep feature vector of the validation dataset. The residual sequence between the prediction results of the substation current flow simulation model and the true values ​​of the validation dataset is calculated and used as the anomaly identification training dataset.

[0124] A class of SVM algorithms based on radial basis function kernels is adopted to map the anomaly detection training dataset to a high-dimensional feature space through kernel functions;

[0125] For the three types of abnormal operating states, three binary classification SVM sub-models are constructed. The abnormal operating states include equipment failure, load overload, and current deviation.

[0126] Each binary SVM sub-model is trained separately. On the anomaly recognition training dataset, the optimal classification hyperplane in the high-dimensional feature space that maximizes the classification margin and minimizes misclassification is found by solving an optimization problem.

[0127] Based on the optimal hyperplane obtained by the solution, an anomaly recognition decision function is constructed for each binary SVM sub-model to obtain the anomaly operation state classification output by each binary SVM sub-model. The distance from the training samples of the anomaly recognition training dataset to the optimal hyperplane is calculated as the confidence score of anomaly recognition.

[0128] The abnormal operating state classification and confidence score output by each binary SVM sub-model are superimposed and normalized. The abnormal operating state with the highest confidence score and its confidence score are taken as the final output of the substation operating state anomaly identification model.

[0129] The kernel function parameters and penalty parameters were optimized using cross-validation, and the model with the highest F1 score was selected as the final substation operation status anomaly identification model after training.

[0130] In this embodiment, the process of generating simulated monitoring data is as follows:

[0131] Based on the actual operation requirements of substations, the target test scenario is abstracted and quantified into specific parameters. For different operating conditions, the corresponding reference voltage, rated current, maximum power, reference power factor, load fluctuation amplitude, load fluctuation cycle parameter, load fluctuation random factor, fault type, fault start time, fault duration, and fault severity are specified to obtain the parameters corresponding to the target test scenario.

[0132] Based on the dynamic equations of the power system, and according to the parameters corresponding to the target test scenario, the current (Equation (5)), voltage (Equation (6)), and power values ​​(Equation (7)) are generated:

[0133]

[0134]

[0135]

[0136] in, Indicates the reference voltage. The voltage fluctuation amplitude is represented by f, the system frequency is represented by t, and time is represented by t. Indicates voltage phase, Indicates the rated current. Indicates the magnitude of load fluctuation. This indicates the load fluctuation period parameter. This represents the random factor of load fluctuation. Represents a standard normally distributed random number. This represents the instantaneous voltage value at time t. This represents the instantaneous value of the current at time t. Represents the power factor at time t. This represents the active power at time t;

[0137] Based on thermodynamic equations and equipment characteristics, a transformer oil temperature model is constructed to generate transformer oil temperature data, as shown in equation (8).

[0138]

[0139] in, Indicates ambient temperature. This represents the rated temperature rise, and k represents the heat transfer coefficient. Represents the thermal time constant. Indicates transformer oil temperature;

[0140] The circuit breaker operation sequence is generated based on changes in current, voltage, and power values. The circuit breaker operation sequence includes three states: open, closed, and in operation. The circuit breaker status signal is generated by the correspondence between the circuit breaker status and the circuit breaker status signal.

[0141] The partial discharge signal is generated based on the random pulse sequence generator formula (9).

[0142]

[0143] in, Indicates the discharge amplitude. This indicates the time of the i-th discharge. Indicates a discharge pulse. This represents the discharge decay time constant. Indicates the total number of discharge pulses. This represents the intensity of the partial discharge signal at time t;

[0144] Based on the fault type, fault start time, fault duration, and fault severity, an event log is generated based on circuit breaker status changes and threshold triggers.

[0145] The current, voltage, power values, transformer oil temperature, circuit breaker status signals, partial discharge signals, and event logs are combined into multi-source heterogeneous simulation monitoring data.

[0146] In this embodiment, the process of generating abnormal diagnostic results is as follows:

[0147] The simulated monitoring data is preprocessed to obtain the simulated monitoring dataset;

[0148] Based on the trained feature extraction network, features are extracted from the simulated monitoring dataset to obtain the deep feature vector of the simulated monitoring dataset;

[0149] The substation current flow simulation model is forward-propagated on the deep feature vector of the simulated monitoring dataset to obtain the prediction results of the simulated monitoring data.

[0150] The anomaly identification model for substation operation status is used to identify the predicted results of simulated monitoring data, and the anomaly diagnosis results of simulated monitoring data are obtained, including abnormal operation status and its confidence score.

[0151] In this embodiment, the process of generating the structured test report is as follows:

[0152] Based on the prediction results of the simulation monitoring data, the current distribution matrix of each branch of the substation is calculated, and the Gaussian kernel density estimation method is used to generate the current distribution heat map.

[0153] Based on the anomaly diagnosis results of simulated monitoring data, the data are integrated according to the timestamp information of the abnormal operating state to construct an anomaly event time sequence map.

[0154] The current distribution heatmap and the time sequence map of abnormal events are integrated into a structured test report.

[0155] To verify the feasibility of this invention in practice, it was applied to the current flow simulation and anomaly detection process of a substation. In this substation, the operation of power equipment is complex, the load fluctuates significantly, and equipment failures and emergencies frequently occur. Therefore, timely and accurate prediction of current flow status and identification of potential anomalies are crucial for ensuring the safe operation of the substation.

[0156] During the actual operation of this substation, the SCADA system and various sensors continuously collect equipment operation data, including real-time monitoring information such as current, voltage, and power. Simultaneously, equipment status information (such as transformer oil temperature and circuit breaker status signals) is constantly changing. To achieve accurate simulation of current flow and effectively identify abnormal states of the substation under different operating conditions, we first preprocessed this multi-source, heterogeneous monitoring data. Specifically, for continuous data such as current, voltage, and power, we used interpolation to fill in missing values, employed median filtering to remove noise, and used Z-score standardization to normalize the data, ensuring consistency and comparability. For discrete data, such as circuit breaker status signals and equipment event logs, we used forward imputation to fill in missing values, employed mode filtering to remove abnormal state transitions, and vectorized the data using one-hot encoding.

[0157] The processed multi-source heterogeneous monitoring data is horizontally concatenated according to timestamps to form multi-dimensional time-series feature vectors. These feature vectors include not only current flow-related data but also equipment status information, thus comprehensively reflecting the substation's operating status. For simulation, we used a sliding window method to sample these feature vectors, generating multiple consecutive time-series sample segments. Each sample segment represents the current flow state within a time window, forming training and validation datasets. The training dataset is used to train the model, while the validation dataset is used to evaluate the model's accuracy and robustness.

[0158] In current flow simulation, we input the processed deep feature vectors into a simulation model based on a Transformer encoder for training. The Transformer encoder can handle long-range dependencies in time-series data, making the simulation of substation current flow more accurate. After training, we obtained a preliminary simulation model. To optimize the simulation results, we calculated the prediction error of the preliminary simulation model based on the validation dataset and used gradient descent to iteratively optimize the model parameters. By continuously adjusting the model parameters, we finally obtained an optimized substation current flow simulation model, which can accurately simulate the current flow of the substation under different operating conditions.

[0159] In terms of anomaly identification, we further constructed an anomaly identification model for substation operation status based on the predicted output of the substation current flow simulation model and combined with an unsupervised anomaly detection algorithm. This model can automatically identify possible abnormal states from the simulation output, including equipment failure, load overload, and current deviation. Specifically, we adopted an SVM algorithm based on radial basis function kernel function, which maps the output of the simulation model to a high-dimensional feature space to maximize the margin between normal and abnormal samples, thereby accurately distinguishing between abnormal and normal states. The training process of this model is based on a validation dataset, and finally, through optimization, we obtained a model that can monitor the substation status in real time and effectively identify anomalies.

[0160] After the system completed training on the current flow simulation and anomaly detection model, we generated corresponding simulated monitoring data for the target test scenarios of the substation. During the generation of this simulated data, we set different operating conditions, load fluctuation curves, and fault types according to the actual operational requirements of the substation. Using methods such as power system dynamic equations and equipment thermodynamic models, we generated simulated monitoring data including current, voltage, and power. This data can realistically reflect the operating status of the substation under different operating conditions and fault conditions.

[0161] Subsequently, we used a trained feature extraction network to extract features from the simulated monitoring data, and then input the extracted deep feature vectors into the substation current flow simulation model for prediction. Through the prediction output of the simulation model, we can simulate the current flow state of the substation under different scenarios, and further input these prediction results into anomaly identification models to obtain anomaly diagnosis results regarding the substation's operating status. Through this process, we can not only obtain accurate predictions of current flow but also promptly identify potential abnormal states, thus providing strong support for the intelligent operation and maintenance of substations.

[0162] Finally, we integrated the predicted outputs and anomaly diagnostic results to generate a structured test report. The report includes a current distribution heatmap, anomaly event time series graphs, and prediction deviation analysis. The current distribution heatmap visually displays the current distribution at different times and locations, while the anomaly event time series graphs show the occurrence times and severity of various anomalies. The prediction deviation analysis helps assess the accuracy and reliability of the simulation model, providing detailed decision-making support for maintenance personnel.

[0163] Through this series of operations, we can accurately simulate the current flow status of substations and identify abnormal situations in real time, thereby effectively improving the intelligent monitoring and fault early warning capabilities of substations and providing strong technical support for ensuring the stable operation of the power grid.

[0164] Table 1. Performance comparison between the substation simulation current-carrying test method based on contrastive learning and traditional methods.

[0165]

[0166] As can be seen from the table above, the method of the present invention is superior to the traditional method in many aspects.

[0167] The prediction accuracy of the method in this invention is 94.5%, a significant improvement compared to the 82.3% of traditional methods. Traditional methods rely on physical models and statistical methods for current flow simulation, but these methods struggle to handle complex nonlinear relationships, resulting in low accuracy under some abnormal conditions. This invention, by introducing deep learning techniques such as a contrastive learning framework and a Transformer encoder, can effectively extract deep-level features from current flow and handle more complex data patterns, thereby improving simulation accuracy.

[0168] In terms of anomaly detection accuracy, the method of this invention also performs excellently, reaching 92.1%, an improvement of nearly 16 percentage points compared to the 75.4% of traditional methods. Traditional methods often rely on preset rules and simple statistical models, making them susceptible to interference from data noise, resulting in low accuracy in anomaly identification. However, by combining the SimCLR contrastive learning framework and SVM anomaly detection, the method of this invention can more accurately learn complex anomaly patterns from large amounts of data, thus significantly improving its anomaly detection performance.

[0169] The computation time of the method in this invention is 31.5 seconds, which is nearly 30% less than the 45.2 seconds of the traditional method. Although this invention uses a deep learning model, thanks to the adoption of a stochastic gradient descent algorithm with momentum and an adaptive learning rate adjustment strategy, it can optimize model parameters in a shorter time. Its efficient feature extraction and model optimization process, as well as reasonable allocation of computing resources, significantly shorten the computation time compared to traditional methods. Especially in scenarios such as substations that require real-time processing of large amounts of monitoring data, the reduction in computation time has very important practical application significance.

[0170] The misclassification rate of the method in this invention is 7.3%, significantly lower than the 22.8% of traditional methods. The higher misclassification rate of traditional methods is mainly due to the poor adaptability of statistical methods when facing complex current flow states and sudden faults, which easily leads to misclassification. In contrast, this invention, through the adaptive learning capability of deep learning, can better identify normal and abnormal data, reducing the occurrence of misclassification.

[0171] According to the table, the F1 score of the method of this invention is 96.2%, which is much higher than the 80.5% of the traditional method. The improvement in the F1 score means that the method of this invention can more balancedly consider precision and recall when identifying abnormal events, ensuring efficient detection of anomalies while reducing the risk of missed detections and false detections.

[0172] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A substation simulated current-carrying test method based on contrastive learning, characterized in that, Includes the following steps: Collect and preprocess multi-source heterogeneous monitoring data during substation operation to construct training and validation datasets; The SimCLR contrastive learning framework is used to construct positive and negative sample pairs based on the training dataset for representation learning, thereby training a feature extraction network and deep feature vectors of the training and validation datasets. A preliminary simulation model with a Transformer encoder as its core is constructed, and the deep feature vectors of the training dataset are used as input for training. Based on the validation dataset, the prediction error of the preliminary simulation model is calculated. The model parameters are then optimized using the gradient descent algorithm to obtain the substation current flow simulation model, which specifically includes: The preliminary simulation model is forward-propagated on the deep feature vectors of the validation dataset to obtain the prediction results of the preliminary simulation model. Evaluation metrics between the prediction results of the preliminary simulation model and the actual values ​​of the validation dataset are calculated, including mean squared error, mean absolute error, and coefficient of determination. Based on the evaluation metrics, a multi-objective optimization decision is adopted, with minimizing the mean squared error as the main optimization objective. At the same time, the mean absolute error is required to be lower than a preset threshold and the coefficient of determination is required to be higher than a preset threshold. When the three metrics simultaneously meet the preset performance conditions, the model is judged to have the best performance. The parameters of the preliminary simulation model are optimized using the momentum stochastic gradient descent algorithm. By calculating the gradient of the loss function with respect to the parameters and combining the momentum term and historical gradient information, all parameters in the preliminary simulation model are updated. An adaptive learning rate adjustment strategy based on the performance of the validation dataset is adopted. When the improvement of the mean squared error is less than a preset threshold, the learning rate is reduced by a predetermined ratio, and all parameters in the preliminary simulation model are updated again. When the performance of the preliminary simulation model simultaneously meets the multi-objective optimization conditions, and the mean square error and mean absolute error are lower than the preset thresholds, and the coefficient of determination is higher than the preset threshold, the current model is saved as a candidate optimal model. If the performance of the preliminary simulation model no longer improves after several consecutive training cycles, then parameter updates are stopped, and the candidate optimal model with the smallest mean square error is selected as the final substation current flow simulation model. Based on the predicted output of the verification dataset on the substation current flow simulation model, an unsupervised anomaly detection algorithm is used to train and construct a substation operation status anomaly identification model, specifically including: Based on the radial basis function kernel function SVM, a substation operation status anomaly identification model is constructed. The substation current flow simulation model is forward propagated on the deep feature vector of the validation dataset. The residual sequence between the prediction results of the substation current flow simulation model and the true values ​​of the validation dataset is calculated and used as the anomaly identification training dataset. A class of SVM algorithms based on radial basis function kernels is adopted to map the anomaly detection training dataset to a high-dimensional feature space through kernel functions; For the three types of abnormal operating states, three binary classification SVM sub-models are constructed. The abnormal operating states include equipment failure, load overload, and current deviation. Each binary SVM sub-model is trained separately. On the anomaly recognition training dataset, the optimal classification hyperplane in the high-dimensional feature space that maximizes the classification margin and minimizes misclassification is found by solving an optimization problem. Based on the optimal hyperplane obtained by the solution, an anomaly recognition decision function is constructed for each binary SVM sub-model to obtain the anomaly operation state classification output by each binary SVM sub-model. The distance from the training samples of the anomaly recognition training dataset to the optimal hyperplane is calculated as the confidence score of anomaly recognition. The abnormal operating state classification and confidence score output by each binary SVM sub-model are superimposed and normalized. The abnormal operating state with the highest confidence score and its confidence score are taken as the final output of the substation operating state anomaly identification model. The kernel function parameters and penalty parameters were optimized by cross-validation, and the model with the highest F1 score was selected as the final substation operation status anomaly identification model after training. Generate corresponding simulated monitoring data based on the target test scenario; The feature extraction network is used to extract features from the simulated monitoring data, the predicted output of the simulated monitoring is obtained through the substation current flow simulation model, and the abnormal diagnosis result is obtained through the substation operation status abnormal identification model. Integrate the predicted outputs from simulation monitoring and the results of anomaly diagnosis to generate a structured test report.

2. The substation simulated current-carrying test method based on contrastive learning according to claim 1, characterized in that, The multi-source heterogeneous monitoring data includes historical data from the SCADA system, real-time sensor monitoring data, and equipment status data; The historical data of the SCADA system includes historical current values, historical voltage values, historical power values, and historical event logs; The real-time sensor monitoring data includes real-time current values, real-time voltage values, and real-time power values; The equipment status data includes transformer oil temperature, circuit breaker status signals, and partial discharge signals.

3. The substation simulated current-carrying test method based on contrastive learning according to claim 1, characterized in that, The construction of the training dataset and validation dataset specifically includes: For continuous data in multi-source heterogeneous monitoring data, including current values, voltage values, power values, transformer oil temperature and partial discharge signals, the nearest neighbor interpolation method is used to fill missing values, median filtering is used to filter out noise, and Z-score standardization is used for standardization. For discrete data in multi-source heterogeneous monitoring data, including circuit breaker status signals and historical event logs, the missing values ​​are filled by forward filling, abnormal state jumps are filtered out by mode filtering, and vectorization is performed by one-hot encoding. Based on the timestamps of the preprocessed multi-source heterogeneous monitoring data, data from the same time point are horizontally spliced ​​to obtain a multi-dimensional time-series feature vector. The multidimensional temporal feature vectors are arranged in chronological order, and the sliding window method is used to sample them to generate multiple consecutive temporal sample segments, which are then divided into training datasets and validation datasets. The training dataset precedes the validation dataset in the timeline.

4. The substation simulated current-carrying test method based on contrastive learning according to claim 1, characterized in that, The training process yields a feature extraction network and deep feature vectors from the training and validation datasets, specifically including: A SimCLR contrastive learning framework is constructed, and two random data augmentations are performed on one sample in each batch of the training dataset. The data augmentation is to randomly truncate the sample in sequence, sample with random step size, and inject random noise to obtain two augmented views as positive sample pairs, while the augmented views of other samples in the same batch are used as negative sample pairs. Feature vectors are obtained by extracting features from all positive and negative sample pairs using a deep convolutional neural network. The NT-Xent loss function is used to maximize the similarity between positive sample pairs and minimize the similarity between negative sample pairs. The average loss of all positive sample pairs in a batch is taken as the total loss. : Where N represents the number of samples in a batch; and These represent the feature vectors of positive sample pairs; This represents the feature vector among all negative sample pairs; This indicates the temperature coefficient used to adjust the contrast loss sensitivity. Indicates an indicator function, The value is 1 when the time is right, and 0 otherwise. Cosine similarity between two vectors; Based on the gradient of the loss function, the Adam optimizer is used to optimize the parameters in the deep convolutional neural network to obtain a trained feature extraction network. By using a feature extraction network to extract features from the training and validation datasets, deep feature vectors of the training and validation datasets are obtained.

5. The substation simulated current-carrying test method based on contrastive learning according to claim 1, characterized in that, A preliminary simulation model based on the Transformer encoder is constructed, including a position calculation layer, an encoder layer, and a decoder layer; By using the position of the time step of the deep feature vector in the training dataset within the dataset, and employing sine and cosine functions to provide positional information for the feature vector, the enhanced deep feature vector is obtained. The enhanced deep feature vector is fed into the encoder layer. The encoder layer consists of multiple identical stacked layers, each composed of a multi-head self-attention sub-layer and a feedforward neural network sub-layer. The multi-head self-attention sub-layer linearly projects the input of the encoder layer onto the query, key, and value space through a randomly generated training parameter matrix of query, key, and value to obtain the projection of the deep feature vector. The projection is then calculated through the multi-head self-attention mechanism, and the outputs of all attention heads are concatenated and linearly transformed to obtain the attention output. The attention output is nonlinearly transformed through a feedforward neural network sublayer to obtain the neural network output. The feedforward neural network sublayer includes two linear transformations and an activation function. The output of the neural network is processed by residual connections and layer normalization to obtain the output of one layer in the encoder layer. The output of the previous layer is used as the input of the next layer. After multiple layers of encoding, the feature matrix is ​​obtained. The feature matrix output by the encoder layer is decoded by the decoder layer to obtain the prediction results of the training dataset. The decoder layer consists of a fully connected layer.

6. The substation simulated current-carrying test method based on contrastive learning according to claim 1, characterized in that, The generation of corresponding simulated monitoring data based on the target test scenario specifically includes: Based on the actual operation requirements of substations, the target test scenario is abstracted and quantified into specific parameters. For different operating conditions, the corresponding reference voltage, rated current, maximum power, reference power factor, load fluctuation amplitude, load fluctuation cycle parameter, load fluctuation random factor, fault type, fault start time, fault duration, and fault severity are specified to obtain the parameters corresponding to the target test scenario. Based on the dynamic equations of the power system, current, voltage, and power values ​​are generated according to the parameters corresponding to the target test scenario. Based on thermodynamic equations and equipment characteristics, a transformer oil temperature model is constructed to generate transformer oil temperature data; The circuit breaker operation sequence is generated based on changes in current, voltage, and power values. The circuit breaker operation sequence includes three states: open, closed, and in operation. The circuit breaker status signal is generated according to the correspondence between the circuit breaker status and the circuit breaker status signal. Generating partial discharge signals based on random pulse sequences: in, Indicates the discharge amplitude. This indicates the time of the i-th discharge. Indicates a discharge pulse. This represents the discharge decay time constant, and N represents the total number of discharge pulses. This represents the intensity of the partial discharge signal at time t; Based on the fault type, fault start time, fault duration, and fault severity, an event log is generated based on circuit breaker status changes and threshold triggers. The current, voltage, power values, transformer oil temperature, circuit breaker status signals, partial discharge signals, and event logs are combined into multi-source heterogeneous simulation monitoring data.

7. The substation simulated current-carrying test method based on contrastive learning according to claim 1, characterized in that, The generation of the abnormal diagnostic results specifically includes: The simulated monitoring data is preprocessed to obtain the simulated monitoring dataset; Based on the trained feature extraction network, features are extracted from the simulated monitoring dataset to obtain the deep feature vector of the simulated monitoring dataset; The substation current flow simulation model is forward-propagated on the deep feature vector of the simulated monitoring dataset to obtain the prediction results of the simulated monitoring data. The anomaly identification model for substation operation status is used to identify the predicted results of simulated monitoring data, and the anomaly diagnosis results of simulated monitoring data are obtained, including abnormal operation status and its confidence score.

8. The substation simulated current-carrying test method based on contrastive learning according to claim 1, characterized in that, The generation of the structured test report specifically includes: Based on the prediction results of the simulation monitoring data, the current distribution matrix of each branch of the substation is calculated, and the Gaussian kernel density estimation method is used to generate the current distribution heat map. Based on the anomaly diagnosis results of simulated monitoring data, the data are integrated according to the timestamp information of the abnormal operating state to construct an anomaly event time sequence map. The current distribution heatmap and the time sequence map of abnormal events are integrated into a structured test report.