Power grid fault diagnosis method and system based on text vectorization

By performing deep semantic vectorization processing and feature extraction on the grid alarm information text, the problem of low efficiency and accuracy of power grid fault diagnosis in the prior art is solved, and high accuracy recognition of complex fault scenarios is achieved.

CN119622483BActive Publication Date: 2025-04-18YANTAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510161990.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-04-18
Estimated Expiration
2045-02-14

AI Technical Summary

Technical Problem

Existing power grid fault diagnosis methods have low diagnostic efficiency and accuracy when dealing with complex fault scenarios, and it is difficult to distinguish fault types samples with highly similar characteristics.

Method used

The grid fault diagnosis method based on text vectorization is adopted, and the grid alarm information text is divided into word segmentation, embedding conversion, self-attention processing and multi-head attention processing, and deep semantic vectors are generated, and feature extraction is combined with label vectors, and the fault probability of different grid fault types is finally calculated.

Benefits of technology

It improves the accuracy and efficiency of power grid fault diagnosis, can effectively distinguish similar text content, and significantly improves the ability to identify complex fault scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119622483B_ABST
    Figure CN119622483B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of power grid fault classification diagnosis, and specifically to a power grid fault diagnosis method and system based on text vectorization, which performs word segmentation processing and embedding conversion processing on a power grid alarm information text to obtain an initial vector, extracts keywords at the same time, and performs vectorization processing on the text to obtain a label vector; performs encoding processing on the initial vector several times to generate a text vector, then performs splicing processing on the text vector and the label vector to obtain a splicing vector, performs feature extraction processing several times to generate a high-dimensional feature vector, performs full-connection forward processing on the high-dimensional feature vector, and obtains a power grid fault diagnosis result, which can mine deep semantics and logical relationships in the text, distinguish fault type samples with similar characteristics, and improve the accuracy of power grid fault diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grid fault classification diagnosis, and in particular to a power grid fault diagnosis method and system based on text vectorization. Background Art

[0002] As the power grid structure and fault characteristics become increasingly complex, fast and accurate power grid fault diagnosis is becoming increasingly important for the safe and stable operation of the power grid. Power grid alarm information is a commonly used data for power grid fault diagnosis. By analyzing power grid alarm information for fault diagnosis, the fault type and location can be identified.

[0003] At present, in the field of power grid fault diagnosis, the mainstream methods mainly include rule-based diagnosis methods and data-driven diagnosis methods. Rule-based diagnosis methods realize fault diagnosis through preset rule bases, which can solve power grid fault problems to a certain extent. However, the update and maintenance costs of the rule base are high, and this type of method has low diagnostic efficiency and accuracy when facing complex fault scenarios; data-driven diagnosis methods can realize end-to-end fault classification, but it is difficult to distinguish different fault types of samples with highly similar characteristics.

[0004] Therefore, when processing alarm information texts for power grid fault diagnosis, how to effectively mine the deep semantic and logical relationships in the texts and distinguish between fault type samples with highly similar characteristics is an important research topic at present. Summary of the invention

[0005] In order to solve the above problems raised by the background technology, the present invention provides a method and system for power grid fault diagnosis based on text vectorization.

[0006] The technical solution of the present invention is as follows:

[0007] A power grid fault diagnosis method based on text vectorization includes the following steps:

[0008] S1. Perform word segmentation processing on the acquired power grid alarm information text, obtain a number of word segmentation units and map them into a number of IDs respectively, generate an ID sequence, a classification mark is set at the beginning of the ID sequence, and perform embedding conversion processing on the ID sequence to obtain an initial vector;

[0009] S2. Perform several encoding processes on the initial vector. Each encoding process is specifically as follows: perform self-attention processing on the initial vector to obtain a semantic vector, perform multi-head attention processing on the semantic vector to obtain a comprehensive semantic vector, perform a first normalization process and a first nonlinear process on the comprehensive semantic vector in sequence, and then perform a first residual connection and a second normalization process on the output of the first nonlinear process and the output of the first normalization process to obtain a global semantic vector on the classification mark as the input of the next encoding process.

[0010] The global semantic vector obtained from the last encoding process is used as the text vector;

[0011] S3, concatenating the text vector and the label vector to obtain a concatenated vector, performing position encoding on the concatenated vector and then performing several feature extraction processes, wherein each feature extraction process is:

[0012] Perform multi-head self-attention processing on the spliced ​​vector after position encoding processing, obtain the feature vector after each attention head performs self-attention processing on the spliced ​​vector, and splice all feature vectors to obtain the output vector;

[0013] After the output vector and the concatenated vector are subjected to residual connection and third normalization, the second nonlinear processing is performed through the activation function, and then the output of the second nonlinear processing and the output of the third normalization processing are subjected to the second residual connection and fourth normalization processing to obtain the feature enhancement vector as the input for the next feature extraction processing.

