Query processing method and device and vehicle

By encoding the interface description text and building a comprehensive embedding sequence, the context length limitation and matching error problems of deep learning models in tool description processing are solved, and more efficient and accurate query processing is achieved.

CN120409684APending Publication Date: 2025-08-01GUANGZHOU XIAOPENG MOTORS TECH CO LTD

Patent Information

Application Number
CN202510513922.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the prior art, deep learning models are prone to exceed the context length range when processing tool description, resulting in the model not working properly and the processing efficiency is low. There are matching errors in the search and enhancement generation technology, which affects the accuracy and reliability of the model calling tool.

Method used

By obtaining input query and interface description text, coding processing is performed to generate interface encoding, building a comprehensive embedding sequence, using the target language model for inference calculation, generating answer data, avoiding dependence on additional retrieval mechanisms, and ensuring accurate semantic transmission of interface description text.

Benefits of technology

It improves the accuracy and efficiency of the model's processing of input queries, ensures accurate call of interface tools, reduces matching errors, and improves the overall performance of query processing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409684A_ABST
    Figure CN120409684A_ABST
Patent Text Reader

Abstract

The invention discloses a query processing method and device and a vehicle, and relates to the technical field of query processing and intelligent driving. The method comprises the steps that an input query, a processing prompt text and an interface description text are obtained, the processing prompt text is used for constraining a tool calling mode corresponding to the input query, and the interface description text is used for describing various interface tools corresponding to the tool calling mode; performing coding processing on the interface description text to obtain an interface code; utilizing interface coding, processing prompt text and inputting query, and constructing a comprehensive embedding sequence; and utilizing the comprehensive embedded sequence to drive the target language model to perform reasoning calculation, and generating answer data. The technical problems of poor accuracy and low efficiency of a query processing method due to dependence on a similarity matching mechanism in the related technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical fields of query processing and intelligent driving technology. Specifically, it relates to a query processing method, device, and vehicle. Background Art

[0002] During the process of a deep learning model processing input text, generally, the descriptions of all tools are used as context to be input into the model to call external tools to assist in processing the input text. However, when the number of tools is large or the tool descriptions are detailed, it is easy to exceed the context length range that the model can handle, which will not only cause the model to malfunction but also reduce the overall processing efficiency of the system.

[0003] In related technologies, the Retrieval-Augmented Generation (RAG) technique is adopted, and the descriptions of the most similar partial tools are dynamically matched as context input through a retrieval mechanism. Although this method can alleviate the problem of context length limitation, on the one hand, there will be matching errors in this method, affecting the accuracy and reliability of the model calling tools and resulting in poor accuracy of the model output results. On the other hand, this method requires relying on an additional retrieval mechanism, resulting in low processing efficiency of the model for input text.

[0004] In response to the above problems, no effective solution has been proposed yet. Summary of the Invention

[0005] Embodiments of this application provide a query processing method, device, and vehicle to at least solve the technical problems in related technologies that rely on a similarity matching mechanism, resulting in poor accuracy and low efficiency of the query processing method.

[0006] According to one aspect of the embodiments of this application, a query processing method is provided, including: obtaining an input query, a processing prompt text, and an interface description text, where the processing prompt text is used to constrain the tool call method corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call method; performing encoding processing on the interface description text to obtain an interface encoding; constructing a comprehensive embedding sequence by using the interface encoding, the processing prompt text, and the input query; and driving a target language model to perform inference calculation by using the comprehensive embedding sequence to generate answer data.

[0007] Optionally, performing encoding processing on the interface description text to obtain an interface encoding includes: performing word segmentation processing on the interface description text to obtain description word segmentation data; and performing semantic vector embedding encoding on the description word segmentation data by using a pre-trained embedding encoding model to obtain an interface encoding, where the encoding dimension of the embedding encoding model is determined according to the hidden space size of the target language model.

[0008] Optionally, the interface is encoded as an encoding matrix, where the first matrix dimension of the encoding matrix is determined by the number of types of multiple interface tools, and the second matrix dimension of the encoding matrix is determined by the hidden space size.

[0009] Optionally, an integrated embedding sequence is constructed using the interface encoding, processed prompt text, and input query, including: performing an embedding conversion process on the processed prompt text to obtain prompt embedding data; performing an embedding conversion process on the input query to obtain query embedding data; and constructing an integrated embedding sequence based on the interface encoding, prompt embedding data, and query embedding data.

[0010] Optionally, the prompt embedding data includes: a pre-prompt embedding and a post-prompt embedding. Performing an embedding conversion process on the processed prompt text to obtain prompt embedding data includes: parsing the processed prompt text according to preset context information to obtain a pre-prompt text and a post-prompt text, where the context information is used to determine the organization order of the processed prompt text and the interface description text. The pre-prompt text includes a part of the prompt text in the processed prompt text whose organization order is before the interface description text, and the post-prompt text includes a part of the prompt text in the processed prompt text whose organization order is after the interface description text; performing an embedding conversion process on the pre-prompt text to obtain a pre-prompt embedding; and performing an embedding conversion process on the post-prompt text to obtain a post-prompt embedding.

[0011] Optionally, constructing an integrated embedding sequence based on the interface encoding, prompt embedding data, and query embedding data includes: sorting and combining the pre-prompt embedding, interface encoding, post-prompt embedding, and query embedding data in a target construction order to generate an integrated embedding sequence.

[0012] Optionally, using the integrated embedding sequence to drive the target language model to perform inference calculations to generate answer data includes: using the integrated embedding sequence to drive the target language model to perform inference calculations, enabling the target language model to identify instructions according to the prompt embedding data and the query embedding data, determining the query instruction information corresponding to the input query, determining the interface name corresponding to the target interface tool to be called according to the query instruction information and the interface encoding, and generating answer data based on the query instruction information and the interface name.

[0013] Optionally, the processed prompt text includes: a first prompt text for describing the dialogue context corresponding to the input query; a second prompt text for indicating an update to the input query according to the dependency relationship between the input query and the historical dialogue; a third prompt text for defining an instruction classification criterion and indicating an instruction recognition and classification of the input query; a fourth prompt text for defining an interface call policy corresponding to multiple instruction categories and indicating a selection of a target interface tool from multiple interface tools; and a fifth prompt text for determining the input format of the answer data.

[0014] According to another aspect of the embodiments of the present application, there is also provided a query processing device, including: an acquisition module, configured to acquire an input query, a processing prompt text, and an interface description text, where the processing prompt text is used to constrain the tool call manner corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call manner; an encoding module, configured to perform encoding processing on the interface description text to obtain an interface code; a construction module, configured to construct a comprehensive embedding sequence by using the interface code, the processing prompt text, and the input query; a calculation module, configured to drive a target language model to perform inference calculation by using the comprehensive embedding sequence to generate answer data.

[0015] According to another aspect of the embodiments of the present application, there is also provided a vehicle, including a memory storing an executable program; a processor, configured to run the program, where when the program runs, it executes the query processing method of any one of the above.

