A knowledge processing method and device for power inspection defect detection

By applying Markov decision processes and random beam search strategies to the knowledge graph of power equipment, the problems of incomplete knowledge base and slow reasoning speed are solved, thereby improving the interpretability and advanced causal relationship inference of the knowledge graph of power equipment.

CN116719947BActive Publication Date: 2026-01-06HUNAN UNIV OF TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310439744.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2026-01-06
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

Existing knowledge graphs for power equipment suffer from incomplete knowledge bases, slow reasoning speed, and low accuracy during the completion process, especially lacking interpretability in complex environments and inferences about advanced causal relationships.

Method used

By employing Markov decision processes and random beam search strategies, an agent is trained to find the optimal path in a knowledge graph of power equipment. The policy network and value network are used for path planning and decision-making, forming an interpretable source of reasoning.

Benefits of technology

It improves the interpretability of power equipment knowledge graph completion and its inference capabilities in complex environments, provides better control and flexibility, and can effectively recommend explicit reasoning paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116719947B_ABST
    Figure CN116719947B_ABST
Patent Text Reader

Abstract

The application provides a knowledge processing method and device for power inspection defect detection, and the method comprises the following steps: obtaining an optimal path to connect a starting point entity and an ending point entity in the power equipment knowledge graph to form a Markov decision process according to the starting point entity and the ending point entity; training the Markov decision process to obtain a trained Markov decision process; an agent in the trained Markov decision process selects output edges in turn by using a random beam search strategy, and traverses to a new entity; when the agent searches for an optimal path by using the random beam search strategy, the path automatically forms a predicted explainable source. The application not only makes the power equipment knowledge graph knowledge completion explainable, but also improves the ability to understand complex environments and infer high-level causal relationships.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power line inspection defect detection technology, and also to a knowledge processing method and apparatus for power line inspection defect detection. Background Technology

[0002] Existing power equipment knowledge graphs contain and integrate data from power transmission and transformation networks to inspection records and scientific knowledge extracted from literature. This data often results in a highly incomplete knowledge base due to the possibility of missing many hidden links between entities. Therefore, knowledge processing is needed to complete the knowledge base, which involves inferring new relationships (missing links) by combining and reasoning with information found along other paths that connect a pair of entities.

[0003] To address this challenge, artificial intelligence reasoning systems are used to enhance human decision-making, often inferring facts not directly stored in a knowledge base. For example, reasoning based on knowledge graph representation learning first maps entities and relations to a low-dimensional continuous vector space. Then, it learns the distance features between entities and relations by studying the semantic type, structured attributes, and information about adjacent nodes in the space. Vector computation is used to find the most suitable vector representation, and finally, the authenticity of the queried relation is judged by comparison, supplementing the relationships between entities. Path-based reasoning uses carefully selected relational paths in the knowledge graph as reasoning evidence. An agent is trained to navigate the knowledge graph, finding highly relevant alternative paths, which are then used as features for downstream tasks.

[0004] However, current representation learning-based methods do not require manual definition of reasoning logic and are suitable for uncertain reasoning scenarios, but they lose the interpretability of reasoning results and are only suitable for one-on-one reasoning. A potential bottleneck of path-based reasoning is that supernodes connected to a large number of formulas will generate huge fan-out regions, which will significantly slow down the reasoning speed and affect the accuracy. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a knowledge processing method and device for detecting defects in power line inspection, which not only makes the knowledge graph of power equipment complete and interpretable, but also improves the ability to understand complex environments and infer advanced causal relationships.

