Intelligent questioning and answering method for power questions

Through the intelligent question-and-answer method, DRL algorithm, attention mechanism and graph neural network, combined with a hybrid inference engine, the problem of insufficient response speed and efficiency of traditional power service models is solved, and efficient, accurate and intelligent answers to power problems are achieved.

CN119202175AActive Publication Date: 2024-12-27NORTH CHINA GRID MEASUREMENT CENT
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When traditional power service models deal with complex and changing customer needs, the response speed and processing efficiency are insufficient, resulting in a decrease in customer satisfaction and affecting the service quality of power supply companies.

Method used

Using intelligent question-and-answer method, analyzing user queries through DRL algorithms, formulating the best path to retrieve relevant information from the power knowledge base, combining attention mechanisms and graph neural networks to build a power knowledge graph, and using a hybrid inference engine for logical reasoning and rule matching. Generate target answers.

Benefits of technology

It improves the accuracy of query comprehension and the efficiency of information retrieval, enhances the logic and accuracy of answers, can handle more complex and abstract power problems, and provides efficient, accurate and intelligent solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202175A_ABST
    Figure CN119202175A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent question and answer method for power questions. The method comprises the following steps: receiving user query; user query is analyzed through a DRL algorithm, an optimal path for retrieving related information from the power knowledge base is formulated according to an analysis result, and a query strategy is generated; retrieving related information from the power knowledge base according to the query strategy, and introducing an attention mechanism in the information retrieval process to perform dynamic weight distribution on the retrieved information; an electric power knowledge graph is constructed based on the graph neural network, logical reasoning and rule matching are carried out on the retrieved information through a hybrid reasoning engine in combination with the electric power knowledge graph, and a target answer is generated; and outputting the target answer to the user. According to the intelligent question answering method for the electric power question, through organic combination of the DRL algorithm, the attention mechanism, the graph neural network and the hybrid inference engine, efficient, accurate and intelligent answering of the electric power question is achieved.
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 issues, and in particular to an intelligent question-answering method for power issues. Background Art

[0002] As electricity demand continues to grow, customers' expectations for electricity services are also increasing. Users often want to get answers to electricity-related questions quickly and accurately, but traditional service models often cannot meet this demand. The existing electricity service model is often insufficient in response speed and processing efficiency when dealing with complex and changing customer needs, which leads to a decline in customer satisfaction and affects the service quality of power supply companies. Summary of the invention

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

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

[0005] receiving a user query, wherein the user query is a query question related to electricity input by a user;

[0006] 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;

[0007] 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;

[0008] 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;

[0009] Output the target answer to the user.

[0010] Furthermore, 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:

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

[0012] 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;

[0013] Design a reward function to evaluate the generated answers based on target metrics, including answer accuracy and user satisfaction;

[0014] 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.

[0015] Furthermore, in the information retrieval process, the step of introducing the attention mechanism and dynamically allocating weights to the retrieved information includes:

[0016] The user query and retrieved information are converted into vector representations through an encoder;

[0017] During the decoding process, a multi-head attention mechanism is combined 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 a vector representation by the encoder includes:

[0019] The user query is converted into a query vector sequence q through the 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] The retrieved information is converted into a document vector sequence d through the encoder.

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

[0023] Furthermore, 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:

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

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

[0026] The context vectors from all heads are merged to update the decoder state and produce an output vector.

[0027] Furthermore, the steps of constructing the electric power knowledge graph based on the graph neural network include:

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

[0029] 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:

[0030]

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

[0032] 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.

[0033] Furthermore, 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:

[0034] 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;

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

[0036] Construct a preset set of symbolic logic rules and store them in a data structure;

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

[0038] 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;

[0039] If a node indicates that one of the preconditions of the preset logical rule is satisfied;

[0040] Logical reasoning is then performed according to the selected preset symbolic logic rules to obtain preliminary results.

[0041] Furthermore, 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:

[0042] If a node indicates that more than one of the preconditions of the preset logical rule is satisfied at the same time;

[0043] 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;

[0044] Logical reasoning is performed according to the selected preset symbolic logic rules to obtain preliminary results.

[0045] Furthermore, the step of performing logical reasoning according to the selected preset symbolic logic rules to obtain a preliminary result further includes:

[0046] 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;

[0047] converting the user query, preliminary results, and matched and reviewed preset symbolic logic rules into a formal representation;

[0048] Initialize the logic reasoning engine and input the formalized user query, preliminary results and matching preset symbolic rules;

[0049] 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.

