Feature extraction network training method and device, case matching method and device and storage medium

Through the training method of feature extraction network, combining power safety knowledge and cases, using a bidirectional encoder and a bidirectional long and short-term memory network to extract semantic features, the problem of low matching efficiency of traditional power safety cases is solved, and more efficient power safety knowledge application is achieved and risk management.

CN119149992APending Publication Date: 2024-12-17GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411325321.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Traditional power safety knowledge management and case analysis rely on manual experience, is inefficient and susceptible to subjective factors, resulting in insufficient accuracy and effectiveness of power safety case matching.

Method used

Using the training method of feature extraction network, by fusing power safety knowledge with cases into text information, semantic features are extracted using a transformer represented by a bidirectional encoder and a bidirectional long and short-term memory network, and generating loss values ​​based on the characteristics of multiple cases. , improve feature extraction ability and case matching accuracy.

Benefits of technology

It improves the accuracy and effectiveness of power safety case matching, enables the model to better learn and adapt to different power safety cases, and improves the application of power safety knowledge and risk management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149992A_ABST
    Figure CN119149992A_ABST
Patent Text Reader

Abstract

The invention discloses a feature extraction network training method and device, a case matching method and device and a storage medium, and the method comprises the steps: fusing electric power security knowledge and electric power security cases into electric power security text information, loading a feature extraction network, inputting the electric power security text information into a converter represented by a bidirectional encoder to extract target semantic features, and outputting the target semantic features; inputting the target semantic features into a bidirectional long short-term memory network for processing to obtain electric power security text features, generating loss values according to the electric power security text features of a plurality of electric power security cases, updating a feature extraction network according to the loss values, and if updating is completed, judging whether a preset training condition is met; on the other hand, by fusing the electric power security knowledge and the cases and using the trained feature extraction network, more representative electric power security text features can be efficiently extracted, the features are used for effectively matching the electric power security cases, and the accuracy and effectiveness of electric power security case matching are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of power grid security case matching, and in particular to feature extraction network training, case matching methods, devices and storage media. Background Art

[0002] With the rapid development of the power industry, the importance of power safety management has become increasingly prominent. The accumulation of power safety knowledge and the analysis of power safety cases are one of the important factors for the safe operation of the power system.

[0003] However, traditional power safety knowledge management and case analysis mostly rely on manual experience, which is inefficient and easily affected by subjective factors, reducing the accuracy and effectiveness of power safety case matching. Summary of the invention

[0004] The present invention provides a feature extraction network training, case matching method, device and storage medium to improve the accuracy and effectiveness of power safety case matching.

[0005] In a first aspect, an embodiment of the present invention provides a method for training a feature extraction network, comprising:

[0006] Integrate power safety knowledge and power safety cases into power safety text information;

[0007] Loading a feature extraction network; the feature extraction network includes a transformer represented by a bidirectional encoder and a bidirectional long short-term memory network;

[0008] Inputting the power safety text information into the transformer represented by the bidirectional encoder to extract target semantic features;

[0009] Inputting the target semantic features into the bidirectional long short-term memory network for processing to obtain power safety text features;

[0010] generating a loss value according to the power safety text features of a plurality of the power safety cases;

[0011] Updating the feature extraction network according to the loss value;

[0012] If the update is completed, it is determined whether the preset training conditions are met; if so, it is determined that the feature extraction network has completed training; if not, it returns to execute the step of inputting the power safety text information into the converter represented by the bidirectional encoder to extract the target semantic features.

[0013] In a second aspect, an embodiment of the present invention further provides a case matching method, comprising:

[0014] Integrate power safety knowledge and power safety cases into power safety text information;

[0015] A feature extraction network loaded with the feature extraction network training method as described in the first aspect; the feature extraction network includes a transformer represented by a bidirectional encoder and a bidirectional long short-term memory network;

[0016] Inputting the power safety text information into the transformer represented by the bidirectional encoder to extract target semantic features;

[0017] Inputting the target semantic features into the bidirectional long short-term memory network for processing to obtain power safety text features;

[0018] The power safety cases are matched according to the power text features.

[0019] In a third aspect, an embodiment of the present invention further provides a training device for a feature extraction network, comprising:

[0020] The power safety text information acquisition module is used to integrate power safety knowledge and power safety cases into power safety text information;

[0021] A feature extraction network loading module, used to load a feature extraction network; the feature extraction network includes a transformer represented by a bidirectional encoder and a bidirectional long short-term memory network;

[0022] A target semantic feature extraction module, used for extracting target semantic features from the converter represented by the bidirectional encoder by inputting the power safety text information;

[0023] An electric power safety text feature acquisition module, used for inputting the target semantic feature into the bidirectional long short-term memory network for processing to obtain electric power safety text features;

[0024] A loss value generating module, used for generating a loss value according to the power safety text features of a plurality of the power safety cases;

[0025] A feature extraction network updating module, used to update the feature extraction network according to the loss value;

[0026] The training condition judgment module is used to judge whether the preset training conditions are met if the update is completed; if so, the method of the feature extraction network training completion module is executed; if not, the method of returning to the target semantic feature extraction module is executed;

