Method and device for data query and intelligent agent

Through deep learning models, users' natural language query is subject to intent recognition and split, and subquery tasks are performed, which solves the problems of insufficient retrieval accuracy and intent recognition difficulties in the prior art, and achieves more efficient and accurate data query.

CN119782501APending Publication Date: 2025-04-08BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202411833518.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing search enhancement generation methods have problems such as insufficient intent recognition, limited retrieval accuracy, lack of intent disassembly and code library meta-information utilization in user natural language queries, resulting in limited accuracy and correlation of query results.

Method used

By receiving natural language query input from users, using deep learning models for intent recognition, split into one or more subquery tasks, and performing these subquery tasks in a predetermined database to obtain more accurate query results.

Benefits of technology

It improves the accuracy and efficiency of searches, can better understand users' complex query intentions, generate more relevant search plans, and improves the accuracy and user experience of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782501A_ABST
    Figure CN119782501A_ABST
Patent Text Reader

Abstract

The invention provides a data query method and device and an intelligent agent, and relates to the technical field of data processing, in particular to a large model technology and a code retrieval technology. According to the implementation scheme, query input information input by a user is received; performing intention recognition according to the query input information by using a deep learning model to obtain a sub-query task corresponding to the user input; executing the sub-query task in a predetermined database; and obtaining a query result corresponding to the sub-query task from the predetermined database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, in particular to large model technology and code retrieval technology, and specifically to a method, device and intelligent agent for data query. Background Art

[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions. In the scenario of using large models for knowledge retrieval, the accuracy of the answers generated by the large model is improved through the retrieval enhancement generation method.

[0003] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0004] The present disclosure provides a method, an apparatus, an electronic device, a computer-readable storage medium, a computer program product, and an intelligent agent for data query.

[0005] According to one aspect of the present disclosure, a method for data query is provided, comprising: receiving a query input input by a user; performing intent recognition based on the query input using a deep learning model to obtain one or more sub-query tasks corresponding to the user input; executing the one or more sub-query tasks in at least one predetermined database; and obtaining query results corresponding to the one or more sub-query tasks from the at least one predetermined database.

[0006] According to another aspect of the present disclosure, a device for data query is provided, including: a receiving unit, configured to receive a query input input by a user; an intention recognition unit, configured to perform intention recognition based on the query input using a deep learning model to obtain one or more sub-query tasks corresponding to the user input; a query unit, configured to execute the one or more sub-query tasks in at least one predetermined database; and a query result acquisition unit, configured to acquire query results corresponding to the one or more sub-query tasks from the at least one predetermined database.

[0007] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in accordance with an embodiment of the present disclosure.

[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is further provided, wherein the computer instructions are used to enable a computer to execute the method according to the embodiment of the present disclosure.

[0009] According to another aspect of the present disclosure, a computer program product is further provided, including a computer program, wherein when the computer program is executed by a processor, the method according to the embodiment of the present disclosure is implemented.

[0010] According to another aspect of the present disclosure, an intelligent agent is further provided, which is configured to execute the method described according to the embodiment of the present disclosure.

[0011] According to one or more embodiments of the present disclosure, a query input entered by a user in a natural language manner may be converted into one or more sub-query tasks, thereby improving the accuracy of retrieval.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0014] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0015] Figure 2 An exemplary flow chart of a method for data query according to an embodiment of the present disclosure is shown;

[0016] Figure 3 An exemplary process of a data query method according to an embodiment of the present disclosure is shown;

[0017] Figure 4An exemplary process of performing a query in a code base according to an embodiment of the present disclosure is shown;

[0018] Figure 5 An exemplary block diagram of a device for data query according to an embodiment of the present disclosure is shown;

[0019] Figure 6 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0021] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0022] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0023] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0024] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0025] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the method for data query according to an embodiment of the present disclosure.

[0026] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0027] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0028] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to receive user input and provide output results to the user. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0029] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0030] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0031] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0032] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0033] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0034] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0035] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0036] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0037] Figure 1The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0038] In the intelligent question and answer generation scenario, since the large model (also called the large language model) lacks knowledge of databases for private domain knowledge (such as code libraries, knowledge bases for specific types of information), it is also difficult to train private domain knowledge into the model (there are difficulties such as high training costs, long cycles, poor adaptability, and untimely updates).

[0039] In order to improve the accuracy of answers provided for private domain knowledge, the Retrieval Augmented Generation (RAG) method is widely used. By using the query results of private domain knowledge such as code bases / knowledge bases / web searches as context, the answers generated by the large language model are made more accurate.

