Intelligent substation secondary equipment fault positioning method based on improved Transform

By introducing an improved Transformer model, including THA and ICB modules, in the fault location model of smart substations, the inefficiency problem of existing models in dealing with dynamic topology and high-dimensional complex data is solved, and more efficient fault location and real-time requirements are achieved.

CN119807982AActive Publication Date: 2025-04-11SICHUAN UNIVERSITY OF SCIENCE AND ENGINEERING

Patent Information

Application Number
CN202510298129.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-04-11
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

The existing secondary equipment fault positioning model of smart substations is difficult to cope with the dynamic changes in the substation topology, it is difficult to fully capture global features, and has low computational efficiency when processing high-dimensional complex data.

Method used

Using the improved Transformer model, by introducing THA module and ICB module, feature interaction capabilities and multi-scale feature extraction capabilities are improved, and convolutional paths are dynamically modulated to enhance the processing capabilities of high-dimensional complex data.

Benefits of technology

It significantly improves the overall efficiency of fault location, reduces the need for manual intervention, and meets the real-time requirements in practical applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807982A_ABST
    Figure CN119807982A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent substation secondary equipment fault positioning method based on an improved Transform. The method comprises the following steps: constructing an improved Transform model; training is carried out on the constructed and improved Transform model; judging whether a fault on-line diagnosis threshold value is reached or not, and inputting an unknown fault category sample Ftest into an improved Transform model when the fault on-line diagnosis threshold value is reached; and calculating the probability distribution of the fault sample belonging to each fault category by using an improved Transform model, thereby realizing the fault positioning of the fault sample. The fault positioning method can deal with high-dimensional complex feature processing, can meet the real-time requirement in practical application, remarkably improves the overall efficiency of fault processing, and reduces the requirement of manual intervention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a secondary equipment fault locating method, in particular to a secondary equipment fault locating method for an intelligent substation based on an improved Transformer. Background Art

[0002] Since the release of the national standard "Technical Guidelines for Smart Substations" in 2013, smart substations have been widely used across the country, marking that my country's power system has officially entered a new era of intelligent development, and smart substations have become an indispensable part of the power system. In smart substations, the stability of secondary equipment has a direct impact on the safe and stable operation of the substation and even the entire power grid. Since secondary equipment failures are usually accompanied by the interaction of a large number of devices and alarm signals, accurately locating secondary equipment failures has become a key technical challenge to ensure the safe and stable operation of the power system.

[0003] Early smart substation secondary equipment failures relied on regular inspections and historical experience judgments by staff, resulting in long response times, high workload, and the accuracy of positioning was easily affected by human factors. In order to improve the accuracy of fault location and reduce the workload of staff, the existing technology uses the Apriori association rule mining algorithm to screen evaluation indicators, uses the attribute hierarchy analysis method and anti-entropy weight method to calculate the subjective and objective weights, and obtains the combined weights based on the cooperative game model, and finally constructs a cloud-based power grid secondary equipment risk assessment model. Although certain results have been achieved in the location of secondary equipment faults, these methods are not only highly dependent on prior knowledge, but also difficult to adapt to the complexity and dynamic variability of the system.

[0004] In recent years, artificial intelligence algorithms have gradually been applied to fault location research due to their advantages in dealing with nonlinear mapping problems. A fault location method based on probabilistic neural networks (PNN) is proposed in the prior art. However, the performance of PNN is greatly affected by the selection of smoothing factors, which can easily lead to unstable model performance during training. The prior art also proposes to use GRU to realize secondary equipment fault location, which effectively alleviates the problem of gradient vanishing and explosion in RNN. However, in smart substations, due to the wide variety of secondary equipment, the fault characteristics are diverse, and GRU cannot fully capture the global features in the data.

[0005] Based on the status of the above-mentioned existing technologies, it can be seen that the current intelligent substation secondary equipment fault location model implemented based on artificial intelligence algorithms has the following problems: 1) The existing model is difficult to cope with the dynamic changes in the substation topology, which makes it difficult to ensure the adaptability and accuracy of the original model when the configuration or topology is adjusted; 2) With the diversification of fault characteristics, it is difficult for the existing model to fully capture the global characteristics; 3) The existing model may face the problem of low computational efficiency when processing high-dimensional and complex data. Summary of the invention

[0006] The purpose of the invention is to provide a method for locating secondary equipment faults in an intelligent substation based on an improved Transformer, which can cope with high-dimensional complex feature processing, meet the real-time requirements in practical applications, and significantly improve the overall efficiency of fault handling and reduce the need for manual intervention.

[0007] Technical solution: The improved transformer intelligent substation secondary equipment fault location method of the present invention comprises the following steps: Step 1, constructing an improved Transformer model for substation secondary equipment fault location; Step 2: Use the fault sample set to train the constructed improved Transformer model; Step 3: Determine in real time whether the fault online diagnosis threshold is reached. If it is not reached, notify the staff to perform manual reasoning to obtain the fault source. If it is reached, the fault feature set is generated. F i As a sample of unknown fault category F test Input into the trained improved Transformer model; Step 4: The trained improved Transformer model calculates the probability distribution of the fault samples belonging to various fault categories, and selects the category with the highest probability as the fault category, thereby realizing the fault location of the fault samples.

