Index query method and device, electronic equipment and medium
By matching user input information with query task mapping table, obtaining subquery tasks and using parameter templates and interfaces, the problem of high calculation cost of large-model query strategies is solved, and fast and flexible business query system docking and reducing development costs are achieved.
Patent Information
- Application Number
- CN202510354366.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-03-25
AI Technical Summary
The existing large-model query strategies have high calculation costs, long time, and low planning inconsistency and reliability, making it difficult to quickly and flexibly connect with the business query system.
By matching user input information with the preset query task mapping table, subquery tasks are obtained, and query results are directly obtained using parameter templates and query interfaces, reducing dependence on large models and decoupling of tasks.
It reduces calculation and time costs, ensures rapid query and business relevance of subquery tasks, flexibly responds to business adjustments, and reduces development costs.
Smart Images

Figure CN120336350A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large models, and particularly to a query indexing method, device, electronic device and medium. Background Art
[0002] Processing complex query transactions has always been a difficult problem faced by large model technologies. And with the implementation of large models in many industries, how to flexibly and quickly connect large models to existing business query systems and fully realize business query automation has also become one of the current problems.
[0003] In the face of the above problems, existing solutions for processing complex query transactions usually adopt the method of decomposition and planning. It mainly has two strategies in query task decomposition, including decomposition first and interleaved decomposition.
[0004] Decomposition-First Methods decomposes the query task into sub-query goals and formulates plans for each sub-query goal in turn. This strategy ensures the strong correlation between the sub-query tasks and the original query task, reducing the risks of task forgetting and hallucination.
[0005] Interleaved Decomposition Methods interleaves between query task decomposition and sub-query task planning, revealing only one or two sub-query tasks of the current state each time. This strategy can dynamically adjust task decomposition according to environmental feedback, improving fault tolerance to a certain extent.
[0006] However, both of the above two strategies completely rely on large models for query task decomposition, resulting in the infeasibility of the generated sub-query tasks and low relevance to the business.
[0007] The process of plan generation usually consists of two steps: multi-plan generation and optimal plan selection. Among them, the multi-plan generation stage can be considered as an attempt to generate a series of possible plans; while the optimal plan selection stage means selecting the best one from multiple candidate plans.
[0008] This generation strategy can theoretically provide users with efficient and innovative plans. However, in practice, each step requires a large amount of time and computational cost, and the randomness of large models themselves leads to different plans for the same problem, making it difficult to ensure the consistency and reliability of the plans. Summary of the Invention
[0009] The present invention provides a query indexing method, device, electronic device and medium, which are used to solve the technical problem of high computational cost and long computational time of existing large model query strategies.
[0010] According to one aspect of the present invention, there is provided a query index method, including:
[0011] Obtaining the input information of the user;
[0012] Matching the input information with sub-query tasks in a preset query task mapping table to obtain at least one of the matched sub-query tasks;
[0013] Obtaining parameter templates corresponding to at least one of the sub-query tasks, and normalizing the query parameters of the sub-query tasks based on the parameter templates;
[0014] Invoking the query interfaces of at least one of the sub-query tasks to obtain the normalized query parameters of at least one of the sub-query tasks, so as to output the query results of each of the sub-query tasks; the query task mapping table includes a plurality of the sub-query tasks, and each sub-query task corresponds to one of the parameter templates and one of the query interfaces.
[0015] Optionally, the matching the input information with sub-query tasks in a preset query task mapping table to obtain at least one of the matched sub-query tasks includes:
[0016] Extracting keywords of the input information;
[0017] Performing similarity matching on the keywords of the input information and the keywords of the sub-query tasks, and determining at least one of the sub-query tasks that matches the input information based on the similarity value;
[0018] Alternatively, performing similarity matching on the keywords of the input information and the keywords of the parent query task, and determining at least one of the parent query tasks that matches the input information based on the similarity value, and further obtaining at least one of the sub-query tasks that matches the input information; the parent query task corresponds to at least one of the sub-query tasks.
[0019] Optionally, the matching the input information with sub-query tasks in a preset query task mapping table to obtain at least one of the matched sub-query tasks includes:
[0020] Performing context reasoning on the input information by a large model, and performing similarity matching on the reasoning result and the task templates of each sub-query task to obtain at least one of the matched sub-query tasks; each of the task templates corresponds to at least one of the sub-query tasks.
[0021] Optionally, the matching the input information with sub-query tasks in a preset query task mapping table to obtain at least one of the matched sub-query tasks includes:
[0022] Inference is performed by a large model based on the input information;
[0023] And the inference result is matched with the task description of the sub - query task to obtain at least one of the sub - query tasks that match the input information;
[0024] Alternatively, the inference result is matched with the task description of the parent query task to obtain at least one of the parent query tasks that match the input information, and further obtain at least one of the sub - query tasks that match the input information; the parent query task corresponds to at least one sub - query task.
[0025] Optionally, after matching the input information with the sub - query tasks in the pre - set query task mapping table to obtain at least one of the sub - query tasks that are matched, the following is further included:
[0026] Each of the sub - query tasks is assigned to a separate thread for processing.
[0027] Optionally, the following is further included:
[0028] Add, delete, and modify the task names, task features, parameter templates, and query interfaces of the parent query tasks or sub - query tasks in the query task mapping table according to requirements.
[0029] Optionally, the following is further included:
[0030] Query parameters are extracted based on the context of the input information, user information, and user preferences and used as normalized query parameters.
[0031] According to another aspect of the present invention, a query index device is provided, including:
[0032] An information acquisition unit for acquiring the input information of the user;
[0033] A task matching unit for matching the input information with the sub - query tasks in the pre - set query task mapping table to obtain at least one of the sub - query tasks that are matched;
[0034] A normalization processing unit for obtaining the parameter templates corresponding to at least one of the sub - query tasks and performing normalization processing on the query parameters of the sub - query tasks based on the parameter templates;
[0035] A query unit, configured to call the query interfaces of at least one of the sub-query tasks, obtain the normalized query parameters of at least one of the sub-query tasks, and output the query results of each of the sub-query tasks; the query task mapping table includes a plurality of the sub-query tasks, and each sub-query task corresponds to a parameter template and a query interface respectively.
[0036] According to another aspect of the present invention, there is provided an electronic device, which includes:
[0037] At least one processor; and
[0038] A memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the query index method according to any embodiment of the present invention.
[0040] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the query index method according to any embodiment of the present invention when executed.
[0041] The technical solution of the embodiment of the present invention matches the input information of the user with the sub-query tasks in the preset query task mapping table to obtain at least one matched sub-query task, and each sub-query task has a corresponding call interface and parameter template in the query task mapping table. Thus, there is no need to call a large model for task planning, which reduces the calculation and time costs and ensures the fast query of the generated sub-query tasks.
[0042] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0044] Figure 1 It is a flowchart showing two decomposition methods for a large model to decompose query tasks in the prior art;
[0045] Figure 2 is a flowchart of a query index method provided according to Embodiment 1 of the present invention;
[0046] Figure 3 is a structural diagram of a query index device provided according to Embodiment 2 of the present invention;
[0047] Figure 4 is a schematic structural diagram of an electronic device for implementing the query index method of the embodiments of the present invention. Detailed implementation manners
[0048] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0050] With the implementation of large models in many industries, how to flexibly and quickly connect large models to existing business query systems and fully realize business query automation has also become one of the problems faced currently. To solve this type of problem, existing large models usually adopt a decomposition and planning method when dealing with complex query transactions.
[0051] There are mainly two strategies in query task decomposition, as shown in the appendix Figure 1 :
[0052] Figure 1 On the left is the Decomposition-First Methods strategy, that is, decomposing the query task into sub-query goals and formulating plans for each sub-query goal in turn. This strategy ensures the strong correlation between the sub-query tasks and the original query task, reducing the risks of task forgetting and hallucination.
[0053] Figure 1 On the right is the Interleaved Decomposition Methods strategy, that is, interleaving between query task decomposition and sub-query task planning, and only revealing one or two sub-query tasks of the current state each time. This strategy can dynamically adjust task decomposition according to environmental feedback, improving fault tolerance to a certain extent. However, both of the above strategies completely rely on large models for query task decomposition, resulting in the difficulty of ensuring the feasibility of the generated sub-query tasks and their low relevance to the business.
[0054] The planning generation process generally consists of two steps: multi-plan generation and optimal plan selection. The multi-plan generation stage can be considered as an attempt to generate a series of possible plans; the optimal plan selection stage is to select the best one from multiple candidate plans. This generation strategy can theoretically provide users with efficient and innovative plans. However, in practice, each step requires a large amount of time and computational cost, and the randomness of the large model itself may result in different plans for the same problem, making it difficult to ensure the consistency and reliability of the plan.
[0055] On the other hand, regarding the issue of docking between the business query system and the large model, enterprises will select a suitable large model according to business needs and provide business data to fine-tune the model. At the same time, it is also necessary to develop a query interface for the business system to interact with the large model. This method has good stability and scalability to support high-concurrency and complex business scenarios. However, this method is difficult to quickly dock when the business is adjusted, and it is necessary to re-perform tasks such as model fine-tuning and query interface development, with low flexibility and portability.
[0056] To solve the above two problems, the present invention matches the user's input information with the sub-query tasks in the preset query task mapping table to obtain at least one matched sub-query task. Then, the large model can directly call the call interface and parameter template in the sub-query task in the query task mapping table to obtain query parameters. By adopting this method of completely decoupling the large model and the business query system, there is no need to call the large model for task planning, which greatly reduces the computational and time costs in the query process of the large model and ensures the fast query of the generated sub-query tasks. In addition, by setting the task templates, keywords, and task descriptions of each parent query task and sub-query task in the query task mapping table, it is easier for the large model to match relevant sub-query tasks for the input information. Even when facing incomplete and ambiguous user inputs, it can ensure the absolute relevance of the decomposed sub-query tasks to the business. Finally, since the present application completely decouples the large model and the business query system, when the business needs to be adjusted, only the content in the query task mapping table needs to be adjusted, without the need to fine-tune the large model or re-develop the task query interface, greatly reducing the development cost.
[0057] The present application will introduce the solution of the present invention in detail through the following embodiments.
[0058] Embodiment 1
[0059] Figure 2 The flowchart of a query index method is provided for Embodiment 1 of the present invention. As Figure 2 shown, the method includes:
[0060] S101. Obtain user input information.
[0061] The user input can be voice input or text input. If it is voice input, a speech recognition algorithm can be used to recognize the user input voice and convert it into text.
[0062] S102. Match the input information with sub-query tasks in a pre-set query task mapping table to obtain at least one of the matched sub-query tasks.
[0063] Among them, the query task mapping table is a pre-set table designed to build the mapping relationship between sub-query tasks, parameter templates, and query interfaces, so that the large model can directly obtain the sub-query tasks matching the input information and call the query interfaces of the sub-query tasks to obtain query parameters.
[0064] In this embodiment, there are multiple methods to match the input information with the sub-query tasks in the pre-set query task mapping table. For example, the keywords of the input information can be extracted and the keywords of the input information can be matched with the keywords of the sub-query tasks, so as to match at least one sub-query task corresponding to the input information.
[0065] S103. Obtain the parameter templates corresponding to at least one of the sub-query tasks, and normalize the query parameters of the sub-query tasks based on the parameter templates.
[0066] The parameter template is used to define the normalized form of query parameters. In a specific query, the large model can match the user input information with the parameter templates corresponding to the sub-query tasks and obtain the query parameters after normalization for each sub-query task, so that each sub-query task corresponds to normalized parameters, thereby improving the model accuracy and model efficiency.
[0067] S104. Call the query interfaces of at least one of the sub-query tasks to obtain the normalized query parameters of at least one of the sub-query tasks, so as to output the query results of each sub-query task; the query task mapping table includes multiple sub-query tasks, and each sub-query task corresponds to one parameter template and one query interface respectively.
[0068] In this embodiment, when a corresponding sub-query task needs to be executed, the query interface corresponding to the sub-query task can be directly called, and the normalized query parameters corresponding to the query interface can be obtained. Using the normalized query parameters as the input of the large model, the query result of the sub-query task can be quickly obtained.
[0069] The technical solution of the embodiment of the present invention matches the input information of the user with the sub-query tasks in the preset query task mapping table to obtain at least one matched sub-query task. Each sub-query task has a corresponding call interface and parameter template in the query task mapping table. Therefore, there is no need to call the large model for task planning, which reduces the calculation and time costs and ensures the fast query of the generated sub-query tasks.
[0070] In one embodiment, step S102 matches the input information with the sub-query tasks in the preset query task mapping table to obtain at least one of the matched sub-query tasks, which may specifically include:
[0071] Extract the keywords of the input information;
[0072] Perform a similarity match between the keywords of the input information and the keywords of the sub-query task, and determine at least one of the sub-query tasks that matches the input information based on the similarity value;
[0073] Alternatively, perform a similarity match between the keywords of the input information and the keywords of the parent query task, and determine at least one of the parent query tasks that matches the input information based on the similarity value, and then obtain at least one of the sub-query tasks that matches the input information; the parent query task corresponds to at least one of the sub-query tasks.
[0074] It should be noted that the large model can perform word segmentation and vectorization processing on the input information of the user. Word segmentation is to decompose the text input by the user into individual words or sub-word units. For example, for the sentence "I like artificial intelligence", it may be segmented into units such as "I", "like", and "artificial intelligence". Vectorization is to convert these word or sub-word units into vector representations in a vector space, and each vector contains semantic and syntactic information of the vocabulary. Different words have different positions and features in the vector space, and in this way, the text information is converted into a digital form that can be processed by a computer.
[0075] In this embodiment, keywords for each sub-query task and the parent query task can be preset in the query task mapping table. For example, when the parent query task is food recommendation, its corresponding keywords can include food, restaurant, etc. Moreover, each parent query task can correspond to multiple sub-query tasks. For example, when the parent query task is food recommendation, its corresponding sub-query tasks can include querying according to per capita consumption and querying according to geographical location. Similarly, each sub-query task can correspond to multiple keywords. For example, the keywords for querying according to per capita consumption can include cost performance, affordability, etc., and the keywords for querying according to geographical location can include nearby, kilometers, etc.
[0076] In this embodiment, the keywords of the input information and the keywords of the sub-query tasks can both be converted into vector forms, and the similarity is calculated in the vector space. Then, at least one parent query task or sub-query task that is closest to the input information is determined according to the similarity value. When the matched task is a parent query task, at least one sub-query task corresponding to the parent query task is also matched with the input information.
[0077] In one embodiment, step S102 of matching the input information with the sub-query tasks in the preset query task mapping table to obtain at least one of the matched sub-query tasks may further include:
[0078] The large model performs context reasoning on the input information, and performs similarity matching between the reasoning result and the task template of each sub-query task to obtain at least one of the matched sub-query tasks; each task template corresponds to at least one of the sub-query tasks.
[0079] It should be noted that the task templates for each sub-query task and the parent query task can be preset in the query task mapping table. For example, for the parent query task of food recommendation, its task template can be set as: "I want to go somewhere nearby to eat something". Similarly, for each sub-query task, a similar task template can be set. After the large model performs context reasoning on the input information, it performs similarity matching between the reasoning result and the task templates of each parent query task and sub-query task to find the parent query task and sub-query task that match the input information. Since a parent query task can correspond to at least one sub-query task, that is, when the input information matches a parent query task, the sub-query tasks corresponding to the parent query task also match the input information.
[0080] In one embodiment, step S102 of matching the input information with the sub-query tasks in the preset query task mapping table to obtain at least one of the matched sub-query tasks may further include:
[0081] The large model performs reasoning based on the input information;
[0082] And perform a similarity match between the inference result and the task description of the sub-query task to obtain at least one of the sub-query tasks that matches the input information;
[0083] Alternatively, perform a similarity match between the inference result and the task description of the parent query task to obtain at least one of the parent query tasks that matches the input information, and further obtain at least one of the sub-query tasks that matches the input information; the parent query task corresponds to at least one sub-query task.
[0084] It should be noted that the task descriptions of each sub-query task and the parent query task can be preset in the query task mapping table. For example, for the parent query task of food recommendation, its task description can be: the user hopes to obtain food recommendations according to personal taste, location or other preferences; for the sub-query task of querying according to per capita consumption, its task description can be expressed as the user hopes to obtain relevant food recommendations according to a specific per capita consumption range. The large model can perform inference based on the input information, and perform a similarity match between the inference result and the task descriptions of the sub-query task and the parent query task, and use at least one sub-query task or parent query task with the highest similarity as the query task that matches the input information. In addition, since the parent query task can correspond to at least one sub-query task, that is, when the input information matches the parent query task, the sub-query tasks corresponding to the parent query task also match the input information.
[0085] In this embodiment, the query task mapping table can be as shown in Table 1 below. Only one example of the parent query task name of food recommendation is given in Table 1, and there can actually be multiple parent query tasks. The task features of the parent query tasks in Table 1 all include the task template, keywords, and task description of the parent query task. And the parent query task corresponds to two sub-query tasks, namely querying according to per capita consumption and querying according to geographical location. Similarly, each sub-query task includes keywords and task descriptions, and each sub-query task in Table 1 corresponds to a parameter template and a query interface api. This embodiment is only an exemplary illustration and not a restrictive illustration.
[0086] Table 1 Query Task Mapping Table
[0087]
[0088] In one embodiment, it further includes: allocating each of the sub-query tasks to a separate thread for processing.
[0089] In this embodiment, by matching the user input information with the sub-query tasks in the query task mapping table, at least one sub-query task that matches the input information is found. Then, each sub-query task is assigned to a separate thread for parallel processing. Each thread separately matches the user input information with the parameters in the parameter template to extract the normalized query parameters. Each thread can use the HTTP request library to concurrently call these interfaces, using the normalized query parameters as input to obtain the query results of each sub-query task.
[0090] In one embodiment, it further includes: adding, deleting, and modifying the task names, task features, parameter templates, and query interfaces of the sub-query tasks in the query task mapping table according to requirements.
[0091] When the business is adjusted, it can be achieved by modifying the task names, task features, parameter templates, and query interfaces of the parent query task or sub-query tasks in the query task mapping table for addition, deletion, and modification, without the need to fine-tune the large model or re-develop the query interfaces.
[0092] In one embodiment, it further includes: extracting query parameters based on the context of the input information, user information, and user preferences, and using them as the normalized query parameters.
[0093] For example, when the user input already contains explicit parameters or user-preferred parameters, the explicit parameters or user-preferred parameters can be directly used as the normalized parameters. For example, when the user input information contains "within 5 kilometers", and "nearby" is defined as within a range of less than or equal to 2 kilometers in the parameter template of the sub-query task, the user input "within 5 kilometers" can be directly used as the normalized distance parameter.
[0094] The technical solution of the embodiment of the present invention matches the input information of the user with the sub-query tasks in the pre-set query task mapping table to obtain at least one sub-query task that is matched. Then, the large model can directly call the call interfaces and parameter templates in the sub-query tasks in the query task mapping table to obtain query parameters. By adopting this method of completely decoupling the large model and the business query system, there is no need to call the large model for task planning, which greatly reduces the calculation and time costs in the query process of the large model and ensures the fast query of the generated sub-query tasks. In addition, by setting the task templates, keywords, and task descriptions of each parent query task and sub-query task in the query task mapping table, it is easier for the large model to match relevant sub-query tasks for the input information. Even when facing incomplete and ambiguous user inputs, it can ensure that the decomposed sub-query tasks are absolutely relevant to the business. Finally, since the present application completely decouples the large model and the business query system, when the business needs to be adjusted, only the content in the query task mapping table needs to be adjusted, without the need to fine-tune the large model or re-develop the task query interface, which greatly reduces the development cost.
[0095] Embodiment 2
[0096] Figure 3 FIG. is a schematic structural diagram of a query index device provided in Embodiment 2 of the present invention. As Figure 3 shown, the device includes:
[0097] An information acquisition unit 201, configured to acquire the input information of the user;
[0098] A task matching unit 202, configured to match the input information with the sub-query tasks in the pre-set query task mapping table to obtain at least one of the matched sub-query tasks;
[0099] A normalization processing unit 203, configured to acquire the parameter templates corresponding to at least one of the sub-query tasks, and perform normalization processing on the query parameters of the sub-query tasks based on the parameter templates;
[0100] A query unit 204, configured to call the query interfaces of at least one of the sub-query tasks, acquire the normalized query parameters of at least one of the sub-query tasks, and output the query results of each of the sub-query tasks; the query task mapping table includes a plurality of the sub-query tasks, and each sub-query task corresponds to one of the parameter templates and one of the query interfaces.
[0101] The query index device provided in the embodiment of the present invention can execute the query index method provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0102] Embodiment 4
[0103] Figure 4 FIG. 2 shows a schematic structural diagram of an electronic device 10 that can be used to implement an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, 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 processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) 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 invention described and / or claimed herein.
[0104] As Figure 4 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0105] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0106] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a query index method.
[0107] In some embodiments, a query indexing method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the query indexing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute a query indexing method by any other suitable means (e.g., by means of firmware).
[0108] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0109] The computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs may be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.
[0110] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0111] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 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 a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds 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, speech input, or tactile input).
[0112] 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 having a graphical user interface or a web browser through which the user can interact with an implementation 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), a blockchain network, and the Internet.
[0113] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0114] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0115] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A query indexing method, characterized in that, Including: Obtain the input information of the user; Match the input information with the sub-query tasks in the preset query task mapping table to obtain at least one of the matched sub-query tasks; Obtain the parameter templates corresponding to at least one of the sub-query tasks, and normalize the query parameters of the sub-query tasks based on the parameter templates; Call the query interfaces of at least one of the sub-query tasks to obtain the normalized query parameters of at least one of the sub-query tasks, so as to output the query results of each sub-query task; The query task mapping table includes a plurality of the sub-query tasks, and each sub-query task corresponds to one of the parameter templates and one of the query interfaces respectively.
2. The query index method according to claim 1, wherein The step of matching the input information with the sub-query tasks in the preset query task mapping table to obtain at least one of the matched sub-query tasks includes: Extract the keywords of the input information; Perform a similarity match on the keywords of the input information and the keywords of the sub-query tasks, and determine at least one of the sub-query tasks that matches the input information based on the similarity value; Alternatively, perform a similarity match on the keywords of the input information and the keywords of the parent query task, and determine at least one of the parent query tasks that matches the input information based on the similarity value, and then obtain at least one of the sub-query tasks that matches the input information; the parent query task corresponds to at least one of the sub-query tasks.
3. The query index method according to claim 1, wherein The step of matching the input information with the sub-query tasks in the preset query task mapping table to obtain at least one of the matched sub-query tasks includes: The large model performs context reasoning on the input information, and performs a similarity match on the reasoning result and the task templates of each sub-query task to obtain at least one of the matched sub-query tasks; each of the task templates corresponds to at least one of the sub-query tasks.
4. The query index method according to claim 1, wherein The step of matching the input information with the sub-query tasks in the preset query task mapping table to obtain at least one of the matched sub-query tasks includes: The large model performs reasoning according to the input information; And perform a similarity match on the reasoning result and the task description of the sub-query task to obtain at least one of the sub-query tasks that matches the input information; Alternatively, perform a similarity match on the reasoning result and the task description of the parent query task to obtain at least one of the parent query tasks that matches the input information, and then obtain at least one of the sub-query tasks that matches the input information; the parent query task corresponds to at least one of the sub-query tasks.
5. The query indexing method according to claim 1, wherein After the step of matching the input information with the sub-query tasks in the preset query task mapping table to obtain at least one of the matched sub-query tasks, it further includes: Assign each of the sub-query tasks to a separate thread for processing.
6. The query index method according to claim 1, wherein It further includes: Add, delete, and modify the task names, task features, parameter templates, and query interfaces of the parent query tasks or sub-query tasks in the query task mapping table according to requirements.
7. The query index method according to claim 1, wherein It further includes: Query parameters are extracted based on the context of the input information, user information, and user preferences, and are used as the normalized query parameters.
8. A query indexing device, characterized in that, Including: An information acquisition unit for acquiring the input information of the user; A task matching unit for matching the input information with sub-query tasks in a preset query task mapping table to obtain at least one of the matched sub-query tasks; A normalization processing unit for obtaining parameter templates corresponding to at least one of the sub-query tasks and normalizing the query parameters of the sub-query tasks based on the parameter templates; A query unit for calling the query interfaces of at least one of the sub-query tasks to obtain the normalized query parameters of at least one of the sub-query tasks, so as to output the query results of each of the sub-query tasks; The query task mapping table includes a plurality of the sub-query tasks, and each sub-query task corresponds to one of the parameter templates and one of the query interfaces respectively.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the query indexing method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to implement the query indexing method according to any one of claims 1-7 when executed.
Citation Information
Patent Citations
Data processing method, device and equipment, readable medium and software product
CN116401140A
Data query method, electronic equipment and readable storage medium
CN116775957A
Structured large-field data query method and device and electronic equipment
CN118132550A
Natural language-based query statement conversion method and device and storage medium
CN119336783A
Creating a query template optimized for both recall and precision
US20240184789A1
Cited By
Traffic query method and device based on large model, and electronic equipment
CN120892440A