[0050] In summary, according to the above-mentioned intelligent question-answering method for power problems, the power-related queries input by the user are deeply analyzed through the DRL algorithm, which 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, thereby 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, thereby effectively highlighting the most relevant and important information to the user's query, and further improving the accuracy and relevance of information retrieval. Then, the power knowledge graph is constructed based on the graph neural network to realize the structured representation of power entities, attributes and relationships, and the retrieved information is deeply logically reasoned and matched by the hybrid reasoning engine, thereby 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 in the present invention realizes efficient, accurate and intelligent answers to 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 and in part will be obvious from the following description or will be learned through 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 easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0053] Figure 1 The figure is a flow chart of an intelligent question-answering method for power issues according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given 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, the purpose of providing these embodiments is 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 "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central 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 those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention 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 related listed items.

[0057] See also Figure 1 The present invention proposes an intelligent question-answering method for power problems, which includes steps S101 to S105:

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

[0059] It is understandable that after users input electricity-related query questions through various channels such as clients, web pages, WeChat public accounts, etc., the system will pre-process the user input after receiving the user query, including cleaning and formatting, to remove irrelevant information and ensure the validity of the input.

[0060] For some inquiries that require user identity verification (such as electricity bill inquiries, repair applications, etc.), user identity recognition is also required, such as login verification: requiring users to log in to their accounts and verify through usernames and passwords or other identity verification methods.

[0061] After receiving a user query, timely feedback should be given to the user to indicate 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 "being processed" can be displayed immediately.

[0062] S102, parsing the user query by using a DRL algorithm, and formulating an optimal path for retrieving relevant information from a power knowledge base according to the parsing result, thereby generating a query strategy.

[0063] Understandably, the DRL algorithm is used to deeply analyze user queries, understand the query intent, and determine the query type (such as electricity bill inquiry, fault repair, business consultation, etc.). And according to the user intent and query type, the best path to retrieve relevant information from the power knowledge base is formulated, and the query strategy is dynamically generated.

[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:

[0065] First, the user query is preprocessed, including word segmentation, part-of-speech tagging, named entity recognition, etc., so that the DRL model can better understand the query content. The preprocessed query text is converted into a state representation that the DRL model can understand. The DRL model selects the next action based on the current state, which can be further analysis of the query (such as identifying query intent, extracting keywords, etc.).

[0066] After parsing the user query, the DRL model needs to plan the best path to retrieve relevant information from the power knowledge base based on the parsing results, which involves understanding the structure of the power knowledge base and matching the query intent. First, the DRL model needs to learn the structure of the power knowledge base, including the organization of data, indexing mechanism, etc. Then match the user query intent with the content in the power knowledge base to determine the type and scope of the data to be retrieved.

[0067] The quality of the generated retrieval path is evaluated by designing a reasonable reward function. 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 expressed in some form (such as SQL query statements, API call parameters, etc.) 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 pattern of user queries and have a certain generalization ability to deal with unseen queries.

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

[0070] Understandably, integrate various types of power knowledge, policy documents, FAQs and business rules of power companies to build a comprehensive and accurate power knowledge base. And quickly retrieve relevant information from the power knowledge base based on the query strategy generated by the DRL algorithm.

[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 may include database queries, API calls, etc., depending on the storage method and access interface of the power knowledge base.

[0072] Introducing the attention mechanism in the information retrieval process can more intelligently filter and weight the retrieved information. The attention mechanism can simulate the way humans allocate attention when processing information, giving higher weight to information that is more relevant or important to the user's query.

[0073] The attention mechanism of this embodiment dynamically assigns weights to each piece of information based on 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 deepens and the user's needs change.

[0074] S104, constructing an electric power knowledge graph based on a graph neural network, combining the electric 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 electric power knowledge graph includes electric power entities, attributes and relationships.

[0075] Understandably, in the 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 field. The power knowledge graph not only contains a wealth of power entities (such as electricity meters, electricity users, etc.), but also covers the attributes between these entities (such as meter readings, balances, historical payment records, etc.) and the relationships between them (such as the binding relationship between meters and electricity users, the correlation between meter reading changes and electricity fee calculations, etc.).

[0076] When the system receives a power-related query input by a 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, and is not enough 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.) and uses the information in the power knowledge graph to comprehensively analyze and process the retrieved data. In this process, the system will filter, sort, and associate 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 forecasting, power grid fault diagnosis, policy interpretation, etc., providing users with a more intelligent and personalized service experience. At the same time, with the continuous updating and improvement of the power knowledge graph, the accuracy and response speed of the system will continue to improve.

[0079] S105: Output the target answer to the user.

[0080] In the electric power intelligent question-answering system, the DRL algorithm is used to parse user queries, develop the best retrieval path, and combine the electric power knowledge graph built by the graph neural network. The hybrid reasoning engine is used to perform logical reasoning and rule matching on the information to generate the final answer and return it to the user.

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

[0082] For inquiries that need to be transferred for processing, the intelligent question and answer system can automatically trigger the request transfer mechanism to ensure that the problems are handled in a timely and effective manner.

[0083] The present invention can deeply analyze complex queries input by users, accurately identify query intent 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. 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: "My home circuit suddenly tripped. 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 step-by-step troubleshooting based on the troubleshooting process and diagnostic rules in the power knowledge graph. The system can also provide possible fault causes and corresponding solutions based on the troubleshooting results.

[0085] The user inputs: "I want to check my electricity bill for last month and predict the approximate electricity bill for next month." The system first retrieves and displays the user's electricity bill information for last month. Then, based on the user's historical electricity usage data and current electricity price policy, the system uses a machine learning algorithm to predict the electricity bill and give a rough 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 explain to me in detail the content and impact of this policy?" The system will identify the policy keywords in the query and retrieve information and interpretations related to the policy in the electricity knowledge graph. It will also provide personalized policy explanations and impact analysis based on the user's needs and background.

[0087] Based on step S101 to step S105, the power-related query input by the user is deeply analyzed through the DRL algorithm, which not only improves the accuracy of query understanding, but also intelligently formulates the best path to retrieve relevant information from the huge power knowledge base according to the analysis results, thereby 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, thereby effectively highlighting the most relevant and important information to the user's query, and further improving the accuracy and relevance of information retrieval. Then, the power knowledge graph is constructed based on the graph neural network to realize the structured representation of power entities, attributes and relationships, and the retrieved information is deeply logically reasoned and matched by the hybrid reasoning engine, thereby 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 in the present invention realizes efficient, accurate and intelligent answers to power problems through the organic combination of the DRL algorithm, the attention mechanism, the graph neural network and the hybrid reasoning engine.

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

[0089] Further optionally, in step S102, 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. The step of generating a query strategy includes:

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

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

[0092] Design a reward function to evaluate the generated answers based on target metrics, including answer accuracy and user satisfaction.

[0093] 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.

[0094] Further optionally, in step S103, the step of introducing an attention mechanism in the information retrieval process and dynamically allocating weights to the retrieved information includes:

[0095] The user query and retrieved information are converted into vector representations through an encoder;

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

[0097] It is understandable that the attention mechanism is introduced in the information retrieval process. First, the user query and retrieval information are converted into vector form through the encoder for computer processing. In the decoding stage, the multi-head attention mechanism is used to dynamically assign weights to the encoder output information for each decoding step. This approach can more accurately capture the correlation between user queries and retrieval information, thereby effectively improving the accuracy and efficiency of information retrieval, 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 a vector representation by the encoder includes:

[0099] The user query is converted into a query vector sequence q through the 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] The retrieved information is converted into a document vector sequence d through the encoder.