[0040] The RAG method has some limitations in practical applications:

[0041] 1. Non-standard nature of user queries: Natural language queries entered by users may be unclear, inaccurately worded, or lack professional terminology, making it difficult for the system to accurately understand the user’s true intentions.

[0042] 2. Limited retrieval accuracy: Due to insufficient understanding of user intent, the retrieval stage may not be able to accurately locate the most relevant knowledge, resulting in a decrease in the quality of the generated answers.

[0043] 3. Lack of intent recognition and decomposition: Existing methods directly process the user's original query, lack the intent recognition and sub-task decomposition of complex queries, and cannot provide accurate retrieval plans for multi-level questions.

[0044] 4. Single retrieval method: Existing RAG methods are usually only capable of keyword retrieval and relevance matching, and are unable to deeply understand and utilize the structure and semantic information of the code. They are unable to extract key information to specify a specific range for precise search, which limits the ability to identify and retrieve complex code patterns. This limitation limits the accuracy and relevance of query results.

[0045] 5. Unable to dynamically acquire new knowledge: When the information required by the user does not exist in the model's knowledge base, the existing RAG method cannot perform network retrieval to obtain the latest or model-unknown knowledge, resulting in insufficient completeness and timeliness of the answer.

[0046] 6. Lack of utilization of code base meta-information: Existing methods usually do not build and utilize the meta-information of the code base in advance, such as code summary, dependencies, programming language, code architecture, startup and build information, etc. This meta-information plays an important role in understanding the overall structure of the code base, optimizing retrieval and improving the professionalism of answers.

[0047] In order to further improve the retrieval accuracy of the retrieval enhancement generation method, the present disclosure provides a new method for data query. The principle of the present disclosure is described below by taking data query in a question-and-answer interaction scenario as an example. However, it is understandable that the data query method provided by the present disclosure can also be applied to other scenarios without departing from the principles of the present disclosure.

[0048] Figure 2 An exemplary flow chart of a method for data query according to an embodiment of the present disclosure is shown.

[0049] In step S202, query input information input by a user is received.

[0050] In step S204, the deep learning model is used to perform intent recognition based on the query input information to obtain a sub-query task corresponding to the user input.

[0051] In step S206, the sub-query task is executed in the predetermined database.

[0052] In step S208, a query result corresponding to the sub-query task is obtained from a predetermined database.

[0053] By using the method provided by the embodiments of the present disclosure, the query input entered by the user in natural language can be converted into one or more sub-query tasks, thereby improving the accuracy of the retrieval. By identifying the intent of the user's query input and generating one or more sub-query tasks for different query intents according to the identified intent, the complex retrieval intent of the user can be searched separately in a targeted manner, thereby better realizing the user's intent.

[0054] The principles of the present disclosure will be described in detail below.

[0055] In step S202, a query input input by a user is received. The query input includes input information in natural language form. For example, the content input by the user may include one or more query questions. The user may perform question-and-answer interaction with a generative model (such as a large language model) in natural language. In the example, the user may input query information in natural language form into the generative model, and obtain the output provided by the generative model as a question-and-answer result. After obtaining the original query input provided by the user, the original query input may be preprocessed, including natural language processing operations such as early return of common words, word segmentation, part-of-speech tagging, disambiguation, and removal of stop words. The above method can be used to normalize user input, eliminate noise and ambiguity, and improve model processing efficiency and accuracy.

[0056] In step S204, the deep learning model is used to perform intent recognition based on the query input to obtain one or more sub-query tasks corresponding to the user input.

[0057] In some embodiments, the deep learning model can be a supervised fine-tuning SFT model. Various open source or non-open source pre-trained models (such as BERT, GPT, Wenxinyiyan, etc.) can be used as the initial model. The model can be supervised and fine-tuned by collecting user query data in specific fields on the Internet and manually annotating it, so that the trained SFT model can meet the retrieval requirements of specific fields. The trained SFT model is used to process the user's query input, which can identify the explicit and implicit intentions in the user's query and split complex queries into multiple sub-queries. In the example, the SFT model is a model for natural language processing, not a model for image processing. According to experimental results, the method provided in the embodiments of the present disclosure has a better effect on natural language queries.

