Query request processing method and device, equipment and medium
By analyzing and optimizing user query problems in the question-and-answer system, the problem of precise matching difficulties caused by complex or vague problem structure is solved, and the accuracy and user experience of the query are improved.
Patent Information
- Application Number
- CN202510239038.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-20
AI Technical Summary
In a knowledge base-based question-and-answer system, the problem structure raised by users is complex or vague, making it difficult for the system to achieve accurate matching through standard search methods.
Provides a query request processing method, which optimizes query problems by receiving query requests, analyzing query problems, determining whether optimization is needed, and selecting appropriate optimization strategies, such as splitting, rewriting or completing query problems.
By optimizing query problems, the quality of query problems is significantly improved, the error caused by language ambiguity and ambiguity is reduced, and the accuracy and user experience of subsequent queries are improved.
Smart Images

Figure CN120179775A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a method, apparatus, device, and medium for processing query requests. Background Art
[0002] In the design and implementation of a question-and-answer system based on a knowledge base, one of the main challenges in processing user queries is the complex variability of natural language. Users seek information by inputting query questions. However, due to the diversity of expression methods, even for the same question, different users may ask it using different wordings and structures. In addition, some questions may be ambiguously expressed or have a complex structure, making it difficult to achieve an ideal matching effect and retrieval accuracy directly using standard search methods.
[0003] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present disclosure, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0004] The present disclosure provides a method, apparatus, device, and medium for processing query requests, which at least to some extent solves the problem in the related art that it is difficult for the system to directly achieve an exact match through standard search methods due to the complex or ambiguous structure of the questions raised by users.
[0005] Other features and advantages of the present disclosure will become apparent through the following detailed description, or will be learned in part through the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, there is provided a method for processing a query request, including:
[0007] Receiving a query request, where the query request includes a query question;
[0008] Analyzing the query question and determining whether the query question needs to be optimized according to the analysis result;
[0009] Determining that the query question needs to be optimized, and selecting one or more optimization strategies from query question splitting, query question rewriting, and query question completion according to the analysis result;
[0010] Applying the selected optimization strategy to optimize the query question;
[0011] Querying in the question-and-answer system using the optimized query question to obtain a query result.
[0012] In one embodiment of the present disclosure, if it is determined according to the analysis result that the query problem contains multiple sub-problems or involves the comparison of several things, the selected optimization strategy includes query problem splitting, which is used to split the query problem into multiple sub-problems for querying or split the query problem into queries for each object.
[0013] In one embodiment of the present disclosure, if it is determined according to the analysis result that the query problem contains multiple sub-problems and the query results of multiple sub-problems can be obtained through one query in the question-answering system, the query problem is not split.
[0014] In one embodiment of the present disclosure, the optimization strategy of query problem completion is applied to optimize the query problem, including:
[0015] Based on the personal information of the user sending the query request and the user's historical questions, context enhancement and completion are performed on the query problem.
[0016] In one embodiment of the present disclosure, based on the personal information of the user sending the query request and the user's historical questions, context enhancement and completion are performed on the query problem, including:
[0017] In the personal information of the user and the user's historical questions, match the technical field and relevant information corresponding to the query problem;
[0018] Based on the technical field and relevant information, the query problem is completed.
[0019] In one embodiment of the present disclosure, the optimization strategy of query problem rewriting is applied to optimize the query problem, including:
[0020] Based on the basic principles involved in the query problem, the query problem is converted into a problem involving relevant concepts or principles.
[0021] In one embodiment of the present disclosure, the optimization strategy of query problem rewriting is applied to optimize the query problem, including:
[0022] Based on the basic principles involved in the query problem, the query problem is converted into a problem involving relevant concepts or principles;
[0023] Calculate the semantic similarity between the converted problem and the original query problem;
[0024] If the semantic similarity is lower than the preset threshold, the query problem is re-optimized until the semantic similarity is not lower than the preset threshold.
[0025] According to another aspect of the present disclosure, a query request processing device is provided, including:
[0026] A request receiving module, configured to receive a query request, where the query request includes a query question;
[0027] A problem analysis module, configured to analyze the query question and determine whether it is necessary to optimize the query question according to the analysis result;
[0028] A strategy determination module, configured to determine that it is necessary to optimize the query question and select one or more optimization strategies from query question splitting, query question rewriting, and query question completion according to the analysis result;
[0029] A problem optimization module, configured to apply the selected optimization strategy to optimize the query question;
[0030] A problem query module, configured to query in the question-answering system by applying the optimized query question to obtain a query result.
[0031] According to another aspect of the present disclosure, there is provided an electronic device, including: a memory, configured to store instructions; a processor, configured to call the instructions stored in the memory to implement the above-mentioned query request processing method.
[0032] According to another aspect of the present disclosure, there is provided a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the above-mentioned query request processing method is implemented.
[0033] According to another aspect of the present disclosure, there is provided a computer program product, where the computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the above-mentioned query request processing method.
[0034] According to another aspect of the present disclosure, there is provided a chip, including at least one processor and an interface;
[0035] The interface is configured to provide program instructions or data for at least one processor;
[0036] At least one processor is configured to execute program instructions to implement the above-mentioned query request processing method.
[0037] The query request processing method, apparatus, device, and medium provided by the embodiments of the present disclosure perform a preliminary analysis on the query problem. Based on the results of the preliminary analysis, it determines whether the query problem needs to be optimized and decides which optimization strategy to adopt, enhancing flexibility and adaptability, enabling it to handle various types of user queries, and taking the most appropriate processing method according to the specific situation, enhancing the adaptability of the system; by analyzing and optimizing the query problem using the selected optimization strategy, the quality of the query problem is significantly improved, the errors caused by language polysemy and ambiguity are reduced, and the accuracy of subsequent queries is improved; the optimized query can better reflect the actual needs of users, helps to provide more expected answers, and improves the user experience. In addition, by optimizing the query problem, users can find relevant answers in a shorter time, improving the overall work efficiency.
[0038] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.
[0040] Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0041] Figure 1 Show a flowchart of a query request processing method in an embodiment of the present disclosure;
[0042] Figure 2 Show a flowchart of optimizing a query problem in an embodiment of the present disclosure;
[0043] Figure 3 Show a flowchart of another method for optimizing a query problem in an embodiment of the present disclosure;
[0044] Figure 4 Show a flowchart of another query request processing method in an embodiment of the present disclosure;
[0045] Figure 5 Show a schematic diagram of a query request processing apparatus in an embodiment of the present disclosure;
[0046] Figure 6 Show a structural block diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only some, rather than all, of the embodiments of the present disclosure. Components of the embodiments of the present disclosure generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Therefore, the detailed description of the embodiments of the present disclosure provided in the figures is not intended to limit the scope of the present disclosure claimed, but merely represents selected embodiments of the present disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative efforts fall within the scope of protection of the present disclosure.
[0048] In a knowledge base-based question answering system, when a user inputs a query question, the system needs to search for relevant documents in the knowledge base for these questions and extract corresponding answers. However, due to the complex variability of natural language, the questions raised by users may have complex structures or be ambiguous, making it difficult for the system to directly achieve an exact match through standard search methods. In addition, current query question optimization techniques are usually only applicable to a single type of query and lack the adaptive optimization ability for different question characteristics.
[0049] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0050] In some embodiments, when receiving a query request, a prompt message may be sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of the present disclosure according to the prompt message.
[0051] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving a query request may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry selection controls for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0052] It can be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not constitute a limitation on the implementation manner of the present disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0053] Meanwhile, it can be understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of data) should comply with the requirements of corresponding laws, regulations and related provisions.
[0054] The message transmission method of the embodiments of the present disclosure can be applied to an electronic device. The execution subject of the query request processing method can be at least one of user terminals such as mobile phones, tablet computers, wearable devices, etc. that can be configured to execute the query request processing method provided by the embodiments of the present disclosure. Alternatively, the execution subject of this method can also be the client itself that can execute this method.
[0055] The following will describe this exemplary embodiment in detail with reference to the accompanying drawings and embodiments.
[0056] Figure 1 The flowchart of a query request processing method in the embodiments of the present disclosure is shown. As Figure 1 shown, the query request processing method provided in the embodiments of the present disclosure includes S101 - S105.
[0057] In S101, a query request is received, and the query request includes a query problem.
[0058] In S102, the query problem is analyzed, and it is determined whether the query problem needs to be optimized according to the analysis result.
[0059] In some embodiments, natural language processing (NLP) technology can be applied to perform syntactic and semantic analysis on the query problem, such as part - of - speech tagging, named entity recognition, syntactic analysis, etc.
[0060] In some embodiments, a pre - trained machine learning model can be applied to identify the user's query intent and determine whether the query problem is clear and complete.
[0061] In some embodiments, after applying natural language processing (NLP) technology and a pre - trained machine learning model to the query problem, the complexity and ambiguity of the query problem are evaluated to decide whether further optimization is needed.
[0062] In S103, it is determined that the query problem needs to be optimized, and one or more optimization strategies are selected from query problem splitting, query problem rewriting, and query problem completion according to the analysis result.
[0063] In some embodiments, the analysis result can include syntactic structure analysis, semantic analysis, ambiguity and clarity evaluation.
[0064] In S104, the selected optimization strategy is applied to optimize the query problem.
[0065] The optimized query problem has a simpler structure and more precise semantics compared to the original query problem.
[0066] In S105, the optimized query problem is applied to query in the question-answering system to obtain a query result.
[0067] It should be noted that the data stored in the question-answering system includes internal data, and the internal data is not publicly disclosed. In this embodiment of the present disclosure, the query problem is optimized to improve the query process and enhance the query efficiency.
[0068] In this embodiment of the present disclosure, the selected optimization strategy is applied to analyze and optimize the query problem, significantly improving the quality of the query problem, reducing the errors caused by language polysemy and ambiguity, and enhancing the accuracy of subsequent queries; the optimized query can better reflect the actual needs of users, helping to provide more expected answers and improving the user experience. In addition, by optimizing the query problem, users can find relevant answers in a shorter time, improving the overall work efficiency.
[0069] Different query problems can have different optimization strategies. This embodiment of the present disclosure mainly considers three optimization methods, namely query problem splitting, query problem rewriting, and query problem completion. In some embodiments, in S102 - S103, after receiving the user's query problem, the appropriate optimization strategy is selected according to the characteristics of the query sentence, which can be implemented through a large language model. Compared with training a dedicated classification model for strategy selection (requiring a large amount of data and having poor transferability), this embodiment of the present disclosure utilizes the context learning ability of the large model and uses an appropriate prompt to enable the large model to flexibly select the appropriate optimization method according to the query characteristics. As an example, the specific prompt is as follows:
[0070] "You are an expert in classifying query problems. Please return the option number most relevant to the problem '{query}' according to the following option descriptions:
[0071] Option 1: The sentence is clearly expressed and there is only one core problem in the sentence.
[0072] - Example: How to calculate the monthly salary days standard?
[0073] Option 2: The sentence describes a complex plot or scenario and is not suitable for directly querying using the original problem. The query problem needs to be rewritten before querying.
[0074] - Example: Zhang was unemployed in March 2018 and applied for unemployment insurance benefits for 15 months. He took temporary work for 3 months from June 2018 and paid unemployment insurance. The unemployment insurance agency stopped paying Zhang's unemployment insurance benefits from June. Can Zhang continue to receive unemployment insurance benefits after being unemployed again 3 months later?
[0075] Option 3: The sentence contains multiple sub-questions and needs to be split into multiple sub-questions for querying, or the sentence involves comparing several things and each object needs to be queried separately first.
[0076] - Example: What is a non-leadership position? What specific positions does it include?
[0077] Option 4: The sentence is short and broad, and may be just a keyword. It needs to be expressed as a complete description according to the context or other supplementary information.
[0078] - Example: Job responsibilities?
[0079] Question: {query}
[0080] Please think step by step and return the number of this question.
[0081] In some embodiments, if the query question is clearly expressed and does not need to be optimized, the question is directly retrieved. Example of a simple question: What is an in-house trainer?
[0082] In some embodiments, an optimization strategy for query question rewriting is applied to optimize the query question, including: based on the basic principles involved in the query question, converting the query question into a question involving related concepts or principles.
[0083] Many complex questions queried by users contain a large amount of detailed information. If the original question is directly used for retrieval, it is often difficult to retrieve relevant information. Therefore, the embodiments of the present disclosure propose a rewriting method based on the principle-guided method, which emphasizes guiding the model to think back to the basic principles involved in the question, that is, converting a specific question into a question involving high-level concepts or principles. As an example, the principle-guided method prompt is as follows:
[0084] "You are an expert with extensive knowledge. Your task is to think from the perspective of the principles involved in the question and rewrite the question into a more general and high-level question for easier answering. The following are some examples:
[0085] Original question: <Original question example 1>
[0086] Rewritten question: <High-level question example 1>
[0087] Original question: <Original question example 2>
[0088] Rewritten question: <High-level question example 2>
[0089] Original question: <Original question>
[0090] Rewritten question"
[0091] Through the above rewriting, the model can focus on the concepts and principles related to the problem, ignore unnecessary details, and thus more effectively infer the answer. This abstraction of the problem simplifies the handling of complex details, makes the reasoning process clearer and more direct, and thus improves the accuracy of the answer.
[0092] As an example, the original complex problem: After Zhang lost his job in March 2023, he applied for unemployment insurance benefits and could receive 15 months of unemployment insurance benefits. Since June 2023, he has taken up temporary work for 3 months and paid unemployment insurance. The unemployment insurance agency stopped paying Zhang's unemployment insurance benefits since June. If Zhang loses his job again after 3 months, can he continue to receive unemployment insurance benefits?
[0093] The rewritten problem: During the period of receiving unemployment insurance benefits, if an individual takes up temporary work and pays unemployment insurance while receiving unemployment insurance benefits, can they continue to receive the remaining unemployment insurance benefits if they become unemployed again?
[0094] In some embodiments, such as Figure 2 shown, an optimization strategy for query problem rewriting is applied to optimize the query problem, including S201 - S203.
[0095] In S201, based on the basic principles involved in the query problem, the query problem is converted into a problem involving relevant concepts or principles;
[0096] In S202, the semantic similarity between the converted problem and the original query problem is calculated;
[0097] In S203, if the semantic similarity is lower than the preset threshold, the query problem is re - optimized until the semantic similarity is not lower than the preset threshold.
[0098] Affected by large model hallucinations, instruction complexity, etc., the query problems rewritten by the large model may also deviate from the original problem and generate some irrelevant content. Therefore, before using the query problems optimized by the large model, it is necessary to first evaluate the quality of the query problems. The specific method is to calculate the semantic similarity between the original query and the optimized query. If it is higher than the threshold, the optimized query problem is considered usable.
[0099] If the optimized problem fails the quality assessment of the above steps, it is considered that there may be a problem with this query and it needs to be further optimized. Provide the original query, the corresponding optimization strategy of the original query, and the optimized query to the large model, so that the large model can edit the optimization result again to generate a higher - quality query. Then repeat the quality assessment until the optimized query problem passes the quality inspection.
[0100] In some embodiments, if it is determined according to the analysis result that the query problem contains multiple sub-problems or involves the comparison of several things, the selected optimization strategy includes query problem splitting, which is used to split the query problem into multiple sub-problems for querying or split the query problem into queries for each object.
[0101] In some embodiments, if it is determined according to the analysis result that the query problem contains multiple sub-problems and it is possible to obtain the query results of multiple sub-problems through a single query in the question-answering system, then the query problem is not split.
[0102] As an example, if the query problem contains multiple sub-problems and needs to be split into multiple sub-problems for querying, or the sentence involves the comparison of several things and needs to query each object separately. Relying directly on the large model to judge whether splitting is needed may have errors, because in the knowledge base question-answering system, whether a complex problem needs to be split is closely related to the data organization method. For example, if a certain data segment in the knowledge base contains both the job responsibilities and salary information of a position, even if the original query problem is "What are the job responsibilities of the human resources position? What is the salary?" a query containing 2 questions like this can be solved through a single query without the need for splitting.
[0103] When the large model only relies on the literal meaning of the sentence without considering the data organization structure, it may unnecessarily split the problem, thereby affecting the query efficiency and the coherence of the answer. Therefore, for problems that the large model determines need to be split, first verify through the data perception check module. This module is responsible for analyzing the matching degree between the user query and the metadata or data summary information of the data stored in the knowledge base, and judging whether it can be solved through a single query. If the stored data segment can meet all query requirements (for example, job responsibilities and salary exist in a single data segment at the same time), then directly execute a single query and skip the splitting step; if it cannot be solved through a single query, then continue with the problem optimization process.
[0104] As an example, the original compound problem: What are the main responsibilities and main processes of the human resources department during the introduction of mature talents through social recruitment?
[0105] After analysis by the data perception check module, this problem cannot be solved through a single query and needs to be split.
[0106] The split problems:
[0107] 1. What are the main responsibilities of the human resources department during the introduction of mature talents through social recruitment?
[0108] 2. What are the main processes of the human resources department during the introduction of mature talents through social recruitment?
[0109] In some embodiments, an optimization strategy for query question completion is applied to optimize the query question, including: enhancing and completing the context of the query question based on the personal information of the user sending the query request and the user's historical questions.
[0110] In some embodiments, as Figure 3 shown, enhancing and completing the context of the query question based on the personal information of the user sending the query request and the user's historical questions includes S301 - S302.
[0111] In S301, in the user's personal information and historical questions, match the technical field and relevant information corresponding to the query question;
[0112] In S302, complete the query question based on the technical field and relevant information.
[0113] The question queried by the user may be very short and ambiguous, often just a single keyword, such as: job responsibilities. If the original question is directly used for retrieval, the retrieval effect may be poor due to the original question being too broad. Therefore, this proposal presents a method for completing ambiguous questions based on the user's personal information and historical questions. Specifically as follows:
[0114] First, build a knowledge base of the user's personal information and historical questions.
[0115] Collect the user's historical query records and personal information, such as age, gender, position, etc. Extract key entities from the historical queries through entity recognition technology and combine them with the personal information to form an entity - centered user knowledge base. This knowledge base records the user's personal information, interest fields, frequently queried content, and query time information, providing a basis for personalized question completion.
[0116] Second, enhance and complete the context of the ambiguous question based on the user's personal knowledge base.
[0117] When the user enters an ambiguous or incomplete question, the system matches the question with the entities in the user knowledge base. Based on these matched relevant entities and personal background, the system supplements the missing key information in the question to generate a more complete and personalized query, ensuring that the query results can accurately reflect the user's intention and needs.
[0118] As an example, the original query question: job responsibilities.
[0119] Optimized and completed query: What are the job responsibilities of a human resources training specialist?
[0120] Figure 4 Shows the overall flowchart of the query request processing method according to the embodiments of the present disclosure, as Figure 4As shown, the query problem optimization framework of the present disclosure includes key steps such as optimization strategy selection - problem optimization - quality assessment - re - optimization, etc. Especially in the problem rewriting optimization link, the present disclosure adopts an innovative optimization method based on retrieval results. This method guides the rewriting of query problems by analyzing the content of retrieved documents, thereby effectively improving the relevance and accuracy of the rewritten problems.
[0121] It should be noted that Figure 4 The rewriting strategy in [description] is the "query problem rewriting" optimization strategy mentioned above, the complementing strategy is the "query problem complementing" optimization strategy mentioned above, and the splitting strategy is the "query problem splitting" optimization strategy mentioned above. Through the refined problem rewriting optimization in the embodiments of the present disclosure, the solutions of the present disclosure significantly improve the system's ability to handle complex query problems, especially the accuracy and efficiency in the face of multi - variable or multi - level information.
[0122] The optimized query problems are closer to high - quality documents in the knowledge base, enabling the system to provide more accurate and relevant answers, thereby improving user satisfaction and the system's reliability.
[0123] In the embodiments of the present disclosure, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0124] The term "and / or" in the present disclosure is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, the character " / " in this article generally represents an "or" relationship between the preceding and following associated objects.
[0125] Furthermore, although the steps of the methods in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be executed in that specific order, or that all the steps shown must be executed to achieve the desired result.
[0126] In some embodiments, certain steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.
[0127] Based on the same inventive concept, an embodiment of the present disclosure also provides a query request processing device as described in the following embodiments. Since the principle of problem - solving of this device embodiment is similar to that of the above - mentioned method embodiment, the implementation of this device embodiment can refer to the implementation of the above - mentioned method embodiment, and the repeated parts will not be elaborated.
[0128] Figure 5 Figure [figure number] shows a schematic diagram of a query request processing device in an embodiment of the present disclosure, as Figure 5As shown, the query request processing device includes a request receiving module 501, a problem analysis module 502, a policy determination module 503, a problem optimization module 504, and a problem query module 505.
[0129] The request receiving module 501 is used to receive a query request, and the query request includes a query problem.
[0130] The problem analysis module 502 is used to analyze the query problem and determine whether the query problem needs to be optimized according to the analysis result.
[0131] The policy determination module 503 is used to determine that the query problem needs to be optimized and select one or more optimization policies from query problem splitting, query problem rewriting, and query problem completion according to the analysis result.
[0132] The problem optimization module 504 is used to apply the selected optimization policy to optimize the query problem.
[0133] The problem query module 505 is used to query in the question and answer system with the optimized query problem to obtain a query result.
[0134] In some embodiments, if it is determined according to the analysis result that the query problem contains multiple sub-problems or involves a comparison of several things, the selected optimization policy includes query problem splitting, and query problem splitting is used to split the query problem into multiple sub-problems for querying or split the query problem into queries for each object.
[0135] In some embodiments, if it is determined according to the analysis result that the query problem contains multiple sub-problems and the query results of multiple sub-problems can be obtained through a single query in the question and answer system, the query problem is not split.
[0136] In some embodiments, the problem optimization module 504 applies the optimization policy of query problem completion to optimize the query problem, including: enhancing and completing the context of the query problem based on the personal information of the user who sends the query request and the user's historical questions.
[0137] In some embodiments, enhancing and completing the context of the query problem based on the personal information of the user who sends the query request and the user's historical questions includes: matching the technical field and relevant information corresponding to the query problem in the user's personal information and historical questions; completing the query problem based on the technical field and relevant information.
[0138] In some embodiments, the problem optimization module 504 applies the optimization policy of query problem rewriting to optimize the query problem, including: converting the query problem into a problem involving relevant concepts or principles based on the basic principles involved in the query problem.
[0139] In some embodiments, the problem optimization module 504 applies an optimization strategy for query problem rewriting to optimize the query problem, including: converting the query problem into a problem involving related concepts or principles based on the basic principles involved in the query problem; calculating the semantic similarity between the converted problem and the original query problem; if the semantic similarity is lower than a preset threshold, re-optimizing the query problem until the semantic similarity is not lower than the preset threshold.
[0140] The concepts such as "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0141] Regarding the query request processing device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the query request processing method, and will not be elaborated here in detail.
[0142] It should be noted that although several modules or units of a device for action execution are mentioned in the above detailed description, such a division is not mandatory.
[0143] In fact, according to the embodiments of the present disclosure, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0144] Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0145] Next, with reference to Figure 6 to describe the electronic device provided by the embodiments of the present disclosure. Figure 6 The electronic device 600 shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0146] Figure 6 The schematic diagram of the architecture of an electronic device 600 provided by the embodiments of the present disclosure is shown. As Figure 6 shown, the electronic device 600 includes but is not limited to: at least one processor 610, at least one memory 620.
[0147] The memory 620 is used to store instructions.
[0148] In some embodiments, the memory 620 may include a readable medium in the form of volatile storage units, such as a random access memory (RAM) 6201 and / or a cache storage unit 6202, and may further include a read-only memory (ROM) 6203.
[0149] In some embodiments, the memory 620 may further include a program / utilities 6204 having a set (at least one) of program modules 6205. Such program modules 6205 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment.
[0150] In some embodiments, the memory 620 may store an operating system. The operating system may be an operating system such as a Real Time eXecutive (RTX), LINUX, UNIX, WINDOWS, or OS X.
[0151] In some embodiments, data may also be stored in the memory 620.
[0152] As an example, the processor 610 may read the data stored in the memory 620. The data may be stored at the same storage address as the instruction, or the data may be stored at a different storage address from the instruction.
[0153] The processor 610 is configured to call the instructions stored in the memory 620 to implement the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section above. For example, the processor 610 may execute the steps of the above-described query request processing method embodiments.
[0154] It should be noted that the above-mentioned processor 610 may be a general-purpose processor or a special-purpose processor. The processor 610 may include one or more processing cores, and the processor 610 executes various functional applications and data processing by running instructions.
[0155] In some embodiments, the processor 610 may include a central processing unit (CPU) and / or a baseband processor.
[0156] In some embodiments, the processor 610 may determine an instruction according to the priority identifier and / or function category information carried in each control instruction.
[0157] In the present disclosure, the processor 610 and the memory 620 may be provided separately or integrated together.
[0158] As an example, the processor 610 and the memory 620 can be integrated on a single board or a system on chip (SOC).
[0159] As Figure 6 shown, the electronic device 600 is presented in the form of a general-purpose computing device. The electronic device 600 may also include a bus 630.
[0160] The bus 630 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus structures.
[0161] The electronic device 600 may also communicate with one or more external devices 640 (such as a keyboard, a pointing device, a Bluetooth device, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication may be carried out through an input / output (I / O) interface 650.
[0162] Moreover, the electronic device 600 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 660.
[0163] As Figure 6 shown, the network adapter 660 communicates with other modules of the electronic device 600 through the bus 630.
[0164] It should be understood that although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0165] It can be understood that the structure illustrated in the embodiments of the present disclosure does not constitute a specific limitation on the electronic device 600. In other embodiments of the present disclosure, the electronic device 600 may include more or fewer components than Figure 6 shown, or combine certain components, or split certain components, or have a different component arrangement. Figure 6 The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0166] The present disclosure also provides a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the query request processing method described in the above method embodiments is implemented.
[0167] In the embodiments of the present disclosure, a computer-readable storage medium can send, propagate, or transmit computer instructions for use by or in conjunction with an instruction execution system, apparatus, or device.
[0168] As an example, the computer-readable storage medium is a non-volatile storage medium.
[0169] In some embodiments, more specific examples of the computer-readable storage medium in the present disclosure may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, a USB flash drive, a portable hard disk, or any suitable combination of the above.
[0170] In the embodiments of the present disclosure, the computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer instructions (readable program code).
[0171] Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
[0172] In some examples, the computing instructions included on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the above.
[0173] The embodiments of the present disclosure also provide a computer program product. The computer program product stores instructions that, when executed by a computer, cause the computer to implement the query request processing method described in the above method embodiments.
[0174] The above instructions may be program code. In specific implementation, the program code can be written in any combination of one or more programming languages.
[0175] Programming languages include object-oriented programming languages - such as Java, C++, etc., and also include conventional procedural programming languages - such as the "C" language or similar programming languages.
[0176] The program code can be executed entirely on the user's computing device, partially on the user's device, executed as an independent software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0177] In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., by using an Internet service provider to connect through the Internet).
[0178] Embodiments of the present disclosure also provide a chip, including at least one processor and an interface;
[0179] The interface is used to provide program instructions or data for at least one processor;
[0180] At least one processor is used to execute program instructions to implement the query request processing method described in the above method embodiments.
[0181] In some embodiments, the chip may further include a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0182] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be specifically implemented in the following forms, that is: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuit", "module" or "system" here.
[0183] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other embodiments of the present disclosure.
[0184] The present disclosure aims to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include the common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the appended claims.
Claims
1. A query request processing method, characterized in that: include: receiving a query request, wherein the query request includes a query question; Analyze the query problem, and determine whether the query problem needs to be optimized according to the analysis result; Determining that the query problem needs to be optimized, and selecting one or more optimization strategies from among query problem splitting, query problem rewriting, and query problem completion according to the analysis result; Applying the selected optimization strategy to optimize the query problem; The optimized query questions are queried in the question-answering system to obtain query results.
2. The method according to claim 1, characterized in that If it is determined according to the analysis result that the query problem contains multiple sub-problems or involves comparison of several objects, the selected optimization strategy includes query problem splitting, which is used to split the query problem into multiple sub-problems for query or split the query problem into queries for each object.
3. The method according to claim 2, characterized in that If it is determined according to the analysis result that the query question contains multiple sub-questions, and query results of the multiple sub-questions can be obtained through one query in the question-answering system, the query question is not split.
4. The method according to claim 1, characterized in that Applying the optimization strategy for query completion to optimize the query problem includes: Based on the personal information of the user who sent the query request and the user's historical questions, the query question is contextually enhanced and completed.
5. The method according to claim 4, characterized in that The performing context enhancement and completion on the query question based on the personal information of the user sending the query request and the user's historical questions includes: Matching the technical fields and related information corresponding to the query question in the user's personal information and historical user questions; Based on the technical field and related information, the query question is completed.
6. The method according to claim 1, characterized in that Applying the optimization strategy of rewriting the query problem to optimize the query problem includes: Based on the basic principles involved in the query question, the query question is converted into a question involving relevant concepts or principles.
7. The method according to claim 6, characterized in that Applying the optimization strategy of rewriting the query problem to optimize the query problem includes: Based on the basic principles involved in the query question, convert the query question into a question involving relevant concepts or principles; Calculate the semantic similarity between the converted question and the original query question; If the semantic similarity is lower than a preset threshold, the query question is re-optimized until the semantic similarity is no lower than the preset threshold.
8. A query request processing device, characterized in that: include: A request receiving module, used for receiving a query request, wherein the query request includes a query question; A question analysis module, used to analyze the query question and determine whether the query question needs to be optimized according to the analysis result; A strategy determination module, used to determine whether the query problem needs to be optimized, and select one or more optimization strategies from among query problem splitting, query problem rewriting and query problem completion according to the analysis result; A question optimization module, used for applying a selected optimization strategy to optimize the query problem; The question query module is used to apply the optimized query questions to query in the question-answering system to obtain query results.
9. An electronic device, characterized in that: include: A memory for storing instructions; The processor is used to call the instructions stored in the memory to implement the query request processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the query request processing method described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Query processing method, storage medium and electronic equipment
CN114896486A
Optimization method and device for knowledge graph question-answering system
CN118093842A
Query request processing method, electronic equipment and storage medium
CN118277588A
Vector database retrieval method and device based on large model, terminal and medium
CN118312594A
Multi-stage dynamic retrieval question-answering system and working method thereof
CN118656481A