[0102] d=[d1,d2,…,d j , …, d m ], where d jis the vector representation of the jth word in the document.

[0103] Understandably, the user query is converted into a query vector sequence, which consists of the vector representation of each word in the query. This representation method can capture the semantic information and word order relationship in the query; secondly, the retrieved information (i.e., document content) is also converted into a document vector sequence, which contains the vector representation of each word in the document, thereby realizing the numerical representation of the document content. This vector representation method not only unifies the form of user queries and retrieved information, making it easier to calculate and process, but also vectorizes the vocabulary through the encoder, which can capture the semantic similarity and contextual relationship between vocabulary, thereby improving the accuracy and relevance of information retrieval.

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

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

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

[0107] The context vectors from all heads are merged to update the decoder state and produce an output vector.

[0108] Understandably, through the multi-head attention mechanism, the model can simultaneously focus on multiple different aspects of the input sequence, thereby capturing richer features and dependencies. The embodiment of the present invention realizes dynamic weight allocation of the encoder output by combining the multi-head attention mechanism, so that the decoder can more accurately generate the output sequence according to the input information, thereby improving the performance and accuracy of the sequence-to-sequence model.

[0109] Specifically, for each decoding step and each attention head, the correlation score between the query state of the current decoding step and the document vector sequence d is calculated to obtain the attention weight, which is calculated as follows:

[0110] Among them, e tj Represents the query vector q t With the document vector d j The correlation score between t is the query vector, i.e. the query state of the current decoding step t, d j is the jth document vector in the document vector sequence d;

[0111] Applying the softmax function to the relevance score yields the attention weight vector, αt[αt1 , α t2 , ..., α tj , ..., α tm ], where the calculation formula of attention weight is: e tj Represents the query vector q t With the document vector d j The correlation score between tk Represents the query vector q t With the document vector d k The correlation score between

[0112] According to the attention weight vector α t The document vector sequence d is weighted summed to obtain the context vector of each attention head. The formula is: in, is the context vector of the lth attention head;