[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:

[0007] Firstly, a knowledge processing method for detecting defects in power line inspections, the method comprising the following steps:

[0008] Obtain a large knowledge graph of power equipment containing many unseen zero-view relationships, and determine the starting and ending entities in the knowledge graph of power equipment;

[0009] Based on the starting entity and ending entity in the power equipment knowledge graph, an optimal path is obtained to connect the starting entity and the ending entity to form a Markov decision process.

[0010] The Markov decision process is trained to obtain a trained Markov decision process;

[0011] In the trained Markov decision process, the agent sequentially selects output edges and traverses to new entities using a random beam search strategy. When the agent finds an optimal path using the random beam search strategy, that path automatically forms the interpretable source of its prediction.

[0012] Optionally, a large knowledge graph of power equipment containing numerous unseen zero-view relationships is obtained, and the starting and ending entities in the power equipment knowledge graph are determined, including:

[0013] Define a knowledge graph G of power equipment with entity set E and relation set R, defined as G = {(e,r,e)|e,e∈E,r∈R}, where each triple (e,r,e) represents a fact of relation r between the starting entity e and the ending entity e.

[0014] Optionally, based on the starting entity and ending entity in the power equipment knowledge graph, an optimal path is obtained to connect the starting entity and ending entity to form a Markov decision process, including:

[0015] The optimal sequence of relational links is sought in the knowledge graph of the power equipment, and the search for the optimal sequence of relational links is formally defined as a Markov decision process. The Markov decision process includes a state space S, an action space A, a transition probability matrix P, and a reward function R. The state space S represents all reachable entities, the action space A represents the relationship type between two entities, the transition probability matrix P represents the probability of transitioning from the current entity to the next entity by performing an action, and the reward function R represents the accumulated immediate reward when an action is selected.

[0016] By utilizing Markov decision processes to model a knowledge graph environment and a policy network agent, the policy network agent interacts with the environment at each step and learns to select the optimal relational links to extend the reasoning path.

[0017] At each step, the policy network agent selects an action based on the current state using existing knowledge and learned policies. After executing the action, the environment returns a new state and the reward obtained.

[0018] The policy network agent updates its policy and value function based on information from environmental feedback, and then selects actions again based on the new policy until it finds the optimal path.

[0019] Optionally, the Markov decision process is trained to obtain a trained Markov decision process, including:

[0020] During the path-finding process of the policy network agent, the policy network agent takes entity e as its core. s Starting from the structured knowledge of the meta-path pattern, the pruned action space A is obtained. The policy network agent performs random beam search with the action probability generated by the dynamic policy network. One beam contains B candidate clue paths.

[0021] When the policy network agent reaches step j, it obtains the pruned action space based on the structured knowledge of the meta-path pattern. Then, the policy network agent performs random beam search using the action probabilities generated by the dynamic policy network. For each candidate path, B most likely actions are appended to the end of the path to generate a new path pool of size B×B. The action with the highest probability is selected to complete the search. The dynamic policy network can handle dynamically changing action spaces and obtain rewards for unstructured knowledge. The candidate path with the high probability score is saved to the next node.

[0022] Optionally, the agent in the trained Markov decision process sequentially selects output edges and traverses to new entities using a random beam search strategy, including:

[0023] Using a relational embedding model, an entity node in the current state is represented as a vector;

[0024] Calculate the cosine similarity between the vector and all other vectors, and sort them from highest to lowest similarity.

[0025] A subset of entity nodes are retained based on a predefined threshold. These retained entity nodes are considered as the nearest neighbors of the current entity node and are taken into account in the next action space.

[0026] When the agent enters a new state, it retains nearest neighbor information based on the cosine similarity of all entity nodes in the new state and a predefined threshold.

[0027] For each remaining entity node, the agent adds the relationship between the entity node and the entity nodes in the current state as an actionable action to the action space.

[0028] In the next step of path exploration, the agent selects the best strategy based on the nearest neighbor information of the current entity node in order to achieve knowledge graph traversal.

[0029] Optionally, the score for each candidate clue path is equal to:

[0030]

[0031] Optionally, in addition to the reward for obtaining unstructured knowledge, the following may also be included:

[0032] The stochastic policy π maps the state vector to the probability distribution of all possible actions. During training, the agent starts from the current state, samples actions, observes the reward signal, and enters the next state.

[0033] As the agent gradually learns better strategies to maximize the expected cumulative reward for any initial entity: Where η is the discount factor, and the policy network It accepts state vector embeddings and action vector embeddings as inputs and provides the probability of each action.

[0034] Secondly, a knowledge processing device for detecting defects in power line inspection includes:

[0035] The acquisition module is used to construct a knowledge graph of power equipment, detect power paths based on the knowledge graph of power equipment, and if a problem is detected in the power path, formally define the power path and describe the formal definition as a Markov decision process.

[0036] The processing module is used to design and learn policy networks and value networks with the same feature layers based on Markov decision processes. It learns to reach the answer node by selecting labeled relation edges at each step, building a bridge between visible and invisible relations. Its goal is to take the optimal decision sequence to maximize the expected reward.

[0037] Thirdly, a computer device comprising:

[0038] One or more processors;

[0039] A storage device for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the knowledge processing method for detecting defects in power line inspections.

[0040] Fourthly, a computer-readable storage medium storing a program that, when executed by a processor, implements the knowledge processing method for detecting defects in power line inspections.

[0041] The above-described solution of the present invention has at least the following beneficial effects:

[0042] The above-mentioned scheme of the present invention, through the trained Markov decision process, the agent sequentially selects the output edge and traverses to new entities using a random beam search strategy. When the agent uses the random beam search strategy to find an optimal path, the path automatically forms the interpretable source of its prediction, thereby providing better control and greater flexibility in the path finding process. It can also effectively extract different inference paths and candidate sets for recommendation, and find clear and reliable clues for the facts to be predicted. Attached Figure Description

[0043] Figure 1 This is a flowchart of the knowledge processing method for detecting defects in power line inspection according to the present invention.

[0044] Figure 2 This is an overall block diagram of the knowledge processing method for detecting defects in power line inspection according to the present invention.

[0045] Figure 3 This is a schematic diagram of the knowledge processing module structure for power inspection defect detection provided in an embodiment of the present invention. Detailed Implementation

[0046] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0047] like Figure 1 and Figure 2 As shown, an embodiment of the present invention proposes a knowledge processing method for detecting defects in power line inspections, the method comprising the following steps:

[0048] Step 11: Obtain a large power equipment knowledge graph containing a large number of unseen zero-view relationships, and determine the starting and ending entities in the power equipment knowledge graph;

[0049] Step 12: Based on the starting entity and ending entity in the power equipment knowledge graph, obtain an optimal path to connect the starting entity and ending entity to form a Markov decision process;

[0050] Step 13: Train the Markov decision process to obtain a trained Markov decision process;

[0051] Step 14: In the trained Markov decision process, the agent sequentially selects output edges and traverses to new entities using a random beam search strategy. When the agent uses the random beam search strategy to find an optimal path, that path automatically forms the interpretable source of its prediction.

[0052] In this embodiment, the agent in the Markov decision process, after training, sequentially selects output edges and traverses to new entities through a random beam search strategy. When the agent uses the random beam search strategy to find an optimal path, the path automatically forms the interpretable source of its prediction, thereby providing better control and greater flexibility in the pathfinding process. It can also effectively extract different inference paths and candidate sets for recommendation, finding clear and reliable clues for the facts to be predicted.

[0053] It should be noted that in step 11, this step refers to first acquiring a large knowledge graph of power equipment containing numerous unseen zero-lens relationships (connections that have not been previously recorded or discovered). This knowledge graph contains various information and relationships between entities related to power equipment. The starting and ending entities in the knowledge graph need to be determined for subsequent path planning and decision-making processes. In step 12, this step involves finding an optimal path in the power equipment knowledge graph using the aforementioned starting and ending entities, connecting the starting and ending entities, and transforming it into a Markov decision process. A Markov decision process is a probability-based sequential decision model that can be used to solve decision problems in uncertain environments. In step 13, this step involves training the aforementioned Markov decision process to obtain a trained model. The purpose of training is to enable the model to better adapt to real-world situations and improve accuracy and precision. In step 14, this step involves the agent using a random beam search strategy to select the optimal path and traverse new entities in the trained Markov decision process. When an agent finds an optimal path using this search strategy, the path automatically forms an interpretable source predicted by the agent, that is, an interpretable source of equipment defects inferred from known conditions. Therefore, this knowledge processing method for power line inspection defect detection mainly achieves efficient and accurate detection of power line inspection defects by constructing a knowledge graph of power equipment and using Markov decision processes and random beam search strategies for path planning and decision-making.

[0054] In a preferred embodiment of the present invention, step 11 above may include:

[0055] Step 111: Determine a power equipment knowledge graph G with an entity set E and a relation set R, defined as G = {(e,r,e)|e,e∈E,r∈R}, where each triple (e,r,e) represents a fact of relation r between the starting entity e and the ending entity e.

[0056] In this embodiment, specifically, in the power equipment knowledge graph, the entity set E may include various power equipment, such as transformers, switches, circuit breakers, etc., and each entity has its specific attributes and characteristics. The relation set r describes the relationships between these entities, such as the connection relationship between switches and transformers, the transformation relationship between current and voltage, etc. Therefore, the defined G = {(e,r,e)|e,e∈E,r∈R} represents the complete picture of entities and relations in the knowledge graph, providing a foundation for a deeper understanding of the power equipment knowledge graph. The knowledge graph environment and policy network agent structure are modeled by MDP (Markov Decision Process). At each step, through interaction with the environment, the agent learns to select a relation link to extend the reasoning path.

[0057] The main components of an MDP (Markov Decision Process) are shown below:

[0058] Environment: In this invention, the environment refers to the entire power equipment knowledge graph G, excluding query relations and their inverse relations. The environment remains consistent throughout the entire network framework training process.

[0059] States: At time step t, the state s t =(q, e) s e t h t )∈S is a tuple, where e s Let e ​​be the subject entity of the given question q. t From e s The entity visited at time step t during pathfinding, and h t It is the set of decisions made by the agent up to step t. Here, q and e s It can be viewed as global information known to the agent, e t It depends on h tThe initial state s0 is random, and its prior distribution is assumed to follow a uniform distribution so that equal sampling is performed at the beginning. Entities and relations in the state knowledge graph are naturally discrete atomic symbols. Because existing real-world knowledge graphs often contain a large number of triples, it is impossible to directly model all the symbolic atoms in a state. To capture the semantic information of these symbols, we use TransE as the baseline transformation embedding to represent entities and relations, which maps all symbols to a low-dimensional vector space. In our framework, each state captures the agent's position in the knowledge graph. After taking an action, the agent moves from one entity to another, and these two are linked by the action taken by the agent (relationship).