[0058] By using a deep learning model to analyze user input, it is possible to deeply understand the intent of the user input and convert complex or ambiguous natural language queries into clear, structured intent representations. In this way, when the query information input by the user includes query intents involving multiple different databases and / or query intents for different types and ranges of data in the database, the model can decompose the complex intent of the user input into multiple simple intents and generate corresponding simple query tasks, thereby improving the accuracy and efficiency of subsequent retrieval and generation. Without departing from the principles of the present disclosure, other types of models can also be used to analyze the user's query input to achieve query task generation.

[0059] In some embodiments, step S204 may include: inputting the query input information and the prompt information into a deep learning model for intent recognition. For example, the query input information and the prompt information may be input into the deep learning model together. The prompt information may include historical query input information of the current session, user-specified information, and retrieval capability information supported by a predetermined database.

[0060] By inputting historical query inputs in the session into the deep learning model, the model can reason about current needs based on the user's historical needs, providing additional information for the model to reason about the user's current retrieval needs, improving the comprehensiveness of the model's understanding of the user's current input content, and further improving the accuracy of intent recognition, thereby improving the accuracy and efficiency of subsequent retrieval.

[0061] In the example, the user-specified information may include a user-specified knowledge set, a user-provided knowledge link, a code library identifier currently used by the user, etc. Providing the above user-specified information together with the query input to the deep learning model helps the deep learning model better understand the user's intention. In addition, by providing the deep learning model with information such as the retrieval capabilities supported by the database (such as query language, supported retrieval formulas), the deep learning model can directly output query tasks that can be executed, thereby improving retrieval efficiency.

[0062] By performing intent recognition and task splitting on the query input, a query plan including clear retrieval targets, retrieval types, retrieval keywords, and retrieval strategies can be generated. The above method can provide clear guidance for the retrieval process, improve the pertinence and efficiency of the retrieval, and avoid information omissions and deviations. In some embodiments, the sub-query task generated in step S204 is structured information including at least two query parameters. Exemplary query parameters include at least one of the following: a predetermined database identifier, a search scope, a search action, a search formula, a specified website, and a regular search description.

[0063] In step S206, one or more sub-query tasks are executed in at least one predetermined database. In some embodiments, the one or more sub-query tasks may include a first sub-query task for a first predetermined database and a second sub-query task for a second predetermined database. The first predetermined database may be different from the second predetermined database. In the example, the first predetermined database may be a code library, and the second predetermined database may be a knowledge base in a specific field. In addition to the above examples, the multiple sub-query tasks generated in step S204 can also support a larger number of different types of predetermined databases at the same time. By splitting the user's query input into sub-query tasks for different types of predetermined databases, the accuracy and completeness of data queries can be improved.

[0064] In some embodiments, each of the at least one predetermined database may include data slices and global data information.

[0065] In the data query task of the related art, the information in the database is divided into data slices by using a slicing vectorization method. Each data slice can have the same size and format, such as a function format or a file format. The above slicing vectorization method can improve the efficiency of retrieval, but the retrieval will only face fragmented data information, and it is difficult to know the global information of the database.

[0066] In order to solve the above problems, in the data query method provided in the embodiment of the present invention, when constructing a predetermined database, on the basis of slicing and vectorizing the information in the database, global data information of the database is also generated, so that in subsequent data query tasks, content related to the global information of the database can be easily retrieved.

[0067] Taking the predetermined database as a code base as an example, the global data information of the code base may include at least one of summary information (such as the role, function, application scenario, etc. of the code base), component architecture information, technology stack information, and API list information. Among them, the code base meta information can be summarized with the help of at least one of a large language model and engineering means to obtain the global data information. Examples of engineering means include language recognition of the code base, finding the entry, dependent files or build files of the code base, so that the information in the code base can be globally summarized and summarized, providing background and summary knowledge for subsequent data query tasks.

[0068] By using the query plan formed by one or more sub-query tasks generated in step S204, a search can be performed in the pre-built predetermined database. The search algorithm can integrate keyword matching, semantic similarity calculation, code structure analysis, regular matching, network search and other technologies. Using the above method, knowledge related to the user's intention can be accurately located from a massive code base, and high-quality reference materials that can match the user's query intention with a high degree of matching can be obtained.

[0069] In step S208, query results corresponding to one or more sub-query tasks are obtained from at least one predetermined database.

[0070] In some embodiments, method 200 may further include: inputting the query result and the query input together into a generative model to obtain feedback for the query input.

[0071] In some embodiments, information about a database used to obtain query results may also be provided to the generative model, so that the generative model can understand the source of the query results, and enable the generative model to generate high-quality responses to the query input that are highly matched to the user's query intent.