[0027] The feature extraction network training completion module is used to determine whether the feature extraction network has completed training.

[0028] In a fourth aspect, an embodiment of the present invention further provides a case matching device, comprising:

[0029] A text information acquisition module is used to integrate power safety knowledge and power safety cases into power safety text information;

[0030] A feature network loading module, used to load the feature extraction network of the feature extraction network training method as described in the first aspect; the feature extraction network includes a transformer represented by a bidirectional encoder and a bidirectional long short-term memory network;

[0031] A semantic feature extraction module, used for extracting target semantic features from the transformer represented by the bidirectional encoder by inputting the electric power safety text information;

[0032] A text feature acquisition module, used for inputting the target semantic features into the bidirectional long short-term memory network for processing to obtain power safety text features;

[0033] A text feature matching module is used to match the power safety case according to the power text feature.

[0034] In a fifth aspect, an embodiment of the present invention further provides a computer device, including:

[0035] one or more processors;

[0036] A storage device for storing one or more programs;

[0037] When the one or more programs are executed by the one or more processors, the one or more processors implement the training method of the feature extraction network provided in the first aspect of the present invention, or the case matching method provided in the second aspect.

[0038] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a training method for a feature extraction network as provided in the first aspect of the present invention, or a case matching method as provided in the second aspect.

[0039] In the seventh aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the training method of the feature extraction network provided in the first aspect of the present invention, or the case matching method provided in the second aspect.

[0040] In this embodiment, the power safety knowledge and the power safety case are integrated into the power safety text information, the feature extraction network is loaded, the power safety text information is input into the transformer represented by the bidirectional encoder to extract the target semantic features, the target semantic features are input into the bidirectional long short-term memory network for processing, the power safety text features are obtained, the loss value is generated according to the power safety text features of multiple power safety cases, the feature extraction network is updated according to the loss value, if the update is completed, it is determined whether the preset training conditions are met, if so, it is determined that the feature extraction network has completed the training; if not, it returns to execute the power safety text information input into the transformer represented by the bidirectional encoder to extract the target semantic features. This embodiment improves the feature extraction capability of power safety text information by continuously iterating and optimizing the feature extraction network, thereby improving the accuracy and effectiveness of the model in the field of power safety, enabling the model to effectively learn and adapt to different power safety cases, and ultimately achieving more efficient power safety knowledge application and risk management. On the other hand, by integrating power safety knowledge with cases and using the trained feature extraction network, more representative power safety text features can be efficiently extracted, and these features are used to effectively match power safety cases, thereby improving the accuracy and effectiveness of power safety case matching. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flowchart of a method for training a feature extraction network provided in Embodiment 1 of the present invention;

[0042] Figure 2 A schematic diagram of power safety knowledge provided in the first embodiment of the present invention;

[0043] Figure 3 A schematic diagram of extracting attribute values ​​of power safety cases provided in the first embodiment of the present invention;

[0044] Figure 4 A schematic diagram of a case specification text information provided in Example 1 of the present invention;

[0045] Figure 5 A framework diagram of a model training provided in Example 1 of the present invention;

[0046] Figure 6 A flowchart of a case matching method provided in Embodiment 2 of the present invention;

[0047] Figure 7 A structural block diagram of a training device for a feature extraction network provided in Embodiment 3 of the present invention;

[0048] Figure 8 A structural block diagram of a case matching device provided in Embodiment 4 of the present invention;

[0049] Fig. 9A schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0050] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0051] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can cover sequential implementations other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0052] Embodiment 1

[0053] See also Figure 1 , shows a flow chart of a method for training a feature extraction network provided in the first embodiment of the present invention, the method can be executed by a training device for a feature extraction network, the training device for a feature extraction network can be implemented in the form of hardware and / or software, and the training device for a feature extraction network can be configured in a computer device. Figure 1 As shown, the method includes:

[0054] Step 101: Integrate power safety knowledge and power safety cases into power safety text information.

[0055] Power safety knowledge includes knowledge about power industry safety, protection, operation and emergency response. This knowledge involves how to safely operate power equipment, prevent and respond to power accidents, and ensure the stable operation of the power system, covering the correct use, maintenance, fault diagnosis and emergency measures of power equipment.

[0056] Power safety involves all aspects of the power system, from power generation, transmission to distribution and consumption. There are potential safety risks in every link. The risks of power safety are due to its many characteristics, as follows:

[0057] (1) Complex system. This mainly includes complex operating procedures and complex working environment. The power system is a highly integrated complex system, including generators, transformers, transmission lines, switchgear, control systems and many other components. Therefore, the operating procedures of the system are complex and detailed during power operations, including normal construction, daily inspections, maintenance, emergency response and other aspects. The complexity of the working environment is mainly reflected in the fact that power facilities may be distributed in different geographical environments (such as mountains, plains, oceans, etc.), and may also be accompanied by natural disasters (such as thunderstorms, typhoons, floods, etc.). Therefore, the ability requirements for power operators and their ability to overcome the influence of the external environment are relatively high.