[0016] In the embodiments of the present application, an input query, a processing prompt text, and an interface description text are acquired, where the processing prompt text is used to constrain the tool call manner corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call manner; encoding processing is performed on the interface description text to obtain an interface code; a comprehensive embedding sequence is constructed by using the interface code, the processing prompt text, and the input query; and a target language model is driven to perform inference calculation by using the comprehensive embedding sequence to generate answer data.

[0017] It is easy to notice that in the embodiments of the present application, an input query, a processing prompt text for the tool call method corresponding to the constrained input query, and an interface description text for a variety of interface tools corresponding to the tool call method are obtained. Further, the interface description text is encoded, and the interface description text with a longer text length is compressed into an interface code with a shorter text length. Then, using this interface code with a shorter text length, the processing prompt text, and the input query, a shorter comprehensive embedding sequence is constructed, shortening the context length of the input model. It can also ensure that the semantics of the interface description text are accurately transmitted during model reasoning, improving the accuracy and efficiency of the model in processing the input query. Further, using this comprehensive embedding sequence to drive the target language model to perform inference calculations, enabling the model to accurately call the corresponding interface tool for the input query under specified conditions, thereby generating answer data more efficiently and accurately. In addition, in the above process of the embodiments of the present application, there is no need to rely on an additional retrieval mechanism, avoiding the influence of matching errors on the model's call of the interface tool, improving the accuracy and efficiency of the model's call of the interface tool, and thus enhancing the accuracy and efficiency of the query processing method. Thus, the present application achieves the purpose of the model efficiently calling the interface tool to process the input query and generating accurate answer data, thereby realizing the technical effect of improving the accuracy and efficiency of the query processing method, and further solving the technical problem in the related art that relying on the similarity matching mechanism results in poor accuracy and low efficiency of the query processing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments of the present application and the related descriptions of the embodiments are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0019] Figure 1 is a hardware structure block diagram of an optional computing terminal for implementing the query processing method according to the embodiments of the present application;

[0020] Figure 2 is a flowchart of a query processing method according to the embodiments of the present application;

[0021] Figure 3 is a schematic diagram of an optional query processing method according to the embodiments of the present application;

[0022] Figure 4 is a structure block diagram of a query processing device according to the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments only include some embodiments of this application, rather than all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0024] It should be noted that the terms "first", "second", etc. in the description and claims of this application 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 the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including 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.

[0025] According to an embodiment of the present invention, a method embodiment of a query processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from that here.

[0026] First, an exemplary description of the operating environment of the above method embodiment will be given. Figure 1 is a hardware structure block diagram of an optional computing terminal for implementing a query processing method according to an embodiment of this application, as Figure 1 shown, the computing terminal 10 (for example, a computer terminal, a mobile intelligent terminal, a vehicle terminal, or a cloud computing virtual terminal, etc.) may include: one or more processors 102 (for example, it may include processors 102a, 102b,..., 102n), a memory 104 for storing data, and a transmission device 106 for implementing communication functions. Among them, the processor(s) 102 may include, but is not limited to, processing components such as a microcontroller unit (abbreviated as MCU) or a field programmable gate array (abbreviated as FPGA).

[0027] The above computing terminal 10 may further include: a display device 110, an input / output interface 108, a Universal Serial Bus (USB) port (which may be one of the ports of the computer bus and is not shown in the figure), a network interface (not shown in the figure), a power supply (not shown in the figure), and a camera (not shown in the figure).

[0028] It should be noted that one or more processors 102 and / or other data processing circuits in the above computing terminal 10 may be embodied in software, hardware, firmware, or any combination thereof, in whole or in part. Additionally, the data processing circuit may be a single independent processing module, or may be incorporated, in whole or in part, into any one of the other elements in the computing terminal 10 (or mobile device).

[0029] The memory 104 can be used to store software programs and modules of application software, such as the program instructions and data storage devices corresponding to the query processing method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above query processing method. The memory 104 may include a high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories may be connected to the vehicle terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include the wireless network provided by the communication provider of the vehicle terminal. In one instance, the transmission device 106 includes a Network Interface Controller (NIC) and a network interface, and the network adapter can be connected to other network devices through a base station so as to communicate with the Internet. The transmission device 106 can perform data communication in a wired and / or wireless network connection manner. In one instance, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] The input / output interface can be connected to the input / output device corresponding to the computing terminal 10 to implement input / output functions. The input / output device may include, but is not limited to: a cursor control device, a keyboard, a display, etc. The above input / output device may be built into the computing terminal 10 or an external device outside the computing terminal 10.

[0032] Those of ordinary skill in the art can understand that Figure 1 the structure of the computing terminal 10 shown is only schematic and does not strictly limit the structure of the above-mentioned computing terminal 10. For example, the computing terminal 10 may further include more or fewer components than those shown in Figure 1 , or the computing terminal 10 may have different categories of components from those shown in Figure 1 .

[0033] Under the above operating environment, the embodiments of the present application provide a query processing method as shown in Figure 2 , Figure 2 which is a flowchart of a query processing method according to an embodiment of the present application. As shown in Figure 2 , the method includes the following implementation steps:

[0034] Step S21, obtain an input query, a processing prompt text, and an interface description text. The processing prompt text is used to constrain the tool call method corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call method;

[0035] Step S22, perform encoding processing on the interface description text to obtain an interface code;

[0036] Step S23, use the interface code, the processing prompt text, and the input query to construct a comprehensive embedding sequence;

[0037] Step S24, use the comprehensive embedding sequence to drive the target language model to perform inference calculations and generate answer data.

[0038] The above input query may be the original query text input by the user. The input query is used to represent the current request information of the user. The above processing prompt text may include a pre-prompt text and a post-prompt text. The processing prompt text may be used to represent the logical framework for the target language model to perform inference calculations.

[0039] The above interface tools may include but are not limited to: mathematical calculation tools, calendar query tools, word query tools, exchange rate conversion query tools, stock market information query tools, traffic restriction query tools, translation tools, knowledge information query tools, vehicle function introduction tools, weather query tools, painting tools, chatting tools (such as tools providing joke functions), multi-modal question and answer tools, time difference query tools, vehicle status detection tools, map and positioning service tools.

[0040] The above interface description text can be obtained through the description text of a predefined interface tool. The interface description text can be in the form of natural language description text. The interface description text can include the description texts of multiple interface tools, and the description text can include but is not limited to: function description text, parameter configuration description text, call example description text, and name description text. The above interface encoding can be used to represent the numerical vector with semantic information corresponding to the interface description text.

[0041] It is easy to understand that by encoding the interface description text, the interface description text in the form of natural language can be converted into a numerical vector with semantic information, and this numerical vector is used as the interface encoding. Thus, not only can the text length of the relatively long interface description text be shortened, the context information input into the model be streamlined, but also the semantics of the interface description text can be accurately transmitted during model inference, thereby providing support for the model to efficiently and accurately process input queries.

[0042] The above comprehensive embedding sequence can be used to represent the comprehensive information including the interface encoding, processing prompt text, and input query. The comprehensive embedding sequence can be obtained by using an embedding conversion method.