[0014] The feature enhancement vector obtained from the last feature extraction process is used as a high-dimensional feature vector;

[0015] S4. After fully connected forward processing of the high-dimensional features, the fault probabilities of different preset power grid fault types are calculated to obtain the power grid fault diagnosis results.

[0016] Specifically, the label vector in S3 is: extracting keywords based on the power grid alarm information text, setting keyword labels, and performing vectorization processing on the keyword labels to obtain label vectors.

[0017] The encoding process and feature extraction process also include minimizing the loss function based on the loss function to update the parameters of the encoding process and feature extraction process. The loss function L formula is expressed as follows:

[0018] ,

[0019] in, is the classification loss, specifically the cross entropy loss; L 2 is the regularization loss, and λ is the regularization coefficient.

[0020] Specifically, in S1, keywords are extracted based on the power grid alarm information text, and the keywords include capacitor, bus, transformer, and reactor.

[0021] In the S1, the ID sequence is subjected to embedding conversion processing, specifically, word embedding processing, sentence embedding processing, and position encoding processing are respectively performed on the ID sequence, and a word embedding vector, a sentence embedding vector, and a position encoding vector are generated correspondingly. The word embedding vector, the sentence embedding vector, and the position encoding vector are added together to obtain an initial vector.

[0022] Furthermore, the position encoding process is expressed as follows:

[0023] ,

[0024] ,

[0025] Among them, PE is the position encoding vector, pos is the position of the word segmentation unit, i is the dimension index of the position encoding vector, and d model is the dimension of the position encoding vector.

[0026] In S4, the failure probability of different preset power grid failure types is calculated, and the formula is expressed as:

[0027] ,

[0028] in, For different grid fault types The probability of failure, is the output of the fully connected forward processing, is the number of power grid fault types.

[0029] Specifically, the first nonlinear processing in S2 is expressed as:

[0030] ,

[0031] in, is the output of the first nonlinear processing, GeLU is the nonlinear activation function, is the output of the first normalization process, , are weight matrices, , These are all set bias parameters.

[0032] Furthermore, the second nonlinear processing in S3 is expressed as:

[0033] ,

[0034] in, is the output of the second nonlinear processing, GeLU is the nonlinear activation function, is the output of the third normalization process, , are weight matrices, , These are all set bias parameters.

[0035] The present invention also provides a power grid fault diagnosis system based on text vectorization, comprising:

[0036] The alarm text processing module is used to perform word segmentation processing on the acquired power grid alarm information text, obtain a number of word segmentation units and map them to a number of IDs respectively, generate an ID sequence, a classification mark is set at the beginning of the ID sequence, and the ID sequence is embedded and converted to obtain an initial vector;

[0037] Extract keywords based on the power grid alarm information text, set keyword labels, and vectorize the keyword labels to obtain label vectors;

[0038] Text vector generation module: used to perform several encoding processes on the initial vector, each encoding process specifically includes: performing self-attention processing on the initial vector to obtain a semantic vector, performing multi-head attention processing on the semantic vector to obtain a comprehensive semantic vector, performing a first normalization process and a first nonlinear process on the comprehensive semantic vector in sequence, and then performing a first residual connection and a second normalization process on the output of the first nonlinear process and the output of the first normalization process to obtain a global semantic vector on the classification mark as the input of the next encoding process, and using the global semantic vector obtained by the last encoding process as the text vector;

[0039] Feature extraction module: used to concatenate the text vector and the label vector to obtain a concatenated vector, perform position encoding on the concatenated vector and then perform several feature extraction processes, wherein each feature extraction process comprises: performing multi-head self-attention processing on the concatenated vector after the position encoding process, obtaining a feature vector after each attention head performs self-attention processing on the concatenated vector, and concatenating all feature vectors to obtain an output vector;

[0040] After the output vector and the concatenated vector are subjected to residual connection and third normalization processing, the second nonlinear processing is performed through the activation function, and then the output of the second nonlinear processing and the output of the third normalization processing are subjected to a second residual connection and a fourth normalization processing to obtain a feature enhancement vector as the input of the next feature extraction processing, and the feature enhancement vector obtained by the last feature extraction processing is used as a high-dimensional feature vector;

[0041] Fault type diagnosis module: It is used to calculate the fault probabilities of different preset power grid fault types after fully connected forward processing of high-dimensional features, and obtain power grid fault diagnosis results.

[0042] The beneficial effects of the present invention are:

[0043] 1. The present invention performs word segmentation on the acquired power grid alarm information text and then performs several encoding processes, and performs deep semantic vectorization processing on the power grid alarm information. It can deeply capture semantics and context dependencies, accurately understand professional terms and ambiguous expressions, and is particularly suitable for processing complex nested structures in alarm information, thereby improving the accuracy of power grid fault diagnosis.