[0008] Furthermore, in step 1, the constructed improved Transformer model includes a THA module, an ICB module, a first RC&LN module, an FFN module, a second RC&LN module, a linear layer and a Softmax module; the THA module processes the input feature data, and the processed feature data is sent to the ICB module and the first RC&LN module respectively, the ICB module extracts important features, and sends the extracted important features to the first RC&LN module, the first RC&LN module performs residual connection and layer normalization processing on the two input data and then sends them to the FFN module, the FFN module extracts complex features, and then the second RC&LN module performs residual connection and layer normalization processing on the extracted complex features and then sends them to the linear layer, the linear layer maps the hidden layer representation of the input data to the output space of the fault location task, and finally generates the probability distribution of each fault location through the Softmax module, and outputs the final fault location.

[0009] Furthermore, in step 2, the specific steps of training the constructed improved Transformer model using the fault sample set are: Step 2.1, obtain the fault sample set as , where F i For the i The fault feature set of fault samples, N is the total number of fault samples, Indicates i The category label to which the fault samples belong, C is the total number of fault categories; Step 2.2, input the fault feature set into the constructed improved Transformer model to generate the probability distribution of each fault category: , where Fault signature set F i Belongs to the fault category j The predicted probability of Step 2.3, use the cross entropy loss function to train the improved Transformer model. The cross entropy loss function is: , where B is the number of fault samples in the fault sample set, δ ( Y i ,j ) is the indicator function, when Y i = j hour, δ ( Y i ,j)=1, otherwise it is 0, log means natural logarithm.

[0010] Furthermore, in step 3, the fault online diagnosis threshold is obtained by evaluating the historical fault feature information, and the specific steps are as follows: First, each group of historical fault feature information of the substation to be evaluated within the evaluation period is obtained. Each group of historical fault feature information is a string of feature information data consisting of 0 and / or 1. Each digit in the feature information data represents the situation information of each monitoring point of the substation. Data 1 indicates that the corresponding abnormal situation occurs at the monitoring point, and data 0 indicates that the corresponding abnormal situation does not occur at the monitoring point. Then, the obtained historical fault feature information is statistically analyzed to obtain the number of record groups of historical fault feature information within the evaluation period and the number of data 1 in each group of historical fault feature information. Z j , and then find the number Z j The maximum value in Zmax and the minimum value Z ; Then the characteristic information recording frequency is calculated according to the number of record groups: P times / year, and then calculate the average value of data 1 in each group of historical fault feature information Zx ; Finally, the evaluation formula for the fault online diagnosis threshold is established as follows: , where K 1. K 2 and K 3 are adjustment coefficients, which are used to fine-tune the output fault online diagnosis threshold. R is the threshold value, which is used to adjust the intervention threshold of online diagnosis.

[0011] Furthermore, in step 3, the fault feature set formed F i for: , where is the self-check feature subset, is a subset of fault alarm features, is the process layer state feature subset, is a subset of communication layer state features; Self-check feature subset Comprehensive hardware module self-test information , Memory abnormal information And communication module self-test information , the formula is: , where are the total number of measurement and control devices, protection devices, merging units, and intelligent terminals, respectively. Respectively kA measurement and control device, l A protective device, m Merging units and n Hardware self-check alarm of smart terminal devices, Respectively k A measurement and control device, l A protective device, m Merging units and n The storage abnormality alarm of each smart terminal device, Respectively k A measurement and control device, l A protective device, m Merging units and n The communication module self-check alarm of each intelligent terminal device; Fault alarm feature subset Integrated sampling fault alarm , trip fault alarm , communication warning signal 、Body alarm signal , the formula is: , where The total number of devices including measurement and control devices, protection devices, merging units, intelligent terminals and switches, Respectively k A measurement and control device, l A protective device, m Merging units and n Sampling fault alarm of smart terminal devices, For the l Protection action failure alarm of each protection device, Respectively k A measurement and control device, l A protective device, m Merged units, n Smart terminal devices and o Communication failure alarm of each switch. Respectively k A measurement and control device, l A protective device, m Merging units and n The main body fault alarm of each intelligent terminal device; State feature subset Contains current sampling value , voltage sampling value And the abnormal state of the switch , the formula is: , where They are the current values ​​of phase A, phase B, and phase C in channel 1, They are the current values ​​of phase A, phase B, and phase C in channel 2, They are the voltage values ​​of phase A, phase B, and phase C in channel 1, are the voltage values ​​of phase A, phase B and phase C in channel 2, respectively, and are the total number of devices of the measurement and control device, protection device and merging unit, respectively. For the k A measurement and control device, l The first protection device and the m Switching signal related to the state of each merging unit; Communication layer status feature subset Used to comprehensively reflect various status information of the communication layer, including SV message anomalies , GOOSE message abnormality And possible switch status abnormality , the formula is: , where The total number of devices including measurement and control devices, protection devices, merging units, intelligent terminals and switches, Respectively l A protective device, m Merged units, n SV message abnormal alarm of intelligent terminal devices, Respectively k A measurement and control device, l A protective device, m Merged units, n GOOSE message abnormal alarm of smart terminal devices, Respectively o The port status, network traffic status, and link detection status of each switch.

