Query method, electronic device cluster, program product and readable storage medium

By obtaining the prior knowledge input by users, enhancing contextual background information, and generating extended query objects, the problem of inaccurate and incomplete query results in the Q&A system when contextual information is lacking, and more accurate and comprehensive query results are achieved.

CN119760105APending Publication Date: 2025-04-04SHENZHEN HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411758236.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When processing user input, the question and answer system lacks context information, resulting in the query results being inaccurate and comprehensive enough to effectively provide the answers required by the user.

Method used

By obtaining prior knowledge input from users, enhancing the contextual background information input by users, thereby generating a more comprehensive extended query object to ensure the accuracy and comprehensiveness of query results.

Benefits of technology

It improves the accuracy and comprehensiveness of the query system in the case of unclear user intentions or insufficient context information, and provides answers that are more in line with user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760105A_ABST
    Figure CN119760105A_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and an embodiment of the present application provides a query method, an electronic device cluster, a program product, and a readable storage medium. The query method provided in an embodiment of the present application is applied to an electronic device, and the method includes: obtaining prior knowledge corresponding to the user input according to the user input; generating an extended query object corresponding to the user input according to the user input and the prior knowledge. According to the query method of an embodiment of the present application, a more comprehensive and accurate extended query object can be obtained, which improves the problem of incomplete query objects caused by unclear user input intentions or insufficient context information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a query method, an electronic device cluster, a program product, and a readable storage medium. Background Art

[0002] With the development of the Internet, people's ways of obtaining information are becoming more and more diverse. Nowadays, people's ways of obtaining information are gradually shifting from traditional search engines to question-answering systems such as artificial intelligence dialogue robots. As an efficient information retrieval tool, question-answering systems have been widely used in various scenarios, such as intelligent customer service, search engines, knowledge management systems, etc.

[0003] The question-answering system can search for questions entered by users and provide answers to users based on the search results. Compared with traditional search engines, the question-answering system adopts a human-computer question-answering interaction method, which improves the convenience of obtaining information and enhances the user experience.

[0004] However, since the question-answering system can only directly query based on user questions and directly reply to the user with the query results as answers, the answers given by the question-answering system are stiff and often contain unnecessary information. In addition, when the user's question is not clear, the question-answering system cannot obtain an accurate answer.

[0005] Therefore, a new query method is needed to obtain more accurate and comprehensive answers to user questions. Summary of the invention

[0006] In response to the question of how to provide more accurate and comprehensive answers, the present application provides a query method, an electronic device cluster, a program product, and a readable storage medium.

[0007] The Retrieval Augmented Generation (RAG) system queries relevant information from an external knowledge base and inputs it as prompts to large language models (LLMs), thereby enhancing the ability of LLMs to handle knowledge-intensive tasks.

[0008] However, since users are accustomed to the product form of manual query based on search engines, when users interact with the RAG system, they are accustomed to using concise methods such as phrases and short sentences to input. The dialogue information of human-computer interaction lacks contextual information, which makes it impossible for the RAG system to query comprehensive relevant information based on the dialogue information, and thus unable to provide sufficient prompts to the LLMS, which ultimately affects the accuracy and comprehensiveness of the information output by the LLMs, resulting in inaccurate and / or insufficient comprehensiveness of the dialogue response content.

[0009] In order to query comprehensive relevant information based on user input, in the query method provided in the present application, an extended query object based on the user input is obtained, thereby ensuring the accuracy and comprehensiveness of the query result through query based on the extended query object.

[0010] Specifically, in the query method provided in the present application, corresponding prior knowledge is obtained based on user input, and the contextual background information of the user input is enhanced through the prior knowledge, thereby ensuring that the user's intention can be understood, so as to ultimately obtain an extended query object that better meets the user's needs.

[0011] The present application embodiment adopts the following technical solutions:

[0012] In a first aspect, the present application provides a query method, which is applied to an electronic device, and includes:

[0013] According to the user input, obtain the prior knowledge corresponding to the user input;

[0014] Based on the user input and prior knowledge, an extended query object corresponding to the user input is generated.

[0015] According to the method of the first aspect, corresponding prior knowledge is obtained based on user input, which can enhance the contextual background information of the user input, ensure that the query device can understand the user's intention, and improve the accuracy of the query device in subsequently generating extended query objects, so that the query device can obtain extended query objects that better meet user needs.

[0016] According to the method of the first aspect, an extended query object is generated based on prior knowledge and user input. With the enhancement of the prior knowledge input by the user, the semantic understanding ability and reasoning thinking ability of the large model can be used to understand the intention of the user input and generate a more comprehensive and integrated extended query object.

