Methods, devices and equipment for processing interactive data of telephone ordering
By constructing a dual-role model and tool call system, the system simulates the telephone ordering process to generate structured interactive data and performs full-dimensional verification and repair. This solves the problem of data generation not conforming to business specifications in existing technologies, and achieves efficient and automated data generation and repair, thereby improving data quality and usability.
Patent Information
- Application Number
- CN202611165135.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, the processing of telephone ordering interaction data is costly and time-consuming, and the generated data does not conform to the actual business process, resulting in poor fine-tuning and training effects of intelligent ordering agents.
A dual-role model and tool invocation system are constructed to simulate the multi-round interaction of the entire telephone ordering process, generate structured interaction data, and conduct compliance verification through preset business rules and tool definition specifications. The quality inspection results are analyzed, and the correction content is generated using a large language model to form a closed-loop processing mechanism.
It significantly improves the quality and usability of generated telephone ordering interaction data, ensuring that the data is relevant to the actual scenario, and the automated repair process improves efficiency, outputting high-quality data that meets business and technical specifications.
Smart Images

Figure CN123117400A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a method, apparatus, and equipment for processing interactive data during telephone ordering. Background Technology
[0002] With the widespread application of intelligent voice assistants in the catering service sector, the interactive capabilities and business compliance of intelligent ordering agents have become crucial for improving user experience. To achieve efficient fine-tuning training of intelligent ordering agents, a large amount of multi-round interaction data closely aligned with actual telephone ordering scenarios is required. However, existing methods for processing telephone ordering interaction data have the following shortcomings: traditional manual annotation methods are costly and time-consuming, making it difficult to meet the demands of massive data volumes; simply simulated data often deviates from actual business processes, resulting in unnatural customer behavior, and the ordering assistant's responses and tool calls do not conform to industry standards, leading to unstable data quality and ultimately affecting the fine-tuning training effect of intelligent ordering agents. Therefore, there is an urgent need for a processing mechanism that can efficiently generate high-quality, business-compliant telephone ordering interaction data to improve the quality and usability of the generated data. Summary of the Invention
[0003] The purpose of this application is to provide a method, apparatus, and device for processing telephone ordering interaction data, which can efficiently generate high-quality, business-compliant telephone ordering interaction data and improve the quality and usability of the generated data.
[0004] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for processing telephone ordering interaction data, including: Construct a dual-role model and tool call system to simulate the entire process of telephone ordering and generate structured interactive data containing dialogue content, tool call behavior and order information; The structured interactive data is subjected to compliance verification according to preset business rules, and the structured interactive data is subjected to standardization verification according to tool definition specifications, and the quality inspection results containing abnormal data and the abnormal location and type of abnormal data are output. The quality inspection results are analyzed to determine the anomaly type and location of the abnormal data. Based on the anomaly type, a large language model is called and correction content is generated based on preset business rules or tool definition specifications. The corresponding content in the abnormal data is replaced with the correction content at the anomaly location to obtain the repaired data. The repaired data is then re-performed for compliance and standardization checks, and the repaired data that passes the checks is marked as usable data.
[0005] Optionally, the dual-role model includes an ordering assistant model and a customer model, wherein: The ordering assistant model is configured with a standardized ordering process, complete menu information, language consistency rules, and response style specifications. The standardized ordering process includes, in sequence, dish confirmation, order review, payment method inquiry, price calculation, order creation, and conversation end. The complete menu information includes the dish identifier, price, and attributes of each dish. The customer model is configured with language rules, behavior rules, scenario rules, and order restriction rules. The language rules randomly select Chinese or English as the interaction language. The behavior rules are natural ordering logic. The scenario rules randomly select a single-person ordering scenario or a multi-person ordering scenario. The order restriction rules stipulate that the number of dishes ordered in a single order does not exceed a preset threshold and dishes are only selected from a preset menu.
[0006] Optionally, the tool invocation system includes a menu details query tool, a price calculation tool, an order creation tool, a call end tool, and a human operator transfer tool, wherein: The dish details query tool is invoked after the customer selects a dish. The parameter of the dish details query tool is a list of dish identifiers, and it only returns the dish details corresponding to the list of dish identifiers. The price calculation tool is invoked after confirming all dishes, quantities, and customization requirements. The parameters of the price calculation tool include order details, order type, and payment method, and the parameter values include content explicitly confirmed by the customer. The order creation tool is invoked after confirming the order, inquiring about the payment method, and calculating the total price. The required parameters of the order creation tool include customer information, order details, order type, payment method, and order options. The call termination tool is invoked when an order is successfully created and the user confirms that there are no other needs, or when the user explicitly abandons the purchase. The human transfer tool is invoked when a customer requests a transfer, files a complaint, or requires human assistance. The parameters of the human transfer tool include the reason for the transfer and a summary of the scenario.
[0007] Optionally, the generation of structured interactive data containing dialogue content, tool call behavior, and order information specifically includes: Initialize the configuration and set the batch generation quantity, the maximum number of interaction rounds per data item, and the data storage path. Randomly initialize the customer model's interaction language and ordering scenario. The ordering assistant model randomly selects a welcome message from a preset welcome message library to initiate multiple rounds of interaction; The customer model generates customer responses based on the previous response from the ordering assistant model, according to the configuration rules of the customer model. The ordering assistant model parses the customer's response and determines whether a tool needs to be invoked according to the standardized ordering process. If a tool needs to be invoked, it generates a tool invocation command according to the parameter specifications of the corresponding tool. After the tool returns a result, it outputs an interactive response consistent with the interactive language. If a tool does not need to be invoked, it outputs an interactive response that conforms to the response style specifications. The current interaction ends when the call termination condition is triggered; otherwise, return to the customer response generation step. Store the message list of a single interaction, tool call records, and order information in a structured format.
[0008] Optionally, the preset business rules are core rules preset based on the actual business needs of telephone ordering, specifically including: Order confirmation rules: After the customer indicates that they will not add any more dishes, repeat all the dishes already ordered; Rule against repeating the same information: When asking about menu options, skip the menu items that the customer has already selected; Standardized rules for asking about dietary restrictions: Dietary restrictions must be asked using a standardized format only; Rules for inquiring about dietary restrictions: Dietary restrictions should be inquired about only after all dishes have been ordered; Labeling rules: The ordering assistant's reply must not include dish number labels; Notes confirmation rules: Customers' dietary restrictions, special preparation requirements, etc., should be added to the corresponding notes attribute; Ingredient description rules: When a customer inquires about an unlisted ingredient, and if it is uncertain whether the ingredient is contained, add a note as requested by the customer. Option confirmation rule: When a customer asks if the menu options can be adjusted, confirm the result directly; Option value output rule: Only output specific option values for dish attributes when a customer actively inquires about them.
[0009] Optionally, the step of performing normative verification on the structured interaction data according to the tool definition specifications specifically includes: Verify whether the called tool is a registered function in the tool calling system, and verify whether the called tool has spelling errors or misuse of aliases; Verify that all required parameters have been entered without any missing ones, and verify that the use of optional parameters matches the ordering scenario. Verify that the data type and format of the verification parameters are completely consistent with the tool definition; Verify whether the parameter values are within the range allowed by the tool, and verify whether there are logical conflicts between multiple parameters; Verify whether the tool calls conform to the ordering process and context requirements, and whether there are redundant calls, premature calls, or delayed calls.
[0010] Optionally, the step of parsing the quality inspection results to determine the anomaly type and location of the abnormal data, calling the large language model according to the anomaly type and generating corrective content based on preset business rules or tool definition specifications, and replacing the corresponding content in the abnormal data with the corrective content at the anomaly location to obtain the repaired data, specifically includes: The quality inspection results are analyzed to extract the file identifier, anomaly type, problem location, and violation content of the abnormal data. The anomaly types include business rule anomalies and tool call anomalies. When the exception type is a business rule-based exception, the exception data, the preset business rule, and the problem details are input into the large language model to generate corrected dialogue content that conforms to the rule, maintaining the consistency of the response style and context. When the exception type is a tool call exception, the exception data, the definition specification of the corresponding tool, the problem details and the original tool call instruction are input into the large language model to generate a corrected tool call instruction that meets the parameter requirements, format specifications and call logic; Replace the corresponding content in the abnormal data at the abnormal location with the corrected content, keeping the data structure unchanged, and add a repair identifier to the repaired data.
[0011] Optionally, the re-performance of compliance and standardization checks on the repaired data, when the repaired data fails the checks, includes: The repaired data is returned to the repair steps and the repair process is repeated. If the same data fails to pass the verification after being repaired a preset number of times, the data will be marked as invalid data and a manual intervention process will be triggered.
[0012] Secondly, this application provides a telephone ordering interactive data processing device, comprising: Data generation module: used to build a dual-role model and tool call system, simulate the entire process of telephone ordering, and generate structured interactive data containing dialogue content, tool call behavior and order information; Quality inspection module: used to perform compliance verification on the structured interaction data according to preset business rules, and to perform standardization verification on the structured interaction data according to tool definition specifications, and output quality inspection results including abnormal data and the location and type of abnormal data; Repair module: used to parse the quality inspection results to determine the anomaly type and anomaly location of the abnormal data, call the large language model according to the anomaly type and generate correction content based on preset business rules or tool definition specifications, and replace the corresponding content in the abnormal data with the correction content at the anomaly location to obtain the repaired data; Re-inspection module: used to re-perform compliance and standardization checks on the repaired data, and mark the repaired data that passes the checks as usable data.
[0013] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the telephone ordering interactive data processing method described above.
[0014] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the telephone ordering interactive data processing method described above.
[0015] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the telephone ordering interactive data processing method described above.
[0016] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application provides a method, apparatus, and device for processing telephone ordering interaction data. By constructing a dual-role model and tool invocation system, it simulates the entire process of telephone ordering through multiple rounds of interaction to generate structured interaction data, ensuring that the generated data closely matches the actual telephone ordering scenario. Based on preset business rules and tool definition specifications, the structured interaction data undergoes full-dimensional compliance and standardization checks, comprehensively identifying violations of business rules and abnormal tool invocations, thus guaranteeing data quality. By parsing the quality inspection results to locate the anomaly type and location in the abnormal data, a large language model is invoked in conjunction with business specifications or tool definitions to generate corrective content and replace the corresponding content at the anomaly location in the abnormal data. The repair process is automated, requiring no manual intervention and significantly improving repair efficiency. By re-performing compliance and standardization checks on the repaired data, data that passes the checks is marked as usable data, forming a closed-loop processing mechanism of "generation-quality inspection-repair-re-quality inspection," ensuring that the final output usable data conforms to business and technical specifications. This effectively improves the generation quality and usability of telephone ordering interaction data, providing high-quality data support for the fine-tuning and training of intelligent ordering agents. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the 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.
[0018] Figure 1 A flowchart illustrating a telephone ordering interactive data processing method according to an embodiment of this application; Figure 2 A schematic diagram of the overall process of a telephone ordering interactive data processing method provided in an embodiment of this application; Figure 3 This application provides a schematic diagram of a data generation sub-process for a telephone ordering interactive data processing method according to an embodiment of the present application. Figure 4 A schematic diagram of a two-layer automated quality inspection sub-process of a telephone ordering interactive data processing method provided in an embodiment of this application; Figure 5 This is a schematic diagram of an abnormal data repair sub-process of a telephone ordering interactive data processing method provided in an embodiment of this application.
[0019] Figure 6 A functional module diagram of a telephone ordering interactive data processing device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a computer device provided in an 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 embodiments of this application, and not all embodiments. 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] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] In one exemplary embodiment, such as Figure 1 and Figure 2 As shown, a method for processing interactive data during telephone ordering is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, it includes the following steps 101 to 104. Wherein: Step 101: Construct a dual-role model and tool call system to simulate the entire process of ordering food by phone, generating structured interactive data that includes dialogue content, tool call behavior, and order information.
[0023] like Figure 3As shown, a data generation sub-flow diagram of a telephone ordering interaction data processing method is provided. It illustrates the connection logic between the dual-role model interaction and tool invocation, specifically including initialization configuration, interaction initiation, customer reply generation, ordering assistant response processing, interaction termination judgment, and data storage.
[0024] In this embodiment, by constructing a dual-role model and a tool call system, the entire process of telephone ordering is simulated with multiple rounds of interaction to generate structured interactive data. This ensures that the generated data closely matches the actual telephone ordering scenario, the customer behavior is natural, the ordering assistant's responses and tool calls comply with business specifications, and the generated data can be used for fine-tuning and training of the intelligent ordering agent without additional preprocessing.
[0025] As an optional implementation, the dual-role model includes an ordering assistant model and a customer model, wherein: The ordering assistant model is configured with a standardized ordering process, complete menu information, language consistency rules, and response style specifications. The standardized ordering process includes, in sequence, dish confirmation, order review, payment method inquiry, price calculation, order creation, and conversation end. The complete menu information includes the dish identifier, price, and attributes of each dish. The dish categories include lunch sets, all-day meals, à la carte dishes, and beverages. The response style specifications are extremely concise and have zero redundancy. The customer model is configured with language rules, behavior rules, scenario rules, and order restriction rules. The language rules randomly select Chinese or English as the interaction language and maintain language consistency or switch only once during the interaction. The behavior rules are natural ordering logic (including slight hesitation and supplementary requests). The scenario rules randomly select a single-person ordering scenario or a multi-person ordering scenario. The order restriction rules stipulate that the number of dishes ordered in a single order does not exceed a preset threshold (e.g., no more than 4 dishes) and dishes are only selected from a preset menu.
[0026] This implementation method, by configuring the ordering assistant model with standardized ordering processes, complete menu information, language consistency rules, and response style specifications, ensures that the ordering assistant's responses always conform to business norms and maintain a consistent style. By configuring language rules, behavioral rules, scenario rules, and order restriction rules for the customer model, it is possible to simulate diverse customer behaviors that closely resemble real telephone ordering scenarios, making the generated data more realistic and generalizable, and providing diverse training samples for the fine-tuning training of the intelligent ordering agent.
[0027] As an optional implementation, the tool invocation system includes a menu details query tool, a price calculation tool, an order creation tool, a call end tool, and a human operator transfer tool, wherein: The menu details query tool is invoked after the customer selects a menu item. The required parameter of the menu details query tool is a list of menu item identifiers, and it only returns the menu details corresponding to the menu item identifiers. The price calculation tool is invoked after all dishes, quantities, and customization requirements are confirmed. The required parameters of the price calculation tool include order details, order type, and payment method, and the parameter values only include content explicitly confirmed by the customer. The order creation tool is invoked after confirming the order, inquiring about the payment method, and calculating the total price. The required parameters of the order creation tool include customer information, order details, order type, payment method, and order options. The call termination tool is invoked when an order is successfully created and the user confirms that there are no other needs, or when the user explicitly abandons the purchase. The human agent transfer tool is invoked when a customer requests a transfer, files a complaint, or explicitly needs human assistance. The required parameters for the human agent transfer tool include the reason for the transfer and a summary of the scenario.
[0028] This implementation method defines five types of tools: order creation tool, price calculation tool, menu details query tool, call termination tool, and human transfer tool. It also clarifies the timing of tool calls, required parameters, and parameter value rules for each type of tool. This ensures that tool calls strictly conform to the business logic of telephone ordering, avoiding redundant, premature, or delayed calls. The generated tool call behaviors can be directly used for tool learning and training for intelligent ordering agents, enabling agents to call the corresponding tools according to the correct business process in actual applications.
[0029] As an optional implementation, the generation of structured interactive data containing dialogue content, tool call behavior, and order information specifically includes the following sub-steps: The configuration is initialized, and the batch generation quantity, maximum interaction rounds per data item, and data storage path are set. The interaction language and ordering scenario of the customer model are randomly initialized. In this embodiment, the batch generation quantity can be configured between 10 and 1000 items, and the maximum interaction rounds per data item can be configured between 10 and 50 rounds.
[0030] The food ordering assistant model randomly selects a welcome message from a preset welcome message library to initiate multi-round interactions. In this embodiment, the preset welcome message library contains various welcome phrases that conform to telephone ordering etiquette; random selection increases the diversity of the generated data.
[0031] The customer model generates customer responses based on the previous response from the ordering assistant model, according to the configuration rules of the customer model. In this embodiment, the responses generated by the customer model may include menu selection, customization requests, quantity confirmation, etc., and the response style may simulate the simple or complex style of a real customer.
[0032] The ordering assistant model parses the customer's response and determines whether a tool needs to be invoked according to the standardized ordering process. If a tool needs to be invoked, a tool invocation command is generated according to the parameter specifications of the corresponding tool. After the tool returns the result, an interactive response consistent with the interactive language is output. If no tool needs to be invoked, an interactive response conforming to the response style specifications is directly output.
[0033] The current interaction ends when the call termination condition is triggered; otherwise, the process returns to the customer response generation step. In this embodiment, the call termination condition includes successful order creation and user confirmation that there are no other needs, or the user explicitly abandoning the purchase.
[0034] The message list, tool call records, and order information for each interaction are stored in a structured format. In this embodiment, the structured format can be JSON, and the message list includes fields such as role and content.
[0035] This implementation method, through the interactive process simulated by alternating responses from two roles and tool calls, can generate structured interactive data in batches. Each piece of data contains a complete dialogue history, tool call records, and order information. The data format is standardized and can be directly used for fine-tuning training of the intelligent ordering agent without additional data preprocessing.
[0036] Step 102: Perform compliance verification on the structured interaction data according to preset business rules, and perform standardization verification on the structured interaction data according to the tool definition specifications, and output quality inspection results including abnormal data and the abnormal location and type of abnormal data.
[0037] like Figure 4 As shown, a schematic diagram of a two-layer automated quality inspection sub-process for processing interactive data of telephone ordering is provided. It shows the execution logic and result output of the two-layer quality inspection: business rule quality inspection and tool call quality inspection. The business rule quality inspection performs compliance verification based on nine core business rules, while the tool call quality inspection performs standardization verification from five dimensions: function existence, parameter completeness, parameter format correctness, parameter logic rationality, and call timing rationality.
[0038] In this embodiment, by performing full-dimensional compliance and standardization checks on the generated data based on preset business rules and tool definition specifications, it is possible to comprehensively identify violations of business rules and abnormal tool calls in the data. Nine business rules and five tool verification dimensions ensure that quality inspection is thorough and guarantees data quality.
[0039] As an optional implementation, the preset business rules consist of nine core rules preset based on the actual business needs of telephone ordering, specifically including: Order confirmation rules: After a customer indicates they will not order any more dishes, the order assistant must clearly and completely repeat all the dishes ordered. In this embodiment, when a customer explicitly states "no more dishes" or something similar in the conversation, the order assistant must completely repeat the names and quantities of all the dishes the customer has ordered to ensure the accuracy of the order information.
[0040] Rule against repeating options: When inquiring about menu options, the ordering assistant must not repeat the names of dishes already selected by the customer. In this embodiment, when asking customers about spiciness, flavor, or other options, the ordering assistant should not repeat the names of dishes already selected by the customer, in order to keep the conversation concise and efficient.
[0041] Standardized rules for asking about dietary restrictions: Only a standardized format is used to ask about dietary restrictions; individual questions about removing eggs, scallions, onions, or garlic are not asked. In this embodiment, the ordering assistant only asks for dietary restrictions in the standardized format "Do you have any dietary restrictions?", without asking each ingredient individually, to improve interaction efficiency.
[0042] Timing rules for inquiring about dietary restrictions: Dietary restrictions must be inquired about after all dishes have been ordered. In this embodiment, the ordering assistant cannot inquire about dietary restrictions during the ordering process; the inquiry must be made after the customer has selected all dishes.
[0043] Identification display rules: The ordering assistant's reply must not contain dish number identifiers. In this embodiment of the application, the ordering assistant's reply text cannot contain dish IDs or other numbered information; it only communicates with customers using dish names.
[0044] Remarks confirmation rules: Customers' dietary restrictions, special preparation requirements, and other dietary taboos must be accurately added to the corresponding remarks attributes. In this embodiment, any dietary restrictions, restrictions (such as allergies), or special preparation requirements (such as low oil or low salt) raised by the customer must be accurately recorded in the corresponding remarks attribute of the order.
[0045] Ingredient description rules: When a customer inquires about an ingredient not listed, the system will not speculate on whether the ingredient is contained; instead, it will directly add the ingredient as requested. In this embodiment, if a customer inquires whether a dish contains a certain ingredient that is not listed on the menu, the ordering assistant will not provide a speculative answer but will directly add the ingredient as requested by the customer.
[0046] Option Confirmation Rules: When a customer inquires whether a dish can be adjusted, the answer is confirmed directly without repeated questioning. In this embodiment, when a customer asks whether a dish can be adjusted (e.g., "Can this be made without chili?"), the ordering assistant directly provides a confirmation answer without asking the customer for confirmation.
[0047] Option value output rule: The specific option value for a dish attribute will not be automatically output unless a customer requests it. In this embodiment, the ordering assistant will not automatically output the specific option value for a dish attribute (such as spiciness) unless the customer requests it.
[0048] This implementation method, through comprehensive coverage of nine core business rules, can accurately identify behaviors in the data that violate the norms of telephone ordering, ensuring the compliance of generated data in actual business scenarios and avoiding poor user experience in actual application of intelligent ordering agents due to violations of business rules.
[0049] As an optional implementation, the standardization verification of the structured interaction data according to the tool definition specifications specifically includes the following five dimensions: The system verifies whether the called tool is a registered function in the tool calling system and checks whether the called tool has any spelling errors or misused aliases. In this embodiment, this dimension ensures that all called tool names are correctly defined in the tool calling system and that there are no spelling errors or unregistered function aliases.
[0050] The system verifies whether all required parameters have been passed without any omissions, and whether the use of optional parameters matches the ordering scenario. In this embodiment, this dimension ensures that all required parameters for each tool call have been passed, and that the use of optional parameters meets the business requirements of the current ordering scenario.
[0051] Verify that the data type and format of the parameters are completely consistent with the tool definition. In this embodiment, this dimension ensures that the data type (such as string, integer, boolean, array, object) and format (such as identifier format, enumeration format) of the parameters are completely consistent with the tool definition specification.
[0052] The verification parameter values are checked to ensure they are within the range allowed by the tool, and to check for logical conflicts between multiple parameters. In this embodiment, this dimension ensures that the enumeration type parameters use preset enumeration values (e.g., the order type is only self-pickup (ONLINE_PICKUP) or delivery (ONLINE_DELIVERY), the payment method is only online payment (PAY_ONLINE), in-store payment (PAY_IN_STORE), delivery card payment (CARD_ON_DELIVERY), or cash on delivery (CASH_ON_DELIVERY)), the quantity parameter is a positive integer, and there are no logical conflicts between multiple parameters (e.g., self-pickup orders do not include a delivery address).
[0053] The verification tool calls are checked to ensure they conform to the ordering process and context requirements, and to identify any redundant, premature, or delayed calls. In this embodiment, this dimension ensures that each tool call occurs at the correct business process node; for example, the price calculation tool is called after the dishes are confirmed, and the order creation tool is called after the price is confirmed, thus avoiding redundant, premature, or delayed calls.
[0054] This implementation method involves a comprehensive verification of tool calls across five dimensions: function existence, parameter integrity, parameter format correctness, parameter logic rationality, and call timing. This ensures the standardization and accuracy of tool call behavior and prevents errors in the actual execution of the intelligent food ordering agent due to abnormal tool calls.
[0055] Step 103: Analyze the quality inspection results to determine the anomaly type and location of the abnormal data. Based on the anomaly type, call the large language model and generate correction content based on preset business rules or tool definition specifications. Replace the corresponding content in the abnormal data with the correction content at the anomaly location to obtain the repaired data.
[0056] In this embodiment, the abnormal type and location of the abnormal data are determined by parsing the quality inspection results. The large language model is then called to generate corrective content based on preset business rules or tool definition specifications and replace the corresponding content in the abnormal data. Customized corrective content is generated for different types of abnormalities. The repair process is automated and requires no manual intervention, which significantly improves repair efficiency.
[0057] As an optional implementation, the step of parsing the quality inspection results to determine the anomaly type and location of the abnormal data, calling the large language model according to the anomaly type and generating corrective content based on preset business rules or tool definition specifications, and replacing the corresponding content in the abnormal data with the corrective content at the anomaly location, specifically includes the following sub-steps: The quality inspection results are analyzed to extract the file identifier, anomaly type, problem location, and specific violation content of the abnormal data. The anomaly types include business rule anomalies and tool call anomalies.
[0058] In this embodiment of the application, business rule-related exceptions refer to exceptions that violate any of the nine preset business rules, such as asking about dietary restrictions at the wrong time or not fully recounting the dishes; tool call-related exceptions refer to exceptions that violate the tool definition specifications, such as missing parameters, incorrect enumeration values, or premature call timing.
[0059] When the exception type is a business rule-based exception, the exception data, the preset business rule, and the problem details are input into the large language model to generate corrected dialogue content that conforms to the rule, maintaining the consistency of the response style and context.
[0060] In this embodiment of the application, for example, for abnormal data where the dishes are not fully described, the big language model supplements the complete description of the dishes; for abnormal data where the spiciness option is actively output, the big language model deletes the actively output option value; for abnormal data where the timing of asking about dietary restrictions is incorrect, the big language model adjusts the questioning about dietary restrictions to the correct round after all dishes have been ordered.
[0061] When the exception type is a tool call exception, the exception data, the definition specification of the corresponding tool, the problem details and the original tool call instruction are input into the large language model to generate a corrected tool call instruction that meets the parameter requirements, format specifications and call logic.
[0062] In this embodiment, for example, to address the anomaly of missing quantity parameters in the price calculation tool, the large language model supplements the quantity value confirmed by the customer; to address the error in the order type enumeration value in the order creation tool, the large language model corrects the order type to the correct value from the preset enumeration values. The corrected tool call instructions must meet the following requirements: the function name is completely consistent with the tool call system; there are no missing required parameters, and the parameter values only contain information explicitly confirmed by the customer, without inferred or automatically filled content; enumerated parameters strictly use preset enumeration values; and the data type completely matches the tool definition.
[0063] Replace the corresponding content in the abnormal data at the abnormal location with the corrected content, keeping the data structure unchanged, and add a repair identifier to the repaired data.
[0064] In this embodiment, the repair identifier includes information such as repair time, anomaly type, and number of repairs, which facilitates subsequent traceability and quality analysis.
[0065] like Figure 5 As shown, a schematic diagram of the abnormal data repair sub-process of a telephone ordering interaction data processing method is provided. It shows the differentiated repair logic for two types of abnormalities: business rule-related abnormalities and tool call-related abnormalities. The process includes abnormal analysis, correction content generation, data replacement, and repair record generation.
[0066] This implementation method employs differentiated repair strategies for business rule-related anomalies and tool call-related anomalies. It utilizes a large language model combined with corresponding specifications to generate customized correction content. The repair process is highly automated, improving repair efficiency by more than 80%. At the same time, adding repair markers facilitates subsequent traceability and quality analysis.
[0067] Step 104: Re-perform compliance and standardization checks on the repaired data, and mark the repaired data that passes the checks as usable data.
[0068] In this embodiment, compliance and standardization checks are re-executed on the repaired data. Data that passes the checks is marked as usable data, while data that fails the checks is returned to the repair step for reprocessing. This forms a closed-loop processing mechanism of "generation-quality inspection-repair-re-quality inspection". Combined with threshold control of the number of repairs, this ensures that the final output usable data complies with business and technical specifications, while avoiding resource waste caused by invalid repairs.
[0069] As an optional implementation, the step of re-performing compliance and standardization checks on the repaired data includes the following steps if the repaired data fails the checks: The repaired data is returned to the repair steps and the repair process is repeated. If the same data fails to pass the verification after being repaired a preset number of times, the data will be marked as invalid data and a manual intervention process will be triggered.
[0070] In this embodiment, the preset repair count threshold can be configured to be 3 to 5 times. When the same data fails to pass the verification after the preset repair count reaches the threshold, it indicates that the data's anomaly is complex or special, requiring manual intervention to avoid wasting resources due to ineffective cyclical repairs.
[0071] This implementation method, by setting a threshold for the number of repair attempts, avoids resource waste caused by ineffective, repetitive repair cycles. For data that fails verification after multiple repairs, manual intervention is triggered, ensuring that problematic data is properly handled. Data that passes verification is marked as usable and can be directly used for fine-tuning and training of the intelligent ordering agent, significantly improving the agent's interaction compliance, business logic adherence, and tool invocation accuracy.
[0072] By implementing steps 101 to 104 above, a dual-role model and tool invocation system are constructed to simulate the entire process of multi-round interactions in telephone ordering, generating structured interactive data that ensures the generated data closely matches the actual telephone ordering scenario. Based on preset business rules and tool definition specifications, the structured interactive data undergoes full-dimensional compliance and standardization checks, comprehensively identifying violations of business rules and abnormal tool invocations, ensuring data quality. By parsing the quality inspection results to locate the anomaly type and location in the abnormal data, a large language model is invoked in conjunction with business specifications or tool definitions to generate corrective content and replace the corresponding content at the anomaly location in the abnormal data. The repair process is automated, requiring no manual intervention and significantly improving repair efficiency. By re-performing compliance and standardization checks on the repaired data, data that passes the checks is marked as usable data, forming a closed-loop processing mechanism of "generation-quality inspection-repair-re-quality inspection," ensuring that the final output usable data conforms to business and technical specifications. This effectively improves the generation quality and usability of telephone ordering interactive data, providing high-quality data support for the fine-tuning and training of the intelligent ordering agent.
[0073] Based on the same inventive concept, this application also provides a telephone ordering interactive data processing device for implementing the telephone ordering interactive data processing method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of the one or more telephone ordering interactive data processing device embodiments provided below can be found in the limitations of the telephone ordering interactive data processing method described above, and will not be repeated here.
[0074] In one exemplary embodiment, such as Figure 6 As shown, a telephone ordering interactive data processing device is provided, comprising: Data generation module 201: Used to construct a dual-role model and tool call system, simulating the entire process of multi-round interactions during telephone ordering, and generating structured interactive data containing dialogue content, tool call behavior, and order information. In this embodiment, the data generation module has a built-in ordering assistant model and customer model, configures the tool call system and complete menu data, and supports adjusting parameters such as batch generation quantity and maximum number of interaction rounds through configuration files.
[0075] Quality inspection module 202: This module performs compliance checks on the structured interactive data according to preset business rules, and performs standardization checks on the structured interactive data according to tool definition specifications, outputting quality inspection results including abnormal data and the location and type of the abnormal data. In this embodiment, the quality inspection module includes a business rule quality inspection unit and a tool call quality inspection unit. The business rule quality inspection unit performs compliance checks based on nine core business rules, while the tool call quality inspection unit performs standardization checks from five dimensions: function existence, parameter completeness, parameter format correctness, parameter logic rationality, and call timing rationality.
[0076] Repair module 203: This module parses the quality inspection results to determine the anomaly type and location of the abnormal data. Based on the anomaly type, it calls a large language model and generates corrective content based on preset business rules or tool definition specifications. Then, it replaces the corresponding content in the abnormal data at the anomaly location with the corrected content to obtain the repaired data. In this embodiment, the repair module employs differentiated repair strategies for business rule-related anomalies and tool call-related anomalies, supporting both single-data repair and batch data repair.
[0077] The re-inspection module 204 is used to re-perform compliance and standardization checks on the repaired data, and mark the repaired data that passes the checks as usable data. In this embodiment, the re-inspection module reuses the core verification logic with the quality inspection module, adds repair count statistics and threshold judgment functions, and sends a notification when manual intervention is triggered.
[0078] Each module in the aforementioned telephone ordering interactive data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0079] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 7As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data for a telephone ordering interactive data processing method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a telephone ordering interactive data processing method.
[0080] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0081] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0082] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0083] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0084] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0085] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0086] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0087] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0088] This document uses specific examples 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 methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for processing interactive data from telephone food ordering, characterized in that, The method for processing telephone ordering interaction data includes: Construct a dual-role model and tool call system to simulate the entire process of ordering food by phone, generating structured interactive data that includes dialogue content, tool call behavior, and order information; The structured interactive data is subjected to compliance verification according to preset business rules, and the structured interactive data is subjected to standardization verification according to tool definition specifications, and the quality inspection results containing abnormal data and the abnormal location and type of abnormal data are output. The quality inspection results are analyzed to determine the anomaly type and location of the abnormal data. Based on the anomaly type, a large language model is called and correction content is generated based on preset business rules or tool definition specifications. The corresponding content in the abnormal data is replaced with the correction content at the anomaly location to obtain the repaired data. The repaired data is then re-performed for compliance and standardization checks, and the repaired data that passes the checks is marked as usable data.
2. The telephone ordering interactive data processing method according to claim 1, characterized in that, The dual-role model includes an ordering assistant model and a customer model, wherein: The ordering assistant model is configured with a standardized ordering process, complete menu information, language consistency rules, and response style specifications. The standardized ordering process includes, in sequence, dish confirmation, order review, payment method inquiry, price calculation, order creation, and conversation end. The complete menu information includes the dish identifier, price, and attributes of each dish. The customer model is configured with language rules, behavior rules, scenario rules, and order restriction rules. The language rules randomly select Chinese or English as the interaction language. The behavior rules are natural ordering logic. The scenario rules randomly select a single-person ordering scenario or a multi-person ordering scenario. The order restriction rules stipulate that the number of dishes ordered in a single order does not exceed a preset threshold and dishes are only selected from a preset menu.
3. The telephone ordering interactive data processing method according to claim 1, characterized in that, The tool access system includes a menu details query tool, a price calculation tool, an order creation tool, a call end tool, and a human operator transfer tool, among which: The dish details query tool is invoked after the customer selects a dish. The parameter of the dish details query tool is a list of dish identifiers, and it only returns the dish details corresponding to the list of dish identifiers. The price calculation tool is invoked after confirming all dishes, quantities, and customization requirements. The parameters of the price calculation tool include order details, order type, and payment method, and the parameter values include content explicitly confirmed by the customer. The order creation tool is invoked after confirming the order, inquiring about the payment method, and calculating the total price. The required parameters of the order creation tool include customer information, order details, order type, payment method, and order options. The call termination tool is invoked when an order is successfully created and the user confirms that there are no other needs, or when the user explicitly abandons the purchase. The human agent transfer tool is invoked when a customer requests a transfer, files a complaint, or requires human assistance. The parameters of the human agent transfer tool include the reason for the transfer and a summary of the scenario.
4. The telephone ordering interactive data processing method according to claim 2, characterized in that, The generation of structured interactive data, which includes dialogue content, tool call behavior, and order information, specifically includes: Initialize the configuration and set the batch generation quantity, the maximum number of interaction rounds per data item, and the data storage path. Randomly initialize the customer model's interaction language and ordering scenario. The ordering assistant model randomly selects a welcome message from a preset welcome message library to initiate multiple rounds of interaction; The customer model generates customer responses based on the previous response from the ordering assistant model, according to the configuration rules of the customer model. The ordering assistant model parses the customer's response and determines whether a tool needs to be invoked according to the standardized ordering process. If a tool needs to be invoked, it generates a tool invocation command according to the parameter specifications of the corresponding tool. After the tool returns a result, it outputs an interactive response consistent with the interactive language. If a tool does not need to be invoked, it outputs an interactive response that conforms to the response style specifications. The current interaction ends when the call termination condition is triggered; otherwise, return to the customer response generation step. Store the message list of a single interaction, tool call records, and order information in a structured format.
5. The telephone ordering interactive data processing method according to claim 1, characterized in that, The preset business rules are core rules preset based on the actual business needs of telephone ordering, specifically including: Order confirmation rules: After the customer indicates that they will not add any more dishes, repeat all the dishes already ordered; Rule against repeating the same information: When asking about menu options, skip the menu items that the customer has already selected; Standardized rules for asking about dietary restrictions: Dietary restrictions must be asked using a standardized format only; Rules for inquiring about dietary restrictions: Dietary restrictions should be inquired about only after all dishes have been ordered; Labeling rules: The ordering assistant's reply must not include dish number labels; Notes confirmation rules: Customers' dietary restrictions, special preparation requirements, etc., should be added to the corresponding notes attribute; Ingredient description rules: When a customer inquires about an unlisted ingredient, and if it is uncertain whether the ingredient is contained, add a note as requested by the customer. Option confirmation rule: When a customer asks if the menu options can be adjusted, confirm the result directly; Option value output rule: Only output specific option values for dish attributes when a customer actively inquires about them.
6. The telephone ordering interactive data processing method according to claim 1, characterized in that, The standardization verification of the structured interactive data according to the tool definition specifications specifically includes: Verify whether the called tool is a registered function in the tool calling system, and verify whether the called tool has spelling errors or misuse of aliases; Verify that all required parameters have been entered without any missing ones, and verify that the use of optional parameters matches the ordering scenario. Verify that the data type and format of the verification parameters are completely consistent with the tool definition; Verify whether the parameter values are within the range allowed by the tool, and verify whether there are logical conflicts between multiple parameters; Verify whether the tool calls conform to the ordering process and context requirements, and whether there are redundant calls, premature calls, or delayed calls.
7. The telephone ordering interactive data processing method according to claim 1, characterized in that, The process involves parsing the quality inspection results to determine the anomaly type and location of the abnormal data, calling a large language model based on the anomaly type, generating corrective content based on preset business rules or tool definition specifications, and replacing the corresponding content in the abnormal data at the anomaly location with the corrective content to obtain the repaired data. Specifically, this includes: The quality inspection results are analyzed to extract the file identifier, anomaly type, problem location, and violation content of the abnormal data. The anomaly types include business rule anomalies and tool call anomalies. When the exception type is a business rule-based exception, the exception data, the preset business rule, and the problem details are input into the large language model to generate corrected dialogue content that conforms to the rule, maintaining the consistency of the response style and context. When the exception type is a tool call exception, the exception data, the definition specification of the corresponding tool, the problem details and the original tool call instruction are input into the large language model to generate a corrected tool call instruction that meets the parameter requirements, format specifications and call logic; Replace the corresponding content in the abnormal data at the abnormal location with the corrected content, keeping the data structure unchanged, and add a repair identifier to the repaired data.
8. The telephone ordering interactive data processing method according to claim 1, characterized in that, The re-performance of compliance and standardization checks on the repaired data, when the repaired data fails the checks, includes: The repaired data is returned to the repair steps and the repair process is repeated. If the same data fails to pass the verification after being repaired a preset number of times, the data will be marked as invalid data and a manual intervention process will be triggered.
9. A telephone ordering interactive data processing device, characterized in that, The telephone ordering interactive data processing device includes: Data generation module: used to build a dual-role model and tool call system, simulate the entire process of telephone ordering, and generate structured interactive data containing dialogue content, tool call behavior and order information; Quality inspection module: used to perform compliance verification on the structured interaction data according to preset business rules, and to perform standardization verification on the structured interaction data according to tool definition specifications, and output quality inspection results including abnormal data and the location and type of abnormal data; Repair module: used to parse the quality inspection results to determine the anomaly type and anomaly location of the abnormal data, call the large language model according to the anomaly type and generate correction content based on preset business rules or tool definition specifications, and replace the corresponding content in the abnormal data with the correction content at the anomaly location to obtain the repaired data; Re-inspection module: used to re-perform compliance and standardization checks on the repaired data, and mark the repaired data that passes the checks as usable data.
10. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the telephone ordering interactive data processing method according to any one of claims 1-8.