[0060] Actions (Decisions): The set of candidate actions at time step t based on state s t , state s t Complete action space A t Defined as entity e t All possible output edges, excluding historical entities and relationships. Formally, A t ={(r,e)|(e t ,r,e)∈G,e<{e0,...,e t-1}}, the action is given by the entity pair (e) with relation R. s e t Therefore, the agent hopes to find the most informative path connecting these entity pairs, starting from the source entity e. s Initially, the agent uses a policy network to select the most valuable relationships and extend its path at each step until it reaches the target entity e. t .

[0061] Transition (probability of transition): Due to the setting of actions, the probability value of state transition is deterministic. The transition is entirely based on the knowledge graph G, and the state is determined by the position of the entity. Once the agent takes action a... t =(r t+1 ,e t+1 When ), the state will change from s t =(e s ,e t ,h t ) becomes the next state s t+1 =(e s ,e t+1 ,h t+1 ), State transition: P[s t+1 =(e s ,e t+1 ,h t+1 )|s=(e s ,e t ,ht ), a t =(r t+1 ,e t+1 )]=1.

[0062] Reward: A reward is a specific signal transmitted from the environment to the agent, depending on whether the action is effective and whether a series of actions can elicit feedback from the endpoint entity within a specified number of repetitions. Here, a soft reward shaping technique is used: for ineffective actions, the reward is -1; for actions that do not lead to the basic fact, we choose R. T The output of the terminal state s is used as the reward. We expect the agent to find more quality paths; to this end, we use a scoring function f(es, et) to evaluate the terminal state s. T =(e s e T h T ) Provide soft rewards, terminal rewards R T Defined as:

[0063]

[0064] The above definition guarantees that the reward for a valid action is always greater than the reward for an invalid action, and the reward for a successful plot is always greater than the reward for an unsuccessful plot.

[0065] In a preferred embodiment of the present invention, step 12 above may include:

[0066] Step 121: Find the optimal sequence of relational links in the power equipment knowledge graph, and formally define the search for the optimal sequence of relational links as a Markov decision process. The Markov decision process includes a state space S, an action space A, a transition probability matrix P, and a reward function R. The state space S represents all reachable entities, the action space A represents the relationship type between two entities, the transition probability matrix P represents the probability of transitioning from the current entity to the next entity by performing an action, and the reward function R represents the accumulated immediate reward when an action is selected.

[0067] Step 122: By using Markov decision process to model knowledge graph environment and policy network agent, the policy network agent interacts with the environment at each step and learns to select the optimal relation links to expand the reasoning path.

[0068] Step 123: In each step, the policy network agent selects an action based on the current state using existing knowledge and learned policies. After executing the action, the environment returns a new state and the reward obtained.

[0069] Step 124: The policy network agent updates its policy and value function based on the information from the environmental feedback, and selects actions again based on the new policy until the optimal path is found.

[0070] In step 121, by modeling the power equipment knowledge graph as a Markov decision process, the optimal sequence of relational links, i.e., the best reasoning path, can be found. Specifically, the state space represents all entities, the action space represents the types of relationships between entities, the transition probability matrix represents the probability of transitioning from the current entity to the next entity by performing an action, and the reward function represents the accumulated immediate reward when an action is selected. In this way, we can define how to perform reasoning on the knowledge graph and output the final result.

[0071] In this embodiment, in step 122, a Markov decision process is used to model the knowledge graph environment and the policy network agent. The policy network agent is a reinforcement learning model based on deep learning technology, which can learn the optimal policy from experience and interact with the environment at each step. Through interaction with the environment, the policy network agent can continuously update its policy and value function to find the best reasoning path. In step 123, the policy network agent selects an action based on the current state using existing knowledge and the learned policy. After executing the action, the environment returns a new state and the reward obtained. Specifically, the policy network agent selects an action based on existing knowledge and the learned policy, which causes a change in the environment. The policy network agent updates its policy and value function based on the information returned by the environment. In step 124, the policy network agent updates its policy and value function based on the information fed back by the environment and continues to select actions based on the new policy until the best path is found. This process is iterative; the policy network agent continuously incorporates information from the environmental feedback into its decision-making, gradually moving towards finding the optimal path. Ultimately, the policy network agent can output the optimal sequence of relational links, i.e., the best reasoning path.