[0058] (2) High professional ability requirements. Power safety requires in-depth knowledge of multiple disciplines, including electrical engineering, mechanical engineering, materials science, information technology, and other disciplines. It also includes different power fields, such as high-voltage transmission, substation operation, distribution network management, smart grid technology, etc. Each technology has its own specific requirements and operating specifications, so the professional technical requirements for power operators are high.

[0059] (3) Fast emergency response. Power accidents require a quick and effective response. When a power safety accident occurs, time is life, and detailed emergency plans and correct rescue measures are needed. Emergency management in normal times requires regular training, detailed plans and well-trained personal emergency qualities, which need to cover various possible situations and ensure that they can be quickly activated in an emergency.

[0060] The power industry is a basic industry. Whether the power production is safe or not is not only related to the benefits and development of the enterprise itself, but also affects the stability of the entire society, economic development and the normal life of the people. Therefore, doing a good job in safety knowledge education for production personnel and ensuring safe production is one of the important factors for power companies, and it is also one of the important measures to ensure the safety and health of operators during the production process.

[0061] Power safety cases refer to specific examples of power safety accidents or problems that occurred in the actual operation of the power industry. These cases usually include the process of the accident, cause analysis, treatment measures, and post-accident summary. By analyzing these cases, we can understand the various safety issues that may occur in the power system and learn how to prevent and deal with similar situations.

[0062] In this embodiment, by integrating power safety knowledge and power safety cases, comprehensive power safety text information is formed, combining theory and practice, and improving the ability of power safety management and accident response, so that the power system can more comprehensively and effectively refer to and apply relevant knowledge when dealing with safety issues, thereby improving the safety and reliability of the overall power system.

[0063] In one embodiment of the present invention, step 101 may include the following steps:

[0064] Step 1011: Identify operational elements from power safety knowledge.

[0065] In this embodiment, the operation elements are identified from a certain power safety knowledge, such as Figure 2 As shown, each row represents a job element, and each row includes objects, regulations / conditions, and other conditions.

[0066] Step 1012: Filter out attribute values ​​that meet the operating elements in the power safety case.

[0067] In this embodiment, attribute values ​​are screened out from power safety cases based on the identified operating elements. Figure 3 As shown, according to the objects in the identified operating elements, regulations / conditions and other conditions corresponding to each object are screened out from the power safety case.

[0068] Step 1013: Use separators to concatenate attribute values ​​into case specification text information.

[0069] A separator is a symbol or mark used to separate different attribute values, helping to clearly distinguish the parts and make the information easier to understand and process.

[0070] In this embodiment, if Figure 4 As shown, a separator (such as "[SEP]") is used to concatenate the filtered attribute values ​​to form case specification text information, and a start symbol ("[CLS]") is added to the beginning of the case specification text information.

[0071] Using "[SEP]" as a separator can improve the clarity and structure of information and make the relationship between different attribute values ​​clearer. This approach is not only easier to understand and process, but also enhances the model's ability to recognize context, thereby improving overall performance. Using "[CLS]" is usually used to indicate the beginning of a sentence and identify a specific input format or task, which helps the model understand the structure and meaning of a sentence.

[0072] Step 1014: Combine the power safety knowledge and case specification text information into power safety text information.

[0073] In this embodiment, power safety knowledge and case specification text information are spliced ​​through a separator ("[SEP]"), combining theoretical knowledge and actual cases to form power safety text information, providing a more comprehensive input object for training the feature extraction network.

[0074] Step 102: Load the feature extraction network.

[0075] The feature extraction network is a model used to extract useful information from raw data. It includes an input layer, an embedding layer, a hidden layer (such as a convolutional layer, a recurrent layer, and an attention mechanism), and an output layer, and is designed to convert complex data into meaningful feature representations for subsequent analysis and decision-making. This type of network can effectively compress data, identify patterns, and improve model performance. It is important in areas such as power safety and helps extract key information to address safety issues.

[0076] In this embodiment, the feature extraction network includes a Bidirectional Encoder Representation Transformer (BERT) and a Bidirectional Long Short-Term Memory (Bi-LSTM) network.

[0077] Among them, the Bidirectional Encoder Represented Transformer (BERT) is a bidirectional pre-trained language model that learns language patterns by pre-training on a large amount of text data. It is based on the Transformer architecture and is mainly used for natural language processing tasks. It adopts a bidirectional training method, with the aim of taking into account the bidirectional information of the context when understanding sentences, thereby obtaining a richer semantic representation. BERT's pre-training is completed through two main tasks: Masked Language Model (MLM) and Next Sentence Prediction (NSP). In the MLM task, BERT tries to predict the masked words in the input text, which forces the model to understand the contextual meaning of the words. In the NSP task, BERT learns to predict whether two sentences may be continuous text paragraphs, thereby grasping the relationship between sentences.

[0078] Bi-LSTM is an improved recurrent neural network that can capture information from both the forward and backward directions of a sequence. It combines two LSTM layers, one for the forward sequence and the other for the reverse sequence, to more fully understand the context. Bi-LSTM performs well in natural language processing tasks such as text classification, sentiment analysis, and sequence labeling, and can effectively capture long-distance dependencies and complex semantic information.