[0043] It is easy to understand that by using the embedding conversion method, the interface encoding, processing prompt text, and input query are mapped to the same vector space, converted into a unified numerical vector representation sequence, and further these numerical vector representation sequences are fused to obtain a comprehensive embedding sequence. This comprehensive embedding sequence is the basis for the model to understand and respond to input queries, and can drive the model to perform inference calculations, enabling the model to accurately call the corresponding interface tool for the input query under specified conditions, thereby achieving efficient and accurate human-computer interaction.

[0044] The above target language model can be obtained by pre-training an initial language model. The above initial request processing model can be a model that has not been optimized at the beginning of training. The initial request processing model can refer to a deep learning model with a large number of model parameters (i.e., a large model), which usually can contain hundreds of millions, tens of billions, hundreds of billions, trillions or even more than one quadrillion model parameters. The large model can also be called a Foundation Model. Through pre-training of the large model with a large amount of unlabeled corpus, a pre-trained model with more than hundreds of millions of parameters is produced. This kind of model can adapt to a wide range of downstream tasks and has good generalization ability, such as Large Language Model (LLM), multi-modal pre-training model, etc. The above response data can refer to the feedback information generated by the vehicle-mounted request processing system after parsing the user interaction request. The response data can include, but is not limited to: interaction reply results, control instructions, error prompt information.

[0045] It is easy to notice that through the above steps S21 to S24, in the embodiment of the present application, an input query, a processing prompt text corresponding to the constrained input query for the tool call method, and an interface description text describing multiple interface tools corresponding to the tool call method are obtained. Further, the interface description text is encoded, and the interface description text with a longer text length is compressed into an interface code with a shorter text length. Then, using the interface code with a shorter text length, the processing prompt text, and the input query, a shorter comprehensive embedding sequence is constructed, shortening the context length of the input model. It can also ensure that the semantics of the interface description text are accurately transmitted in model reasoning, improving the accuracy and efficiency of the model in processing the input query. Further, using this comprehensive embedding sequence, the target language model is driven to perform inference calculations, enabling the model to accurately call the corresponding interface tool for the input query under specified conditions, thereby generating response data more efficiently and accurately. In addition, in the above process of the embodiment of the present application, there is no need to rely on an additional retrieval mechanism, avoiding the influence of matching errors on the model's call of the interface tool, improving the accuracy and efficiency of the model's call of the interface tool, and thus improving the accuracy and efficiency of the query processing method. Thus, the present application achieves the purpose of the model efficiently calling the interface tool to process the input query and generating accurate response data, thereby realizing the technical effect of improving the accuracy and efficiency of the query processing method, and further solving the technical problems of poor accuracy and low efficiency of the query processing method in the related art due to relying on the similarity matching mechanism.

[0046] As an optional implementation manner, in the above step S22, the steps for encoding the interface description text to obtain the interface code include the following:

[0047] Step S221: Perform word segmentation on the interface description text to obtain description word segmentation data;

[0048] Step S222: Use a pre-trained embedding encoding model to perform semantic vector embedding encoding on the description word segmentation data to obtain an interface encoding, where the encoding dimension of the embedding encoding model is determined according to the hidden space size of the target language model.

[0049] The above-mentioned description word segmentation data is used to represent the description text data corresponding to each interface tool among multiple interface tools. Since the above interface description text includes the description texts of multiple interface tools fused together, by performing word segmentation on the interface description text, it is possible to separate the description text corresponding to each interface tool among multiple interface tools to obtain the word segmentation data corresponding to each interface tool. That is to say, the word segmentation data corresponding to each interface tool among multiple interface tools is independent of each other, which helps the subsequent embedding encoding model to more accurately perform semantic vector embedding encoding on the description word segmentation data.

[0050] The above embedding encoding model can be used to compress the description text into a vector representation in numerical form. The embedding encoding model can include, but is not limited to: a bidirectional language model, a deep learning model based on knowledge distillation technology, a dual-encoder general embedding model (i.e., the BGE-m3 model).

[0051] The above encoding dimension can refer to the length of the vector output when the embedding encoding model converts the text into a vector. The above hidden space size can refer to the vector dimension size of the hidden layer in the neural network model. The hidden space size is the way the model internally represents data and is used to capture the complex features and patterns of the input data. The hidden space size can be set according to the expected requirements. By using a pre-trained embedding encoding model to perform semantic vector embedding encoding on the description word segmentation data, it is possible to accurately capture the semantic features of the word segmentation data, thereby obtaining an interface encoding that can more accurately convey the semantics of the interface description text.

[0052] It should be noted that in a language model, the encoding dimension is determined by the size of the hidden space size of the target language model. The hidden space size determines how the model internally stores and processes the semantic information of the input text, and is usually proportional to the complexity and expressive power of the model. A larger hidden space size means that the model can learn and represent richer features.

[0053] In an exemplary application scenario, the training process of the above embedding encoding model can be as follows: taking the text description data corresponding to the interface tool as input, learning the similarity and relevance between texts through a large number of text pairing trainings. The goal of the model is to minimize the vector distance between similar texts and maximize the distance between dissimilar texts. The embedding encoding model trained in this way can transform the text description data corresponding to the interface tool into an interface code. The obtained interface code can accurately reflect the meaning of the text description corresponding to the interface tool, and in the subsequent tool call process, the corresponding interface tool can be quickly located and called according to these interface codes without processing the complete text description, improving the processing speed and accuracy.

[0054] It should be noted that the above embedding encoding model can also be used to integrate interface codes, store interface codes, and establish an index of interface codes. In particular, when the above embedding encoding model is the BGE-m3 model, using this embedding encoding model, in the subsequent supervised fine-tuning stage and / or inference stage, when the interface code of the interface tool required to process a new input query has been constructed through the embedding encoding model (that is, the interface code of this interface tool already exists), the interface code corresponding to this interface tool can be directly retrieved from the already constructed index and directly used without using the embedding encoding model to perform semantic vector embedding encoding on the description tokenization data again, which can reduce the consumption of computing resources and improve the efficiency of processing the input query.

[0055] It is easy to understand that through the above steps S221 to S222, in the embodiment of the present application, by performing tokenization processing on the interface description text, the description text of multiple interface tools fused together can be divided into tokenization data corresponding to each interface tool, and the tokenization data corresponding to different interface tools are independent of each other, enabling the model to more accurately perform semantic vector embedding encoding on the description tokenization data, improving the accuracy of the interface code, and ensuring that the semantics of the interface description text can be accurately transmitted. In addition, using the embedding encoding model can retrieve the interface code of the interface tool that has been constructed through the embedding encoding model, without repeatedly performing semantic vector embedding encoding on the description tokenization data corresponding to the same interface tool, reducing the consumption of computing resources and improving the processing efficiency of the input query.

[0056] As an optional implementation manner, in the above query processing method, the interface code is a coding matrix. The first matrix dimension of the coding matrix is determined by the number of types of multiple interface tools, and the second matrix dimension of the coding matrix is determined by the hidden space size.

[0057] The above first matrix dimension can be the number of rows of the above coding matrix. This first matrix dimension is determined by the number of types of multiple interface tools. That is to say, each row of the above coding matrix represents a different tool interface.

[0058] The above-mentioned second matrix dimension can be the number of columns of the encoding matrix, which is determined by the hidden space size. That is to say, the second matrix dimension can reflect the vector length of the interface encoding corresponding to each tool.