[0017] According to the query method of the first aspect, a more comprehensive and accurate expanded query object can be obtained, thereby improving the problem of incomplete expanded query objects caused by unclear user input intention or insufficient context information.

[0018] In an implementation of the first aspect, obtaining, according to the user input, prior knowledge corresponding to the user input includes:

[0019] Search according to user input and obtain search recall knowledge for the user input;

[0020] Generate prior knowledge based on user input and search recall knowledge.

[0021] In an implementation of the first aspect, generating prior knowledge according to user input and search-recalled knowledge includes:

[0022] The first generative model is used to generate prior knowledge based on user input and search-recall knowledge.

[0023] In an implementation of the first aspect, using a first generation model to generate prior knowledge according to user input and search recall knowledge includes:

[0024] The first generation model generates prior knowledge using the first prompt word according to user input and search recall knowledge, wherein the first prompt word is used to guide the first generation model to generate prior knowledge.

[0025] In an implementation of the first aspect, the first generation model is a pangu-7B or qwen-7B model.

[0026] According to the method of the above implementation mode, prior knowledge is generated based on the search results of the search engine, which can ensure the comprehensiveness and timeliness of the prior knowledge, improve the accuracy of the query device in subsequently generating extended query objects, and improve the effectiveness and comprehensiveness of the coverage of the extended query objects, so that the query device can obtain extended query objects that better meet user needs.

[0027] In an implementation of the first aspect, generating an extended query object corresponding to the user input according to the user input and prior knowledge includes:

[0028] The second generation model is used to generate an expanded query object according to the user input and prior knowledge.

[0029] In an implementation of the first aspect, using the second generation model to generate an extended query object according to user input and prior knowledge includes:

[0030] The second generation model generates an extended query object using the second prompt word according to user input and prior knowledge, wherein the second prompt word is used to guide the second generation model to generate the extended query object.

[0031] In an implementation of the first aspect, the second prompt word is a prompt word containing a thought chain logic.

[0032] In one implementation of the first aspect, the second generation model is a GPT-4 or pangu-38B model.

[0033] According to the method of the above implementation mode, an extended query object is generated based on prior knowledge and user input. With the enhancement of the prior knowledge of the user input, the semantic understanding ability and reasoning thinking ability of the large model can be used to understand the intention of the user input and generate a more comprehensive and integrated extended query object.

[0034] According to the above implementation method, the semantic understanding and generation capabilities of the large model are utilized, and through customized prompt words, more accurate and extensible extended words are generated, ensuring that the knowledge search scope is wider and the search content is more in line with user intentions in the subsequent dialogue system retrieval module, so as to finally generate high-quality replies.

[0035] In an implementation manner of the first aspect, the method further includes:

[0036] Perform a query based on user input and extended query objects to obtain query results.

[0037] In a second aspect, the present application provides a query device, which is applied to an electronic device, and includes:

[0038] A priori knowledge generation module, which is used to obtain prior knowledge corresponding to the user input according to the user input;

[0039] The query expansion generation module is used to generate an expanded query object corresponding to the user input according to the user input and prior knowledge.

[0040] In an implementation of the second aspect, the prior knowledge generation module includes:

[0041] A search engine, which is used to search according to user input and obtain search recall knowledge for the user input;

[0042] The first generating unit is used to generate prior knowledge according to user input and search recall knowledge.

[0043] In an implementation manner of the second aspect, the first generating unit includes:

[0044] The first generation model is used to generate prior knowledge according to user input and search recall knowledge.

[0045] In an implementation of the first aspect, the first generation model is used to:

[0046] Prior knowledge is generated using the first prompt word according to user input and search recall knowledge, wherein the first prompt word is used to guide the first generation model to generate prior knowledge.

[0047] In an implementation of the first aspect, the first generation model is a pangu-7B or qwen-7B model.

[0048] In an implementation of the first aspect, the query expansion generation module includes:

[0049] The second generation model is used to generate an extended query object according to user input and prior knowledge.

[0050] In an implementation manner of the first aspect, the second generation model is used to:

[0051] The second prompt word is used to generate an extended query object according to the user input and prior knowledge, wherein the second prompt word is used to guide the second generation model to generate the extended query object.

[0052] In an implementation of the first aspect, the second prompt word is a prompt word containing a thought chain logic.

[0053] In one implementation of the first aspect, the second generation model is a GPT-4 or pangu-38B model.

[0054] In an implementation of the first aspect, the apparatus further includes:

[0055] The query module is used to perform queries based on user input and extended query objects to obtain query results.

[0056] In a third aspect, the present application provides a computing device cluster, the computing device cluster comprising at least one computing device, each computing device comprising a memory and a processor;