[0044] 2. The present invention extracts keywords based on the text of power grid alarm information, sets keyword labels, and obtains label vectors, which helps to capture discriminative semantic information, provide additional distinguishing signals, explicitly guide and focus on key information in the alarm information, can effectively distinguish similar text content, improve the model's ability to capture key semantics, and has a high accuracy in distinguishing fault type samples with highly similar features;

[0045] At the same time, the text vector and the label vector are concatenated to obtain a concatenated vector. The concatenated vector is position-encoded and then subjected to several feature extraction processes. This can capture the position information of the sample ID sequence and identify the association between distant elements in the sequence, thereby learning a more comprehensive semantic and logical structure and significantly improving the accuracy of power grid fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In the attached picture:

[0047] Figure 1 Schematic diagram of the flow of a power grid fault diagnosis method based on text vectorization in an embodiment. DETAILED DESCRIPTION

[0048] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings.

[0049] Example

[0050] This embodiment provides a method for power grid fault diagnosis based on text vectorization. Figure 1 , including the following steps:

[0051] S1. Perform word segmentation processing on the acquired power grid alarm information text, obtain a number of word segmentation units and map them into a number of IDs respectively, generate an ID sequence, a classification mark is set at the beginning of the ID sequence, and perform embedding conversion processing on the ID sequence to obtain an initial vector;

[0052] Keywords are extracted based on the power grid alarm information text, keyword labels are set, and keyword labels are vectorized to obtain label vectors.

[0053] In tasks such as power grid fault diagnosis, accurate and efficient text vectorization is essential for understanding the key features of alarm information. First, the acquired power grid alarm information text is segmented, and a dedicated word segmenter is used to decompose the text into several word segmentation units, each of which is a word or word fragment in the power grid alarm information text. While decomposing the text, each word segmentation unit is mapped to an ID, and finally an ID sequence is generated, and a classification tag is automatically set at the beginning of the ID sequence. This ensures that each word or fragment in the power grid alarm information text is recognized and recorded by the model, which is convenient for subsequent semantic processing.

[0054] The ID sequence generated after word segmentation needs to be embedded and converted to obtain the initial vector. Specifically, the ID sequence is processed by word embedding, sentence embedding, and position encoding, and word embedding vectors, sentence embedding vectors, and position encoding vectors are generated accordingly. The word embedding vectors, sentence embedding vectors, and position encoding vectors are added together to obtain the initial vector.

[0055] The position encoding process is expressed as follows:

[0056] ,

[0057] ,

[0058] Among them, PE is the position encoding vector, pos is the position of the word segmentation unit, i is the dimension index of the position encoding vector, and d model is the dimension of the position encoding vector.

[0059] Introducing position coding processing in the embedded conversion process can retain the order information in the ID sequence, thereby retaining the position information of the power grid alarm information text in subsequent processing.

[0060] Step S1 also includes extracting keywords based on the grid alarm information text, the keywords including capacitor, bus, transformer, and reactor.

[0061] After extracting keywords, keyword tags are set to assign a unique keyword tag to each keyword, such as 1 for capacitors, 2 for busbars, 3 for transformers, and 4 for reactors; the keyword tags are vectorized to obtain tag vectors. The specific process is to read the digitally named text files of power grid alarm information, process them one by one in ascending order according to the numerical sequence of the file names, and extract the content of each file. According to the extracted keywords and their corresponding keyword tags, check whether the file content contains these keywords: if a keyword is detected, the corresponding tag is assigned to the file. If no keyword is matched, a default tag is assigned, and the default tag is 0, ensuring that each file is labeled. Then the numerical sequence of the file name, the text content, and the assigned tag are stored in a linked list structure, and the processing results of all files are recorded in sequence. Finally, the constructed linked list structure is serialized into a .pkl format file and saved in the specified path to provide structured basic data for subsequent data analysis and processing.

[0062] S2. Perform encoding processing on the initial vector several times. Each encoding processing is specifically as follows: perform self-attention processing on the initial vector to obtain a semantic vector, perform multi-head attention processing on the semantic vector to obtain a comprehensive semantic vector, perform a first normalization processing and a first non-linear processing on the comprehensive semantic vector in sequence, and then perform a first residual connection and a second normalization processing on the output of the first non-linear processing and the output of the first normalization processing to obtain a global semantic vector on the classification mark as the input of the next encoding processing, and use the global semantic vector obtained from the last encoding processing as the text vector.