[0079] Step 103: Input the power safety text information into the converter represented by the bidirectional encoder to extract the target semantic features.

[0080] In this embodiment, the power safety text information is input into the bidirectional encoder representation transformer (BERT), which processes the input power safety text information and extracts the target semantic features by considering the previous and next information of each word in the context through its bidirectional self-attention mechanism. These target semantic features not only capture the semantic relationship of the words, but also retain the rich information of the context, laying the foundation for subsequent input into the bidirectional long short-term memory network.

[0081] Specifically, the power safety text information is divided into multiple power safety text blocks to solve the problem that BERT cannot process long text data. The segmented multiple power safety text blocks are sequentially input into the transformer represented by the bidirectional encoder to extract multiple original semantic features. Since the segmented original semantic features are encoded by the BERT encoder and are independent encodings, the original semantic features do not contain global context information. Therefore, multiple original semantic features are fused into target semantic features.

[0082] The BERT model structure mainly includes an embedding layer and a multi-layer bidirectional transformer structure. The embedding layer includes word embedding, position embedding, and sentence type embedding, and the input is represented by three types of embedding features. Among them, word embedding is to split each word into subwords and assign an embedding vector to each subword; position embedding adds a position identifier to each word, mainly to solve the problem that Transformer cannot capture the temporal relationship of characters; sentence type embedding marks which sentence or paragraph the input sequence comes from. The bidirectional Transformer mainly includes a multi-head attention mechanism and a feedforward layer. The multi-head attention mechanism maps the input feature representation to multiple vector spaces for interactive calculations, which can learn different interactive features, and the integration of multiple interactive features can also prevent overfitting. The feedforward layer is after the attention mechanism, and each encoder layer also includes a feedforward neural network for further feature processing. In order to alleviate the gradient vanishing problem, BERT uses residual connections before and after each sublayer, and performs layer normalization after each sublayer.

[0083] In this embodiment, multiple original semantic features are fused into target semantic features, the average vector O∈R of the output sentence vectors of the last two layers of Transformer of BERT is selected as the vector representation of the original semantic features of the current segment, and average pooling is used to obtain the final target semantic features, as shown in the following formula:

[0084]

[0085] Among them, n is the number of original semantic features of the current segment, υ is the target semantic feature, O i ∈R is the vector representation of the current segment.

[0086] Average Pooling is a commonly used downsampling technique that reduces the size of the feature map by averaging the elements in each pooling window in the input feature map. This method helps reduce computational complexity and the number of parameters while smoothing features to extract more representative information. It is widely used in tasks such as image classification, object detection, and speech recognition.

[0087] Step 104: Input the target semantic features into a bidirectional long short-term memory network for processing to obtain power safety text features.

[0088] In this embodiment, the target semantic features are input into Bi-LSTM to model the segmented front-end and back-end semantic dependencies, and the power safety text features of the case are extracted, as shown in the following formula:

[0089]

[0090]

[0091]

[0092] Among them, {x1,x2,…,x n} is the target semantic feature, is the hidden layer state of the forward and backward LSTM, is the hidden layer state of the backward LSTM, and h is the power safety text feature representation of the case obtained by concatenating the two vectors.

[0093] Step 105: Generate a loss value based on the power safety text features of multiple power safety cases.

[0094] In this embodiment, by calculating the loss value of the power safety text features of multiple power safety cases, we can understand the accuracy and effectiveness of the current model in processing power safety text, thereby guiding the optimization of the model. The loss value reflects the difference between the output predicted by the network feature extraction model and the true label, helping to adjust the parameters to improve the generalization ability and accuracy of the model. Through this feedback mechanism, the network feature extraction network can be effectively updated to ensure that its performance continues to improve in the subsequent training process, so as to better identify and process information related to power safety.

[0095] In this embodiment, if Figure 5 As shown, multiple safety cases are input into the feature extraction network, each case corresponds to a BERT model and a Bi-LSTM, each case is divided into multiple power safety text blocks, the multiple power safety text blocks are input into the corresponding BERT model to obtain the target semantic features, the multiple target semantic features are input into their respective Bi-LSTMs to obtain power safety text features, and the power safety text features of multiple power safety cases are input into the loss function to generate a loss value.

[0096] In this embodiment, a triplet is constructed with one power safety case as the anchor, one power safety case as the positive sample, and one power safety case as the negative sample. The power safety case serving as the positive sample and the power safety case serving as the anchor belong to the same category, while the power safety case serving as the negative sample and the power safety case serving as the anchor do not belong to the same category.

[0097] In the triplet loss function, a triplet consists of three samples: the anchor (Anchor) A, which is a reference sample; the positive sample (Positive) P, a sample belonging to the same category as the anchor; and the negative sample (Negative) N, a sample not belonging to the same category as the anchor. The goal of the triplet loss function is to reduce the distance between the anchor and its positive sample in the feature space while increasing the distance between the anchor and its negative sample. Specifically, it satisfies the equation: d(A, P) < d(A, N), where d represents the distance metric, such as the Euclidean distance. To achieve the above goal, the triplet loss function can be defined as:

[0098] L(A, P, N) = max(d(A, P) - d(A, N) + α, 0);

[0099] where d(A, P) and d(A, N) are the distances from the anchor to the positive sample and the negative sample respectively, and α is a non - negative margin hyperparameter used to ensure a minimum distance difference between the positive and negative samples. If d(A, P) - d(A, N) + α > 0, the loss function will prompt the model to adjust the weights to decrease d(A, P) and increase d(A, N); if d(A, P) - d(A, N) + α ≤ 0, the loss is 0, indicating that the model has already pulled the positive sample towards the anchor and pushed the negative sample away well enough.

[0100] In this embodiment, the loss value is calculated according to the differences in the power safety text features among the power safety case serving as the anchor, the power safety case serving as the positive sample, and the power safety case serving as the negative sample.

[0101] Specifically, the power safety text features of the power safety case serving as the anchor, the power safety text features of the power safety case serving as the positive sample, and the power safety text features of the power safety case serving as the negative sample are substituted into the following loss function for operation to obtain the loss value:

[0102]

[0103] where Loss is the loss value, is the power safety text feature of the power safety case serving as the anchor, is the power safety text feature of the power safety case serving as the positive sample, is the power safety text feature of the power safety case as a negative sample, γ is the threshold harmonization parameter, i∈n, and n is the number of triplets.

[0104] Step 106: Update the feature extraction network according to the loss value.

[0105] In this embodiment, by calculating the loss value, the model can identify which parameters need to be adjusted to reduce the gap between the prediction and the true value, and use a back-propagation algorithm such as stochastic gradient descent (SGD) or adaptive moment estimation (Adam) to update the feature extraction network based on the loss value.

[0106] The SGD algorithm is an optimization algorithm used to update the parameters of the model during the training process. Unlike the traditional gradient descent algorithm, SGD uses only a small portion of the training data (one or several samples) to calculate the gradient each time, thereby speeding up training and improving adaptability to large data sets. This method helps to jump out of the local optimal solution when facing complex non-convex optimization problems, thereby finding a better global solution.

[0107] Adaptive moment estimation (Adam) is an optimization algorithm that improves the efficiency of gradient descent by combining momentum method and adaptive learning rate. It uses the first-order moment (mean) and second-order moment (variance) of the current gradient to adjust the learning rate of each parameter. It has strong adaptability and is particularly suitable for processing large-scale data and high-dimensional space. Adam can converge quickly during training and is relatively tolerant of the choice of hyperparameters. It is widely used in various deep learning models.

[0108] Step 107: If the update is completed, determine whether the preset training conditions are met; if so, execute step 108; if not, return to execute 103.

[0109] In this embodiment, after completing a parameter update, the system checks whether the feature extraction network has reached the set training criteria. These training criteria may include whether the reduction in loss value is within an acceptable range, whether the performance of the feature extraction network has been significantly improved, or whether the number of training times has reached a predetermined upper limit. If it is detected that these criteria are met, the system will confirm that the training process has been completed, indicating that the feature extraction network has successfully learned the relevant features of the power safety text and can be used for subsequent applications.

[0110] On the contrary, if these preset training conditions are not met, it means that the network still has not achieved the ideal learning effect. At this time, the system will execute the feature extraction step again, continue to input power safety text information, extract the target semantic features through the bidirectional encoder converter, and continue the subsequent processing. This cyclic design ensures that the feature extraction network is continuously optimized and iterated, so that it can accurately capture and extract key information when facing different power safety cases, thereby improving the effectiveness and reliability of the model in practical applications. This feedback mechanism ensures the dynamics and adaptability of the entire training process, prompting the model to gradually improve its performance in continuous training and ultimately achieve the desired effect.

[0111] Step 108: Determine whether the feature extraction network has completed training.

[0112] In this embodiment, at this point, the feature extraction network has successfully learned the relevant features of the power safety text, which can be used for subsequent identification of similar power safety cases.

[0113] In an embodiment of the present invention, power safety knowledge and power safety cases are integrated into power safety text information, a feature extraction network is loaded, the power safety text information is input into a converter represented by a bidirectional encoder to extract target semantic features, the target semantic features are input into a bidirectional long short-term memory network for processing, power safety text features are obtained, loss values ​​are generated based on the power safety text features of multiple power safety cases, and the feature extraction network is updated based on the loss values. If the update is completed, it is determined whether the preset training conditions are met. If so, it is determined that the feature extraction network has completed training; if not, it returns to execute the power safety text information input into the converter represented by the bidirectional encoder to extract the target semantic features. This embodiment improves the feature extraction capability of power safety text information by continuously iterating and optimizing the feature extraction network, thereby improving the accuracy and effectiveness of the model in the field of power safety, enabling the model to effectively learn and adapt to different power safety cases, and improving the accuracy and effectiveness of power safety case matching.

[0114] Embodiment 2

[0115] See also Figure 6 , shows a flow chart of a case matching method provided by the second embodiment of the present invention, the method can be executed by a case matching device, the case matching device can be implemented in the form of hardware and / or software, and the case matching device can be configured in a computer device. Figure 6 As shown, the method includes:

[0116] Step 601: Integrate power safety knowledge and power safety cases into power safety text information.

[0117] In one embodiment of the present invention, operating elements can be identified from power safety knowledge, attribute values ​​that meet the operating elements can be screened out in power safety cases, and the attribute values ​​can be spliced ​​into case standard text information using delimiters, and the power safety knowledge and case standard text information can be spliced ​​into power safety text information.

[0118] Step 602: Load the feature extraction network.

[0119] In this embodiment, applied to power safety, the feature extraction network trained by the above-mentioned embodiment 1 is loaded to extract power safety text features from power safety text information; the feature extraction network includes a converter represented by a bidirectional encoder and a bidirectional long short-term memory network.

[0120] Power safety in the power grid covers power supply reliability, system stability, power quality, prevention of safety accidents and network security, ensuring the continuity and stability of power supply, responding to load changes and failures, maintaining voltage and frequency standards, monitoring potential hidden dangers, reducing accident risks, and protecting smart grids from cyber attacks, thereby ensuring the safe and stable operation of the power system.

[0121] Step 603: Input the power safety text information into the converter represented by the bidirectional encoder to extract the target semantic features.

[0122] In one embodiment of the present invention, the power safety text information is divided into multiple power safety text blocks, and the multiple power safety text blocks are sequentially input into a converter represented by a bidirectional encoder to extract multiple original semantic features, and the multiple original semantic features are fused into target semantic features.

[0123] Among them, an average pooling operation is performed on multiple original semantic features to obtain the target semantic features.

[0124] Step 604: Input the target semantic features into a bidirectional long short-term memory network for processing to obtain power safety text features.

[0125] Step 605: Match power safety cases based on power text features.

[0126] Power safety has many characteristics. Power safety also involves all aspects of the power system (power generation, transmission, distribution and power consumption, etc.), which leads to the frequent occurrence of power safety accidents. Therefore, it is necessary to summarize and review the safety accidents in the later stage and learn from the experience of the accidents. This will help the power industry to learn from past cases and take more effective preventive measures to ensure the stable operation of the system and the personal safety of employees, and reduce the recurrence of similar cases. Then the similarity matching of power safety cases is particularly important. The specific importance is as follows: (1) Experience reference and future prevention: Matching of similar cases can help power companies learn lessons from past accidents and avoid the same mistakes from happening again. At the same time, by analyzing similar cases, the common causes and patterns of accidents can be discovered, and then corresponding preventive measures and effective prevention strategies can be taken to ensure that they can respond quickly and effectively when accidents occur again. (2) Improve safety management: Matching of similar cases can help power companies evaluate the effectiveness of existing safety processes and make improvements accordingly, or the power system can be upgraded, or new technologies can be introduced, etc. At the same time, it can improve from the management level: whether there are defects in the management system and promote the improvement of the management system. (3) Providing decision support: When faced with new safety issues, finding and matching similar historical cases can help decision makers quickly obtain relevant experience and solutions. This matching can provide decision makers with evidence-based recommendations and improve the quality and speed of decision making. (4) As training and education cases: Matching similar safety cases can be used as training materials to help new and existing employees learn how to properly respond to similar safety incidents, improve employees' safety awareness, and ensure that they understand the correct operating procedures and emergency response measures.

[0127] Similar safety case matching is one of the important management factors in power safety management. It can help the power industry learn from historical experience, avoid the recurrence of accidents, and help improve the safety management level of the entire industry.

[0128] In this embodiment, the trained feature extraction network generates power text features for power safety text information, and matches power safety cases based on the power text features, thereby identifying and associating related cases to enhance the application and understanding of power safety knowledge. This helps to effectively prevent and respond to power safety issues in actual scenarios.

[0129] In the specific implementation, the similarity between the power text features of the current power safety case and the power text features of other power safety cases is calculated. The similarity can be calculated by algorithms such as Euclidean distance or cosine algorithm; through the calculation of the similarity, it is determined that the current power safety case is successfully matched with other power safety cases with the highest similarity.

[0130] In an embodiment of the present invention, power safety knowledge and power safety cases are fused into power safety text information, a feature extraction network is loaded, the power safety text information is input into a converter represented by a bidirectional encoder to extract target semantic features, the target semantic features are input into a bidirectional long short-term memory network for processing, power safety text features are obtained, and power safety cases are matched based on the power text features. This embodiment can efficiently extract more representative power safety text features by fusing power safety knowledge with cases and using a trained feature extraction network, and use these features to effectively match power safety cases, thereby improving the accuracy and effectiveness of power safety case matching.

[0131] Embodiment 3

[0132] Figure 7 A structural diagram of a training device for a feature extraction network provided in Embodiment 3 of the present invention is shown in FIG. Figure 7 As shown, the device comprises:

[0133] The power safety text information acquisition module 701 is used to integrate power safety knowledge and power safety cases into power safety text information;

[0134] A feature extraction network loading module 702 is used to load a feature extraction network; the feature extraction network includes a transformer represented by a bidirectional encoder and a bidirectional long short-term memory network;

[0135] A target semantic feature extraction module 703 is used to extract target semantic features from the transformer represented by the bidirectional encoder by inputting the power safety text information;