[0012] Furthermore, in step 4, the calculation formula for selecting the category with the highest probability is: , where For test samples F test The predicted category, For test samples F test Belongs to category j The predicted probability of To solve Largest category index j .

[0013] Furthermore, the calculation formula of the THA module is: , where Q, K and V are query vector, key value vector and value vector respectively.W o is the learnable weight matrix, h For the attention head head The total number of attention heads head The calculation formula is: , where head i For the output of each attention head, P w and P l are two different linear projection matrices, and Respectively i The query transformation matrix and key transformation matrix of the head, is the query factor, softmax The function is used to convert similarity into probability distribution.

[0014] Furthermore, the calculation formula of the ICB module is: , where A 1 and A 2 are the first interaction feature and the second interaction feature respectively, Conv 3 is the third convolutional layer, the first interactive feature A 1 and the second interaction feature A 2 The calculation formula is: , , where is the timing characteristics of the THA module output, Conv 1 is a small kernel convolution, which is used to extract fine-grained local features. Conv 2 is a large kernel convolution, which is used to capture global dependencies. is the GeLU activation function, Represents an element-wise multiplication operation.

[0015] Compared with the prior art, the present invention has the following beneficial effects: (1) by introducing the THA module into the improved Transformer model, the feature interaction capability of the improved Transformer model is effectively improved, so that it can still maintain high adaptability and accuracy when the substation topology structure changes dynamically; (2) by using the ICB model to extract local fine-grained features through small kernel convolution and obtain global context information through large kernel convolution, it can fully capture the characteristics of feature information of different scales under the diversified fault characteristics and add it to the output of the THA module, which significantly improves the comprehensiveness and accuracy of feature expression. The ICB module dynamically modulates the convolution path, promotes the complementary fusion of multi-scale features, and effectively enhances the improved Transformer model's ability to process high-dimensional complex data; (3) the improved Transformer model can not only cope with high-dimensional complex feature processing, but also meet the real-time requirements in practical applications, and significantly improve the overall efficiency of fault processing, reducing the need for manual intervention. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of the fault location method of the present invention; Figure 2 This is a structural diagram of the improved Transformer model of the present invention; Figure 3 It is a structural diagram of the ICB module of the present invention; Figure 4 This is a diagram showing the positioning effect of the improved Transformer of the present invention; Figure 5 It is the line interval topology diagram of the 220KV intelligent substation of the present invention; Figure 6 is the accuracy and loss function value curve of the present invention; Figure 7 This is the structure diagram of the traditional Transformer model. DETAILED DESCRIPTION

[0017] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.

[0018] like Figure 1 As shown, the method for locating faults of secondary equipment in a smart substation based on an improved Transformer disclosed in the present invention comprises the following steps: Step 1, constructing an improved Transformer model for substation secondary equipment fault location; Step 2: Use the fault sample set to train the constructed improved Transformer model; Step 3: Determine in real time whether the fault online diagnosis threshold is reached. If it is not reached, notify the staff to perform manual reasoning to obtain the source of the fault. When performing manual reasoning, the fault source is inferred based on the existing secondary equipment fault knowledge base. If the fault online diagnosis threshold is reached, the fault feature set is generated. F i As a sample of unknown fault category F test Input into the trained improved Transformer model; Step 4: The trained improved Transformer model calculates the probability distribution of the fault samples belonging to various fault categories, and selects the category with the highest probability as the fault category, thereby realizing the fault location of the fault samples.

[0019] Furthermore, in step 1, the improved Transformer model constructed includes a THA module, an ICB module, a first RC&LN module, a FFN module, a second RC&LN module, a linear layer and a Softmax module, such as Figure 2 As shown in the figure, the THA module processes the input feature data, and the processed feature data are sent to the ICB module and the first RC&LN module respectively. The ICB module extracts important features and sends the extracted important features to the first RC&LN module. The first RC&LN module performs residual connection and layer normalization on the two input data and then sends them to the FFN module. The FFN module extracts complex features, and then the second RC&LN module performs residual connection and layer normalization on the extracted complex features and then sends them to the linear layer. The linear layer maps the hidden layer representation of the input data to the output space of the fault location task. Finally, the Softmax module generates the probability distribution of each fault location and outputs the final fault location.

[0020] The THA module replaces the original MHA of the traditional Transformer, enhances the model's feature interaction capabilities, and improves the model's adaptability and accuracy.

[0021] The ICB module combines small-kernel convolution with large-kernel convolution to extract local fine-grained features and global contextual information respectively, thereby effectively capturing features of different scales and enhancing the model's ability to express complex features. At the same time, ICB promotes the complementary fusion of multi-scale features by dynamically modulating the convolution path, thereby improving the model's comprehensive utilization efficiency of high-dimensional features.

[0022] Both the first RC&LN module and the second RC&LN module are used to solve the gradient vanishing and explosion problems during model training, speed up model training and improve model performance.

[0023] The FFN module is used to perform nonlinear transformation on the features after attention calculation, so that the model can learn more complex feature representations.

[0024] The linear layer converts the features extracted from the model into the final prediction result, that is, the probability distribution of the fault location. In the fault location task, the output of the linear layer is the probability distribution of each fault location.