[0063] The obtained initial vector is encoded several times, which can effectively process the semantic information of the power grid warning information text and generate a high-quality text vector. This embodiment sets 24 encoding processes. In each encoding process, the initial vector is firstly self-attention processed to calculate the correlation between each word segmentation unit and other word segmentation units, capture the context dependency, and obtain a semantic vector containing context information. The formula for self-attention processing is expressed as:

[0064] ,

[0065] Among them, Q, K and V are the query, key and value obtained after linear transformation, and d is the dimension of the initial input vector.

[0066] Further multi-head attention processing is performed on the semantic vector to obtain a comprehensive semantic vector containing semantic features of different dimensions. The process of multi-head attention processing is expressed as follows:

[0067] ,

[0068] in, E is the output after multi-head attention processing, each is an independent attention head, , , are all learnable weight matrices, is the weight matrix for linearly transforming the concatenated attention head output, u is the sequence number of the attention head. Multi-head attention processing can capture semantic features of different dimensions in different subspaces by computing multiple attention heads in parallel, thus enhancing the ability to analyze complex semantic relationships.

[0069] The comprehensive semantic vector is further subjected to a first normalization process and a first nonlinear process in sequence, and the output of the first nonlinear process is subjected to a first residual connection and a second normalization process with the output of the first normalization process to obtain a global semantic vector on the classification label as the input for the next encoding process.

[0070] Among them, the first normalization process is expressed as:

[0071] ,

[0072] in, X is the initial input vector, E is the output after multi-head attention processing, is the output of the first normalization process.

[0073] Then, the vector output after the first normalization process is subjected to the first nonlinear process. The first nonlinear process is expressed as follows:

[0074] ,

[0075] in, is the output of the first nonlinear processing, GeLU is the nonlinear activation function, is the output of the first normalization process, , are weight matrices, , These are all set bias parameters.

[0076] Finally, the output of the first nonlinear processing is subjected to the first residual connection and the second normalization processing, and the formula is expressed as follows:

[0077] ,

[0078] in, is the output of the second normalization process, is the output of the first normalization process, is the output of the first nonlinear processing.

[0079] Through the above processing, a global semantic vector is finally generated on the classification mark, that is, the global semantic representation of the power grid alarm information text, which is used as the input of the next encoding process. The global semantic vector obtained by the last encoding process is used as the generated text vector for subsequent power grid fault classification and diagnosis tasks, providing rich semantic feature support.

[0080] S3, concatenating the text vector and the label vector to obtain a concatenated vector, performing position encoding on the concatenated vector and then performing several feature extraction processes, wherein each feature extraction process is:

[0081] Perform multi-head self-attention processing on the spliced ​​vector after position encoding processing, obtain the feature vector after each attention head performs self-attention processing on the spliced ​​vector, and splice all feature vectors to obtain the output vector;

[0082] After the output vector is residually connected with the concatenated vector and subjected to the third normalization processing, a second nonlinear processing is performed through an activation function, and then the output of the second nonlinear processing and the output of the third normalization processing are subjected to a second residual connection and a fourth normalization processing to obtain a feature enhancement vector as the input for the next feature extraction processing. The feature enhancement vector obtained from the last feature extraction processing is used as a high-dimensional feature vector.

[0083] In this step, the text vector and the label vector are first concatenated to obtain a concatenated vector, which can show and guide the attention to the key information in the power grid alarm information text and improve the ability to distinguish similar texts. Then, the concatenated vector is position-encoded and subjected to several feature extraction processes. In each feature extraction process, the concatenated vector after position encoding is subjected to multi-head self-attention processing to obtain an output vector. The process of multi-head self-attention processing is expressed as follows:

[0084] ,

[0085] Among them, Q, K and V are the query, key and value obtained after linear transformation, and d is the dimension of the input.

[0086] Compared with the single-head attention mechanism, the multi-head self-attention processing mechanism allows to simultaneously focus on information from different semantic subspaces, thereby providing richer and more diverse feature representation capabilities and capturing the correlation and detail information in the input concatenated vector.

[0087] ,

[0088] in, is the output after multi-head self-attention processing, is the weight matrix for linearly transforming the concatenated attention head output, u is the sequence number of the attention head.

[0089] Among them, u The computation output of the attention head It is expressed as follows:

[0090] ,

[0091] , , All are u The learnable weight matrix of the attention head.

[0092] The output vector is further subjected to residual connection and third normalization processing with the concatenated vector, and then subjected to second nonlinear processing by an activation function, and then subjected to second residual connection and fourth normalization processing to obtain a feature enhancement vector.

[0093] Specifically, the output vector and the concatenated vector are residually connected and third normalized, and the formula is as follows:

[0094] ,

[0095] in, is the concatenation vector, is the output vector after multi-head self-attention processing, is the output of the third normalization process.

[0096] Then, the nonlinear activation function GeLU is used to perform the second nonlinear processing on the above output to achieve the nonlinear transformation of the input. The second nonlinear processing is expressed as:

[0097] ,

[0098] in, is the output of the second nonlinear processing, GeLU is the nonlinear activation function, is the output of the third normalization process, , are weight matrices, , These are all set bias parameters.

[0099] Finally, the output of the second nonlinear processing and the output of the third normalization processing are subjected to the second residual connection and the fourth normalization processing to obtain the feature enhancement vector. The formula is as follows:

[0100] ,

[0101] in, is the output of the fourth normalization process, is the output of the third normalization process, is the output of the second nonlinear processing.

[0102] In this embodiment, a total of 6 feature extraction processes are performed, and the feature enhancement vector obtained by the last feature extraction process is used as a high-dimensional feature vector.

[0103] S4. After fully connected forward processing of the high-dimensional features, the fault probabilities of different preset power grid fault types are calculated to obtain the power grid fault diagnosis results.

[0104] Specifically, a fully connected forward processing is performed on the high-dimensional feature vector to obtain fused features, and logistic regression processing is performed based on the fused features to calculate the fault probabilities of different preset power grid fault types. The power grid fault type label with the highest fault probability is mapped to the corresponding power grid fault type based on a preset mapping relationship to obtain a power grid fault diagnosis result.

[0105] Among them, the process of fully connected forward processing is expressed as follows:

[0106] ,

[0107] in, For the l + Layer j The activation value of each neuron, i.e. the output of the fully connected forward process; For full connection forward processing l Tier t The output of a neuron, n is the number of neurons, For connection l Tier t neurons and l +1 level j The weight of a neuron, For the l All neurons in the layer l +1 level j The bias value of a neuron.

[0108] Logistic regression processing is performed based on the fusion features to calculate the fault probability of different preset power grid fault types. The formula is expressed as:

[0109] ,

[0110] in, For different grid fault types The probability of failure, is the output of the fully connected forward processing, is the number of power grid fault types.

[0111] The encoding process and feature extraction process also include minimizing the loss function and updating the parameters of the encoding process and feature extraction process. The loss function L is expressed as follows:

[0112] ,

[0113] in, is the classification loss, specifically the cross entropy loss; L 2 is the regularization loss, and λ is the regularization coefficient.

[0114] The present invention also provides a power grid fault diagnosis system based on text vectorization, comprising:

[0115] The alarm text processing module is used to perform word segmentation processing on the acquired power grid alarm information text, obtain a number of word segmentation units and map them to a number of IDs respectively, generate an ID sequence, a classification mark is set at the beginning of the ID sequence, and the ID sequence is embedded and converted to obtain an initial vector;

[0116] Extract keywords based on the power grid alarm information text, set keyword labels, and vectorize the keyword labels to obtain label vectors;

[0117] Text vector generation module: used to perform several encoding processes on the initial vector, each encoding process specifically includes: performing self-attention processing on the initial vector to obtain a semantic vector, performing multi-head attention processing on the semantic vector to obtain a comprehensive semantic vector, performing a first normalization process and a first nonlinear process on the comprehensive semantic vector in sequence, and then performing a first residual connection and a second normalization process on the output of the first nonlinear process and the output of the first normalization process to obtain a global semantic vector on the classification mark as the input of the next encoding process, and using the global semantic vector obtained by the last encoding process as the text vector;

[0118] Feature extraction module: used to concatenate the text vector and the label vector to obtain a concatenated vector, perform position encoding on the concatenated vector and then perform several feature extraction processes, wherein each feature extraction process comprises: performing multi-head self-attention processing on the concatenated vector after the position encoding process, obtaining a feature vector after each attention head performs self-attention processing on the concatenated vector, and concatenating all feature vectors to obtain an output vector;

[0119] After the output vector and the concatenated vector are subjected to residual connection and third normalization processing, the second nonlinear processing is performed through the activation function, and then the output of the second nonlinear processing and the output of the third normalization processing are subjected to a second residual connection and a fourth normalization processing to obtain a feature enhancement vector as the input of the next feature extraction processing, and the feature enhancement vector obtained by the last feature extraction processing is used as a high-dimensional feature vector;

[0120] Fault type diagnosis module: It is used to calculate the fault probabilities of different preset power grid fault types after fully connected forward processing of high-dimensional features, and obtain power grid fault diagnosis results.

[0121] Experimental content

[0122] In order to verify the performance of the power grid fault diagnosis method based on text vectorization proposed in this invention, a large number of experiments were carried out to verify it, using the power grid alarm information text collected by the Supervisory Control and Data Acquisition (SCADA) as the data set. Each step in the experiment is described in detail below.

[0123] Data preprocessing