[0057] The processor of at least one computing device is configured to execute instructions stored in a memory of at least one computing device, so that the computing device cluster executes the method according to the first aspect.

[0058] In a fourth aspect, the present application provides a computer program product comprising instructions, which, when executed by a computing device system, enables a computing device cluster to execute the method of the first aspect.

[0059] In a fifth aspect, the present application provides a computer-readable storage medium, comprising computer program instructions. When the computer program instructions are executed by a computer system, the computer system executes the method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 The figure is a schematic diagram of a synonym or related word acquisition process according to an embodiment of the present application;

[0061] Figure 2 The figure is a schematic diagram of the expansion word acquisition process according to an embodiment of the present application;

[0062] Figure 3 Shown is a schematic diagram of the structure of a query device according to an embodiment of the present application;

[0063] Figure 4 The figure is a flowchart of a query method according to an embodiment of the present application;

[0064] Figure 5The figure is a schematic diagram of the structure of a priori knowledge generation module according to an embodiment of the present application;

[0065] Figure 6 The figure is a partial flow chart of a query method according to an embodiment of the present application;

[0066] Figure 7 The figure is a schematic diagram of the structure of a priori knowledge generation module according to an embodiment of the present application;

[0067] Figure 8 The figure is a partial flow chart of a query method according to an embodiment of the present application;

[0068] Fig. 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application;

[0069] Fig.10 A schematic diagram of an electronic device cluster according to an embodiment of the present application;

[0070] Fig.11 The figure is a schematic diagram of a network connection of an electronic device cluster according to an embodiment of the present application. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0072] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0073] As for the problem of how to obtain more accurate and comprehensive answers to user questions, a feasible solution is to adopt a Retrieval Augmented Generation (RAG) system.

[0074] The RAG system is an artificial intelligence technology that combines information retrieval technology with language generation models. The technology queries relevant information from an external knowledge base and inputs it as a prompt to a large language model (LLMs). LLMs generate model output based on the prompt and user input. The RAG system can enhance the model's ability to handle knowledge-intensive tasks such as question answering, text summarization, content generation, etc.

[0075] However, since users are accustomed to the product form based on manual query of search engines, when users interact with the RAG system, they are accustomed to using concise methods such as phrases and short sentences to input, which makes the dialogue information of human-computer interaction lack contextual information, which makes it easy for the dialogue information intention to be unclear and lead to problems such as missing search information.

[0076] Specifically, since the dialogue information only contains short phrases and sentences and lacks contextual information, the RAG system cannot query comprehensive relevant information based on the dialogue information, and thus cannot provide sufficient prompts to the LLMS, which ultimately affects the accuracy and comprehensiveness of the information output by the LLMs, resulting in inaccurate and / or insufficient comprehensiveness of the dialogue response content.

[0077] A feasible solution to the problem of insufficient comprehensiveness of the above-mentioned prompt is to expand the vocabulary input by the user to obtain an expanded vocabulary; query the expanded vocabulary to obtain an expanded query result; generate a prompt based on the expanded query result and the query result based on the user input to ensure the comprehensiveness of the prompt.

[0078] Specifically, in one implementation, a pre-built dictionary or synonym database is used to replace the keywords in the user input with synonyms or related words, and the replaced statements are added to the query to perform an expanded query.

[0079] Alternatively, by using statistical methods or semantic analysis to analyze the correlation between words, words related to the keywords in the user input are found, the keywords in the user input are replaced with the related words, and the replaced sentences are added to the query to perform an extended query.

[0080] Figure 1 Shown is a schematic diagram of a synonym or related word acquisition process according to an embodiment of the present application.

[0081] like Figure 1 As shown:

[0082] S100, obtaining a target word (keyword) in user input.

[0083] S101, obtaining at least one candidate text associated with a target word.

[0084] S102: Determine a plurality of candidate words from at least one candidate text.

[0085] S103, determining at least one extended word (synonym or related word) of the target word from the plurality of candidate words.

[0086] According to the above-mentioned extended query scheme based on synonyms or extended words, the query results can be expanded, the semantic coverage of the query can be increased, and more prompts to LLMs can be provided.

[0087] However, although the above scheme can expand the query results and increase the semantic coverage of the query, its expanded semantic coverage depends on dictionaries and synonym thesaurus for obtaining synonyms or related words, or on statistical results or semantic analysis for analyzing lexical relevance.

[0088] This means that when the coverage of dictionaries and synonym databases is incomplete, or when the statistical results or semantic analysis used to analyze word associations are incomplete, the expanded query results are also incomplete and cannot cover all word changes and contexts, and ultimately cannot provide a comprehensive prompt.