[0059] In an exemplary application scenario, Figure 3 is a schematic diagram of an optional query processing method according to an embodiment of the present application. As Figure 3 shown, the above-mentioned embedding encoding model is the BGE-m3 model. Using the pre-trained embedding encoding model, semantic vector embedding encoding is performed on the described tokenized data to obtain interface encodings corresponding to multiple tool interfaces respectively. Gathering these can obtain the above-mentioned encoding matrix. For example, if the first matrix dimension is m and the second matrix dimension is n, the size of the encoding matrix can be m×n. That is to say, the tool encodings corresponding to all tool interfaces can be stored in a structured storage manner, which is beneficial to subsequent retrieval and use of the tool encodings corresponding to the tool interfaces.

[0060] It is easy to understand that through the above query processing method, in the embodiment of the present application, the interface encodings corresponding to multiple tool interfaces are stored using the encoding matrix, and the structured storage method of the encoding matrix helps to quickly find and read the interface encoding corresponding to a specific tool, is suitable for a large-scale tool set, and can improve the efficiency of the query processing method.

[0061] As an optional implementation manner, in the above step S23, using the interface encoding, the processing prompt text, and the input query to construct the comprehensive embedding sequence includes the following implementation steps:

[0062] Step S231, perform embedding conversion processing on the processing prompt text to obtain prompt embedding data;

[0063] Step S232, perform embedding conversion processing on the input query to obtain query embedding data;

[0064] Step S233, based on the interface encoding, the prompt embedding data, and the query embedding data, construct the comprehensive embedding sequence.

[0065] The above-mentioned processing prompt text can be text in natural language form. The above-mentioned prompt embedding data can be in the form of a numerical vector corresponding to the processing prompt text. The prompt embedding data can be used to represent the semantic features of the processing prompt text. The prompt embedding data can include the meaning of keywords, context relationships, and potential intentions.

[0066] The above input query can be the original query text in the form of natural language input by the user. The input query can at least include the information requested by the user. The input query can also include the user location information. The above query embedding data can be in the form of a numerical vector corresponding to the input query. The query embedding data can be used to represent the semantic features of the input query.

[0067] It should be noted that a pre-trained embedding conversion model can be used to perform the above embedding conversion process. The above embedding conversion model can include, but is not limited to: a bidirectional long short-term memory network model, a bidirectional encoder based on the Transformer architecture (i.e., the Transformer architecture). Using the pre-trained embedding conversion model can convert the text information in the form of natural language into the form of numerical vectors, which is convenient for the model to understand and process this text information.

[0068] It is easy to understand that through the above steps S231 to S233, in the embodiments of the present application, by performing embedding conversion processing on the processing prompt text and performing embedding conversion processing on the input query, the processing prompt text and the input query in the form of natural language can be respectively converted into the prompt embedding data and the query embedding data in the form of numerical vectors. This kind of data in the form of numerical vectors can not only shorten the text length, but also be more helpful for the model to understand and process. Further, based on the interface code, the prompt embedding data and the query embedding data, compared with directly using the input query, the processing prompt text and the interface description text as context data input in the related art, the text length of the comprehensive embedding sequence constructed in the present application is shorter, and the comprehensive embedding sequence is beneficial for the model to understand and process, thereby providing support for the subsequent model to efficiently and accurately process the input query.

[0069] As an optional implementation manner, the prompt embedding data includes: a pre-prompt embedding and a post-prompt embedding. In the above step S231, the steps for performing embedding conversion processing on the processing prompt text to obtain the prompt embedding data are as follows:

[0070] Step S2311, parse the processing prompt text according to the preset context information to obtain a pre-prompt text and a post-prompt text, where the context information is used to determine the organization order of the processing prompt text and the interface description text. The pre-prompt text includes some prompt text in the processing prompt text whose organization order is before the interface description text, and the post-prompt text includes some prompt text in the processing prompt text whose organization order is after the interface description text;

[0071] Step S2312, perform embedding conversion processing on the pre-prompt text to obtain a pre-prompt embedding;

[0072] Step S2313, perform embedding conversion processing on the post-prompt text to obtain a post-prompt embedding.

[0073] The above context information can be used to define the relative position and resistance value logic for processing the prompt text and the interface description text. By parsing the processing prompt text according to the preset context information, the processing prompt text can be divided into a pre-prompt text and a post-prompt text. According to the context information, the resistance value order of the processing prompt words and the interface description text can be determined, so as to ensure that the processing prompt text and the interface description text can be integrated in a reasonable order subsequently.

[0074] The above pre-prompt text can represent a text in natural language form that guides the target language model into a specific working state (e.g., calling a tool corresponding to the input query) or provides background knowledge, such as text about the vehicle cockpit environment, text of personalized settings set by the user. The above post-prompt text can represent a text in natural language form that represents the expected result or the constraint conditions for model operations, such as text of the expected operation type, text of the expected result, text of the response time threshold, etc.

[0075] The above pre-prompt embedding can be in the form of a numerical vector corresponding to the pre-prompt text. This prompt embedding data can be used to represent the semantic features of the pre-prompt text. The above post-prompt embedding can be in the form of a numerical vector corresponding to the post-prompt text. This prompt embedding data can be used to represent the semantic features of the post-prompt text.

[0076] In an exemplary application scenario, still as Figure 3 shown, according to the preset context information, the processing prompt text is parsed to obtain the pre-prompt text and the post-prompt text. Further, the pre-trained embedding conversion model is used to perform embedding conversion processing on the pre-prompt text, the post-prompt text, and the input query (e.g., background where is suitable to see cherry blossoms in spring) in sequence to obtain the pre-prompt embedding, the post-prompt embedding, and the query embedding data. Based on the interface encoding, the pre-prompt embedding, the post-prompt embedding, and the query embedding data, a comprehensive embedding sequence is constructed. Compared with directly using the input query, the processing prompt text, and the interface description text as context data input in the related technology, the length of this comprehensive embedding sequence is shorter, which helps the subsequent target language model to process the input query more quickly.

[0077] Still in the above application scenario, the above context information can be: "You are a in-vehicle voice assistant of an intelligent vehicle (assistant), named 'Xiaop', responsible for listening to all conversations among in-vehicle users (user). You need to combine the historical conversations between the user (user) and the in-vehicle voice assistant (assistant), the content replied by 'Xiaop', and the current user input query, and strictly follow the following steps to gradually analyze the input query currently entered by the user:

[0078] 1. If the input does not contain the historical conversation between the user and the in-vehicle voice assistant, skip this step; otherwise, based on the semantic coherence of the historical conversation and the current input query, or the relationship between entities, determine whether the current input query is missing components and depends on useful information such as actions or entities obtained from the historical conversation information to complete the current input query. If the current input query depends on the historical conversation for completion, output 'Dependency on historical turn for completion: Yes', and at the same time, replace the current input query with the completed input query for the next judgment; if it does not depend on the historical turn for completion, proceed to the next judgment based on the user's input query;