[0025] The Softmax operation maps the score of each location to between 0 and 1 and ensures that the sum of the probabilities of all locations is 1, so that the model can output the predicted probability of each fault location.

[0026] Furthermore, in step 2, the specific steps of training the constructed improved Transformer model using the fault sample set are: Step 2.1, obtain the fault sample set as , where F i For the i The fault feature set of fault samples, N is the total number of fault samples, Indicates i The category label to which the fault samples belong, C is the total number of fault categories; Step 2.2, input the fault feature set into the constructed improved Transformer model to generate the probability distribution of each fault category: , where Fault signature set F i Belongs to the fault category j The predicted probability of Step 2.3, use the cross entropy loss function to train the improved Transformer model. The cross entropy loss function is: , where B is the number of fault samples in the fault sample set, δ ( Y i ,j ) is the indicator function, when Y i = j hour, δ ( Y i ,j )=1, otherwise it is 0, log means natural logarithm.

[0027] Furthermore, in step 3, the fault online diagnosis threshold is obtained by evaluating the historical fault feature information, and the specific steps are as follows: First, obtain each group of historical fault feature information of the substation to be evaluated within the evaluation period. Each group of historical fault feature information is a string of feature information data composed of 0 and / or 1. Each digit in the feature information data represents the situation information of each monitoring point of the substation. Data 1 indicates that the corresponding abnormal situation occurs at the monitoring point, and data 0 indicates that the corresponding abnormal situation does not occur at the monitoring point. The number of digits of the feature information data is consistent with the number of monitoring points of the current substation. The evaluation period is set to 1 year, that is, all historical fault feature information within 1 year before the current time is obtained. If the recording time of the historical fault feature information is less than 1 year, all historical fault feature information is counted; The monitoring point situation information includes protection device locking, protection device action, intelligent terminal feedback, circuit breaker action, merging unit device abnormality, merging unit self-test alarm, merging unit SV data abnormality, merging unit self-test circuit error, merging unit double position input inconsistency, merging unit sampling abnormality, merging unit synchronization signal interruption, etc. The monitoring point situation information varies according to the substation settings. There are differences in the monitoring points of substations of different sizes. Therefore, the fault online diagnosis threshold of each substation needs to be customized; Then, the obtained historical fault feature information is statistically analyzed to obtain the number of record groups of historical fault feature information within the evaluation period and the number of data 1 in each group of historical fault feature information. Z j , and then find the number Z j The maximum value in Zmax and the minimum value Z ; Then the characteristic information recording frequency is calculated according to the number of record groups: P times / year, and then calculate the average value of data 1 in each group of historical fault feature information Zx ; Finally, the evaluation formula for the fault online diagnosis threshold is established as follows: , where K 1. K 2 and K 3 are adjustment ratio coefficients, which are used to fine-tune the output fault online diagnosis threshold so that the output values ​​of the stages are R is the threshold value, which is used to adjust the intervention threshold of online diagnosis.

[0028] By setting the fault online diagnosis threshold, it is possible to avoid frequent intervention of the positioning method for automatic calculation due to a small number of erroneous alarm messages; by setting the threshold value R It can improve the threshold as a whole and avoid frequent intervention of online diagnosis, thus distinguishing it from manual diagnosis.

[0029] Furthermore, in step 3, the fault feature set formed Fi for: , where is the self-check feature subset, is a subset of fault alarm features, is the process layer state feature subset, is a subset of communication layer state features; Self-check feature subset Comprehensive hardware module self-test information , Memory abnormal information And communication module self-test information , the formula is: , where are the total number of measurement and control devices, protection devices, merging units, and intelligent terminals, respectively. Respectively k A measurement and control device, l A protective device, m Merging units and n Hardware self-check alarms of smart terminal devices, such as I / O board hardware failures, power supply abnormality alarms, etc. Respectively k A measurement and control device, l A protective device, m Merging units and n Memory abnormality alarms of smart terminal devices, such as FLASH errors, internal memory abnormalities, etc. Respectively k A measurement and control device, l A protective device, m Merging units and n The communication module self-check alarm of each intelligent terminal device, such as GOOSE board X network abnormality, SV board communication interruption, etc. Fault alarm feature subset Integrated sampling fault alarm , trip fault alarm , communication warning signal 、Body alarm signal , the formula is: , where The total number of devices including measurement and control devices, protection devices, merging units, intelligent terminals and switches, Respectively k A measurement and control device, l A protective device, m Merging units and n Sampling fault alarms of smart terminal devices, such as abnormal SV data, invalid SV sending quality, etc. For thel Protection action fault alarm of each protection device, such as protection device lockout, differential protection lockout, etc. Respectively k A measurement and control device, l A protective device, m Merged units, n Smart terminal devices and o Communication fault alarms of switches, such as abnormal communication, VLAN allocation errors, etc. Respectively k A measurement and control device, l A protective device, m Merging units and n The main body fault alarm of each intelligent terminal device, such as self-test alarm, device operation abnormality, etc. State feature subset Contains current sampling value , voltage sampling value And the abnormal state of the switch , the formula is: , where They are the current values ​​of phase A, phase B, and phase C in channel 1, They are the current values ​​of phase A, phase B, and phase C in channel 2, They are the voltage values ​​of phase A, phase B, and phase C in channel 1, are the voltage values ​​of phase A, phase B and phase C in channel 2, respectively, and are the total number of devices of the measurement and control device, protection device and merging unit, respectively. For the k A measurement and control device, l The first protection device and the m The switch quantity signals related to the status of the merging units, such as abnormal input switch quantity, abnormal output signal, etc. Communication layer status feature subset Used to comprehensively reflect various status information of the communication layer, including SV message anomalies , GOOSE message abnormality And possible switch status abnormality , the formula is: , where The total number of devices including measurement and control devices, protection devices, merging units, intelligent terminals and switches, Respectively l A protective device, m Merged units, n SV message abnormal alarm of each intelligent terminal device, such as SV general alarm, SV board X network abnormality, etc. Respectivelyk A measurement and control device, l A protective device, m Merged units, n GOOSE message abnormality alarm of each intelligent terminal device, such as GOOSE data abnormality, GOOSE communication abnormality, etc. Respectively o The port status, network traffic status and link detection status of each switch, such as broadcast storm alarm, traffic anomaly, etc.