[0089] Furthermore, if there are errors in the dictionary, synonym database or word vector model, or if there are errors in the statistical results or semantic analysis used to analyze vocabulary associations, error noise will be introduced into the expanded query results, reducing the accuracy of the query.

[0090] Furthermore, in another implementation, based on deep learning, a word vector model is used to obtain words similar to the keywords in the user input, and replace and expand them.

[0091] Specifically, through large-scale corpus training, the distributed representation of vocabulary is learned and a word vector model (such as Word2Vec, GloVe) is constructed. The word vector model can capture the semantic information of vocabulary and ensure that semantically similar words are close in the vector space. When obtaining user input, the word vector model can find words with semantically similar words to the user input, thereby performing extended queries.

[0092] Figure 2 The figure is a schematic diagram of the expansion word acquisition process according to an embodiment of the present application.

[0093] S200, obtaining network session logs, extracting query words of all network users to obtain a query word material training library;

[0094] S201, training a word vector model using a query word data training library;

[0095] S202, after receiving the query text and inputting it into the trained word vector model, an expanded word is obtained.

[0096] Although the word vector model can more accurately obtain words that are semantically similar to the user input, it cannot handle polysemous words, which means that the output of the word vector model cannot be used universally in different contexts.

[0097] For example, when understanding the word “apple”, the word embedding model cannot directly determine whether it refers to fruit or a technology company.

[0098] Furthermore, word embedding models cannot capture long-range dependencies.

[0099] For example, in a complex sentence, the semantic relationship between certain words may need to be determined across a long distance, but the word embedding model may not be able to accurately capture this relationship.

[0100] In order to obtain more accurate and comprehensive answers to user questions, an embodiment of the present application provides a query method.

[0101] In the query method provided in the present application, an extended query object for the user input is obtained according to the user input, so as to ensure the accuracy and comprehensiveness of the query result through the query based on the extended query object.

[0102] Specifically, in the method of the embodiment of the present application, prior knowledge corresponding to the user input is obtained according to the user input. Based on the generative model, an extended query object corresponding to the user input is generated according to the user input and the prior knowledge corresponding to the user input. By querying based on the extended query object, comprehensive relevant information for the user input can be obtained.

[0103] Furthermore, an embodiment of the present application also provides a query device for implementing the query method.

[0104] Figure 3 FIG. 4 is a schematic diagram of the structure of a query device according to an embodiment of the present application.

[0105] like Figure 3 As shown, the query device 300 includes a priori knowledge generation module 301 , a query expansion generation module 302 and a query module 303 .

[0106] Figure 4 FIG. 4 is a flow chart of a query method according to an embodiment of the present application.

[0107] S400, the prior knowledge generation module 301 obtains user input.

[0108] S401, the prior knowledge generation module 301 obtains prior knowledge corresponding to the user input according to the user input.

[0109] Specifically, in one embodiment, in S401, the prior knowledge generation module 301 generates a priori knowledge summary of the user input through a generative large model (such as qwen-7B, pangu-7B, etc.) based on the user input, taking into account the timeliness of the input and the recall knowledge of the retrieval.

[0110] According to the method of the embodiment of the present application, corresponding prior knowledge is obtained based on user input, and the contextual background information of the user input is enhanced through the prior knowledge to ensure that the query device can understand the user's intention and improve the accuracy of the query device in subsequently generating extended query objects, so that the query device can obtain extended query objects that better meet user needs.

[0111] According to the method of the embodiment of the present application, the problem of decreased accuracy of general scene query expansion in scenarios such as unclear user input intention and lack of description can be alleviated.

[0112] Specifically, Figure 5 Shown is a schematic diagram of the structure of a priori knowledge generation module according to an embodiment of the present application.

[0113] like Figure 5 As shown, the prior knowledge generation module 500 includes a search engine 501 and a generation unit 502 .

[0114] Figure 6 Shown is a partial flow chart of a query method according to an embodiment of the present application.

[0115] S600: The prior knowledge generation module 500 obtains user input.

[0116] S601, the search engine 501 searches according to user input and obtains search recall knowledge for the user input.

[0117] Specifically, in one embodiment, the search engine 501 may be a real-time public search engine, such as bing, petal, etc.

[0118] S602, the generating unit 502 generates prior knowledge corresponding to the user input according to the user input and the search and recall knowledge for the user input.

[0119] Specifically, in one embodiment, the generation unit 502 includes a first generation model, which uses a designed first prompt word (prompt) to generate prior knowledge corresponding to the user input according to the user input and the search recall knowledge for the user input.

[0120] Specifically, in one embodiment, the first prompt word is used to guide the first generation model to generate prior knowledge. For example, the first prompt word may include: considering the timeliness of input; summarizing user input and search recall knowledge.

