LLM interaction method, system and device based on intention domain pre-judgment
By executing tool calls in parallel on top of a lightweight semantic understanding model, the high latency problem in the LLM interaction process is solved, achieving fast response and accurate interaction experience.
Patent Information
- Application Number
- CN202611350610.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-20
AI Technical Summary
In the existing LLM interaction process, tool execution is placed after the first round of inference in the large language model, resulting in excessive interaction latency and affecting user experience.
Intent recognition is performed using a lightweight semantic understanding model, which matches skill profiles and executes tool calls in parallel to obtain real runtime data. After constructing initial contextual prompts, the data is input into a large language model for inference.
It reduced response latency, improved interaction efficiency and accuracy, optimized system resource allocation, and enhanced user experience.
Smart Images

Figure CN123142618A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of in-vehicle voice interaction technology, specifically to an LLM interaction method, system, and device based on intent domain prediction. Background Technology
[0002] With the rapid development of artificial intelligence technology, large language models (LLMs) have been widely used in various intelligent interaction scenarios, such as in-vehicle voice interaction scenarios.
[0003] In existing typical implementations, LLM interaction flows are mostly processed sequentially: First, the system receives user input and directly inputs it into the large language model for the first round of inference. Then, the large language model determines whether a specific external tool (such as checking the weather or controlling in-vehicle devices) needs to be invoked based on the inference result, and generates the corresponding tool invocation command. After the system executes the tool invocation command to obtain the actual runtime data, it feeds the data back to the large language model for secondary or subsequent rounds of inference, finally generating the response text. Because the tool execution is placed after the first round of inference by the large language model, the system must wait for the model to complete intent understanding and decision-making before it can begin acquiring data. This results in excessively high interaction latency, impacting the user experience. Summary of the Invention
[0004] In view of this, this application provides an LLM interaction method, system, and device based on intent domain prediction. It aims to solve or partially solve the problems existing in the background art.
[0005] The first aspect of this application provides an LLM interaction method based on intent domain prediction, the method comprising: Receive user input commands; The instructions are subjected to intent recognition using a lightweight semantic understanding model, and intent domain labels are output. Based on the intent domain label, match and load the corresponding skill configuration file; Parse the metadata in the skill configuration file to obtain a list of tool interfaces to be executed; Before constructing the initial contextual prompts for the large language model, the calls to the tools in the list of tool interfaces to be executed are performed in parallel to obtain real runtime data; The skill configuration file is concatenated with the actual runtime data to construct initial context prompts; The initial contextual cue words are input into a large language model for inference to generate response text.
[0006] Optionally, if the output result obtained by performing intent recognition on the instruction also includes the confidence score corresponding to the intent domain label, then the method includes: The current response mode is determined based on the relationship between the confidence score and a preset threshold; wherein, the response mode includes a parallel preload response mode and a serial response mode; If the confidence score is greater than or equal to the preset threshold, it is determined to be in parallel preloading response mode, and the above-mentioned parallel execution of the tool calls in the tool interface list to be executed is performed to obtain the actual runtime data; If the confidence score is less than the preset threshold, it is determined to be a serial response mode. The large language model then infers the instruction and makes a decision to call the tool and obtain the actual runtime data.
[0007] Optionally, the step of matching and loading the corresponding skill configuration file based on the intent domain tag includes: Read the preset skill registry; Based on the intent domain label, skill configuration files that match the intent domain label are filtered from the skill registry to obtain the initial screening results; Read the current system operating status variables, which include at least one of vehicle driving status, media playback status, or geographical location information; Based on predefined skill filtering rules and the current system running status variables, the initial screening results are subjected to secondary screening to select skill configuration files that match the current system running status variables, thus obtaining the secondary screening results. Load the skill configuration files from the secondary screening results into memory.
[0008] Optionally, the calls to tools in the list of tool interfaces to be executed are performed in parallel to obtain real runtime data, including: Parse the dynamic placeholders in the input parameter templates of each tool in the list of tool interfaces to be executed; Extract the actual value corresponding to the dynamic placeholder from the current system runtime state; The actual values are filled into the dynamic placeholder positions to obtain the instantiated parameter set; A data retrieval request is generated and executed based on the instantiated parameter set to obtain the actual runtime data.
[0009] Optionally, when the intent domain label matches multiple skill profiles, the input parameter templates of the tools in all matching skill profiles are analyzed to identify the dynamic placeholders corresponding to the runtime state variables of the same system. Read the actual value once for the runtime state variable of the same system; The actual values read are then injected into the instantiation parameter sets of each tool that depends on the runtime state variables of the same system. Based on each of the instantiation parameter sets, generate their respective data acquisition requests and execute them in parallel to obtain real runtime data; All matching skill configuration files are concatenated with the actual runtime data to construct initial contextual prompts.
[0010] Optional, also includes: Real-time monitoring of the invocation status of tools in the list of tool interfaces to be executed; If a call to a tool in the list of tools to be executed does not return actual runtime data within the timeout threshold, the actual runtime data acquisition operation for that tool will be terminated. Mark the output field corresponding to this tool as unavailable or fill it with a default placeholder to the initial context prompt.
[0011] Optional, also includes: Monitor the semantic consistency between the response text generated by the large language model and the obtained real runtime data; If a logical conflict or data mismatch is detected, a correction command is triggered. The current generation process is interrupted based on the correction instruction, and the process is switched to serial response mode. The corresponding tool is then called again to obtain the actual runtime data and generate a new response text.
[0012] Optionally, in the serial response mode: The instruction is input into the large language model for the first round of inference, and the tool call instruction is output. The tool calls instructions to obtain real runtime data, and then feeds the obtained real runtime data back to the large language model for subsequent rounds of inference to generate response text.
[0013] A second aspect of this application provides an LLM interaction system based on intent domain prediction, the system comprising: The instruction receiving module is used to receive instructions input by the user. The intent determination module is used to identify the intent of the instruction using a lightweight semantic understanding model and output an intent domain label. The skill configuration file determination module is used to match and load the corresponding skill configuration file based on the intent domain tag; The parsing module is used to parse the metadata in the skill configuration file to obtain a list of tool interfaces to be executed; The runtime data acquisition module is used to execute the calls to the tools in the list of tools to be executed in parallel before constructing the initial context prompt words for the large language model, so as to obtain the actual runtime data. The prompt word construction module is used to concatenate the skill configuration file with the actual runtime data to construct initial context prompt words; The response module is used to input the initial contextual prompts into the large language model for inference and generate response text.
[0014] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements the steps of the LLM interaction method based on intent domain prediction described in the first aspect of this application.
[0015] The LLM interaction method based on intent domain prediction provided in this application has the following advantages: The LLM interaction method based on intent domain prediction provided in this application determines the intent domain setting through a lightweight semantic understanding model, matches and loads the corresponding skill configuration file based on the intent domain label, parses the metadata in the skill configuration file to obtain a list of tool interfaces to be executed, and executes the calls to the tools in the list of tool interfaces to be executed in parallel before constructing the initial context prompts for the large language model, thereby obtaining real runtime data. This achieves the completion of the tool call and acquisition of real runtime data before constructing the initial context prompts for the large language model. Compared to the previous serial process where the large language model had to perform inference and decision-making before triggering tool calls, this solution parallelizes or preprocesses the time-consuming tool data acquisition process with the inference stage of the large model, ensuring that the large language model contains the necessary real-time data when receiving prompts, thus effectively reducing response latency.
[0016] Meanwhile, this application introduces a lightweight semantic understanding model to identify the intent domain and assess the confidence level of user commands, enabling adaptive switching of response modes based on the certainty of the user command. For explicit commands with high confidence, a parallel preloading mechanism avoids the involvement of a large language model in simple tool decision-making processes, reducing the ineffective computational overhead and token consumption of a large model. For ambiguous commands with low confidence, a serial response mode is retained to ensure the accuracy of the processing logic. This mechanism achieves optimal allocation of system resources and improved processing efficiency while ensuring interaction quality.
[0017] Furthermore, this application directly concatenates the actual runtime data obtained from tool calls into the initial context prompts, ensuring that the large language model can make decisions and generate text based on the latest and most accurate system environment data during inference. This not only avoids process interruptions caused by information lag or the need for multiple rounds of interaction to obtain necessary state information, but also improves the accuracy of response text generated in a single interaction, thereby enhancing the user's interactive experience. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A flowchart illustrating an LLM interaction method based on intent domain prediction, as shown in one embodiment of this application; Figure 2 A timing diagram illustrating an LLM interaction method based on intent domain prediction, as shown in one embodiment of this application; Figure 3 This is a schematic diagram of an LLM interaction system based on intent domain prediction, as shown in one embodiment of this application. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] This application provides an LLM interaction method based on intent domain prediction, which relates to in-vehicle voice interaction application scenarios. It is mainly applied to in-vehicle voice agent systems and aims to reduce the number of interaction rounds of large language models (LLM) and reduce response latency through intent prediction and tool preloading mechanisms, thereby meeting the requirements for fast response in in-vehicle scenarios.
[0022] In this embodiment, the LLM interaction method based on intent domain prediction provided in this application is applied to an in-vehicle voice agent system including: a user input terminal, a lightweight semantic understanding model, a large language model, a skill registry, and a tool call interface library. The specific implementation process is as follows: refer to Figure 1 , Figure 1This is a flowchart illustrating an LLM interaction method based on intent domain prediction, as shown in one embodiment of this application. Figure 1 As shown, the method includes: Step S101: Receive instructions input by the user.
[0023] In this embodiment, the in-vehicle voice agent system collects the user's voice commands through a microphone array and converts them into text-formatted command data. This command data includes natural language requests made by the user in specific in-vehicle interaction scenarios, such as querying media information, weather conditions, or navigation routes. The system uses the processed text commands as input for subsequent processing.
[0024] Step S102: Perform intent recognition on the instruction using a lightweight semantic understanding model and output intent domain labels.
[0025] In this embodiment, the system invokes a pre-trained lightweight semantic understanding model (such as an NLU model, Natural Language Understanding Classification Model) to perform inference analysis on the user-input command data. This lightweight semantic understanding model adopts a low-parameter architecture to adapt to the computational resource limitations of the in-vehicle device. The intent domain label output by the model is used to characterize the business domain to which the user command belongs.
[0026] For example, when a user inputs "What is this movie about?", the lightweight semantic understanding model analyzes the semantics of the text and outputs the intent domain label as "media" (media domain); if the input is a vague command such as "Help me adjust it", the model may output the intent domain label as "control" (control domain).
[0027] Step S103: Based on the intent domain label, match and load the corresponding skill configuration file.
[0028] In this embodiment, based on the intent domain tag obtained in step S102, the system retrieves the skill configuration file that matches the tag from the skill registry. Each skill configuration file contains a business logic description and related metadata information. The metadata explicitly defines the list of tools to be invoked during the execution of the corresponding skill and their invocation rules, i.e., the tool invocation declaration. The system loads the full text of the skill configuration file matching the intent domain tag into memory, preparing a complete business knowledge background for subsequent large language model inference.
[0029] For example, if the intent domain label is "media", the system queries the skill registry for the "media-ask" skill configuration file that matches the "media" intent domain label, and reads the 'tools_precall' field (i.e., tool call declaration) in its metadata. This tool call declaration indicates that the current media playback status needs to be obtained.
[0030] Step S104: Parse the metadata in the skill configuration file to obtain a list of tool interfaces to be executed.
[0031] In this embodiment, the system performs structured parsing of the metadata in the loaded skill configuration file, extracting the tool call declarations defined therein. Based on the parsing results, a list of tool interfaces to be executed, containing specific tool identifiers, method names, and parameter templates, is generated. This list of tool interfaces to be executed clarifies which runtime data needs to be acquired in advance before LLM inference, avoiding the serial time consumption of waiting for LLM inference and then making step-by-step decisions for calls in the traditional approach.
[0032] Step S105: Before constructing the initial context prompt words for the large language model, execute the calls to the tools in the list of tools to be executed in parallel to obtain the actual runtime data.
[0033] In this embodiment, the system does not wait for the participation of the large language model, but directly initiates tool call requests from the list of pending tool interfaces in the local or background service. These tool calls aim to obtain dynamic information such as the current vehicle status, media playback information, or geographical location—that is, real-time runtime data. Through a parallel execution mechanism, tool call requests from multiple tools in the pending tool interface list can be issued simultaneously, further reducing the data acquisition waiting time.
[0034] For example, if the list of pending tool interfaces includes "get the currently playing song" and "get the current location latitude and longitude", the system will send requests to both the media service interface and the location service interface simultaneously, instead of processing them in a queue, thereby further reducing the waiting time for data acquisition.
[0035] Step S106: Concatenate the skill configuration file with the actual runtime data to construct initial context prompts.
[0036] Step S107: Input the initial context prompts into the large language model for inference and generate response text.
[0037] In this embodiment, the system merges the full text of the loaded skill configuration file with the real runtime data obtained in step S105. Specifically, the system directly fills the reserved variable positions in the skill configuration file with the specific values from the real runtime (such as the name of the currently playing song or the latitude and longitude of the current location), or appends them directly to the skill content, forming initial contextual prompts containing complete business rules and real-time runtime data. Subsequently, the system inputs the constructed initial contextual prompts into the large language model all at once. Since the LLM already possesses complete skill knowledge and real-time runtime data context during the first inference, the final response text can be directly generated and output to the user without multiple rounds of interaction.
[0038] This embodiment, through the above steps, compresses the original three-round LLM interaction (reading skills, querying context, and generating responses) into a single LLM inference, which can significantly reduce end-to-end response latency and meet the technical requirements for rapid response in automotive scenarios.
[0039] The LLM interaction method based on intent domain prediction provided in this application determines the intent domain setting through a lightweight semantic understanding model, matches and loads the corresponding skill configuration file based on the intent domain label, parses the metadata in the skill configuration file to obtain a list of tool interfaces to be executed, and executes the calls to the tools in the list of tool interfaces to be executed in parallel before constructing the initial context prompts for the large language model, thereby obtaining real runtime data. This achieves the completion of the tool call and acquisition of real runtime data before constructing the initial context prompts for the large language model. Compared to the previous serial process where the large language model had to perform inference and decision-making before triggering tool calls, this solution parallelizes or preprocesses the time-consuming tool data acquisition process with the inference stage of the large model, ensuring that the large language model contains the necessary real-time data when receiving prompts, thus effectively reducing response latency.
[0040] Furthermore, the subsequent solution in this application introduces a lightweight semantic understanding model to identify the intent domain and assess the confidence level of user commands, enabling adaptive switching of response modes based on the certainty of the user command. For explicit commands with high confidence, a parallel preloading mechanism avoids the involvement of a large language model in simple tool decision-making processes, reducing the ineffective computational overhead and token consumption of a large model. For ambiguous commands with low confidence, a serial response mode is retained to ensure the accuracy of the processing logic. This mechanism achieves optimal allocation of system resources and improved processing efficiency while ensuring interaction quality.
[0041] Furthermore, this application directly concatenates the actual runtime data obtained from tool calls into the initial context prompts, ensuring that the large language model can make decisions and generate text based on the latest and most accurate system environment data during inference. This not only avoids process interruptions caused by information lag or the need for multiple rounds of interaction to obtain necessary state information, but also improves the accuracy of response text generated in a single interaction, thereby enhancing the user's interactive experience.
[0042] In conjunction with the above embodiments, in one implementation, this application also provides an LLM interaction method based on intent domain prediction. In this LLM interaction method based on intent domain prediction, when the output result obtained by performing intent recognition on the instruction also includes a confidence score corresponding to the intent domain label, the method further includes: The current response mode is determined based on the relationship between the confidence score and a preset threshold; wherein, the response mode includes a parallel preload response mode and a serial response mode; If the confidence score is greater than or equal to the preset threshold, it is determined to be in parallel preloading response mode, and the above-mentioned parallel execution of the tool calls in the tool interface list to be executed is performed to obtain the actual runtime data; If the confidence score is less than the preset threshold, it is determined to be a serial response mode. The large language model then infers the instruction and makes a decision to call the tool and obtain the actual runtime data.
[0043] In this embodiment, the output result obtained by recognizing the instruction may further include the confidence score corresponding to the intent domain label. When the output result obtained by recognizing the instruction also includes the confidence score corresponding to the intent domain label, the method further includes the following implementation steps: The system invokes a pre-trained lightweight semantic understanding model (such as an NLU model, Natural Language Understanding Classification Model) to perform inference analysis on the user-input command data. This lightweight semantic understanding model employs a low-parameter architecture to adapt to the computational resource limitations of in-vehicle devices. The model output includes two core elements: first, an intent domain label, used to characterize the business domain to which the user command belongs; and second, a confidence score, used to quantify the reliability of the current recognition result. The confidence score is numerical data, for example, set between 0 and 1.
[0044] For example, when a user inputs "What is this movie about?", the lightweight semantic understanding model analyzes the semantics of the text and outputs the intent domain label as "media" (media domain), along with a corresponding confidence score of 0.92. If the user inputs a vague command such as "Help me with this", the model may output the intent domain label as "control" (control domain) and a confidence score of 0.45.
[0045] In this embodiment, the system internally stores a preset threshold parameter (e.g., 0.85). The system compares the confidence score of the output intent domain label with this preset threshold. When the confidence score indicates that the recognition result is highly reliable, the system determines that an accelerated processing flow, i.e., a parallel pre-loading response mode, is suitable. Conversely, if the confidence score is low, the system switches to a traditional serial processing flow, i.e., a serial response mode, to ensure the accuracy of the interaction. This step achieves a dynamic balance between speed priority and accuracy priority, ensuring a significant reduction in latency when the intent is clear, while maintaining the stability of the system's accuracy performance when the intent is ambiguous.
[0046] Specifically, when the confidence score output by the lightweight semantic understanding model reaches or exceeds a preset threshold (e.g., 0.85), the system clearly determines that the user's intent is clear and definite. At this point, it directly triggers the entry into the parallel preloading response mode. This implementation method ensures maximum processing speed under most standard instructions. The working process of the parallel preloading response mode is as follows: based on the intent domain label, the corresponding skill configuration file is matched and loaded; the metadata in the skill configuration file is parsed to obtain a list of tool interfaces to be executed; before constructing the initial context prompt words for the large language model, the calls to the tools in the list of tool interfaces to be executed are executed in parallel to obtain the actual runtime data; the skill configuration file and the actual runtime data are concatenated to construct the initial context prompt words; the initial context prompt words are input into the large language model for inference to generate the response text.
[0047] In this embodiment, when the confidence score is below a preset threshold (e.g., 0.45), the system considers the intent ambiguous or the recognition risk high. At this point, the parallel preloading process is blocked, and the system switches to serial response mode. In serial response mode, the system directly inputs the original instruction into the large language model, which completes the first round of inference and outputs a tool invocation decision. Subsequently, it obtains real runtime data based on this decision. Although this implementation sacrifices some speed, it utilizes the contextual understanding capabilities of the large language model to ensure the accuracy of intent recognition, avoiding preloading errors, resource waste, or response deviations caused by low confidence.
[0048] In conjunction with the above embodiments, in one implementation, this application also provides an LLM interaction method based on intent domain prediction. In this LLM interaction method based on intent domain prediction, step S103 may include the following steps: Step S103_1: Read the preset skill registry.
[0049] Step S103_2: Based on the intent domain label, filter out the skill configuration files that match the intent domain label from the skill registry to obtain the initial screening result.
[0050] This embodiment further defines the specific filtering process for skill configuration file matching and loading in step S103, based on the above embodiment.
[0051] In this embodiment, the system maintains a global skill registry, which indexes the domain tags (such as music, weather) of all available skills. The system first performs a first-level coarse-grained filtering based on the intent domain tag, that is, it indexes the skill profiles (which include their own metadata) that match the intent domain tag from the global skill registry, in order to quickly lock the set of potentially related skill profiles and obtain the corresponding preliminary screening results.
[0052] Step S103_3: Read the current system operating status variables, which include at least one of vehicle driving status, media playback status, or geographical location information.
[0053] Step S103_4: Based on the predefined skill filtering rules and the current system running status variables, perform a second screening on the initial screening results to filter out the skill configuration files that match the current system running status variables, and obtain the second screening results.
[0054] In this embodiment, to further optimize resource utilization and improve the accuracy of tool invocation, the system introduces a context-aware mechanism based on the initial screening. The system reads the vehicle's current operating status in real time (i.e., the current system operating status variables, including at least one of vehicle driving status, media playback status, or geographical location information), such as whether the vehicle is in motion, whether the media player is playing content, or the vehicle's geographical location range. Combining predefined skill filtering rules (such as "if there is no media playing, then filter out skills that only target already played content"), the initial screening results are further filtered to select skill configuration files that match the current system operating status variable, thus obtaining the corresponding secondary filtering results.
[0055] For example, when the intent domain label is "media," the system detects that the vehicle is currently off and not connected to a Bluetooth media device. According to the filtering rules, although media-related skills are matched, configuration items that rely on online streaming media services will be removed, and only local audio-related configurations or skill files that cannot be played will be retained. This secondary filtering ensures that the loaded skill configurations match the current real-world scenario.
[0056] Step S103_5: Load the skill configuration file from the secondary screening results into memory.
[0057] In this embodiment, the skill configuration file from the final double-screening result is officially loaded into the system memory for subsequent parsing and prompt word construction, thereby avoiding the occupation and misuse of invalid skills. The current system running status variable read here is a lightweight status indicator (such as whether it is playing), rather than specific runtime content data (such as song name).
[0058] In conjunction with the above embodiments, in one implementation, this application also provides an LLM interaction method based on intent domain prediction. In this LLM interaction method based on intent domain prediction, step S105 may include the following steps: Step S105_1a: Parse the dynamic placeholders in the input parameter templates of each tool in the list of tool interfaces to be executed.
[0059] This embodiment further defines the specific parameter processing logic for the parallel execution tool call in step S105, based on the above embodiment.
[0060] In this embodiment, the tool invocation declaration contains a defined input parameter template, which includes specific dynamic placeholders (such as '${runtime.xxx}'). The system identifies these dynamic placeholders and determines the runtime data type that needs to be filled.
[0061] Step S105_2a: Extract the actual value corresponding to the dynamic placeholder from the current system runtime state; fill the actual value into the position of the dynamic placeholder to obtain the instantiated parameter set.
[0062] In this embodiment, the system extracts specific actual values from the real-time operational data bus of the vehicle system based on the semantic definition of dynamic placeholders. For example, for dynamic placeholders representing location, the current GPS latitude and longitude coordinates are extracted; for dynamic placeholders representing time, the current system timestamp is extracted. The system substitutes the extracted actual values into the corresponding dynamic placeholder positions in the input parameter template to complete the parameter instantiation process and generate an executable data acquisition request parameter set (i.e., the instantiated parameter set). This mechanism allows skill configuration files to dynamically adapt to the environment without hard-coding specific values.
[0063] For example, in a weather query scenario, the input parameter template contains '${runtime.location.lat}' and '${runtime.location.lng}'. The system reads the current vehicle coordinates (e.g., 31.23827, 121.32594) from the positioning module and fills them into the input parameter template to generate a complete API request message.
[0064] Step S105_3a: Generate and execute a data acquisition request based on the instantiated parameter set to obtain the actual runtime data.
[0065] In this embodiment, the system calls the network interface or local service interface based on the obtained instantiation parameter set to send the generated data acquisition request, and receives the returned JSON or other format data as the real runtime data, which is then used to concatenate the data to form the initial context prompt words.
[0066] In conjunction with the above embodiments, in one implementation, this application also provides an LLM interaction method based on intent domain prediction. In this LLM interaction method based on intent domain prediction, step S105 may include the following steps: Step S105_1b: When the intent domain label matches multiple skill profiles, analyze the input parameter templates of the tools in all the matching skill profiles, identify the dynamic placeholders of the runtime state variables of the same system, and read the actual value of the runtime state variables of the same system once.
[0067] This embodiment, based on the above embodiment, further defines the parallel loading and parameter processing logic when the intent domain label matches multiple skill configuration files.
[0068] In this embodiment, when a user command involves a complex intent (such as simultaneously including weather and media) (or for a single intent domain, there are multiple skill profiles matching that intent domain), multiple skill profiles may be matched. To avoid wasting resources and increasing latency due to repeatedly extracting the same context data, the system performs a merged analysis of the input parameter templates of all tools. If different tools are found to depend on the same system runtime state variable (e.g., all depending on the current geographical location), the actual value of the system runtime state variable is extracted only once from the vehicle's runtime state. Specifically, the system analyzes the input parameter templates of tools in all skill profiles matched by the user's current intent domain label, identifying dynamic placeholders belonging to the same system runtime state variable. Then, the actual value is read once for that same system runtime state variable.
[0069] For example, a user command might be "Play some songs that fit today's weather for me." This intent matches the "weather" and "media" skills, both of which require current location information as a parameter. The system only queries the latitude and longitude once from the location service, instead of querying them twice.
[0070] Step S105_2b: Inject the read actual values into the instantiation parameter sets of each tool that depends on the runtime state variables of the same system; generate their respective data acquisition requests based on each instantiation parameter set and execute them in parallel to obtain the real runtime data.
[0071] In this embodiment, the system distributes the actual value of a single extraction of the same system runtime state variable to all tool instances that depend on the same system runtime state variable. That is, for each tool that needs to use the same system runtime state variable, the specific value of the same system runtime state variable is filled into the corresponding dynamic placeholder position in the input parameter template of these tools. Then, based on the instantiation parameter sets of each tool, data acquisition requests are initiated in parallel for all tools. This strategy of shared reading and parallel execution further reduces the total time consumption in multi-skill scenarios.
[0072] Step S105_3b: Concatenate all the matching skill configuration files in their entirety with the actual runtime data to construct the initial context prompt words.
[0073] In this embodiment, the system integrates the contents of multiple matching skill files with the actual runtime data returned by their respective tools to jointly construct an initial contextual prompt input large language model containing multi-dimensional business knowledge, thereby realizing the one-time generation and response of compound instructions.
[0074] In conjunction with the above embodiments, in one implementation, this application also provides an LLM interaction method based on intent domain prediction. This LLM interaction method based on intent domain prediction further includes the following steps: Step S108: Monitor the invocation status of tools in the list of tools to be executed in real time; if the invocation of a tool in the list of tools to be executed does not return real runtime data within the timeout threshold, terminate the real runtime data acquisition operation of that tool.
[0075] This embodiment adds handling logic for abnormal tool call situations, based on the above embodiment.
[0076] In this embodiment, under the parallel preloading response mode, the system initiates a monitoring mechanism while concurrently executing tool calls to monitor the call status of tools in the list of pending tool interfaces in real time. A reasonable timeout threshold (e.g., 500ms) is also set. If a tool interface in the list of pending tool interfaces fails to return the corresponding runtime data within the timeout threshold due to network fluctuations or service unresponsiveness, the system will immediately interrupt the waiting process of that specific tool to prevent a single slow tool from blocking the overall response flow.
[0077] Step S109: Mark the output field corresponding to the tool as unavailable or fill it with a default placeholder to the initial context prompt.
[0078] In this embodiment, for timed-out tool call results, the system does not treat them as errors that block the entire task, but instead adopts a degradation processing strategy. Specifically, the data is marked as "unavailable" in the context or directly filled with a preset default placeholder (such as "current data retrieval failed"). This ensures that the large language model can still generate responses based on other available information, improving the robustness of the system and the continuity of the user experience.
[0079] In conjunction with the above embodiments, in one implementation, this application also provides an LLM interaction method based on intent domain prediction. This LLM interaction method based on intent domain prediction further includes the following steps: Step S110: Monitor the semantic consistency between the response text generated by the large language model and the obtained real runtime data.
[0080] This embodiment adds a verification and correction mechanism after the response is generated, based on the above embodiment.
[0081] In this embodiment, under the parallel preloading response mode, after the large language model generates the response text, the system introduces a verification step. This verification step compares the semantic consistency between the generated response text and the previously preloaded real runtime data to determine whether there are semantic inconsistencies (e.g., the preloaded latitude and longitude coordinates are for city A, while the response text provides the user with weather information for city B) or logical conflicts. Although the intent recognition confidence is high, in extreme cases, there may still be response errors due to changes in data state or recognition bias.
[0082] Step S111: If a logical conflict or data mismatch is detected, a correction instruction is triggered; based on the correction instruction, the current generation process is interrupted, the serial response mode is switched, the corresponding tool is called again to obtain the actual runtime data and generate a new response text.
[0083] In this embodiment, once a logical conflict or data mismatch is detected during verification, the system immediately triggers a correction command. This command forcibly interrupts the current parallel mode process and reverts to the serial response mode. In the serial response mode, the large language model re-invokes the decision-making tool based on the current state to ensure that the latest data is obtained and the generated result is corrected. This mechanism serves as the last line of defense, ensuring the accuracy and logical correctness of the final response.
[0084] Among them, logical conflict refers to the logical contradiction between the response content generated by the large language model and the preloaded skill logic or system state.
[0085] For example, the current media playback status is "not playing," and the skill configuration file contains the constraint rule "if not playing, guide the player to start the music." If the response text generated by the large language model is "You are playing the song 'XX'," this response logically conflicts with the preloaded "not playing" status, triggering a correction instruction.
[0086] Data mismatch refers to a discrepancy between the factual descriptions in the response generated by the large language model and the specific numerical values in the actual runtime data. For example, the actual runtime data shows the current weather as "sunny, temperature 30°C," while the response text generated by the large language model contains descriptions such as "it's raining heavily outside" or "the temperature is below zero."
[0087] In conjunction with the above embodiments, in one implementation, this application also provides an LLM interaction method based on intent domain prediction. In this LLM interaction method based on intent domain prediction, when it is determined that a serial response mode has been entered: the instruction is input into the large language model for the first round of inference, and a tool invocation instruction is output; real runtime data is obtained according to the tool invocation instruction, and the obtained real runtime data is fed back to the large language model for subsequent rounds of inference to generate response text.
[0088] In this embodiment, in low-confidence or correction-triggered scenarios, the system does not rely on the pre-judgment results of the lightweight model to load skills. Instead, it directly sends the original user instructions to the large language model. The large language model performs an initial analysis based on its built-in general knowledge and capabilities, autonomously determines the external tools that need to be called (such as read_asset, getCurrentMediaInfo, etc.), and outputs the specific tool call instructions.
[0089] In this embodiment, the system executes the tool invocation command specified by the large language model to obtain real runtime data. Subsequently, this obtained real runtime data is used as new context information and input back into the large language model. The large language model combines the original command with the real runtime data obtained in real time to finally generate an accurate response text output to the user. Although this sequential process is time-consuming, the autonomous decision-making capability of the large language model can handle scenarios with ambiguous intent, complex skill dependencies, or invalid preloaded data, thereby ensuring the accuracy of the interaction.
[0090] In this embodiment, as Figure 2 As shown, the complete implementation process of the LLM interaction method based on intent domain prediction provided in this application is as follows: First, the user initiates a command (e.g., "What is this movie about?"). Then, a lightweight semantic understanding model identifies the intent domain of the command, obtaining the corresponding intent domain label (nlu_domains, such as the media intent domain) and the corresponding confidence score. Here, we explain the parallel preloading response mode enabled for higher confidence scores. Based on the identified intent domain, the skill manager (i.e., SkillsLoader) loads the skill configuration file (e.g., the media-ask skill) that matches the intent domain label. Then, the full text of the skill configuration file is read, and the file reader (i.e., ReadAssetTool) calls read_asset to read and parse the tool call declarations (e.g., metadata.tools_precall) in the skill configuration file. Based on the parsing results, the tool precall executor (i.e., tools_precall executor) executes the corresponding tool call (e.g., executing MediaTool.getCurrentMediaInfo(), synchronously calling CapService to obtain the currently playing "The Wandering Earth 2"). The runtime data (such as the currently playing media information) obtained by calling the tool is sent to the file reader to concatenate the full text of the skill configuration file and the runtime data to obtain a complete context. Finally, the context builder constructs the corresponding prompt words based on the complete context, inputs them into the large language model for inference, and generates the response text.
[0091] In this embodiment, the metadata declaration field `tools_precall` in the skill configuration file defines the pre-execution tool calls that are automatically executed when a skill is read. The `params` property of `tools_precall` (i.e., the set of parameters passed to the target tool) supports dynamic placeholders for runtime variables `${runtime.xxx}`, which are replaced with actual values before execution. For example, `${runtime.location.lat}` → current latitude; `${runtime.location.lng}` → current longitude; `${runtime.voiceZone}` → current voice zone; `${runtime.currentTime}` → current time.
[0092] The trigger rules for the metadata declaration in the skill profile include: domains: A list of intent domains identified by NLU (such as music, navi, weather). trigger.domains defines which intent domain the skill should be activated in. keywords: triggers the keyword list; patterns: regular expression matching patterns; exclude_patterns: Exclude patterns; exclude_route: Excludes the route target.
[0093] Based on the same inventive concept, this application provides an LLM interaction system based on intent domain prediction, such as... Figure 3 As shown, the system 300 includes: The instruction receiving module 301 is used to receive instructions input by the user; The intent determination module 302 is used to identify the intent of the instruction through a lightweight semantic understanding model and output an intent domain label; The skill configuration file determination module 303 is used to match and load the corresponding skill configuration file based on the intent domain label; Parsing module 304 is used to parse the metadata in the skill configuration file to obtain a list of tool interfaces to be executed; The runtime data acquisition module 305 is used to execute the calls to the tools in the list of tools to be executed in parallel before constructing the initial context prompt words for the large language model, so as to obtain the actual runtime data. The prompt word construction module 306 is used to concatenate the skill configuration file with the actual runtime data to construct initial context prompt words; The response module 307 is used to input the initial context prompt words into the large language model for inference and generate response text.
[0094] Optionally, if the output result obtained from the intent recognition of the instruction also includes the confidence score corresponding to the intent domain label, the system 300 further includes: The pattern determination module is used to determine the current response pattern based on the relationship between the confidence score and a preset threshold; wherein the response pattern includes a parallel preloading response pattern and a serial response pattern; and is used to determine the parallel preloading response pattern if the confidence score is greater than or equal to the preset threshold, and execute the calls to the tools in the list of tools to be executed in parallel to obtain real runtime data; and is used to determine the serial response pattern if the confidence score is less than the preset threshold, and the large language model performs inference on the instructions and then decides to call the tools and obtain real runtime data. Optionally, the skill profile determination module 303 includes: The skill registry reading module is used to read the preset skill registry. The initial screening module is used to filter out skill configuration files that match the intent domain tags from the skill registry based on the intent domain tags, and obtain the initial screening results; The status variable reading module is used to read the current system operating status variables, which include at least one of vehicle driving status, media playback status, or geographical location information. The secondary screening module is used to perform secondary screening on the initial screening results based on predefined skill filtering rules and the current system running status variables, and to select skill configuration files that match the current system running status variables to obtain the secondary screening results. The loading module is used to load the skill configuration files from the secondary screening results into memory.
[0095] Optionally, the runtime data acquisition module 305 is configured to: parse the dynamic placeholders in the input parameter templates of each tool in the list of tools to be executed in the parallel preload response mode; extract the actual values corresponding to the dynamic placeholders from the current system runtime state; fill the actual values into the positions of the dynamic placeholders to obtain an instantiated parameter set; and generate and execute a data acquisition request based on the instantiated parameter set to obtain real runtime data.
[0096] Optionally, the system 300 also includes: The identification module is used to analyze the input parameter templates of tools in all matching skill profiles when the intent domain label matches multiple skill profiles, and identify the dynamic placeholders corresponding to the runtime state variables of the same system. The value reading module is used to read the actual value once for the runtime state variable of the same system. The instantiation module is used to inject the read actual values into the instantiation parameter sets of each tool that depends on the runtime state variables of the same system. The runtime data acquisition module is used to generate respective data acquisition requests based on each of the instantiated parameter sets and execute them in parallel to obtain real runtime data. The prompt word construction module 307 is used to concatenate the full text of all matched skill configuration files with the actual runtime data to construct the initial context prompt words.
[0097] Optionally, the system 300 also includes: The detection module is used to monitor the invocation status of tools in the list of tool interfaces to be executed in real time under the parallel preloading response mode. The termination module is used to terminate the real runtime data acquisition operation of a tool if the call to a tool in the list of tools to be executed does not return real runtime data within a timeout threshold. The prompt word building module 306 is used to mark the output field corresponding to the tool as unavailable or to fill the default placeholder into the initial context prompt word.
[0098] Optionally, the system 300 also includes: The semantic consistency determination module is used to monitor the semantic consistency between the response text generated by the large language model and the acquired real runtime data in the parallel preload response mode. The calibration trigger module is used to trigger a calibration command if a logical conflict or data mismatch is detected. The response module 307 is used to interrupt the current generation process based on the correction instruction, switch to serial response mode, and re-call the corresponding tool to obtain the actual runtime data and generate a new response text.
[0099] Optionally, the system 300 also includes: The calling module is used to input the instruction into the large language model for the first round of inference in the serial response mode and output the tool calling instruction; The response module 307 is used to obtain real runtime data according to the tool call instruction, and feed the obtained real runtime data back to the large language model for subsequent rounds of inference to generate response text.
[0100] Based on the same inventive concept, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the LLM interaction method based on intent domain prediction described in the first aspect of this application.
[0101] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of this application. As for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple; relevant details can be found in the descriptions of the method embodiments.
[0102] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0103] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0106] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0107] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0108] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0109] The foregoing has provided a detailed description of an LLM interaction method, system, and device based on intent domain prediction provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An LLM interaction method based on intent domain prediction, characterized in that, include: Receive user input commands; The instructions are subjected to intent recognition using a lightweight semantic understanding model, and intent domain labels are output. Based on the intent domain label, match and load the corresponding skill configuration file; Parse the metadata in the skill configuration file to obtain a list of tool interfaces to be executed; Before constructing the initial contextual prompts for the large language model, the calls to the tools in the list of tool interfaces to be executed are performed in parallel to obtain real runtime data; The skill configuration file is concatenated with the actual runtime data to construct initial context prompts; The initial contextual cue words are input into a large language model for inference to generate response text.
2. The LLM interaction method based on intent domain prediction according to claim 1, characterized in that, If the output of the intent recognition of the instruction also includes the confidence score corresponding to the intent domain label, then the method includes: The current response mode is determined based on the relationship between the confidence score and a preset threshold; wherein, the response mode includes a parallel preload response mode and a serial response mode; If the confidence score is greater than or equal to the preset threshold, it is determined to be in parallel preloading response mode, and the above-mentioned parallel execution of the tool calls in the tool interface list to be executed is performed to obtain the actual runtime data; If the confidence score is less than the preset threshold, it is determined to be a serial response mode. The large language model then infers the instruction and makes a decision to call the tool and obtain the actual runtime data.
3. The LLM interaction method based on intent domain prediction according to claim 1, characterized in that, The process of matching and loading the corresponding skill configuration file based on the intent domain label includes: Read the preset skill registry; Based on the intent domain label, skill configuration files that match the intent domain label are filtered from the skill registry to obtain the initial screening results; Read the current system operating status variables, which include at least one of vehicle driving status, media playback status, or geographical location information; Based on predefined skill filtering rules and the current system running status variables, the initial screening results are subjected to secondary screening to select skill configuration files that match the current system running status variables, thus obtaining the secondary screening results. Load the skill configuration files from the secondary screening results into memory.
4. The LLM interaction method based on intent domain prediction according to claim 1, characterized in that, The calls to the tools in the list of tool interfaces to be executed are performed in parallel to obtain the actual runtime data, including: Parse the dynamic placeholders in the input parameter templates of each tool in the list of tool interfaces to be executed; Extract the actual value corresponding to the dynamic placeholder from the current system runtime state; The actual values are filled into the dynamic placeholder positions to obtain the instantiated parameter set; A data retrieval request is generated and executed based on the instantiated parameter set to obtain the actual runtime data.
5. The LLM interaction method based on intent domain prediction according to claim 4, characterized in that, When the intent domain label matches multiple skill profiles, analyze the input parameter templates of the tools in all the matching skill profiles and identify the dynamic placeholders corresponding to the runtime state variables of the same system. Read the actual value once for the runtime state variable of the same system; The actual values read are then injected into the instantiation parameter sets of each tool that depends on the runtime state variables of the same system. Based on each of the instantiation parameter sets, generate their respective data acquisition requests and execute them in parallel to obtain real runtime data; All matching skill configuration files are concatenated with the actual runtime data to construct initial contextual prompts.
6. The LLM interaction method based on intent domain prediction according to claim 1, characterized in that, Also includes: Real-time monitoring of the invocation status of tools in the list of tool interfaces to be executed; If a call to a tool in the list of tools to be executed does not return actual runtime data within the timeout threshold, the actual runtime data acquisition operation for that tool will be terminated. Mark the output field corresponding to this tool as unavailable or fill it with a default placeholder to the initial context prompt.
7. The LLM interaction method based on intent domain prediction according to claim 2, characterized in that, Also includes: Monitor the semantic consistency between the response text generated by the large language model and the obtained real runtime data; If a logical conflict or data mismatch is detected, a correction command is triggered. The current generation process is interrupted based on the correction instruction, and the process is switched to serial response mode. The corresponding tool is then called again to obtain the actual runtime data and generate a new response text.
8. The LLM interaction method based on intent domain prediction according to claim 1, characterized in that, In the serial response mode: The instruction is input into the large language model for the first round of inference, and the tool call instruction is output. The tool calls instructions to obtain real runtime data, and then feeds the obtained real runtime data back to the large language model for subsequent rounds of inference to generate response text.
9. An LLM interaction system based on intent domain prediction, characterized in that, The system includes: The instruction receiving module is used to receive instructions input by the user. The intent determination module is used to identify the intent of the instruction using a lightweight semantic understanding model and output an intent domain label. The skill configuration file determination module is used to match and load the corresponding skill configuration file based on the intent domain tag; The parsing module is used to parse the metadata in the skill configuration file to obtain a list of tool interfaces to be executed; The runtime data acquisition module is used to execute the calls to the tools in the list of tools to be executed in parallel before constructing the initial context prompt words for the large language model, so as to obtain the actual runtime data. The prompt word construction module is used to concatenate the skill configuration file with the actual runtime data to construct initial context prompt words; The response module is used to input the initial contextual prompts into the large language model for inference and generate response text.
10. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements the steps of the LLM interaction method based on intent domain prediction as described in any one of claims 1 to 8.
