Intelligent Question-Answering Method for Power Issues

Through the intelligent question-and-answer method, DRL algorithm, attention mechanism, graph neural network and hybrid inference engine are used to solve the problem of insufficient response speed and processing efficiency of power service mode, and efficient, accurate and intelligent answers to power problems are achieved.

CN119202175BActive Publication Date: 2025-06-27NORTH CHINA GRID MEASUREMENT CENT
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411281783.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-06-27
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

When the existing power service model deals with complex and changing customer needs, the response speed and processing efficiency are insufficient, resulting in a decline in customer satisfaction and service quality impact.

Method used

An intelligent question-and-answer method for power problems is proposed. User queries are analyzed through DRL algorithm, the best path to retrieve relevant information from the power knowledge base is formulated, and attention mechanism is introduced in the information retrieval process, power knowledge graph is constructed based on graph neural network, and logical reasoning and rule matching are combined with a hybrid inference engine to generate target answers.

Benefits of technology

It improves the accuracy of query comprehension and the accuracy of information retrieval, enhances the logical and accuracy of answer generation, can handle more complex and abstract power problems, and achieves efficient, accurate and intelligent answers to power problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202175B_ABST
    Figure CN119202175B_ABST
Patent Text Reader

Abstract

The present invention proposes an intelligent question-answering method for power problems. The method includes: receiving a user query; parsing the user query through a DRL algorithm, formulating an optimal path for retrieving relevant information from a power knowledge base according to the parsing result, and generating a query strategy; retrieving relevant information from the power knowledge base according to the query strategy, and introducing an attention mechanism during the information retrieval process to perform dynamic weight allocation on the retrieved information; constructing a power knowledge graph based on a graph neural network, and combining with the power knowledge graph, performing logical reasoning and rule matching on the retrieved information through a hybrid inference engine to generate a target answer; outputting the target answer to the user. The intelligent question-answering method for power problems proposed by the present invention realizes efficient, accurate, and intelligent answering of power problems through the organic combination of a DRL algorithm, an attention mechanism, a graph neural network, and a hybrid inference engine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent question - answering for power problems, and particularly to an intelligent question - answering method for power problems. Background Art

[0002] With the continuous growth of power demand, customers' expectations for power services are also increasing. Users often hope to obtain quick and accurate answers to power - related questions, while the traditional service mode often fails to meet this demand. When dealing with complex and changeable customer needs, the existing power service mode often lacks in response speed and processing efficiency, which leads to a decline in customer satisfaction and also affects the service quality of power supply enterprises. Summary of the Invention

[0003] Based on this, the objective of the present invention is to propose an intelligent question - answering method for power problems to solve the above - mentioned problems.

[0004] According to the intelligent question - answering method for power problems proposed by the present invention, the method includes:

[0005] Receiving a user query, where the user query is a power - related query question input by the user;

[0006] Parsing the user query through a DRL algorithm, and formulating an optimal path for retrieving relevant information from the power knowledge base according to the parsing result to generate a query strategy;

[0007] Retrieving relevant information from the power knowledge base according to the query strategy, and during the information retrieval process, introducing an attention mechanism to perform dynamic weight assignment on the retrieved information;

[0008] Constructing a power knowledge graph based on a graph neural network, and combining with the power knowledge graph, performing logical reasoning and rule matching on the retrieved information through a hybrid inference engine to generate a target answer, where the power knowledge graph includes power entities, attributes, and relationships;

[0009] Outputting the target answer to the user.

[0010] Furthermore, the step of parsing the user query through a DRL algorithm, and formulating an optimal path for retrieving relevant information from the power knowledge base according to the parsing result to generate a query strategy includes:

[0011] Defining a state space, including the user query, the user's historical query records, and the current power knowledge base state;

[0012] Defining an action space, including querying specific entries in the power knowledge base, requesting the user to supplement information to clarify the question, or generating an answer based on the existing information;

[0013] Design a reward function to evaluate the generated answers according to the target metrics, where the target metrics include the accuracy of the answers and user satisfaction;

[0014] By interacting with the environment, continuously optimize the query strategy to maximize the long-term reward, where the environment includes an electricity knowledge base and a user feedback mechanism.

[0015] Furthermore, the step of introducing an attention mechanism to perform dynamic weight allocation on the retrieved information during the information retrieval process includes:

[0016] Convert the user query and the retrieved information into vector representations through an encoder;

[0017] During the decoding process, combine the multi-head attention mechanism to calculate the attention weights for the encoder output for each decoding step.

