Natural language man-machine interaction method and system, medium and terminal
By combining intent recognition models and large language models, parameter completion instructions and rhetorical questions are dynamically generated, solving the instruction generation problem of natural language human-computer interaction systems in dynamic business environments. This achieves efficient and accurate human-computer interaction, and improves the system's self-healing capabilities and interaction efficiency.
Patent Information
- Application Number
- CN202610080780.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-01
AI Technical Summary
Existing natural language human-computer interaction systems struggle to adapt to dynamic business environments, lacking dynamic awareness of the current business context. This results in generated instructions lacking required parameters or failing to provide effective guided questioning. Toolchain integration is deeply coupled with model inference, and output instructions suffer from uncontrollable illusions and format errors, lacking self-correction capabilities.
By combining an intent recognition model with a large language model, parameter completion instructions and rhetorical question prompts are dynamically generated. Based on scenario requirements, a tool resource pool is retrieved to dynamically mount tool definitions and resource protocols. A closed-loop verification and self-correction mechanism is adopted to ensure the compliance and accuracy of interactive function call instructions.
It achieves efficient and accurate natural language human-computer interaction, dynamically perceives business context, decouples management tool resources, and has the ability to correct and self-heal instruction execution, significantly improving interaction efficiency and accuracy, and solving the problems of inaccurate intent recognition, uncontrollable function calls, and low system integration in existing technologies.
Smart Images