[0136] The power safety text feature acquisition module 704 is used to input the target semantic feature into the bidirectional long short-term memory network for processing to obtain the power safety text feature;

[0137] A loss value generating module 705, configured to generate a loss value according to the power safety text features of the plurality of power safety cases;

[0138] A feature extraction network updating module 706, used to update the feature extraction network according to the loss value;

[0139] The training condition judgment module 707 is used to judge whether the preset training condition is met if the update is completed; if so, the method of the feature extraction network training completion module 708 is executed; if not, the method of the target semantic feature extraction module 703 is executed;

[0140] The feature extraction network training completion module 708 is used to determine whether the feature extraction network has completed training.

[0141] In one embodiment of the present invention, the power safety text information acquisition module 701 includes:

[0142] An operation element identification module is used to identify operation elements from power safety knowledge;

[0143] An attribute value screening module, used to screen out attribute values ​​that meet the operation elements in the power safety case;

[0144] An attribute value splicing module, used to splice the attribute values ​​into case specification text information using separators;

[0145] The power safety text information splicing module is used to splice the power safety knowledge and the case specification text information into power safety text information.

[0146] In one embodiment of the present invention, the target semantic feature extraction module 703 includes:

[0147] A text block acquisition module, used to divide the power safety text information into multiple power safety text blocks;

[0148] An original semantic feature extraction module, used for sequentially inputting a plurality of the electric power safety text blocks into the converter represented by the bidirectional encoder to extract a plurality of original semantic features;

[0149] The target semantic feature acquisition module is used to fuse the multiple original semantic features into a target semantic feature.

[0150] In one embodiment of the present invention, the target semantic feature fusion module includes:

[0151] The original semantic feature average pooling module is used to perform an average pooling operation on a plurality of the original semantic features to obtain a target semantic feature.

[0152] In one embodiment of the present invention, the loss value generating module 705:

[0153] A triplet construction module is used to construct a triplet with one of the power safety cases as an anchor point, one of the power safety cases as a positive sample and one of the power safety cases as a negative sample; the power safety case as the positive sample belongs to the same category as the power safety case as the anchor point, and the power safety case as the negative sample does not belong to the same category as the power safety case as the anchor point;

[0154] A loss value calculation module is used to calculate the loss value according to the difference in the power safety text features between the power safety case as the anchor point, the power safety case as the positive sample and the power safety case as the negative sample.

[0155] In one embodiment of the present invention, the loss value calculation module includes:

[0156] A text feature calculation module is used to substitute the power safety text feature of the power safety case as the anchor point, the power safety text feature of the power safety case as the positive sample, and the power safety text feature of the power safety case as the negative sample into the following loss function to calculate and obtain a loss value:

[0157]

[0158] Among them, Loss is the loss value, is the power safety text feature of the power safety case as the anchor point, is the power safety text feature of the power safety case as the positive sample, is the power safety text feature of the power safety case serving as the negative sample, γ is a threshold harmonization parameter, i∈n, and n is the number of triples.

[0159] A feature extraction network training device provided in an embodiment of the present invention can execute a feature extraction network training method provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing a feature extraction network training method.

[0160] Embodiment 4

[0161] Figure 8 A schematic diagram of a case matching device provided in Embodiment 4 of the present invention is shown in FIG. Figure 8 As shown, the device comprises:

[0162] The text information acquisition module 801 is used to integrate power safety knowledge and power safety cases into power safety text information;

[0163] A feature network loading module 802, used to load a feature extraction network trained according to the method of claims 1-6; the feature extraction network includes a transformer represented by a bidirectional encoder and a bidirectional long short-term memory network;

[0164] A semantic feature extraction module 803, for extracting target semantic features from the transformer represented by the bidirectional encoder by inputting the electric power safety text information;

[0165] A text feature acquisition module 804 is used to input the target semantic feature into the bidirectional long short-term memory network for processing to obtain power safety text features;

[0166] The text feature matching module 805 is used to match the power safety case according to the power text feature.

[0167] In one embodiment of the present invention, the text information acquisition module 801 includes:

[0168] An element acquisition module, used to identify operation elements from power safety knowledge;

[0169] An attribute value acquisition module, used to screen out attribute values ​​that meet the operation elements in the power safety case;

[0170] A segmentation module, used for splicing the attribute values ​​into case specification text information using a separator;

[0171] A splicing module is used to splice the power safety knowledge and the case specification text information into power safety text information.

[0172] In one embodiment of the present invention, the semantic feature extraction module 803 includes:

[0173] An information segmentation module, used to segment the power safety text information into multiple power safety text blocks;

[0174] A text block input module, used for sequentially inputting a plurality of the power safety text blocks into the converter represented by the bidirectional encoder to extract a plurality of original semantic features;

[0175] The feature fusion module is used to fuse the multiple original semantic features into a target semantic feature.

[0176] In one embodiment of the present invention, the feature fusion module includes:

[0177] The feature average pooling module is used to perform an average pooling operation on the multiple original semantic features to obtain a target semantic feature.