[0124] Based on the collected power grid alarm information text as a data set, samples corresponding to 10 important fault events are extracted from it, and a total of 13411 fault event samples are obtained. Each fault sample is divided into a training set and a test set in a ratio of 7:3. The number of training sets and test sets for each fault sample is shown in Table 1. When a fault occurs in the power grid, the protection and switch action information of the faulty equipment will be uploaded to the SCADA system in real time. This information is recorded in the order of the events, thus forming a set of alarm information texts at the time of the fault. The main task of data preprocessing is to read all the alarm information and its corresponding labels. Subsequently, the module divides the data set into a training set and a test set. In addition, mapping the labels corresponding to the alarm information to indexes and storing them in Excel files helps to organize and manage the data. Especially when processing large-scale data, the use of indexes can save a lot of storage space and improve efficiency in data processing and analysis. The processed alarm information is saved in a text document. Finally, the alarm information of each text document is processed and the alarm information of each document is spliced ​​into one line. This can simplify the data structure, reduce the dimension of the data, help improve the efficiency of data processing and analysis, improve the consistency and availability of data, and facilitate the use of subsequent operations. Through data preprocessing, a cleaned and processed data set is prepared, providing a high-quality data foundation for subsequent experiments and analysis. This will help ensure the reliability of the experiment and the accuracy of the results, thereby providing more reliable support for power grid fault diagnosis and prediction.

[0125] Table 1 Statistics of the number of fault event samples

[0126]

[0127] Parameter settings

[0128] The training and testing process of this experiment was carried out on a Windows PC equipped with an NVIDIA GeForce GTX 3090 GPU processor and an Intel Core i9-10900 3.70 GHz CPU processor. Python programming language and Pycharm development environment were used to set parameters. The parameter table is shown in Table 2.

[0129] During data processing, the size of the text embedding of the power grid alarm information is set to 1024. The number of samples passed in each training is 32 by default, and the number of iterations during training is set to 25. In the power grid fault diagnosis based on text vectorization, the dimension of the attention mechanism used is set to 1028. In addition, the probability of regularization (Dropout) is set to 0.5 to help reduce the risk of overfitting during training. Finally, the learning rate is set to 0.0001, which will control the update speed of the parameters and promote better convergence to the optimal solution during training. With the above settings, reliable support can be provided for the power grid fault diagnosis task.

[0130] Table 2 Parameter setting table

[0131]

[0132] Experimental Results

[0133] In order to verify the performance of the power grid fault diagnosis method based on text vectorization proposed in the present invention, a large number of experiments are carried out based on the power grid alarm information collected by the SCADA system when the electrical appliances fail as a data set. The experimental results are shown in Table 3.

[0134] Table 3 Accuracy of various fault indicators

[0135]

[0136] The experimental results show that the proposed method has excellent performance in fault type classification tasks, especially in the diagnosis of equipment faults, with an accuracy of 100%. For complex line faults, the model can still maintain a high accuracy of nearly 0.999, which verifies the generalization ability and reliability of the model.

[0137] Comparative experimental results

[0138] In order to prove the effectiveness of the proposed text vectorization-based power grid fault diagnosis method, the present invention selects convolutional neural network (CNN), long short-term memory network (LSTM), transformer model (Transformer) and deep belief network (DBN) as benchmarks and conducts experimental comparison with the present invention. The description of the above four benchmarks is as follows:

[0139] (1) CNN: It can automatically extract text features and realize classification and prediction of warning information text. The data combing process is further simplified, and the accuracy of diagnosis is not restricted by other conditions, which improves the adaptive ability.

[0140] (2) LSTM: It can more fully mine the time series features in the data and use a simple sliding time window to accurately capture fault events. It is simple to implement and has high accuracy.

[0141] (3) Transformer: Automatically focuses on the key content in the alarm information text, autonomously extracts the text description features and naming rules of electrical equipment in the alarm information text, quickly infers the fault-related situation, and promptly removes the faulty equipment.

[0142] (4) Deep Belief Network (DBN): Based on deep learning, it is usually composed of multiple stacked restricted Boltzmann machines (RBMs). DBN first learns the characteristics of the data through an unsupervised learning stage, and then classifies it through supervised learning.

[0143] Table 4 Comparative experimental results

[0144]

[0145] Experimental results show that the text vectorization-based power grid fault diagnosis method of the present invention outperforms other benchmarks in terms of accuracy (99.6%) and F1 value (0.948), among which the second-place Transformer model has an accuracy and F1 value of 93.5% and 0.9205, respectively. We believe that this advantage comes from its strong capabilities in feature extraction and text vectorization, which can better capture the complex characteristics of power grid faults. In summary, the present invention performs well in power grid fault diagnosis and has strong practical value and promotion potential.

[0146] Ablation experiment