[0079] 2. You need to determine whether the user's input query is a clear in-vehicle instruction. A clear in-vehicle instruction needs to include an 'operation action' and a specific 'in-vehicle device' or 'in-vehicle function' to be operated, or use the knowledge query function provided by the vehicle. Among them, 'in-vehicle functions' include, but are not limited to: control of sound zones, control of sound effects volume, playback and control of multimedia resources such as audio / video / radio stations, opening / closing / downloading of apps, selection / confirmation / cancellation of interface lists, global controls such as general exit / closing, making phone calls, navigation services, time setting, mathematical calculations, knowledge-related query functions such as ancient poems, vocabulary, exchange rates, stocks, weather, time / date, news, multilingual translation, vehicle traffic restrictions, transportation, vehicle usage tutorials, creating story picture books, painting, and multimodal Q&A using images of various vehicle positions, etc. When the input query matches a clear in-vehicle instruction, if the in-vehicle instruction consists of a single atomic instruction, answer 'Simple instruction', and if it consists of two or more atomic instructions, answer 'Complex instruction' (multiple atomic instructions can be related to each other or independent), and sequentially split out multiple atomic instructions.

[0080] 3. When the user's input query is judged as a 'Simple instruction', you need to, according to the specific content of the user's input query, combined with the APIs and their function descriptions provided in the

API Candidate List

[0081]

API Candidate List

[0082] (a) BaikeCalculator: Provides basic mathematical calculation functions, can handle basic operations such as addition, subtraction, multiplication, and division, as well as more complex mathematical problems such as power operations and square roots.

[0083] (b) BaikeCalendar: Provides calendar query functions such as time, date, holidays, and date intervals.

[0084] (c) BaikeChinese: Provides Chinese language services, including poetry query, word definition, synonym and antonym query, Chinese character writing guidance, word formation and sentence making, and idiom query functions.

[0085] (d) BaikeExchange: Used to query currency exchange rate information and supports exchange rate conversion queries between multiple currencies.

[0086] (e) BaikeStock: Provides stock market information queries, including stock prices, stock trading information, market dynamics, indices, trends, and price changes, etc., to help users grasp the real-time dynamics of the stock market.

[0087] (f) BaikeTraffic: Used to query traffic restriction information.

[0088] (g) BaikeTranslate: Provides text translation services and supports mutual translation between Chinese and English.

[0089] (h) BaikeGeneral: Provides a wide range of knowledge-based information queries, including history, science, culture, and common sense of life, etc.

[0090] (i) QaCarUsage: Used to answer questions related to vehicle recommendation, vehicle usage, and in-vehicle sensor information queries, such as vehicle function introduction and usage tutorials, maintenance suggestions, and information queries depending on in-vehicle sensors such as in-vehicle temperature, in-vehicle air quality, and battery life, etc., to help users better understand and use vehicles.

[0091] (j) WeatherSearch: Provides weather query services and supports detailed weather forecasts for specific regions, including specific meteorological information such as wind direction, temperature, humidity, etc., and out-of-vehicle air quality, etc.

[0092] (k) AIGCMultiModalQA: Provides a multi-modal question-and-answer function using images of various positions outside the vehicle.

[0093] (l) AIGCDrawPicture: Provides AIGC painting and creative drawing functions.

[0094] (m) BaikeJoke: Provides a joke-telling function.

[0095] 4. When the input query does not match a specific in-vehicle instruction, directly answer 'Other'.

[0096] Please note that this is a process of gradually analyzing the user's current input query, and it is necessary to strictly judge and answer according to the above steps. If a certain step is matched, there is no need to continue judging the next step, and directly answer the corresponding result.

[0097] Please strictly follow the answers of 'Simple Instructions', 'Complex Instructions', and 'Others'. Remember, when your answer belongs to one of 'Simple Instructions' or 'Complex Instructions', you need to output the corresponding standard <instruction>; when your answer is 'Simple Instructions' and you can call an API in the

API Candidate List

[0098] To sense and distinguish users in different positions inside the vehicle, the user input format is: 'User Location: User Input Query', where the user location includes: driver's seat / passenger seat / left side of the second row / right side of the second row / left side of the third row / right side of the third row.

[0099] Still in the above application scenario, the interface description text can be: "

[0100]

API Candidate List

[0101] (a) BaikeCalculator: Provides basic mathematical calculation functions, can handle basic operations such as addition, subtraction, multiplication, and division, as well as more complex mathematical problems such as power operations and square roots.

[0102] (b) BaikeCalendar: Provides calendar query functions such as time, date, holidays, and date intervals.

[0103] (c) BaikeChinese: Provides Chinese language services, including poetry query, word definition, synonym and antonym query, Chinese character writing guidance, word formation and sentence making, and idiom query functions.

[0104] (d) BaikeExchange: Used to query currency exchange rate information and supports exchange rate conversion queries between multiple currencies.

[0105] (e) BaikeStock: Provides stock market information queries, including stock prices, stock trading information, market dynamics, indices, trends, and price changes, etc., to help users master the real-time dynamics of the stock market.

[0106] (f) BaikeTraffic: Used to query traffic restriction information.

[0107] (g) BaikeTranslate: Provides text translation services and supports mutual translation between Chinese and English.

[0108] (h) BaikeGeneral: Provides a wide range of knowledge-based information queries, including history, science, culture, and common sense of life, etc.

[0109] (i) QaCarUsage: Used to answer questions related to vehicle recommendations, vehicle usage, and in-vehicle sensor information queries, such as vehicle function introductions and usage tutorials, maintenance suggestions, and information queries depending on in-vehicle sensors like in-vehicle temperature, in-vehicle air quality, and battery range, to help users better understand and use the vehicle.

[0110] (j) WeatherSearch: Provides weather query services, supporting detailed weather forecasts for specific regions, including specific meteorological information such as wind direction, temperature, humidity, and out-of-vehicle air quality.

[0111] (k) AIGCMultiModalQA: Provides a multi-modal question-and-answer function using images from all directions outside the vehicle.

[0112] (l) AIGCDrawPicture: Provides AIGC painting and creative drawing functions.

[0113] (m) BaikeJoke: Provides a joke-telling function.

[0114] It is easy to understand that through the above steps S2311 to S2313, in the embodiments of the present application, the pre-prompt text and the post-prompt text can be clearly distinguished, thereby constructing a comprehensive embedding sequence with a clear organizational order, which helps the subsequent target language model receive and process information more orderly, and avoids the problem of the subsequent target language model having a misunderstanding due to the chaotic input order.

[0115] As an optional implementation manner, in the above step S233, based on the interface encoding, prompt embedding data, and query embedding data, constructing a comprehensive embedding sequence includes the following implementation steps:

[0116] Step S2331, sort and combine the pre-prompt embedding, interface encoding, post-prompt embedding, and query embedding data according to the target construction order to generate a comprehensive embedding sequence.

[0117] The above target construction order can be set in advance. The target construction order can be used to determine the position order of multiple parts in the comprehensive embedding sequence. The target construction order can be stored in the storage area corresponding to the query processing system of the intelligent vehicle. The above storage area includes but is not limited to: flash memory, phase change memory (PCM for short), and magnetoresistive random access memory (MRAM for short).