Figure CN121960779A_ABST
Abstract
Description
Natural Language Human-Computer Interaction Methods, Systems, Media, and Terminals Technical Field
[0001] This invention belongs to the technical field of human-computer interaction, and relates to a natural language human-computer interaction method, system, medium and terminal. Background Technology
[0002] With the rapid development of artificial intelligence technology, Natural Language Processing (NLP) has become an important research direction in the field of human-computer interaction. Traditional human-computer interaction methods usually rely on graphical user interfaces (GUIs) or command-line interfaces (CLIs). Users need to click, drag, or input specific commands to complete operations, which suffers from high learning costs and low operational efficiency. In recent years, interaction methods based on natural language have gradually emerged, allowing humans to exchange information and collaborate on tasks with computer systems (such as mobile phones, smart speakers, and robots) through natural language (such as spoken and written language). Natural language human-computer interaction breaks the limitations of traditional structured operations such as "keyboard / mouse" and "touchscreen clicks," making interaction more in line with human daily communication habits, and is one of the core technological directions for achieving "human-computer collaboration." In practical use, users can express their intentions more intuitively through voice or text input, and the system achieves automated control through semantic understanding and task execution.
[0003] However, existing natural language human-computer interaction systems still face the following problems:
[0004] (1) Static prompts are difficult to adapt to dynamic business environments. Existing systems usually use fixed prompt templates, but in actual interactions, the form environment state (such as user-filled information, page information, and system default configuration) changes in real time. Single direct connection models often lack dynamic awareness of the current business context, resulting in the generation of instructions missing required parameters or failing to provide effective guided questions when information is insufficient.
[0005] (2) Deep coupling between toolchain integration and model inference. As interactive capabilities expand, the number of tools and interfaces that the system needs to call increases dramatically. Existing solutions, after providing a large number of tool descriptions, will see their attention and inference capabilities of a single large model significantly decrease as the context length increases. There is a lack of a flexible, standardized protocol that can dynamically mount and decouple tool definitions according to intent, such as a Model Context Protocol (MCP) or a Function Calling mechanism.
[0006] (3) Risk of “one-time” generation of output instructions (uncontrollable illusion). Even after optimization, large models still suffer from serious format illusions or parameter logic errors when generating complex structured instructions (such as JSON format). Existing interaction processes are mostly one-way open loops. Once the initially generated instructions encounter errors in format validation, parameter consistency, or actual interface calls, the system usually terminates the task directly or returns invalid results, lacking a closed-loop feedback mechanism with self-repair capabilities. Summary of the Invention
[0007] The purpose of this invention is to provide a natural language human-computer interaction method, system, medium, and terminal, which achieves efficient and accurate natural language human-computer interaction by combining an intent recognition model and a large language model.
[0008] In a first aspect, the present invention provides a natural language human-computer interaction method, the method comprising the following steps: acquiring natural language human-computer interaction data; identifying the interaction scenario corresponding to the natural language human-computer interaction data based on an intent recognition model; identifying default parameters and required / missing parameters of the form based on the natural language human-computer interaction data, user prompt, and form environment data, and generating parameter completion instructions and rhetorical question guidance instructions; injecting parameter completion instructions and rhetorical question guidance constraints into the system prompt and user prompt associated with the interaction scenario, generating a dynamic prompt; retrieving a tool resource pool based on scenario requirements, and dynamically mounting tool definitions and... The resource protocol is used to input the natural language human-computer interaction data, the dynamic prompt, the tool definition, and the resource protocol into the function call model to generate an initial interaction function call instruction corresponding to the natural language human-computer interaction data. Based on a closed-loop verification and self-correction mechanism, the initial interaction function call instruction is subjected to format compliance verification and pre-execution testing. If the verification or test fails, error feedback information is obtained, and the error feedback information and the initial interaction function call instruction are fed back to the function call model for instruction correction until a compliant interaction function call instruction is obtained. Human-computer interaction is realized based on the compliant interaction function call instruction.
[0009] In one implementation of the first aspect, the intent recognition model employs a pre-trained model based on the Transformer architecture; the function call model employs a large language model fine-tuned by function call task instructions.
[0010] In one implementation of the first aspect, the form environment data includes the current form real-time data, the result data of the previous interaction, and the target form requirement data; the target form requirement data includes the definition, attributes, format requirements, enumeration values, and logical dependencies between fields in the target form; the system prompt associated with the scenario includes role settings, task constraints, and interaction parameter field extraction rules customized for different interaction scenarios.
[0011] In one implementation of the first aspect, constructing the parameter completion instruction and the rhetorical question prompt instruction includes the following steps:
[0012] Establish the mapping relationship between the interaction scenario and the form variable fields, and define the required and default value attributes of the interaction parameter fields;
[0013] Analyze the extractable entity information in the natural language human-computer interaction data, and match the extractable entity information with the form variable fields to obtain missing parameter items and matching results;
[0014] Based on the matching results, the default values in the form environment data are encapsulated as parameter completion instructions, and the guiding statements for the missing parameters are encapsulated as rhetorical question guiding instructions.
[0015] In one implementation of the first aspect, the tool resource pool is retrieved based on scenario requirements, and the tool definition and resource protocol are dynamically mounted, including the following steps:
[0016] Based on the interaction scenario, retrieve matching tool metadata from the tool resource pool;
[0017] Obtain the resource access path or function calling function that conforms to the model context protocol, and dynamically inject the tool metadata of the resource access path or function calling function of the model context protocol into the runtime environment of the function call model so that the function call model can identify the currently callable capability boundaries.
[0018] In one implementation of the first aspect, the format compliance verification and pre-execution test of the initial interactive function call instruction based on the closed-loop verification and self-correction mechanism includes the following steps:
[0019] The parameters of the initial interactive function call instruction are checked for semantic logic through expressions;
[0020] The initial interactive function call instruction is input into the sandbox environment for simulated call, and the abnormal status or missing field information returned by the interface is captured;
[0021] If the semantic logic check fails or the simulated call captures an exception, a pre-execution feedback mechanism is triggered to encapsulate logical errors or missing field information into error feedback information and inject it back into the function call model so as to complete the correction and reconstruction before the instruction is officially issued.
[0022] In one implementation of the first aspect, implementing human-computer interaction based on the compliant interactive function call instruction includes the following steps:
[0023] Parse the compliant interactive function call instructions to generate call parameters that conform to the target interactive software interface standard;
[0024] The interactive software is invoked based on the invocation parameters to achieve human-computer interaction.
[0025] In a second aspect, the present invention provides a natural language human-computer interaction system, the system comprising an acquisition module, a recognition module, a first generation module, a second generation module, a mounting module, a third generation module, a verification and correction module, and a calling module;
[0026] The acquisition module is used to acquire natural language human-computer interaction data;
[0027] The recognition module is used to identify the interaction scenario corresponding to the natural language human-computer interaction data based on the intent recognition model.
[0028] The first generation module is used to identify the default parameters and required missing parameters of the form based on the natural language human-computer interaction data, user prompt, and form environment data, and to generate parameter completion instructions and rhetorical question prompt instructions;
[0029] The second generation module is used to inject parameter completion instructions and question guidance constraints into the system prompt and the user prompt associated with the interaction scenario to generate a dynamic prompt;
[0030] The mounting module is used to retrieve tool resource pools based on scenario requirements and dynamically mount tool definitions and resource protocols.
[0031] The third generation module is used to input the natural language human-computer interaction data, the dynamic prompt, the tool definition and the resource protocol into the function call model to generate the initial interaction function call instruction corresponding to the natural language human-computer interaction data;
[0032] The verification and correction module is used to perform format compliance verification and pre-execution testing on the initial interactive function call instruction based on a closed-loop verification and self-correction mechanism. If the verification or test fails, error feedback information is obtained, and the error feedback information and the initial interactive function call instruction are fed back to the function call model for instruction correction until a compliant interactive function call instruction is obtained.
[0033] The calling module is used to implement human-computer interaction based on the compliant interactive function call instructions.
[0034] Thirdly, the present invention provides a terminal, the terminal comprising: a processor and a memory;
[0035] The memory is used to store computer programs;
[0036] The processor is used to execute the computer program stored in the memory, so that the terminal performs the above-described natural language human-computer interaction method.
[0037] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a terminal, implements the above-described natural language human-computer interaction method.
[0038] As described above, the natural language human-computer interaction method, system, medium, and terminal of the present invention have the following beneficial effects:
[0039] (1) It can dynamically perceive business context, decouple management tool resources, and has the ability to correct and self-heal instruction execution errors;
[0040] (2) It realizes an end-to-end process from natural language input to structured function calls, effectively improving interaction efficiency and accuracy;
[0041] (3) By combining intent recognition and contextual parameter extraction, interference from irrelevant information is significantly reduced, ensuring the accuracy and reliability of instruction generation;
[0042] (4) It effectively solves the problems of inaccurate intent recognition, uncontrollable function calls, and low system integration in the existing technology. Attached Figure Description
[0043] Figure 1 shows a flowchart of one embodiment of the natural language human-computer interaction method of the present invention;
[0044] Figure 2 shows a schematic diagram of the closed-loop verification and self-correction mechanism of the present invention in one embodiment;
[0045] Figure 3 shows a schematic diagram of the structure of the natural language human-computer interaction system of the present invention in one embodiment;
[0046] Figure 4 shows a schematic diagram of the structure of the terminal of the present invention in one embodiment. Detailed Implementation
[0047] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0048] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0049] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0050] As shown in Figure 1, in one embodiment, the natural language human-computer interaction method of the present invention includes steps S1-S8.
[0051] Step S1: Obtain natural language human-computer interaction data.
[0052] Specifically, users input natural language human-computer interaction data via keyboard or voice. For example, in a business travel scenario, the natural language human-computer interaction data could be: "Beijing Zhongjian Building (No. 15 Sanlihe Road, Haidian District), are there any suitable budget hotels nearby? Check-in on October 1, 2025, for 5 nights."
[0053] Step S2: Identify the interaction scenario corresponding to the natural language human-computer interaction data based on the intent recognition model.
[0054] Specifically, this invention uses a pre-trained intent recognition model to identify the interaction scenarios corresponding to the human-computer interaction data. For example, in a business travel scenario, the interaction scenarios include hotel booking, itinerary planning, flight search, train ticket booking, travel planning, car rental, order inquiry, and function page navigation. Preferably, the intent recognition model is a pre-trained model based on the Transformer architecture, such as the BERT model.
[0055] When training the intent recognition model, a training dataset is first constructed. For business travel scenarios, historical user dialogues, synthetic data, and publicly available datasets need to be collected and labeled with scenario categories, such as hotel booking, itinerary planning, flight search, and train ticket booking. Then, the model is trained using the cross-entropy loss function and the Adam optimizer. Finally, the model's accuracy, recall, and other metrics are evaluated using a validation set to ensure the reliability of the intent recognition model. The learning rate is 2e-5, the batch size is 32, and the number of training epochs is 10.
[0056] In one embodiment, obtaining the interaction scenario corresponding to the natural language human-computer interaction data based on the intent recognition model includes the following steps:
[0057] 21) Perform word segmentation on the natural language human-computer interaction data to obtain the word segmentation results.
[0058] 22) Vectorize the word segmentation results to generate embedding vectors.
[0059] 23) Extract the semantic features of the embedding vector based on the Chinese-bert-wwm-ext pre-trained model.
[0060] 24) Input the semantic features into the intent recognition model to obtain the interaction scenario corresponding to the natural language human-computer interaction data.
[0061] For example, when the natural language human-computer interaction data is "The customer's address is XX Building in Beijing. Are there any suitable budget hotels nearby? Check-in on October 1, 2025, for 5 nights", the intent recognition model locks the interaction scenario as "hotel scenario" (probability 0.997) and excludes other irrelevant labels (such as itinerary, train, airplane, etc.).
[0062] Step S3: Based on the natural language human-computer interaction data, user prompt, and form environment data, identify the default parameters and required missing parameters of the form, and generate parameter completion instructions and rhetorical question prompts.
[0063] Specifically, contextual data is obtained based on the natural language human-computer interaction data. For example, if the user asks questions in the previous rounds such as "Help me create a business trip application, the client is near XX Building in Beijing", then the intent sequence can be obtained as: business trip application. If the user asks questions in the previous rounds such as "Help me plan my trip to Beijing", then the intent sequence can be obtained as: plan trip.
[0064] The form environment data includes current real-time form data, the result data of the previous interaction, and target form requirement data. The target form requirement data includes the definitions, attributes, format requirements, enumerated values, and logical dependencies between fields in the target form. The real-time form data is dynamically obtained from the list page, including information such as current time, city information, location information, and form input data, such as "currentDate:2025-12-13; currentaddress:ShanghaiXXX". The result data of the previous interaction is such as "toaddress:Beijing XX Building, tocity:Beijing, type:Airplane".
[0065] In one embodiment, constructing the parameter completion instruction and the rhetorical question prompt instruction includes the following steps:
[0066] 31) Establish the mapping relationship between the interaction scenario and the form variable fields, and define the required attributes and default values of the interaction parameter fields.
[0067] This includes defining the required and default values for interactive parameter fields. For example, in a trip scenario, predefine variable fields related to the travel scenario, such as: {"description":"Planning the trip, updating the user's trip form information, assisting in filling it out.","name":"updateTripForm","parameters":{"properties":{"fromDate":{"description":"Departure date, required, output format YYYY-MM-DD","type":"string"},"departureHour":{"description":"
Strictly prohibited from being confused
Strictly prohibited from being obfuscated
[0068] 32) Analyze the extractable entity information in the natural language human-computer interaction data, and match the extractable entity information with the form variable fields to obtain the missing parameter items and matching results.
[0069] Specifically, the dynamic language model analyzes the extractable entity information in the natural language human-computer interaction data and matches it with the form variable fields to obtain the missing parameter items.
[0070] 33) Based on the matching results, the default values in the form environment data are encapsulated as parameter completion instructions, and the guiding statements for the missing parameters are encapsulated as rhetorical question guiding instructions.
[0071] In one embodiment, the specific algorithm for identifying default and required / missing parameters of a form based on the natural language human-computer interaction data, user prompt, and form environment data, and generating parameter completion instructions and rhetorical question prompts, is as follows:
[0072] # Task Definition: You are the audit center for human-computer interaction. Please compare the [context data], [form step data], and [current input], execute the following logic in sequence, and output the dynamic instructions required for the next step.
[0073] # Audit Logic
[0074] 1. Identify missing fields: Find fields that are required but missing across the entire data path and have no default value.
[0075] 2. Identify and complete: Find fields that the user has not provided but for which the system default values can be applied.
[0076] # Step 1: Parameter Completion and Summary
[0077] • Identify valid entities in the current input and the context.
[0078] • Identify fields for which default values can be applied in the Form Context Data.
[0079] • Summarize all MATCHED and DEFAULT fields to generate a parameter completion command (for UserPrompt injection on the user side).
[0080] • Parameter completion instruction template logic: "[Task environment supplement: The current value of field [Field A] is [value]; field [Field B] has been completed with the default value [value]. Please force the reference of the above summary parameters when generating function call instructions; do not derive or modify them yourself.]"
[0081] # Step Two: Gap Audit and Directive Decision Based on the results of Step 1 (after completion), compare the required fields on the form:
[0082] • If all parameters are already available: Set system_side_injection to "All parameter already".
[0083] • If the MISSING field still exists: Generate a summary rhetorical question prompt (for System Prompt injection on the system side). The model's interception function is required to generate and integrate all missing items for a one-time natural language rhetorical question.
[0084] • Question-and-answer prompt template logic: "# Interaction constraint strategy: When the required parameters [Field C] and [Field D] are detected to be missing, the function generation behavior must be intercepted. You should summarize all missing items and integrate them into a natural prompt to ask the user a question, and prohibit the output of any code or API call sequence."
[0085] # Output format (strict JSON)
[0086] {
[0087] "audit_summary": { "is_complete": true / false, "missing_fields": []},
[0088] "user_side_injection": "Inject a summary completion command for user-suggested keywords",
[0089] "system_side_injection": "Injects a system prompt or query command."
[0090] }
[0091] If the user enters "departing from Shanghai", based on the context and form data, the recognition result is as follows:
[0092] {"audit_summary": {
[0093] "is_complete": false,
[0094] "missing_fields": ["fromCity", "toDate"]
[0095] },
[0096] "user_side_injection": "[Task environment supplement: Currently confirmed fields; [toCity] value is [Beijing]; [toAddress] value is [Beijing XX Building]; [fromAddress] value is [Global Harbor]; [travelMode] value is [Airplane]; [isMainlandCity] autocomplete is [true]. Please force the above parameters to be referenced when generating the command.]",
[0097] "system_side_injection": "# Interaction constraint strategy: Missing departure time for the required parameter [toDate] has been detected. Function generation behavior must be intercepted. You should summarize the missing items and integrate them into a natural prompt to ask the user a question, and prohibit the output of any API call sequence."
[0098] The parameter completion command received is: "[Task environment supplement: Currently determined fields; [toCity] value is [Beijing]; [toAddress] value is [Beijing XX Building]; [fromAddress] value is [Global Harbor]; [travelMode] value is [Airplane]; [isMainlandCity] is automatically completed to [true]. Please force the above parameters to be referenced when generating the command.]"
[0099] The prompt for a follow-up question is: "# Interaction constraint policy: Missing required parameters [toDate] and [cabinLevel] have been detected. Function generation behavior must be intercepted. You should summarize the missing items and integrate them into a natural prompt to ask the user a follow-up question, and prohibit the output of any API call sequence."
[0100] Step S4: Inject parameter completion instructions and question guidance constraints into the system prompt and the user prompt associated with the interaction scenario to generate a dynamic prompt, so as to perform structured constraints on the inference boundary of the intent recognition model.
[0101] Specifically, the system prompt associated with the scenario includes role settings, task constraints, and rules for extracting interaction parameter fields customized for different interaction scenarios.
[0102] This embodiment achieves deep structured constraints on the model's reasoning boundaries by injecting "deterministic facts" and "dynamic decision-making strategies" into different cue domains. The specific logic is as follows:
[0103] • User-side targeted injection (data locking): The generated parameter completion command is appended as a suffix to the end of the user's current input (User Prompt) in real time.
[0104] o Implementation details: Leveraging the high attention (recency bias) of large models to the end information of the input sequence, the aggregated and determined parameters (including user mention values, historical context values, and form environment default values) are forcibly locked.
[0105] o Technical effect: It eliminates the parameter memory bias caused by attention decay in large models during multi-turn dialogues, ensuring that when the model generates function instructions, it must and can only refer to the "environment truth value" confirmed by the audit center, thus eliminating parameter forgery (illusion) from the physical input level.
[0106] User Prompt after injection is as follows:
[0107] "Departing from Shanghai"
[0108] Additional task environment information: Currently defined fields: [toCity] value is [Beijing]; [toAddress] value is [Beijing XX Building]; [fromAddress] value is [YYY Building]; [travelMode] value is [Airplane]; [isMainlandCity] is autocompleted to [true]. Please force the use of the above parameters when generating the command.
[0109] (The last paragraph contains the injection parameter completion instructions)
[0110] • System-side targeted injection (behavior interception): Dynamically inject the generated rhetorical prompt instruction (if there are parameter gaps) or execution permission instruction (if the parameters are complete) into the constraint module of the system prompt associated with the scenario.
[0111] In practice, this injection acts as a "logical circuit breaker" for the system. When the judgment parameters are incomplete, the instruction explicitly requires the model to intercept the function's generation behavior and activates the "integrated question mode"; when the judgment parameters are complete, the instruction issues an execution permission.
[0112] Technical Effects: This injection method restructures the model's generation logic at the global level. It forces the model to switch between the roles of "executor" and "facilitator" with zero latency. By requiring the model to integrate scattered missing items into a natural language query, it effectively avoids the inefficient "question and answer" pattern of traditional systems and improves the efficiency of business interaction.
[0113] After injection, the System Prompt is as follows:
[0114] #Role: You are the intelligent assistant TuTu #Abilities: 1. Update form fields: Only extract information explicitly mentioned by the user. 2. Open or view the user's itinerary. #Reference Information: - Current Time: {currentTime} - Current Location: {curAddress} - Default Rule: When the user input does not include a detailed departure address, the current address is used by default. #Critical Logic: You must strictly adhere to the following logical order to prevent confusion between departure and arrival times: 1. **[Highest Priority] Time Attribution Judgment** - **When the user only provides one time point (e.g., "9 o'clock"), this time point must only be assigned to the directional preposition or verb that is closest to it and most clearly related to it in the sentence.** - **Arrival Time (arrivalHour)**: The time immediately follows or is adjacent to words such as "to", "to", "arrive", "reach", "to". (Example: "Hope to arrive at 9 o'clock in the morning" -> classified as arrivalHour, ignoring other departure words in the sentence) - **Departure **Time (departureHour)**: The time immediately follows or is adjacent to words such as "departure," "go," or "leave." (Example: "Departing for Shenzhen at 9 o'clock" -> classified under departureHour) 2. **[Secondary Rule] Fuzzy Time Conversion** After determining which slot to fill, convert the fuzzy time into a specific number - "Morning / Forenoon" -> 09:00 - "Noon" -> 12:00 - "Afternoon" -> 14:00 - "Evening" -> 19:00 - If the user only says "9 o'clock" without any AM / PM indication -> defaults to 09:00 3. **[Conflict Handling Example]** - The user says: "Departing from A to B, hoping to arrive at 9 o'clock in the morning." - Logical Chain: Only one time, "9 o'clock," was found in the sentence. "9 o'clock" is closer to "arrival." According to the highest priority rule, 9 o'clock belongs to `arrivalHour`. - Result: `arrivalHour="09:00"`, `departureHour=null`. #Other Rules: 1. Only output tool calls, no idle chat. 2. If the user only changed the city information, clear the specific address. 3. If the date is earlier than the current date, the current date will be used.
[0115] # Interaction Constraint Strategy: Missing required parameters [toDate] and [cabinLevel] have been detected. Function generation must be intercepted. You should summarize the missing items and integrate them into a natural prompt asking the user a question, and prohibit the output of any API call sequence.
[0116] (The last paragraph is an instruction to inject a rhetorical question.)
[0117] The resulting dynamic prompts, through the synergy of "end-of-fact locking" and "global policy interception," ensure that subsequent function call models have clear instruction boundaries and data basis during inference.
[0118] Step S5: Retrieve the tool resource pool based on scenario requirements, and dynamically mount the tool definition and resource protocol.
[0119] Specifically, this invention employs a two-layer retrieval mechanism combining "scenario-based filtering" and "semantic soft matching" to achieve accurate mounting of tool metadata. In one embodiment, retrieving tool resource pools based on scenario requirements and dynamically mounting tool definitions and resource protocols includes the following steps:
[0120] 51) Based on the interaction scenario, retrieve matching tool metadata from the tool resource pool.
[0121] The initial filtering based on scenarios involves quickly indexing a subset of candidate tools related to the interaction scenario (such as "flight booking") from the tool resource pool. This step aims to eliminate interference from tools in irrelevant fields (such as excluding "hotel" or "weather" tools) and narrow down the search scope.
[0122] 52) Obtain the resource access path or function calling function that conforms to the model context protocol, and dynamically inject the tool metadata of the resource access path or function calling function of the model context protocol into the runtime environment of the function call model so that the function call model can identify the currently callable capability boundaries.
[0123] Vector-based semantic retrieval involves embedding the user's current prompt and calculating its vector similarity with the descriptions of tools in the candidate subset. The top K most relevant tool metadata (e.g., K=3) are selected based on their similarity scores, sorted from highest to lowest. Even when multiple tools with similar functions exist in the same scenario (e.g., "domestic flight search" and "international flight search"), vector retrieval can accurately locate the most matching tool based on the user's mentioned keywords (e.g., "London" and "Heathrow").
[0124] The selected Top K tool metadata (including resource access paths conforming to the MCP protocol, FunctionCalling function definitions, and their parameter schemas) is dynamically injected into the runtime environment of the function call model. Specifically:
[0125] The user entered, "Please check my flight tickets to Shanghai tomorrow, and also check out airport pick-up services after I land."
[0126] Execution process:
[0127] 1. Intent Detection: The main interaction scenarios were identified as "flight booking" and "car rental".
[0128] 2. Primary filtering: Pull multiple candidate tools for "flight tickets" and "travel" categories from the resource pool.
[0129] 3. Vector matching: Encode "airport pick-up service" into vectors and match them with candidate tool descriptions.
[0130] Results: The similarity of tool A (flight_list) was 0.98, the similarity of tool B (car) was 0.95, the similarity of tool C (query_weather) was 0.11, and the similarity of tool D (hotel) was 0.07.
[0131] Filtering: Select the top 2 tools A and B.
[0132] 4. Metadata Mounting: * Injected Content: Send the JSON Schema (including parameters and constraints such as from_city, to_city, date, etc.) of tool A (flight_list) and tool B (car) and API definitions to the model.
[0133] Model awareness: At this time, the function call model can only be aware of these two APIs in its current session's "toolbox", which effectively avoids parameter confusion or call errors caused by the model being aware of too many irrelevant APIs (such as hotels and catering).
[0134] Step S6: Input the natural language human-computer interaction data, the dynamic prompt, the tool definition, and the resource protocol into the function call model to generate the initial interaction function call instruction corresponding to the natural language human-computer interaction data.
[0135] Specifically, a large language model fine-tuned using function calling instructions is used as the function calling model. The specific implementation and reasoning logic are as follows:
[0136] A pre-trained model with long context awareness (such as Qwen2.5-32B-Instruct) is used as the function call model. To enable the model to accurately understand the MCP protocol and form field constraints, the LoRA (Low-Rank Adaptation) efficient fine-tuning method is used, and the model is trained on a dataset containing "natural language-structured instruction" pairs.
[0137] Fine-tuning dataset sample example:
[0138] Case 1: Extracting multiple pieces of information and successfully matching default values (successful call mode)
[0139] Input (natural language + contextual hints):
[0140] "Book me a ticket to Beijing for tomorrow morning. [Task environment supplement: The current value of the field [fromCity] is confirmed to be [Shanghai]; [travelMode] has been completed to [Airplane] according to the default value]"
[0141] Target output (structured instructions):
[0142] JSON
[0143] {
[0144] "thought": "The user provided the destination [Beijing] and the time semantic [tomorrow morning]. Combined with the departure point [Shanghai] and the default mode of transportation [airplane] in the supplementary environment, the parameters are complete."
[0145] "call": {
[0146] "name": "updateTripForm",
[0147] "arguments": {
[0148] "fromCity": "Shanghai",
[0149] "toCity": "Beijing",
[0150] "fromDate": "2026-01-05",
[0151] "arrivalHour": "08:00",
[0152] "travelMode": "Airplane"
[0153] }
[0154] }
[0155] }
[0156] Case 2: Missing required parameter triggers "single-item rhetorical question" (guided mode)
[0157] Input (natural language + interception strategy):
[0158] "I want to go to Beijing. [Interaction constraint strategy: The required parameter [fromDate] is missing. Function generation must be intercepted, and the missing item must be integrated to generate a natural language query.]"
[0159] Target output (introduction):
[0160] "Okay, we've set Beijing as your destination. When do you plan to depart?"
[0161] Case 3: Missing multiple required parameters triggers "integrated question" (strategy pattern)
[0162] Input (natural language + interception strategy):
[0163] "Help me book a trip to Shanghai. [Interaction constraint strategy: Missing required parameters [fromCity] and [fromDate] have been detected. Function generation must be intercepted, and all missing items must be integrated into a one-time natural language query.]"
[0164] Target output (introduction):
[0165] "No problem, we've started planning your trip to Shanghai. To ensure accurate tracking, we'd like to ask you to provide your departure city and departure date."
[0166] The fine-tuning parameters are set as follows: learning rate $1 \times 10^{-4}$, batch size of 8, training epochs of 5, and the Adam optimizer is used to ensure convergence of weight updates. The function call model receives dynamic prompts generated in step S4 (including user-side parameter locking instructions and system-side policy interception instructions), the Top K tool definitions attached in step S5, and the interaction context. The model then executes the following inference process:
[0167] Semantic Alignment: Maps the "environmental truth values" injected from the user side to the parameters defined in the tool. Boundary Determination: Real-time detection of the "interception strategy" injected from the system side. If the execution conditions are met, the inference result is converted into structured JSON or a JSON RPC instruction sequence conforming to the MCP protocol; if a missing required field is still found, the system switches to "dialogue guidance mode" based on the injected questioning strategy.
[0168] Specific Scenario A: Complete parameters (triggered function generation) Dynamic prompt input: System side: "Task ready permission"; User side: "[Task environment supplement: departure point [Beijing], destination [Shanghai], date [2026-01-05]]". Model inference: The model recognizes that all required fields are ready and has the corresponding tool search_flights. Output: JSON{
[0169] "type": "call",
[0170] "method": "search_flights",
[0171] "params": {
[0172] "from_city": "Beijing",
[0173] "to_city": "Shanghai",
[0174] "date": "2026-01-05"
[0175] }
[0176] }
[0177] Scenario B: Missing Parameters (Triggering Integrated Question) Dynamic Prompt Input: System-side: "Interception Strategy: Missing [from_city], [date], please integrate question"; User-side: "[Task Environment Supplement: Destination [Shanghai]]". Model Inference: The model recognizes from the system-side instructions that `search_flights` cannot be executed at this time, and instead executes the "integrated question" task. Output: "Your intention to travel to Shanghai has been recorded. To accurately search for flight tickets, which city do you plan to depart from? And what is the specific departure date?"
[0178] Step S7: Based on the closed-loop verification and self-correction mechanism, perform format compliance verification and pre-execution testing on the initial interactive function call instruction; if the verification or test fails, obtain error feedback information, and feed the error feedback information and the initial interactive function call instruction back to the function call model for instruction correction until a compliant interactive function call instruction is obtained.
[0179] Specifically, a closed-loop architecture of "static verification + dynamic simulation + iterative correction" is used to solve potential format errors, logical paradoxes, or parameter failures in large model generation instructions.
[0180] As shown in Figure 2, in one embodiment, based on closed-loop verification and self-correction mechanisms, the initial interactive function call instruction undergoes format compliance verification and pre-execution testing, including the following steps:
[0181] 71) The parameters of the initial interactive function call instruction are checked for semantic logic through expressions.
[0182] This includes checking whether the model output conforms to the predefined Schem specification (such as a sequence of JSON instructions rather than a plain text response). Logical operations are performed on the consistency between parameters using built-in rules. For example, for itinerary forms, it automatically checks whether toDate (arrival date) is not earlier than fromDate (departure date) and whether the enumerated values fall within a valid range (e.g., travelMode must be one of "plane / train / car").
[0183] 72) Input the initial interactive function call instruction into the sandbox environment for simulated call, and capture the abnormal status or field missing information returned by the interface.
[0184] The process involves inputting commands that have passed initial static validation into an isolated sandbox environment for simulated calls. This environment maps to the Interface Protocol (MCP) of the real business system but does not trigger actual business or data changes. If the sandbox interface returns exception status codes such as Error400: Missing Required Field [fromCity] or Error422: Invalid DataFormat, the system will automatically capture the exception context and its associated field information.
[0185] 73) If the semantic logic check fails or the simulated call captures an exception, the execution pre-feedback mechanism is triggered to encapsulate the logical error or missing field information into error feedback information and inject it back into the function call model so as to complete the correction and reconstruction before the instruction is officially issued.
[0186] In this system, if validation or sandbox testing fails, a pre-feedback mechanism will be initiated. Specific logical errors (such as "date conflicts") or sandbox feedback (such as "missing fields") are structured and encapsulated to generate error feedback information. This feedback information, along with the original error instruction, is then re-injected into the function call model as an incremental context. This drives the model to "self-reflect" based on the feedback, re-reasoning and correcting the errors. The model will output the corrected instructions until it passes all validation stages, achieving logical self-healing.
[0187] Example as follows:
[0188] Scenario: A user enters, "Book a flight to Beijing tomorrow, returning on the 15th." (Assume the current date is 2025-12-12)
[0189] First round of reasoning (produces flaws):
[0190] • Model generation: {"action": "updateTripForm", "params": {"fromDate": "2025-12-13", "toDate": "2025-12-15", "toCity": "Beijing", "fromCity": ""}} (The departure city was omitted).
[0191] Closed-loop verification process:
[0192] 1. Sandbox simulation: The command is executed in the sandbox, and the backend returns: {"status": "error", "code": 400,"message": "Field 'fromCity' is required but empty."}.
[0193] 2. Generate feedback: The system generates the following feedback: "[Error message: Execution failed, the required parameter 'fromCity' is missing. Please try to obtain it based on the context or ask the user.]"
[0194] 3. Feedback Injection: Send the above error message along with the JSON generated in the first round back to the large model.
[0195] Second round of reasoning (logical self-healing):
[0196] • Model Reflection: The model recognized that fromCity was necessary and found a potential value in the context "user coordinates: Shanghai".
[0197] • Corrected output: {"action": "updateTripForm", "params": {"fromDate": "2025-12-13", "toDate": "2025-12-15", "toCity": "Beijing", "fromCity": "Shanghai"}}.
[0198] Result: The revised instructions passed the sandbox test, and the system finally issued compliant instructions to execute API calls.
[0199] Step S8: Implement human-computer interaction based on the compliant interactive function call instructions.
[0200] In one implementation of the first aspect, implementing human-computer interaction based on the compliant interactive function call instruction includes the following steps:
[0201] Specifically, the compliant interactive function call instructions are parsed to generate call parameters that conform to the target interactive software interface standard. This involves deep parsing of the JSON structure and mapping the generated general semantic parameters to specific standard code required by the target business system, such as specific API field names required by an office OA system or a business travel booking platform. Based on these call parameters, the interactive software is invoked to achieve human-computer interaction. This involves initiating calls to the interactive software's production environment interface via a secure connection (such as HTTPS / RESTful API). At this point, necessary authentication (Token / API Key) and session identifiers are attached. Since the instructions have been pre-rehearsed in a sandbox environment, this stage of the call has a very high execution success rate, ensuring the determinism of business logic. The execution results returned by the backend interface are captured, and the structured data is transformed into visual components and presented to the user interface.
[0202] Example as follows:
[0203] Parsing the compliance instruction: The system received the final instruction: {"method": "flight_list", "params":{"from": "SHA", "to": "PEK", "date": "2026-01-05", "class": "F"}}.
[0204] Protocol Conversion and Invocation: The instruction parsing module maps SHA to "Shanghai Hongqiao / Pudong" and F to the cabin class code FIRST_CLASS recognized by the target system. Subsequently, the system sends a request to the business travel platform backend via a RESTful interface.
[0205] The system captures the execution results returned by the backend interface and transforms the structured data into visual components to be presented to the user interface.
[0206] Example: The backend returns a successful execution feedback: {"status": "success", "order_id": "FL20260105001", "price": 2800.00}. Based on this feedback, the interactive system renders a confirmation card containing flight details, order number, and price information in real time on the front-end page, along with a natural language prompt: "We have successfully searched for and locked your first-class ticket from Shanghai to Beijing on January 5th," thus completing a full human-computer interaction loop.
[0207] The scope of protection of the natural language human-computer interaction method described in this embodiment is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this invention is included within the scope of protection of this invention.
[0208] This invention also provides a natural language human-computer interaction system, which can implement the natural language human-computer interaction method described in this invention. However, the implementation device of the natural language human-computer interaction system described in this invention includes, but is not limited to, the structure of the natural language human-computer interaction system listed in this embodiment. All structural modifications and substitutions of the prior art made in accordance with the principles of this invention are included within the protection scope of this invention.
[0209] As shown in Figure 3, in one embodiment, the natural language human-computer interaction system of the present invention includes an acquisition module 31, a recognition module 32, a first generation module 33, a second generation module 34, a mounting module 35, a third generation module 36, a verification and correction module 37, and a calling module 38.
[0210] The acquisition module 31 is used to acquire natural language human-computer interaction data.
[0211] The recognition module 32 is connected to the acquisition module 31 and is used to identify the interaction scenario corresponding to the natural language human-computer interaction data based on the intent recognition model.
[0212] The first generation module 33 is connected to the acquisition module 31 and is used to identify the default parameters and required missing parameters of the form based on the natural language human-computer interaction data, user prompt, and form environment data, and generate parameter completion instructions and rhetorical question prompt instructions.
[0213] The second generation module 34 is connected to the recognition module 32 and the first generation module 33, and is used to inject parameter completion instructions and question guidance constraints into the system prompt and the user prompt associated with the interaction scenario to generate a dynamic prompt.
[0214] The mounting module 35 is used to retrieve the tool resource pool based on scenario requirements and dynamically mount tool definitions and resource protocols.
[0215] The third generation module 36 is connected to the second generation module 34 and the mounting module 35, and is used to input the natural language human-computer interaction data, the dynamic prompt, the tool definition and the resource protocol into the function call model to generate the initial interaction function call instruction corresponding to the natural language human-computer interaction data.
[0216] The verification and correction module 37 is connected to the third generation module 36 and is used to perform format compliance verification and pre-execution testing on the initial interactive function call instruction based on a closed-loop verification and self-correction mechanism. If the verification or test fails, error feedback information is obtained and the error feedback information and the initial interactive function call instruction are fed back to the function call model for instruction correction until a compliant interactive function call instruction is obtained.
[0217] The calling module 38 is connected to the verification and correction module 37 and is used to realize human-computer interaction based on the compliant interactive function call instruction.
[0218] The structure and principle of the acquisition module 31, recognition module 32, first generation module 33, second generation module 34, mounting module 35, third generation module 36, verification and correction module 37 and calling module 38 correspond one-to-one with the steps in the above natural language human-computer interaction method, so they will not be described in detail here.
[0219] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, or methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules / units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or modules or units may be electrical, mechanical, or other forms.
[0220] The modules / units described as separate components may or may not be physically separate. The components shown as modules / units may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules / units can be selected to achieve the objectives of the embodiments of the present invention, depending on actual needs. For example, the functional modules / units in the various embodiments of the present invention may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0221] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0222] This invention also provides a computer-readable storage medium. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof. The storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. This available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state drive (SSD)).
[0223] This invention also provides a terminal. The terminal includes a processor and a memory.
[0224] The memory is used to store computer programs.
[0225] The memory includes various media capable of storing program code, such as ROM, RAM, magnetic disk, USB flash drive, memory card, or optical disk.
[0226] The processor is connected to the memory and is used to execute the computer program stored in the memory so that the terminal performs the above-described natural language human-computer interaction method.
[0227] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0228] As shown in Figure 4, the terminal of the present invention is presented in the form of a general-purpose computing device. The components of the terminal may include, but are not limited to: one or more processors or processing units 41, a memory 42, and a bus 43 connecting different system components (including the memory 42 and the processing unit 41).
[0229] Bus 43 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0230] Terminals typically include various computer system-readable media. These media can be any available media that can be accessed by the terminal, including volatile and non-volatile media, and removable and non-removable media.
[0231] Memory 42 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 421 and / or cache memory 422. The terminal may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 423 may be used to read and write non-removable, non-volatile magnetic media (not shown in Figure 4, commonly referred to as a "hard disk drive"). Although not shown in Figure 4, disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disk drives for reading and writing to removable non-volatile optical discs (e.g., CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to bus 43 via one or more data media interfaces. Memory 42 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0232] A program / utility 424 having a set (at least one) of program modules 4241 may be stored, for example, in memory 42. Such program modules 4241 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 4241 typically perform the functions and / or methods described in the embodiments of the present invention.
[0233] The terminal can also communicate with one or more external devices (e.g., keyboard, pointing device, display, etc.), one or more devices that enable a user to interact with the terminal, and / or any device that enables the terminal to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 44. Furthermore, the terminal can communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 45. As shown in Figure 4, network adapter 45 communicates with other modules of the terminal via bus 43. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the terminal, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0234] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A natural language human-computer interaction method, characterized in that, The method includes the following steps: acquiring natural language human-computer interaction data; identifying the interaction scenario corresponding to the natural language human-computer interaction data based on an intent recognition model; identifying default parameters and required / missing parameters of the form based on the natural language human-computer interaction data, user prompt, and form environment data, and generating parameter completion instructions and rhetorical question guidance instructions; injecting parameter completion instructions and rhetorical question guidance constraints into the system prompt and user prompt associated with the interaction scenario to generate a dynamic prompt; retrieving tool resource pools based on scenario requirements and dynamically mounting tool definitions and resource protocols; inputting the natural language human-computer interaction data, the dynamic prompt, the tool definitions, and the resource protocols into a function call model to generate an initial interaction function call instruction corresponding to the natural language human-computer interaction data; performing format compliance verification and pre-execution testing on the initial interaction function call instruction based on a closed-loop verification and self-correction mechanism; if the verification or test fails, obtaining error feedback information and feeding the error feedback information and the initial interaction function call instruction back to the function call model for instruction correction until a compliant interaction function call instruction is obtained; and implementing human-computer interaction based on the compliant interaction function call instruction.
2. The natural language human-computer interaction method according to claim 1, characterized in that, The intent recognition model uses a pre-trained model based on the Transformer architecture; the function call model uses a large language model fine-tuned by function call task instructions.
3. The natural language human-computer interaction method according to claim 1, characterized in that, The form environment data includes the current real-time form data, the result data of the previous interaction, and the target form requirement data; The target form requirement data includes the definition, attributes, format requirements, enumeration values, and logical dependencies between fields in the target form; The system prompt associated with the scenario includes role settings, task constraints, and rules for extracting interaction parameter fields customized for different interaction scenarios.
4. The natural language human-computer interaction method according to claim 1, characterized in that, The steps for constructing parameter completion instructions and rhetorical question prompts are as follows: Establish a mapping relationship between the interaction scenario and form variable fields; define the required and default value attributes of the interaction parameter fields; analyze the extractable entity information in the natural language human-computer interaction data and match the extractable entity information with the form variable fields to obtain missing parameter items and matching results; based on the matching results, encapsulate the default values in the form environment data into parameter completion instructions, and encapsulate the guiding statements for the missing parameter items into rhetorical question prompts.
5. The natural language human-computer interaction method according to claim 1, characterized in that, The process of retrieving tool resource pools based on scenario requirements and dynamically mounting tool definitions and resource protocols includes the following steps: based on the interaction scenario, retrieving matching tool metadata from the tool resource pool; obtaining resource access paths or Function Calling functions that conform to the model context protocol, and dynamically injecting the tool metadata of the resource access paths or Function Calling functions of the model context protocol into the runtime environment of the function call model so that the function call model can identify the currently callable capability boundaries.
6. The natural language human-computer interaction method according to claim 1, characterized in that, Based on a closed-loop verification and self-correction mechanism, the format compliance verification and pre-execution test of the initial interactive function call instruction include the following steps: performing semantic and logical checks on the parameters of the initial interactive function call instruction through expressions; inputting the initial interactive function call instruction into a sandbox environment for simulated calls and capturing abnormal states or missing field information returned by the interface; if the semantic and logical checks fail or the simulated call captures an exception, a pre-execution feedback mechanism is triggered to encapsulate logical errors or missing field information into error feedback information and inject it back into the function call model to complete the correction and reconstruction before the instruction is officially issued.
7. The natural language human-computer interaction method according to claim 1, characterized in that, Implementing human-computer interaction based on the compliant interactive function call instructions includes the following steps: parsing the compliant interactive function call instructions to generate call parameters that conform to the target interactive software interface standard; and calling the interactive software based on the call parameters to achieve human-computer interaction.
8. A natural language human-computer interaction system, characterized in that, The system includes an acquisition module, an identification module, a first generation module, a second generation module, a mounting module, a third generation module, a verification and correction module, and a calling module. The acquisition module acquires natural language human-computer interaction data. The identification module identifies the interaction scenario corresponding to the natural language human-computer interaction data based on an intent recognition model. The first generation module identifies default and required / missing parameters of a form based on the natural language human-computer interaction data, user prompts, and form environment data, and generates parameter completion instructions and rhetorical question guidance instructions. The second generation module injects parameter completion instructions and rhetorical question guidance constraints into the system prompt and user prompt associated with the interaction scenario, generating a dynamic prompt. The mounting module retrieves a tool resource pool based on scenario requirements and dynamically mounts tool definitions and resource protocols. The third generation module inputs the natural language human-computer interaction data, the dynamic prompt, the tool definition, and the resource protocol into a function call model to generate an initial interaction function call instruction corresponding to the natural language human-computer interaction data. The verification and correction module is used to perform format compliance verification and pre-execution testing on the initial interactive function call instruction based on a closed-loop verification and self-correction mechanism. If the verification or test fails, error feedback information is obtained, and the error feedback information and the initial interactive function call instruction are fed back to the function call model for instruction correction until a compliant interactive function call instruction is obtained. The calling module is used to implement human-computer interaction based on the compliant interactive function call instructions.
9. A terminal, characterized in that, The terminal includes: a processor and a memory; the memory is used to store computer programs; the processor is used to execute the computer programs stored in the memory to enable the terminal to perform the natural language human-computer interaction method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the terminal, it implements the natural language human-computer interaction method as described in any one of claims 1 to 7.