[0072] In a preferred embodiment of the present invention, step 13 above may include:

[0073] During the path-finding process of the policy network agent, the policy network agent takes entity e as its core. s Starting from the structured knowledge of the meta-path pattern, the pruned action space A is obtained. The policy network agent performs a random beam search using the action probabilities generated by the dynamic policy network. Each beam contains B candidate clue paths, and the score of each candidate clue path is equal to:

[0074]

[0075] When the policy network agent reaches step j, it obtains the pruned action space based on the structured knowledge of the meta-path pattern. Then, the policy network agent performs random beam search using the action probabilities generated by the dynamic policy network. For each candidate path, B most likely actions are appended to the end of the path to generate a new path pool of size B×B. The action with the highest probability is selected to complete the search. The dynamic policy network can handle dynamically changing action spaces and obtain rewards for unstructured knowledge. The candidate path with the high probability score is saved to the next node.

[0076] In this embodiment, the policy network utilizes the structured knowledge of relationships between entities and meta-path patterns to model the knowledge graph as a Markov decision process. Under the definitions of state space, action space, transition probability matrix, and reward function, it finds the optimal reasoning path by solving an optimization problem, providing a foundation for the subsequent search process. The policy network agent uses the action probabilities generated by the dynamic policy network and employs a random beam search algorithm to explore paths. By adding the most probable action to each candidate path, a new path pool is generated, and the action with the highest probability is selected to complete the search. This policy search has high efficiency and accuracy and can discover different paths. The policy network agent moves along the already searched paths, obtains the pruned action space based on the structured knowledge of meta-path patterns, and performs random beam search using the action probabilities generated by the dynamic policy network. The most probable action is appended to the end of the path to generate a new path pool, gradually finding the optimal path solution and obtaining a reward for unstructured knowledge. The policy network agent updates its policy and value function based on environmental feedback, continuously selecting actions based on new policies until the optimal path is found. This process is iterative; the policy network agent gradually approaches the optimal solution through repeated iterations, stopping the search after outputting the optimal sequence of relational links. During the search, the policy network agent continuously learns new knowledge from the environment and uses this knowledge for intelligent reasoning. Through the dynamic policy network described above, it selects B network paths composed of paths. All linked nodes in the network have high correlation coefficients with the initial nodes, serving as clear evidence of the association between these linked paths. Finally, it analyzes the relationships from e... s The generated B candidate paths are scored to select the final inference result, thus completing the path supplementation.

[0077] In a preferred embodiment of the present invention, step 14 above may include:

[0078] Using a relational embedding model, an entity node in the current state is represented as a vector;

[0079] Calculate the cosine similarity between the vector and all other vectors, and sort them from highest to lowest similarity.

[0080] A subset of entity nodes are retained based on a predefined threshold. These retained entity nodes are considered as the nearest neighbors of the current entity node and are taken into account in the next action space.

[0081] When the agent enters a new state, it retains nearest neighbor information based on the cosine similarity of all entity nodes in the new state and a predefined threshold.

[0082] For each remaining entity node, the agent adds the relationship between the entity node and the entity nodes in the current state as an actionable action to the action space.

[0083] In the next step of path exploration, the agent selects the best strategy based on the nearest neighbor information of the current entity node in order to achieve knowledge graph traversal.

[0084] In this embodiment, when the agent explores a path, the inconsistent output dimension of each node in the knowledge graph leads to spatial redundancy if the largest output dimension is used as the size of the next state action space. Therefore, a cosine similarity-based action pruning strategy is designed, which effectively preserves entity neighbors based on a scoring function. To maintain consistency in the output dimension of the policy network, the action space is defined as all relations in the knowledge graph. A policy network and a value network are constructed and learned based on reinforcement learning, and reinforced using the baseline TransE. The goal is to learn a stochastic policy π that maps the state vector to the probability distribution of all possible actions, maximizing the expected cumulative reward for any initial entity.

[0085]

[0086] Where η is the discount factor.

[0087] Policy Network It accepts state vector embeddings and action vector embeddings as input, and provides the probability of each action, and identifies those not belonging to the state vector embedding. The probability of an action is 0. First, the state set and action set are mapped to a feature space, and the similarity between state s and each action is calculated. Then, softmax is used to normalize the similarity to a probability distribution. Value Network Map the state vector s to a real value. The two networks are defined as follows:

[0088] s′=ReLU(ReLU(sW1)W2)

[0089]

[0090]

[0091]