[0118] In an exemplary application scenario, still as Figure 3As shown, according to the query embedding data, the interface codes corresponding to various interface tools for processing the query embedding data are selected from the encoding matrix. Further, they are sorted and combined in the order of the pre-prompt embedding, interface code, post-prompt embedding, and query embedding data in sequence to obtain an ordered comprehensive embedding sequence.

[0119] It is easy to understand that through the above step S2331, in the embodiment of the present application, the comprehensive embedding sequence generated according to the target construction order can more orderly sort and combine the pre-prompt embedding, interface code, post-prompt embedding, and query embedding data. Using this comprehensive embedding sequence can ensure that the subsequent target language model processes information in a logical order, enabling the target language model to more accurately understand and process the query embedding data. In addition, the present application directly embeds the interface code in the comprehensive embedding sequence, reducing the time cost of the subsequent target language model in the process of calling tools, accelerating the speed of tool calling, and thus improving the processing efficiency of the query processing method.

[0120] As an alternative implementation manner, in the above step S24, using the comprehensive embedding sequence to drive the target language model to perform inference calculation and generate answer data includes the following implementation steps:

[0121] Step S241, using the comprehensive embedding sequence to drive the target language model to perform inference calculation, so that the target language model identifies the instruction according to the prompt embedding data and the query embedding data, determines the query instruction information corresponding to the input query, determines the interface name corresponding to the target interface tool to be called according to the query instruction information and the interface code, and generates answer data based on the query instruction information and the interface name.

[0122] The above query instruction information may include an instruction type and an instruction content. The above instruction type may include: simple instruction, complex instruction, other instruction. The above instruction content may be used to represent the semantic representation of the input query. The above simple instruction may refer to an instruction containing one atomic instruction. The above complex instruction may refer to an instruction including multiple atomic instructions, and the multiple atomic instructions included in the complex instruction may be related to each other or independent of each other. The above other instruction may refer to an instruction that does not contain an atomic instruction. The above atomic instruction may be an instruction containing an independent vehicle-mounted function operation or execution action, and the machine can execute independently without relying on other instructions. The above answer data may include instruction type data, instruction content data, and interface name data.

[0123] In an exemplary application scenario, still as Figure 3As shown, the integrated embedding sequence is used to drive the target language model to perform inference calculations. The target language model will identify the query embedding data based on the pre-prompt embedding in the prompt embedding data, and identify whether the query embedding data belongs to a simple instruction or a complex instruction. If the recognition result indicates that the query embedding data belongs to a complex instruction, the instruction type is determined as "complex instruction", and the query embedding data is split into multiple atomic instructions.

[0124] Still in the above application scenario, if the recognition result indicates that the query embedding data belongs to a simple instruction, the instruction type is determined as "simple instruction", the query embedding data is used as the instruction content, and the instruction type and the instruction content are used as the query instruction information corresponding to the input query. For example, for an input query: "Where is suitable to see cherry blossoms in Beijing in spring", the query instruction information corresponding to the input query may include the instruction type and the instruction content. Among them, the instruction type corresponding to the input query may be "simple instruction", and the instruction content corresponding to the input query may be "Where is suitable to see cherry blossoms in Beijing in spring". Further, based on the query instruction information, the interface name of the target interface tool to be called that matches the query instruction information is determined from the interface codes in the interface coding, and answer data is generated based on the query instruction information and the interface name. The answer data can be used to represent the instruction type, the instruction content, and the interface name.

[0125] Still in the above application scenario, if the recognition result indicates that the query embedding data does not belong to a simple instruction or a complex instruction, the target language model determines that the instruction type corresponding to the input query is "other instruction" according to the post-prompt embedding, and the instruction type can be directly used as the query instruction information without other processing. Further, answer data is generated based on the query instruction information.

[0126] It is easy to understand that through the above step S241, in the embodiment of the present application, the method of specifying the interface tool selection rule based on the interface coding through the prompt embedding data can avoid the problem that the target language model cannot call the corresponding interface tool due to matching errors compared with the method of inputting the description of selecting some interface tools based on similarity calculation as the context into the model in the related art, and improves the accuracy of the target language model in calling the interface tool.

[0127] As an alternative implementation, in the above query processing method, the processing prompt text includes: a first prompt text for describing the dialogue context corresponding to the input query; a second prompt text for indicating to update the input query according to the dependency relationship between the input query and the historical dialogue; a third prompt text for defining the instruction classification criteria and indicating to perform instruction recognition and classification on the input query; a fourth prompt text for defining the interface call policies corresponding to multiple instruction categories and indicating to select a target interface tool from multiple interface tools; a fifth prompt text for determining the input format of the answer data.

[0128] The above processing prompt text may include a pre-prompt text and a post-prompt text. The above pre-prompt text may include the first prompt text, the second prompt text, the third prompt text, and the fourth prompt text. The above post-prompt text may include the fifth prompt text. The above dialogue context may be used to determine the dialogue background where the input query is located.

[0129] The above historical dialogue may include dialogue context information and timestamp information. During the process of human-computer interaction between the user and the query processing system, the query processing system may automatically record the dialogue content and store these dialogue contents as the historical dialogue.

[0130] The above instruction classification criteria may be used to determine the definitions corresponding to multiple instruction types. For example, "an atomic instruction corresponds to a clear and independent vehicle-mounted function or action and can be executed independently", and for another example, "if a vehicle-mounted instruction is composed of a single atomic instruction, then answer'simple instruction', if it is composed of two or more atomic instructions, then answer 'complex instruction' (multiple atomic instructions may be related to each other or may be independent of each other)".

[0131] The above interface call policy may be used to characterize the usage mode and conditions of the interface tool. Using this interface call policy can assist the target language model to select a suitable target interface tool from multiple interface tools. The interface call policy may include, but is not limited to: the priority sorting of the interface tool, the parameter configuration of the interface tool, and the call frequency limit of the interface tool.

[0132] In an exemplary application scenario, the above first prompt text may be: "You are an in-vehicle voice assistant of an intelligent car, named 'Xiaop', responsible for listening to all conversations among in-vehicle users. You need to combine the historical dialogue between the user and the in-vehicle voice assistant, the content of the 'Xiaop' reply, and the current user input query, and strictly follow the following steps to gradually analyze the current user input query."

[0133] Using this first prompt text enables the target language model to understand and respond within a specific environmental framework.

[0134] The above second prompt text can be: "1. If the input does not contain the historical conversation between the user and the in-vehicle voice assistant, skip this step; otherwise, please, based on the semantic coherence or the relationship between entities in the historical conversation and the current input query, determine whether the current input query is missing components and depends on obtaining useful information such as actions or entities from the historical conversation information to complete the current input query. If the current input query depends on the historical conversation for completion, output 'Dependency on historical turn for completion: Yes', and at the same time replace the current input query with the completed input query for the next judgment; if it does not depend on the historical turn for completion, then proceed to the next judgment based on the user input query."

[0135] Using this second prompt text enables the target language model to determine whether there is information to be supplemented in the input query (such as missing entity information, missing action information) according to the dependency relationship between the input query and the historical conversation. If there is information to be supplemented in the input query, then perform a dialogue completion process on the input query according to the historical conversation, output 'Dependency on historical turn for completion: Yes', and update the input query.