[0072] The feedback provided by the generative model can be information in the form of natural language or in multimodal forms such as audio and images.

[0073] By applying the data query method provided by the embodiment of the present disclosure to the question-answer interaction between users and generative models, the generative model can be provided with private domain knowledge retrieval results that are consistent with the user's query intent, thereby improving the accuracy of feedback generated by the generative model.

[0074] In some embodiments, method 200 may further include a feedback optimization step. User queries, background knowledge, and generated answers may be collected by means of data reflux, and each module of the system may be evaluated and optimized by means of a large model, including optimizing the data query method by adjusting the SFT model, updating the prompt, and adding retrieval means. Continuous feedback and optimization can improve the performance and accuracy of the query system to better meet user needs.

[0075] Figure 3 An exemplary process of a data query method according to an embodiment of the present disclosure is shown.

[0076] At step 301 , the method starts.

[0077] At step 302, user query input and information related to the user query input, such as knowledge set information specified by the user or related to the query operation, may be obtained.

[0078] At step 303, prompt information may be determined. The context information of the user query input, historical input, current question, etc. may be assembled as prompt information for the intent recognition model.

[0079] At step 304, the query input and prompt information can be processed using the SFT model for intent recognition to determine the user intent. Exemplary user intent determination results may include no need for retrieval 305-1, code base retrieval 305-2 (semantic retrieval, keyword retrieval, regular matching, file reading, metadata reading and other code base related actions), Internet retrieval 305-3 (network search segmentation, semantic retrieval, web page reading and other actions), knowledge set retrieval 305-4 (knowledge set segmentation, semantic retrieval and other actions), web page retrieval 305-5 (web page reading and other actions), and any other suitable database retrieval actions.

[0080] At step 306, search action matching may be performed, for example, matching the identified search action intention with the search capabilities supported by the search library, and generating a search strategy including a search formula.

[0081] At step 307, a multiple search may be performed on one or more predetermined databases.

[0082] At step 308, the search results of the various predetermined databases involved in the search strategy may be mixed and rearranged.

[0083] At step 309, the search rules and results may be assembled to obtain prompt information of a large language model for requesting questions and answers.

[0084] At step 310, the user query input and the prompt information generated at step 309 may be input into the request question answering model together, and the question answering result output by the large language model may be obtained.

[0085] At step 311 , the method ends.

[0086] In summary, the embodiments of the present disclosure significantly improve the performance of the query method in terms of retrieval efficiency, user experience, and system flexibility by optimizing the natural language query process and combining historical data and multiple retrieval tools.

[0087] Through the pre-intention recognition module, the user's natural language query is split into a more clear query plan, so as to obtain more accurate and relevant knowledge in the retrieval process. This optimization greatly improves the retrieval quality of the RAG (Retrieval-Augmented Generation) model, and can reduce the problems of misunderstanding and lack of relevance compared with direct natural language queries.

[0088] In addition, the query method provided by the present disclosure can also continuously correct and narrow the search scope in combination with the user's historical questions. This dynamic adjustment makes the search results more accurate and improves the accuracy and relevance of the answers.

[0089] Furthermore, in the query method provided by the present disclosure, the user can obtain accurate search results without having to make complex grammatical adjustments to the query or understand the specific details of the database, such as the code base. This convenience helps to improve user satisfaction and usage frequency, and can better meet user needs.

[0090] Furthermore, through effective intent recognition and query splitting, the query method provided by the present disclosure can locate relevant information more quickly and reduce user waiting time. At the same time, by identifying issues unrelated to the code base, unnecessary search processes can be reduced, resource usage can be optimized, and the user experience can be smoother.

[0091] Furthermore, the query method provided by the present disclosure adopts a flexible intent recognition mechanism, which can easily adapt to the database knowledge retrieval needs of different fields and topics. In addition, the intent recognition function can continuously expand the retrieval tools according to the user scenario, such as knowledge graphs, pre-built summary and inductive knowledge, network search, regular matching, etc. The modular design of the system facilitates subsequent technology iteration and function expansion, and is more flexible and has long-term competitive advantages compared to fixed architecture products on the market.

[0092] Figure 4 An exemplary process of performing a query in a code base according to an embodiment of the present disclosure is shown.

[0093] At 401 , the method starts.

[0094] At 402, a search action for a code base is determined. Figure 2 The described SFT model generates retrieval actions corresponding to sub-query tasks based on query input.