[0092] Here, s and s′ represent the embedding and hidden features of the state, a s W represents the hidden features of an action. A It is a lookup table for action vectors, and ReLU is a non-linear activation function. This represents the trimmed motion space, and ⊙ is the Hadamard product, used here to mask invalid motions. State vector Represented as embedded e s e t and history h t The two networks are concatenated, where M is the spatial effect magnitude and D is the maximum spatial effect magnitude. The model parameters of the two networks are represented as θ = {W1, W2, W3, W4, W...}. ν Finally, policy gradient. Defined as:

[0093]

[0094] Where G represents the transition from state s to the final state s t The cumulative cash-out reward.

[0095] In knowledge graph completion tasks, given the type of the head entity and a valid relation, the type of the tail entity can be determined. Therefore, this attribute can be extended by creating chained rules for entity and relation types: {e0, r1, e1, r2, ..., r...} k ,e k If entity type e0 and all relations r1, ..., r k Other entity types e1, ..., e k It is uniquely determined. The k-relation sequence belongs to They are referred to as two entities (e0, e k An effective k-hop pattern is defined if there exists an entity set {e1, ..., e}. k-1 Its type is uniquely determined;

[0096] Therefore, {e0←r1→e1←r2→···←r k-1 →e k-1 ←r k →e kA valid k-hop path is formed on the knowledge graph of power equipment. When searching for a valid multi-hop path, the link relationship is selected based on the probability obtained from the model. Operations are considered valid or invalid; valid actions indicate an output relationship with the current entity, while invalid actions indicate no relationship. In practical applications, the path length required by the agent for a given problem is unknown; therefore, in A(s) t A self-loop edge has been added to the algorithm, allowing the agent to choose to terminate a path search. The agent will remain in the current entity e. t The path search is expanded to a fixed number of steps, t. Self-loop actions act as a kind of "stop" action, placing the agent in a special state called the terminal state. To remove redundant information, an action pruning strategy is designed. First, impossible edges are eliminated based on the meta-path pattern, and then a scoring function is used... Map all actions to values ​​conditioned on the initial entity. The scoring function for the action pruning strategy is as follows:

[0097]

[0098] Given two entities e s ,e k There exists only one multi-hop path chain, where <,> are dot product operations, e,r∈R. d A d-dimensional vector represents entity e and relation r, where be∈r is the deviation of entity e.

[0099] like Figure 3 As shown, embodiments of the present invention also provide a knowledge processing device 20 for power line inspection defect detection, comprising:

[0100] The acquisition module 21 is used to construct a knowledge graph of power equipment, detect power paths based on the knowledge graph of power equipment, and if a problem is detected in the power path, formally define the power path and describe the formal definition as a Markov decision process.

[0101] Processing module 22 is used to design and learn policy networks and value networks with the same feature layers based on Markov decision processes. It learns to reach the answer node by selecting labeled relation edges at each step, building a bridge between visible and invisible relations. Its goal is to take the optimal decision sequence to maximize the expected reward.

[0102] Optionally, a large knowledge graph of power equipment containing numerous unseen zero-view relationships is obtained, and the starting and ending entities in the power equipment knowledge graph are determined, including:

[0103] Define a knowledge graph G of power equipment with entity set E and relation set R, defined as G = {(e,r,e)|e,e∈E,r∈R}, where each triple (e,r,e) represents a fact of relation r between the starting entity e and the ending entity e.

[0104] Optionally, based on the starting entity and ending entity in the power equipment knowledge graph, an optimal path is obtained to connect the starting entity and ending entity to form a Markov decision process, including:

[0105] The optimal sequence of relational links is sought in the knowledge graph of the power equipment, and the search for the optimal sequence of relational links is formally defined as a Markov decision process. The Markov decision process includes a state space S, an action space A, a transition probability matrix P, and a reward function R. The state space S represents all reachable entities, the action space A represents the relationship type between two entities, the transition probability matrix P represents the probability of transitioning from the current entity to the next entity by performing an action, and the reward function R represents the accumulated immediate reward when an action is selected.

[0106] By utilizing Markov decision processes to model a knowledge graph environment and a policy network agent, the policy network agent interacts with the environment at each step and learns to select the optimal relational links to extend the reasoning path.

[0107] At each step, the policy network agent selects an action based on the current state using existing knowledge and learned policies. After executing the action, the environment returns a new state and the reward obtained.

[0108] The policy network agent updates its policy and value function based on information from environmental feedback, and then selects actions again based on the new policy until it finds the optimal path.

[0109] Optionally, the Markov decision process is trained to obtain a trained Markov decision process, including:

[0110] During the path-finding process of the policy network agent, the policy network agent takes entity e as its core. s Starting from the structured knowledge of the meta-path pattern, the pruned action space A is obtained. The policy network agent performs random beam search with the action probability generated by the dynamic policy network. One beam contains B candidate clue paths.

[0111] When the policy network agent reaches step j, it obtains the pruned action space based on the structured knowledge of the meta-path pattern. Then, the policy network agent performs random beam search using the action probabilities generated by the dynamic policy network. For each candidate path, B most likely actions are appended to the end of the path to generate a new path pool of size B×B. The action with the highest probability is selected to complete the search. The dynamic policy network can handle dynamically changing action spaces and obtain rewards for unstructured knowledge. The candidate path with the high probability score is saved to the next node.

[0112] Optionally, the agent in the trained Markov decision process sequentially selects output edges and traverses to new entities using a random beam search strategy, including:

[0113] Using a relational embedding model, an entity node in the current state is represented as a vector;

[0114] Calculate the cosine similarity between the vector and all other vectors, and sort them from highest to lowest similarity.

[0115] A subset of entity nodes are retained based on a predefined threshold. These retained entity nodes are considered as the nearest neighbors of the current entity node and are taken into account in the next action space.

[0116] When the agent enters a new state, it retains nearest neighbor information based on the cosine similarity of all entity nodes in the new state and a predefined threshold.

[0117] For each remaining entity node, the agent adds the relationship between the entity node and the entity nodes in the current state as an actionable action to the action space.

[0118] In the next step of path exploration, the agent selects the best strategy based on the nearest neighbor information of the current entity node in order to achieve knowledge graph traversal.

[0119] Optionally, the score for each candidate clue path is equal to:

[0120]

[0121] Optionally, in addition to the reward for obtaining unstructured knowledge, the following may also be included:

[0122] The stochastic policy π maps the state vector to the probability distribution of all possible actions. During training, the agent starts from the current state, samples actions, observes the reward signal, and enters the next state.

[0123] As the agent gradually learns better strategies to maximize the expected cumulative reward for any initial entity:

[0124] Where η is the discount factor, and the policy network It accepts state vector embeddings and action vector embeddings as inputs and provides the probability of each action.

[0125] It should be noted that this device is a device corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0126] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0127] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0128] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0129] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0130] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0132] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0133] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0134] Furthermore, it should be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent solutions of the present invention. Moreover, the steps performing the above-described series of processes can naturally be executed in the order described, but are not necessarily required to be executed in chronological order; some steps can be executed in parallel or independently of each other. Those skilled in the art will understand that all or any step or component of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or network of computing devices, in hardware, firmware, software, or a combination thereof. This is something that those skilled in the art can achieve by using their basic programming skills after reading the description of the present invention.