[0136] The above third prompt text can be: "2. You need to determine whether the user input query is a clear in-vehicle instruction. A clear in-vehicle instruction needs to include an 'operation action' and a specific 'in-vehicle device' or 'in-vehicle function' to be operated, or use the knowledge query function provided by the vehicle. Among them, 'in-vehicle functions' include, but are not limited to: control of sound zones, control of sound effects volume, playback and control of multimedia resources such as audio / video radio stations, opening / closing / downloading of APPs, selection / confirmation / cancellation of interface lists, global controls such as general exit / closing, making phone calls, navigation services, time setting, mathematical calculations, knowledge-related query functions such as ancient poems, vocabulary, exchange rates, stocks, weather, time and date, news, multilingual translation, vehicle traffic restrictions, transportation, vehicle usage tutorials, creating story picture books, painting, and performing multimodal Q&A using images of all aspects of the vehicle. When the input query matches a clear in-vehicle instruction, if the in-vehicle instruction consists of a single atomic instruction, then answer 'Simple instruction', if it consists of two or more atomic instructions, then answer 'Complex instruction' (multiple atomic instructions can be related to each other or independent of each other), and sequentially split out multiple atomic instructions."

[0137] Using this third prompt text enables the target language model to perform instruction recognition based on the prompt embedding data and the query embedding data to determine the query instruction information corresponding to the input query.

[0138] The above fourth prompt text can be: "3. When the user input query is judged as a'simple instruction', you need to combine the specific content of the user input query with the APIs and their function descriptions provided in the

API candidate list

[0139] Using this fourth prompt text, the target language model can determine the interface call strategy that matches the query instruction information from the interface call strategies corresponding to multiple instruction types based on the query instruction information, and then select the target interface tool from multiple interface tools according to the interface code and in accordance with the matched interface call strategy, and determine the interface name corresponding to the target interface tool.

[0140] The above fifth prompt text can be: "4. When the input query does not match a specific vehicle-mounted instruction, directly answer 'Other'."

[0141] Please note that this is a process of gradually analyzing the user's current input query, and it is necessary to strictly make judgments and give answers according to the above steps. If a certain step is matched, there is no need to continue to judge the next step, and just directly answer the corresponding result.

[0142] Please strictly follow the answers of'simple instruction', 'complex instruction', and 'other'. Remember, when your answer belongs to one of'simple instruction' and 'complex instruction', you need to output the corresponding one or more standard <instructions>; when your answer is'simple instruction' and an API in the

API candidate list

[0143] To sense and distinguish users in different positions inside the vehicle, the user input format is: 'User location: User input query', where the user location includes: driver's seat / passenger seat / left side of the second row / right side of the second row / left side of the third row / right side of the third row."

[0144] Using this fifth prompt text, the target language model can generate answer data based on the query instruction information and the interface name according to the input format of the answer data.

[0145] It should be noted that the specific examples of the context information, interface description text, and processing prompt text listed in the embodiments of the present application are only optional setting methods in the exemplary application scenarios, and different specific examples from those in the embodiments of the present application can also be adopted according to the scenario requirements in other application scenarios. That is to say, the present application does not limit the specific setting methods of the above context information, interface description text, and processing prompt text.

[0146] It is easy to understand that, through the above query processing method, in the embodiments of the present application, through the synergistic effect of the five parts of hint text included in the hint text, a systematic constraint on the tool call method corresponding to the input query can be provided for the target language model, improving the accuracy and efficiency of the target language model in processing the input query, thereby improving the accuracy and generation efficiency of the answer data.

[0147] It should be noted that the query processing method mentioned above in the present application can be understood as an efficient large model call scheme based on tool description compression encoding. This scheme is not only applicable to the intelligent cockpit of vehicles, but can also be widely extended to other application scenarios, especially in those fields that rely on large language models for complex tool calls and information processing. The following are several possible application fields:

[0148] For example, in the application scenario of smart home control, using the query processing method in the present application, the model in the smart home control system can call the interfaces corresponding to various tools such as controlling lights, temperature, and security monitoring to provide services to users efficiently and accurately.

[0149] For example, in the application scenario of enterprise management systems, using the query processing method in the present application, it is possible to call the interfaces corresponding to various enterprise tools to automatically complete specific work tasks such as approval processes and data analysis, improving the processing efficiency of enterprise tasks.

[0150] For example, in the application scenario of online education platforms, using the query processing method in the present application, by processing the questions raised by students, the tool interfaces such as course materials, experimental guidance, and question bank analysis can be called efficiently and accurately, and corresponding answers can be given more quickly and accurately.

[0151] For example, in the application scenario of intelligent customer service or chatbots, using the query processing method in the present application, on social media platforms, it is used to identify user intentions and call corresponding functions such as querying personal information and participating in community activities.

[0152] These application scenarios all benefit from the ability of large models to efficiently call tools, which can improve the user experience, system response speed, and task execution accuracy. By compressing and encoding tool descriptions, the context length of model inputs can be effectively reduced, thereby overcoming technical limitations in large-scale tool call scenarios and making the application of large models more extensive and efficient.

[0153] In particular, for the scenario of intelligent customer service or chatbots, query statements input by users, processing prompt texts that constrain the tool call methods corresponding to the query statements, and interface description texts that describe multiple interface tools corresponding to the tool call methods are obtained. Further, the intelligent customer service system performs encoding processing on the interface description texts, compresses the interface description texts with longer text lengths into interface encodings with shorter text lengths. Then, using the interface encodings with shorter text lengths, the processing prompt texts, and the query statements, a shorter comprehensive embedding sequence is constructed, shortening the context length of the input model. Moreover, it can ensure that the semantics of the interface description texts are accurately transmitted in model reasoning, improving the accuracy and efficiency of the model in processing query statements. Then, using this comprehensive embedding sequence, the target language model is driven to perform reasoning calculations, enabling the model to accurately call the corresponding interface tools for the query statements for processing under specified conditions, thereby more efficiently and accurately completing the processing of the query statements input by users.

[0154] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the users or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.

[0155] According to an embodiment of the present application, a query processing device is also provided. Please refer to Figure 4 . The device includes: an acquisition module 401, configured to acquire an input query, a processing prompt text, and an interface description text, where the processing prompt text is used to constrain the tool call method corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call method; an encoding module 402, configured to perform encoding processing on the interface description text to obtain an interface encoding; a construction module 403, configured to construct a comprehensive embedding sequence using the interface encoding, the processing prompt text, and the input query; and a calculation module 404, configured to drive the target language model to perform reasoning calculations using the comprehensive embedding sequence to generate answer data.

[0156] It should be noted here that the above acquisition module 401, encoding module 402, construction module 403, and calculation module 404 correspond to steps S21 to S24 in the method embodiment. The functions and application scenarios of these four modules are the same as those of the corresponding steps, but are not limited to the content disclosed in the above method embodiment.

[0157] It should be noted that the various modules mentioned in the above device embodiments can be implemented by software, hardware, or a combination of software and hardware. For example, when implementing the above modules in hardware, each module can be set in the same processor, or each module can be set in different processors in any combination form. For another example, the above modules can be hardware components or software components stored in a memory (for example, memory 104) and processed by one or more processors (for example, processors 102a, 102b,..., 102n), and the above modules can also run as part of a device in a Figure 1 computing terminal 10 as shown.

