Question reply method and device, electronic equipment and computer program product
By constructing a multi-level management grid and a pre-set question-and-answer knowledge tree, combined with semantic matching technology, the problem of high computational resource consumption in answering installation and maintenance questions was solved, achieving fast and accurate answers and efficient resource utilization, thus improving the accuracy and speed of the answers.
Patent Information
- Application Number
- CN202511055421.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-14
AI Technical Summary
Existing technologies consume high computational resources, require large amounts of storage, have low retrieval efficiency, involve redundant knowledge storage, and fail to fully utilize geographic information when answering installation and maintenance questions, resulting in low response efficiency and wasted resources.
A multi-level management grid and a pre-set question-and-answer knowledge tree are constructed. Management paths are determined through management information, the most relevant leaf nodes are selected, semantic matching technology is used to select the best matching items, and a large language model is used to provide answers when necessary.
It enables rapid and accurate problem location and efficient response, reduces computing resource requirements, improves the accuracy and speed of responses, and optimizes the efficiency and accuracy of problem matching.
Smart Images

Figure CN120950643A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and more specifically, to a method, apparatus, electronic device, and computer program product for answering a question. Background Technology
[0002] In the installation, maintenance, and customer development processes of telecommunications operators, after-sales service support systems play a crucial role. To improve the efficiency of installation and maintenance technicians and reduce the manpower costs of remote support, operators have begun using artificial intelligence technology to build intelligent question-and-answer systems to assist technicians in resolving problems encountered by users during installation and maintenance. Among these, the RAG (Retrieval Augmented Generation) architecture, due to its combination of retrieval technology and deep learning models, has become a popular choice for achieving this goal.
[0003] Traditional intelligent question-answering systems based on the RAG architecture primarily rely on the generation capabilities of Large Language Models (LLMs) and the storage and retrieval of complete historical question-answering data. While this architecture can provide relatively accurate question-answering services, it faces the following major technical challenges:
[0004] 1. Large storage requirements: Due to the need to store all historical question and answer data, the system must handle a large amount of data storage, which not only consumes a lot of storage resources, but also leads to complex data management and increases system maintenance costs.
[0005] 2. Low retrieval efficiency: Performing linear searches on massive amounts of data to find answers semantically related to new questions leads to longer retrieval times, slower response speeds, and negatively impacts user experience.
[0006] 3. Frequent calls to large models: When a matching question cannot be found in historical data, the system frequently calls the LLM to generate answers. This not only increases the computational cost, but may also cause system response delays, especially during peak user consultation periods.
[0007] 4. Duplication of knowledge storage: Past storage mechanisms lacked effective identification and compression of duplicate problems, resulting in the same or similar problems being stored repeatedly by different users at different times, causing a waste of storage space.
[0008] 5. Insufficient utilization of geographic information: Installation and maintenance issues are often closely related to the user's geographical location, but traditional question-and-answer systems do not effectively utilize this information for question clustering and storage, making it difficult to achieve efficient question retrieval and answer matching.
[0009] The aforementioned technical issues are particularly prominent when dealing with large-scale user data and complex network equipment maintenance information, which is a challenge that operators urgently need to address.
[0010] In summary, existing technologies require frequent invocation of large language models when responding to installation and maintenance issues. Furthermore, the efficiency of large language models is affected by computing resources, resulting in high computational resource consumption and low response efficiency.
[0011] There is currently no effective solution to the problem of high computational resource consumption in the existing problem-solving methods mentioned above. Summary of the Invention
[0012] This invention provides a problem-solving method, apparatus, electronic device, and computer program product to at least solve the technical problem of high computational resource consumption in existing problem-solving methods.
[0013] According to one aspect of the present invention, a method for answering a question is provided, comprising: obtaining a question to be answered, wherein the question to be answered includes at least: management information and question data to be answered, the management information including at least: a multi-level management grid for managing the question to be answered; determining a management path matching the management information among multiple knowledge nodes of a preset question-answering knowledge tree, wherein the knowledge nodes include: branch nodes and preset leaf nodes, each branch node representing a corresponding management grid, each preset leaf node pre-configured with historical question data and corresponding historical answer data, the management path including: multiple branch nodes arranged in order of the level of the management grid, and adjacent branch nodes in the management path having a parent-child relationship; filtering a target leaf node matching the question data to be answered in at least one first leaf node, wherein the first leaf node is the preset leaf node connected to the branch node in the management path, the historical question data in the target leaf node matching the question data to be answered; and determining the historical answer data in the target leaf node as the question answer data for the question to be answered.
[0014] Optionally, determining the management path matching the management information among multiple knowledge nodes in a preset question-and-answer knowledge tree includes: sorting the multi-level management grids in the management information in descending order of level to obtain a management grid sequence, wherein the management grid sequence includes at least a first management grid and a second management grid, the first management grid being at a higher level than the second management grid; determining a first target node matching the first management grid among at least a first branch node in the preset question-and-answer knowledge tree, wherein the first branch node is connected to a pre-selected node in the preset question-and-answer knowledge tree, the pre-selected node including at least the root node of the preset question-and-answer knowledge tree; determining a second target node matching the second management grid among at least a second branch node in the preset question-and-answer knowledge tree, wherein the second branch node is a child node of the first target node; and generating the management path based on the first target node and the second target node.
[0015] Optionally, in at least one first leaf node, filtering the target leaf node that matches the question data to be answered includes: calculating the semantic relevance between the historical question data and the question data to be answered that are pre-configured in each first leaf node; and determining the first leaf node whose semantic relevance is greater than a preset relevance threshold as the target leaf node.
[0016] Optionally, the method further includes: if no target leaf node matching the question data to be answered exists in at least one of the first leaf nodes, determining the last branch node in the management path as the third branch node; determining the parent node of the third branch node as the fourth branch node among the multiple branch nodes in the management path; recursively querying at least one second leaf node of the fourth branch node in the preset question-answering knowledge tree, wherein the recursive query process includes: traversing all descendant nodes of the fourth branch node and using the preset leaf node among the descendant nodes as the second leaf node; filtering target leaf nodes matching the question data to be answered in at least one second leaf node, wherein the historical question data in the target leaf node matches the question data to be answered.
[0017] Optionally, the method further includes: if there is no target leaf node matching the question data to be answered in at least one of the second leaf nodes, detecting whether the fourth branch node belongs to the root node of the preset question-answering knowledge tree; if the fourth branch node does not belong to the root node, taking the fourth branch node as the third branch node, and recursively querying a new second leaf node based on the updated third branch node.
[0018] Optionally, the method further includes: if the fourth branch node belongs to the root node, analyzing the question data to be answered using a pre-set large language model to obtain the question answer data; creating a third leaf node in a preset question-answer knowledge tree according to the management path, wherein the third leaf node is a child node of the last branch node in the management path; and recording the question data to be answered as the historical question data and the question answer data as the historical answer data in the third leaf node.
[0019] Optionally, in at least one first leaf node, filtering the target leaf node that matches the question data to be answered includes: sorting at least one first leaf node according to a pre-selected priority order to obtain a leaf node sequence; sequentially determining whether each first leaf node in the leaf node sequence is a target leaf node that matches the question data to be answered, according to the priority from high to low; if the first leaf node is the target leaf node, incrementing the priority parameter of the first leaf node by 1, wherein the magnitude of the priority parameter is positively correlated with the priority level.
[0020] Optionally, before determining the management path matching the management information among multiple knowledge nodes in the preset question-and-answer knowledge tree, the method further includes: acquiring multiple sample question-and-answer data, wherein the sample question-and-answer data includes: sample questions and sample answers, the sample questions include at least: sample management information and sample question data, the sample management information includes at least: the multi-level management grid for managing the sample questions; in the preset question-and-answer knowledge tree, setting corresponding branch nodes according to the management grid in the sample management information, and setting a corresponding fourth leaf node for each sample question-and-answer data, wherein the parent-child relationship between the branch nodes is determined according to the multi-level management grid recorded in the same sample management information, and the parent-child relationship between the branch node and the fourth leaf node is determined according to the sample management information. The attribution relationship between the information and the sample question-and-answer data is determined. Each fourth leaf node is configured with the corresponding sample question data and sample answer data from the sample question-and-answer data. Among the multiple fourth leaf nodes in the preset question-and-answer knowledge tree, multiple leaf node sets are determined, wherein at least one fourth leaf node in each leaf node set is a child node of the same branch node. At least one fourth leaf node in the same leaf node set is merged according to the semantic relevance of the sample question data to obtain the preset leaf node. The historical question data in the preset leaf node is the merging result of sample question data with semantic relevance greater than a preset threshold, and the historical answer data is the merging result of the sample answer data corresponding to the sample question data.
[0021] According to another aspect of the present invention, a question-answering device is also provided, comprising: an acquisition module, configured to acquire a question to be answered, wherein the question to be answered includes at least: management information and question data to be answered, the management information including at least: a multi-level management grid for managing the question to be answered; and a first determination module, configured to determine a management path matching the management information among multiple knowledge nodes of a preset question-answering knowledge tree, wherein the knowledge nodes include: branch nodes and preset leaf nodes, each branch node representing a corresponding management grid, and each preset leaf node pre-configured with historical question data and corresponding historical answers. The data includes a management path comprising multiple branch nodes arranged in hierarchical order according to the management grid, wherein adjacent branch nodes in the management path have a parent-child relationship; a matching module for filtering target leaf nodes that match the question data to be answered in at least one first leaf node, wherein the first leaf node is a preset leaf node connected to the branch nodes in the management path, and the historical question data in the target leaf node matches the question data to be answered; and a second determining module for determining the historical response data in the target leaf node as the question response data for the question to be answered.
[0022] According to another aspect of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute a method for answering the above-mentioned problem through the computer program.
[0023] According to another aspect of the present invention, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the steps of the method for answering the problem described above.
[0024] The embodiments described above in this application, by constructing a system combining a multi-level management grid and a preset question-and-answer knowledge tree, achieve rapid and accurate location and efficient response to questions. Through the management information of the questions to be answered, the multi-level management grid responsible for answering and managing the questions can be identified. The most relevant management path is found among multiple branch nodes of the preset question-and-answer knowledge tree, and further, the most relevant preset leaf nodes are identified within the preset question-and-answer knowledge tree, improving the relevance of the response. Furthermore, by comparing the question data to be answered with historical question data in the preset leaf nodes, semantic matching technology is used to select the best match. This process fully utilizes the value of historical data and avoids repetitive work. Especially with large-scale datasets, the dual optimization of grid and semantic clustering significantly improves the efficiency and accuracy of question matching while reducing the demand for computing resources. This achieves the technical effect of improving the accuracy and speed of responses, solving the technical problem of high computational resource consumption in existing question-answering methods. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0026] Figure 1 This is a flowchart of a question-answering method according to an embodiment of the present invention;
[0027] Figure 2 This is a schematic diagram of the timing of intelligent question-and-answer storage and retrieval for installation and maintenance after-sales service based on grid clustering according to an embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of a historical question-and-answer knowledge tree structure according to an embodiment of the present invention;
[0029] Figure 4 This is a schematic diagram illustrating a RAG architecture based on an embedded model and a large model to generate questions and answers according to an embodiment of the present invention;
[0030] Figure 5 This is a schematic diagram illustrating a grid-tree clustering (left) and semantic compression counting (right) according to an embodiment of the present invention;
[0031] Figure 6 This is a schematic diagram of a matching process for two scenarios to address a novel problem according to an embodiment of the present invention;
[0032] Figure 7 This is a schematic diagram of a question-answering device according to an embodiment of the present invention;
[0033] Figure 8This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Detailed Implementation
[0034] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0036] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0037] AI: Artificial Intelligence, the technology that uses computer systems to simulate human intelligence.
[0038] RAG: Retrieval Augmented Generation, combines language models and information retrieval techniques.
[0039] LLM: Large Language Model, refers to a deep learning model trained using a large amount of text data.
[0040] According to an embodiment of the present invention, a method for answering a question is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0041] Figure 1This is a flowchart of a question-answering method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0042] Step S102: Obtain questions to be answered, wherein the questions to be answered include at least: management information and question data to be answered, and the management information includes at least: a multi-level management grid for managing the questions to be answered;
[0043] Step S104: Among the multiple knowledge nodes of the preset question-and-answer knowledge tree, determine the management path that matches the management information. The knowledge nodes include: branch nodes and preset leaf nodes. Each branch node represents a corresponding management grid. Each preset leaf node is pre-configured with historical question data and corresponding historical answer data. The management path includes: multiple branch nodes arranged in order of management grid level, and adjacent branch nodes in the management path have a parent-child relationship.
[0044] Step S106: In at least one first leaf node, filter the target leaf node that matches the data of the question to be answered, wherein the first leaf node is a preset leaf node connected to the branch node in the management path, and the historical question data in the target leaf node matches the data of the question to be answered.
[0045] Step S108: Determine the historical response data in the target leaf node as the question response data for the question to be answered.
[0046] The embodiments described above in this application, by constructing a system combining a multi-level management grid and a preset question-and-answer knowledge tree, achieve rapid and accurate location and efficient response to questions. Through the management information of the questions to be answered, the multi-level management grid responsible for answering and managing the questions can be identified. The most relevant management path is found among multiple branch nodes of the preset question-and-answer knowledge tree, and further, the most relevant preset leaf nodes are identified within the preset question-and-answer knowledge tree, improving the relevance of the response. Furthermore, by comparing the question data to be answered with historical question data in the preset leaf nodes, semantic matching technology is used to select the best match. This process fully utilizes the value of historical data and avoids repetitive work. Especially with large-scale datasets, the dual optimization of grid and semantic clustering significantly improves the efficiency and accuracy of question matching while reducing the demand for computing resources. This achieves the technical effect of improving the accuracy and speed of responses, solving the technical problem of high computational resource consumption in existing question-answering methods.
[0047] For example, if a user asks a question about broadband installation in a specific neighborhood, the system will prioritize searching for similar questions in the leaf nodes of that neighborhood, rather than blindly searching the entire database. This approach solves the problems of low retrieval efficiency and severe resource waste in traditional question-answering systems. Especially with large-scale datasets, through the dual optimization of grid and semantic clustering, it significantly improves the efficiency and accuracy of question matching while also reducing the demand for computing resources.
[0048] In step S102 above, the management information records a multi-level management grid for managing unanswered questions. This management grid can be divided by the operator, for example, five layers of grids such as: regional grid, operation grid, maintenance grid, primary splitter grid, secondary splitter grid, etc.
[0049] In step S102 above, the management information can be represented as: [region ID][operation ID][maintenance ID][first-level splitter ID][second-level splitter ID]; for example, [Nanjing][Jianye Operation Center][Wanda Branch][PT-POS-000001][PT-POS-0000011].
[0050] As an optional embodiment, determining the management path matching the management information among multiple knowledge nodes of a preset question-and-answer knowledge tree includes: sorting the multi-level management grids in the management information in descending order of level to obtain a management grid sequence, wherein the management grid sequence includes at least a first management grid and a second management grid, with the first management grid having a higher level than the second management grid; determining a first target node matching the first management grid among at least one first branch node of the preset question-and-answer knowledge tree, wherein the first branch node is connected to a pre-selected node in the preset question-and-answer knowledge tree, and the pre-selected node includes at least the root node of the preset question-and-answer knowledge tree; determining a second target node matching the second management grid among at least one second branch node of the preset question-and-answer knowledge tree, wherein the second branch node is a child node of the first target node; and generating a management path based on the first target node and the second target node.
[0051] The embodiments described above in this application, by sorting and constructing paths in a hierarchical manner among the multi-level management grids (such as multi-level geographical regions) in the management information, can more precisely narrow down the query scope until the target leaf node corresponding to the question to be answered and the question answer data are obtained. In this way, even in a large multi-level grid system, the belonging point of the question can be found quickly and accurately, solving the problem of high retrieval complexity caused by too many grid levels in traditional methods.
[0052] For example, when a user reports a broadband failure, the system locates the branch node in the user's higher-level geographical region, then refines it to the next lower-level geographical region, and finally pinpoints the specific cell. This series of steps ensures a high degree of relevance in the response data.
[0053] As an optional embodiment, in at least one first leaf node, filtering the target leaf node that matches the question data to be answered includes: calculating the semantic relevance between the pre-configured historical question data and the question data to be answered in each first leaf node; and determining the first leaf node whose semantic relevance is greater than a preset relevance threshold as the target leaf node.
[0054] In the embodiments described above, by introducing semantic relevance calculation, the system intelligently judges the similarity between the question to be answered and historical question data, thereby quickly filtering out the target leaf node most likely to contain the answer from a massive number of preset leaf nodes. Then, the historical answer data in the target leaf node can be used as the question answer data for the question to be answered. Because semantic relevance can better understand the essence of the question, rather than just relying on surface text matching, it can more accurately determine the question answer data. By adjusting the relevance threshold, the best balance between recall and precision can be found, further optimizing the question answering experience.
[0055] For example, if a user asks, "How do I reset my Wi-Fi password?", the semantic similarity of this question with historical questions in all leaf nodes is calculated. Nodes that describe similar questions (such as "What if I forget my Wi-Fi password?" or "How do I change my home network password?") will be marked as target leaf nodes.
[0056] Optionally, the semantic relevance between historical question data and question data to be answered can be the semantic similarity between historical question data and question data to be answered, which can be determined by calculating the cosine similarity between historical question data and question data to be answered.
[0057] As an optional embodiment, the method further includes: if no target leaf node matching the question data to be answered exists in at least one first leaf node, determining the last branch node in the management path as the third branch node; determining the parent node of the third branch node as the fourth branch node among multiple branch nodes in the management path; recursively querying at least one second leaf node of the fourth branch node in a preset question-answering knowledge tree, wherein the recursive query process includes: traversing all descendant nodes of the fourth branch node and taking the preset leaf node among the descendant nodes as the second leaf node; filtering target leaf nodes matching the question data to be answered in at least one second leaf node, wherein the historical question data in the target leaf node matches the question data to be answered.
[0058] In the embodiments described above, when a matching problem cannot be found at the finest-grained grid level, a multi-level recursive query mechanism allows the system to backtrack upwards, i.e., search for answers across a broader geographical or organizational scope. This mechanism ensures that even if there are no directly matching historical cases within a specific grid, the system can find solutions to similar problems by querying the next higher-level grid. This approach overcomes the limitations of single-level retrieval, enhances the system's adaptability and flexibility, and provides a more comprehensive solution strategy, especially when facing emerging or rare problems.
[0059] For example, if no troubleshooting cases for a specific device model are found in a community, the system will automatically search within the street, district, or even city where the community is located until the closest match is found.
[0060] It should be noted that the recursive query mechanism is applicable to all scenarios that require information retrieval across multiple levels. Through multi-level queries from bottom to top or top to bottom, the success rate and coverage of information retrieval can be effectively improved.
[0061] Optionally, all descendant nodes of the fourth branch node include: the child nodes of the fourth branch node, and the child nodes of the child nodes, until the child node is a leaf node.
[0062] Optionally, after filtering the target leaf node that matches the question data to be answered in at least one second leaf node, the method further includes: creating a third leaf node in the preset question-and-answer knowledge tree according to the management path, wherein the third leaf node is a child node of the last branch node in the management path; and copying the historical question data and historical answer data in the target leaf node to the third leaf node.
[0063] As an optional embodiment, the method further includes: if there is no target leaf node matching the question data in at least one second leaf node, detecting whether the fourth branch node belongs to the root node of the preset question-answering knowledge tree; if the fourth branch node does not belong to the root node, taking the fourth branch node as the third branch node, and recursively querying the new second leaf node based on the updated third branch node.
[0064] In the embodiments described above, when a matching question cannot be found within the current level of the preset question-answering knowledge tree based on the management path for the question to be answered, the exception handling logic allows the system to dynamically adjust the query scope until it reaches the highest level (i.e., the root node), ensuring that no possible answers are missed. This mechanism guarantees that when faced with extremely special or unprecedented questions, the system can still attempt to provide solutions from a broader perspective, avoiding deadlocks or unsolvable situations.
[0065] For example, if no troubleshooting information for a new type of equipment is found within a city's grid, the system will continue querying upwards until it reaches the highest-level grid, hoping to find solutions that may exist in other regions. This approach is particularly effective when dealing with complex problems that span geographical regions and organizations, significantly improving the system's problem-solving capabilities.
[0066] As an optional embodiment, the method further includes: when the fourth branch node belongs to the root node, analyzing the question data to be answered using a pre-set large language model to obtain question answer data; creating a third leaf node in the preset question-answer knowledge tree according to the management path, wherein the third leaf node is a child node of the last branch node in the management path; and recording the question data to be answered as historical question data and the question answer data as historical answer data in the third leaf node.
[0067] In the embodiments described above, when no matching question is found in any level of the grid of the preset question-answering knowledge tree, a large language model is activated for deep analysis to generate question-answer data. This mechanism ensures that even when there is no readily available answer in the knowledge base, the system can provide a solution through advanced AI technology, demonstrating the system's intelligence. Furthermore, after generating question-answer data, the newly generated questions and answers are added to the knowledge tree as a reference for similar questions in the future. This not only enriches the content of the knowledge base but also improves the efficiency of subsequent question processing. This method solves the challenges of slow knowledge updates and difficulty in responding to new questions in traditional question-answering systems. Through a dynamic update mechanism, the system can continuously evolve and improve service quality.
[0068] For example, if a user asks a question about the latest technology, and the relevant information is not yet included in the knowledge base, the large model will step in and use its powerful learning and language understanding capabilities to generate an answer.
[0069] As an optional embodiment, in at least one first leaf node, filtering the target leaf node that matches the data of the question to be answered includes: sorting at least one first leaf node according to a pre-selected priority order to obtain a leaf node sequence; judging in descending order of priority whether each first leaf node in the leaf node sequence is a target leaf node that matches the data of the question to be answered; if the first leaf node is a target leaf node, incrementing the priority parameter of the first leaf node by 1, wherein the magnitude of the priority parameter is positively correlated with the priority level.
[0070] The embodiments described above in this application, by setting priority parameters for leaf nodes, can dynamically adjust the retrieval order based on historical matching data, prioritizing the checking of nodes that have been frequently matched in the past, thereby further accelerating the problem-solving process. This method, through a learning and feedback mechanism, continuously optimizes the structure of the knowledge tree, making it more closely aligned with actual needs and improving problem-solving efficiency and user experience. Through the dynamic adjustment of priority parameters, the system can automatically identify and strengthen its ability to handle frequently asked questions, which is significant for improving overall service response speed and reducing user waiting time.
[0071] For example, if broadband problems occur frequently in a certain community, the priority of the leaf nodes of that community will gradually increase, and users with the same or similar problems will get answers faster in the future.
[0072] As an optional embodiment, before determining the management path for matching management information, the method further includes: acquiring multiple sample question-and-answer data, wherein the sample question-and-answer data includes: sample questions and sample answers, the sample questions include at least: sample management information and sample question data, and the sample management information includes at least: a multi-level management grid for managing sample questions; in a preset question-and-answer knowledge tree, setting corresponding branch nodes according to the management grid in the sample management information, and setting a corresponding fourth leaf node for each sample question-and-answer data, wherein the parent-child relationship between branch nodes is determined according to the multi-level management grid recorded in the same sample management information, and the parent-child relationship between branch nodes and the fourth leaf node is determined according to the sample management information. The attribution relationship between information and sample question-and-answer data is determined. Each fourth leaf node is configured with sample question data and sample answer data from the corresponding sample question-and-answer data. In the multiple fourth leaf nodes of the preset question-and-answer knowledge tree, multiple leaf node sets are determined, wherein at least one fourth leaf node in each leaf node set is a child node of the same branch node. At least one fourth leaf node in the same leaf node set is merged according to the semantic relevance of the sample question data to obtain a preset leaf node. The historical question data in the preset leaf node is the result of merging sample question data with semantic relevance greater than a preset threshold, and the historical answer data is the result of merging sample answer data corresponding to the sample question data.
[0073] The embodiments described above in this application, by collecting and analyzing a large amount of sample question-and-answer data, can automatically construct and optimize a preset question-and-answer knowledge tree, ensuring its reasonable structure and rich content. This process involves not only the division of the grid hierarchy but also the merging of leaf nodes based on semantic relevance, aiming to reduce redundant information and improve the overall efficiency of the knowledge tree. Through automated data analysis and structural optimization, maintenance costs can be significantly reduced, and the usability and response speed of the knowledge base can be improved. This method is particularly suitable for application areas with diverse question types and frequent updates, effectively addressing the challenges brought by information explosion and ensuring that the knowledge base always remains efficient and cutting-edge.
[0074] For example, analyzing sample question-and-answer data might reveal that users from the same region frequently ask similar questions. These leaf nodes can then be merged into a comprehensive node containing multiple common questions and their answers. This saves storage space and allows users to quickly access the information they need. This method solves the problems of high manual maintenance costs and slow updates in traditional knowledge base construction. Through automated learning and optimization, the system can continuously improve itself, enhancing the intelligence level of question handling.
[0075] This invention also provides a preferred embodiment, which offers a grid-based and semantic clustering-based method for storing and retrieving installation and maintenance questions and answers. Targeting intelligent question-and-answer scenarios in installation and maintenance after-sales service, this method fully leverages the grid-based clustering characteristics of user services according to operations, maintenance, and network equipment, designing a grid-based tree-like clustering storage and retrieval technology. Combined with semantic relevance matching of question-and-answer knowledge under clustering, this achieves a reduction in the storage volume of historical question-and-answer knowledge, improved retrieval efficiency, and reduced large model call volume, thereby efficiently reducing the computational load of the intelligent question-and-answer system and improving the support efficiency of installation and maintenance services.
[0076] To ensure retrieval accuracy and efficiency while reducing reliance on large models and optimizing resource allocation, a more efficient and intelligent method for storing and retrieving installation and maintenance questions and answers is needed. This requires not only an effective method to compress historical question and answer data and reduce storage requirements, but also to improve retrieval efficiency and reduce the frequency of large model calls, thereby reducing computational resource consumption and improving service response speed.
[0077] It should be noted that operators allocate user support to grid areas based on operation and maintenance, and network equipment is deployed according to physical area hierarchies. This results in a high concentration of installation and maintenance feedback issues in specific areas. Statistical analysis of Q&A knowledge in installation and maintenance after-sales service scenarios reveals that the operator-defined grids, especially the five-layer grids (regional grid, operation grid, maintenance grid, primary splitter grid, and secondary splitter grid), exhibit high concentration characteristics in historical Q&A knowledge. Utilizing these grid concentration characteristics to establish a reasonable historical Q&A knowledge storage and retrieval mechanism can effectively reduce the large model call rate and thus reduce system computing and storage resources.
[0078] Through in-depth analysis of intelligent question-and-answer scenarios in installation and maintenance, this application designs a highly efficient historical question-and-answer knowledge tree-structured storage and retrieval technology based on grid and semantic clustering. This technology fully leverages the characteristics of user clustering and hierarchical network deployment, effectively achieving question clustering, compressed storage, and rapid question retrieval. During storage, historical question-and-answer knowledge is clustered according to a grid tree, and questions within the same category are semantically compressed and merged for storage. During retrieval, a grid tree index quickly locates new questions to the target cluster, and semantic matching calculations are performed between new and old questions within the same category.
[0079] It should be noted that new questions can be unanswered questions or unanswered question data within unanswered questions, while old questions can be historical question data stored on the leaf nodes of a preset question-and-answer knowledge tree.
[0080] Figure 2 This is a schematic diagram illustrating the timing of intelligent question-and-answer storage and retrieval for installation and maintenance after-sales service based on grid clustering, according to an embodiment of the present invention. Figure 2 As shown, in the operator's intelligent Q&A system for installation and maintenance after-sales service, grid clustering retrieval and storage work in conjunction with the front-end customer service server and the back-end RAG system to complete the Q&A support for installation and maintenance.
[0081] In broadband installation and maintenance after-sales service Q&A systems, frequently occurring questions often exhibit clear grid-like clustering characteristics, which are closely related to user residential distribution, network equipment deployment, and service operation models. Statistical analysis of all questions and answers from the system over seven days revealed that up to 60% of questions asked more than 100 times were related to specific grid attributes. Specifically, these questions can be categorized into the following three common scenarios:
[0082] (1) Insufficient network equipment capacity: The bandwidth contracted by the user does not match the actual hardware performance of the gateway or router used, resulting in low speed.
[0083] (3) Poor WiFi signal: Due to the failure to deploy WiFi appropriately according to different room types, the signal coverage quality is poor, which affects the internet experience.
[0084] (3) Low optical power of uplink device: The network connections of users in the area are all through the same uplink device port. If the optical power of the port is insufficient, there will be a general slowdown and packet loss.
[0085] To address these grid clustering issues, this application designs two core modules: grid-tree semantic clustering storage and grid-tree retrieval, aiming to optimize knowledge management and improve service efficiency.
[0086] As an optional embodiment, a grid-tree semantic clustering storage is used to implement grid-tree clustering processing of question-and-answer knowledge, and performs similar compressed storage based on the correlation between semantics, specifically including:
[0087] (1) Generate a grid tree structure: For historical Q&A knowledge, a tree structure is generated according to the user's five-layer grid. The historical Q&A knowledge of installation and maintenance is processed. The root node is a fixed provincial region. The child nodes (i.e., branch nodes) of the root node are divided according to the hierarchy of [region id][operation id][maintenance id][first-level splitter id][second-level splitter id]. The leaf nodes store the historical Q&A knowledge belonging to the current child node. The historical Q&A knowledge is clustered and divided.
[0088] (2) Clustered knowledge semantic compression storage: Leaf nodes belonging to the same child node (i.e., branch node) are subjected to semantic relevance calculation. Leaf nodes with a cosine semantic relevance rate of 60% or more are considered to be the same problem. Leaf nodes are merged and a similar count value is set. Those with a semantic relevance rate of less than 60% are directly retained.
[0089] Figure 3 This is a schematic diagram of a historical question-and-answer knowledge tree structure according to an embodiment of the present invention, such as... Figure 3 As shown, the preset question-and-answer knowledge tree of this application uses a tree structure to store data. Historical questions and answers (i.e., sample question-and-answer data) are processed and stored in a tree structure through the user's five-layer grid attributes. Combined with semantic compression, storage can be effectively reduced and retrieval efficiency can be improved.
[0090] It should be noted that, in accordance with the operator's strict grid delineation management, users will be operated and maintained under the five-layer grid planning. Therefore, installation and maintenance support questions triggered by user services will all fall under the secondary optical splitter.
[0091] As an optional embodiment, the grid-tree retrieval is specifically used for: querying the question-answer data of the question to be answered in the preset question-answer knowledge tree; and updating the preset question-answer knowledge tree according to the query results of the question to be answered.
[0092] Optionally, querying the question-answer data of the question to be answered in the preset question-answer knowledge tree includes: performing a step-by-step grid-based search on the question to be answered according to its grid, sequentially searching the regional grid, operation grid, maintenance grid, first-level splitter grid, second-level splitter grid, until all five grids are completely matched, obtaining multiple leaf nodes (i.e., first leaf nodes) of the question to be answered, and then performing semantic relevance matching between the question data of the question to be answered and the historical question data in the leaf nodes (i.e., first leaf nodes). Leaf nodes (i.e., first leaf nodes) that match more than 60% are designated as target leaf nodes, and the historical answer data in the target leaf nodes are the question-answer data of the question to be answered.
[0093] Optionally, if the semantic relevance match between the question data to be answered and the historical question data in the leaf node (i.e., the first leaf node) is no greater than 60%, then the synchronous matching backtracks to the previous child node (i.e., the previous level branch node) until it recurses to the root node. Based on each recursively generated leaf node (i.e., the second leaf node), the leaf node (i.e., the second leaf node) with a semantic relevance match greater than 60% with the question data to be answered is retrieved as the target leaf node. Furthermore, the historical answer data in the target leaf node is the question answer data of the question to be answered.
[0094] Optionally, if the semantic relevance of the historical question data in all leaf nodes of the preset question-answering knowledge tree to the question-answering data is no greater than 60%, the question-answering data can be submitted to the Large Language Model (LLM) to temporarily generate question-answering data.
[0095] Figure 4 This is a schematic diagram illustrating a RAG architecture based on an embedded model and a large model to generate questions and answers according to an embodiment of the present invention, such as... Figure 4 As shown, RAG's architecture supports the processing flow of user question-and-answer scenarios, mainly including the invocation of embedded models and large models. This application proposes a grid-based intelligent question-and-answer storage and retrieval method focusing on the installation and maintenance after-sales service process, improving AI support efficiency. The specific steps include the following:
[0096] Step S41: Input the question into the embedding model, that is, input the question data to be answered into the embedding model.
[0097] Step S42: The embedded model converts the question into a vector for retrieval.
[0098] Step S43: Query the knowledge limit database and calculate semantic relevance.
[0099] Step S44: Return semantically relevant results to the embedding model.
[0100] Step S45: Provide the prompt word and semantically related indication content to the large language model.
[0101] Step S46: The large language model combines the specified content range to generate an answer.
[0102] Optionally, updating the preset question-answering knowledge tree based on the query results of the question to be answered includes: when the question to be answered is searched level by level according to its grid and a leaf node with a semantic relevance match greater than 60% with the question data to be answered is obtained (that is, the target leaf node is determined among multiple first leaf nodes), the similarity count value of the leaf node is incremented by 1, that is, the priority parameter is incremented by 1.
[0103] Optionally, updating the preset question-answering knowledge tree based on the query results of the question to be answered includes: when the question to be answered is searched level by level according to its grid and no leaf node with a semantic relevance greater than 60% matching the question data cannot be obtained (that is, there is no target leaf node among multiple first leaf nodes), that is, when a leaf node with a semantic relevance greater than 60% matching the question data is obtained by recursively searching towards the root node (that is, the target leaf node is determined among multiple second leaf nodes), the recursively obtained leaf node with a semantic relevance greater than 60% matching the question data is copied to the leaf node position of the original search path (that is, copying the second leaf node to the position of the first leaf node).
[0104] Optionally, updating the preset question-answering knowledge tree based on the query results of the questions to be answered also includes: when using the Large Language Model (LLM) to temporarily generate question-answer data, a new leaf node (i.e., the third leaf node) can be added at the leaf node position of the original retrieval path (i.e., the position of the first leaf node) to record the question-answer data generated by the Large Language Model (LLM) and the questions to be answered (or the question data to be answered).
[0105] The embodiments described above in this application fully utilize the grid aggregation characteristics of installation and maintenance services. Compared with other traditional methods, they reduce storage capacity, retrieval computation capacity, and large model call rate by comparing operator production data.
[0106] Table 1 is a schematic comparison of the storage, computation, and call rate of this method with traditional methods according to an embodiment of the present invention. As shown in Table 1, there are currently 10 questions in 3 categories of question-answer pairs, of which 5 have broadband speed test failures, 3 have ITV buffering issues, and 2 have landline phone malfunctions. The overall effect of this method is significantly improved, which significantly suppresses model generation, reduces computational resource consumption, and improves response efficiency.
[0107] Table 1
[0108]
[0109]
[0110] As an optional embodiment, the intelligent question-and-answer storage and optimization method for equipment maintenance based on grid clustering proposed in this application focuses on grid tree clustering storage and grid tree retrieval, realizing the grid tree storage and retrieval of historical question-and-answer knowledge.
[0111] Optionally, the grid-tree semantic clustering storage consists of two implementation stages: generating the grid-tree structure and compressing and storing clustered knowledge. Generating the grid-tree structure focuses on processing historical knowledge into a tree structure and compressing and storing semantically relevant information.
[0112] As an optional example, the design logic for building and managing a grid tree structure, and storing question-answering knowledge clusters within it, can be summarized into the following key steps:
[0113] Step A11 defines two core classes: GridNode and QAKnowledge.
[0114] Optionally, GridNode represents a node in a grid tree, each node having a unique identifier nodeId, a level gridLevel, a parent reference parent, a list of child nodes children, and a question-and-answer knowledge list qaList specific to the leaf nodes.
[0115] Optionally, QAKnowledge contains knowledge units of specific questions and answers, each unit having a question text, an answer text, a semantic vector representation of the question (embedding), and a count of similar questions and answers (sameClassCount).
[0116] Step A12, Mesh tree construction and question-and-answer assignment.
[0117] Optionally, the `buildGridTreeAndCluster` method is used to construct a five-level grid tree and distribute question-and-answer knowledge to the corresponding leaf nodes based on the grid paths extracted from the questions. This process consists of two steps:
[0118] Assigning to a leaf node: Traverse the original question and answer list rawQAList, for each question and answer knowledge unit qa, use the extractGridId method (not defined in the pseudocode, but can be understood as extracting the grid path from the question text), then call the findOrCreateLeafNode method to find or create the corresponding leaf node, and add the question and answer knowledge to the qaList of the leaf node.
[0119] Step A13: Dynamically find / create leaf nodes.
[0120] Optionally, a recursive method `findOrCreateLeafNode` is used to search for or create a specific leaf node in the grid tree, i.e., creating a node based on the next-level ID of the grid path. If the current node is already at the leaf level, the current node is returned directly; otherwise, the matching node ID is searched in the list of child nodes of the current node. If found, the node itself is recursively called to continue searching downwards; if not found, a new child node is created, added to the list of child nodes, and the node itself is recursively called again until the leaf level is reached.
[0121] Step A14, semantic clustering compression.
[0122] Optionally, the traverseAndCluster method is used to traverse the entire grid tree and perform semantic clustering compression on the question-and-answer knowledge in all leaf nodes. This typically means using some clustering algorithm, such as K-means or hierarchical clustering, to identify similar questions based on the embedding attributes of the question-and-answer knowledge (usually the question vector representation obtained through a deep learning model such as BERT), and possibly merging them to reduce redundancy and improve knowledge retrieval efficiency.
[0123] The embodiments described above utilize a tree-like data structure (grid tree) to organize and classify question-and-answer knowledge. This enables rapid location of relevant knowledge bases based on geographical or other hierarchical attributes, and further allows for knowledge clustering, optimizing storage and retrieval mechanisms. This is particularly useful for large-scale, hierarchical knowledge management systems, such as maintenance knowledge bases for telecommunications companies and customer support systems for large enterprises.
[0124] Optionally, clustered knowledge compression storage focuses on compressing and storing knowledge within the same category based on semantic relevance.
[0125] As an optional implementation, the traversal and clustering process of the grid-based hierarchical clustering algorithm has the following main logic:
[0126] Step A21: Configure the function entry point. The function `traverseAndCluster` receives a parameter `node` of type `GridNode` for traversal and clustering processing.
[0127] Step A22, Leaf Node Processing. Check the `gridLevel` of the node. If it equals 4, it means it is a leaf node and needs to be merged into semantic clusters. For each QAKnowledge instance `qa` in the leaf node, the algorithm attempts to compare it with existing instances in the currently clustered question-answer instance list `mergedList`.
[0128] Step A23: Cosine Similarity Calculation. The cosineSimilarity function is used to calculate the cosine similarity between the embedding vectors of the two question-answering instances, qa and existing, and this is used as the basis for clustering and merging. The cosine similarity is between 0 and 1; the closer the value is to 1, the more similar the two vectors are.
[0129] Step A24, Cluster Merging. If the similarity between qa and existing is greater than or equal to 0.6 (the preset clustering threshold), they are considered to belong to the same class. The sameClassCount of qa (the count of the same class) will be added to the sameClassCount of existing, indicating that two similar question-and-answer instances have been merged. At the same time, merged is marked as true, indicating that qa has been merged.
[0130] Step A25: Add a new instance. If qa has not been merged with any existing instance (i.e., merged is false), then qa is added as a new instance to mergedList, indicating that it forms a new cluster.
[0131] Step A26: List Update. After traversal, update the qaList of the leaf nodes to mergedList to reflect the clustering and merging results.
[0132] Step A27: Recursively process non-leaf nodes. If a node is not a leaf node (i.e., gridLevel is not equal to 4), then traverse all its child nodes and recursively call the traverseAndCluster function to traverse and cluster the next level of grid nodes.
[0133] The core logic of the above embodiments of this application is to traverse each node of the grid tree, perform semantic clustering and merging on the leaf nodes (based on cosine similarity), recursively process all child nodes, and finally update the question-answer instance list of the leaf nodes to reflect the results of clustering and merging.
[0134] Following the above processing flow, the tree-structured processing of the example scenarios mentioned in the text, including the 5 instances of broadband speed failures, 3 instances of IPTV buffering, and 2 instances of landline phone malfunctions, is illustrated in the following example:
[0135] "[Nanjing][Jianye Operation Center][Wanda Branch][PT-POS-000001][PT-POS-0000011] - 1000M broadband speed test failed;
[0136] [Nanjing][Jianye Operation Center][Wanda Branch][PT-POS-000001][PT-POS-0000011] - User's home speed test results are not up to standard;
[0137] [Nanjing][Jianye Operation Center][Wanda Branch][PT-POS-000001][PT-POS-0000011] - Home broadband speed test results are not up to standard;
[0138] [Suzhou][Wuzhong Operation Center][Jinchang Branch][PT-POS-000011][PT-POS-0000111] - Broadband speed test fails to meet standard;
[0139] [Suzhou][Wuzhong Operation Center][Jinchang Branch][PT-POS-000011][PT-POS-0000111] - Broadband uplink speed test fails to meet standard;
[0140] [Nanjing][Jianye Operation Center][Xinglong Branch][PT-POS-000002][PT-POS-0000021] - ITV playback is lagging;
[0141] [Nanjing][Jianye Operation Center][Xinglong Branch][PT-POS-000002][PT-POS-0000021] - ITV is lagging and cannot play;
[0142] [Nanjing][Jianye Operation Center][Wanda Branch][PT-POS-000001][PT-POS-0000011] - ITV Program Playback Card;
[0143] [Nanjing][Wuzhong Operation Center][Jinchang Branch][PT-POS-000011][PT-POS-0000111] - Landline calls cannot be made;
[0144] [Nanjing][Wuzhong Operation Center][Jinchang Branch][PT-POS-000001][PT-POS-0000011] - Landline cannot be dialed.
[0145] Figure 5 This is a schematic diagram illustrating a grid-tree clustering (left) and semantic compression counting (right) according to an embodiment of the present invention, as shown below. Figure 5As shown, a grid-tree-like storage clustering is performed, resulting in the tree structure shown on the left below. For problems under the same second-level beam splitter, clustering according to a five-level grid can effectively group the problems. Then, semantic relevance compression and merging of problems at the same level are performed. Problems with semantic relevance of 60% or higher are merged and retained, and duplicates are counted, resulting in the storage result shown on the right below.
[0146] As an optional embodiment, the process of handling new questions and retrieving historical answers in a grid-tree retrieval mainly consists of three steps:
[0147] Step A31 involves matching the grid path level by level, specifically including: extracting the grid ID path and traversing to the target leaf node.
[0148] Optionally, extract the grid ID path by retrieving the corresponding grid ID path from the passed-in new question object `newQuestion`. This path is a string connected by delimiters `-`, representing the hierarchical location of the new question within the network.
[0149] Optionally, traverse to the target leaf node: using the obtained grid ID path, start from the root node of the grid tree and traverse downwards level by level until the target leaf node targetNode pointed to by the end of the path is found. If no corresponding node is found in the tree for any part of the path, the traversal process terminates, and targetNode is null.
[0150] Step A32, semantic matching of sibling leaf nodes, specifically includes: checking whether the target node is valid, comparing semantic similarity, and determining the best match.
[0151] Optionally, check if the target node is valid. Only if the targetNode is not empty, that is, if the new problem has a specific location in the network, will the next matching step be performed.
[0152] Optionally, semantic similarity is compared by iterating through all historical question-answers (oldQA) in the targetNode and calculating the cosine similarity (sim) between the embedding of the new question and the embedding of each historical question-answer. If the similarity is greater than a preset threshold of 0.6, the current best match (bestMatch) and the maximum similarity (maxSimilarity) are updated.
[0153] Optionally, the best match is determined. After the traversal is complete, if a bestMatch exists, it means that the most similar historical question and answer has been found. At this time, the sameClassCount counter of bestMatch is incremented, indicating that it has been successfully matched once, and the answer to that historical question and answer is returned. If no match is found, the function continues to step 3.
[0154] Step A33 involves recursively backtracking to the parent node, specifically including: backtracking, parent node matching, and termination condition judgment.
[0155] Optionally, the backtracking process includes: if no historical question-answer matching the conditions is found at the target leaf node through step S32, then backtracking upwards from the targetNode, checking all its parent nodes. This step attempts to find a match in a higher-level grid to increase the likelihood of finding a suitable answer.
[0156] Optionally, parent node matching includes: within each parent node, using cosine similarity to check the match between the new question and historical question-answers. If the similarity is greater than or equal to 0.6, the matched historical question-answer is returned directly, but the counter is not updated. This indicates that a sufficiently relevant historical question-answer has been found within a broader concept category.
[0157] Optionally, termination conditions include: the backtracking process continues until a match is found or no match is found even after returning to the root node of the grid tree. If no match is found after the entire process ends, the function will return null, meaning that no historical record matching the new problem was found.
[0158] The above process combines structured matching of grid ID paths with comparison of semantic similarity, aiming to efficiently and accurately retrieve the most relevant answers to new questions from historical data.
[0159] As an alternative example, in a tree-based question-answering system, the process of processing and matching new questions to find the most suitable answer mainly includes the following four steps:
[0160] Step A41: Semantic matching of sibling leaf nodes.
[0161] Optionally, it checks whether the new input question is semantically highly similar to any stored question in the current grid node. This is done by calculating the cosine similarity between the embedded representation of the new question and the embedded representation of the stored questions. If the similarity exceeds a set threshold (e.g., 0.6), a match is considered found, and the answer to this historical question-answer pair is returned. Simultaneously, the `sameClassCount` variable for this match is updated; it is a statistical variable that records how many times a new question-answer pair has been added to the same grid node as this old question-answer pair.
[0162] Step A42: Recursively backtrack to the parent node.
[0163] Optionally, if no match is found at the current node, the search continues back up to the parent node. This process is recursive, starting from the most concrete leaf node and searching for possible matches level by level towards more abstract parent nodes. Within each parent node, cosine similarity is used to determine if there are sufficiently similar historical question-answer pairs. However, even if a match is found during this process, the counter is not updated; instead, the answer is returned directly.
[0164] Step A43: When there is no match, call the large model.
[0165] Alternatively, if no question-answer pair satisfying the similarity criteria is found throughout the entire tree structure, the system invokes a large language model (LLM) to generate the answer. This is a remedy when there are no readily available answers in the system's database, ensuring that every question receives a response.
[0166] Step A44: Store the new question and its answer in the matching grid node.
[0167] Optionally, once an answer is obtained, whether from historical question-answer pairs or generated by LLM, the new question and its answer will be stored as a new question-answer pair in the tree at the most matching node. Here, the "most matching" node refers to the node that best represents the context and scope of the question, as determined by the semantic matching process, and the actual storage operation is performed by the addToProperNode function. This step helps with the rapid matching of subsequent questions and the self-improvement of the learning system.
[0168] The design logic described above reflects the question-answering system's strategy for organizing, retrieving, and generating knowledge, aiming to improve the accuracy and efficiency of question responses, while also possessing the ability to dynamically expand the knowledge base through large-scale language models.
[0169] Figure 6 This is a schematic diagram illustrating the matching process for two scenarios, a novel problem according to an embodiment of the present invention, as shown below. Figure 6 As shown, the matching process logic for new questions is as follows: if the new question can be semantically matched within the same category as the expected path, then the new question is updated to the old question, and the count is incremented by 1. If no match is found, a new leaf node for the new question is added within that category, the count is set to 1, and the process is recursively performed through the tree structure until a leaf node is expected to match, at which point the answer is returned to the leaf node containing the new question.
[0170] Additionally, if no relevant questions are found after traversing the entire tree, a larger model is used to generate the search results. This optimizes the retrieval efficiency for subsequent questions.
[0171] Table 2 is a schematic table comparing the storage capacity, computational load, and call rate of the method according to an embodiment of the present invention with that of the traditional method. As shown in Table 2, the generated data test verifies that the method is superior to the traditional method in terms of storage capacity, computational load, and call rate. In production practice, the method is verified using data from the operator's intelligent question-and-answer system. Based on an average of 1 million question-and-answer consultation data per day, compared with the storage and retrieval methods of the traditional method, the storage capacity of the present application is reduced by 50%, the computational load is reduced by 60%, and the model call rate is reduced by 51.1%.
[0172] Table 2
[0173] index Traditional methods This method Increase Storage 3GB 1.5GB 50%↓ computational load 200ms 80ms 60%↓ Model call rate 45% 22% 51.1%↓
[0174] The embodiments described above in this application reduce question-and-answer storage by using grid and semantic clustering. They fully leverage the characteristics of operators' installation and maintenance after-sales service scenarios, utilizing the clustering attributes of user clustering and network layer deployment. A grid-based, tree-like historical question-and-answer knowledge storage structure is designed, and semantically related compression of similar knowledge storage achieves high-density knowledge effective clustering compression. Combined with practical production, this effectively reduces historical question-and-answer storage by 50%. Tree-like retrieval improves the efficiency of retrieving both new and old questions. Utilizing a grid-like tree structure and a five-layer grid tree index design, path matching retrieval of new and old questions can be effectively achieved, avoiding the surge in retrieval time caused by cracked or linear retrieval, achieving a 60% reduction in retrieval efficiency for both new and old questions. Grid clustering effectively reduces the large model call rate. Based on the high-density knowledge clustering characteristics of operators' questions and answers using grids, high-value retention of historical question-and-answer knowledge is achieved, effectively reducing the semantic matching computation of new and old questions, and reducing the large model call rate by 51%.
[0175] According to an embodiment of the present invention, a question-answering device embodiment is also provided. It should be noted that the question-answering device can be used to execute the question-answering method in the embodiments of the present invention, and the question-answering method in the embodiments of the present invention can be executed in the question-answering device.
[0176] Figure 7 This is a schematic diagram of a question-answering device according to an embodiment of the present invention, such as... Figure 7As shown, the device may include: an acquisition module 72, used to acquire questions to be answered, wherein the questions to be answered include at least: management information and question data to be answered, and the management information includes at least: a multi-level management grid for managing the questions to be answered; a first determination module 74, used to determine a management path matching the management information among multiple knowledge nodes of a preset question-and-answer knowledge tree, wherein the knowledge nodes include: branch nodes and preset leaf nodes, each branch node represents a corresponding management grid, each preset leaf node is pre-configured with historical question data and corresponding historical answer data, and the management path includes: multiple branch nodes arranged in order of management grid level, and adjacent branch nodes in the management path have a parent-child relationship; a matching module 76, used to filter target leaf nodes matching the question data to be answered in at least one first leaf node, wherein the first leaf node is a preset leaf node connected to a branch node in the management path, and the historical question data in the target leaf node matches the question data to be answered; and a second determination module 78, used to determine the historical answer data in the target leaf node as the question answer data for the question to be answered.
[0177] It should be noted that the acquisition module 72 in this embodiment can be used to execute step S102 in this application embodiment, the first determination module 74 in this embodiment can be used to execute step S104 in this application embodiment, the matching module 76 in this embodiment can be used to execute step S106 in this application embodiment, and the second determination module 78 in this embodiment can be used to execute step S108 in this application embodiment. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.
[0178] The embodiments described above in this application, by constructing a system combining a multi-level management grid and a preset question-and-answer knowledge tree, achieve rapid and accurate location and efficient response to questions. Through the management information of the questions to be answered, the multi-level management grid responsible for answering and managing the questions can be identified. The most relevant management path is found among multiple branch nodes of the preset question-and-answer knowledge tree, and further, the most relevant preset leaf nodes are identified within the preset question-and-answer knowledge tree, improving the relevance of the response. Furthermore, by comparing the question data to be answered with historical question data in the preset leaf nodes, semantic matching technology is used to select the best match. This process fully utilizes the value of historical data and avoids repetitive work. Especially with large-scale datasets, the dual optimization of grid and semantic clustering significantly improves the efficiency and accuracy of question matching while reducing the demand for computing resources. This achieves the technical effect of improving the accuracy and speed of responses, solving the technical problem of high computational resource consumption in existing question-answering methods.
[0179] As an optional embodiment, the first determining module includes: a first sorting unit, used to sort the multi-level management grids in the management information in descending order of level to obtain a management grid sequence, wherein the management grid sequence includes at least: a first management grid and a second management grid, the first management grid being at a higher level than the second management grid; a first determining unit, used to determine a first target node matching the first management grid in at least one first branch node of a preset question-and-answer knowledge tree, wherein the first branch node is connected to a pre-selected node in the preset question-and-answer knowledge tree, the pre-selected node including at least: the root node of the preset question-and-answer knowledge tree; a second determining unit, used to determine a second target node matching the second management grid in at least one second branch node of the preset question-and-answer knowledge tree, wherein the second branch node is a child node of the first target node; and a generating unit, used to generate a management path based on the first target node and the second target node.
[0180] As an optional embodiment, the matching module includes: a calculation unit for calculating the semantic relevance between pre-configured historical question data and question data to be answered in each first leaf node; and a third determination unit for determining the first leaf node whose semantic relevance is greater than a preset relevance threshold as the target leaf node.
[0181] As an optional embodiment, the apparatus further includes: a first determining submodule, configured to determine the last branch node in the management path as the third branch node when there is no target leaf node matching the question data to be answered in at least one first leaf node; a second determining submodule, configured to determine the parent node of the third branch node as the fourth branch node among multiple branch nodes in the management path; a first query submodule, configured to recursively query at least one second leaf node of the fourth branch node in a preset question-answering knowledge tree, wherein the recursive query process includes: traversing all descendant nodes of the fourth branch node and taking the preset leaf node among the descendant nodes as the second leaf node; and a matching submodule, configured to filter the target leaf nodes matching the question data to be answered in at least one second leaf node, wherein the historical question data in the target leaf node matches the question data to be answered.
[0182] As an optional embodiment, the apparatus further includes: a detection submodule, configured to detect whether the fourth branch node belongs to the root node of a preset question-and-answer knowledge tree when there is no target leaf node matching the question data to be answered in at least one second leaf node; and a second query submodule, configured to treat the fourth branch node as the third branch node when the fourth branch node does not belong to the root node, and recursively query a new second leaf node based on the updated third branch node.
[0183] As an optional embodiment, the device further includes: an analysis submodule, used to analyze the question data to be answered using a pre-set large language model when the fourth branch node belongs to the root node, and obtain the question answer data; a creation submodule, used to create a third leaf node in the preset question-answer knowledge tree according to the management path, wherein the third leaf node is a child node of the last branch node in the management path; and a recording submodule, used to record the question data to be answered as historical question data and the question answer data as historical answer data in the third leaf node.
[0184] As an optional embodiment, the matching module includes: a second sorting unit, used to sort at least one first leaf node according to a pre-selected priority order to obtain a leaf node sequence; a judgment unit, used to sequentially judge whether each first leaf node in the leaf node sequence is a target leaf node matching the data of the question to be answered, according to the priority from high to low; and an update unit, used to increment the priority parameter of the first leaf node by 1 if the first leaf node is a target leaf node, wherein the magnitude of the priority parameter is positively correlated with the priority level.
[0185] As an optional embodiment, the device further includes: an acquisition submodule, configured to acquire multiple sample question-and-answer data before determining the management path matching the management information among multiple knowledge nodes in a preset question-and-answer knowledge tree, wherein the sample question-and-answer data includes: sample questions and sample answers, the sample questions at least include: sample management information and sample question data, and the sample management information at least includes: a multi-level management grid for managing sample questions; and a setting submodule, configured to set corresponding branch nodes in the preset question-and-answer knowledge tree according to the management grid in the sample management information, and set a corresponding fourth leaf node for each sample question-and-answer data, wherein the parent-child relationship between branch nodes is determined according to the multi-level management grid recorded in the same sample management information, and the parent-child relationship between the branch node and the fourth leaf node is... Based on the attribution relationship between sample management information and sample question-and-answer data, each fourth leaf node is configured with corresponding sample question data and sample answer data from the sample question-and-answer data. The third determination submodule is used to determine multiple leaf node sets among multiple fourth leaf nodes in the preset question-and-answer knowledge tree, wherein at least one fourth leaf node in each leaf node set is a child node of the same branch node. The merging submodule is used to merge at least one fourth leaf node in the same leaf node set according to the semantic relevance of the sample question data to obtain a preset leaf node, wherein the historical question data in the preset leaf node is the merging result of sample question data with semantic relevance greater than a preset threshold, and the historical answer data is the merging result of sample answer data corresponding to the sample question data.
[0186] Embodiments of the present invention can provide an electronic device, which can be a computer terminal, and the computer terminal can be any one of a group of computer terminal devices. Optionally, in this embodiment, the computer terminal can also be replaced by a mobile terminal or other terminal device.
[0187] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0188] In this embodiment, the computer terminal described above can execute the program code for the following steps in the question answering method: obtaining the question to be answered, wherein the question to be answered includes at least: management information and question data to be answered, and the management information includes at least: a multi-level management grid for managing the question to be answered; determining a management path matching the management information among multiple knowledge nodes in a preset question-and-answer knowledge tree, wherein the knowledge nodes include: branch nodes and preset leaf nodes, each branch node represents a corresponding management grid, each preset leaf node is pre-configured with historical question data and corresponding historical answer data, and the management path includes: multiple branch nodes arranged in order of management grid level, and adjacent branch nodes in the management path have a parent-child relationship; filtering target leaf nodes matching the question data to be answered in at least one first leaf node, wherein the first leaf node is a preset leaf node connected to the branch node in the management path, and the historical question data in the target leaf node matches the question data to be answered; determining the historical answer data in the target leaf node as the question answer data for the question to be answered.
[0189] Figure 8 This is a structural block diagram of a computer terminal according to an embodiment of the present invention, such as... Figure 8 As shown, the computer terminal 70 may include one or more (only one is shown in the figure) processors 82 and memory 84.
[0190] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the question-answering method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned question-answering method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal 80 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0191] The processor can invoke information and applications stored in memory via a transmission device to perform the following steps: acquiring a question to be answered, wherein the question to be answered includes at least: management information and question data to be answered, and the management information includes at least: a multi-level management grid for managing the question to be answered; determining a management path matching the management information among multiple knowledge nodes in a preset question-and-answer knowledge tree, wherein the knowledge nodes include: branch nodes and preset leaf nodes, each branch node representing a corresponding management grid, each preset leaf node pre-configured with historical question data and corresponding historical answer data, and the management path including: multiple branch nodes arranged in order of management grid level, and adjacent branch nodes in the management path having a parent-child relationship; filtering target leaf nodes matching the question data to be answered in at least one first leaf node, wherein the first leaf node is a preset leaf node connected to a branch node in the management path, and the historical question data in the target leaf node matches the question data to be answered; determining the historical answer data in the target leaf node as the question answer data for the question to be answered.
[0192] Optionally, the processor may also execute program code for the following steps: sorting the multi-level management grids in the management information in descending order of level to obtain a management grid sequence, wherein the management grid sequence includes at least: a first management grid and a second management grid, the first management grid being at a higher level than the second management grid; determining a first target node matching the first management grid in at least one first branch node of a preset question-and-answer knowledge tree, wherein the first branch node is connected to a pre-selected node in the preset question-and-answer knowledge tree, the pre-selected node including at least: the root node of the preset question-and-answer knowledge tree; determining a second target node matching the second management grid in at least one second branch node of the preset question-and-answer knowledge tree, wherein the second branch node is a child node of the first target node; and generating a management path based on the first target node and the second target node.
[0193] Optionally, the processor may also execute program code that performs the following steps: calculates the semantic relevance between the pre-configured historical question data and the question data to be answered in each first leaf node; and identifies the first leaf node whose semantic relevance is greater than a preset relevance threshold as the target leaf node.
[0194] Optionally, the processor may also execute program code with the following steps: if no target leaf node matching the question data to be answered exists in at least one first leaf node, determine the last branch node in the management path as the third branch node; among multiple branch nodes in the management path, determine the parent node of the third branch node as the fourth branch node; recursively query at least one second leaf node of the fourth branch node in the preset question-answering knowledge tree, wherein the recursive query process includes: traversing all descendant nodes of the fourth branch node and taking the preset leaf node among the descendant nodes as the second leaf node; in at least one second leaf node, filter the target leaf node matching the question data to be answered, wherein the historical question data in the target leaf node matches the question data to be answered.
[0195] Optionally, the processor may also execute program code that performs the following steps: if there is no target leaf node matching the question data in at least one second leaf node, detect whether the fourth branch node belongs to the root node of the preset question-answering knowledge tree; if the fourth branch node does not belong to the root node, use the fourth branch node as the third branch node, and recursively query the new second leaf node based on the updated third branch node.
[0196] Optionally, the processor may also execute program code with the following steps: when the fourth branch node is the root node, analyze the question data to be answered using a pre-set large language model to obtain the question answer data; based on the management path, create a new third leaf node in the preset question-answer knowledge tree, wherein the third leaf node is a child node of the last branch node in the management path; record the question data to be answered as historical question data and the question answer data as historical answer data in the third leaf node.
[0197] Optionally, the processor may also execute program code that performs the following steps: sorting at least one first leaf node according to a pre-selected priority order to obtain a leaf node sequence; determining, in descending order of priority, whether each first leaf node in the leaf node sequence is a target leaf node matching the data of the question to be answered; and, if the first leaf node is a target leaf node, incrementing the priority parameter of the first leaf node by 1, wherein the magnitude of the priority parameter is positively correlated with the priority level.
[0198] Optionally, the processor may also execute program code for the following steps: acquiring multiple sample question-and-answer data, wherein the sample question-and-answer data includes: sample questions and sample answers, the sample questions at least include: sample management information and sample question data, the sample management information at least includes: a multi-level management grid for managing sample questions; in a preset question-and-answer knowledge tree, setting corresponding branching nodes according to the management grid in the sample management information, and setting a corresponding fourth leaf node for each sample question-and-answer data, wherein the parent-child relationship between branching nodes is determined according to the multi-level management grid recorded in the same sample management information, and the parent-child relationship between a branching node and the fourth leaf node is determined according to the sample management information and the sample question... The hierarchical relationships between the answer data are determined, and each fourth leaf node is configured with sample question data and sample answer data from the corresponding sample question and answer data. In the multiple fourth leaf nodes of the preset question and answer knowledge tree, multiple leaf node sets are determined, wherein at least one fourth leaf node in each leaf node set is a child node of the same branch node. At least one fourth leaf node in the same leaf node set is merged according to the semantic relevance of the sample question data to obtain the preset leaf node. The historical question data in the preset leaf node is the result of merging sample question data with semantic relevance greater than a preset threshold, and the historical answer data is the result of merging sample answer data corresponding to the sample question data.
[0199] Those skilled in the art will understand that Figure 8 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 8 This does not limit the structure of the aforementioned electronic device. For example, computer terminal 80 may also include components that are more... Figure 8 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 8 The different configurations shown.
[0200] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a computer program instructing the hardware related to the terminal device. The computer program can be stored in a non-volatile medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.
[0201] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the aforementioned non-volatile storage medium can be used to store the program code executed by the problem-solving method provided in the above embodiments.
[0202] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0203] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining questions to be answered, wherein the questions to be answered include at least: management information and question data to be answered, and the management information includes at least: a multi-level management grid for managing the questions to be answered; determining a management path matching the management information among multiple knowledge nodes of a preset question-and-answer knowledge tree, wherein the knowledge nodes include: branch nodes and preset leaf nodes, each branch node representing a corresponding management grid, each preset leaf node being pre-configured with historical question data and corresponding historical answer data, and the management path including: multiple branch nodes arranged in order of management grid level, and adjacent branch nodes in the management path having a parent-child relationship; filtering target leaf nodes matching the question data to be answered in at least one first leaf node, wherein the first leaf node is a preset leaf node connected to a branch node in the management path, and the historical question data in the target leaf node matches the question data to be answered; determining the historical answer data in the target leaf node as the question answer data for the questions to be answered.
[0204] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: sorting the multi-level management grids in the management information in descending order of level to obtain a management grid sequence, wherein the management grid sequence includes at least: a first management grid and a second management grid, the first management grid being at a higher level than the second management grid; determining a first target node matching the first management grid in at least one first branch node of a preset question-and-answer knowledge tree, wherein the first branch node is connected to a pre-selected node in the preset question-and-answer knowledge tree, the pre-selected node including at least: the root node of the preset question-and-answer knowledge tree; determining a second target node matching the second management grid in at least one second branch node of the preset question-and-answer knowledge tree, wherein the second branch node is a child node of the first target node; and generating a management path based on the first target node and the second target node.
[0205] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: calculating the semantic relevance between pre-configured historical question data and unanswered question data in each first leaf node; and determining the first leaf node whose semantic relevance is greater than a preset relevance threshold as the target leaf node.
[0206] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: if no target leaf node matching the question data to be answered exists in at least one first leaf node, determine the last branch node in the management path as the third branch node; among the multiple branch nodes in the management path, determine the parent node of the third branch node as the fourth branch node; recursively query at least one second leaf node of the fourth branch node in the preset question-answering knowledge tree, wherein the recursive query process includes: traversing all descendant nodes of the fourth branch node and taking the preset leaf node among the descendant nodes as the second leaf node; in at least one second leaf node, filter the target leaf node matching the question data to be answered, wherein the historical question data in the target leaf node matches the question data to be answered.
[0207] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: if there is no target leaf node matching the question data in at least one second leaf node, detect whether the fourth branch node belongs to the root node of the preset question-answering knowledge tree; if the fourth branch node does not belong to the root node, use the fourth branch node as the third branch node, and recursively query the new second leaf node based on the updated third branch node.
[0208] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: when the fourth branch node belongs to the root node, the question data to be answered is analyzed using a pre-set large language model to obtain question answer data; according to the management path, a third leaf node is created in the preset question-answer knowledge tree, wherein the third leaf node is a child node of the last branch node in the management path; the question data to be answered is recorded as historical question data, and the question answer data is recorded as historical answer data in the third leaf node.
[0209] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: sorting at least one first leaf node according to a pre-selected priority order to obtain a leaf node sequence; determining, in descending order of priority, whether each first leaf node in the leaf node sequence is a target leaf node matching the data of the question to be answered; if the first leaf node is a target leaf node, incrementing the priority parameter of the first leaf node by 1, wherein the magnitude of the priority parameter is positively correlated with the priority level.
[0210] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: acquiring multiple sample question-and-answer data, wherein the sample question-and-answer data includes: sample questions and sample answer data, the sample questions include at least: sample management information and sample question data, the sample management information includes at least: a multi-level management grid for managing sample questions; in a preset question-and-answer knowledge tree, setting corresponding branching nodes according to the management grid in the sample management information, and setting a corresponding fourth leaf node for each sample question-and-answer data, wherein the parent-child relationship between branching nodes is determined according to the multi-level management grid recorded in the same sample management information, and the parent-child relationship between branching nodes and the fourth leaf node is determined according to the sample... The attribution relationship between management information and sample question-and-answer data is determined. Each fourth leaf node is configured with sample question data and sample answer data from the corresponding sample question-and-answer data. In the multiple fourth leaf nodes of the preset question-and-answer knowledge tree, multiple leaf node sets are determined, wherein at least one fourth leaf node in each leaf node set is a child node of the same branch node. At least one fourth leaf node in the same leaf node set is merged according to the semantic relevance of the sample question data to obtain a preset leaf node. The historical question data in the preset leaf node is the result of merging sample question data with semantic relevance greater than a preset threshold, and the historical answer data is the result of merging the sample answer data corresponding to the sample question data.
[0211] Embodiments of the present invention also provide a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it implements the steps of the problem-solving method provided in the above embodiments.
[0212] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0213] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0214] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0215] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0216] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0217] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0218] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for answering a question, characterized in that, include: Obtaining questions to be answered, wherein the questions to be answered include at least: management information and question data to be answered, and the management information includes at least: a multi-level management grid for managing the questions to be answered; In a pre-defined question-and-answer knowledge tree, a management path matching the management information is determined from multiple knowledge nodes. The knowledge nodes include branch nodes and pre-defined leaf nodes. Each branch node represents a corresponding management grid. Each pre-defined leaf node is pre-configured with historical question data and corresponding historical answer data. The management path includes multiple branch nodes arranged in order of the management grid level, and adjacent branch nodes in the management path have a parent-child relationship. In at least one first leaf node, a target leaf node matching the data of the question to be answered is selected, wherein the first leaf node is the preset leaf node connected to the branch node in the management path, and the historical question data in the target leaf node matches the data of the question to be answered; The historical response data in the target leaf node is determined as the question response data for the question to be answered.
2. The method according to claim 1, characterized in that, Among multiple knowledge nodes in a pre-defined question-and-answer knowledge tree, the management path for matching the management information includes: The multi-level management grids in the management information are sorted in descending order of level to obtain a management grid sequence, wherein the management grid sequence includes at least: a first management grid and a second management grid, wherein the first management grid is at a higher level than the second management grid; In at least one first branch node of the preset question-and-answer knowledge tree, a first target node matching the first management grid is determined, wherein the first branch node is connected to a pre-selected node in the preset question-and-answer knowledge tree, and the pre-selected node includes at least the root node of the preset question-and-answer knowledge tree. In at least one second branch node of the preset question-and-answer knowledge tree, a second target node matching the second management grid is determined, wherein the second branch node is a child node of the first target node; The management path is generated based on the first target node and the second target node.
3. The method according to claim 1, characterized in that, In at least one first leaf node, the target leaf nodes for filtering the data matching the question to be answered include: Calculate the semantic relevance between the pre-configured historical question data and the question data to be answered in each of the first leaf nodes; The first leaf node whose semantic relevance is greater than a preset relevance threshold is determined as the target leaf node.
4. The method according to claim 1, characterized in that, The method further includes: If, in at least one of the first leaf nodes, there is no target leaf node matching the data of the question to be answered, the last branch node in the management path is determined to be the third branch node. Among the multiple branch nodes in the management path, the parent node of the third branch node is determined to be the fourth branch node; In the preset question-and-answer knowledge tree, at least one second leaf node of the fourth branch node is recursively queried, wherein the recursive query process includes: traversing all descendant nodes of the fourth branch node, and taking the preset leaf node among the descendant nodes as the second leaf node; In at least one of the second leaf nodes, target leaf nodes that match the data of the questions to be answered are selected, wherein the historical question data in the target leaf nodes matches the data of the questions to be answered.
5. The method according to claim 4, characterized in that, The method further includes: If, in at least one of the second leaf nodes, there is no target leaf node matching the question data to be answered, it is detected whether the fourth branch node belongs to the root node of the preset question-answering knowledge tree. If the fourth branch node does not belong to the root node, the fourth branch node is taken as the third branch node, and based on the updated third branch node, the new second leaf node is recursively queried.
6. The method according to claim 5, characterized in that, The method further includes: If the fourth branch node belongs to the root node, the question data to be answered is analyzed using a pre-set large language model to obtain the question answer data; Based on the management path, a third leaf node is created in the preset question-and-answer knowledge tree, wherein the third leaf node is a child node of the last branch node in the management path; The unanswered question data is recorded as the historical question data, and the question answer data is recorded as the historical answer data in the third leaf node.
7. The method according to claim 1, characterized in that, In at least one of the first leaf nodes, the target leaf nodes for filtering the data matching the question to be answered include: At least one of the first leaf nodes is sorted according to a pre-selected priority order to obtain a leaf node sequence; In accordance with the order of priority from high to low, determine in turn whether each of the first leaf nodes in the leaf node sequence is the target leaf node that matches the data of the question to be answered; If the first leaf node is the target leaf node, the priority parameter of the first leaf node is incremented by 1, wherein the magnitude of the priority parameter is positively correlated with the priority level.
8. The method according to claim 1, characterized in that, Before determining the management path matching the management information among multiple knowledge nodes in a preset question-and-answer knowledge tree, the method further includes: Multiple sample question-and-answer data are acquired, wherein the sample question-and-answer data includes: sample questions and sample answer data, the sample questions include at least: sample management information and sample question data, and the sample management information includes at least: the multi-level management grid for managing the sample questions; In the preset question-and-answer knowledge tree, the corresponding branch nodes are set according to the management grid in the sample management information, and a corresponding fourth leaf node is set for each sample question-and-answer data. The parent-child relationship between the branch nodes is determined according to the multi-level management grid recorded in the same sample management information. The parent-child relationship between the branch node and the fourth leaf node is determined according to the affiliation relationship between the sample management information and the sample question-and-answer data. Each fourth leaf node is configured with the corresponding sample question data and sample answer data in the sample question-and-answer data. In the multiple fourth leaf nodes of the preset question-and-answer knowledge tree, multiple leaf node sets are determined, wherein at least one fourth leaf node in each leaf node set is a child node of the same branch node; At least one fourth leaf node in the same set of leaf nodes is merged according to the semantic relevance of the sample question data to obtain the preset leaf node, wherein the historical question data in the preset leaf node is the result of merging sample question data whose semantic relevance is greater than a preset threshold, and the historical response data is the result of merging sample response data corresponding to the sample question data.
9. A device for answering a question, characterized in that, include: The acquisition module is used to acquire questions to be answered, wherein the questions to be answered include at least: management information and question data to be answered, and the management information includes at least: a multi-level management grid for managing the questions to be answered; The first determining module is used to determine the management path matching the management information among multiple knowledge nodes of a preset question-and-answer knowledge tree. The knowledge nodes include: branch nodes and preset leaf nodes. Each branch node represents the corresponding management grid. Each preset leaf node is pre-configured with historical question data and corresponding historical answer data. The management path includes: multiple branch nodes arranged in the order of the management grid level, and adjacent branch nodes in the management path have a parent-child relationship. The matching module is used to filter target leaf nodes that match the question data to be answered in at least one first leaf node, wherein the first leaf node is the preset leaf node connected to the branch node in the management path, and the historical question data in the target leaf node matches the question data to be answered; The second determining module is used to determine the historical response data in the target leaf node as the question response data for the question to be answered.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute, through the computer program, a method for answering the problem according to any one of claims 1 to 8.
11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method for answering the problem according to any one of claims 1 to 8.
Citation Information
Cited By
Knowledge system construction method based on multi-source teaching materials
CN121681846A