[0121] Specifically, in one embodiment, the first generative model may be a generative large model, for example, pangu-7B, qwen-7B, etc.

[0122] According to the method of the embodiment of the present application, prior knowledge is generated based on the search results of the search engine, which can ensure the comprehensiveness and timeliness of the prior knowledge, improve the accuracy of the query device in subsequently generating extended query objects, and improve the effectiveness and comprehensiveness of the coverage of the extended query objects, so that the query device can obtain extended query objects that better meet user needs.

[0123] S402, the query expansion generation module 302 generates an expanded query object corresponding to the user input according to the user input and prior knowledge corresponding to the user input.

[0124] According to the query method of the embodiment of the present application, a more comprehensive and accurate extended query object can be obtained, thereby improving the problem of incomplete query objects caused by unclear user input intention or insufficient context information.

[0125] Specifically, in one embodiment, in S402, the query expansion generation module 302 performs data splicing of user input and prior knowledge based on a generative model (such as GPT-4, pangu-38B, etc.), and specifically designs the prompt words of the chain-of-thought logic to directionally strengthen the large model's generation of extended query objects for user input.

[0126] According to the method of the embodiment of the present application, an extended query object is generated based on prior knowledge and user input. With the enhancement of the prior knowledge of the user input, the semantic understanding ability and reasoning thinking ability of the large model can be utilized to understand the intention of the user input and generate a more comprehensive and integrated extended query object.

[0127] According to the method of the embodiment of the present application, the semantic understanding and generation capabilities of the large model are utilized, and through customized prompt words, more accurate and extensible extended words are generated, ensuring that the knowledge search scope is wider and the search content is more in line with the user's intention in the subsequent dialogue system retrieval module, so as to finally generate high-quality replies.

[0128] Specifically, Figure 7 Shown is a schematic diagram of the structure of a priori knowledge generation module according to an embodiment of the present application.

[0129] like Figure 7 As shown, the query expansion generation module 700 includes a generation model 701 (a second generation model).

[0130] Figure 8 Shown is a partial flow chart of a query method according to an embodiment of the present application.

[0131] S800, the query expansion generation module 700 obtains user input and prior knowledge corresponding to the user input.

[0132] S801, the generation model 701 uses the designed second prompt word (prompt) to generate an extended query object corresponding to the user input according to the user input and the prior knowledge corresponding to the user input.

[0133] Specifically, in one embodiment, in S801 , the generation model 701 performs data concatenation of user input and prior knowledge.

[0134] Specifically, in one embodiment, the second prompt word is used to guide the generation model 701 to generate an extended query object.

[0135] In one embodiment, the second prompt word is designed specifically and includes a prompt word of a chain-of-thought logic.

[0136] For example, the second prompt word may include:

[0137] Combine prior knowledge and user input to analyze and think step by step, first understand the problem, then break it down, and ensure that the broken down problem can be answered with sufficient knowledge through search;

[0138] The thinking process includes: (1) reading the question, understanding the question content and main semantic information; (2) expanding the question to ensure that the different dimensions of the user's question are covered, so as to supplement and extend the semantics of the original question;

[0139] The output requirements include: (1) generating decomposed questions based on the thinking process; and (2) outputting in a structured dictionary format according to the specified format, with fields including the user's original input question, the thinking process, and the generated results.

[0140] Specifically, in one embodiment, the generative model 701 may be a generative large model, such as GPT-4, pangu-38B, etc.

[0141] S403, the query module 303 performs a query based on the user input and the extended query object corresponding to the user input to obtain a query result.

[0142] According to the query method of the embodiment of the present application, comprehensive relevant information input by the user can be obtained, thereby improving the problem of incomplete query results caused by unclear user input intentions or insufficient context information.

[0143] Furthermore, the query method provided in the embodiment of the present application can be applied to the RAG dialogue system. The RAG dialogue system includes but is not limited to open domain dialogue systems such as dialogue robots, intelligent customer service, and AI search.

[0144] Specifically, in one embodiment, the extended query object corresponding to the user input is applied to the RAG system, so that the RAG system queries comprehensive relevant information for the user input based on the extended query object, thereby providing accurate and comprehensive prompt input for the LLMs model, and finally obtaining a more comprehensive and accurate answer to the user input.

[0145] According to the query method of the embodiment of the present application, the problem of incomplete response content caused by unclear user input intention or insufficient context information in the RAG dialogue system can be improved and enhanced.

[0146] Furthermore, the query method provided in the embodiment of the present application can also be applied to other application scenarios other than the RAG system that require querying based on user input.

[0147] Furthermore, in one embodiment, the prior knowledge corresponding to the user input may be applied to the expansion of the long input.