[0018] Furthermore, the step of converting the user query and the retrieved information into vector representations through an encoder includes:

[0019] Convert the user query into a sequence of query vectors q through an encoder,

[0020] q = [q1, q2,..., q i ,..., q n , where q i is the vector representation of the i-th word in the query;

[0021] Convert the retrieved information into a sequence of document vectors d through an encoder,

[0022] d = [d1, d2,..., d j ,..., d m , where d j is the vector representation of the j-th word in the document.

[0023] Furthermore, the step of combining the multi-head attention mechanism to calculate the attention weights for the encoder output for each decoding step includes:

[0024] Calculate the correlation between the current state of the decoder and the encoder output to obtain the attention weights;

[0025] Perform weighted summation on the encoder output based on the attention weights to obtain the context vector for each head;

[0026] Merge the context vectors of all heads to update the state of the decoder and generate an output vector.

[0027] Furthermore, the step of constructing an electricity knowledge graph based on a graph neural network includes:

[0028] Input the output vector into a graph neural network;

[0029] Use the graph neural network to perform information propagation on the graph structure, and update the representation of each node by aggregating the information of neighboring nodes. The aggregation formula is:

[0030]

[0031] where, represents the hidden state of node v in the k-th layer, N(v) represents the set of neighboring nodes of node v, A (k) is the aggregation function in the k-th layer, and c is the output vector;

[0032] Use the graph neural network and model the connection relationship between nodes to represent the connection between different power entities in the power knowledge graph.

[0033] Furthermore, the steps of combining the power knowledge graph, performing logical reasoning and rule matching on the retrieved information through a hybrid inference engine, and generating a target answer include:

[0034] Define a series of symbolic logic rules, set as preset logical rules. Each of the preset logical rules includes a precondition, a conclusion, an applicable scenario, and an exception;

[0035] Assign a unique priority identifier to each of the preset logical rules;

[0036] Construct a preset symbolic logic rule set and store it in a data structure;

[0037] Extract node representations related to the user query from the power knowledge graph;

[0038] Match the extracted node representations with each rule in the preset symbolic logic rule set in sequence to determine whether it satisfies the precondition of the rule;

[0039] If a node representation satisfies the precondition of one of the preset logical rules;

[0040] Then perform logical reasoning according to the selected preset symbolic logic rule to obtain a preliminary result.

[0041] Furthermore, after the step of matching the extracted node representations with each rule in the preset symbolic logic rule set in sequence to determine whether it satisfies the precondition of the rule, it further includes:

[0042] If a node representation simultaneously satisfies the preconditions of more than one of the preset logical rules;

[0043] Then trigger the conflict detection mechanism, and according to the priority identification that conforms to the preset logical rules, select the rule with the highest priority for application;

[0044] Conduct logical reasoning according to the selected preset symbolic logic rule to obtain a preliminary result.

[0045] Furthermore, after the step of conducting logical reasoning according to the selected preset symbolic logic rule to obtain a preliminary result, the following steps are also included:

[0046] Review the matched preset symbolic logic rule to ensure that the matched preset symbolic logic rule is applicable to the current problem and has no logical contradiction;

[0047] Convert the user query, preliminary result, and matched and reviewed preset symbolic logic rule into a formal representation;

[0048] Initialize the logical reasoning engine, and input the formalized user query, preliminary result, and matched preset symbolic rule;

[0049] Execute symbolic logic reasoning through the logical reasoning engine to gradually derive a more accurate conclusion and obtain the reasoning result, that is, the target answer.

[0050] In summary, according to the above intelligent question-answering method for power problems, through the DRL algorithm, the power-related queries input by users are deeply analyzed, which not only improves the accuracy of query understanding, but also intelligently formulates the best path for retrieving relevant information from a large power knowledge base according to the analysis results, thus ensuring the efficiency and pertinence of the query strategy. Secondly, in the information retrieval process, the attention mechanism is introduced, which can dynamically assign weights to the retrieved information, thus effectively highlighting the information most relevant and important to the user query, and further improving the accuracy and relevance of information retrieval. Then, a power knowledge graph is constructed based on the graph neural network to realize the structured representation of power entities, attributes, and relationships. Also, through the hybrid reasoning engine, the retrieved information is subjected to in-depth logical reasoning and rule matching, thus not only enhancing the logic and accuracy of answer generation, but also enabling the system to handle more complex and abstract power problems. The intelligent question-answering method for power problems proposed by the present invention realizes the efficient, accurate, and intelligent answering of power problems through the organic combination of the DRL algorithm, the attention mechanism, the graph neural network, and the hybrid reasoning engine.

[0051] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be understood through the embodiments of the present invention. Brief Description of the Drawings

[0052] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the following description of embodiments in conjunction with the accompanying drawings, in which:

[0053] Figure 1 It is a flowchart of the intelligent question-answering method for power problems according to an embodiment of the present invention. Detailed implementation manners

[0054] To facilitate the understanding of the present invention, the present invention will be described more comprehensively below with reference to the relevant drawings. Several embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, these embodiments are provided to make the disclosure of the present invention more thorough and comprehensive.

[0055] It should be noted that when an element is referred to as being "fixedly provided on" another element, it can be directly on the other element or there may also be an intermediate element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there may be an intermediate element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs. The terms used in the description of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0057] Please refer to Figure 1 , the present invention proposes an intelligent question-answering method for power problems, and the method includes steps S101 to S105:

[0058] S101, receiving a user query, where the user query is a query question related to power input by the user.

[0059] It can be understood that after the user inputs a query question related to power through various channels such as a client, a web page, a WeChat public account, etc., after the system receives the user query, it preprocesses the user input, including cleaning and formatting processing, to remove irrelevant information and ensure the validity of the input.

[0060] For some queries that require user identity verification (such as electricity bill query, repair application, etc.), user identity recognition is also required, such as login verification: requiring the user to log in to the account and verify through the user name and password or other identity verification methods.

[0061] After receiving the user's query, feedback should also be given to the user in a timely manner, indicating that the query has been received and is being processed. For example, for queries submitted through online channels, a prompt message such as "Query submitted" or "Processing" can be displayed immediately.

[0062] S102, Parse the user's query through the DRL algorithm, and formulate the best path for retrieving relevant information from the power knowledge base according to the parsing result, and generate a query strategy.

[0063] It is understandable that the DRL algorithm is used to deeply analyze the user's query, understand the query intention, and judge the query type (such as electricity bill query, fault repair, business consultation, etc.). And according to the user's intention and query type, formulate the best path for retrieving relevant information from the power knowledge base, and dynamically generate a query strategy.

[0064] In the power intelligent question-answering system of this embodiment, the DRL algorithm can be used to parse complex queries input by users. Since DRL combines the perception ability of deep learning and the decision-making ability of reinforcement learning, it can handle high-dimensional and complex environmental states, and is very suitable for parsing and understanding the ambiguity and diversity in natural language. The specific query parsing process can be as follows:

[0065] First, preprocess the user's query, including word segmentation, part-of-speech tagging, named entity recognition, etc., so that the DRL model can better understand the query content. Convert the preprocessed query text into a state representation that the DRL model can understand. The DRL model selects the next action according to the current state, and these actions can be further parsing of the query (such as identifying the query intention, extracting keywords, etc.).

[0066] After parsing the user's query, the DRL model needs to plan the best path for retrieving relevant information from the power knowledge base according to the parsing result, which involves understanding the structure of the power knowledge base and matching the query intention. First, the DRL model needs to learn the structure of the power knowledge base, including the organization method of data, indexing mechanism, etc. Then match the intention of the user's query with the content in the power knowledge base to determine the data type and scope to be retrieved.

[0067] Design a reasonable reward function to evaluate the quality of the generated retrieval path. For example, if the retrieved information can accurately answer the user's query, a higher reward is given; if the retrieval efficiency is high, a certain reward can also be given.

[0068] The generated query strategy is represented in a certain form (such as an SQL query statement, API call parameters, etc.) and is used to guide the retrieval of information from the power knowledge base. By continuously receiving user queries and observing the retrieval results, the DRL model can iteratively improve its query strategy. After each retrieval, the model parameters are adjusted according to the reward function to optimize the query path and strategy representation. Through a large amount of training data, the DRL model can learn the general patterns of user queries and possess a certain generalization ability to handle unseen queries.

[0069] S103, retrieve relevant information from the power knowledge base according to the query strategy, and during the information retrieval process, introduce an attention mechanism to dynamically assign weights to the retrieved information.

[0070] Understandably, various types of power knowledge, policy documents, common question answers, and business rules of power companies are integrated to build a comprehensive and accurate power knowledge base. And according to the query strategy generated by the DRL algorithm, relevant information is quickly retrieved from the power knowledge base.

[0071] According to the query strategy generated by the DRL algorithm, the system will perform corresponding retrieval operations in the power knowledge base. These operations can include database queries, API calls, etc., depending on the storage method and access interface of the power knowledge base.

[0072] Introducing an attention mechanism during the information retrieval process can more intelligently screen and assign weights to the retrieved information. The attention mechanism can simulate the way humans allocate attention when processing information and give higher weights to information that is more relevant or important to the user's query.

[0073] The attention mechanism in this embodiment will dynamically assign weights to each piece of information according to the query strategy, the retrieved content, and the specific needs of the user's query. This weight assignment is flexible and can be adjusted as the query progresses and the user's needs change.

[0074] S104, construct a power knowledge graph based on a graph neural network, and combine the power knowledge graph to perform logical reasoning and rule matching on the retrieved information through a hybrid inference engine to generate a target answer, where the power knowledge graph contains power entities, attributes, and relationships.

[0075] Understandably, in a power intelligent question - answering system, based on graph neural network technology, the system can efficiently integrate and represent the complex relationship network in the power domain. The power knowledge graph not only contains rich power entities (such as electricity meters, electricity users, etc.), but also covers the attributes (such as the readings, balances, historical payment records, etc. of electricity meters) between these entities and the relationships between them (such as the binding relationship between the electricity meter and the electricity user, the correlation relationship between the change in electricity meter readings and electricity bill calculation, etc.).

[0076] When the system receives a power-related query input by the user, it parses the query intent through the DRL algorithm and retrieves relevant information from the power knowledge base. This information is often raw and fragmented, insufficient to directly answer complex queries. At this time, the power knowledge graph plays an important role, providing a structured framework that enables the system to perform in-depth logical reasoning based on entities, attributes, and relationships.

[0077] The hybrid reasoning engine combines multiple reasoning techniques (such as rule-based reasoning, case-based reasoning, etc.), utilizes the information in the power knowledge graph, and comprehensively analyzes and processes the retrieved data. During this process, the system will perform operations such as screening, sorting, and associating the information according to the rules and logic defined in the knowledge graph, and finally generate a comprehensive, accurate, and easy-to-understand target answer.

[0078] In this way, the power intelligent question-answering system can handle more complex and diverse power queries, such as electricity bill prediction, power grid fault diagnosis, policy interpretation, etc., providing users with a more intelligent and personalized service experience. At the same time, with the continuous update and improvement of the power knowledge graph, the accuracy and response speed of the system will also continue to improve.

[0079] S105, output the target answer to the user.

[0080] In the power intelligent question-answering system, the user query is parsed through the DRL algorithm to formulate the best retrieval path, combined with the power knowledge graph constructed by the graph neural network, and the hybrid reasoning engine is used to perform logical reasoning and rule matching on the information, and the final reply is generated and returned to the user.

[0081] The intelligent question-answering system can be integrated into the existing grid management system, enabling the system to combine the data of grid management when processing user queries and provide more accurate services.

[0082] For queries that need to be transferred for processing, the intelligent question-answering system can automatically trigger the appeal transfer mechanism to ensure that problems are processed in a timely and effective manner.

[0083] The present invention can deeply analyze complex queries input by users, accurately identify query intents and key information, and combine the power knowledge base, power knowledge graph, and hybrid reasoning engine to comprehensively process various types of queries and generate accurate and comprehensive answers. Moreover, the power knowledge base and knowledge graph can be updated in real time to adapt to new knowledge, new technologies, and new policies in the power field.

[0084] For example, the user inputs: "The circuit in my house tripped suddenly. Can you help me analyze the possible causes and provide solutions?" The system identifies the fault phenomenon "circuit tripping" in the query and guides the user to conduct a step-by-step investigation based on the fault troubleshooting process and diagnostic rules in the power knowledge graph. The system can also provide possible fault causes and corresponding solutions according to the investigation results.

[0085] The user inputs: "I want to view my electricity bill for last month and predict approximately how much the electricity bill will be next month." The system first retrieves and displays the user's electricity bill information for last month. Then, combining the user's historical electricity consumption data and the current electricity price policy, it uses machine learning algorithms to predict the electricity bill and gives an approximate range or estimate of the electricity bill for next month.

[0086] The user inputs: "I heard that there is a new electricity policy recently. Can you give me a detailed explanation of the content and impact of this policy?" The system will identify the policy keyword in the query, retrieve relevant information and interpretations related to this policy in the power knowledge graph, and also provide personalized policy explanations and impact analyses according to the user's needs and background.

[0087] Based on steps S101 to S105, the DRL algorithm is used to deeply analyze the electricity-related queries input by the user. This not only improves the accuracy of query understanding but also intelligently formulates the best path for retrieving relevant information from the huge power knowledge base according to the analysis results, thus ensuring the efficiency and pertinence of the query strategy. Secondly, during the information retrieval process, an attention mechanism is introduced. This mechanism can dynamically assign weights to the retrieved information, effectively highlighting the information most relevant and important to the user's query, and further improving the precision and relevance of information retrieval. Furthermore, a power knowledge graph is constructed based on the graph neural network to realize the structured representation of power entities, attributes, and relationships. Also, a hybrid inference engine is used to conduct in-depth logical reasoning and rule matching on the retrieved information, not only enhancing the logic and accuracy of answer generation but also enabling the system to handle more complex and abstract power problems. The intelligent question-answering method for power problems proposed by the present invention realizes the efficient, accurate, and intelligent answering of power problems through the organic combination of the DRL algorithm, attention mechanism, graph neural network, and hybrid inference engine.

[0088] The following is a further introduction to the intelligent question-answering method for power problems in the embodiments of the present invention:

[0089] Further optionally, in step S102, the step of parsing the user query through the DRL algorithm, formulating the best path for retrieving relevant information from the power knowledge base according to the parsing result, and generating a query strategy includes:

[0090] Define the state space, including user queries, user historical query records, and the current power knowledge base status, etc.;

[0091] Define the action space, including querying specific entries in the power knowledge base, requesting the user to supplement information to clarify the question, or generating answers based on existing information, etc.;

[0092] Design a reward function to evaluate the generated answers according to the target metrics, where the target metrics include metrics such as the accuracy of the answers and user satisfaction;

[0093] By interacting with the environment, continuously optimize the query strategy to maximize the long-term reward, where the environment includes the power knowledge base and the user feedback mechanism.

[0094] Further optionally, in step S103, the step of introducing an attention mechanism during the information retrieval process to perform dynamic weight allocation on the retrieved information includes:

[0095] Convert the user query and the retrieved information into vector representations through an encoder;

[0096] During the decoding process, combine the multi-head attention mechanism to calculate the attention weights for the encoder output for each decoding step.

[0097] Understandably, introducing an attention mechanism during the information retrieval process first converts the user query and the retrieved information into vector forms through an encoder for easy computer processing. During the decoding stage, the multi-head attention mechanism is used to dynamically allocate the weights for the encoder output information for each decoding step. This approach can more accurately capture the correlation between the user query and the retrieved information, thereby effectively improving the accuracy and efficiency of information retrieval and making the returned results more in line with the actual needs of users.

[0098] Further optionally, the step of converting the user query and the retrieved information into vector representations through an encoder includes:

[0099] Convert the user query into a query vector sequence q through an encoder,

[0100] q = [q1, q2,..., q i ,..., q n , where q i is the vector representation of the i-th word in the query;

[0101] Convert the retrieved information into a document vector sequence d through an encoder,

[0102] d = [d1, d2,..., d j ,..., d m , where d jIt is the vector representation of the j-th word in the document.

[0103] It can be understood that the user query is converted into a sequence of query vectors, which is composed of the vector representations of each word in the query. Such a representation method can capture the semantic information and word order relationship in the query. Secondly, the retrieved information (i.e., the document content) is also converted into a sequence of document vectors, which contains the vector representations of each word in the document, thus realizing the numerical representation of the document content. Such a vector representation method not only unifies the form of the user query and the retrieved information, facilitating calculation and processing, but also can capture the semantic similarity and context relationship between words through the encoder's vectorization of vocabulary, thereby improving the accuracy and relevance of information retrieval.

[0104] Further optionally, in the decoding process, the step of calculating the attention weights for the encoder output for each decoding step by combining the multi-head attention mechanism includes:

[0105] Calculate the correlation between the current state of the decoder and the encoder output to obtain the attention weights;

[0106] Perform weighted summation on the encoder output based on the attention weights to obtain the context vector for each head;

[0107] Merge the context vectors of all heads to update the state of the decoder and generate an output vector.

[0108] It can be understood that through the multi-head attention mechanism, the model can simultaneously focus on multiple different aspects of the input sequence, thereby capturing richer features and dependency relationships. In the embodiment of the present invention, by combining the multi-head attention mechanism, dynamic weight allocation for the encoder output is realized, enabling the decoder to more accurately generate the output sequence according to the input information, thus improving the performance and accuracy of the sequence-to-sequence model.

[0109] Specifically, for each decoding step and each attention head, calculate the correlation score between the query state of the current decoding step and the document vector sequence d to obtain the attention weights. The calculation formula is:

[0110] where, e tj represents the correlation score between the query vector q t and the document vector d j ; q t is the query vector, that is, the query state of the current decoding step t, and d j is the j-th document vector in the document vector sequence d;

[0111] Apply the softmax function to the correlation score to obtain the attention weight vector, αt [αt1 , α t2 , ..., α tj , ..., α tm , where the calculation formula for the attention weight is: e tj represents the relevance score between the query vector q t and the document vector d j , and e tk represents the relevance score between the query vector q t and the document vector d k ;

[0112] According to the attention weight vector α t perform weighted summation on the document vector sequence d to obtain the context vector of each attention head, and the formula is: where, is the context vector of the l-th attention head;

[0113] Merge the context vectors of all attention heads to update the state of the decoder and generate an output vector, and the output vector contains the key information related to the user query extracted from the retrieved information.

[0114] Further optionally, in step S104, the step of constructing the power knowledge graph based on the graph neural network includes:

[0115] Input the output vector into the graph neural network;

[0116] Use the graph neural network to perform information propagation on the graph structure and update the representation of each node by aggregating the information of neighboring nodes. The aggregation formula is:

[0117]

[0118] where, represents the hidden state of node v in the k-th layer, N(v) represents the set of neighboring nodes of node v, and A (k) is the aggregation function of the k-th layer, and c is the output vector;

[0119] Use the graph neural network and model the relationship according to the connection (edge) between nodes to represent the connection between different power entities in the power knowledge graph.

[0120] Further optionally, in step S104, the step of combining the power knowledge graph and performing logical reasoning and rule matching on the retrieved information through the hybrid inference engine to generate the target answer includes:

[0121] Define a series of symbolic logic rules, which are set as preset logical rules. Each of the preset logical rules includes a precondition, a conclusion, an applicable scenario, and possible exceptions;

[0122] Assign a unique priority identifier to each of the preset logical rules for priority judgment when resolving rule conflicts;

[0123] Construct a preset symbolic logic rule set and store it in a data structure accessible by the hybrid inference engine;

[0124] Extract node representations related to the user query from the power knowledge graph;

[0125] Match the extracted node representations with each rule in the preset symbolic logic rule set in sequence to determine whether it satisfies the precondition of the rule;

[0126] If a node representation satisfies the precondition of one of the preset logical rules;

[0127] Then perform logical reasoning according to the selected preset symbolic logic rule to obtain a preliminary result.

[0128] Optionally, after the step of matching the extracted node representations with each rule in the preset symbolic logic rule set in sequence to determine whether it satisfies the precondition of the rule, the following steps are further included:

[0129] If a node representation satisfies the preconditions of more than one of the preset logical rules at the same time;

[0130] Then trigger the conflict detection mechanism and select the rule with the highest priority for application according to the priority identifier of the preset logical rule;

[0131] Perform logical reasoning according to the selected preset symbolic logic rule to obtain a preliminary result.

[0132] It is understandable that, first, a series of predefined symbolic logic rules are defined. These rules not only cover a wide range of applicable scenarios but also take into account possible exceptions. At the same time, by assigning a unique priority identifier to each rule, the problem of rule conflicts is effectively solved, ensuring the consistency and rationality of the reasoning results. Second, by accurately extracting node representations related to the user's query from the power knowledge graph, an efficient connection from the vast knowledge base to the specific query requirements is achieved. This not only reduces the unnecessary data processing burden but also ensures the pertinence and effectiveness of the reasoning process. Next, a hybrid reasoning engine is applied. By matching the extracted node representations with the predefined symbolic logic rule set and performing logical reasoning, preliminary results can be generated quickly and accurately. In particular, for possible rule conflict situations, the application of the conflict detection mechanism and priority rules ensures the smooth progress of the reasoning process, avoiding incorrect results caused by rule conflicts and making the final output target answer accurate and comprehensive.

[0133] Further optionally, after the step of performing logical reasoning according to the selected predefined symbolic logic rule to obtain a preliminary result, the following steps are further included:

[0134] Review the matched predefined symbolic logic rule to ensure that the matched predefined symbolic logic rule is applicable to the current problem and is logically consistent;

[0135] Convert the user query, the preliminary result, and the matched and reviewed predefined symbolic logic rule into a formal representation, such as a predicate logic formula;

[0136] Initialize the logical reasoning engine and input the formalized user query, preliminary result, and the matched predefined symbolic rule;

[0137] Execute symbolic logic reasoning through the logical reasoning engine to gradually derive a more accurate conclusion and obtain the reasoning result, that is, the target answer.

[0138] It is understandable that in the case where there may be logical inconsistencies in the neural network output or more accurate reasoning is required, the logical reasoning engine can be used to perform in-depth symbolic logic reasoning on the formalized input to verify whether the output of the neural network is logically consistent and correct the answer as needed to ensure the accuracy and consistency of the final answer.

[0139] An example of the present invention: Suppose a resident suddenly encounters a power outage at home at night. He submits a query through the intelligent Q&A system of the power company: "Why has my home suddenly lost power?"

[0140] The defined preset symbolic logic rules can be: Rule 1: If the power supply is not detected in the regional power grid (prerequisite), then it may be a power outage in the whole region (conclusion), and the applicable scenario is the power outage query in the residential area (applicable scenario); Rule 2: If the household electricity meter trips (prerequisite), then it may be an overload or short circuit in the household circuit (conclusion), and the applicable scenario is the single household power outage query (applicable scenario). Each rule is assigned a unique priority identifier. For example, it can be assumed that the priority of Rule 1 is higher than that of Rule 2 because a power outage in the whole region usually has a wider impact range than a single household problem. Then, a preset symbolic logic rule set is constructed and these rules are stored in a data structure accessible by the hybrid inference engine of the power company.

[0141] Extract node representations related to the user's query from the power knowledge graph, such as the power grid status of the area where the resident is located, the electricity meter status of the resident's home, etc., and match the extracted node representations (such as the power grid status of the area and the electricity meter status) with the rules in the preset symbolic logic rule set. Assume that the system detects that the power grid status of the area where the resident is located is normal, but the electricity meter status of the user's home shows a trip. Then, conflict detection and rule selection are performed. However, in this example, there is no rule conflict because only the prerequisite of one rule (Rule 2) is satisfied. Therefore, logical reasoning can be carried out according to Rule 2 to obtain a preliminary result: the electricity meter trips may be caused by an overload or short circuit in the household circuit. Then, a brief review of the matched Rule 2 is carried out to confirm its applicability. And the user's query, preliminary result, and matched rule are converted into a formal representation. According to the logical reasoning result, the system gives a suggestive answer: "Hello, according to our system detection, the reason for the power outage in your home may be that the electricity meter trips due to an overload or short circuit in the circuit. Please check the household circuit to confirm whether there is improper or excessive use of electrical appliances. If the problem remains unresolved, please contact our professional maintenance personnel."

[0142] The above-described embodiments only express several implementation manners of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several deformations and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention should be subject to the appended claims.

Claims

1. An intelligent question-answering method for power problems, characterized in that: The method comprises: receiving a user query, wherein the user query is a query question related to electricity input by a user; The user query is parsed by the DRL algorithm, and an optimal path for retrieving relevant information from the power knowledge base is formulated according to the parsing result to generate a query strategy; Retrieve relevant information from the power knowledge base according to the query strategy, and introduce an attention mechanism in the information retrieval process to dynamically assign weights to the retrieved information; Building a power knowledge graph based on a graph neural network, combining the power knowledge graph, and performing logical reasoning and rule matching on the retrieved information through a hybrid reasoning engine to generate a target answer, wherein the power knowledge graph contains power entities, attributes, and relationships; Output the target answer to the user; The step of parsing the user query by the DRL algorithm and formulating the best path for retrieving relevant information from the power knowledge base according to the parsing result, and generating the query strategy includes: Use the DRL algorithm to deeply analyze user queries to understand the query intent and determine the query type, which includes electricity bill inquiry, fault repair, and business consultation; According to user intent and query type, the optimal path for retrieving relevant information from the power knowledge base is formulated, and query strategies are dynamically generated. Specifically: Convert the preprocessed query text into a state representation; The DRL model selects the next action based on the current state. The action is to parse the user query, including identifying the query intent and extracting keywords. The DRL model plans the best path to retrieve relevant information from the power knowledge base based on the parsing results. During the retrieval process, the quality of the generated retrieval path is evaluated through a reward function. The evaluation criteria include the accuracy of the response and the retrieval efficiency. Generate a formalized query strategy to guide information retrieval from the power knowledge base; By continuously receiving user queries and observing retrieval results, the DRL model iteratively improves its query strategy; After each retrieval, the model parameters are adjusted according to the reward function to optimize the query path and policy representation.

2. The intelligent question-answering method for power problems according to claim 1 is characterized in that: The step of parsing the user query by the DRL algorithm and formulating the best path for retrieving relevant information from the power knowledge base according to the parsing result, and generating the query strategy also includes: Define the state space, including user queries, user historical query records and current power knowledge base status; Define the action space, including querying specific items in the electricity knowledge base, requesting additional information from the user to clarify the question, or generating answers based on existing information; Design a reward function to evaluate the generated answers based on target metrics, including answer accuracy and user satisfaction; The query strategy is continuously optimized to maximize the long-term reward by interacting with the environment, which includes a power knowledge base and a user feedback mechanism.

3. The intelligent question-answering method for power problems according to claim 1 is characterized in that: In the information retrieval process, the step of introducing the attention mechanism and dynamically allocating weights to the retrieved information includes: The user query and retrieved information are converted into vector representations through an encoder; During the decoding process, a multi-head attention mechanism is combined to calculate the attention weights for the encoder output for each decoding step.

4. The intelligent question-answering method for power problems according to claim 3 is characterized in that: The step of converting the user query and the retrieved information into a vector representation by the encoder comprises: The user query is converted into a query vector sequence q through the encoder. q=[q1,q2,…,q i , …, q n ], where q i is the vector representation of the i-th word in the query; The retrieved information is converted into a document vector sequence d through the encoder. d = [d1, d2, …, d j , …, d m ], where d j is the vector representation of the jth word in the document.

5. The intelligent question-answering method for power problems according to claim 3 is characterized in that: In the decoding process, the step of calculating the attention weight of the encoder output for each decoding step in combination with the multi-head attention mechanism includes: Calculate the correlation between the current state of the decoder and the output of the encoder to obtain the attention weight; Perform weighted summation of encoder outputs based on attention weights to obtain the context vector for each head; The context vectors from all heads are merged to update the decoder state and produce an output vector.

6. The intelligent question-answering method for power problems according to claim 5 is characterized in that: The steps of constructing a power knowledge graph based on a graph neural network include: Inputting the output vector into a graph neural network; The graph neural network is used to propagate information on the graph structure, and the representation of each node is updated by aggregating the information of neighboring nodes. The aggregation formula is: , in, represents the hidden state of node v in the kth layer, represents the set of neighbor nodes of node v, is the aggregation function of the kth layer, and c is the output vector; Graph neural networks are used to model relationships based on connections between nodes to represent the connections between different power entities in the power knowledge graph.

7. The intelligent question-answering method for power problems according to claim 1, characterized in that: The steps of combining the power knowledge graph and performing logical reasoning and rule matching on the retrieved information through a hybrid reasoning engine to generate a target answer include: Define a series of symbolic logic rules as preset logical rules, each of which includes a premise, a conclusion, an applicable scenario and an exception; Assigning a unique priority identifier to each of the preset logical rules; Construct a preset set of symbolic logic rules and store them in a data structure; Extracting node representations related to the user query from the power knowledge graph; Matching the extracted node representation with each rule in the preset symbolic logic rule set in turn to determine whether it satisfies the prerequisite of the rule; If a node indicates that one of the preconditions of the preset logical rule is satisfied; Logical reasoning is then performed according to the selected preset symbolic logic rules to obtain preliminary results.

8. The intelligent question-answering method for power problems according to claim 7 is characterized in that: The step of sequentially matching the extracted node representation with each rule in the preset symbolic logic rule set to determine whether it satisfies the prerequisite of the rule further includes: If a node indicates that more than one of the preconditions of the preset logical rule is satisfied at the same time; The conflict detection mechanism is triggered, and the rule with the highest priority is selected for application according to the priority identifier of the preset logical rule; Logical reasoning is performed according to the selected preset symbolic logic rules to obtain preliminary results.

9. The intelligent question-answering method for power problems according to claim 7 or 8, characterized in that: The step of performing logical reasoning according to the selected preset symbolic logic rules to obtain a preliminary result further includes: Review the matching preset symbolic logic rules to ensure that the matching preset symbolic logic rules are applicable to the current problem and have no logical contradictions; converting the user query, preliminary results, and matched and reviewed preset symbolic logic rules into a formal representation; Initialize the logic reasoning engine and input the formalized user query, preliminary results and matching preset symbolic rules; Symbolic logic reasoning is performed through the logic reasoning engine to gradually derive more precise conclusions and obtain the reasoning result, that is, the target answer.

Citation Information

Patent Citations

  • Intelligent question and answer method and apparatus, server and storage medium

    CN107885842A

  • Automatic question answering system based on deep reinforcement learning

    CN116910213A

  • Power data analysis method and analysis system, power system, terminal equipment and storage medium

    CN118396162A