Method, device, medium, and program product for dialog processing
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU MANYUN LOGISTICS INFORMATION CO LTD
- Filing Date
- 2026-07-13
- Publication Date
- 2026-08-07
AI Technical Summary
现有技术存在诸多不足:规则模板方案覆盖能力弱,难以适配长尾表达与多轮交互,规则易膨胀、维护成本高;纯大模型方案易出现规则违背、业务幻觉,高优先级信息冲突时逻辑不稳定;检索增强方案仅能补充话术,无法完成确定性约束推理,难以输出可靠结论
[0024] Furthermore, in this embodiment, the restriction information of the second user is extracted separately and a restriction condition set is formed. Then, the set of priority constraints is obtained by sorting the constraints according to the priority rules. In view of the characteristics of multi-dimensional constraint coupling and higher priority of special requirements in the vehicle-cargo adaptation scenario, high-priority constraints can be made effective first, which overcomes the defects of unstable coverage logic and poor consistency of multi-turn dialogue when unstructured additional requirements conflict with general rules in the prior art.
Smart Images

Figure CN122527293A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle-cargo matching technology, and in particular to a method, device, medium, and program product for dialogue processing. Background Technology
[0002] During the operation of the vehicle-cargo matching platform and transportation capacity service system, drivers and cargo owners often initiate business inquiries through online customer service, instant messaging, voice agents, and other channels. The inquiries mainly cover scenarios such as whether the vehicle and cargo are compatible, whether the loading behavior is compliant, whether the transportation route is feasible, the configuration requirements of special equipment, and transportation risk warnings. Most of the inquiries are multi-round interactive dialogues.
[0003] Currently, most solutions employ information extraction, rule-based decision-making, and dialogue template architecture. This involves first extracting structured information such as vehicle type, load capacity, cargo type, and route restrictions, then using a rule engine to make judgments and output templated responses. With the rise of large language models, end-to-end generation and retrieval-enhanced generation solutions have also been gradually implemented to optimize the dialogue experience and expand scenario coverage.
[0004] However, cargo-vehicle matching consulting is a business characterized by strong constraints, multi-dimensional coupling, and high context dependence. It requires strict adherence to hard rules such as size, load capacity, road control, and hazardous materials transportation, with different constraints having clear priorities. Existing technologies have several shortcomings: rule template solutions have weak coverage capabilities, making it difficult to adapt to long-tail expressions and multi-turn interactions; rules are prone to expansion, resulting in high maintenance costs; pure large-model solutions are prone to rule violations and business illusions, and the logic is unstable when high-priority information conflicts occur; retrieval enhancement solutions can only supplement the wording and cannot complete deterministic constraint reasoning, making it difficult to output reliable conclusions. Therefore, existing solutions cannot simultaneously meet the comprehensive requirements of the business for reasoning determinism, constraint stability, and scenario adaptability. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this application provides a method, apparatus, medium, and program product for dialogue processing, thereby offering a technical solution that can simultaneously meet the comprehensive requirements of business for reasoning determinism, constraint stability, and scenario adaptability.
[0006] This application provides a method for dialogue processing, the method comprising: The current round input and historical round context of the first user are subjected to structured element extraction to obtain the current round extraction result. The global slot information is updated according to the current round extraction result to obtain the structured dialogue frame. The restriction information input by the second user is extracted according to preset restriction conditions to obtain a set of restriction conditions corresponding to the restriction information. The restriction conditions in the set of restriction conditions are then sorted by priority according to preset priority rules to obtain a set of priority constraints. Based on preset business rules, the structured dialogue frames are constrained and inferred to obtain inference results. Based on the inference results, the industry knowledge base is retrieved to generate a caliber material package. Based on the structured dialogue frame, the priority constraint set, and the caliber material package, a constraint instruction set is constructed, and the constraint instruction set is input into the large language model. The large language model is used to generate and output response content based on the constraint instruction set.
[0007] In one alternative implementation, the structured elements include vehicle-related information; Structured feature extraction is performed on the current round input and historical round context of the first user to obtain the current round extraction results, including: The vehicle-related information is extracted from the current wheel input and historical wheel context of the first user to obtain the initial extraction result; The initial extraction results are processed by entity disambiguation and content normalization to obtain the current round of extraction results.
[0008] In one optional implementation, updating the global slot information based on the current round extraction result to obtain a structured dialogue frame includes: The current round extraction result is fused with historical slot information to update global slot information, and a structured dialogue frame is constructed based on the updated slot information.
[0009] In one optional implementation, the limiting information includes remarks, additional explanations, and relevant industry knowledge; The preset restrictions include vehicle equipment restrictions, vehicle travel route restrictions, vehicle temperature control restrictions, loading and unloading time period restrictions, and auxiliary equipment restrictions. The restriction information input by the second user is extracted according to preset restriction conditions to obtain a set of restriction conditions corresponding to the restriction information, including: The remarks, additional explanations, and relevant industry knowledge input by the second user are extracted according to the vehicle equipment restrictions, vehicle route restrictions, vehicle temperature control restrictions, loading and unloading time restrictions, and auxiliary equipment restrictions to obtain a set of restrictions corresponding to the restriction information.
[0010] In one optional implementation, the constraints in the constraint set are prioritized according to a preset priority rule to obtain a priority constraint set including: The constraint modes and strengths of each constraint in the constraint set are identified from the remarks and additional description information. Based on the preset priority rules and the constraint modes and strengths of each constraint, the constraints are sorted to obtain the priority constraint set.
[0011] In one optional implementation, the constraint reasoning of the structured dialogue frame based on preset business rules to obtain the reasoning result includes: Obtain the pre-configured minimum set of target information; If the structured dialogue frame satisfies all fields of the target minimum information set, then constraint reasoning is performed on the structured dialogue frame based on the preset business rules to obtain the reasoning result; If the structured dialogue frame lacks a key field in the target minimum information set, a follow-up questioning strategy is generated based on the missing key field; wherein, the follow-up questioning strategy is used to ask the first user follow-up questions; Based on the aforementioned follow-up questioning strategy, obtain the follow-up questioning results returned by the first user; The follow-up question results are fused into the structured dialogue frame to obtain a fused structured dialogue frame. Constraint reasoning is then performed on the fused structured dialogue frame based on the preset business rules to obtain the reasoning result.
[0012] In one optional implementation, the step of retrieving the industry knowledge base based on the reasoning results and generating the caliber material package includes: Extract the corresponding business reason code from the reasoning result, and traverse the industry knowledge base using the business reason code as the search keyword to obtain the corresponding business script template set; wherein, the business reason code includes at least one of the following: information missing type code, vehicle-cargo mismatch type code, compliance and violation type code, and constraint conflict type code; Based on preset business template rules, expired templates in the business script template set are removed to obtain the policy material package; wherein, the policy material package includes explanatory sentences, follow-up question sentences, risk warning sentences, and alternative suggestion sentences.
[0013] In one optional implementation, constructing the constraint instruction set based on the structured dialogue frame, the priority constraint set, and the caliber material package includes: Based on the structured dialogue frame, the priority constraint set, and the caliber material package, construct a constraint instruction set; Based on a preset instruction partitioning rule, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction to obtain a partitioned constraint instruction set, and the partitioned constraint instruction set is used as the constraint instruction set; wherein, the first constraint instruction is a non-adjustable instruction, and the second constraint instruction is an adjustable instruction.
[0014] In one optional implementation, based on a preset instruction partitioning rule, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction, resulting in a partitioned constraint instruction set including: Based on a preset instruction partitioning rule, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction, and a preset response strategy is injected into the constraint instruction set to obtain the partitioned constraint instruction set.
[0015] In one alternative implementation, the large language model is specifically used for: When the constraint instruction set satisfies the preset deterministic conditions and the preset constraint conditions, a response content is generated according to each of the first constraint instructions; If the constraint instruction set does not meet the preset deterministic conditions, generate and output minimal follow-up information carrying the reason for the follow-up inquiry; If the constraint instruction set does not meet the preset constraint conditions, clarification and follow-up information is generated and output. The method further includes: The minimum follow-up question or the clarification follow-up question is pushed to the first user, and additional information in response to the minimum follow-up question or the clarification follow-up question is obtained. The additional information is incorporated into the first user's current input round, and the corresponding structured dialogue frame is updated.
[0016] In an optional implementation, the method further includes: The response content is subject to preset constraint satisfaction checks, preset field consistency checks, and preset content compliance checks. If the response content passes verification, a reply result is output to the first user; If the response content verification fails, the response content is regenerated according to the reason for the verification failure, and the regenerated response content is verified until the response content verification passes or a preset fallback termination condition is triggered.
[0017] In one optional implementation, the type of the response content is any one of the following: standard response, supplementary inquiry response, risk disclosure response, alternative suggestion response, and fallback response.
[0018] In an alternative implementation, prior to the structured feature extraction of the first user's current round input and historical round context, the method further includes: Receive the current round input and historical round context of the first user, the restriction information of the second user's input, and related structured fields; The target session object is obtained by encapsulating the current round input and historical round context of the first user, the restriction information of the second user's input, and the relevant structured fields. The target session object is subjected to error correction and normalization processing to obtain the processed session object; Based on the processed session object, intent recognition and scene recognition are performed to obtain the target intent and target scene; Based on the target intent and the target scenario, determine the target processing link; The structured feature extraction of the first user's current input and historical context includes: Under the target processing link, structured element extraction is performed on the current round input and historical round context of the first user; The extraction of the restriction information input by the second user according to preset restriction conditions includes: Under the target processing link, the restriction information input by the second user is extracted according to preset restriction conditions; The constraint reasoning of the structured dialogue frame based on preset business rules includes: Under the target processing link, constraint reasoning is performed on the structured dialogue frame based on the preset business rules.
[0019] This application also provides a dialogue processing apparatus, which includes: a first extraction module, a second extraction module, an inference module, and a construction module; The first extraction module is used to extract structured elements from the current round input and the historical round context of the first user, obtain the current round extraction result, and update the global slot information according to the current round extraction result to obtain a structured dialogue frame. The second extraction module is used to extract the restriction information input by the second user according to preset restriction conditions, obtain a set of restriction conditions corresponding to the restriction information, and sort the restriction conditions in the set of restriction conditions according to preset priority rules to obtain a set of priority constraints. The reasoning module is used to perform constraint reasoning on the structured dialogue frame based on preset business rules, obtain reasoning results, and retrieve industry knowledge base based on the reasoning results to generate a caliber material package; The construction module is used to construct a constraint instruction set based on the structured dialogue frame, the priority constraint set, and the caliber material package, and input the constraint instruction set into the large language model. The large language model is used to generate and output response content based on the constraint instruction set.
[0020] This application also provides an electronic device, including: a memory and a processor; This memory is configured to store computer program instructions; The processor is configured to execute the computer program instructions, causing the electronic device to implement the method as described in any of the first aspects.
[0021] This application also provides a computer-readable storage medium, including: computer program instructions; The electronic device executes the computer program instructions, causing the electronic device to perform the method as described in any of the first aspects.
[0022] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method of any one of the first aspects.
[0023] This application provides a method, device, medium, and program product for dialogue processing. The method extracts structured elements by combining the current round's input with the context of previous rounds and dynamically updates global slot information to obtain structured dialogue frames, thus fully preserving multi-round interaction states. Compared to traditional structured extraction schemes that are prone to losing context and struggle to handle long-tail expressions and semantic references, this application adapts to multi-round consultation scenarios and avoids recognition failures caused by dialogue state updates.
[0024] Furthermore, in this embodiment, the restriction information of the second user is extracted separately and a restriction condition set is formed. Then, the set of priority constraints is obtained by sorting the constraints according to the priority rules. In view of the characteristics of multi-dimensional constraint coupling and higher priority of special requirements in the vehicle-cargo adaptation scenario, high-priority constraints can be made effective first, which overcomes the defects of unstable coverage logic and poor consistency of multi-turn dialogue when unstructured additional requirements conflict with general rules in the prior art.
[0025] Furthermore, this embodiment completes pre-constraint reasoning based on preset business rules, generates a standard language material package by combining industry knowledge base, and uses the determined reasoning conclusions and standardized language as a basis before handing it over to a large language model to generate response content. Unlike end-to-end large models that rely on implicit memory rules and are prone to violating hard constraints and generating business illusions, this embodiment implements the judgment logic with rule reasoning, ensuring that the output content conforms to industry hard rules and standard business language.
[0026] Finally, this embodiment integrates structured dialogue frames, priority constraint sets, and policy information packages to construct a constraint instruction set-driven large model. This retains the advantages of reliable and compliant traditional rule-based decision conclusions while leveraging the generation capabilities of a large language model to overcome the shortcomings of pure template solutions, such as limited expression and insufficient scenario coverage. It also solves the problem that retrieval-enhanced generation schemes cannot perform deep deterministic constraint reasoning and output reliable judgment conclusions. Furthermore, this embodiment separates element extraction, constraint sorting, rule reasoning, policy matching, and content generation into independent stages, allowing business rules, constraint priorities, and policy statements to be maintained independently. This improves upon the problem of logical coupling and scale expansion that arises with the increase of business dimensions in traditional rule systems, effectively reducing the costs of system maintenance, version iteration, and regression testing. Attached Figure Description
[0027] Figure 1 A flowchart illustrating the steps of a dialogue processing method provided in this application embodiment; Figure 2 A flowchart illustrating a dialogue processing method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0028] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. It is understood that the terms “first,” “second,” etc., as used herein may be used to describe various information or data, but these elements are not limited by these terms. These terms are only used to distinguish first information from another type of information. For example, without departing from the scope of this application, first action information may be referred to as second action information, and similarly, second action information may be referred to as first action information. Both first action information and second action information are action information, but they are not the same action information.
[0030] During the operation of the vehicle-cargo matching platform and transportation capacity service system, drivers and cargo owners often initiate business inquiries through online customer service, instant messaging, voice agents, and other channels. The inquiries mainly cover scenarios such as whether the vehicle and cargo are compatible, whether the loading behavior is compliant, whether the transportation route is feasible, the configuration requirements of special equipment, and transportation risk warnings. Most of the inquiries are multi-round interactive dialogues.
[0031] Currently, mainstream consulting solutions in the industry generally adopt a technical architecture of structured information extraction, rule-based decision-making, and script templates. This type of solution first performs intent recognition and slot extraction on the user's input text, extracting key information such as vehicle model, vehicle dimensions, cargo weight, cargo category, loading / unloading methods, route restrictions, and special equipment requirements, and completing structured processing. Then, rule-based components such as rule engines, decision trees, and decision tables perform logical judgments, outputting matching conclusions such as whether the vehicle can accept the request, cannot accept the request, or needs additional information. Finally, a preset script template is invoked to generate and push the response content. With the development of large language model technology, its excellent natural language generation capabilities are gradually being applied to dialogue interaction scenarios, giving rise to various technical combinations such as end-to-end generation, retrieval-enhanced generation, and tool function calls, to optimize dialogue expression effects and expand the coverage of consulting scenarios.
[0032] However, vehicle-cargo matching and vehicle adaptation consultation are business scenarios with strong constraints, multi-dimensional coupling, and a high dependence on context. The response results need to be simultaneously constrained by multiple industry-specific rules, such as vehicle size, approved load capacity, specialized equipment, road height restrictions, hazardous materials transportation management, and additional special requirements. Furthermore, there are clear priority relationships among these constraints; for example, mandatory or prohibited requirements explicitly stated in user notes have higher priority than the system's default recommended rules. Existing technical solutions all have significant shortcomings in practical applications, failing to simultaneously ensure reasoning certainty, scenario coverage, and constraint execution stability. Specific deficiencies are as follows: While pure rule-based and template-driven solutions offer high deterministic inference results, they lack sufficient scenario coverage. They are prone to failure in complex scenarios such as long-tail user expressions, semantic references, and multi-turn dialogue state updates. Furthermore, as the dimensions of business constraints continue to increase, rule sets are prone to logical coupling and scaling issues, resulting in high costs for subsequent system maintenance, version iteration, and regression testing.
[0033] End-to-end large language model generation solutions mainly rely on prompt words or training data to implicitly memorize business rules. The model output is prone to the illusion problem of violating hard constraints and deviating from standard business terms. When high-priority unstructured information such as notes and supplementary explanations conflict with existing structured rules, the constraint coverage logic becomes unstable, and the consistency of content in multi-turn dialogues is difficult to guarantee.
[0034] The search enhancement generation solution focuses on supplementing factual data and standard wording, while the core verification work of vehicle-cargo adaptation, such as size, load, and equipment, relies on deterministic logical reasoning. Relying solely on retrieval cannot output verifiable and highly reliable judgment conclusions, making it difficult to meet the usage requirements of strongly constrained businesses.
[0035] In summary, existing technologies cannot simultaneously meet the comprehensive needs of strict enforcement of hard constraints, accurate handling of rule priorities, adaptation to complex dialogues, and traceability of conclusions in the context of vehicle-cargo consultation. Therefore, a new dialogue processing solution is urgently needed to solve the above-mentioned technical problems.
[0036] The technical solutions shown in this application will now be described in detail through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; for identical or similar content, the description will not be repeated in different embodiments.
[0037] Based on the above technical deficiencies, referring to Figure 1 This application provides a method for dialogue processing, the method comprising: S10: Extract structured elements from the current round input and the historical round context of the first user to obtain the current round extraction result, and update the global slot information based on the current round extraction result to obtain a structured dialogue frame.
[0038] This step involves extracting and integrating all information and states of the first user's interaction content: First, structured element extraction is performed on the first user's current input content and the historical context retained during the dialogue. Key business elements such as vehicle type, vehicle size, cargo parameters, transportation requirements, and route restrictions are identified and extracted to generate the current round extraction result. Then, the current round extraction result is used to incrementally update, correct, and complete the stored global slot information, integrating single-round information with multi-round historical states to finally form a structured dialogue frame that carries complete dialogue data.
[0039] Based on this, this step simultaneously processes the current input and historical context, and continuously updates the global slots, connecting scattered single-turn information into coherent overall data. It comprehensively records all business elements throughout the multi-turn consultation process, solving the problem of traditional solutions only processing single-turn content and easily losing historical dialogue states. Furthermore, relying on structured element extraction capabilities, it can parse non-standard expressions such as long-tail user expressions and semantic references, overcoming the shortcomings of traditional rule-template solutions that are prone to recognition failures when dealing with complex spoken expressions and multi-turn state updates. The structured dialogue frames have the characteristics of unified format and clear elements, stably supporting subsequent constraint extraction, constraint reasoning, and instruction construction processes, ensuring the standardization and consistency of data input throughout the entire process.
[0040] S20: Extract the restriction information input by the second user according to the preset restriction conditions to obtain the restriction condition set corresponding to the restriction information, and sort the restriction conditions in the restriction condition set according to the preset priority rules to obtain the priority constraint set.
[0041] In this step, the second user can be the cargo owner. This step processes the restriction information submitted by the cargo owner: according to preset extraction rules and restriction dimensions, various business constraint items are extracted from the restriction information provided by the cargo owner and summarized into a restriction condition set; then, according to the preset constraint priority rules, the constraint items in the restriction condition set are sorted hierarchically to distinguish the execution order of different constraints, and finally an ordered priority constraint set is generated.
[0042] This step independently extracts the cargo owner's restriction information and forms a set of restriction conditions. The special requirements and mandatory restrictions proposed by the cargo owner are stored separately from the driver's consultation information. The data is clearly divided, which facilitates subsequent unified retrieval, verification and reasoning.
[0043] Furthermore, this step prioritizes various restrictions imposed by the shipper, ensuring that high-priority requirements such as mandatory and prohibited restrictions noted by the shipper take effect first. This resolves the issues of unstable rule coverage logic and chaotic execution in existing technologies when shipper-specific restrictions conflict with general business rules. For cargo-vehicle matching scenarios, a priority constraint set is used to hierarchically manage the hard restrictions proposed by the shipper regarding loading, transportation, equipment, and routes. This prevents general rules from overriding the shipper's explicit requirements, ensuring that business execution aligns with the shipper's needs, and improving the consistency of constraint strategies across multiple rounds of dialogue.
[0044] S30: Based on preset business rules, perform constraint reasoning on the structured dialogue frame to obtain the reasoning result, and retrieve the industry knowledge base based on the reasoning result to generate a caliber material package.
[0045] In this embodiment, based on the pre-configured preset business rules related to vehicle-cargo matching and transportation capacity, deterministic constraint reasoning is performed on the aforementioned structured dialogue frames. Compliance and suitability judgments are completed by combining factors such as vehicle parameters, cargo information, and transportation requirements, and standardized reasoning results are output. Then, based on the reasoning results, a preset industry knowledge base is queried to retrieve matching standard scripts, risk warnings, business descriptions, and other content, and integrated to generate a policy material package.
[0046] Based on this, this step uses pre-set business rules as the core of judgment, replacing the implicit memory rules of large models. It performs logical verification on hard conditions such as vehicle compatibility, loading compliance, route accessibility, and equipment requirements. The reasoning results are objective and verifiable, fundamentally avoiding the defects of large language models violating industry constraints and deviating from business standards, thus avoiding illusions. Then, based on the reasoning results, the industry knowledge base is retrieved and a standard material package is generated to ensure that all external responses use platform- and industry-standard expressions, solving the problem of inconsistent responses in different conversations and rounds, and meeting the standardization requirements of language in highly regulated scenarios.
[0047] Furthermore, this step first completes deterministic constraint reasoning, and then supplements the standard content. Unlike simple retrieval which can only provide information but cannot complete logical judgment, this step can output complete materials with valid conclusions and standardized wording, which can meet the business needs of vehicle and cargo consulting.
[0048] S40. Based on the structured dialogue frame, the priority constraint set, and the caliber material package, a constraint instruction set is constructed, and the constraint instruction set is input into the large language model, which is used to generate and output response content based on the constraint instruction set.
[0049] This step involves constructing a constraint instruction set based on the obtained structured dialogue frames, the cargo owner's priority constraint set, and the standard business language package, according to the preset instruction format and organizational logic. This constraint instruction set is then input into the large language model, which strictly follows the dialogue elements, constraint rules, priority requirements, and standard business language in the instruction set to complete the natural language organization and finally generate and output the corresponding response content.
[0050] Based on this, this step simultaneously distributes the complete elements of the dialogue, the high-priority constraints of the cargo owner, and the standard business terms to the large language model, clarifies the boundaries and basis for model generation, changes the end-to-end model from relying solely on implicit memory, locks in the business logic from the input level, and avoids violating hard constraints.
[0051] By embedding cargo owner-side priority constraints within the constraint instruction set, the model-generated content ensures that it complies with cargo owner-mandated and prohibited requirements, resolving issues of logical confusion and poor consistency in multi-turn dialogues when special restrictions conflict with general rules in existing technologies. The use of a set of standardized language materials as the basis for generating the constraint instruction set guarantees that the model's output conforms to industry and platform-wide unified language standards, eliminating expression deviations and adapting to the standardized operational requirements of truck-freight service scenarios.
[0052] In this embodiment, the large language model is only responsible for language polishing and content output. It retains the advantage of reliable conclusions of rule-based solutions while leveraging the flexibility and wide scenario coverage of large models, thus making up for the shortcomings of pure template solutions in terms of limited expression.
[0053] In one alternative implementation, the structured element includes vehicle-related information; The current round input and historical round context of the first user are used to extract structured features, and the current round extraction results include: Extract vehicle-related information from the current wheel input and historical wheel context of the first user to obtain initial extraction results; The initial extraction result is processed by entity disambiguation and content normalization to obtain the current round of extraction results.
[0054] In this embodiment, the first user can be the driver. Based on the driver's current wheel input and historical wheel context, vehicle-related information (such as vehicle type, length, width, and load capacity) is extracted in a targeted manner to obtain initial extraction results.
[0055] The initial extraction results are processed for entity disambiguation and content normalization. Different expressions, numerical writings, and colloquial descriptions of the same business entity are mapped to the system standard values. For example, different forms of vehicle length descriptions such as "13-meter high rail", "13.0 meters", and "thirteen meters" are unified into standard data, and finally, standardized extraction results for the current round are generated.
[0056] Entity disambiguation can be understood as semantically distinguishing different business entities in the driver's input text and eliminating ambiguity.
[0057] For example, "heavy goods" can refer to heavy cargo or heavy trucks, and the system can determine the true meaning by combining the context; "high railing" can refer to the type of vehicle or simply describe the structure of the carriage, and the meaning of the entity can be distinguished by the context to avoid misjudgment of elements.
[0058] Content standardization involves converting expressions with the same meaning but different writing styles / formats / colloquialisms into the system's preset standard formats, values, or text to achieve data consistency.
[0059] For example, the numbers and words are unified: "thirteen meters", "13 meters", "13.0m" are all standardized to the standard value of 13 meters; Synonymous colloquialisms: "carry more" and "high load capacity" are uniformly classified as standard expressions of vehicle load elements; Abbreviations / Common Names Standardization: Industry common names and abbreviations are uniformly mapped to the system's standard field values.
[0060] Based on this, this application embodiment combines current input with historical context to extract elements and collect vehicle-related information mentioned by the driver during the consultation process, avoiding information omissions in a single round and adapting to multi-round driver consultation scenarios. It can disambiguate and normalize commonly used spoken descriptions, different numerical writing styles, and synonymous expressions, solving the problem of non-standard natural expressions and achieving data format uniformity. The standardized extraction results provide regular and consistent input data for subsequent stages such as global slot updates and constraint reasoning, reducing business judgment errors caused by differences in expression.
[0061] Furthermore, the global slot information is updated based on the current round's extraction result to obtain structured dialogue frames, including: The current round's extraction result is fused with historical slot information to update global slot information, and a structured dialogue frame is constructed based on the updated slot information.
[0062] In this embodiment, the current round extraction result of the driver end after entity disambiguation and content normalization is fused and compared with the historical slot information retained by the system to complete, correct and update the original global slot information; based on the updated global slot information, a structured dialogue frame carrying the complete current session state is constructed.
[0063] Simultaneously, referencing the minimum information set required for the business, each key field in the slot is verified to identify missing business elements, and a list of fields to be further questioned is generated accordingly. Using the minimum information set required for the normal operation of the vehicle-cargo adaptation consulting business as the verification benchmark, each updated global slot key field is checked and compared; missing business elements that have not yet been collected in the current session and cannot support subsequent constraint reasoning and business judgment are identified, and a standardized list of fields to be further questioned is compiled. This list clearly marks the specific information items that need to be supplemented, serving as the basis for the system to initiate multiple rounds of inquiries.
[0064] Based on the above description, this application embodiment integrates and updates the current round's extraction results with historical slots, continuously recording vehicle, cargo, and transportation-related information across multiple rounds of dialogue. This avoids fragmented information from a single round and loss of historical data, ensuring that the structured dialogue frames fully reflect the entire conversation state. Furthermore, iterating historical slots using the latest extraction results can correct erroneous information from earlier periods and supplement new content, allowing slot data to match drivers' actual inquiry needs in real time. The unified format of the structured dialogue frames provides standardized input for subsequent constraint extraction, rule reasoning, and instruction construction, reducing business judgment errors caused by data anomalies.
[0065] Optionally, the restriction information may include remarks, additional explanations, and relevant industry knowledge; The preset restrictions include vehicle equipment restrictions, vehicle travel route restrictions, vehicle temperature control restrictions, loading and unloading time restrictions, and auxiliary equipment restrictions. The restriction information input by the second user is extracted according to preset restriction conditions, resulting in a set of restriction conditions corresponding to the restriction information, including: The remarks, additional explanations, and relevant industry knowledge input by the second user are extracted according to the vehicle equipment restrictions, vehicle route restrictions, vehicle temperature control restrictions, loading and unloading time restrictions, and auxiliary equipment restrictions to obtain a set of restrictions corresponding to the restriction information.
[0066] In this embodiment, the restriction information input by the cargo owner includes remarks, additional instructions, and industry-related knowledge. The system extracts the content of the restriction information input by the second user according to preset restriction conditions: vehicle equipment restrictions, vehicle route restrictions, vehicle temperature control restrictions, loading and unloading time restrictions, and auxiliary equipment restrictions. Specifically, it extracts corresponding constraint content from the cargo owner's remarks, supplementary instructions, and implicit requirements of industry knowledge. For example, it requires vehicles to be equipped with tailgates, prohibits passage on highways, requires refrigerated temperature control throughout the journey, requires the vehicle to carry straps, and only allows loading and unloading of goods at night. All extracted constraint items are summarized and integrated to form a complete set of restriction conditions.
[0067] Based on this, the embodiments of this application take into account the remarks actively filled in by the cargo owner, subsequent supplementary explanations, and implicit conditions of industry knowledge, and fully extract various restrictive requirements put forward by the cargo owner. Targeted extraction is performed based on dimensions such as vehicle equipment, routes, temperature control, loading and unloading times, and auxiliary equipment. The constraint items are clearly categorized, facilitating subsequent unified management, prioritization, and rule reasoning. It can effectively extract personalized and customized restrictive conditions put forward by the cargo owner, making up for the inadequacy of general business rules in covering special needs, and adapting to diverse customized freight requirements.
[0068] According to the preset priority rules, the constraints in this set of constraints are sorted by priority, resulting in a set of priority constraints including: Identify the constraint modes and strengths of each constraint in the constraint set from the remarks and additional description information, and sort each constraint according to the preset priority rules and the constraint modes and strengths of each constraint to obtain the priority constraint set.
[0069] In this embodiment, a priority sorting process is performed on the set of constraints formed by the cargo owner. First, the constraint modality and constraint strength corresponding to each constraint are identified from the cargo owner's remarks and additional description information, specifically divided into four categories: mandatory, prohibited, preferred, and optional. Simultaneously, the business dimensions covered by each constraint are determined, including vehicle size, vehicle type, equipment, driving route, loading compliance, etc., and corresponding priority labels are matched for different constraint dimensions and constraints. Then, based on preset priority rules, and combining constraint modality, strength, coverage dimensions, and priority labels, all constraints in the constraint set are uniformly sorted, ultimately generating an ordered set of priority constraints.
[0070] Among them, constraint modalities are classifications of the nature and enforceability of various restrictions and requirements proposed by cargo owners. They are used to distinguish the rigidity of different demands and serve as the basis for determining constraint priority and handling rule conflicts. These can include: mandatory, which is a strong rigid constraint, a hard prerequisite; if it is not met, the business cannot be completed. Examples: vehicles must be equipped with refrigeration units; loading and unloading must be done at night.
[0071] Prohibitions are strong, rigid constraints that explicitly prohibit specific behaviors or conditions; violations constitute non-compliance. Examples include: prohibiting entry onto highways and prohibiting unloading cargo mid-journey.
[0072] Preferences are a type of flexible constraint, only providing a priority recommendation. If a matching option exists, it is prioritized; otherwise, the preference can be relaxed. For example: prioritize using high-sided trucks and load trucks during the daytime whenever possible.
[0073] This is an optional, weak constraint, and only serves as an additional reference. Its presence or absence does not affect core business decisions. Examples: A waterproof tarpaulin can be carried in the vehicle; the driver can assist with simple handling.
[0074] The strength of the constraint modes includes highest, second highest, medium, and lowest. The strength ranking is: mandatory > prohibited > preferred > optional.
[0075] When different constraints conflict, the stronger constraint overrides the weaker one. For example, if a cargo owner requires that the national highway must be used (high) and prefers large vehicles (medium), and large vehicles cannot use the national highway, then the stronger constraint requiring the national highway to be used takes precedence.
[0076] Based on the above description, by identifying constraint modes such as mandatory, prohibited, preferred, and optional, the strength of constraints can be quantified, the execution rigidity of different requirements can be clarified, and hard mandatory requirements and flexible reference requirements can be distinguished, thus providing a basis for differentiated management and control.
[0077] The prioritized constraint set, after sorting, clarifies the order of constraint execution. When conflicts arise between the shipper's specific requirements and general business rules or different restrictions, the logic of higher-priority constraints overriding lower-priority constraints can be automatically executed, resolving the issues of chaotic constraint coverage and unstable execution in traditional solutions. Clearly defined mandatory and prohibited constraints by the shipper are designated as high-priority and take effect first in subsequent constraint reasoning and instruction generation stages, ensuring strict enforcement of the shipper's rigid requirements and improving the accuracy of business matching.
[0078] In one optional implementation, the structured dialogue frame is subjected to constraint reasoning based on preset business rules, and the reasoning result includes: Obtain the pre-configured minimum set of target information; If the structured dialogue frame satisfies all fields of the target minimum information set, then constraint reasoning is performed on the structured dialogue frame based on the preset business rules to obtain the reasoning result; If the structured dialogue frame lacks a key field in the target's minimum information set, a follow-up questioning strategy is generated based on the missing key field; wherein, the follow-up questioning strategy is used to ask follow-up questions to the first user; Based on this follow-up questioning strategy, obtain the follow-up questioning results returned by the first user; The result of the follow-up question is merged into the structured dialogue frame to obtain the merged structured dialogue frame. Based on the preset business rules, constraint reasoning is performed on the merged structured dialogue frame to obtain the reasoning result.
[0079] In this embodiment of the application, firstly, the system retrieves the pre-configured minimum information set of business objectives. This information set is the collection of core key fields required for vehicle-cargo matching constraint reasoning and is the minimum data standard for effective business decision-making.
[0080] Secondly, the system performs a full-field comparison and verification between the currently constructed structured dialogue frame and the target minimum information set, executing the logic in two branches: The first scenario, with complete fields: If the structured dialogue frame fully contains all the key fields of the target minimum information set, and the data conditions meet the business reasoning requirements, the system directly calls the preset business rule assets, including decision tables, decision graphs, rule configurations, and DSL rule expressions. An external decision engine then performs routine constraint reasoning on all structured elements in the structured dialogue frame, such as vehicle attributes, cargo attributes, and transportation requirements. The final output is a standardized reasoning result, covering deterministic business data such as constraint satisfaction conclusions, corresponding reason codes, and key risk warnings.
[0081] The second scenario involves missing fields: If a structured dialogue frame lacks any key field from the minimum target information set, making it impossible to support complete and accurate business reasoning, the system immediately generates a targeted follow-up questioning strategy based on the identified missing key field. This follow-up questioning strategy is specifically designed to initiate precise information queries to the first user (driver) to fill the data gap.
[0082] Subsequently, based on the generated follow-up questioning strategy, the system completes the interaction with the driver's end and obtains the follow-up questioning results from the driver. This supplementary follow-up questioning result is then incrementally merged into the original structured dialogue frame to update and improve the dialogue data, forming a fused, complete structured dialogue frame.
[0083] Finally, for the integrated structured dialogue frames with complete and compliant data, routine constraint reasoning is performed again based on the decision engine and preset business rule assets, ultimately outputting compliant and complete deterministic reasoning results.
[0084] Based on the above description, this application embodiment uses a preset minimum information set of business objectives as a foundation to distinguish between inference-possible and inference-incompatible scenarios. This avoids blindly conducting constrained reasoning when key business data is missing, eliminating reasoning bias and invalid conclusions caused by incomplete data from the source. It ensures that every business reasoning has a complete data foundation, improving the accuracy and reliability of the reasoning results. For scenarios with missing key fields, it can automatically generate follow-up questioning strategies based on the missing items, accurately supplementing the driver's end with the necessary information, replacing the traditional manual prediction and blind inquiry mode. This avoids invalid interactions, improves dialogue interaction efficiency, dynamically fills in dialogue slot information, perfects structured dialogue frame data, and achieves a closed loop for multi-round dialogue information collection, adapting to complex multi-round consultation scenarios on the driver's end.
[0085] Furthermore, this application's embodiment employs a two-branch logic—direct inference with complete fields and inference after filling in missing fields—covering all dialogue scenarios with both complete and missing data. This ensures rapid output of inference results and improved response efficiency when data is sufficient, while also guaranteeing inference quality through a completion mechanism when data is missing, thus balancing system response efficiency and business accuracy.
[0086] Furthermore, based on this reasoning result, the industry knowledge base is retrieved to generate a package of relevant information, including: Extract the corresponding business reason code from the reasoning result, and use the business reason code as the search keyword to traverse the industry knowledge base to obtain the corresponding business script template set; wherein, the business reason code includes at least one of the following: information missing type code, vehicle and cargo mismatch type code, compliance and violation type code, and constraint conflict type code; Based on the preset business template rules, expired templates in the business script template set are removed to obtain the corresponding material package; the material package includes explanatory sentences, follow-up question sentences, risk warning sentences, and alternative suggestion sentences.
[0087] In this embodiment, the system first extracts the corresponding business reason code from the reasoning results obtained from the aforementioned constraint reasoning. The business reason code is a systematic classification code, including at least four categories: information missing type code, vehicle-cargo mismatch type code, compliance / violation type code, and constraint conflict type code. These codes uniquely identify the type of business problem and the type of reasoning conclusion corresponding to this reasoning.
[0088] Secondly, the system uses the extracted business reason codes as search keywords, traverses the pre-built industry knowledge base, batch matches and retrieves all standard script resources corresponding to the current reasoning scenario, and summarizes them into a corresponding business script template set. The template resources cover a variety of script materials, including standard business statements, explanation templates, information follow-up templates, compliance judgment templates, and optimization suggestion templates.
[0089] Furthermore, the system filters the acquired business script template set according to the preset business template version rules, automatically removing expired, obsolete, and old version historical templates, and retaining only valid script templates that are consistent with the current business version and platform rules, thus preventing outdated or invalid scripts from being mixed into the output content.
[0090] Finally, the selected effective templates are integrated and packaged to generate a structured content package. This package uniformly includes four types of standard sentence structures: explanatory sentences, follow-up question sentences, risk warning sentences, and alternative suggestion sentences, providing standardized material support for the subsequent generation of compliant, unified, and complete response content for the large model.
[0091] Based on the above description, this application uses business reason codes as search criteria. Through refined classification coding of missing information, vehicle-cargo mismatch, compliance violations, and constraint conflicts, it can accurately locate the standard script system corresponding to the current business problem. This avoids the problems of ambiguous semantic matching, incorrect template retrieval, and irrelevant answers in traditional solutions, achieving strong binding and high matching between reasoning results and output statements. Furthermore, through business version verification and expired template removal mechanisms, it automatically filters out old and invalid scripts, always matching the latest industry rules and platform business standards. This completely solves the industry pain points of mixed multi-version scripts, inconsistent old and new statements, and non-standard responses, ensuring that the platform's external responses are consistent and effective in real time.
[0092] The protocol material package generated in this application integrates four types of sentence structures: explanation, follow-up question, risk warning, and alternative suggestion. It can simultaneously meet diverse response scenarios such as problem description, information completion, risk warning, and optimization recommendation, covering the complete dialogue needs of driver inquiries, problem judgment, compliance reminders, and solution suggestions. The scenario coverage is far greater than that of a single template output solution. This allows the large model to no longer rely on its own random wording to generate responses, but instead uses a structured, standardized, and version-verified protocol material package as the basis for generation. This effectively limits the model's room for free expression and avoids problems such as arbitrary expression, messy speech, deviation in protocol, and illegal wording, significantly improving the professionalism, compliance, and standardization of customer service responses.
[0093] In an optional implementation, constructing the constraint instruction set based on the structured dialogue frame, the priority constraint set, and the caliber material package includes: Based on the structured dialogue frame, the priority constraint set, and the caliber material package, construct a constraint instruction set; Based on the preset instruction division rules, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction to obtain a divided constraint instruction set, and the divided constraint instruction set is used as the constraint instruction set; wherein, the first constraint instruction is a non-adjustable instruction, and the second constraint instruction is an adjustable instruction.
[0094] In this embodiment, the system first performs unified assembly and fusion of multi-source structured data, and organizes and integrates the structured dialogue frames, priority constraint sets, dimensional decision reasoning results, and standardized caliber material packages output by the pre-process. It then generates a complete constraint instruction set that can be recognized and executed by a large model according to the preset instruction assembly logic, so that the instruction set can simultaneously carry the complete session state, cargo owner priority constraint rules, business decision conclusions, and standardized response script resources.
[0095] Secondly, the system classifies all instructions in the constraint instruction set hierarchically according to the preset instruction classification rules, dividing all constraint instructions into first constraint instructions (non-adjustable hard constraint instructions) and second constraint instructions (adjustable soft constraint instructions), forming a hierarchical constraint instruction set after classification.
[0096] The first constraint is a rigid, inviolable constraint, including business constraints that cannot be changed and must be strictly enforced, such as vehicle size restrictions, load limits, required equipment, and compliance prohibitions. The second constraint is a flexible, adaptable constraint, including reference constraints that can be flexibly adjusted according to the actual scenario, such as cargo owner preference conditions, capacity recommendation suggestions, and dialogue topic guidance.
[0097] Finally, based on the completion of the soft and hard constraint layering, standardized response strategy points are uniformly injected into the constraint instruction set, including dialogue control strategies such as directly outputting conclusions, asking follow-up questions to fill in missing information, correcting and clarifying content deviations, and prioritizing confirmation of cargo owner remarks. This ultimately forms a complete constraint instruction set that combines rule rigidity, scenario flexibility, and dialogue controllability, which is used to drive the large language model to generate standardized response content.
[0098] Based on the above description, the embodiments of this application integrate structured dialogue frames, high-priority constraint sets, decision reasoning results, and standard language material packages, so that the instruction set simultaneously possesses full conversation information, strong constraints on cargo owners, business judgment conclusions, and standard language material, solving the problems of fragmented and missing dimensions in traditional instruction information, and providing a complete, unified, and practical basis for generating large models.
[0099] Furthermore, by distinguishing between unadjustable hard constraints and adjustable soft constraints, the model generation boundaries are clearly defined: hard compliance, size, load, equipment, and prohibition rules are absolutely inviolable, while preference and suggestion conditions can be flexibly adapted. This effectively solves the problem of large models not distinguishing between the strength of constraints, arbitrarily breaking through hard business rules, or becoming overly rigid, resulting in stiff interactions.
[0100] Furthermore, by injecting direct conclusions, asking follow-up questions to complete the dialogue, correcting deviations and clarifying errors, and prioritizing confirmation of remarks, the dialogue behavior of the large model is explicitly controlled. This prevents the model from randomly generating dialogue logic and instead executes response patterns according to pre-set business strategies, significantly improving the logical consistency, standardization, and business relevance of the dialogue. Constraint grading, strategy binding, and pre-setting of standards are completed before inputting the model, locking in the generation standard from the Prompt source. This avoids issues such as the model violating compliance regulations, ignoring the shipper's stringent requirements, confusing response logic, and non-standard wording, significantly improving the security and accuracy of the output results.
[0101] Optionally, based on a preset instruction partitioning rule, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction, resulting in a partitioned constraint instruction set including: Based on the preset instruction partitioning rules, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction, and a preset response strategy is injected into the constraint instruction set to obtain the partitioned constraint instruction set.
[0102] In this embodiment, after the initial construction of the constraint instruction set is completed, the system performs hierarchical classification of all constraint instructions in the constraint instruction set according to preset instruction classification rules, dividing each constraint instruction into a first constraint instruction or a second constraint instruction. The first constraint instruction is a non-adjustable hard constraint instruction, while the second constraint instruction is an adjustable flexible constraint instruction. Simultaneously, the system batch-injects preset standardized response strategies into the hierarchically classified constraint instruction set, ultimately obtaining a fully classified constraint instruction set with clear hierarchical levels and accompanying dialogue control strategies. This provides precise instruction basis for the standardized and normalized response generation of large language models.
[0103] Based on this, the embodiments of this application proactively inject preset response strategies to pre-bind standardized business dialogue logic to the constraint instruction set, replacing the large model's autonomous random decision-making dialogue mode, unifying the model's response methods, interaction logic, and processing strategies, and achieving consistency and standardization of response logic in multi-turn dialogue scenarios.
[0104] In one alternative implementation, the large language model is specifically used for: If the constraint instruction set satisfies the preset deterministic conditions and the preset constraint conditions, a response content is generated according to each of the first constraint instructions; If the constraint instruction set does not meet the preset deterministic condition, generate and output minimal inquiry information carrying the reason for the inquiry; If the constraint instruction set does not meet the preset constraint conditions, generate and output clarification and follow-up information; The method also includes: The minimum follow-up question or the clarification follow-up question is pushed to the first user, and additional information in response to the first user in response to the minimum follow-up question or the clarification follow-up question is obtained; The additional information is incorporated into the first user's current round input, and the corresponding structured dialogue frame is updated.
[0105] The preset deterministic conditions refer to the completeness requirements of the core information needed to conduct business judgments and generate formal responses. These are the prerequisite data standards for the system to reach a unique and definite conclusion. If all key fields and basic business data within the structured dialogue frame and constraint instruction set are complete and without omissions, the condition is deemed met; otherwise, it is deemed not met. The preset deterministic conditions primarily verify whether the minimum information set fields of the business objective defined above are complete, covering essential elements such as vehicle attributes, cargo attributes, and transportation requirements.
[0106] For example, the preset deterministic conditions are met: all key fields such as vehicle model, vehicle length, load, cargo type, and loading / unloading requirements have been fully collected, and the data is sufficient to directly determine the result.
[0107] The preset deterministic conditions are not met: key fields such as vehicle length, load, and loading / unloading time are missing, making it impossible to draw a unique conclusion and triggering the minimum follow-up information.
[0108] The preset constraints are compliance requirements where all business constraint rules are compatible and conflict-free. These constraints are used to verify whether multiple constraints conflict with each other or with general business rules. If all constraint instructions (hard constraints, soft constraints, cargo owner priority constraints, and platform general rules) are compatible and conflict-free, the condition is considered met; otherwise, if there are conflicting rules, contradictory requirements, or ambiguous constraint definitions, the condition is considered not met. The verification scope includes: restrictions on vehicles and equipment, routes, temperature control, loading and unloading times, auxiliary equipment, etc., as well as the logical relationships between various constraint modalities such as mandatory / prohibited / preferred / optional.
[0109] For example: satisfying the preset constraints: the cargo owner requires "refrigerated trucks must be used" and "loading and unloading must be done during the day". The vehicle conditions match both requirements, and there is no conflict between the rules.
[0110] The pre-set constraints are not met: the cargo owner simultaneously proposes "must take the highway" and "vehicle type is a height-restricted flatbed truck (prohibited on local highways)," the two constraints are contradictory; or some additional requirements are vaguely stated or unclearly defined, triggering clarification and follow-up inquiries.
[0111] In this embodiment of the application, firstly, it is verified whether the constraint instruction set simultaneously satisfies the preset deterministic condition and the preset constraint condition: If both conditions are met, it means that the business information is complete and there are no conflicts in the constraints. The large language model strictly follows the boundary of the first constraint instruction (a hard constraint that cannot be adjusted) and generates a complete response that includes business conclusions, reasons, prompts and suggestions.
[0112] If the constraint instruction set does not meet the preset deterministic conditions, i.e. key information is missing and a deterministic business judgment cannot be formed, the model generates minimal follow-up information with reasons for follow-up questions and outputs it externally, collecting only necessary content to simplify the interaction rounds.
[0113] If the constraint instruction set does not meet the preset constraint conditions, such as conflicting constraint rules or unclear definition of special requirements, the model generates clarification and follow-up information; if an adaptation solution can be provided, alternative suggestions are output simultaneously with corresponding annotations.
[0114] Then, the minimum follow-up information or clarification follow-up information output by the model is pushed to the first user (driver's end), and additional information is received from the user's feedback.
[0115] The collected additional information is incorporated into the first user's current input, and the global data is updated synchronously to complete the iterative refresh of the structured dialogue frames, providing complete data support for the next round of reasoning and response processing.
[0116] Based on the above description, the embodiments of this application can distinguish between three scenarios: normal response, follow-up questioning due to missing information, and clarification of constraint conflicts. They cover various working conditions such as complete data, insufficient information, and rule conflicts, forming a complete business processing chain with comprehensive scenario adaptability. In the normal response scenario, the first constraint instruction serves as the bottom line, ensuring that all output content does not violate hard business rules, effectively avoiding issues such as non-compliant responses and rule deviations, and guaranteeing consistent business execution standards. When information is missing, only the minimum necessary follow-up questions are output, along with explanations, avoiding meaningless and general questions, effectively reducing dialogue rounds, and improving user interaction experience and information collection efficiency. For constraint conflict scenarios, rule coverage and fusion are prioritized based on priority; for ambiguous content, clarification follow-up questions are initiated, and alternative suggestions and supporting evidence are output simultaneously when feasible solutions exist, adhering to constraint priority rules while proactively providing feasible guidance to users. Furthermore, user-supplemented additional information is integrated in real time and the structured dialogue frames are updated, fully retaining multi-round interaction data to ensure that each round of business processing is based on the latest and most complete session state, continuously improving the accuracy of subsequent reasoning and responses.
[0117] In one alternative implementation, the method further includes: Perform preset constraint satisfaction checks, preset field consistency checks, and preset content compliance checks on the response content; If the response content passes verification, a reply result will be output to the first user; If the response content fails to be verified, the response content is regenerated according to the reason for the failure, and the regenerated response content is verified until the response content passes the verification or the preset fallback termination condition is triggered.
[0118] In this embodiment, the response content generated by the model is validated, including preset constraint satisfaction validation, field consistency validation, and content compliance validation. Constraint satisfaction validation verifies whether the response content fully complies with hard constraint instructions and priority constraint rules, and does not contain any statements that violate the cargo owner's hard requirements or platform business rules. Field consistency validation verifies that structured field information such as vehicle parameters, cargo parameters, and transportation requirements in the response content is consistent with the current structured dialogue frame data, and that there are no issues of tampering, mismatch, or inconsistencies. Content compliance validation checks whether the response wording, judgment conclusions, and risk warning content comply with platform specifications and industry compliance requirements, and that there are no illegal, misleading, or non-compliant statements.
[0119] Then, based on the verification results, the output logic is executed: if all the response content passes the verification, it means that the content meets the constraint rules, the fields are accurate, and the wording is compliant. The system directly organizes the response content into the final reply result and pushes it to the first user.
[0120] If the response content verification fails, the system will regenerate the corrected response content based on the specific reason for the failure, and restart the verification process for the regenerated response content. The system continues to iterate and correct, and perform loop verification until the response content passes full verification, or the process exits the loop after triggering a preset fallback termination condition, forming a fully automatic closed-loop repair mechanism.
[0121] Based on the above description, this application embodiment completes comprehensive verification from three dimensions: business rule rigidity, structured data accuracy, and external communication compliance, through constraint satisfaction, field consistency, and content compliance checks. This comprehensively intercepts various output defects such as model illusion, rule violation, data mismatch, and communication violations, significantly improving the accuracy and reliability of the final response content.
[0122] The constraint satisfaction check verifies whether the response conforms to high-priority hard constraints. This can avoid problems such as large models arbitrarily relaxing the necessary conditions for cargo owners, ignoring prohibited constraints, and reversing constraint priorities. It safeguards the bottom line of business decisions from the output layer and ensures that core freight constraints are not covered by the model's free play.
[0123] Field consistency checks force the response content to be fully aligned with the structured dialogue frame data, effectively avoiding problems such as parameter confusion, inconsistencies in information, and misattribution in multi-round dialogues, ensuring logical coherence, data consistency, and credible conclusions throughout the consultation dialogue.
[0124] For content that fails validation, the system can automatically iterate and rewrite based on the reason for the failure, forming a closed-loop mechanism of generation, validation, repair, and re-validation. This eliminates the need for manual intervention, significantly reducing the probability of model error output and enhancing the system's autonomy. Furthermore, by configuring preset fallback termination conditions, the system can avoid the abnormal state of infinite validation loops in extreme scenarios, ensuring output quality while maintaining system stability and process control, thus balancing output accuracy and service stability.
[0125] Optionally, the response content can be any one of the following types: standard response, supplementary inquiry response, risk disclosure response, alternative suggestion response, or fallback response.
[0126] In this application embodiment, the specific applicable scenarios for each response type are defined as follows: Standard Response: Applicable to normal scenarios where the structured dialogue frame information is complete, constraints are conflict-free, and all business judgment conditions are met. The response content includes a clear vehicle-cargo matching conclusion, the reason for the judgment, business prompts, and compliance explanations, providing a complete and directly actionable business response.
[0127] Supplementary query response: Applicable to scenarios where key fields in the conversation are missing, preset deterministic conditions are not met, and complete business reasoning cannot be completed. The response content carries clear information about the missing fields and the reasons for follow-up questions, supplementing the driver with necessary information in the fewest query rounds to complete the data.
[0128] Risk notification and response: Applicable to scenarios where there are compliance flaws, critical conditions, or potential transportation risks in vehicle-cargo matching. The response should highlight the existing business risks, compliance precautions, and constraints, providing users with risk warnings and compliance information.
[0129] Alternative suggestion response: Applicable to scenarios where the original constraints cannot be met, or where there are conflicts between constraints but suitable alternatives exist. The response explains the reasons for the mismatch in the original conditions and provides compliant and feasible alternative transportation solutions, adaptation suggestions, and corresponding justifications, offering users actionable optimization directions.
[0130] Fallback response: Applicable to extreme and abnormal scenarios, including multiple iterations of verification failure, rule matching anomalies, and special boundary issues that prevent conventional reasoning. Standardized fallback statements ensure compliant response output, avoiding interruptions, no response, or abnormal error messages.
[0131] Based on the above description, this application's embodiments define five standardized response types, fully covering all business scenarios including normal responses, information completion, risk warnings, solution alternatives, and fallback responses. This eliminates blind spots in dialogue scenarios and standardizes and systematizes the entire process of freight consultation response logic. Furthermore, fallback responses address special cases such as extreme boundaries, iteration failures, and rule anomalies, preventing issues like no system output, dialogue freezes, and logic errors, ensuring the continuous and smooth operation of the dialogue chain and significantly improving system stability. Moreover, when the user's original needs cannot be met, feasible solutions are provided through alternative suggestion responses; precise inquiries are made when information is insufficient; and proactive warnings are issued when risks exist. This breaks away from the traditional system's single interaction mode of merely judging right or wrong, optimizing the user experience while adhering to business rules.
[0132] In an alternative implementation, prior to the structured feature extraction of the first user's current round input and historical round context, the method further includes: Receive the current round input and historical round context of the first user, the restriction information of the second user's input, and related structured fields; The target session object is obtained by encapsulating the current round input and historical round context of the first user, the restriction information of the second user's input, and the relevant structured fields. The target session object is then subjected to error correction and normalization processing to obtain the processed session object; Based on the processed session object, intent recognition and scene recognition are performed to obtain the target intent and target scene; Based on the target intent and the target scenario, determine the target processing chain; The structured feature extraction of the first user's current input and historical context includes: Under this target processing link, structured elements are extracted from the current round input and historical round context of the first user; The restriction information extracted from the second user input according to preset restriction conditions includes: Under this target processing link, the restriction information input by the second user is extracted according to preset restriction conditions; The constraint reasoning based on preset business rules for this structured dialogue frame includes: Under this target processing link, constraint reasoning is performed on the structured dialogue frame based on the preset business rules.
[0133] In this embodiment, firstly, all input data sources for this round are received uniformly, including the current round input text of the first user, the dialogue context of the previous round, various restriction information submitted by the second user, and the relevant original structured fields synchronously transmitted from the business side, to complete the collection and access of full-dimensional conversation data and ensure that the input materials for this round of calculation are complete and have complete sources.
[0134] Secondly, all received data undergoes unified encapsulation processing. Current round user messages, historical multi-round dialogue contexts, and session metadata (session time, interaction channel, user role, order identifier, route identifier, etc.) are integrated and packaged to construct a standardized target session object. This session object encapsulation clarifies the input data boundaries for a single-round task, converging fragmented and multi-sourced scattered data into a unified structured carrier, providing standard input for subsequent unified processing.
[0135] Next, error correction and standardization preprocessing is performed on the target session object to obtain the processed session object. Specifically, this includes automatically correcting and standardizing user colloquial expressions, typos, irregular text, mixed units, and inconsistent number formats, unifying units of measurement and numerical expressions, such as unifying meters and centimeters as units of length, and tons and kilograms as units of weight; at the same time, information with obvious missing fields, contradictory expressions, or semantic ambiguity is automatically marked as pending clarification, thus achieving the cleaning, correction, and standardization of input data.
[0136] Subsequently, based on the preprocessed session objects, intent recognition and scenario recognition are performed to analyze the user's true business intent and associated business scenario in this round of interaction, outputting the target intent and target scenario results. Based on the identified target intent and target scenario, the target processing link corresponding to the current session is matched and determined, realizing task routing. For business requests such as vehicle-cargo matching and vehicle adaptation consultation, they enter the corresponding processing link; for non-business requests such as casual conversation, complaints, and platform rule consultations, they are distributed to the corresponding subsystem or fallback processing link, achieving task classification and diversion.
[0137] Finally, all subsequent business steps are bound to the target processing link for execution, achieving link-isolated computation: under the control of the target processing link, the structured element extraction of the first user's content is completed, the dimensional constraint extraction of the second user's restriction information is completed, and the structured dialogue frame constraint reasoning based on preset business rules is completed.
[0138] Specifically, the structured element extraction step for the first user is bound to the target processing link for execution. Within the scope of the currently matched dedicated target processing link, the system performs standardized structured element extraction on the current round input content and historical round context information of the first user, completing the accurate extraction of core business fields such as vehicle attributes, cargo attributes, and transportation requirements, and eliminating cross-link data interference.
[0139] The process of extracting the second user's constraint information is bound to the target processing link for execution. Under the rule system and processing boundaries of the same target processing link, the system performs targeted extraction of constraint information such as remarks, additional instructions, and industry implicit knowledge input by the second user according to various preset constraint conditions, generating a constraint condition set corresponding to the link, ensuring that the constraint extraction logic is fully matched with the current business scenario.
[0140] The system binds the constraint reasoning steps of the structured dialogue frames to the target processing link for execution. Relying on the exclusive preset business rule system corresponding to the current target processing link, the system performs standardized constraint reasoning operations on the updated structured dialogue frames, outputs compliant reasoning results that match the scenario, and ensures that the reasoning rules, judgment criteria, and business boundaries are fully adapted to the current conversation scenario.
[0141] By using the above-mentioned link binding method, all business logic of element extraction, constraint extraction, and constraint inference is completed in a closed loop under the same set of scenario links, the same set of business rules, and the same processing boundary, achieving consistency of scenario throughout the entire process, uniformity of rules, and independence of operation.
[0142] Reference Figure 2 The following describes the above-mentioned dialogue processing method with a specific implementation method.
[0143] The method includes: After users enter the system with their input (driver / shipper's inquiry text, order notes, and historical conversations), the system first undergoes session access and preprocessing: Data encapsulation: Pack text, structured fields (vehicle type, load capacity, cargo type), and session metadata (order number, channel, role) into standardized session objects.
[0144] Error correction and standardization: Automatically corrects colloquialisms, typos, and mixed units (e.g., 13-meter semi-trailer and 13-meter truck are standardized to the standard field).
[0145] Intent / Scene Recognition: Determine whether a user request belongs to the vehicle-cargo matching business.
[0146] Non-matching requests (such as complaints, casual chat, and rule inquiries): are directly routed to other subsystems for processing.
[0147] Matching requests: Enter the core business process.
[0148] Semantic understanding and dialogue state tracking: Parse the structured elements in the dialogue (vehicle attributes, cargo attributes, transportation requirements), update global slot information, and form a structured dialogue frame (a snapshot of the current session state).
[0149] Unconventional information extraction and priority labeling: Extract constraints (such as "must have tailgate" and "cannot take highway") from cargo owner remarks, additional instructions and industry tacit knowledge, and divide the strength according to constraint mode (must / prohibited / preference / optional) to generate priority constraint set.
[0150] The system verifies whether the structured dialogue frames meet the minimum information set required for the business: Information is missing (Yes): Trigger "branch-based follow-up question", generate follow-up questions with the minimum necessary information (such as "What are the length and load capacity of your vehicle?"), and explain the reason for the follow-up question to reduce the number of interaction rounds.
[0151] Complete information (No): Proceed to the core decision-making stage.
[0152] The constraint reasoning performed by the external decision engine is the "business brain" of the entire process: Input: Structured dialogue frame, high-priority constraint set.
[0153] Output: Reasoning results, including constraint satisfaction conclusions, reason codes, risk warnings, and conflict determinations.
[0154] Key verification: Determine if there are any high-priority constraint conflicts. Conflict exists (Yes): Triggers a conflict resolution branch, outputting a clarifying follow-up question or alternative solution (e.g., "You requested 'must take the highway' but your vehicle type cannot access the highway, would you like to adjust the route?").
[0155] No conflict (No): Proceed to the next step.
[0156] Using the business reason code of the reasoning result as an index, search the industry knowledge base to obtain the corresponding standard script template: Template types: Explanatory, follow-up question, risk warning, and alternative suggestion sentence structures.
[0157] Version filtering: Remove expired / old version templates to ensure that the wording is consistent with the current business rules and to create a wording material package.
[0158] Integrate structured dialogue frames, high-priority constraint sets, and caliber material packages to construct a constraint instruction set: Instructions are stratified into non-adjustable hard constraints (such as load limits and compliance requirements) and adjustable soft constraints (such as preferred vehicle models and recommendations).
[0159] Strategy injection: Bind response strategies (such as direct conclusions, follow-up questions to complete the analysis, and correction and clarification) to define the generation boundaries of the large model.
[0160] The Large Model (LLM) receives a set of constraint instructions and generates a draft response within the hard constraint boundaries, ensuring that the content conforms to business rules while also maintaining natural and fluent expression.
[0161] The draft response enters the output verifier, where triple validation is performed: Constraint satisfaction check: whether hard constraints are broken or priority rules are violated.
[0162] Field consistency check: Whether the content is consistent with the data in the structured dialog frame.
[0163] Content compliance verification: Whether the wording complies with platform guidelines and industry compliance requirements.
[0164] Verification passed: Proceed directly to the final output stage.
[0165] Verification failure: Triggers closed-loop repair and fallback controller, prioritizes automatic repair and rewriting, if the number of repair failures exceeds the limit, it will enter manual review or downgrade fallback to avoid illegal output.
[0166] The final response delivered to the user is categorized into standard responses, supplementary inquiry responses, risk disclosure responses, alternative suggestion responses, and fallback responses, depending on the scenario.
[0167] Log auditing and monitoring: Records session data, inference results, and verification logs throughout the entire process for problem backtracking and business optimization.
[0168] The following is a complete description of how the system handles a vehicle-cargo matching dialogue using a business scenario.
[0169] The shipper entered: "I have a batch of ice cream that needs to be transported from point A to point B. Loading will be done tomorrow. Refrigerated trucks are required, and those that can travel on highways are preferred. The interior height of the truck bed must be no less than 2.2 meters. In addition, the truck driver must bring straps." The driver typed: "I have a 4.2-meter blue-plate refrigerated truck with a load capacity of 4.5 tons and a height of 2.3 meters. It has straps. I'm available tomorrow." System preprocessing: Encapsulate the session object, correct the unit description, identify it as a "vehicle-cargo matching" business request, and enter the core link.
[0170] Structured dialogue frames: Shipper's side: Cargo type = ice cream (refrigerated), origin = location A, destination = location B, loading time = tomorrow, temperature control requirements = refrigerated, route preference = priority highway, interior height of the carriage ≥ 2.2 meters, auxiliary equipment = with straps.
[0171] Driver's side: Vehicle type = 4.2-meter blue-plate refrigerated truck, load capacity = 4.5 tons, vehicle height = 2.3 meters, equipment = with straps, available time = tomorrow.
[0172] Unconventional information extraction and prioritization: Must (high priority): Refrigerated truck, interior height of the truck bed ≥ 2.2 meters, with straps.
[0173] Preference (medium priority): Take the highway.
[0174] The system verifies the minimum set of business information (vehicle type, load, temperature control, route, loading time). If all fields are complete and without any missing information, it proceeds to the decision-making and reasoning stage.
[0175] Decision engine validation: Hard constraint matching: The driver's vehicle is a refrigerated truck, with a height of 2.3 meters or more (≥2.2 meters), and is equipped with straps, all of which meet the mandatory requirements.
[0176] Route verification: 4.2-meter blue-plate vehicles can travel on highways, which meets the preferences of cargo owners.
[0177] There is no constraint conflict, and the reasoning result is "match successful". The reason code is "match successful - cold storage is compatible - vehicle parameters are satisfied".
[0178] Search the knowledge base using the reason code to obtain the standard script template: Explanation type: "Your cargo and driver vehicle have been successfully matched. The following are the matching instructions:" Tips: "This vehicle meets your requirements for refrigerated transport, cargo box height, and strapping, and can travel on highways, matching your transport route preferences." Risk warning type: "Please ensure that the vehicle's refrigeration equipment is working properly to prevent the ice cream from spoiling during transportation." Constructing a constraint instruction set: Hard constraints: It must be stated that refrigeration, vehicle height, and strapping requirements are all met, and nothing can be omitted; it is not permissible to promise a transport capacity exceeding the vehicle's load capacity.
[0179] Soft constraints: Prioritize high-speed adaptation, and supplement with suggestions on transportation timeliness.
[0180] Large-scale model generated draft response: Hello, your ice cream transportation request has been successfully matched with the driver's 4.2-meter refrigerated truck. This vehicle has an interior height of 2.3 meters, is equipped with straps, and the refrigeration equipment is functioning properly. It also supports high-speed passage and is suitable for your transportation route from point A to point B. We suggest you confirm the loading time with the driver in advance and check the status of the refrigeration equipment to ensure the safe transportation of your goods.
[0181] If all three checks pass, the result will be directly output to the user.
[0182] Log auditing: Records the session process, reasoning results, and verification logs to facilitate subsequent problem tracing.
[0183] The following is a complete description of how the system handles a vehicle-cargo matching dialogue using another business scenario.
[0184] The shipper entered: "I have a batch of equipment to be transported from City A to City B. It must be transported in a high-sided truck (for easy loading and unloading), and the entire journey must be on the highway (the customer requires timely delivery). The equipment is 2.6 meters high, and the height inside the height restriction barrier must not be less than 2.7 meters. Loading will be done tomorrow." The driver typed: "I have a 9.6-meter high-sided truck with an inner height of 2.5 meters and a load capacity of 18 tons. I'm free tomorrow and can drive on the highway." Shipper's hard constraint: The height inside the column must be ≥2.7 meters (mandatory).
[0185] Driver's vehicle actual parameters: height inside the barrier is 2.5 meters (not met).
[0186] Meanwhile, another hard constraint for cargo owners is that they must use highways, but the height restrictions for high-sided trucks may be limited on some highway sections, further amplifying potential conflicts.
[0187] The system receives the conversation text and order metadata from the cargo owner and driver, and encapsulates it into a standardized session object.
[0188] Preprocessing stage: Information such as "high-sided vehicle", "9.6 meters", "2.5 meters", "2.7 meters" and "highway" are normalized and identified as vehicle-cargo matching business requests, which are then entered into the core link.
[0189] Structured dialogue frame construction: For the shipper: Cargo type = equipment, dimensions and height = 2.6m, vehicle type = high-sided truck (mandatory), interior height ≥ 2.7m (mandatory), route = must take the highway (mandatory), loading time = tomorrow.
[0190] Driver's side: Vehicle type = 9.6-meter high-sided truck, inside height = 2.5m, load capacity = 18 tons, route support = highway access, available time = tomorrow.
[0191] Unconventional constraint extraction and priority ranking: Must (high priority): High-sided vehicles, with a height of ≥2.7m inside the guardrail, must travel on highways.
[0192] Implicit constraint: The equipment height is 2.6m, and the strict requirement for the height inside the fence cannot be relaxed.
[0193] The system verifies that the minimum information set for the business (vehicle type, bar height, route, loading time, etc.) is complete and without any missing information, and then directly proceeds to the strategy decision-making and constraint reasoning stage.
[0194] The external decision engine performs inference based on rule-based assets: Hard constraint in the verification column: The height in the driver vehicle column is 2.5m, which is less than the 2.7m required by the cargo owner. Therefore, the hard constraint is directly determined to be unmet.
[0195] Verification of route constraints: The height limit for 9.6-meter high-sided trucks on some highway sections is 2.6 meters. Even if the height limit is met, there is still a risk of passage after loading 2.6-meter equipment, which may conflict with the requirement to "take the highway".
[0196] Reasoning result: There is a high-priority constraint conflict, which triggers the conflict resolution branch and generates a cause code.
[0197] Search the industry knowledge base using the conflict cause code to obtain a standard documentation package for conflict scenarios: Clarification and follow-up question format: "Your requirement for a height of ≥2.7 meters inside the barrier is currently 2.5 meters, which cannot be met. Would you accept adjusting the barrier height requirement?" Risk warning format: "After the 2.6-meter equipment is installed, there may be height restrictions on some sections of the highway. Please be aware." Alternative suggestion format: "You may consider replacing the vehicle with a high-sided truck with a height of ≥2.7 meters, or adjusting the transportation route to a national highway to avoid the risk of height restrictions." Constructing a constraint instruction set: Hard constraints: It is mandatory to explain the mismatch in barrier height and the risks of high-speed passage, and no concealment is allowed; it is also mandatory not to promise that the vehicle can meet the hard constraints.
[0198] Soft constraints: Prioritize providing clarification and follow-up questions, while also offering alternative solutions and explaining the impact of different choices.
[0199] Large model generates draft responses: "Hello, your equipment transportation needs conflict with the current 9.6-meter high-sided truck: the truck's internal height is 2.5 meters, which cannot meet your mandatory requirement of an internal height of ≥2.7 meters; at the same time, your equipment is 2.6 meters high, and even if the internal height is adjusted, there is still a risk of height restriction on some highway sections. Would you be willing to relax the internal height requirement? If it cannot be adjusted, you can consider replacing it with a high-sided truck with an internal height of ≥2.7 meters, or changing the transportation route to a national highway to avoid the height restriction issue." The output validator performs the verification: Constraint satisfaction check: No hard constraint boundary was breached, conflicts were reported truthfully, and there were no violations of commitments.
[0200] Field consistency check: Column height, device height, route information are completely consistent with the structured dialog frame, with no data deviation.
[0201] Content compliance verification: The wording is clear, the risk warnings are appropriate, and it complies with platform regulations.
[0202] The verification passed, and the process proceeds to the final output stage.
[0203] Provide clarifications, follow-up questions, and alternative suggestions to cargo owners, and await user feedback.
[0204] Logs record the cause of the conflict, the reasoning process, and the verification results, which are used for subsequent business optimization and rule iteration.
[0205] This application also provides a dialogue processing apparatus, which includes: a first extraction module, a second extraction module, an inference module, and a construction module; The first extraction module is used to extract structured elements from the current round input and the historical round context of the first user, obtain the current round extraction result, and update the global slot information according to the current round extraction result to obtain a structured dialogue frame. The second extraction module is used to extract the restriction information input by the second user according to preset restriction conditions, obtain a set of restriction conditions corresponding to the restriction information, and sort the restriction conditions in the set of restriction conditions according to preset priority rules to obtain a set of priority constraints. The reasoning module is used to perform constraint reasoning on the structured dialogue frame based on preset business rules, obtain reasoning results, and retrieve industry knowledge base based on the reasoning results to generate a caliber material package; The construction module is used to construct a constraint instruction set based on the structured dialogue frame, the priority constraint set, and the caliber material package, and input the constraint instruction set into the large language model. The large language model is used to generate and output response content based on the constraint instruction set.
[0206] In one alternative implementation, the structured elements include vehicle attributes, cargo attributes, and transportation requirements; The first extraction module is specifically used for: The vehicle attributes, cargo attributes, and transportation requirements are extracted from the current wheel input and historical wheel context of the first user to obtain the initial extraction results; The initial extraction results are subjected to entity disambiguation and content normalization to obtain the current round extraction results.
[0207] In one optional implementation, the first extraction module is specifically used for: The current round extraction result is fused with historical slot information to update global slot information, and a structured dialogue frame is constructed based on the updated slot information.
[0208] In one optional implementation, the limiting information includes remarks, additional explanations, and relevant industry knowledge; The preset restrictions include vehicle equipment restrictions, vehicle travel route restrictions, vehicle temperature control restrictions, loading and unloading time period restrictions, and auxiliary equipment restrictions. The second extraction module is specifically used to: extract the remarks information, the additional explanation information, and the relevant industry knowledge input by the second user according to the vehicle equipment restrictions, the vehicle driving route restrictions, the vehicle temperature control restrictions, the loading and unloading time restrictions, and the auxiliary equipment restrictions, to obtain a set of restrictions corresponding to the restriction information.
[0209] In one optional implementation, the second extraction module is specifically used for: The constraint modes and strengths of each constraint in the constraint set are identified from the remarks and additional description information. Based on the preset priority rules and the constraint modes and strengths of each constraint, the constraints are sorted to obtain the priority constraint set.
[0210] In one alternative implementation, the inference module is specifically used to: obtain a pre-configured minimum set of target information; If the structured dialogue frame satisfies all fields of the target minimum information set, then constraint reasoning is performed on the structured dialogue frame based on the preset business rules to obtain the reasoning result; If the structured dialogue frame lacks a key field in the target minimum information set, a follow-up questioning strategy is generated based on the missing key field; wherein, the follow-up questioning strategy is used to ask the first user follow-up questions; Based on the aforementioned follow-up questioning strategy, obtain the follow-up questioning results returned by the first user; The follow-up question results are fused into the structured dialogue frame to obtain a fused structured dialogue frame. Constraint reasoning is then performed on the fused structured dialogue frame based on the preset business rules to obtain the reasoning result.
[0211] In one optional implementation, the step of retrieving the industry knowledge base based on the reasoning results and generating the caliber material package includes: Extract the corresponding business reason code from the reasoning result, and traverse the industry knowledge base using the business reason code as the search keyword to obtain the corresponding business script template set; wherein, the business reason code includes at least one of the following: information missing type code, vehicle-cargo mismatch type code, compliance and violation type code, and constraint conflict type code; Based on preset business template rules, expired templates in the business script template set are removed to obtain the policy material package; wherein, the policy material package includes explanatory sentences, follow-up question sentences, risk warning sentences, and alternative suggestion sentences.
[0212] In one alternative implementation, the building module is specifically used for: Based on the structured dialogue frame, the priority constraint set, and the caliber material package, construct a constraint instruction set; Based on a preset instruction partitioning rule, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction to obtain a partitioned constraint instruction set, and the partitioned constraint instruction set is used as the constraint instruction set; wherein, the first constraint instruction is a non-adjustable instruction, and the second constraint instruction is an adjustable instruction.
[0213] In one alternative implementation, the building module is specifically used for: Based on a preset instruction partitioning rule, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction, and a preset response strategy is injected into the constraint instruction set to obtain the partitioned constraint instruction set.
[0214] In one alternative implementation, the large language model is specifically used for: When the constraint instruction set satisfies the preset deterministic conditions and the preset constraint conditions, a response content is generated according to each of the first constraint instructions; If the constraint instruction set does not meet the preset deterministic conditions, generate and output minimal follow-up information carrying the reason for the follow-up inquiry; If the constraint instruction set does not meet the preset constraint conditions, clarification and follow-up information is generated and output. The device further includes: an acquisition module; The acquisition module is used to: push the minimum follow-up information or the clarification follow-up information to the first user, and acquire additional information in response to the minimum follow-up information or the clarification follow-up information by the first user; The additional information is incorporated into the first user's current input round, and the corresponding structured dialogue frame is updated.
[0215] In one optional implementation, the apparatus further includes: a verification module; The verification module is specifically used to: perform preset constraint satisfaction verification, preset field consistency verification, and preset content compliance verification on the response content; If the response content passes verification, a reply result is output to the first user; If the response content verification fails, the response content is regenerated according to the reason for the verification failure, and the regenerated response content is verified until the response content verification passes or a preset fallback termination condition is triggered.
[0216] In one optional implementation, the type of the response content is any one of the following: standard response, supplementary inquiry response, risk disclosure response, alternative suggestion response, and fallback response.
[0217] In one alternative embodiment, the apparatus further includes: an encapsulation module; The encapsulation module is used to: receive the current round input and historical round context of the first user, the restriction information of the second user input, and related structured fields; The target session object is obtained by encapsulating the current round input and historical round context of the first user, the restriction information of the second user's input, and the relevant structured fields. The target session object is subjected to error correction and normalization processing to obtain the processed session object; Based on the processed session object, intent recognition and scene recognition are performed to obtain the target intent and target scene; Based on the target intent and the target scenario, determine the target processing link; The first extraction module is used to: extract structured elements from the current round input and historical round context of the first user under the target processing link; The second extraction module is used to: extract the restriction information input by the second user according to preset restriction conditions under the target processing link; The reasoning module is used to: perform constraint reasoning on the structured dialogue frame based on the preset business rules under the target processing link.
[0218] This application also provides an electronic device, Figure 3This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device may include: transceiver 121, processor 122, and memory 123.
[0219] Processor 122 executes computer execution instructions stored in memory, causing processor 122 to perform the scheme in the above method embodiments. Processor 122 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may 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.
[0220] The memory 123 is connected to the processor 122 via the system bus and completes communication between them. The memory 123 is used to store computer program instructions.
[0221] Transceiver 121 can be used to obtain the task to be run and its configuration information.
[0222] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.
[0223] This application also provides a chip for executing instructions, which is used to execute the technical solutions of the methods described in the above embodiments.
[0224] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the technical solutions of the methods described in the above embodiments.
[0225] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solutions of the methods in the above embodiments.
[0226] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules 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 indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0227] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0228] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0229] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0230] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0231] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0232] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0233] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0234] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application-Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.
[0235] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for dialogue processing, characterized in that, The method includes: The current round input and historical round context of the first user are subjected to structured element extraction to obtain the current round extraction result. The global slot information is updated according to the current round extraction result to obtain the structured dialogue frame. The restriction information input by the second user is extracted according to preset restriction conditions to obtain a set of restriction conditions corresponding to the restriction information. The restriction conditions in the set of restriction conditions are then sorted by priority according to preset priority rules to obtain a set of priority constraints. Based on preset business rules, the structured dialogue frames are constrained and inferred to obtain inference results. Based on the inference results, the industry knowledge base is retrieved to generate a caliber material package. Based on the structured dialogue frame, the priority constraint set, and the caliber material package, a constraint instruction set is constructed, and the constraint instruction set is input into the large language model. The large language model is used to generate and output response content based on the constraint instruction set.
2. The method according to claim 1, characterized in that, The structured elements include vehicle-related information; The step of extracting structured elements from the current round input and historical round context of the first user to obtain the current round extraction result includes: The vehicle-related information is extracted from the current wheel input and historical wheel context of the first user to obtain the initial extraction result; The initial extraction results are subjected to entity disambiguation and content normalization to obtain the current round extraction results.
3. The method according to claim 1, characterized in that, The step of updating the global slot information based on the current round extraction result to obtain the structured dialogue frame includes: The current round extraction result is fused with historical slot information to update global slot information, and a structured dialogue frame is constructed based on the updated slot information.
4. The method according to claim 1, characterized in that, The restriction information includes remarks, additional explanations, and relevant industry knowledge; The preset restrictions include vehicle equipment restrictions, vehicle travel route restrictions, vehicle temperature control restrictions, loading and unloading time period restrictions, and auxiliary equipment restrictions. The restriction information input by the second user is extracted according to preset restriction conditions to obtain a set of restriction conditions corresponding to the restriction information, including: The remarks, additional explanations, and relevant industry knowledge input by the second user are extracted according to the vehicle equipment restrictions, vehicle route restrictions, vehicle temperature control restrictions, loading and unloading time restrictions, and auxiliary equipment restrictions to obtain a set of restrictions corresponding to the restriction information.
5. The method according to claim 4, characterized in that, The priority constraint set is obtained by prioritizing each constraint in the constraint set according to a preset priority rule, including: The constraint modes and strengths of each constraint in the constraint set are identified from the remarks and additional description information. Based on the preset priority rules and the constraint modes and strengths of each constraint, the constraints are sorted to obtain the priority constraint set.
6. The method according to any one of claims 1-5, characterized in that, The constraint reasoning performed on the structured dialogue frame based on preset business rules yields the following reasoning results: Obtain the pre-configured minimum set of target information; If the structured dialogue frame satisfies all fields of the target minimum information set, then constraint reasoning is performed on the structured dialogue frame based on the preset business rules to obtain the reasoning result; If the structured dialogue frame lacks a key field in the target minimum information set, a follow-up questioning strategy is generated based on the missing key field; wherein, the follow-up questioning strategy is used to ask the first user follow-up questions; Based on the aforementioned follow-up questioning strategy, obtain the follow-up questioning results returned by the first user; The follow-up question results are fused into the structured dialogue frame to obtain a fused structured dialogue frame. Constraint reasoning is then performed on the fused structured dialogue frame based on the preset business rules to obtain the reasoning result.
7. The method according to claim 6, characterized in that, The step of retrieving the industry knowledge base based on the reasoning results and generating the scope material package includes: Extract the corresponding business reason code from the reasoning result, and traverse the industry knowledge base using the business reason code as the search keyword to obtain the corresponding business script template set; wherein, the business reason code includes at least one of the following: information missing type code, vehicle-cargo mismatch type code, compliance and violation type code, and constraint conflict type code; Based on preset business template rules, expired templates in the business script template set are removed to obtain the policy material package; wherein, the policy material package includes explanatory sentences, follow-up question sentences, risk warning sentences, and alternative suggestion sentences.
8. The method according to claim 6, characterized in that, The step of constructing a constraint instruction set based on the structured dialogue frame, the priority constraint set, and the caliber material package includes: Based on the structured dialogue frame, the priority constraint set, and the caliber material package, construct a constraint instruction set; Based on a preset instruction partitioning rule, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction to obtain a partitioned constraint instruction set, and the partitioned constraint instruction set is used as the constraint instruction set; wherein, the first constraint instruction is a non-adjustable instruction, and the second constraint instruction is an adjustable instruction.
9. The method according to claim 8, characterized in that, Based on the preset instruction partitioning rules, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction, resulting in a partitioned constraint instruction set including: Based on a preset instruction partitioning rule, each constraint instruction in the constraint instruction set is divided into a first constraint instruction or a second constraint instruction, and a preset response strategy is injected into the constraint instruction set to obtain the partitioned constraint instruction set.
10. The method according to claim 9, characterized in that, The large language model is specifically used for: When the constraint instruction set satisfies the preset deterministic conditions and the preset constraint conditions, a response content is generated according to each of the first constraint instructions; If the constraint instruction set does not meet the preset deterministic conditions, generate and output minimal follow-up information carrying the reason for the follow-up inquiry; If the constraint instruction set does not meet the preset constraint conditions, clarification and follow-up information is generated and output. The method further includes: The minimum follow-up question or the clarification follow-up question is pushed to the first user, and additional information in response to the minimum follow-up question or the clarification follow-up question is obtained. The additional information is incorporated into the first user's current input round, and the corresponding structured dialogue frame is updated.
11. The method according to any one of claims 1-5, characterized in that, The method further includes: The response content is subject to preset constraint satisfaction checks, preset field consistency checks, and preset content compliance checks. If the response content passes verification, a reply result is output to the first user; If the response content verification fails, the response content is regenerated according to the reason for the verification failure, and the regenerated response content is verified until the response content verification passes or a preset fallback termination condition is triggered.
12. The method according to claim 11, characterized in that, The response content can be any one of the following types: standard response, supplementary inquiry response, risk disclosure response, alternative suggestion response, or fallback response.
13. The method according to any one of claims 1-5, characterized in that, Before performing structured feature extraction on the current round input and historical round context of the first user, the method further includes: Receive the current round input and historical round context of the first user, the restriction information of the second user's input, and related structured fields; The target session object is obtained by encapsulating the current round input and historical round context of the first user, the restriction information of the second user's input, and the relevant structured fields. The target session object is subjected to error correction and normalization processing to obtain the processed session object; Based on the processed session object, intent recognition and scene recognition are performed to obtain the target intent and target scene; Based on the target intent and the target scenario, determine the target processing link; The structured feature extraction of the first user's current input and historical context includes: Under the target processing link, structured element extraction is performed on the current round input and historical round context of the first user; The extraction of the restriction information input by the second user according to preset restriction conditions includes: Under the target processing link, the restriction information input by the second user is extracted according to preset restriction conditions; The constraint reasoning based on preset business rules on the structured dialogue frame includes: Under the target processing link, constraint reasoning is performed on the structured dialogue frame based on the preset business rules.
14. An electronic device, characterized in that, include: A memory and a processor; the memory is configured to store computer program instructions; the processor is configured to execute the computer program instructions, causing the electronic device to perform the method as described in any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that, include: Computer program instructions; The electronic device executes the computer program instructions, causing the electronic device to perform the method as described in any one of claims 1 to 13.
16. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-13.