[0158] According to an embodiment of the present application, an embodiment of a vehicle is further provided. The vehicle includes a memory storing an executable program, and a processor for running the program. When the program runs, it executes the query processing method described in any one of the above.

[0159] According to an embodiment of the present application, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program. When the program runs, it controls the device where the computer-readable storage medium is located to implement the above query processing method.

[0160] Optionally, the above computer storage medium may include, but is not limited to: a hard disk drive (HDD), a solid state drive (SSD), a USB flash drive, an optical disc, a memory card, a cloud storage medium, and a network-attached storage (NAS), etc.

[0161] Optionally, the above computer-readable storage medium can be set to store a computer program for performing the following steps: obtaining an input query, processing a prompt text and an interface description text, where the prompt text is used to constrain the tool call method corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call method; performing an encoding process on the interface description text to obtain an interface encoding; using the interface encoding, the prompt text, and the input query to construct a comprehensive embedding sequence; using the comprehensive embedding sequence to drive a target language model to perform an inference calculation to generate answer data.

[0162] According to an embodiment of the present application, a computer program product is further provided. The computer program product includes a computer program that can implement the above request processing method for an intelligent cockpit when executed by a processor.

[0163] Optionally, the above computer program product may provide services for improving the accuracy and efficiency of processing requests of the intelligent cockpit based on the above request processing method of the intelligent cockpit.

[0164] Optionally, in this embodiment, the above computer program product may be a set of instructions and codes pre-written according to the above request processing method of the intelligent cockpit. The computer program product can run on various different computer platforms, including personal computers, servers, mobile devices, etc.

[0165] Optionally, in this embodiment, the instructions and codes corresponding to the computer program product are used to implement the following method steps: obtaining an input query, processing a prompt text and an interface description text, where the prompt text is used to constrain the tool call method corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call method; performing encoding processing on the interface description text to obtain an interface code; constructing a comprehensive embedding sequence by using the interface code, the processed prompt text and the input query; and driving a target language model to perform inference calculation by using the comprehensive embedding sequence to generate answer data.

[0166] In the above embodiments of the present invention, the descriptions of the respective embodiments have their own focuses. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0167] In several embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.

[0168] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0169] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0170] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROMs, short for Read-Only Memory), random access memories (RAMs, short for Random Access Memory), mobile hard disks, magnetic disks, or optical discs.

[0171] The foregoing are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A query processing method, characterized in that, Including: Obtain an input query, a processing prompt text, and an interface description text, where the processing prompt text is used to constrain the tool call method corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call method; Perform encoding processing on the interface description text to obtain an interface encoding; Use the interface encoding, the processing prompt text, and the input query to construct a comprehensive embedding sequence; Use the comprehensive embedding sequence to drive a target language model to perform inference calculations and generate answer data.

2. The query processing method according to claim 1, wherein Performing encoding processing on the interface description text to obtain the interface encoding includes: Perform word segmentation processing on the interface description text to obtain description word segmentation data; Use a pre-trained embedding encoding model to perform semantic vector embedding encoding on the description word segmentation data to obtain the interface encoding, where the encoding dimension of the embedding encoding model is determined according to the hidden space size of the target language model.

3. The query processing method according to claim 2, wherein The interface encoding is an encoding matrix, the first matrix dimension of the encoding matrix is determined by the number of types of the multiple interface tools, and the second matrix dimension of the encoding matrix is determined by the hidden space size.

4. The query processing method according to claim 1, wherein Using the interface encoding, the processing prompt text, and the input query to construct the comprehensive embedding sequence includes: Perform embedding conversion processing on the processing prompt text to obtain prompt embedding data; Perform embedding conversion processing on the input query to obtain query embedding data; Based on the interface encoding, the prompt embedding data, and the query embedding data, construct the comprehensive embedding sequence.

5. The query processing method according to claim 4, wherein The prompt embedding data includes: a pre-prompt embedding and a post-prompt embedding. Performing embedding conversion processing on the processing prompt text to obtain the prompt embedding data includes: Parse the processing prompt text according to preset context information to obtain a pre-prompt text and a post-prompt text, where the context information is used to determine the organization order of the processing prompt text and the interface description text. The pre-prompt text includes a part of the prompt text in the processing prompt text whose organization order is before the interface description text, and the post-prompt text includes a part of the prompt text in the processing prompt text whose organization order is after the interface description text; Perform embedding conversion processing on the pre-prompt text to obtain the pre-prompt embedding; Perform embedding conversion processing on the post-prompt text to obtain the post-prompt embedding.

6. The query processing method according to claim 5, wherein Based on the interface encoding, the prompt embedding data, and the query embedding data, constructing the comprehensive embedding sequence includes: Sort and combine the pre-prompt embedding, the interface encoding, the post-prompt embedding, and the query embedding data in a target construction order to generate the comprehensive embedding sequence.

7. The query processing method according to claim 5, wherein Using the comprehensive embedding sequence to drive the target language model to perform inference calculations and generate the answer data includes: Using the comprehensive embedding sequence, drive the target language model to perform inference calculations, so that the target language model identifies instructions based on the prompt embedding data and the query embedding data, determines the query instruction information corresponding to the input query, determines the interface name of the target interface tool to be called according to the query instruction information and the interface encoding, and generates the answer data based on the query instruction information and the interface name.

8. The query processing method according to any one of claims 1 to 7, characterized in that, The processing prompt text includes: The first prompt text is used to describe the dialogue scenario corresponding to the input query; The second prompt text is used to indicate updating the input query according to the dependency relationship between the input query and the historical dialogue; The third prompt text is used to define the instruction classification criteria and indicate the instruction recognition and classification of the input query; The fourth prompt text is used to define the interface call policies corresponding to multiple instruction categories and indicate selecting the target interface tool from the multiple interface tools; The fifth prompt text is used to determine the input format of the answer data.

9. A query processing device, characterized in that, It includes: An acquisition module, configured to acquire an input query, processing prompt text, and interface description text, where the processing prompt text is used to constrain the tool call method corresponding to the input query, and the interface description text is used to describe multiple interface tools corresponding to the tool call method; An encoding module, configured to perform encoding processing on the interface description text to obtain an interface encoding; A construction module, configured to construct a comprehensive embedding sequence by using the interface encoding, the processing prompt text, and the input query; A calculation module, configured to drive the target language model to perform inference calculations by using the comprehensive embedding sequence and generate answer data.

10. A vehicle, characterized in that, It includes: A memory storing an executable program; A processor, configured to run the program, where when the program runs, it executes the query processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Function tool calling method and device in trusted execution environment, medium and equipment

    CN118114771A

  • Text processing method and device, electronic equipment and storage medium

    CN118227868A

  • Question and answer method, system and equipment based on intelligent cockpit and medium

    CN119719311A

  • Tool recommendation method and device and electronic equipment

    CN119829753A

  • Multi-stage multi-hop natural language and model execution plan generation

    US20250111164A1

Cited By

  • Voice interaction method and device, equipment and storage medium

    CN120895035A