[0095] Exemplary search actions for code bases include code base global search 403, specified folder search 408, and specified file search 412. Among them, code base global search 403 may include meta information search 404, such as search for code base summary 4041, dependency build information 4042, technology stack architecture information 4043, and other related meta information. Code base global search 403 may also include keyword search 405, semantic search 406, regular matching 407, and any other suitable global information search actions. Among them, regular matching 407 may include calling a model to generate a regular expression 4071. In the example, when the SFT model recognizes the regular matching search intention for, a regular expression matching the user's search intention can be generated based on the information of the code base to be searched. Using the above method, the user does not need to query the regular expression required for the search by himself. In addition, because regular expressions do not have real semantic information, it is difficult to understand the meaning of regular expressions through natural language processing. Regular expressions cannot be processed correctly when semantic matching is used for retrieval in related technologies. By providing information to the SFT model, the SFT model can understand the meaning of the regular expression in the database, so that it can adaptively search according to the predetermined regular expression rules in the database when executing the query task in the predetermined database, avoiding the failure to retrieve the expected results due to the difference between the expression in the user query input and the expression of the regular expression.

[0096] The specified folder search 408 may include keyword search 409, semantic search 410, regular expression matching 411, and any other suitable folder search actions, wherein matching 411 may include calling a model to generate a regular expression 4111.

[0097] The specified file retrieval 412 may include full-text reading 413 , knowledge graph retrieval 414 , and the like.

[0098] At step 415, the method ends.

[0099] Figure 5 An exemplary block diagram of a device for data query according to an embodiment of the present disclosure is shown. Figure 5 The device 500 shown implements the combination Figure 2 Describes the methods used for data querying.

[0100] like Figure 5 As shown, the device 500 may include a receiving unit 510 , an intention recognition unit 520 , a query unit 530 , and a query result acquisition unit 540 .

[0101] The receiving unit 510 may be configured to receive query input information input by a user. The intention recognition unit 520 is configured to use a deep learning model to perform intention recognition based on the query input information to obtain a sub-query task corresponding to the user input. The query unit 530 is configured to execute the sub-query task in a predetermined database. The query result acquisition unit 540 is configured to acquire a query result corresponding to the sub-query task from a predetermined database.

[0102] In some embodiments, the deep learning model is a supervised fine-tuning model.

[0103] In some embodiments, the sub-query task includes a first sub-query task for a first predetermined database and a second sub-query task for a second predetermined database, wherein the first predetermined database is different from the second predetermined database.

[0104] In some embodiments, the predetermined database includes data slices and global data information.

[0105] In some embodiments, the predetermined database includes a code base, and the global data information of the code base includes at least one of summary information, component architecture information, technology stack information, and API list information.

[0106] In some embodiments, using a deep learning model to perform intent recognition based on query input information includes: inputting query input information and prompt information into the deep learning model to perform intent recognition, wherein the prompt information includes historical query input information of the current session, user-specified information, and retrieval capability information supported by a predetermined database.

[0107] In some embodiments, the sub-query task includes structured information of at least two query parameters.

[0108] In some embodiments, the query parameters include at least one of the following: a predetermined database identifier; a search scope; a search action; a search formula; a specified website; and a regular search description.

[0109] In some embodiments, the apparatus further comprises: inputting the query result and the query input information into a generative model to obtain output feedback for the query input information.

[0110] It should be understood that Figure 5 The various modules or units of the apparatus 500 shown in FIG. 5 can be used in conjunction with the reference Figure 2 The steps in the method 200 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 200 are also applicable to the device 500 and the modules and units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

[0111] Although specific functionality is discussed above with reference to specific modules, it should be noted that the functionality of the various units discussed herein may be separated into multiple units, and / or at least some functionality of multiple units may be combined into a single unit.

[0112] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0113] According to an embodiment of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described according to an embodiment of the present disclosure.

[0114] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is further provided, wherein the computer instructions are used to enable a computer to execute the method according to the embodiment of the present disclosure.

[0115] According to an embodiment of the present disclosure, a computer program product is further provided, including a computer program, wherein when the computer program is executed by a processor, the method according to the embodiment of the present disclosure is implemented.

[0116] According to an embodiment of the present disclosure, an intelligent agent is also provided, including: an input module for receiving input information; a processing module for determining a target task based on the input information received by the input module, determining a query model based on the target task, and executing a method according to an embodiment of the present disclosure by calling the query model to obtain a query result for the input information; and an output module for outputting the output information obtained by the processing module.