[0113] The context vectors of all attention heads are merged to update the state of the decoder and produce an output vector that contains key information related to the user query extracted from the retrieved information.

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

[0115] Inputting the output vector into a graph neural network;

[0116] 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:

[0117]

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

[0119] Graph neural networks are used to model relationships based on connections (edges) between nodes to represent the connections 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 a hybrid reasoning engine to generate a target answer includes:

[0121] Define a series of symbolic logic rules as preset logical rules, each of which includes a premise, a conclusion, an applicable scenario, and possible exceptions;

[0122] Assigning a unique priority identifier to each of the preset logical rules for use in determining the priority when resolving rule conflicts;

[0123] Constructing a preset symbolic logic rule set and storing it in a data structure accessible to the hybrid reasoning engine;

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

[0125] 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;

[0126] If a node indicates that one of the preconditions of the preset logical rule is satisfied;

[0127] Logical reasoning is then performed according to the selected preset symbolic logic rules to obtain preliminary results.

[0128] Further optionally, 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:

[0129] If a node indicates that more than one of the preconditions of the preset logical rule is satisfied at the same time;

[0130] 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;

[0131] Logical reasoning is performed according to the selected preset symbolic logic rules to obtain preliminary results.

[0132] Understandably, first, a series of preset symbolic logic rules are defined, which 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. Secondly, by accurately extracting node representations related to user queries from the power knowledge graph, efficient docking from a huge knowledge base to specific query needs is achieved, which not only reduces unnecessary data processing burdens, but also ensures the pertinence and effectiveness of the reasoning process. Next, the hybrid reasoning engine is used. By matching and logically reasoning the extracted node representations with the preset symbolic logic rule set, preliminary results can be generated quickly and accurately. In particular, for possible rule conflicts, the application of conflict detection mechanisms and priority rules ensures the smooth progress of the reasoning process, avoids erroneous results caused by rule conflicts, and makes the final output target answer accurate and comprehensive.

[0133] Further optionally, after the step of performing logical reasoning according to the selected preset symbolic logic rule to obtain a preliminary result, the step further includes:

[0134] 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;

[0135] converting the user query, preliminary results, and matched and reviewed preset symbolic logic rules into a formal representation, such as a predicate logic formula;

[0136] Initialize the logic reasoning engine and input the formalized user query, preliminary results and matching preset symbolic rules;

[0137] 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.

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

[0139] An example of the present invention: Assume that a resident suddenly encounters a power outage at home at night. He submits a query through the intelligent question-answering system of the power company: "Why did my home suddenly lose power?"

[0140] The defined preset symbolic logic rules can be: Rule 1: If the power grid in the area does not detect power supply (precondition), it may be a power outage in the entire area (conclusion), and the applicable scenario is the query of power outage in residential areas (applicable scenario); Rule 2: If the meter at home trips (precondition), it may be an overload or short circuit in the home circuit (conclusion), and the applicable scenario is the query of power outage in a single household (applicable scenario). Each rule is assigned a unique priority identifier. For example, it can be assumed that Rule 1 has a higher priority than Rule 2 because the overall power outage usually affects a wider range than a single household problem. Then build a set of preset symbolic logic rules and store them in a data structure accessible to the hybrid reasoning engine of the power company.

[0141] Extract node representations related to the user query from the power knowledge graph, such as the grid status of the area where the resident is located, the status of the electric meter of the resident's home, etc., and match the extracted node representations (such as the grid status of the area and the electric meter status) with the rules in the preset symbolic logic rule set. Suppose the system detects that the grid status of the area where the resident is located is normal, but the electric meter status of the user's home shows tripping. Conflict detection and rule selection are performed, but in this example, there is no rule conflict because only the premise of one rule (Rule 2) is met. Therefore, logical reasoning can be performed based on Rule 2 to obtain a preliminary result: the circuit in the home may be overloaded or short-circuited, causing the meter to trip. Then briefly review the matched Rule 2 to confirm its applicability. And convert the user query, preliminary results and matching rules into formal representations. Based on the results of logical reasoning, 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 circuit is overloaded or short-circuited, causing the meter to trip. Please check the circuit at home to confirm whether there are any improper or excessive electrical appliances. If the problem is still not solved, please contact our professional maintenance personnel."

[0142] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached 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.

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 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, N(v) represents the set of neighbor nodes of node v, and A (k) 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

  • Knowledge graph-based search method and device, computer equipment and storage medium

    CN114637855A

  • Knowledge graph multi-hop question and answer method based on reinforcement learning path reasoning

    CN115640410A

  • Automatic question answering system based on deep reinforcement learning

    CN116910213A

  • Question and answer type retrieval method based on deep reinforcement learning

    CN118093825A