[0147] The present invention provides a power grid fault diagnosis method based on text vectorization, which can effectively extract the semantic features and deep features of the alarm information. The use of text keyword tags can effectively distinguish similar texts, thereby improving the accuracy of result prediction. In order to verify the effectiveness of the present invention, an ablation experiment was further carried out. Experiment 1 verified the impact of several encoding processes on the power grid fault diagnosis method proposed in the present invention. First, the power grid alarm information text is vectorized. Then, the vectorized power grid alarm information text is concatenated with the label vector, and several feature extraction processes are performed. Finally, the steps in the aforementioned S4 are continued. The purpose is to analyze the role of several encoding processes in the power grid fault diagnosis method based on text vectorization.

[0148] Experiment 2 verifies the influence of keyword extraction on the power grid fault diagnosis method based on text vectorization proposed in the present invention. First, cancel the operation of splicing the label vector and the text vector. Then, directly perform feature extraction processing on the text vector after several encoding processes. Continue to execute subsequent steps. The purpose is to analyze the role of keyword information in the power grid alarm information text in power grid fault diagnosis.

[0149] Experiment 3 verifies the impact of multiple feature extraction processes on the power grid fault diagnosis method based on text vectorization proposed in the present invention. First, the feature extraction operation is replaced by LSTM. Then, the text vector after encoding is concatenated with the label vector and input into the replaced network structure for feature extraction. Finally, the subsequent operation steps are continued. The purpose is to analyze the role of multiple feature extraction processes in the power grid fault diagnosis method based on text vectorization.

[0150] Experiment 4 is a power grid fault diagnosis method based on text vectorization proposed in the present invention.

[0151] The ablation experiment results in Table 5 verify the effectiveness of each step in the present invention.

[0152] The experimental results are shown in Table 5.

[0153] Table 5 Ablation experiment results

[0154]

[0155] The present invention proposes an innovative power grid fault diagnosis method based on text vectorization, which aims to cope with the complexity of power grid alarm information and the rapid growth of data volume, and effectively improves the speed of fault diagnosis and classification accuracy. Experimental results show that the present invention performs well in processing a large amount of alarm information and extracting key fault features, which not only significantly improves the diagnostic accuracy, but also effectively reduces the misjudgment rate. Specifically, when step S2 vectorizes the alarm information text, it can deeply capture the contextual relationship and semantic logic of the alarm text, providing a more comprehensive information basis for power grid fault diagnosis. Step S3 further extracts deep features in the alarm text through a multi-head self-attention mechanism, which helps to achieve fast and accurate fault type classification. The combination of the two enables the present invention to maintain high robustness and stability in a complex power grid data environment. Nevertheless, the present invention still has some limitations. First, the present invention has high requirements for computing resources. Secondly, although the present invention performs well in common fault types, there is still room for improvement when dealing with some extreme or rare fault modes. In general, the power grid fault diagnosis method based on text vectorization proposed in the present invention provides an efficient and reliable solution for power grid fault diagnosis, and promotes the development of intelligent and digital operation and maintenance of power systems. In the future, with the further advancement of technology and optimization of models, power grid fault diagnosis methods will become more intelligent, providing more solid technical support for the safe and stable operation of the power grid.

Claims

1. A power grid fault diagnosis method based on text vectorization, characterized in that: The following steps are involved: S1. Perform word segmentation processing on the acquired power grid alarm information text, obtain a number of word segmentation units and map them into a number of IDs respectively, generate an ID sequence, a classification mark is set at the beginning of the ID sequence, and perform embedding conversion processing on the ID sequence to obtain an initial vector; S2. Perform several encoding processes on the initial vector. Each encoding process is specifically as follows: perform self-attention processing on the initial vector to obtain a semantic vector, perform multi-head attention processing on the semantic vector to obtain a comprehensive semantic vector, perform a first normalization process and a first nonlinear process on the comprehensive semantic vector in sequence, and then perform a first residual connection and a second normalization process on the output of the first nonlinear process and the output of the first normalization process to obtain a global semantic vector on the classification mark as the input of the next encoding process. The global semantic vector obtained from the last encoding process is used as the text vector; S3, concatenating the text vector and the label vector to obtain a concatenated vector, performing position encoding on the concatenated vector and then performing several feature extraction processes, wherein each feature extraction process is: Perform multi-head self-attention processing on the spliced ​​vector after position encoding processing, obtain the feature vector after each attention head performs self-attention processing on the spliced ​​vector, and splice all feature vectors to obtain the output vector; After the output vector and the concatenated vector are subjected to residual connection and third normalization, the second nonlinear processing is performed through the activation function, and then the output of the second nonlinear processing and the output of the third normalization processing are subjected to the second residual connection and fourth normalization processing to obtain the feature enhancement vector as the input for the next feature extraction processing. The feature enhancement vector obtained from the last feature extraction process is used as a high-dimensional feature vector; S4. After fully connected forward processing of the high-dimensional features, the fault probabilities of different preset power grid fault types are calculated to obtain the power grid fault diagnosis results.