[0178] In one embodiment of the present invention, the text feature matching module 805 includes:

[0179] A similarity calculation module, used for calculating the similarity between the power text feature of the current power safety case and the power text features of each of the other power safety cases;

[0180] The matching success module is used to determine whether the current power safety case is successfully matched with the other power safety case with the highest similarity.

[0181] The case matching device provided in the embodiment of the present invention can execute the case matching method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the case matching method.

[0182] Embodiment 5

[0183] See also Fig. 9 , showing a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. The computer device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, blade servers, mainframe computers, and other suitable computers. The computer device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0184] like Fig. 9 As shown, the computer device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the computer device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0185] A number of components in the computer device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the computer device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0186] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a training method for a feature extraction network, or a case matching method.

[0187] In some embodiments, the training method of the feature extraction network, or the case matching method, may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the computer device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the training method of the feature extraction network, or the case matching method described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured to execute the training method of the feature extraction network, or the case matching method, in any other appropriate manner (e.g., by means of firmware).

[0188] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0189] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0190] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0191] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0192] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0193] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0194] Embodiment 6

[0195] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the training method of the feature extraction network or the case matching method provided in any embodiment of the present invention.

[0196] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0197] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0198] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for training a feature extraction network, characterized in that: include: Integrate power safety knowledge and power safety cases into power safety text information; Load the feature extraction network; The feature extraction network includes a transformer represented by a bidirectional encoder and a bidirectional long short-term memory network; Inputting the power safety text information into the transformer represented by the bidirectional encoder to extract target semantic features; Inputting the target semantic features into the bidirectional long short-term memory network for processing to obtain power safety text features; generating a loss value according to the power safety text features of a plurality of the power safety cases; Updating the feature extraction network according to the loss value; If the update is completed, it is determined whether the preset training conditions are met; if so, it is determined that the feature extraction network has completed training; if not, it returns to execute the step of inputting the power safety text information into the converter represented by the bidirectional encoder to extract the target semantic features.

2. The method according to claim 1, characterized in that The integration of power safety knowledge and power safety cases into power safety text information includes: Identify operational elements from electrical safety knowledge; Filter out attribute values ​​that meet the operational elements in the power safety case; Use separators to concatenate the attribute values ​​into case specification text information; The power safety knowledge and the case specification text information are spliced ​​into power safety text information.

3. The method according to claim 1, characterized in that The step of inputting the electric power safety text information into the transformer represented by the bidirectional encoder to extract the target semantic features comprises: Dividing the power safety text information into multiple power safety text blocks; Inputting multiple segments of the power safety text blocks into the transformer represented by the bidirectional encoder in sequence to extract multiple original semantic features; The multiple original semantic features are fused into a target semantic feature.

4. The method according to claim 3, characterized in that The fusing of the plurality of original semantic features into a target semantic feature comprises: An average pooling operation is performed on the multiple original semantic features to obtain a target semantic feature.

5. The method according to any one of claims 1 to 4, characterized in that The generating of the loss value according to the power safety text features of the plurality of power safety cases comprises: A triplet is constructed with one of the power safety cases as an anchor point, one of the power safety cases as a positive sample, and one of the power safety cases as a negative sample; the power safety case as the positive sample belongs to the same category as the power safety case as the anchor point, and the power safety case as the negative sample does not belong to the same category as the power safety case as the anchor point; The loss value is calculated according to the difference in the power safety text features between the power safety case as the anchor point, the power safety case as the positive sample, and the power safety case as the negative sample.

6. The method according to claim 5, characterized in that The calculating of the loss value according to the difference between the power safety case as the anchor point, the power safety case as the positive sample and the power safety case as the negative sample in the power safety text features includes: Substitute the power safety text features of the power safety case as the anchor point, the power safety text features of the power safety case as the positive sample, and the power safety text features of the power safety case as the negative sample into the following loss function to calculate and obtain the loss value: Among them, Loss is the loss value, is the power safety text feature of the power safety case as the anchor point, is the power safety text feature of the power safety case as the positive sample, is the power safety text feature of the power safety case serving as the negative sample, γ is a threshold harmonization parameter, i∈n, and n is the number of triples.

7. A case matching method, characterized in that: include: Integrate power safety knowledge and power safety cases into power safety text information; Loading a feature extraction network trained according to the method of claims 1-6; The feature extraction network includes a transformer represented by a bidirectional encoder and a bidirectional long short-term memory network; Inputting the power safety text information into the transformer represented by the bidirectional encoder to extract target semantic features; Inputting the target semantic features into the bidirectional long short-term memory network for processing to obtain power safety text features; The power safety cases are matched according to the power text features.

8. The method according to claim 7, characterized in that The matching of the power safety case according to the power text feature includes: Calculating the similarity between the power text feature of the current power safety case and the power text features of each of the other power safety cases; It is determined that the current power safety case successfully matches the other power safety case with the highest similarity.

9. A computer device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the training method of the feature extraction network as described in any one of claims 1 to 6, or the case matching method as described in any one of claims 7 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the training method of the feature extraction network as described in any one of claims 1 to 6, or the case matching method as described in any one of claims 7 to 8 is implemented.