[0030] Furthermore, in step 4, the calculation formula for selecting the category with the highest probability is: , where For test samples F test The predicted category, For test samples F test Belongs to category j The predicted probability of To solve Largest category index j .

[0031] Furthermore, the calculation formula of the THA module is: , where Q, K and V are query vector, key value vector and value vector respectively. W o is the learnable weight matrix, h For the attention head head The total number of attention heads head The calculation formula is: , where head i For the output of each attention head, P w and P l are two different linear projection matrices, and Respectively i The query transformation matrix and key transformation matrix of the head, is the query factor, softmax The function is used to convert similarity into probability distribution.

[0032] Furthermore, the structure of the ICB module is as follows Figure 3 As shown, the calculation formula of the ICB module is: , where A 1 and A 2 are the first interaction feature and the second interaction feature respectively, Conv3 is the third convolutional layer, the first interactive feature A 1 and the second interaction feature A 2 The calculation formula is: , , where is the timing characteristics of the THA module output, Conv 1 is a small kernel convolution, which is used to extract fine-grained local features. Conv 2 is a large kernel convolution, which is used to capture global dependencies. is the GeLU activation function, Represents an element-wise multiplication operation.

[0033] In order to verify the positioning effect of the fault location method of the present invention, a typical 220KV smart substation line interval is taken as the research object, and the secondary equipment such as protection and measurement and control are analyzed using the "direct sampling and direct jump" mode. The topological structures involved are as follows: Figure 5 As shown in Table 1. Based on the actual test cases of the Electric Power Research Institute, 2730 fault samples were collected, covering 28 fault conditions. Each fault type is classified according to the number shown in Table 1. In addition, the fault feature set F i A total of 204 secondary equipment fault feature information are included. In order to ensure the effectiveness of the experiment, the present invention randomly divides these fault samples into training sets and test sets in a ratio of 8:2 for model training and evaluation.

[0034] Table 1 is a statistical table of secondary equipment failure types and numbers

[0035] Since the feature information has dimensional differences, all input quantities need to be Max-Min normalized before model training. The normalization range is [0,1] and the normalization formula is: , where is the result after data normalization, x is the original input data, and are the maximum and minimum values ​​of the original data respectively.

[0036] This paper uses the model performance evaluation indicators commonly used in classification tasks to verify the performance of the proposed model, as follows: (1) Accuracy , which represents the proportion of samples correctly predicted by the model in all predictions, and the calculation formula is: ; (2) Accuracy P, which represents the proportion of samples that actually belong to the fault category among the samples predicted by the model as faults. The calculation formula is: ; (3) Recall rate , which represents the proportion of samples that actually belong to the fault category and are correctly identified as faults by the model. The calculation formula is: ; (4) F1 score is used to comprehensively measure the balance between the accuracy and coverage of the model. The calculation formula is: ; In the above four formulas, TP represents the number of samples correctly predicted as positive, TN represents the number of samples correctly predicted as negative, FP represents the number of samples that are actually negative but mistakenly predicted as positive (i.e., false positive), and FN represents the number of samples that are actually positive but mistakenly predicted as negative (i.e., missed negative).

[0037] The experimental environment of this invention adopts Windows 11 operating system, NVIDIA RTX3060 graphics card, the algorithm model uses Python 3.6.13 as the programming language, and the model is built based on the deep learning framework Pytorch.

[0038] In order to avoid over-training or under-training of the model, experiments were conducted on the effect of the number of iterations on the fault localization performance. Figure 6 As shown in the figure, as the number of iterations increases, the accuracy and loss value of the model show a trend of continuous change. Especially when the number of iterations approaches 300, the accuracy and loss function values ​​tend to be stable, and the change range is significantly reduced, which indicates that the model has basically converged at this time. In order to ensure that the model can fully converge, the maximum number of iterations is set to 600 in subsequent experiments.