2. The power grid fault diagnosis method based on text vectorization according to claim 1 is characterized in that: The label vector in S3 is: Keywords are extracted based on the power grid alarm information text, keyword labels are set, and keyword labels are vectorized to obtain label vectors.

3. The power grid fault diagnosis method based on text vectorization according to claim 1 is characterized in that: The encoding process and feature extraction process also include minimizing the loss function based on the loss function to update the parameters of the encoding process and feature extraction process. The loss function L formula is expressed as follows: , in, is the classification loss, specifically the cross entropy loss; L2 is the regularization loss, and λ is the regularization coefficient.

4. The power grid fault diagnosis method based on text vectorization according to claim 1 is characterized in that: In the S1, keywords are extracted based on the power grid alarm information text, and the keywords include capacitor, bus, transformer, and reactor.

5. The power grid fault diagnosis method based on text vectorization according to claim 1 is characterized in that: In the S1, the ID sequence is subjected to embedding conversion processing, specifically, word embedding processing, sentence embedding processing, and position encoding processing are respectively performed on the ID sequence, and a word embedding vector, a sentence embedding vector, and a position encoding vector are generated correspondingly. The word embedding vector, the sentence embedding vector, and the position encoding vector are added together to obtain an initial vector.

6. The method for power grid fault diagnosis based on text vectorization according to claim 5, characterized in that: The position encoding process is expressed as follows: , , Among them, PE is the position encoding vector, pos is the position of the word segmentation unit, i is the dimension index of the position encoding vector, and d model is the dimension of the position encoding vector.

7. The power grid fault diagnosis method based on text vectorization according to claim 1 is characterized in that: In S4, the failure probability of different preset power grid failure types is calculated, and the formula is expressed as: , in, For different grid fault types The probability of failure, is the output of the fully connected forward processing, is the number of power grid fault types.

8. The method for power grid fault diagnosis based on text vectorization according to claim 1, characterized in that: The first nonlinear processing in S2 is expressed as: , in, is the output of the first nonlinear processing, GeLU is the nonlinear activation function, is the output of the first normalization process, , are weight matrices, , These are all set bias parameters.

9. The method for power grid fault diagnosis based on text vectorization according to claim 1, characterized in that: The second nonlinear processing in S3 is expressed as follows: , in, is the output of the second nonlinear processing, GeLU is the nonlinear activation function, is the output of the third normalization process, , are weight matrices, , These are all set bias parameters.

10. A power grid fault diagnosis system based on text vectorization, characterized in that: include: The alarm text processing module is used to perform word segmentation processing on the acquired power grid alarm information text, obtain a number of word segmentation units and map them to a number of IDs respectively, generate an ID sequence, a classification mark is set at the beginning of the ID sequence, and the ID sequence is embedded and converted to obtain an initial vector; Text vector generation module: used to perform several encoding processes on the initial vector, each encoding process specifically includes: performing self-attention processing on the initial vector to obtain a semantic vector, performing multi-head attention processing on the semantic vector to obtain a comprehensive semantic vector, performing a first normalization process and a first nonlinear process on the comprehensive semantic vector in sequence, and then performing a first residual connection and a second normalization process on the output of the first nonlinear process and the output of the first normalization process to obtain a global semantic vector on the classification mark as the input of the next encoding process, and using the global semantic vector obtained by the last encoding process as the text vector; Feature extraction module: used to concatenate the text vector and the label vector to obtain a concatenated vector, perform position encoding on the concatenated vector and then perform several feature extraction processes, wherein each feature extraction process comprises: performing multi-head self-attention processing on the concatenated vector after the position encoding process, obtaining a feature vector after each attention head performs self-attention processing on the concatenated vector, and concatenating all feature vectors to obtain an output vector; After the output vector and the concatenated vector are subjected to residual connection and third normalization processing, the second nonlinear processing is performed through the activation function, and then the output of the second nonlinear processing and the output of the third normalization processing are subjected to a second residual connection and a fourth normalization processing to obtain a feature enhancement vector as the input of the next feature extraction processing, and the feature enhancement vector obtained by the last feature extraction processing is used as a high-dimensional feature vector; Fault type diagnosis module: It is used to calculate the fault probabilities of different preset power grid fault types after fully connected forward processing of high-dimensional features, and obtain power grid fault diagnosis results.

Citation Information

Patent Citations

  • Power backbone communication network fault diagnosis method based on knowledge graph reasoning

    CN118041744A

  • Method and system for intelligent analysis of bills based on semantic graph model

    JP7579022B1