Power failure detection method and apparatus
By constructing a target power fault detection model using an improved reinforcement learning model and a hierarchical attention network, the problems of insufficient interpretability and multi-step reasoning ability in power fault detection methods are solved, achieving higher detection accuracy and interpretability.
Patent Information
- Application Number
- CN202310963365.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2026-03-27
- Estimated Expiration
- 2043-08-02
AI Technical Summary
Existing power fault detection methods based on embedded representations have limited interpretability and multi-step reasoning capabilities, leading to difficulties in user understanding and low fault detection capabilities.
An improved reinforcement learning model combined with a hierarchical attention network is used to construct a target power fault detection model. By acquiring power fault entity information and outputting the target fault path and its confidence level, power fault detection is achieved.
It improves the accuracy and interpretability of power fault detection, and enhances the understandability and operability of fault detection.
Smart Images

Figure CN116955651B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of power technology, and in particular to a power fault detection method and apparatus. Background Technology
[0002] In the power sector, power knowledge graphs are typically constructed to assist maintenance personnel in power-related fault maintenance and fault detection. However, in existing technologies, the interpretability and multi-step reasoning capabilities of reasoning methods based on embedded representations are still very limited. This can cause some confusion for users, making it difficult for them to understand and use, and also resulting in low fault detection capabilities. Summary of the Invention
[0003] This disclosure provides a power fault detection method and apparatus, which can improve the accuracy and interpretability of fault detection.
[0004] In a first aspect, embodiments of this disclosure provide a power fault detection method, comprising: acquiring power fault entity information; wherein the power fault entity information includes any two of the following: a power fault device, a component of the power fault device, a fault type of the component, and a fault handling strategy; inputting the power fault entity information into a target power fault detection model, outputting a target fault path corresponding to the power fault entity information and a confidence level of the target fault path; and performing power fault detection based on the target fault path.
[0005] Secondly, this disclosure also provides a power fault detection device, comprising: a power fault entity information acquisition module, used to acquire power fault entity information; wherein the power fault entity information includes any two of the following: a power fault device, a component of the power fault device, a fault type of the component, and a fault handling strategy; a target power fault detection model module, used to input the power fault entity information into a target power fault detection model, and output a target fault path corresponding to the power fault entity information and a confidence level of the target fault path; and a power fault detection module, used to perform power fault detection based on the target fault path.
[0006] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0007] One or more processors;
[0008] Storage device for storing one or more programs.
[0009] When the one or more programs are executed by the one or more processors, the one or more processors implement the power fault detection method as described in the embodiments of this disclosure.
[0010] The technical solution disclosed in this embodiment obtains power fault entity information; wherein, the power fault entity information includes any two of the following: a power fault device, a component of the power fault device, a fault type of the component, and a fault handling strategy; the power fault entity information is input into a target power fault detection model, and the target fault path corresponding to the power fault entity information and the confidence level of the target fault path are output; power fault detection is performed based on the target fault path. This embodiment, by inputting the power fault entity information into a target power fault detection model and outputting the target fault path corresponding to the power fault entity information and the confidence level of the target fault path, and performing power fault detection based on the target fault path, can improve the accuracy and interpretability of fault detection. Attached Figure Description
[0011] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0012] Figure 1 This is a schematic flowchart of a power fault detection method provided in an embodiment of the present disclosure;
[0013] Figure 2 This is a schematic diagram of a target power fault detection model structure provided in an embodiment of the present invention;
[0014] Figure 3 This is a schematic diagram of a hierarchical attention network module structure provided in an embodiment of the present invention;
[0015] Figure 4 This is a schematic diagram illustrating the application effect of a power fault detection method provided in an embodiment of the present invention;
[0016] Figure 5 This is a schematic diagram of the structure of a power fault detection device provided in an embodiment of the present disclosure;
[0017] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0018] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0019] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0020] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0021] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0022] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0023] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0024] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0025] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0026] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0027] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0028] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0029] Figure 1 This is a schematic flowchart of a power fault detection method provided in an embodiment of the present disclosure. The embodiments of the present disclosure are applicable to the detection of power faults, such as transformer fault detection. The method can be executed by a power fault detection device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.
[0030] S110, Obtain information about power fault entities.
[0031] The power fault entity information includes any two of the following: power fault device, components of the power fault device, fault type of the component, and fault handling strategy.
[0032] In this embodiment, any two power fault entity information items can be obtained from the following: power fault device, components of the power fault device, fault type of the component, and fault handling strategy. For any two power fault entity information items, one can be used as the header entity information and the other as the tail entity information.
[0033] S120. Input the power fault entity information into the target power fault detection model, and output the target fault path corresponding to the power fault entity information and the confidence level of the target fault path.
[0034] In this embodiment, power fault entity information can be input into a pre-constructed knowledge graph through a target power fault detection model, and the target fault path corresponding to the power fault entity information and the confidence level of the target fault path can be output. The target power fault detection model can be composed of an improved reinforcement learning model. The head entity information and tail entity information in the target fault path are power fault entity information. For example, if the power fault entity information is the fault type of a power fault device or component, then the head entity information in the target fault path can be the power fault device, and the tail entity information can be the fault type of the component.
[0035] The target power fault detection model includes a hierarchical attention network module, a multilayer perceptron module, an agent module, a probability distribution module, an activation function module, and an action module; the agent module includes relational agent units and entity agent units; the action module includes relational action units and entity action units.
[0036] For example, Figure 2 This is a schematic diagram of a target power fault detection model structure provided in an embodiment of the present invention. Figure 2 As shown, the Environment can be a reinforcement learning environment, i.e., a power fault knowledge graph. HAE is a hierarchical attention network module, MLP is a multilayer perceptron module, and the Agent module includes r_agent (relational agent unit) and e_agent (entity agent unit), i.e., two agents. r1, r2, and r3 are the relations selected by the relation agent, and e1, e2, and e3 are the entities selected by the entity agent. The probability distribution module includes πr and πe, used to determine the probability distribution of each relation and entity, respectively. The activation function module is the softmax function, and the action module includes e_action (entity action unit) and r_action (relational action unit).
[0037] The hierarchical attention network module includes: a first-layer attention mechanism unit, a second-layer attention mechanism unit, and a third-layer encoder; the first-layer attention mechanism unit includes a first predetermined number of attention mechanism networks; the second-layer attention mechanism unit includes a second predetermined number of attention mechanism networks; and the third-layer encoder includes a third predetermined number of encoders.
[0038] For example, Figure 3 This is a schematic diagram of a hierarchical attention network module structure provided in an embodiment of the present invention. Figure 3 As shown, the first-layer attention mechanism unit includes one attention mechanism network; the second-layer attention mechanism unit includes three attention mechanism networks; and the third-layer encoder includes multiple encoders. The encoder can adopt a transformer structure.
[0039] Optionally, the training method for the target power fault detection model is as follows: extract any two training entity information from the power fault knowledge graph training set, and use them as the head entity information and tail entity information, respectively; obtain the real path information corresponding to the two entity information from the power fault knowledge graph training set; input the two entity information into the target power fault detection model, and output the predicted path information and the confidence level of the predicted path information; train the target power fault detection model based on the confidence level.
[0040] In this embodiment, the knowledge graph data, including entity, relation, and attribute information, can first be prepared. This data can be obtained from power transformer fault-related tables and document data. Based on the prepared knowledge graph data, a power fault knowledge graph training set is constructed. This step can be achieved using a graph database or other graph processing tools. Then, any two training entity information are extracted from the power fault knowledge graph training set and used as the head and tail entity information, respectively. The actual path information corresponding to the two entity information is obtained from the power fault knowledge graph training set. The two entity information is input into the target power fault detection model, and the predicted path information and the confidence level of the predicted path information are output. The target power fault detection model is trained based on the confidence level.
[0041] Optionally, the real path information and the two training entity information are input into the target power fault detection model, and the predicted path information and the confidence level of the predicted path information are output. This includes: determining multiple predicted sub-path information based on the training head entity information; determining the confidence level corresponding to the multiple predicted sub-path information; determining a target confidence level based on the confidence level corresponding to the multiple predicted sub-path information; determining target predicted sub-path information based on the target confidence level; using the tail entity information in the target predicted sub-path information as the training head entity information, and continuing to determine multiple predicted sub-path information until the tail entity information in the target predicted sub-path information is the training tail entity information.
[0042] The true path information includes multiple true sub-path information; the predicted path information includes multiple predicted sub-path information, and any one of the true sub-path information corresponds to multiple predicted sub-path information. In this embodiment, the target power fault detection model explores from the power fault knowledge graph training set and outputs the predicted path information and corresponding confidence scores as follows: starting from the training head entity information, at each exploration step, multiple predicted sub-path information explored are output, along with the confidence score of each predicted sub-path information. The best predicted sub-path information and its corresponding confidence score for that step are selected, and the exploration continues on the selected best predicted sub-path information. This process continues until the tail entity information in the target predicted sub-path information is the training tail entity information.
[0043] Specifically, multiple predicted sub-paths are determined based on the training head entity information; the confidence levels corresponding to the multiple predicted sub-paths are determined; among the confidence levels corresponding to the multiple predicted sub-paths, the highest confidence level is determined as the target confidence level; the predicted sub-path information corresponding to the target confidence level is determined as the target predicted sub-path information; based on the target predicted sub-path information, the next target predicted sub-path is explored, that is, the tail entity information in the target predicted sub-path information is used as the training head entity information, and multiple predicted sub-paths are determined based on the training head entity information, and the target predicted sub-path information is determined, and so on, until the tail entity information in the target predicted sub-path information is the training tail entity information. At this point, complete predicted path information and the confidence level corresponding to each target predicted sub-path information can be obtained.
[0044] Optionally, determining the confidence level corresponding to the multiple predicted sub-path information includes: for any predicted sub-path information, comparing the real sub-path information with the predicted sub-path information to obtain a comparison result; determining a first confidence level based on the comparison result; determining a second confidence level based on the similarity between the real sub-path information and the predicted sub-path information; and determining a comprehensive confidence level based on the first confidence level and the second confidence level.
[0045] In this embodiment, the confidence level corresponding to each predicted sub-path information is determined as follows: The actual sub-path information and the predicted sub-path information are compared to obtain a comparison result; a first confidence level is determined based on the comparison result. For example, if the comparison result is consistent, the first confidence level is determined to be 1; if the comparison result is inconsistent, the first confidence level is determined to be 0 or -1. A second confidence level is determined based on the similarity between the actual sub-path information and the predicted sub-path information; wherein, the value of the second confidence level is the similarity value. The sum of the first confidence level and the second confidence level is determined as the comprehensive confidence level.
[0046] Optionally, determining a first confidence level based on the comparison result includes: if the comparison result shows that the actual sub-path information and the predicted sub-path information are the same, then determining the first confidence level to be 1; if the comparison result shows that the actual sub-path information and the predicted sub-path information are not the same, then determining the first confidence level to be 0 or -1.
[0047] In this embodiment, if the comparison result is that the real sub-path information is the same as the predicted sub-path information (that is, the relationship information and entity information in the real sub-path information and the predicted sub-path information are the same), then the first confidence level is determined to be 1; if the comparison result is that the entity information in the real sub-path information and the predicted sub-path information are the same, but the relationship information is different, then the first confidence level is determined to be 0; if the comparison result is that the entity information and the relationship information in the real sub-path information and the predicted sub-path information are both different, then the first confidence level is determined to be -1.
[0048] Optionally, if the comparison result shows that the real sub-path information and the predicted sub-path information are the same, then the first confidence level is determined to be 1, including: determining the first step length of the real path information; determining the second step length based on the predicted sub-path information; if the second step length is less than or equal to the first step length, the tail entity in the predicted sub-path information is the same as the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is the same as the relationship in the corresponding real sub-path information, then the first confidence level is determined to be 1; if the comparison result shows that the real sub-path information and the predicted sub-path information are not the same, then the first confidence level is determined to be 1. Setting the first confidence level to 0 or -1 includes: if the second step size is less than or equal to the first step size, the tail entity in the predicted sub-path information is the same as the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is set to 0; if the second step size is less than or equal to the first step size, the tail entity in the predicted sub-path information is different from the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is set to -1.
[0049] For example, the formula for determining the first confidence level is as follows:
[0050]
[0051] Where T is the first step length and t is the second step length. t e is the tail entity in the current predicted sub-path information. o This represents the tail entity of the actual subpath information corresponding to the currently predicted subpath information. r represents the relation in the currently predicted subpath information. qThis refers to the relationship in the actual sub-path information corresponding to the currently predicted sub-path information.
[0052] Specifically, if the second step length is less than or equal to the first step length, the tail entity in the currently predicted sub-path information is the same as the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is the same as the relationship in the corresponding real sub-path information, then it is considered a hit, and the first confidence level is determined to be 1. If the second step length is less than or equal to the first step length, the tail entity in the currently predicted sub-path information is the same as the tail entity in the corresponding real sub-path information, and the relationship in the currently predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is determined to be 0. "Otherwise" means that if the second step length is less than or equal to the first step length, the tail entity in the predicted sub-path information is different from the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is determined to be -1. Alternatively, "otherwise" means that if the second step length is greater than the first step length, the tail entity in the predicted sub-path information is different from the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is determined to be -1.
[0053] Optionally, determining a second confidence level based on the similarity between the real sub-path information and the predicted sub-path information includes: determining a first Manhattan distance from the predicted sub-path information; determining a second Manhattan distance from the real sub-path information; and determining the similarity between the first Manhattan distance and the second Manhattan distance as the second confidence level.
[0054] In this embodiment, the two entity information in the predicted sub-path information are converted into two predicted entity coordinate points on a two-dimensional plane coordinate axis; a first Manhattan distance is determined based on the two predicted entity coordinate points; the two entity information in the real sub-path information are converted into two real entity coordinate points on a two-dimensional plane coordinate axis; a second Manhattan distance is determined based on the two real entity coordinate points; and the similarity between the first Manhattan distance and the second Manhattan distance is determined as a second confidence level.
[0055] In this embodiment, the idea of calculating Manhattan distance is introduced as a confidence mechanism for reinforcement learning. Manhattan distance differs from Euclidean distance; it represents the sum of the absolute axial distances between two points, while Euclidean distance represents the straight-line distance between them. Simply put, given two points i and j on a two-dimensional plane coordinate axis and their coordinates (xi, yi) and (xj, yj), the Manhattan distance can be expressed as d(i, j) = |xi - xj| + |yi - yj|. Extended, the Manhattan distance between two n-dimensional vectors a(x11, x12, ..., x1n) and b(x21, x22, ..., x2n) is calculated as follows:
[0056]
[0057] The Manhattan distance method for calculating similarity has the characteristic that the larger the distance, the smaller the similarity; when the distance approaches infinity, the similarity is almost zero. Taking a negative Manhattan distance makes the similarity even higher and the similarity even lower.
[0058] S130. Perform power fault detection based on the target fault path.
[0059] In this embodiment, power fault maintenance and power fault detection can be performed based on the target fault path. The target fault path includes a power fault operation and maintenance plan.
[0060] The technical solution disclosed in this embodiment obtains power fault entity information; wherein, the power fault entity information includes any two of the following: a power fault device, a component of the power fault device, a fault type of the component, and a fault handling strategy; the power fault entity information is input into a target power fault detection model, and the target fault path corresponding to the power fault entity information and the confidence level of the target fault path are output; power fault detection is performed based on the target fault path. This embodiment, by inputting the power fault entity information into a target power fault detection model and outputting the target fault path corresponding to the power fault entity information and the confidence level of the target fault path, and performing power fault detection based on the target fault path, can improve the accuracy and interpretability of fault detection.
[0061] In this embodiment, interpretability can be understood as outputting the confidence level of the target fault path along with the target fault path. In other words, it is to interpret the nodes (entities) and edges (relationships) in the knowledge graph so that operation and maintenance personnel can understand and apply them.
[0062] Figure 4 This is a schematic diagram illustrating the application effect of a power fault detection method provided in an embodiment of the present invention. Figure 4As shown, the data required to construct the knowledge graph is obtained from the power transformer fault-related tables and document data. The power transformer fault-related tables and document data can be accident reports, regulations and specifications, and operation and maintenance manuals, etc. Natural language processing technology is used to extract entities, update knowledge, extract relationships, and complete knowledge from accident reports, regulations and specifications, and operation and maintenance manuals, etc., in order to construct a power transformer operation and maintenance knowledge graph (power transformer operation and maintenance knowledge graph retrieval).
[0063] like Figure 4 As shown, the power fault device is a 110kV transformer. The components of the power fault device can be windings, core, and bushings. The fault types of these components include inter-turn breakdown, overheating faults, and capacitor core breakdown. Fault handling strategies include laminating the core laminations, adjusting the windings, and realigning the core after lifting it. The side between the 110kV transformer and the windings is considered a transformer component; the side between the 110kV transformer and the core is considered a transformer component; the side between the 110kV transformer and the bushing is considered a transformer component; the side between the winding and inter-turn breakdown is considered a component defect; the side between the core and the overheating fault is considered a component defect; the side between the bushing and the capacitor core breakdown is considered a component defect; and the sides between the overheating fault and the laminations, adjusting the windings, and realigning the core after lifting are all handling methods.
[0064] like Figure 4 As shown, the system receives alarm signals from the transformer, parses these signals to obtain fault information, including time, location, and fault description. Based on the fault information, a knowledge graph is retrieved to determine the target fault path. An operation and maintenance strategy is then derived from this path, and this strategy can be fed back into accident reports, procedures and specifications, and operation and maintenance manuals.
[0065] like Figure 4 As shown, for example, if the power fault entity information is a 110kV transformer and an overheating fault, the target fault path output by knowledge graph retrieval can be 110kV transformer -> core -> overheating fault (including the relationships within 110kV transformer -> core -> overheating fault); the target fault path output can also be transformer -> core -> overheating fault -> core lamination, winding adjustment and core lifting, etc. (that is, all information on the path where the 110kV transformer and overheating fault are located).
[0066] The solution provided in this disclosure combines reinforcement learning and knowledge graphs, essentially proposing a dynamic knowledge graph-based interpretable reasoning method based on reinforcement learning. This method can explicitly provide the reasoning path when utilizing reinforcement learning, and simultaneously designs an interpretable reinforcement learning model (target power fault detection model) to improve the interpretability of the reasoning.
[0067] The advantages of this solution are: it enables adaptive learning and optimization of knowledge, improving the quality and interpretability of knowledge; it can be applied to knowledge modeling and application in the power industry or other fields, improving the efficiency and accuracy of knowledge management and application; it adopts reinforcement learning algorithms, which can optimize the structure and content of the knowledge graph through continuous trial and error and learning, improving the quality and interpretability of knowledge; and it can interpret the nodes and edges in the knowledge graph according to application requirements, so that users can understand and apply it.
[0068] For example, another power fault detection method has the following specific steps:
[0069] Step 1: Data Preparation: First, you need to prepare the knowledge graph data, including information on entities, relationships, and attributes. This data can be obtained from power transformer fault-related tables and document data.
[0070] Step 2: Dynamic Knowledge Graph Construction: Based on the prepared data, construct a knowledge graph. This step can be achieved using graph databases or other graph processing tools.
[0071] First, based on knowledge and data related to transformer faults in the power sector, an initial knowledge graph is constructed and stored in a database. Then, the knowledge graph is continuously updated and optimized to achieve its dynamic nature. Given an entity set E and a relation set R, the knowledge graph consists of triples of the form (e1, r, e2), where e1, e2 ∈ E, r ∈ R. The set of all known triples is denoted as Δ. Knowledge graph question answering involves seeking an answer for another entity given a relation in a triple, in the form (e1, r, ?).
[0072] Step 3: Reinforcement Learning Environment Design: Design the reinforcement learning environment according to the specific task requirements. This includes defining states, actions, and confidence levels.
[0073] Define states and actions. First, based on the established knowledge graph, define the state, S∈E×E×R×E. Within this environment, the state consists of 4-tuples, with the current node e being the current state. t Starting node e 1q Initial query relation r q And the correct answer e 2q That is, s = (e t ,e 1q ,r q ,e 2q Furthermore, through observations, the state in the environment cannot be fully observed; only the current node and the initial query are known. The correct answer is hidden. Therefore, the observation design for any state is O(s=(e t ,e 1q,r q ,e2q))=(e t ,e 1q ,r q Then define the actions. Actions are the actions that can be executed in the current state, defined by the current node e. t The decision, except for no action (NO_OP), is based on the current node e. t The association is performed on triples, that is, any known triple (e t All of these (r, v) can be considered actions. Finally, the state transition function δ is designed: S × A → S, δ(s, a) = (v, e) / (r, v). 1q ,r q ,e 2q When s = (e t ,e 1q ,r q ,e 2q ) and action a = (e t ,r,v).
[0074] Define the reward function (i.e., the confidence function). The reward function in reinforcement learning is a key factor guiding agents to make effective policy decisions. To allow the model to fully consider the path diversity of the graph, agents are encouraged to "take" different paths. In this embodiment, in a multi-agent collaborative interaction scenario, the simple "either / or" hit reward is no longer applied. The confidence level in this embodiment consists of two parts: the hit reward RACURACY and the path similarity reward RSIMILARITY, corresponding to the first confidence level and the second confidence level, respectively.
[0075] Step 4: Reinforcement Learning Algorithm Selection: Based on the characteristics and requirements of the task, select a suitable reinforcement learning algorithm. Common reinforcement learning algorithms include Q-learning, Deep Q Network (DQN), and Policy Gradient algorithms.
[0076] Step 5: Reinforcement Learning Training: Train the knowledge graph using the selected reinforcement learning algorithm. This includes updating the model's parameters through interaction with the environment to optimize the policy.
[0077] After the agent makes decisions through the policy network, it selects an action (e) at time t. t ,r t The state is then updated and fed into a hierarchical attention network module (HAE). The encoder can adopt a transformer structure.
[0078] To enable the input of the Agent's policy network to assist the Agent in making decisions at the current moment, an interactive reasoning mode for the Agent was designed. After the Agent's historical state h- is updated, it is used as the input of the Agent's policy network to assist the Agent in making decisions at the current moment. Furthermore, whenever the Agent selects a possible action A = (etrt), the embedding of A can be represented as [e...]. t ;r t ([;] denotes vector concatenation), and then stack all possible actions A to obtain a moment A. Inputting A along with the current history h (after ReLU nonlinear activation) and the query tail entity e into the softmax function yields the probability distribution of the actions the agent might take. It is important to note that the designed multi-agent model needs to implement interactions on the policy network; therefore, the agent representations are different at this stage.
[0079] An alternating agent training model is adopted. The agent is trained when t=0, using the historical embedding h of the agent model as input to the agent's policy network. Alternating training is then performed thereafter. This is for paths with a series of relations r. The parameters 0 of the policy network consist of the parameters of the MLP, weights WI and W2, and biases. To find the parameters 0 that maximize the expected return, Monte Carlo policy gradient REINFORCE is used to update the parameters.
[0080]
[0081] Where at = (et, rt). It's also important to note that during gradient training, the states St of the two agents (r_agent (relational agent unit) and e_agent (entity agent unit) are distinguished and represented as follows:
[0082] Step Six: Policy Evaluation and Improvement: After training is complete, the trained policy is evaluated and improved based on the evaluation results. This may include adjusting parameters, increasing training data, etc.
[0083] Interpreting the knowledge graph. Maintenance personnel use transformer fault descriptions and target power fault detection models to infer the causes and solutions to faults. This process of recording and reasoning along knowledge graph paths interprets the nodes (entities) and edges (relationships) for easier understanding and application by maintenance personnel. For link prediction tasks, the result of the reasoning task is a list of relationships. However, during result verification, the target power fault detection model is evaluated based on its ability to predict a target relationship within the query triple. Path-based methods use the endpoint of the path as the target entity and then compare the representation of the entire reasoning path's relationship chain with the relationship list to evaluate the result.
[0084] In this embodiment, State and Action: In interpretive reinforcement learning, State and Action are two important concepts. State refers to an observation or description of the environment at a specific moment during the reinforcement learning process. It can be a complete environmental state or a partial observation. The state contains all the information about the environment, describing the current situation and its characteristics. In a knowledge graph, a state can be represented as an entity or a set of entities, or a combination of an entity and its attributes and relationships. Action refers to the behavior or decision that an agent can choose to make in a given state. Actions can be discrete or continuous. In a knowledge graph, actions can be represented as operations on entities, such as adding, deleting, or modifying entity attributes or relationships.
[0085] Figure 5 This is a schematic diagram of the structure of a power fault detection device provided in an embodiment of this disclosure; as shown below. Figure 5 As shown, the device includes a power fault entity information acquisition module 510, a target power fault detection model module 520, and a power fault detection module 530.
[0086] The power fault entity information acquisition module 510 is used to acquire power fault entity information; wherein, the power fault entity information includes any two of the following: power fault device, component of the power fault device, fault type of the component, and fault handling strategy; the target power fault detection model module 520 is used to input the power fault entity information into the target power fault detection model and output the target fault path corresponding to the power fault entity information and the confidence level of the target fault path; the power fault detection module 530 is used to perform power fault detection based on the target fault path.
[0087] The technical solution disclosed in this embodiment acquires power fault entity information through a power fault entity information acquisition module. The power fault entity information includes any two of the following: a power fault device, a component of the power fault device, a fault type of the component, and a fault handling strategy. The power fault entity information is input into a target power fault detection model module, which outputs the target fault path corresponding to the power fault entity information and the confidence level of the target fault path. The power fault detection module then performs power fault detection based on the target fault path. This embodiment, by inputting the power fault entity information into the target power fault detection model and outputting the target fault path corresponding to the power fault entity information and the confidence level of the target fault path, and by performing power fault detection based on the target fault path, can improve the accuracy and interpretability of fault detection.
[0088] The target power fault detection model includes a hierarchical attention network module, a multilayer perceptron module, an agent module, a probability distribution module, an activation function module, and an action module; the agent module includes relational agent units and entity agent units; the action module includes relational action units and entity action units.
[0089] The hierarchical attention network module includes: a first-layer attention mechanism unit, a second-layer attention mechanism unit, and a third-layer encoder; the first-layer attention mechanism unit includes a first predetermined number of attention mechanism networks; the second-layer attention mechanism unit includes a second predetermined number of attention mechanism networks; and the third-layer encoder includes a third predetermined number of encoders.
[0090] Optionally, the target power fault detection model module is specifically used for: extracting information on any two training entities from the power fault knowledge graph training set, and using them as the head entity information and tail entity information, respectively; obtaining the real path information corresponding to the two entity information from the power fault knowledge graph training set; inputting the two entity information into the target power fault detection model, and outputting the predicted path information and the confidence level of the predicted path information; and training the target power fault detection model based on the confidence level.
[0091] The true path information includes multiple true sub-path information; the predicted path information includes multiple predicted sub-path information, and any one of the true sub-path information corresponds to multiple predicted sub-path information; optionally, the target power fault detection model module is further configured to: determine multiple predicted sub-path information based on the training head entity information; determine the confidence level corresponding to the multiple predicted sub-path information; determine the target confidence level based on the confidence level corresponding to the multiple predicted sub-path information; determine the target predicted sub-path information based on the target confidence level; and use the tail entity information in the target predicted sub-path information as the training head entity information to continue determining multiple predicted sub-path information until the tail entity information in the target predicted sub-path information is the training tail entity information.
[0092] Optionally, the target power fault detection model module is further configured to: for any predicted sub-path information, compare the confidence level of the predicted sub-path information with the actual sub-path information to obtain a comparison result; determine a first confidence level based on the comparison result; determine a second confidence level based on the similarity between the actual sub-path information and the predicted sub-path information; and determine a comprehensive confidence level based on the first confidence level and the second confidence level.
[0093] Optionally, the target power fault detection model module is further configured to: if the comparison result shows that the real sub-path information is the same as the predicted sub-path information, then determine the first confidence level as 1; if the comparison result shows that the real sub-path information is not the same as the predicted sub-path information, then determine the first confidence level as 0 or -1.
[0094] Optionally, the target power fault detection model module is further configured to: determine the first step length of the true path information; determine the second step length based on the predicted sub-path information; if the second step length is less than or equal to the first step length, the tail entity in the predicted sub-path information is the same as the tail entity in the corresponding true sub-path information, and the relationship in the predicted sub-path information is the same as the relationship in the corresponding true sub-path information, then the first confidence level is determined to be 1.
[0095] Optionally, the target power fault detection model module is further configured to: if the second step size is less than or equal to the first step size, the tail entity in the predicted sub-path information is the same as the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is set to 0; if the second step size is less than or equal to the first step size, the tail entity in the predicted sub-path information is different from the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is set to -1.
[0096] Optionally, the target power fault detection model module is further configured to: determine a first Manhattan distance from the predicted sub-path information; determine a second Manhattan distance from the actual sub-path information; and determine the similarity between the first Manhattan distance and the second Manhattan distance as a second confidence level.
[0097] The power fault detection device provided in this disclosure can execute the power fault detection method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.
[0098] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0099] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 6 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 6 The diagram below shows the structure of the terminal device or server 500. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0100] like Figure 6 As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the electronic device 600. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An edit / output (I / O) interface 605 is also connected to the bus 604.
[0101] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0102] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0103] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0104] The electronic device provided in this embodiment and the power fault detection method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0105] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the power fault detection method provided in the above embodiments.
[0106] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0107] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0108] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0109] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: acquire power fault entity information; wherein the power fault entity information includes any two of the following: a power fault device, a component of the power fault device, a fault type of the component, and a fault handling strategy; input the power fault entity information into a target power fault detection model, and output the target fault path corresponding to the power fault entity information and the confidence level of the target fault path; and perform power fault detection based on the target fault path.
[0110] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "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 standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0111] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0112] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0113] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0114] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0115] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0116] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0117] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for detecting power faults, characterized in that, include: Obtain power fault entity information; wherein, the power fault entity information includes any two of the following: power fault device, component of the power fault device, fault type of the component, and fault handling strategy; The power fault entity information is input into the target power fault detection model, and the target fault path corresponding to the power fault entity information and the confidence level of the target fault path are output. Power fault detection is performed based on the target fault path; The training method for the target power fault detection model is as follows: Extract any two training entity information from the power fault knowledge graph training set, and use them as the head entity information and tail entity information respectively. Obtain the real path information corresponding to the two training entity information from the power fault knowledge graph training set; The two training entity information are input into the target power fault detection model, and the predicted path information and the confidence level of the predicted path information are output. The target power fault detection model is trained based on the confidence level. The actual path information includes multiple actual sub-path information; the predicted path information includes multiple predicted sub-path information, and any one of the actual sub-path information corresponds to multiple predicted sub-path information. Specifically, the actual path information and the information of the two training entities are input into the target power fault detection model, and the predicted path information and the confidence level of the predicted path information are output, including: Multiple predicted sub-path information is determined based on the training head entity information; Determine the confidence level corresponding to the multiple predicted sub-path information; The target confidence level is determined based on the confidence levels corresponding to the multiple predicted sub-path information. Determine the target prediction sub-path information based on the target confidence level; The tail entity information in the target predicted sub-path information is used as the training head entity information, and multiple predicted sub-path information is determined until the tail entity information in the target predicted sub-path information is the training tail entity information. The step of determining the confidence level corresponding to the multiple predicted sub-path information includes: For any predicted sub-path information, the confidence level is compared with the actual sub-path information to obtain the comparison result; Determine the first confidence level based on the comparison results; The second confidence level is determined based on the similarity between the real sub-path information and the predicted sub-path information; The overall confidence level is determined based on the first confidence level and the second confidence level.
2. The method according to claim 1, characterized in that, in, The target power fault detection model includes a hierarchical attention network module, a multilayer perceptron module, an agent module, a probability distribution module, an activation function module, and an action module; the agent module includes relational agent units and entity agent units; the action module includes relational action units and entity action units.
3. The method according to claim 2, characterized in that, in, The hierarchical attention network module includes: a first-layer attention mechanism unit, a second-layer attention mechanism unit, and a third-layer encoder; the first-layer attention mechanism unit includes a first predetermined number of attention mechanism networks; the second-layer attention mechanism unit includes a second predetermined number of attention mechanism networks; and the third-layer encoder includes a third predetermined number of encoders.
4. The method according to claim 1, characterized in that, The first confidence level is determined based on the comparison results, including: If the comparison result shows that the actual sub-path information is the same as the predicted sub-path information, then the first confidence level is determined to be 1. If the comparison result shows that the actual sub-path information is different from the predicted sub-path information, the first confidence level is set to 0 or -1.
5. The method according to claim 4, characterized in that, If the comparison result shows that the true sub-path information is the same as the predicted sub-path information, then the first confidence level is determined to be 1, including: The first step length of the actual path information is determined; The second step length is determined based on the predicted sub-path information; If the second step length is less than or equal to the first step length, the tail entity in the predicted sub-path information is the same as the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is the same as the relationship in the corresponding real sub-path information, then the first confidence level is determined to be 1. If the comparison result shows that the actual sub-path information and the predicted sub-path information are different, the first confidence level is determined to be set to 0 or -1, including: If the second step length is less than or equal to the first step length, the tail entity in the predicted sub-path information is the same as the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is set to 0. If the second step length is less than or equal to the first step length, the tail entity in the predicted sub-path information is different from the tail entity in the corresponding real sub-path information, and the relationship in the predicted sub-path information is different from the relationship in the corresponding real sub-path information, then the first confidence level is determined to be -1.
6. The method according to claim 1, characterized in that, Determining a second confidence level based on the similarity between the actual sub-path information and the predicted sub-path information includes: The first Manhattan distance is determined based on the predicted sub-path information; Determine the second Manhattan distance based on the actual sub-path information; The similarity between the first Manhattan distance and the second Manhattan distance is determined as the second confidence level.
7. A power fault detection device, characterized in that, include: A power fault entity information acquisition module is used to acquire power fault entity information; wherein, the power fault entity information includes any two of the following: power fault device, components of the power fault device, fault type of the component, and fault handling strategy; The target power fault detection model module is used to input the power fault entity information into the target power fault detection model and output the target fault path and the confidence level of the target fault path corresponding to the power fault entity information. A power fault detection module is used to detect power faults based on the target fault path; wherein, the training method of the target power fault detection model is as follows: Extract any two training entity information from the power fault knowledge graph training set, and use them as the head entity information and tail entity information, respectively; obtain the real path information corresponding to the two training entity information from the power fault knowledge graph training set; input the two training entity information into the target power fault detection model, and output the predicted path information and the confidence level of the predicted path information; train the target power fault detection model based on the confidence level. The actual path information includes multiple actual sub-path information; the predicted path information includes multiple predicted sub-path information, and any one of the actual sub-path information corresponds to multiple predicted sub-path information. The target power fault detection model module is further used for: Multiple predicted sub-paths are determined based on the training head entity information; the confidence level corresponding to the multiple predicted sub-paths is determined; a target confidence level is determined based on the confidence level corresponding to the multiple predicted sub-paths; target predicted sub-paths are determined based on the target confidence level; the tail entity information in the target predicted sub-paths is used as the training head entity information, and multiple predicted sub-paths are further determined until the tail entity information in the target predicted sub-paths is the training tail entity information; The target power fault detection model module is further used for: For any predicted sub-path information, the confidence level is compared with the actual sub-path information to obtain a comparison result; a first confidence level is determined based on the comparison result; a second confidence level is determined based on the similarity between the actual sub-path information and the predicted sub-path information; and a comprehensive confidence level is determined based on the first confidence level and the second confidence level.
Citation Information
Patent Citations
Power grid equipment fault diagnosis method and system based on knowledge graph relation reasoning
CN115563225A
Fault diagnosis capability assessment method and device based on performance-fault relation graph
CN116149297A