[0148] For example, for long inputs in the RAG system, prior knowledge can be enhanced to split the outline or decompose it into sub-problems.

[0149] Furthermore, in one embodiment, in a dialog system (eg, RAG system), a dialog reply may nest an extended query object.

[0150] For example, an extended agent can be built to perform progressive splitting of sub-titles, sub-titles, etc., to add more comprehensive and detailed information, making the dialogue responses more comprehensive and accurate.

[0151] The query device of the embodiment of the present application has good usability and can be directly integrated into the existing AI dialogue system to improve the accuracy and comprehensiveness of the overall dialogue responses, and ensure that in the RAG dialogue system and RAG search system, the advantages of traditional search engines are combined to improve the comprehensiveness of the response content.

[0152] The following describes the specific process of obtaining an extended query object according to the query method implemented in the present application based on a specific application scenario.

[0153] Take user input: "A model mobile phone" as an example.

[0154] In S601, the search engine 501 searches for search recall knowledge for “A model mobile phone”:

[0155] {“context”:[“Model A has a XX-inch folding screen, supports single-screen and dual-screen modes, and provides multiple experiences and intelligent assistance. Equipped with XX operating system, it provides variable aperture folding images, presenting extraordinary exploration and super light and shadow.” “Model A adopts an inward folding design, which can be folded and unfolded. After unfolding, the screen display size reaches XX inches. This article introduces the characteristics and advantages of Model A in terms of thickness, weight, hinge, screen, and photography, as well as some usage experience and evaluation.” “Model A provides two screen sizes, up to XX inches. Equipped with XX chip, it supports the latest communication standard, has 66W wired and 50W wireless fast charging, and is priced from XX yuan.”……]}

[0156] In S602 , the generating unit 502 generates prior knowledge according to the search-recall knowledge and the user input.

[0157] The input of the generation unit 502 is:

[0158] {

[0159] “system”: “Based on the search and recall knowledge results, it is necessary to consider whether the user input is timely and summarize the background prior knowledge of the user input”,

[0160] "user":f"

[0161] Search for recall information: {retrieve_info},

[0162] User input: 'A model mobile phone'"

[0163] }

[0164] The output of the generation unit 502 is:

[0165] "The A-type mobile phone is a folding screen mobile phone. It adopts an internal folding structure and a main and secondary screen design. It can support two different forms of single screen and dual screen, providing users with an immersive office and entertainment experience. The A-type mobile phone is equipped with an XX-inch main screen and a variable aperture imaging system, which greatly enhances the practicality of the mobile phone. In addition, the A-type mobile phone is equipped with an XX chip and supports the latest communication standards. It also has 66W wired fast charging and 50W wireless fast charging technology. The price of the A-type mobile phone starts from XX yuan, which brings consumers a new multi-functional mobile phone choice."

[0166] In S801 , the generation model 701 generates an extended query object corresponding to the user input according to the user input and prior knowledge corresponding to the user input.

[0167] The input of the generative model 701 is:

[0168] {

[0169] "system": "As a problem analysis assistant, you need to combine prior knowledge and user input to analyze and think step by step. First, understand the problem, then break it down, and ensure that the broken down problem can be answered with sufficient knowledge through search.

[0170] #Thinking process

[0171] 1. Read the question and understand the content and main semantic information.

[0172] 2. Please expand the question to ensure that it covers different dimensions of the user's question and to supplement and extend the semantics of the original question.

[0173] # Output requirements

[0174] 1. Generate deconstructive questions based on your thinking process.

[0175] 2. Please output the structured dictionary format according to the specified format. The fields include the user's original input question, thinking process and generated results. …”

[0176] "user":f"

[0177] Prior knowledge: {context}

[0178] User input: "A model mobile phone"

[0179] }

[0180] The output of the generative model 701 is:

[0181] {

[0182] "Question":"Mobile phone model A",

[0183] “Thinking process”: “The question asked by the user is about phone model A. This question may involve various aspects of the phone, including its features, technical specifications, functions, price, etc. We need to break it down into multiple specific questions so that the search can obtain enough information.”

[0184] "Extended Result":{

[0185] "1":"Features of Model A mobile phone",

[0186] "2":"Technical specifications of model A mobile phone",

[0187] "3":"Functions of Model A mobile phone",

[0188] "4":"The price of model A mobile phone"

[0189] }

[0190] }

[0191] In the description of the embodiments of the present application, for the convenience of description, the device is described by dividing it into various modules according to its functions. The division of each module is merely a division of logical functions. When implementing the embodiments of the present application, the functions of each module can be implemented in the same or one or more software and / or hardware.