[0039] Since the performance of the optimizer in gradient descent may significantly affect the training efficiency and final performance of the model, the present invention conducts comparative analysis on the performance of multiple typical optimizers through experiments, thereby selecting the optimizer that is most suitable for subsequent experiments to ensure the efficiency and reliability of model training. The experimental results are shown in Table 2. From the perspective of the accuracy of comprehensive model positioning and the time consumption of model training in Table 2, the SGD optimizer performs relatively balanced. Therefore, in subsequent experiments, the present invention chooses to use the SGD optimizer.

[0040] Table 2 is a statistical table of fault location accuracy when using different optimizers

[0041] In order to explore the effect of hyperparameters on model performance, this paper takes the traditional Transformer model as the baseline and conducts selection experiments on the hyperparameters of attention heads, learning rate lr, and batch_size. The experimental results are shown in Table 3.

[0042] As can be seen from Table 3, when Head=4 and batch_size=16, the performance indicators of the model reach the best level when lr=0.1, indicating that this learning rate can effectively balance the optimization speed and stability. When the learning rate increases to lr=0.5, the model accuracy drops to 85.37%, which may be because too large a learning rate can cause the model gradient to be unstable or explode. When the learning rate decreases, that is, when lr=0.01 and lr=0.05, although the model can converge stably, the model performance is slightly lower than lr=0.1. Therefore, an appropriate learning rate can better improve the model performance.

[0043] When Head=4 and lr=0.1, the batch size has a significant impact on model performance and training time. Experiments show that when the batch size is 16, the model performance is optimal and the training time is moderate, meeting the actual task requirements. Reducing the batch size to 8 will significantly increase the training time, while increasing it to 32 will shorten the training time, but the model performance will decrease, indicating that an excessively large batch size may lead to inaccurate gradient estimation and affect the model effect.

[0044] When batch_size=16 and lr=0.1, the model performance is best when Head=4, with an accuracy of 97.56%. When the number of heads is reduced to Head=2, the model performance drops to 96.22%, indicating that too few attention heads limit the ability of feature interaction. When it is increased to Head=6, the accuracy is only increased to 97.07%, but the training time is significantly increased, indicating that too many attention heads will increase the computational complexity rather than significantly improve the performance.

[0045] Table 3 is the statistical table of hyperparameter selection experiments

[0046] In summary, the traditional Transformer model has the best performance when Head=4, batch_size=16, and lr=0.1. Subsequent experiments on improving the model will be carried out based on this parameter setting to evaluate the effectiveness of the improvement measures on model performance.

[0047] In order to verify the effectiveness of the positioning method proposed in the present invention, the present invention adopts the model parameters when the above model has the best performance, and conducts experimental verification. The positioning effect is as follows: Figure 4 In addition, in order to verify the performance of the improved Transformer model constructed by the present invention, the performance index accuracy is further calculated. A cc , precision P, recall R cAnd F1 score, and compared with the commonly used models in this field, such as Fully Convolutional Networks (FCN), deep neural network (DNN), GRU (Gated Recurrent Unit), Transformer and other models, the experimental results are shown in Table 4. It can be seen that the various performance indicators of the improved Transformer model constructed by the present invention are higher than those of FCN, DNN, GRU and Transformer. This result shows that the improved Transformer model constructed by the present invention can accurately classify and identify fault samples in the secondary equipment fault location task, thereby reducing false positives and negatives. Although compared with other models, the improved Transformer model constructed by the present invention has an increase in processing time, but the time difference is small, and it can still meet the real-time requirements in practical applications, and significantly improve the overall efficiency of fault handling, reducing the need for manual intervention.

[0048] Table 4 is a statistical table of comparative experimental results

[0049] The present invention also verifies the effectiveness of each optimization module on the constructed improved Transformer model through ablation experiments, and specifically sets the following experiments: Experiment 1: The unmodified traditional Transformer is used as a baseline comparison to evaluate the performance of the model without any optimization. Figure 7 shown.

[0050] Experiment 2: The traditional MHA is replaced by the THA module of the present invention to verify the effectiveness of the THA module in enhancing feature interaction capabilities and global feature expression.

[0051] Experiment 3: Add an ICB module after the MHA of the traditional Transformer to verify the role of the ICB module in multi-scale feature extraction, feature fusion, and computational efficiency improvement.

[0052] Experiment 4: Replace the traditional MHA with the THA module and apply it in conjunction with the ICB module to comprehensively evaluate the effect of the collaborative optimization of the THA module and the ICB module, especially in terms of the enhancement of fault feature extraction accuracy and overall model performance.

[0053] Table 5 is a comparative experimental statistics table

[0054] As shown in Table 5, by comparing experiments 1-4, it can be seen that experiment 1 has the worst performance in all indicators, which indicates that the traditional Transformer model has obvious deficiencies in feature extraction and global information expression capabilities; by comparing the results of experiments 1 and 2, it can be seen that the addition of the THA module has significantly improved the performance of the traditional Transformer model, especially the accuracy and recall rates, which have increased by 0.64% and 0.66% respectively, verifying that the THA module enhances the Head feature interaction capability while also enhancing the model's comprehensive utilization of feature subspaces, and improving the model's ability to extract key features in complex classification tasks; by comparing experiments 1 and 3, it can be seen that adding ICB after the MHA of the traditional Transformer The module further improves the multi-scale feature extraction capability of the Transformer model, and improves the accuracy and recall of the Transformer model by 0.37% and 0.27% respectively. By comparing experiments 1 and 4, it can be seen that the comprehensive utilization capability of the high-dimensional features of the improved Transformer model of the present invention significantly improves the fault location performance of the Transformer model, and improves the accuracy, precision, recall and F1 score by 1.34%, 1.25%, 1.49% and 1.23% respectively compared with the traditional Transformer.

