Electrical equipment defect identification method and device, electronic equipment and storage medium
By combining the text extraction model of the Transformer encoding layer and the BI-LSTM output layer, using the multi-head attention mechanism and graph convolution layer, the problem of insufficient comprehensive understanding of power equipment defect text in the existing technology is solved, and more accurate defects are achieved Identify effects.
Patent Information
- Application Number
- CN202411372655.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing text classification model cannot fully utilize the context information in the text, resulting in insufficient understanding of defect text of power equipment, which affects the effect of defect recognition.
Using a text extraction model combining Transformer encoding layer and BI-LSTM output layer, the semantic information in power equipment defect text is extracted and classified through multi-head attention mechanism and graph convolution layer to construct the target word vector and power equipment information. Relational topology diagram for defect identification.
The accuracy and effectiveness of defect recognition are improved, and the accuracy of defect recognition results is enhanced by comprehensively learning context information and correlation.
Smart Images

Figure CN119322849A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power equipment identification, and in particular to an electric power equipment defect identification method, device, electronic equipment and storage medium. Background Art
[0002] Defect identification of electric high-voltage equipment is related to the safe and stable operation of the power system. Therefore, how to efficiently and accurately extract and classify equipment defect information from large amounts of text data has become one of the hot research issues.
[0003] At present, the existing text classification models cannot fully utilize the contextual information in the text, resulting in an incomplete and inaccurate understanding of the equipment defect text. This limitation is particularly evident when processing long texts and texts containing complex semantic relationships, thus affecting the effect of defect identification. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, device, electronic device and storage medium for identifying defects in electric power equipment, so as to improve the accuracy of defect identification.
[0005] In a first aspect, a method for identifying defects in electric power equipment is provided, the method comprising:
[0006] Input the defect text to be identified of the target device into the pre-built text extraction model to obtain the target word vector of the defect text; wherein the text extraction model includes an input layer, a transformer encoding layer and a BI-LSTM output layer;
[0007] The input layer is used to convert the defect text to be identified into the initial word vector;
[0008] The transformer encoding layer is used to calculate the semantic relationship between each initial word vector and its context based on the multi-head attention mechanism, and update the initial word vector according to the semantic relationship to obtain an intermediate word vector containing semantic information;
[0009] The BI-LSTM output layer is used to perform bidirectional semantic extraction on the contextual semantic information of the intermediate word vector to obtain the target word vector containing bidirectional semantic information;
[0010] The target word vector and the power equipment information are input into the pre-built equipment defect recognition model, so that the equipment defect recognition model constructs a relationship topology map between the target word vector and the power equipment information, and the defects are classified based on the relationship topology map to obtain the defect recognition result of the target equipment.
[0011] Optionally, the semantic relationship between each initial word vector and its context is calculated based on a multi-head attention mechanism, and the initial word vector is updated according to the semantic relationship to obtain an intermediate word vector containing semantic information, including:
[0012] Generate query vectors, key vectors, and value vectors based on each initial word vector. The generation formula is:
[0013] Q=XW Q ,K=XW K ,V=XW V
[0014] Among them, X is the initial word vector, W Q ,W K ,W V are weight matrices corresponding to query vector, key vector and value vector respectively; Q represents query vector; K represents key vector; V represents value vector;
[0015] Based on the query vector, key vector and value vector, the attention output vector of the context information that each attention mechanism pays attention to is calculated. The calculation formula is:
[0016]
[0017] Among them, head i represents the attention output vector of the i-th attention mechanism;
[0018] The attention output vectors of the context information paid attention to by each attention mechanism are connected to obtain the vector of the context information paid attention to by the multi-head attention mechanism, and the vector is determined as the intermediate word vector, where the concatenation formula is as follows:
[0019] MuitiHead(Q,K,V)=Concat(head1,head2…head k )W o ;
[0020] Among them, Concat means that each head i After the matrix is connected, it is connected to the connection matrix W o Multiply.
[0021] Optionally, the power equipment information includes equipment documents and equipment basic information, the equipment documents refer to all formal documents and records related to the power high-voltage equipment, including but not limited to equipment instructions, operation manuals, maintenance records, design drawings, and technical specifications; the equipment basic information includes at least the equipment ID; the equipment defect recognition model includes an embedding layer, a graph convolution layer, and a classification layer;
[0022] The embedding layer is used to determine the initial feature vectors of power equipment, documents and words based on the basic information of the equipment, equipment documents and target word vectors respectively;
[0023] The graph convolution layer is used to construct an undirected graph containing three types of nodes: power equipment, documents, and words based on the initial feature vectors of power equipment, documents, and words, and perform a graph convolution operation on the central node in the undirected graph to update the initial feature vector of the central node, and obtain a target feature vector that aggregates the feature information of the three types of nodes and the graph structure;
[0024] The classification layer is used to classify the defects of the target feature vector to obtain the defect recognition results of the target device.
[0025] Optionally, determining initial feature vectors of the power equipment, the document, and the word based on the basic equipment information, the equipment document, and the target word vector respectively includes:
[0026] Discretize basic device information, device documents, and target word vectors;
[0027] The discretized equipment basic information, equipment documents and target word vectors are one-hot encoded to obtain the one-hot vectors of power equipment, documents and words, and the one-hot vectors are used as the initial feature vectors.
[0028] Optionally, constructing an undirected graph including three types of nodes of power equipment, document and word based on the initial feature vectors of power equipment, document and word includes:
[0029] Based on the initial feature vectors of the power equipment, the document and the word, three types of nodes and edges between the nodes of the undirected graph are constructed; wherein the edges between the nodes include the edge between the power equipment node and the document node, the edge between the document node and the word node, and the edge between the word node and the word node;
[0030] The weight of the edge between the power equipment node and the document node is configured as a fixed weight value;
[0031] The weight of the edge between the document node and the word node is calculated based on the TF-IDF (Term Frequency-Inverse Document Frequency) algorithm;
[0032] The weights of the edges between word nodes are calculated based on the PMI (Pointwise Mutual Information) algorithm.
[0033] Optionally, a graph convolution operation is performed on the central node in the undirected graph to update the initial feature vector of the central node, and the target feature vector that aggregates the feature information of the three types of nodes includes:
[0034] Perform neighbor sampling on the central node in the undirected graph to obtain a set of neighbor nodes;
[0035] The initial feature vectors of the neighbor node set are aggregated through the message passing mechanism to obtain the target feature vector that aggregates the feature information of the three types of nodes.
[0036] Optionally, neighbor sampling is performed on the central node in the undirected graph, and the obtained neighbor node set includes:
[0037] Determine the number of neighbor node samples;
[0038] Determine whether the total number of neighbor nodes around the central node of the undirected graph is greater than the number of neighbor node samplings;
[0039] If it is greater than, a preset number of sampling nodes are randomly selected to obtain a set of neighbor nodes;
[0040] If it is less than, a random sampling method with replacement is used to obtain a set of neighbor nodes of the sampling number.
[0041] In a second aspect, a device for identifying defects in electric power equipment is provided, the device comprising:
[0042] A text extraction unit, used to input the defect text to be identified of the target device into a pre-built text extraction model to obtain a target word vector of the defect text; wherein the text extraction model includes an input layer, a transformer encoding layer and a BI-LSTM output layer;
[0043] The input layer is used to convert the defect text to be identified into the initial word vector;
[0044] The transformer encoding layer is used to calculate the semantic relationship between each initial word vector and its context based on the multi-head attention mechanism, and update the initial word vector according to the semantic relationship to obtain an intermediate word vector containing semantic information;
[0045] The BI-LSTM output layer is used to perform bidirectional semantic extraction on the contextual semantic information of the intermediate word vector to obtain the target word vector containing bidirectional semantic information;
[0046] The defect recognition unit is used to input the target word vector and the power equipment information into a pre-built equipment defect recognition model, so that the equipment defect recognition model constructs a relationship topology map between the target word vector and the power equipment information, and classifies defects based on the relationship topology map to obtain the defect recognition result of the target equipment.
[0047] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0048] Memory, used to store computer programs;
[0049] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.
[0050] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0051] The embodiments of the present invention provide a method, device, electronic device and storage medium for identifying defects in electric power equipment. The target word vector of the defect text is obtained by inputting the defect text to be identified of the target equipment into a pre-built text extraction model. Through the combination of the transformer encoding layer and the BI-LSTM output layer, the context information of each word vector can be learned more comprehensively and completely, thereby improving the accuracy of the extracted word vector, providing high-accuracy data support for subsequent defect identification, and further inputting the target word vector and the electric power equipment information into the pre-built equipment defect identification model for defect identification, fully considering the correlation between the target word vector and the electric power equipment information, and classifying defects according to the correlation, thereby improving the accuracy of the defect identification result.
[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 A flow chart showing a method for identifying defects in electric power equipment provided by an embodiment of the present invention is shown;
[0055] Figure 2 A schematic diagram showing the structure of a text extraction model provided by an embodiment of the present invention is shown;
[0056] Figure 3 A schematic diagram showing the structure of the input layer of the text extraction model provided in an embodiment of the present invention is shown;
[0057] Figure 4 A schematic diagram showing the structure of the BI-LSTM output layer of the text extraction model provided in an embodiment of the present invention is shown;
[0058] Figure 5A schematic diagram showing the structure of a device for identifying defects in electric power equipment provided by an embodiment of the present invention is shown;
[0059] Figure 6 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0061] Considering that the existing text classification model cannot fully utilize the context information in the text, resulting in an incomplete and inaccurate understanding of the equipment defect text. Based on this, an embodiment of the present invention provides a method and device for identifying defects in power equipment, which are described below through embodiments.
[0062] The present invention provides a method for identifying defects in electric power equipment. Figure 1 As shown, the method comprises the following steps:
[0063] Step S101: input the defect text to be identified of the target device into a pre-built text extraction model to obtain a target word vector of the defect text.
[0064] Among them, the text extraction model includes input layer, transformer encoding layer and BI-LSTM output layer.
[0065] In the embodiment of the present invention, the number of transformer coding layers can be set according to the complexity of the task. The more complex the task, the more layers are needed. For semantic recognition of short texts, two layers are generally sufficient. Each transformer coding layer consists of an encoder and a decoder. For example, each transformer coding layer consists of 6 encoder layers and 6 decoder layers. Figure 2 As shown, the first layer is the input layer, E i represents the input word, TrmE in the second and third layers represents the Transformer encoding layer, and T in the fourth layer irepresents the output result, and N represents the total number of input words.
[0066] The input layer is used to convert the defect text to be identified into an initial word vector.
[0067] like Figure 3 As shown in the figure, the defect text to be identified is "the main transformer's main body oil level abnormal defect is caused by oil leakage". The input layer consists of four parts: the input layer divides the defect text to be identified into sentence vectors, [CLS] is the start mark of the text, and [SEP] is the sentence separator or the end mark of the text. Token converts each word in the defect text into a one-dimensional vector by querying the word vector table, which represents the original word vector of the word. Segment indicates which sentence the current word is in the defect text, and Position is used to indicate the sequence position of the current word in the defect text.
[0068] Therefore, it can be understood that each initial word vector includes not only the original word vector, but also the sentence vector and the position vector.
[0069] The transformer encoding layer is used to calculate the semantic relationship between each initial word vector and its context based on the multi-head attention mechanism, and update the initial word vector according to the semantic relationship to obtain an intermediate word vector containing semantic information.
[0070] After being processed by the transformer encoding layer, the intermediate word vector will contain the semantic information of the word itself and its context. The multi-head attention mechanism adopts the principle of parallel processing, and multiple texts can be extracted at the same time.
[0071] Although the transformer encoding layer can capture the relationship between each word vector and its context, it cannot fully capture the contextual semantic features of some complex defect texts, which affects the accuracy of complex defect text information extraction.
[0072] Therefore, in order to further improve the accuracy of semantic extraction of character vectors of power equipment defect text, a BI-LSTM output layer is set.
[0073] The BI-LSTM output layer is used to perform bidirectional semantic extraction on the contextual semantic information of the intermediate word vector to obtain the target word vector containing bidirectional semantic information.
[0074] The BI-LSTM output layer is composed of forward and backward LSTM networks, so it can learn not only the context information of the sentence from the front to the back, but also the context information from the back to the front. The bidirectional sentence meaning is concatenated and input into the fully connected layer, and then classified by the Sigmoid activation function.
[0075] like Figure 4 As shown in the figure, the BI-LSTM output layer updates the vector through the input gate, forget gate, and output gate. Each gating unit can learn the long-term and short-term dependency information of the text. Specifically, the calculation formula of each LSTM gating unit is as follows:
[0076] f t =σ(w f [h t-1 ,x t ]+b f )(1);
[0077] i t =σ(w i [h t-1 ,x t ]+b i )(2);
[0078]
[0079]
[0080] o t =σ(w o [h t-1 ,x t ]+b o )(5);
[0081] h t =o t ×tanh(c t )(6);
[0082] In the formula, x t 、h t are input and output respectively, h t-1 is the output of the previous layer; i t 、f t ,、o t are the input gate, forget gate and output gate functions respectively, σ is the Sigmoid activation function, tanh is the hyperbolic tangent activation function, and w i 、w c 、w o is the weight matrix, b i , b c , b o are bias vectors. c t are candidate values and updated candidate values respectively, c t-1 corresponds to c t The updated candidate value of the previous layer.
[0083] The BI-LSTM output layer can achieve bidirectional learning of context information. The output of the final BI-LSTM layer is expressed as:
[0084] h(t)=[o pre ,o pos ](7);
[0085] Where h is the concatenation of the forward and backward outputs of the BI-LSTM output layer, t is the time step, and o is pre ,o Dos They are the outputs of forward LSTM and backward LSTM respectively.
[0086] More comprehensive semantic features are obtained through the BI-LSTM output layer to ensure the robustness of semantic learning of the text extraction model.
[0087] Step S102: Input the target word vector and the power equipment information into a pre-built equipment defect recognition model, so that the equipment defect recognition model constructs a relationship topology map between the target word vector and the power equipment information, and classifies defects based on the relationship topology map to obtain the defect recognition result of the target equipment.
[0088] The embodiment of the present invention not only improves the efficiency of text extraction through the parallel processing rules of the multi-head attention mechanism, but also can combine contextual semantic information to improve the accuracy of text extraction. In addition, the contextual information in the text sequence is further obtained through bidirectional semantic recognition, making the learning of sentence information more comprehensive and ensuring the robustness of semantic learning. Finally, through the equipment defect recognition model, the correlation between the target word vector and the power equipment information is fully considered when extracting equipment feature information, thereby improving the accuracy of the defect recognition results.
[0089] Based on the above embodiment, the semantic relationship between each initial word vector and its context is calculated based on the multi-head attention mechanism, and the initial word vector is updated according to the semantic relationship to obtain an intermediate word vector containing semantic information, including:
[0090] Generate query vectors, key vectors, and value vectors based on each initial word vector. The generation formula is:
[0091] Q=XW Q ,K=XW K ,V=XW V (8);
[0092] Among them, X is the initial word vector, W Q ,W K ,W V are weight matrices corresponding to query vector, key vector and value vector respectively; Q represents query vector; K represents key vector; V represents value vector;
[0093] Based on the query vector, key vector and value vector, the attention output vector of the context information that each attention mechanism pays attention to is calculated. The calculation formula is:
[0094]
[0095] Among them, head i represents the attention output vector of the i-th attention mechanism; represents the weight matrix corresponding to the query vector, key vector, and value vector in the i-th attention mechanism.
[0096] In the multi-head attention mechanism, each self-attention mechanism focuses on the contextual information of the same word from different angles.
[0097] The attention output vectors of the context information paid attention to by each attention mechanism are connected to obtain the vector of the context information paid attention to by the multi-head attention mechanism, and the vector is determined as the intermediate word vector, where the concatenation formula is as follows:
[0098] MuitiHead(Q,K,V)=Concat(head1,head2…head k )W o (10);
[0099] Among them, Concat means that each head i After the matrix is connected, it is connected to the connection matrix W o Multiply.
[0100] In an embodiment of the present invention, the multi-head attention mechanism adopts a parallel processing method, and multiple attention mechanisms can be performed simultaneously, thereby greatly improving the efficiency of text extraction.
[0101] Based on the above implementation, the power equipment information includes equipment documents and equipment basic information. Equipment documents refer to all formal documents and records related to power high-voltage equipment, including but not limited to equipment instructions, operation manuals, maintenance records, design drawings, and technical specifications; equipment basic information at least includes equipment ID; the equipment defect recognition model includes an embedding layer, a graph convolution layer, and a classification layer;
[0102] The embedding layer is used to determine the initial feature vectors of the power equipment, document and word based on the basic information of the equipment, the equipment document and the target word vector. The initial feature vector is the embedding vector.
[0103] In another embodiment, in order to obtain an embedded feature with more discriminative characteristics, the initial feature vector may be further processed to obtain an embedded feature with more discriminative characteristics.
[0104] Specifically, a twin network with the same structure as the embedding layer can be constructed, which improves the discriminability of the initial feature vector by minimizing the distance between the embeddings of devices, documents, or words of the same category and maximizing the distance between devices, documents, and words of different categories in space. The initial feature vector is input into the trained twin network for further processing.
[0105] Among them, the training process of the twin network includes the following steps:
[0106] Step 1: First, obtain the historical defect sample data and sample labels of the device, document or word.
[0107] In the second step, the defect sample data is divided into positive sample pairs and negative sample pairs. The positive sample pair contains an anchor sample (anchor) and a positive sample (positive), and the negative sample pair contains an anchor sample and a negative sample (negative). Negative samples are samples with the opposite category to the positive samples.
[0108] The third step is to input the positive sample pairs and negative sample pairs into the twin network for forward propagation training to obtain the embedding vector a for each sample pair. i and b, and calculate the Euclidean distance of each sample pair;
[0109] The fourth step is to calculate the contrast loss of each sample pair based on the Euclidean distance of each sample pair. The loss function is as follows:
[0110]
[0111] Where N represents the number of training pairs, d = ∥a i -b i |2 represents the Euclidean distance between two embedding vectors. When y=1, the two input samples belong to the same category. y=0 means that the two input samples belong to different categories. Setting λ is to ensure that the distance between the features of the two samples is greater than a fixed margin.
[0112] In the fifth step, the parameters of the twin network are updated through back propagation to minimize the loss function. The above process is repeated until the predetermined number of training rounds is reached.
[0113] The graph convolution layer is used to construct an undirected graph containing three types of nodes: power equipment, documents, and words based on the initial feature vectors of power equipment, documents, and words, and perform a graph convolution operation on the central node in the undirected graph to update the initial feature vector of the central node to obtain a target feature vector that aggregates the feature information of the three types of nodes and the graph structure.
[0114] Among them, the central node is the key node in the undirected graph, which contains a large number of neighbor nodes. The central node can effectively aggregate the feature information of its neighbor nodes to obtain a richer feature representation.
[0115] In the graph convolution layer, in the first graph convolution layer, an undirected graph is constructed. In the subsequent convolution layer, the undirected graph and the initial feature vectors of power equipment, documents and words are used as input for multi-layer convolution operations. By continuously updating the feature representation of the current node with the help of surrounding nodes, the feature representation vectors of equipment, documents and words that aggregate the feature information of three types of nodes and network structure information are finally obtained. Through the superposition of multiple layers of graph convolution, the central node can be associated with multiple neighbors, thereby fully reflecting the structural relationship between power equipment, documents and words.
[0116] Among them, when pre-building the equipment defect recognition model, it is necessary to pre-train each layer of the model. When pre-training the graph convolution layer, the GCN (Graph Convolutional Networks) layer inputs the initial feature vectors of the device, document, and word to drive the model to learn and automatically correct the outliers in the device, document, and word.
[0117] When training this GCN layer, the mean squared error (ME) can be used as the loss function to evaluate the loss between the input and the reconstructed output, which is defined as:
[0118]
[0119] Among them, n represents the number of training frames, X i ′ For the reconstructed devices, documents, and words, Represents the corresponding input device, document, or word.
[0120] Furthermore, the time series smoothing constraint is incorporated into the data reconstruction process to reduce the impact of abnormal data on devices, documents, and words. Time series smoothing constraints are applied to devices, documents, and words, and the loss function is:
[0121]
[0122] Among them, X ′ For the reconstructed devices, documents, words, X ′ =[X1 ′ ,X2 ′ ,X3 ′ ,…,X ′ n-1 ,X ′ n ], C is a diagonal matrix used to measure X ′The distance between adjacent frames in is as follows:
[0123]
[0124] The classification layer is used to classify the defects of the target feature vector to obtain the defect recognition results of the target device.
[0125] In one example, the classification layer may be provided with 5 softmax classifiers, and the target feature vectors are classified by the 5 softmax classifiers to obtain the defect recognition result of the power equipment.
[0126] The embodiment of the present invention constructs an undirected graph by inputting the initial feature vectors represented by the one-hot vectors of the power equipment, documents and words into the first layer of the graph convolution layer, and then converting these initial feature vectors together with the undirected Figure 1 The graph convolution layer is used to learn and fuse the document and word feature vectors of power equipment. The graph convolution layer consists of several layers of neural networks, and the output of the previous layer is used as the input of the next layer. After passing through multiple layers of graph convolution layers, a set of target feature vectors of equipment, documents, and words that aggregate three types of node feature information and network structure information is output. The correlation between the target word vector and the equipment information is established through the graph convolution layer, and classification is performed based on the correlation, making the defect classification result more accurate.
[0127] Based on the above embodiment, the initial feature vectors of the power equipment, document and word are determined based on the basic information of the equipment, the equipment document and the target word vector respectively, including:
[0128] Discretize the basic device information, device documents and target word vectors.
[0129] Common discretization methods include equal-width binning, equal-frequency binning, and custom binning. For example, the discretization of usage time, assuming that the range of usage time is 0 to 10,000 hours, can be divided into 4 intervals: 0-2,500 hours, 2,501-5,000 hours, 5,001-7,500 hours, and 7,501-10,000 hours.
[0130] The discretized equipment basic information, equipment documents and target word vectors are one-hot encoded to obtain the one-hot vectors of power equipment, documents and words, and the one-hot vectors are used as the initial feature vectors.
[0131] In an example, basic device information includes device ID, usage duration, usage status, etc. After being discretized and one-hot encoded, this information can be used as a representation feature of the device.
[0132] One-Hot encoding is a commonly used feature encoding technique to convert categorical variables into feature vectors in binary form.
[0133] The basic steps of One-Hot encoding include:
[0134] Step 1: Identify Categories: First, identify all unique categories in the categorical variable.
[0135] Step 2: Create new features: Create a new binary feature for each class.
[0136] Step 3: Assignment: If a sample belongs to a certain category, assign 1 to the corresponding binary feature, otherwise assign 0.
[0137] Example: Assume that we have a data set containing the usage status of equipment. The usage status has three categories: normal, under maintenance, and out of service. For example, if the usage status of the equipment ID 1 is normal, then the data after One-Hot encoding is 100.
[0138] Based on the above embodiment, an undirected graph including three types of nodes of power equipment, document and word is constructed based on the initial feature vectors of power equipment, document and word, including:
[0139] Based on the initial feature vectors of the power equipment, the document and the word, three types of nodes and edges between the nodes of the undirected graph are constructed; wherein the edges between the nodes include the edge between the power equipment node and the document node, the edge between the document node and the word node, and the edge between the word node and the word node;
[0140] The weight of the edge between the power device node and the document node is configured as a fixed weight value; for example, 1.
[0141] The weight of the edge between the document node and the word node is calculated based on the TF-IDF algorithm.
[0142] TF-IDF is the product of term frequency and inverse document frequency, which is used to measure the importance of a word in a document. The formula is as follows:
[0143] TF-IDF=TF(t,d)×IDF(t,d)(15);
[0144] Among them, t represents a word and d represents a document.
[0145] The calculated TF-IDF value is used as the edge weight.
[0146] The weights of the edges between word nodes are calculated based on the PMI algorithm.
[0147] The PMI calculation method is as follows:
[0148]
[0149] Where p(i) represents the frequency of word i in sliding window #G; p(i,j) represents the frequency of word i,j in sliding window #G; PMI(i,j) represents the PMI value of word i and word j; #G is the total number of windows in the corpus, #G(i) is the number of sliding windows in the corpus containing word i, and #G(i,j) is the number of sliding windows in the corpus containing both words i and j. A positive value of PMI indicates that the two words have a high semantic relevance, while a negative value of PMI indicates that the two words have little or no semantic relevance. Therefore, edges are added only between two words with positive PMI.
[0150] In an example, the overall expression for computing the edges between nodes is as follows:
[0151]
[0152] Among them, U is the electric high-voltage equipment set, D is the document set, and W is the word set.
[0153] The undirected graph constructed by this method can capture the co-occurrence information of global words, learn and explore the potential relationships between devices, documents and words, and better represent words and documents.
[0154] Based on the above embodiment, a graph convolution operation is performed on the central node in the undirected graph to update the initial feature vector of the central node, and a target feature vector that aggregates three types of node feature information is obtained, including:
[0155] Perform neighbor sampling on the central node in the undirected graph to obtain a set of neighbor nodes;
[0156] The initial feature vectors of the neighbor node set are aggregated through the message passing mechanism to obtain the target feature vector that aggregates the feature information of the three types of nodes.
[0157] Among them, the basic steps of the message delivery mechanism are as follows:
[0158] Step 1: Initialize node features: Each node has an initial feature vector.
[0159] Step 2: Message passing: Each node receives messages from its neighbor nodes and aggregates these messages.
[0160] Step 3: Update node features: Update the node’s feature vector based on the aggregated messages.
[0161] In a specific example, there is a simple graph including three nodes, namely device node v1, document node v2 and word node v3. The initial feature vectors are For node v1, receiving messages from v2 and v3: Node v1 update features: Update document node v2 and word node v3 in the same way.
[0162] Through the message passing mechanism, each node can gradually aggregate the feature information of its neighbor nodes to obtain the target feature vector containing more contextual information.
[0163] Based on the above embodiment, neighbor sampling is performed on the central node in the undirected graph, and the obtained neighbor node set includes:
[0164] Determine the number of neighbor node samples;
[0165] Determine whether the total number of neighbor nodes around the central node of the undirected graph is greater than the number of neighbor node samplings;
[0166] If it is greater than, a preset number of sampling nodes are randomly selected to obtain a set of neighbor nodes;
[0167] If it is less than, a random sampling method with replacement is used to obtain a set of neighbor nodes of the sampling number.
[0168] The embodiment of the present invention can ensure that the number of neighbors sampled by each central node is consistent through random sampling, is not affected by the imbalance of node labeling relationships, and effectively reduces the complexity of the algorithm.
[0169] Based on the same inventive concept, a device for identifying defects in electric power equipment is provided, such as Figure 5 As shown, the device comprises:
[0170] The text extraction unit 501 is used to input the defect text to be identified of the target device into a pre-built text extraction model to obtain a target word vector of the defect text; wherein the text extraction model includes an input layer, a transformer encoding layer and a BI-LSTM output layer;
[0171] The input layer is used to convert the defect text to be identified into the initial word vector;
[0172] The transformer encoding layer is used to calculate the semantic relationship between each initial word vector and its context based on the multi-head attention mechanism, and update the initial word vector according to the semantic relationship to obtain an intermediate word vector containing semantic information;
[0173] The BI-LSTM output layer is used to perform bidirectional semantic extraction on the contextual semantic information of the intermediate word vector to obtain the target word vector containing bidirectional semantic information;
[0174] The defect identification unit 502 is used to input the target word vector and the power equipment information into a pre-built equipment defect identification model, so that the equipment defect identification model constructs a relationship topology map between the target word vector and the power equipment information, and classifies defects based on the relationship topology map to obtain a defect identification result for the target equipment.
[0175] Based on the same technical concept, an embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601 , a communication interface 602 , a memory 603 and a communication bus 604 , wherein the processor 601 , the communication interface 602 , and the memory 603 communicate with each other via the communication bus 604 .
[0176] Memory 603, used for storing computer programs;
[0177] The processor 601 is used to implement the steps of the power equipment defect identification method when executing the program stored in the memory 603.
[0178] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0179] The communication interface is used for communication between the above electronic device and other devices.
[0180] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0181] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0182] The computer program product for identifying defects in power equipment provided in an embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.
[0183] The device for identifying defects in power equipment provided in the embodiment of the present invention may be specific hardware on the equipment or software or firmware installed on the equipment. The implementation principle and technical effects of the device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment. Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0184] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0185] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0186] In addition, each functional unit in the embodiment provided by the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0187] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0188] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0189] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for identifying defects in electric power equipment, characterized in that: The method comprises: Input the defect text to be identified of the target device into a pre-built text extraction model to obtain a target word vector of the defect text; wherein the text extraction model includes an input layer, a transformer encoding layer and a BI-LSTM output layer; The input layer is used to convert the defect text to be identified into an initial word vector; The transformer encoding layer is used to calculate the semantic relationship between each of the initial word vectors and its context based on a multi-head attention mechanism, and update the initial word vector according to the semantic relationship to obtain an intermediate word vector containing semantic information; The BI-LSTM output layer is used to perform bidirectional semantic extraction on the contextual semantic information of the intermediate word vector to obtain a target word vector containing bidirectional semantic information; The target word vector and the power equipment information are input into a pre-built equipment defect recognition model, so that the equipment defect recognition model constructs a relationship topology map between the target word vector and the power equipment information, and defects are classified based on the relationship topology map to obtain the defect recognition result of the target equipment.
2. The method according to claim 1, characterized in that Calculating the semantic relationship between each of the initial word vectors and its context based on the multi-head attention mechanism, and updating the initial word vector according to the semantic relationship to obtain an intermediate word vector containing semantic information includes: Based on each of the initial word vectors, a query vector, a key vector and a value vector are generated, and the generation calculation formula is: Q=XW Q ,K=XW K ,V=XW V Among them, X is the initial word vector, W Q ,W K ,W V are weight matrices corresponding to query vector, key vector and value vector respectively; Q represents query vector; K represents key vector; V represents value vector; Based on the query vector, key vector and value vector, the attention output vector of the context information that each attention mechanism pays attention to is calculated, and the calculation formula is: head i =Attention(QW i Q ,KW i K ,VQ i V ) Among them, head i represents the attention output vector of the i-th attention mechanism; The attention output vectors of the context information paid attention to by each attention mechanism are connected to obtain the vector of the context information paid attention to by the multi-head attention mechanism, and the vector is determined as the intermediate word vector, where the concatenation formula is: MuitiHead(Q,K,V)=ConCat(head1,head2…head k )W o ; Among them, Concat means that each head i After the matrix is connected, it is connected to the connection matrix W o Multiply.
3. The method according to claim 1, characterized in that The power equipment information includes equipment documents and equipment basic information. The equipment documents refer to all formal documents and records related to the power equipment, including but not limited to equipment instructions, operation manuals, maintenance records, design drawings, and technical specifications; the equipment basic information includes at least the equipment ID; the equipment defect recognition model of the power equipment includes an embedding layer, a graph convolution layer, and a classification layer; The embedding layer is used to determine the initial feature vectors of the power equipment, the document and the word respectively based on the basic information of the equipment, the equipment document and the target word vector; The graph convolution layer is used to construct an undirected graph containing three types of nodes, namely, power equipment, documents and words, based on the initial feature vectors of power equipment, documents and words, and perform a graph convolution operation on the central node in the undirected graph to update the initial feature vector of the central node, thereby obtaining a target feature vector that aggregates feature information of the three types of nodes and the graph structure; The classification layer is used to perform defect classification on the target feature vector to obtain a defect recognition result of the target device.
4. The method according to claim 3, characterized in that Determining the initial feature vectors of the power equipment, the document and the word based on the basic information of the equipment, the equipment document and the target word vector respectively includes: Discretizing the basic device information, device documents, and target word vectors; The discretized basic information of the equipment, equipment documents and target word vectors are processed by one-hot encoding to obtain one-hot vectors of the power equipment, documents and words, and the one-hot vectors are used as initial feature vectors.
5. The method according to claim 3, characterized in that: Based on the initial feature vectors of power equipment, documents and words, an undirected graph including three types of nodes: power equipment, documents and words is constructed. Based on the initial feature vectors of the power equipment, the document and the word, three types of nodes and edges between nodes of an undirected graph are constructed; wherein the edges between the nodes include edges between power equipment nodes and document nodes, edges between document nodes and word nodes, and edges between word nodes; Configuring the weight of the edge between the power equipment node and the document node to be a fixed weight value; Calculate the weight of the edge between the document node and the word node based on the TF-IDF algorithm; The weights of the edges between word nodes are calculated based on the PMI algorithm.
6. The method according to claim 3, characterized in that A graph convolution operation is performed on the central node in the undirected graph to update the initial feature vector of the central node, and a target feature vector that aggregates three types of node feature information is obtained, including: Performing neighbor sampling on the central node in the undirected graph to obtain a neighbor node set; The initial feature vectors of the neighbor node set are aggregated through a message passing mechanism to obtain a target feature vector that aggregates three types of node feature information.
7. The method according to claim 6, characterized in that The performing of neighbor sampling on the central node in the undirected graph to obtain a neighbor node set comprises: Determine the number of neighbor node samples; Determine whether the total number of neighbor nodes around the central node of the undirected graph is greater than the sampled number of neighbor nodes; If it is greater than, a preset number of sampling nodes are randomly selected to obtain a set of neighbor nodes; If it is less than, a random sampling method with replacement is used to obtain a set of neighbor nodes of the sampling number.
8. A device for identifying defects in electric power equipment, characterized in that: The device comprises: A text extraction unit, used to input the defect text to be identified of the target device into a pre-built text extraction model to obtain a target word vector of the defect text; wherein the text extraction model includes an input layer, a transformer encoding layer and a BI-LSTM output layer; The input layer is used to convert the defect text to be identified into an initial word vector; The transformer encoding layer is used to calculate the semantic relationship between each of the initial word vectors and its context based on a multi-head attention mechanism, and update the initial word vector according to the semantic relationship to obtain an intermediate word vector containing semantic information; The BI-LSTM output layer is used to perform bidirectional semantic extraction on the contextual semantic information of the intermediate word vector to obtain a target word vector containing bidirectional semantic information; The defect recognition unit is used to input the target word vector and the power equipment information into a pre-built equipment defect recognition model, so that the equipment defect recognition model constructs a relationship topology map between the target word vector and the power equipment information, and classifies defects based on the relationship topology map to obtain a defect recognition result for the target equipment.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Face clustering method based on graph convolutional neural network
CN114511905A
Intelligent response scene classification system and method, electronic equipment and storage medium
CN116975687A
Brain feature prediction using geometric deep learning on graph representations of medical image data
US20220122250A1