[0117] The intelligent agent is an advanced artificial intelligence system with a large model as its core reasoning engine. It not only has the language understanding and generation capabilities of the large model, but can also solve various complex problems efficiently and flexibly, further releasing the machine intelligence contained in the large language model, thereby providing users with more accurate and personalized services.

[0118] refer to Figure 6 , a block diagram of an electronic device 600 that can be used as a server, client, or agent of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0119] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0120] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device that can input information to the electronic device 600. The input unit 606 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 607 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 608 can include but is not limited to a disk, an optical disk. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0121] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).

[0122] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0123] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0124] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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, or any suitable combination of the foregoing.

[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0126] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0127] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0128] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0129] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A method for data query, comprising: Receive query input information entered by the user; Using a deep learning model to perform intent recognition based on the query input information to obtain a sub-query task corresponding to the user input; Execute the sub-query task in a predetermined database; as well as A query result corresponding to the query task is obtained from the predetermined database.

2. The method of claim 1, wherein: The deep learning model is a supervised fine-tuning model.

3. The method of claim 1, wherein: The sub-query task includes a first sub-query task for a first predetermined database and a second sub-query task for a second predetermined database, wherein the first predetermined database is different from the second predetermined database.

4. The method of claim 1, wherein: The predetermined database includes data slices and global data information.

5. The method of claim 4, wherein: The predetermined database includes a code base, and the global data information of the code base includes at least one of summary information, component architecture information, technology stack information, and API list information.

6. The method according to any one of claims 1 to 5, wherein: The using a deep learning model to perform intent recognition according to the query input information includes: The query input information and prompt information are input into the deep learning model for intent recognition, wherein the prompt information includes historical query input information of the current session, user-specified information, and retrieval capability information supported by a predetermined database.

7. The method according to any one of claims 1 to 5, wherein: The sub-query task includes structured information of at least two query parameters.

8. The method of claim 7, wherein: The query parameter includes at least one of the following: Predetermined database identifier; Search scope; Retrieve action; Search formula; Designated website; Regular search description.

9. The method according to any one of claims 1 to 5, further comprising: The query result and the query input information are input into a generative model to obtain output feedback for the query input information.

10. A device for data query, comprising: A receiving unit, configured to receive query input information input by a user; an intention recognition unit, configured to use a deep learning model to perform intention recognition according to the query input information to obtain a sub-query task corresponding to the user input; A query unit, configured to execute the sub-query task in a predetermined database; as well as The query result obtaining unit is configured to obtain the query result corresponding to the sub-query task from the predetermined database.

11. The device of claim 10, wherein: The deep learning model is a supervised fine-tuning model.

12. The device of claim 10, wherein: The sub-query task includes a first sub-query task for a first predetermined database and a second sub-query task for a second predetermined database, wherein the first predetermined database is different from the second predetermined database.

13. The device of claim 10, wherein: The predetermined database includes data slices and global data information.

14. The device of claim 13, wherein: The predetermined database includes a code base, and the global data information of the code base includes at least one of summary information, component architecture information, technology stack information, and API list information.

15. The device according to any one of claims 10 to 14, wherein: The using a deep learning model to perform intent recognition according to the query input information includes: The query input information and prompt information are input into the deep learning model for intent recognition, wherein the prompt information includes historical query input information of the current session, user-specified information, and retrieval capability information supported by a predetermined database.

16. The device according to any one of claims 10 to 14, wherein: The sub-query task includes structured information of at least two query parameters.

17. The device of claim 16, wherein: The query parameter includes at least one of the following: Predetermined database identifier; Search scope; Retrieve action; Search formula; Designated website; Regular search description.

18. The apparatus of any one of claims 10 to 14, further comprising: A feedback unit is configured to input the query result and the query input together into a generative model to obtain feedback for the query input.

19. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.

21. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

22. An intelligent agent, comprising: An input module, used for receiving input information; a processing module, configured to determine a target task based on the input information received by the input module, determine a query model based on the target task, and obtain a query result for the input information by calling the query model to execute the method according to any one of claims 1 to 9; An output module is used to output the output information obtained by the processing module.

Citation Information

Patent Citations

  • Open type intelligent customer service system based on deep learning

    CN113821621A

  • Data management method, system and equipment and storage medium

    CN117453712A

  • Omni-platform question answering system

    US20190138660A1

  • Method and system for processing unclear intent query in conversation system

    US20200279002A1

Cited By

  • Multi-intelligent-agent physical examination enhancement generation system and question answering method, equipment and product thereof

    CN120706536A