[0055] In summary, the present invention aims to solve the problems of the current smart substation secondary equipment fault location model, which is difficult to cope with the dynamic changes of the substation topology structure, difficult to fully capture global features, and may face low computational efficiency when processing high-dimensional and complex data. The improved Transformer model is disclosed and its effectiveness is verified through experiments. The specific conclusions are as follows: (1) This paper introduces the THA module to replace the MHA of the traditional model, effectively improving the feature interaction capability of the Transformer model, so that it can still maintain high adaptability and accuracy when the substation topology changes dynamically. Experimental results show that compared with the traditional Transformer model, the THA module solves the problem of cross-head feature interaction, making the feature information obtained by different heads no longer independent of each other, and enhancing the comprehensive utilization of the feature subspace.

[0056] (2) The ICB model is used to extract local fine-grained features through small kernel convolution and obtain global context information through large kernel convolution. It can fully capture the characteristics of feature information of different scales under the diversified fault characteristics and add them to the output of the THA module, which significantly improves the comprehensiveness and accuracy of feature expression. At the same time, the ICB module dynamically modulates the convolution path, promotes the complementary fusion of multi-scale features, and effectively enhances the Transformer model's ability to process high-dimensional complex data.

[0057] (3) Compared with the Transformer, FCN, GRU, DNN and other models commonly used in the current research in this field, the improved Transformer model proposed in the present invention can not only cope with high-dimensional complex feature processing, but also meet the real-time requirements in practical applications, and significantly improve the overall efficiency of fault handling and reduce the need for manual intervention.

[0058] Experimental results show that the improved Transformer model proposed in this paper is not only significantly better than the traditional method in performance in the task of locating secondary equipment faults in smart substations, but also meets the real-time requirements in practical applications in terms of efficiency. This provides reliable support for the safe operation and efficient management of smart grids.

[0059] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes in form and details may be made without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. A method for locating faults of secondary equipment in smart substation based on improved Transformer, characterized in that: The steps include: Step 1, constructing an improved Transformer model for substation secondary equipment fault location; Step 2: Use the fault sample set to train the constructed improved Transformer model; Step 3: Determine in real time whether the fault online diagnosis threshold is reached. If it is not reached, notify the staff to perform manual reasoning to obtain the fault source. If it is reached, the fault feature set is generated. F i As a sample of unknown fault category F test Input into the trained improved Transformer model; Step 4: The trained improved Transformer model calculates the probability distribution of the fault samples belonging to various fault categories, and selects the category with the highest probability as the fault category, thereby realizing the fault location of the fault samples.

2. The method for locating faults of secondary equipment in smart substation based on improved Transformer according to claim 1 is characterized in that: In step 1, the constructed improved Transformer model includes a THA module, an ICB module, a first RC&LN module, an FFN module, a second RC&LN module, a linear layer and a Softmax module; the THA module processes the input feature data, and the processed feature data is sent to the ICB module and the first RC&LN module respectively. The ICB module extracts important features and sends the extracted important features to the first RC&LN module. The first RC&LN module performs residual connection and layer normalization processing on the two input data and then sends them to the FFN module. The FFN module extracts complex features, and then the second RC&LN module performs residual connection and layer normalization processing on the extracted complex features and then sends them to the linear layer. The linear layer maps the hidden layer representation of the input data to the output space of the fault location task. Finally, the Softmax module generates the probability distribution of each fault location and outputs the final fault location.

3. The method for locating faults of secondary equipment in smart substation based on improved Transformer according to claim 1 is characterized in that: In step 2, the specific steps of training the constructed improved Transformer model using the fault sample set are: Step 2.1, obtain the fault sample set as , where F i For the i The fault feature set of fault samples, N is the total number of fault samples, Indicates i The category label to which the fault samples belong, C is the total number of fault categories; Step 2.2: Set the fault feature set F i Input into the constructed improved Transformer model to generate the probability distribution of each fault category: , where Fault signature set F i Belongs to the fault category j The predicted probability of step 2.3, use the cross entropy loss function to train the improved Transformer model. The cross entropy loss function is: , where B is the number of fault samples in the fault sample set, δ ( Y i ,j ) is the indicator function, when Y i = j hour, δ ( Y i ,j )=1, otherwise it is 0, log means natural logarithm.