[0135] Therefore, the object of the present invention can also be achieved by running a program or a set of programs on any computing device. The computing device can be a known general-purpose device. Therefore, the object of the present invention can also be achieved simply by providing a program product containing program code implementing the method or apparatus. That is, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent to the present invention. Furthermore, the steps performing the above series of processes can naturally be performed in the order described, but are not necessarily required to be performed in chronological order. Some steps can be performed in parallel or independently of each other.

[0136] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A knowledge processing method for power patrol defect detection, characterized in that, The method comprises the following steps: An electric power equipment knowledge graph with a large number of zero-shot relationships is obtained, and a starting entity and an ending entity in the electric power equipment knowledge graph are determined; An optimal path is obtained to connect the starting entity and the ending entity according to the starting entity and the ending entity in the electric power equipment knowledge graph, so as to form a Markov decision process; The Markov decision process is trained to obtain a trained Markov decision process; An agent in the trained Markov decision process selects output edges in turn by using a random beam search strategy, and traverses to new entities, and when the agent searches for an optimal path by using the random beam search strategy, the path automatically forms a predicted explainable source; The agent in the trained Markov decision process selects output edges in turn by using a random beam search strategy, and traverses to new entities, and comprises the following steps: An entity node in a current state is represented as a vector by using a relationship embedding model; Cosine similarities between the vector and all other vectors are calculated, and the cosine similarities are sorted in descending order; Part of the entity nodes are reserved according to a predefined threshold, wherein the reserved part of the entity nodes are considered as neighbors of the current entity node and are considered in a next action space; When the agent enters a new state, neighbor information is reserved according to cosine similarities of all entity nodes in the new state and a predefined threshold; For each reserved entity node, the agent adds a relationship between the entity node and an entity node in the current state to an action space as an actionable action; In the next path exploration, the agent selects an optimal strategy based on neighbor information of the current entity node to realize knowledge graph traversal.

2. The knowledge processing method for power patrol defect detection according to claim 1, characterized in that: An electric power equipment knowledge graph with a large number of zero-shot relationships is obtained, and a starting entity and an ending entity in the electric power equipment knowledge graph are determined, comprising: A power equipment knowledge graph G with an entity set E and a relation set R is determined, which is defined as G={(e,r,e)|e, e∈E,r∈R} wherein each triple represents a fact of a relation r between a start entity e and an end entity e.