[0192] Specifically, the device proposed in the embodiment of the present application can be fully or partially integrated into a physical entity (for example, a GPU or other type of processor) during actual implementation, or it can be physically separated. And these modules can all be implemented in the form of software calling through a processing element; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through a processing element, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of an electronic device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in a processor element or instructions in the form of software.

[0193] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0194] In one embodiment, the method provided in the present application can be implemented on an electronic device.

[0195] An embodiment of the present application further provides an electronic device (eg, a mobile phone) for executing the method flow or part of the method flow described in the embodiment of the present application.

[0196] Fig. 9 Schematic diagram of the structure of an electronic device according to an embodiment of the present application.

[0197] like Fig. 9As shown, the electronic device 2400 includes: a bus 2404, a processor 2401, a memory 2402 and a communication interface 2403. The processor 2401, the memory 2402 and the communication interface 2403 communicate with each other via the bus 2404.

[0198] The electronic device 2400 may be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the electronic device 2400.

[0199] It is understandable that the structural description of the electronic device 2400 in the embodiment of the present application does not constitute a specific limitation on the electronic device 2400. In other embodiments of the present application, the electronic device 2400 may include other components besides the processor 2401 and the memory 2402.

[0200] The bus 2404 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The bus 2404 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 2404 may include a path for transmitting information between various components of the electronic device 2400 (for example, the memory 2402, the processor 2401, and the communication interface 2403).

[0201] The processor 2401 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0202] The processor 2401 may be a device on a chip (SOC), and the processor 2401 may include a central processing unit (CPU), and may further include other types of processors.

[0203] The processor involved in the processor 2401 may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also include a GPU, an embedded neural network processor (Neural-network Process Units, NPU) and an image signal processor (Image Signal Processing, ISP). The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.

[0204] The processor 2401 may include one or more processing units. For example, the processor may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 2400 may also include one or more processors 2401. The controller may generate an operation control signal based on the instruction opcode and the timing signal to complete the control of fetching and executing instructions.

[0205] In some embodiments, the processor 2401 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. Among them, the USB interface is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface can be used to connect a charger to charge an electronic device, and can also be used to transmit data between an electronic device and a peripheral device.

[0206] The memory 2402 may include a volatile memory, such as a random access memory (RAM). The processor 2401 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0207] The memory 2402 stores executable program codes, and the processor 2401 executes the executable program codes to implement the aforementioned functions, thereby implementing the method proposed in the embodiment of the present application. That is, the memory 2402 stores instructions for executing the method proposed in the embodiment of the present application.

[0208] The memory 2402 may include a code storage area and a data storage area. The code storage area may store an operating system. The data storage area may store data created during the use of the electronic device 2400, etc. In addition, the memory 2402 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, a flash memory component, a universal flash storage (UFS), etc.

[0209] The memory 2402 may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or may be any computer-readable medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer.

[0210] The processor 2401 and the memory 2402 may be integrated into one processing device, or more commonly, may be independent components.

[0211] The communication interface 2403 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the electronic device 2400 and other devices or a communication network.

[0212] The electronic device 2400 may also include an external memory interface, which is used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 2401 through the external memory interface to implement a data storage function. For example, files such as music and videos are stored in the external memory card.

[0213] In another embodiment, the method provided in the present application can be implemented on multiple electronic devices. For example, the method provided in the present application can be implemented through a terminal device and a cloud server connected to the terminal device.

[0214] An embodiment of the present application also proposes an electronic device cluster. The electronic device cluster includes at least one electronic device, each of which includes a memory and a processor; the processor of at least one electronic device in the electronic device cluster is used to execute instructions stored in the memory of at least one electronic device in the electronic device cluster, so that the electronic device cluster executes the method described in the embodiment of the present application.

[0215] For example, in one embodiment, the electronic device cluster includes a first electronic device (eg, a mobile phone) and a second electronic device (eg, a cloud server).

[0216] Fig.10Schematic diagram of an electronic device cluster according to an embodiment of the present application.

[0217] like Fig.10 As shown, the electronic device cluster includes at least one electronic device 2500 (the structure of the electronic device 2500 can refer to the electronic device 2400). The electronic device 2500 can be a server or a terminal device. Each electronic device 2500 includes: a bus 2504 (refer to the bus 2404), a processor 2501 (refer to the processor 2401), a memory 2502 (refer to the memory 2402) and a communication interface 2503 (refer to the communication interface 2403).

[0218] The memory 2501 in one or more electronic devices in the electronic device cluster may store the same instructions for executing the method proposed in the embodiment of the present application.

[0219] In some possible implementations, the memory 2501 of one or more electronic devices 2500 in the electronic device cluster may also store partial instructions for executing the glasses fitting method proposed in the embodiment of the present application. In other words, the combination of one or more electronic devices 2500 may jointly execute instructions for executing the method proposed in the embodiment of the present application.