4. The method for locating faults of secondary equipment in smart substation based on improved Transformer according to claim 1 is characterized in that: In step 3, the fault online diagnosis threshold is obtained by evaluating the historical fault feature information. The specific steps are as follows: First, each group of historical fault feature information of the substation to be evaluated within the evaluation period is obtained. Each group of historical fault feature information is a string of feature information data consisting of 0 and / or 1. Each digit in the feature information data represents the situation information of each monitoring point of the substation. Data 1 indicates that the corresponding abnormal situation occurs at the monitoring point, and data 0 indicates that the corresponding abnormal situation does not occur at the monitoring point. Then, the obtained historical fault feature information is statistically analyzed to obtain the number of record groups of historical fault feature information within the evaluation period and the number of data 1 in each group of historical fault feature information. Z j , and then find the number Z j The maximum value in Zmax and the minimum value Z ; Then the characteristic information recording frequency is calculated according to the number of record groups: P times / year, and then calculate the average value of data 1 in each group of historical fault feature information Zx ; Finally, the evaluation formula for the fault online diagnosis threshold is established as follows: , where K 1. K 2 and K 3 are adjustment coefficients, which are used to fine-tune the output fault online diagnosis threshold. R is the threshold value, which is used to adjust the intervention threshold of online diagnosis.

5. The method for locating faults of secondary equipment in smart substation based on improved Transformer according to claim 1 is characterized in that: In step 3, the fault feature set formed F i for: , where is the self-check feature subset, is a subset of fault alarm features, is the process layer state feature subset, is a subset of communication layer state features; Self-check feature subset Comprehensive hardware module self-test information , Memory abnormal information And communication module self-test information , the formula is: , where are the total number of measurement and control devices, protection devices, merging units, and intelligent terminals, respectively. Respectively k A measurement and control device, l A protective device, m Merging units and n Hardware self-check alarm of smart terminal devices, Respectively k A measurement and control device, l A protective device, m Merging units and n The storage abnormality alarm of each smart terminal device, Respectively k A measurement and control device, l A protective device, m Merging units and n The communication module self-check alarm of each intelligent terminal device; Fault alarm feature subset Integrated sampling fault alarm , trip fault alarm , communication warning signal 、Body alarm signal , the formula is: , where The total number of devices including measurement and control devices, protection devices, merging units, intelligent terminals and switches, Respectively k A measurement and control device, l A protective device, m Merging units and n Sampling fault alarm of smart terminal devices, For the l Protection action failure alarm of each protection device, Respectively k A measurement and control device, l A protective device, m Merged units, n Smart terminal devices and o Communication failure alarm of each switch. Respectively k A measurement and control device, l A protective device, m Merging units and n The main body fault alarm of each intelligent terminal device; State feature subset Contains current sampling value , voltage sampling value And the abnormal state of the switch , the formula is: , where They are the current values ​​of phase A, phase B, and phase C in channel 1, They are the current values ​​of phase A, phase B, and phase C in channel 2, They are the voltage values ​​of phase A, phase B, and phase C in channel 1, are the voltage values ​​of phase A, phase B and phase C in channel 2, respectively, and are the total number of devices of the measurement and control device, protection device and merging unit, respectively. For the k A measurement and control device, l The first protection device and the m Switching signal related to the state of each merging unit; Communication layer status feature subset Used to comprehensively reflect various status information of the communication layer, including SV message anomalies , GOOSE message abnormality And possible switch status abnormality , the formula is: , where The total number of devices including measurement and control devices, protection devices, merging units, intelligent terminals and switches, Respectively l A protective device, m Merged units, n SV message abnormal alarm of intelligent terminal devices, Respectively k A measurement and control device, l A protective device, m Merged units, n GOOSE message abnormal alarm of smart terminal devices, Respectively o The port status, network traffic status, and link detection status of each switch.

6. The method for locating faults of secondary equipment in smart substation based on improved Transformer according to claim 1 is characterized in that: In step 4, the formula for selecting the category with the highest probability is: , where For test samples F test The predicted category, For test samples F test Belongs to category j The predicted probability of To solve Largest category index j .

7. The method for locating faults of secondary equipment in smart substation based on improved Transformer according to claim 2 is characterized in that: The calculation formula of the THA module is: , where Q, K and V are query vector, key value vector and value vector respectively. W o is the learnable weight matrix, h For the attention head head The total number of attention heads head The calculation formula is: , where head i For the output of each attention head, P w and P l are two different linear projection matrices, and Respectively i The query transformation matrix and key transformation matrix of the head, is the query factor, softmax The function is used to convert similarity into probability distribution.

8. The method for locating faults of secondary equipment in smart substation based on improved Transformer according to claim 2 is characterized in that: The calculation formula of the ICB module is: , where A 1 and A 2 are the first interaction feature and the second interaction feature respectively, Conv 3 is the third convolutional layer, the first interactive feature A 1 and the second interaction feature A 2 The calculation formula is: , , where is the timing characteristics of the THA module output, Conv 1 is a small kernel convolution, which is used to extract fine-grained local features. Conv 2 is a large kernel convolution, which is used to capture global dependencies. is the GeLU activation function, Represents an element-wise multiplication operation.

Citation Information

Patent Citations

  • Intelligent substation relay protection device fault diagnosis system and method

    CN112561736A

  • Secondary system fault positioning method based on improved IDNN model

    CN113283462A

  • Intelligent substation secondary system fault positioning method based on Transform-GRU

    CN114492662A

  • Transformer substation equipment fault early warning method and equipment based on double-domain sparse Transform model

    CN116433223A

  • Fault detection method and device

    CN119004065A

Cited By

  • Plateau high-risk operation safety monitoring and early warning system and method based on multi-source perception

    CN120564334A