3. The knowledge processing method for power patrol defect detection according to claim 2, characterized in that: An optimal path is obtained to connect the starting entity and the ending entity according to the starting entity and the ending entity in the electric power equipment knowledge graph, so as to form a Markov decision process, comprising: A best relationship link sequence is found in the electric power equipment knowledge graph, and the best relationship link sequence is defined as a Markov decision process, wherein the Markov decision process comprises a state space S, an action space A, a transition probability matrix P and a reward function R, the state space S represents all entities that can be reached, the action space A represents a relationship type between two entities, the transition probability matrix P represents a probability of transferring from a current entity to a next entity by performing an action, and the reward function R represents an immediate reward accumulated when an action is selected; A strategy network agent is modeled by using the Markov decision process, the strategy network agent interacts with an environment at each step, and learns to select an optimal relationship link to extend a reasoning path; At each step, the policy network agent selects an action based on the current state using existing knowledge and learned policy, and the environment returns a new state and the reward obtained after executing the action; The policy network agent updates its policy and value function according to the feedback information from the environment, and selects an action again based on the new policy until the optimal path is found.

4. The knowledge processing method for power patrol defect detection according to claim 3, characterized in that: Training the Markov decision process to obtain a trained Markov decision process, comprising: In the process of starting to search for a path by the policy network agent, the policy network agent acquires a pruned action space A according to the structured knowledge of the meta-path pattern, and performs random beam search with action probabilities generated by a dynamic policy network, one beam containing B candidate clue paths. In the process of starting to search for a path by the policy network agent, the policy network agent acquires a pruned action space A according to the structured knowledge of the meta-path pattern, and performs random beam search with action probabilities generated by a dynamic policy network, one beam containing B candidate clue paths. When the policy network agent searches to the j-th step, the policy network agent acquires the pruned action space according to the structured knowledge of the meta-path pattern, and then the policy network agent performs random beam search with the action probability generated by the dynamic policy network, for each candidate path, B most likely actions are appended to the end of the path to generate a new path pool with a size of BxB, the action with the highest probability is selected to complete the search, the dynamic policy network can process the dynamically changing action space and obtain the reward of unstructured knowledge, and the candidate path with high probability score is saved to the next node.

5. The knowledge processing method for power patrol defect detection according to claim 4, characterized in that: The score of each candidate clue path is equal to: 。 6. The knowledge processing method for power patrol defect detection according to claim 4, characterized in that: After obtaining the reward of unstructured knowledge, it further comprises: The random policy π maps the state vector to the probability distribution of all possible actions, and in the training process, the agent starts from the current state by sampling actions, observes the reward signal and enters the next state; As the agent gradually learns a better policy to maximize the expected cumulative reward of any initial entity: ; wherein, is a discount factor, the policy network accepts as input the state vector embedding and the action vector embedding and gives a probability for each action.

7. A knowledge processing apparatus for power patrol defect detection, characterized by: It comprises: An acquisition module is configured to acquire a power equipment knowledge graph that is huge and has a large number of unseen zero-shot relationships, and determine a start entity and an end entity in the power equipment knowledge graph; A processing module is configured to acquire an optimal path to connect the start entity and the end entity in the power equipment knowledge graph to form a Markov decision process; Training the Markov decision process to obtain a trained Markov decision process; The agent in the trained Markov decision process selects output edges in turn through a random beam search strategy and traverses to new entities, and when the agent searches an optimal path using the random beam search strategy, the path automatically forms an explainable source of its prediction; wherein the agent in the trained Markov decision process selects output edges in turn through a random beam search strategy and traverses to new entities, including: using a relation embedding model to represent an entity node in a current state as a vector; calculating the cosine similarity between the vector and all other vectors, and sorting them in descending order of similarity; retaining part of the entity nodes according to a predefined threshold, wherein the retained part of the entity nodes are considered as neighbors of the current entity node and are considered in the next action space; when the agent enters a new state, retaining the neighbor information according to the cosine similarity of all entity nodes at the new state and the predefined threshold; for each retained entity node, the agent adds the relationship between the entity node and the entity node in the current state to the action space as an actionable action; in the next path exploration, the agent selects the best strategy based on the neighbor information of the current entity node to realize the knowledge graph traversal.

8. A computer device, comprising: Comprise: 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, so that the one or more processors implement the knowledge processing method for power inspection defect detection as claimed in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a program which is executed by the processor to implement the knowledge processing method for power inspection defect detection as claimed in any one of claims 1-6.

Citation Information

Patent Citations

  • Multi-mode reinforcement learning-based power grid regulation and control method

    CN113947320A