[0220] It should be noted that the memory 2501 in different electronic devices 2500 in the electronic device cluster can store different instructions, which are respectively used to execute part of the functions of the model training device proposed in the embodiment of the present application. That is, the instructions stored in the memory 2502 in different electronic devices 2500 can realize the functions of one or more modules in the query device.

[0221] In some possible implementations, one or more electronic devices in the electronic device cluster may be connected via a network, which may be a wide area network or a local area network.

[0222] Fig.11 The figure is a schematic diagram of a network connection of an electronic device cluster according to an embodiment of the present application.

[0223] like Fig.11 As shown, two electronic devices 2600A and 2600B are connected via a network. Specifically, they are connected to the network via a communication interface in each electronic device. The structures of the electronic devices 2600A and 2600B can refer to the electronic device 2400.

[0224] The electronic device 2600A includes a bus 2604A (see bus 2404 ), a processor 2601A (see processor 2401 ), a memory 2602A (see memory 2402 ), and a communication interface 2603A (see communication interface 2403 ).

[0225] The electronic device 2600B includes a bus 2604B (see bus 2404 ), a processor 2601B (see processor 2401 ), a memory 2602B (see memory 2402 ), and a communication interface 2603B (see communication interface 2403 ).

[0226] In one embodiment, the electronic device 2600A is a terminal device, and the electronic device 2600B is a server.

[0227] It should be understood that Fig.11 The functions of the electronic device 2600A shown in FIG. 2 may also be completed by multiple electronic devices. Similarly, the functions of the electronic device 2500B may also be completed by multiple electronic devices.

[0228] An embodiment of the present application further provides an electronic chip, which is used to execute the method flow or part of the method flow described in the embodiment of the present application.

[0229] Specifically, the electronic chip includes a processor for executing program instructions. When the computer program instructions are executed by the processor, the electronic chip is triggered to execute the method steps described in the embodiment of the present application. The processor of the electronic chip can refer to the processor of the above-mentioned electronic device.

[0230] The devices, apparatuses, and modules described in the embodiments of the present application may be implemented by computer chips or entities, or by products having certain functions.

[0231] The invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.

[0232] In the several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.

[0233] Specifically, in one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is run on a computer, the computer executes the method provided in the embodiment of the present application.

[0234] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is run on a computer, the computer executes the method provided by the embodiment of the present application.

[0235] The embodiments described in this application are described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0236] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0237] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0238] It should also be noted that in the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0239] In the embodiments of the present application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.

[0240] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0241] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0242] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments of the present application can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0243] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0244] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A query method, characterized in that: The method is applied to an electronic device, and the method comprises: According to the user input, obtaining prior knowledge corresponding to the user input; An extended query object corresponding to the user input is generated according to the user input and the prior knowledge.

2. The method according to claim 1, characterized in that The acquiring, according to the user input, prior knowledge corresponding to the user input includes: Searching according to the user input to obtain search recall knowledge for the user input; The prior knowledge is generated according to the user input and the search recall knowledge.

3. The method according to claim 2, characterized in that The generating the prior knowledge according to the user input and the searched and recalled knowledge includes: The prior knowledge is generated according to the user input and the search recall knowledge using a first generation model.

4. The method according to claim 3, characterized in that The using the first generation model to generate the prior knowledge according to the user input and the search recall knowledge includes: The first generation model generates the prior knowledge using a first prompt word according to the user input and the search recall knowledge, wherein the first prompt word is used to guide the first generation model to generate the prior knowledge.

5. The method according to any one of claims 1 to 4, characterized in that The step of generating an extended query object corresponding to the user input according to the user input and the prior knowledge includes: The expanded query object is generated according to the user input and the prior knowledge using a second generation model.

6. The method according to claim 5, characterized in that The using the second generation model to generate the extended query object according to the user input and the prior knowledge includes: The second generation model generates the expanded query object using a second prompt word according to the user input and the prior knowledge, wherein the second prompt word is used to guide the second generation model to generate the expanded query object.

7. The method according to claim 6, characterized in that The second prompt word is a prompt word containing a thinking chain logic.

8. The method according to claim 1, characterized in that The method further comprises: A query is performed according to the user input and the extended query object to obtain a query result.

9. An electronic equipment cluster, characterized in that: The electronic device cluster includes at least one electronic device, each of which includes a memory and a processor; The processor of the at least one electronic device is configured to execute instructions stored in the memory of the at least one electronic device, so that the electronic device cluster executes the method according to any one of claims 1 to 8.

10. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device system, the computing device cluster executes the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computer system, the computer system performs the method according to any one of claims 1 to 8.