Interaction method and device based on large model, storage medium and electronic equipment

CN121747540APending Publication Date: 2026-03-27QINGDAO HAIER TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

然而,在处理复杂多轮对话时,大语言模型也仅基于用户的输入信息进行响应,进而导致输出的响应信息准确率较低

Benefits of technology

[0015]在本申请实施例中,从对话数据库中确定与用户当前输入相关的第一历史对话信息,以及分析第一历史对话信息和与当前输入的相关性,筛选出贴合目标历史对话信息,确保上下文连贯性和个性化。同时,通过识别输入信息的对话场景,将第四响应模版与第一响应模版进行对比,找出差异点作为补集,进而生成优化后的第二响应模版,将历史对话、场景以及响应模版融合,生成目标输入信息,再输入至目标模型中生成交互响应信息。本申请实施例中,通过历史对话与固定话术,以及场景匹配和模版优化保证了输入信息的准确性,进而提高了回复内容的准确性。因此,采用上述技术方案,解决了大语言模型输出的响应信息准确率较低。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121747540A_ABST
    Figure CN121747540A_ABST
Patent Text Reader

Abstract

The invention discloses an interaction method and device based on a large model, a storage medium and electronic equipment, and relates to the technical field of smart home, and the interaction method based on the large model comprises the steps: obtaining first historical dialogue information and a first response template; determining the timestamp of each piece of sub-historical dialogue information in the first historical dialogue information and the relevancy between each piece of sub-historical dialogue information and the input information, and determining target historical dialogue information in the multiple pieces of sub-historical dialogue information according to the timestamps and the relevancy; determining a dialogue scene corresponding to the input information; determining a complementary set corresponding to the first response template based on the second response template and the first response template, and adding the complementary set into the first response template to generate a third response template; generating target input information according to the input information, the target historical dialogue information, the second response template and the dialogue scene; and inputting the target input information into the target model to obtain target interaction response information generated by the target model according to the target input information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of smart home, in particular to an interaction method and device based on a large model, a storage medium and an electronic device. BACKGROUND

[0002] In a voice interaction system, a large language model as a core component is widely used in natural language understanding and generation to provide a conversation experience close to human beings. The large language model can learn the statistical rules of language from large-scale text data through deep learning technology, so as to realize the response to user instructions or questions. However, when processing complex multi-round conversations, the large language model only responds based on the input information of the user, which leads to low accuracy of the output response information.

[0003] In the related art, the large language model outputs response information with low accuracy, and no effective solution has been proposed. SUMMARY

[0004] Embodiments of the present application provide an interaction method and device based on a large model, a storage medium and an electronic device to at least solve the problem of low accuracy of response information output by a large language model in the related art.

[0005] According to an embodiment of the present application, an interaction method based on a large model is provided, including: obtaining first historical conversation information corresponding to input information in a conversation database, and obtaining a first response template corresponding to the input information in a response database, wherein the first historical conversation information includes historical input information and historical response information related to the input information; determining a timestamp of each sub-historical conversation information in the first historical conversation information and a relevance of each sub-historical conversation information to the input information, and determining target historical conversation information in a plurality of sub-historical conversation information according to the timestamp and the relevance; and determining a conversation scenario corresponding to the input information; determining a complement of the first response template corresponding to the first response template based on a second response template corresponding to the conversation scenario, and adding the complement to the first response template to generate a third response template; generating target input information according to the input information, the target historical conversation information, the third response template and the conversation scenario; inputting the target input information into a target model to obtain target interaction response information generated by the target model according to the target input information.

[0006] In one exemplary embodiment, generating target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario includes: formatting the target historical dialogue information, the input information, the third response template, and the dialogue scenario respectively to obtain formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scenario; adding target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scenario; and generating the target input information based on the target historical dialogue information with added structured tags, the input information with added structured tags, the third response template with added structured tags, and the dialogue scenario with added structured tags.

[0007] In an exemplary embodiment, adding target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene includes: determining a set of structured tags, wherein the set of structured tags includes: multiple structured tags; determining entity information in the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene respectively using named entity recognition technology, and determining sentiment information in the formatted target historical dialogue information and formatted input information respectively using sentiment analysis technology; determining target structured tags corresponding to the entity information and the sentiment information in the set of structured tags; and adding target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene respectively.

[0008] In one exemplary embodiment, generating the target input information based on target historical dialogue information with added structured tags, input information with added structured tags, a third response template with added structured tags, and a dialogue scenario with added structured tags includes: concatenating the test historical dialogue information with added structured tags, test input information with added structured tags, test response template with added structured tags, and test dialogue scenario with added structured tags using multiple concatenation orders to generate multiple test input information; inputting the multiple test input information into the target model respectively to obtain test interaction response information generated by the target model based on each test input information; determining the accuracy of each test response information and determining the target concatenation order corresponding to the test response information with the highest accuracy; and concatenating the target historical dialogue information with added structured tags, input information with added structured tags, third response template with added structured tags, and dialogue scenario with added structured tags based on the target concatenation order to generate the target input information.

[0009] In an exemplary embodiment, after generating target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario, the method further includes: determining whether the target input information conforms to the business logic corresponding to the dialogue scenario; if the target input information conforms to the business logic corresponding to the dialogue scenario, inputting the target input information into a target model; if the target input information does not conform to the business logic corresponding to the dialogue scenario, obtaining second historical dialogue information corresponding to the input information from a dialogue database, and obtaining a fourth response template corresponding to the input information from a response database; and generating target input information based on the second historical dialogue information, the input information, and the fourth response template.

[0010] In an exemplary embodiment, determining the dialogue scenario corresponding to the input information includes: determining feature information of the input information, wherein the feature information includes at least one of the following: user intent information, emotion information, and entity information; and classifying the feature information to determine the dialogue scenario corresponding to the input information.

[0011] In an exemplary embodiment, after inputting the target input information into a target model to obtain target interactive response information generated by the target model based on the target input information, the method further includes: determining a user profile of the target object, and determining acoustic information corresponding to the target interactive response information based on the user profile; determining audio data corresponding to the target interactive response information; and outputting the audio data based on the acoustic information.

[0012] According to another embodiment of the present application, an interaction device based on a large model is also provided, comprising: a first acquisition module, configured to acquire first historical dialogue information corresponding to input information from a dialogue database, and acquire a first response template corresponding to the input information from a response database, wherein the first historical dialogue information includes: historical input information and historical response information related to the input information; a determination module, configured to determine the timestamp of each sub-historical dialogue information in the first historical dialogue information and the relevance of each sub-historical dialogue information to the input information, determine target historical dialogue information among multiple sub-historical dialogue information based on the timestamp and the relevance; and determine the dialogue scenario corresponding to the input information; a first generation module, configured to determine the complement set corresponding to the first response template based on the second response template corresponding to the dialogue scenario and the first response template, and add the complement set to the first response template to generate a third response template; a second generation module, configured to generate target input information based on the input information, the target historical dialogue information, the third response template and the dialogue scenario; and a second acquisition module, configured to input the target input information into a target model to obtain target interactive response information generated by the target model based on the target input information.

[0013] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, which is configured to execute the above-described interaction method based on a large model at runtime.

[0014] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described large-model-based interaction method through the computer program.

[0015] In this embodiment, first historical dialogue information related to the user's current input is determined from the dialogue database. The relevance of this first historical dialogue information to the current input is analyzed, and historical dialogue information that fits the target is selected to ensure contextual coherence and personalization. Simultaneously, by identifying the dialogue scenario of the input information, the fourth response template is compared with the first response template, and differences are identified as complements to generate an optimized second response template. The historical dialogue, scenario, and response template are then integrated to generate the target input information, which is then input into the target model to generate interactive response information. In this embodiment, the accuracy of the input information is ensured through historical dialogue and fixed phrases, as well as scenario matching and template optimization, thereby improving the accuracy of the response content. Therefore, the above technical solution solves the problem of low accuracy in response information output by large language models. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the hardware environment for an interaction method based on a large model according to an embodiment of this application;

[0019] Figure 2 This is a flowchart (I) of an interaction method based on a large model according to an embodiment of this application.

[0020] Figure 3 This is a flowchart of a method for constructing an enhanced input sequence according to an embodiment of this application;

[0021] Figure 4 This is a flowchart (II) of the interaction method based on a large model according to an embodiment of this application.

[0022] Figure 5 This is a timing diagram (a) of the interaction method based on a large model according to an embodiment of this application.

[0023] Figure 6 This is a schematic diagram of an interactive system based on a large model according to an embodiment of this application;

[0024] Figure 7 This is a flowchart (IV) of the interaction method based on a large model according to an embodiment of this application.

[0025] Figure 8 This is a timing diagram (II) of the interaction method based on a large model according to an embodiment of this application.

[0026] Figure 9 This is a structural block diagram of an interactive device based on a large model according to an embodiment of this application. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] According to one aspect of the embodiments of this application, a large-model-based interaction method is provided. This large-model-based interaction method is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned large-model-based interaction method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0030] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0031] This embodiment provides an interaction method based on a large model, applied to the aforementioned terminal device. Figure 2 This is a flowchart of a large-model-based interaction method according to an embodiment of this application, which includes the following steps:

[0032] Step S202: Obtain first historical dialogue information corresponding to the input information from the dialogue database, and obtain first response template corresponding to the input information from the response database, wherein the first historical dialogue information includes: historical input information and historical response information related to the input information;

[0033] In step S202, past dialogue records related to the current user input are retrieved from the dialogue database, namely "first historical dialogue information," which includes historical input information (past questions or statements by the user) and historical response information (past replies). Simultaneously, a "first response template" suitable for the current user input is extracted from the response database. This "first response template" is a pre-defined response framework based on business logic.

[0034] Step S204: Determine the timestamp of each sub-historical dialogue information in the first historical dialogue information and the relevance of each sub-historical dialogue information to the input information; determine the target historical dialogue information among multiple sub-historical dialogue information based on the timestamp and the relevance; and determine the dialogue scenario corresponding to the input information.

[0035] Step S206: Based on the second response template and the first response template corresponding to the dialogue scenario, determine the complement set corresponding to the first response template, and add the complement set to the first response template to generate the third response template;

[0036] Step S208: Generate target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario;

[0037] In steps S204-S208, "sub-historical dialogue information" related to the current input is filtered from historical dialogue information. This sub-historical dialogue information is then sorted according to its timestamp to ensure that the newest or most relevant dialogue records are given priority. An algorithm calculates the relevance between the filtered sub-historical dialogue information and the current input to determine the closeness between historical dialogues and the user's immediate needs. Based on the relevance assessment, "target historical dialogue information" with reference value is determined from multiple sub-historical dialogue information. Furthermore, to ensure the quality of the input information, the "target historical dialogue information" can be cleaned by removing irrelevant or potentially confusing information elements, such as meaningless filler words, repetitions, or errors.

[0038] Find a second response template that matches the current dialogue scenario. This second response template can be trained based on a large amount of historical dialogue data and is specifically designed to handle a particular type of dialogue event, such as product inquiries, troubleshooting, or emotional reassurance. By comparing the features of the input information with templates in the scenario library, a template that matches the nature of the current dialogue is determined.

[0039] Based on the second response template and the existing first response template, the missing parts of the first response template, known as the "complements," will be identified. These complements may include additional dialogue elements, special instructions, or contextualized expressions. Based on the identified complements, the first response template will be dynamically adjusted, supplementing or modifying its content to make it more complete and context-appropriate. These adjustments include, but are not limited to, adding specific greetings, prompts for questions, descriptions of product features, or other context-related expressions.

[0040] Finally, the target historical dialogue information, the cleaned user input information, the third response template optimized by scene matching, and the dialogue scene information are integrated to form the "target input information".

[0041] Step S210: Input the target input information into the target model to obtain the target interactive response information generated by the target model based on the target input information.

[0042] In step S210, the generated target input information is input into a pre-trained large language model (target model), allowing the model to generate a "target interactive response information" based on the input information. Here, "target model" refers to a large-scale language model that has been trained on a large amount of data and is capable of understanding and generating human language.

[0043] Through the above steps, the first historical dialogue information related to the user's current input is determined from the dialogue database. The relevance of this first historical dialogue information to the current input is analyzed, and historical dialogue information that fits the target is selected to ensure contextual coherence and personalization. Simultaneously, by identifying the dialogue scenario of the input information, the fourth response template is compared with the first response template, and differences are identified as complements to generate an optimized second response template. The historical dialogue, scenario, and response template are then integrated to generate the target input information, which is then input into the target model to generate interactive response information. In this embodiment, the accuracy of the input information is ensured through historical dialogue and fixed phrases, as well as scenario matching and template optimization, thereby improving the accuracy of the response content. Therefore, the above technical solution solves the problem of low accuracy in response information output by large language models.

[0044] Optionally, generating target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario includes: formatting the target historical dialogue information, the input information, the third response template, and the dialogue scenario respectively to obtain formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scenario; adding target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scenario; and generating the target input information based on the target historical dialogue information with added structured tags, the input information with added structured tags, the third response template with added structured tags, and the dialogue scenario with added structured tags.

[0045] The target historical dialogue information, current input information, adjusted second response template, and dialogue scenario are formatted to ensure that all data elements have a consistent structure and format. Structured tags are added to the formatted information to clearly label the function of each dialogue element, such as distinguishing between user statements, system responses, script templates, or specific scenarios. The formatted and tagged target historical dialogue information, current input information, second response template, and dialogue scenario information are then combined to construct the final target input information.

[0046] In this embodiment, through formatting and structured labeling, the target input information maintains a standardized format while adding rich dialogue scenario clues and user intent details, providing a solid foundation for the model to generate more contextualized and personalized responses.

[0047] Optionally, adding target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene includes: determining a set of structured tags, wherein the set of structured tags includes: multiple structured tags; determining entity information in the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene respectively using named entity recognition technology, and determining sentiment information in the formatted target historical dialogue information and formatted input information respectively using sentiment analysis technology; determining target structured tags corresponding to the entity information and the sentiment information in the set of structured tags; and adding target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene respectively.

[0048] A structured tag set contains predefined tags used to describe different types of entity information and emotional states. For example, entity information can cover specific categories such as users, products, dates, and locations, while emotional information can include emotional tendencies such as positive, negative, neutral, urgent, and relaxed.

[0049] Text content is analyzed using named entity recognition and sentiment analysis techniques. Named entity recognition can identify and classify entities in text, such as product names, user IDs, and dates, while sentiment analysis is used to determine the sentiment in the text and judge the user's emotional state.

[0050] After identifying entity and sentiment information, tags corresponding to the entity and sentiment information are found in the structured tag set. For example, if a user expresses positive feelings about a product, tags indicating satisfaction or interest should be added. Target structured tags are added to formatted historical dialogue information, current input information, third-party response templates, and dialogue scenario descriptions to enrich their semantic hierarchy and indicate that the model generates more appropriate responses.

[0051] Optionally, generating the target input information based on the target historical dialogue information with added structured tags, the input information with added structured tags, the third response template with added structured tags, and the dialogue scenario with added structured tags includes: concatenating the test historical dialogue information with added structured tags, the test input information with added structured tags, the test response template with added structured tags, and the test dialogue scenario with added structured tags using multiple concatenation orders to generate multiple test input information; inputting the multiple test input information into the target model respectively to obtain test interaction response information generated by the target model based on each test input information; determining the accuracy of each test response information and determining the target concatenation order corresponding to the test response information with the highest accuracy; and concatenating the target historical dialogue information with added structured tags, the input information with added structured tags, the third response template with added structured tags, and the dialogue scenario with added structured tags based on the target concatenation order to generate the target input information.

[0052] In this embodiment, multiple generated test input messages are passed to the target model, which then generates a series of test interaction responses based on these messages. Subsequently, an algorithm automatically evaluates the accuracy of each test response, i.e., the degree to which the response content matches the user's true intent. After determining the accuracy of the test responses, the test response with the highest accuracy and its corresponding target concatenation order are identified. Based on the determined target concatenation order, the structured tagged target historical dialogue information, user input, third-party response template, and dialogue scenario are concatenated to generate the final target input information.

[0053] Optionally, after generating target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario, the method further includes: determining whether the target input information conforms to the business logic corresponding to the dialogue scenario; if the target input information conforms to the business logic corresponding to the dialogue scenario, inputting the target input information into the target model; if the target input information does not conform to the business logic corresponding to the dialogue scenario, obtaining second historical dialogue information corresponding to the input information from the dialogue database, and obtaining a fourth response template corresponding to the input information from the response database; and generating target input information based on the second historical dialogue information, the input information, and the fourth response template.

[0054] After generating the target input information, a logical validation is performed. If the target input information passes the logical validation, meaning it is well-prepared and meets the standards, it can be directly input into the target model (large language model) to generate a high-quality response. If the target input information fails the quality validation, a feedback mechanism is triggered to retrieve the user's historical dialogue records and applicable response templates to generate alternative target input information. If the target input information fails the logical validation, "secondary historical dialogue information" more relevant to the current input is retrieved from the dialogue database, and a "fourth response template" more suitable for the current dialogue scenario is selected from the response database.

[0055] Logical validation ensures the accuracy and standardization of input information, avoiding invalid or misleading input, thereby improving the reliability of responses generated by the large language model.

[0056] Optionally, the embodiments of this application may also include the following verification:

[0057] 1. Integrity check: Ensure that the target input information contains all necessary components, such as user ID, current conversation turn, historical conversation context, and adjusted template content.

[0058] 2. Consistency Check: Verify that the content of the target input is consistent with the historical dialogue records to avoid logical contradictions or information conflicts. For example, if the user has already solved a problem in the previous round of dialogue, the target input should not mention or ask about that problem again.

[0059] 3. Semantic rationality verification: Use natural language processing techniques (such as semantic analysis, dependency resolution, etc.) to verify the semantic rationality of the target input information.

[0060] 4. Scenario Adaptability Validation: Assess whether the target input information is suitable for the current dialogue scenario. For example, in a scenario where a user is seeking technical support, ensure that the target input information contains technical information and terminology, rather than content related to emotional support or product sales.

[0061] 5. Personalized Information Validation: Confirm whether the target input information incorporates user preferences, historical behavior, or personalized needs to ensure that the generated response is as personalized and tailored to user needs as possible.

[0062] 6. Template Application Validation: Check whether the adjusted response template is correctly integrated into the target input information, whether the variables in the template are correctly replaced, and whether the dynamic adjustment of the template conforms to the expected dialogue logic.

[0063] 7. Format compliance check: Ensure that the target input information conforms to the format requirements of the model input, such as correct JSON structure, specific field order, and consistent encoding method.

[0064] Optionally, embodiments of this application provide a method for constructing an enhanced input sequence (i.e., the target input information in the above embodiments). Figure 3 This is a flowchart of a method for constructing an enhanced input sequence according to an embodiment of this application, including the following steps:

[0065] Step 1: Obtain user input (i.e., the input information mentioned above), historical dialogue records (i.e., the historical dialogue information mentioned above), and fixed dialogue templates (i.e., the first response template mentioned above).

[0066] Step 2: Clean the user input text;

[0067] Step 3: Sort the historical conversation records by time and filter for relevance;

[0068] Step 4: Perform scenario matching and script optimization adjustments on the fixed script template;

[0069] Step 5: Format the cleaned user input, the relevant filtered historical dialogue records, the fixed dialogue templates after optimization and adjustment, and the scene information;

[0070] Step 6: Combine the formatted user input, historical dialogue records, fixed dialogue templates, and scenario information;

[0071] Step 7: Add structured labels to the combined information to generate an enhanced input sequence;

[0072] Step 8: Perform quality verification checks on the enhanced input sequence;

[0073] Step 9: Determine whether the quality verification check has been passed;

[0074] Step 10: If the quality verification check is passed, output to the LLM module;

[0075] Step 11: If the quality verification check fails, rebuild the enhanced input sequence.

[0076] Optionally, such as Figure 4 As shown in the embodiments of this application, a scenario example is also provided, specifically:

[0077] Step 1: Retrieve historical records, for example: User: How much is product A? System: Product A is priced at 100 yuan;

[0078] Step 2: Obtain the current user input, for example: User: What are the functions of product B?

[0079] Step 3: Obtain fixed scripts, for example: System: Recommend relevant products based on the user's historical interests;

[0080] Step 4: Construct the enhanced input sequence.

[0081] For example: [historical dialogue records];

[0082] User: How much does product A cost?

[0083] System: The price of product A is 100 yuan.

[0084] [Current user input];

[0085] User: What are the features of product B?

[0086] [Standard script];

[0087] System: Recommends relevant products based on users' historical interests.

[0088] Step 5: Send the enhanced input sequence.

[0089] Step 6: Generate user-friendly service. For example: Return: You were previously interested in product A; product B has similar functions but is more energy-efficient.

[0090] Optionally, determining the dialogue scenario corresponding to the input information includes: determining the feature information of the input information, wherein the feature information includes at least one of the following: user intent information, emotion information, and entity information; and classifying the feature information to determine the dialogue scenario corresponding to the input information.

[0091] In this embodiment, key feature information is extracted from the user-provided input information. This feature information includes, but is not limited to, user intent information, emotional information, and entity information. For example, user intent information indicates whether the user is seeking product information, technical support, or complaint feedback; emotional information helps understand the user's emotional state, such as satisfaction, anxiety, or confusion; and entity information indicates specific objects mentioned in the dialogue, such as product model, date and time, or location.

[0092] After identifying the feature information, it is categorized and analyzed, mapping the feature information to predefined dialogue scenario categories. The classification process can be implemented using machine learning algorithms or rule engines. By comparing the feature information with models or rules for various scenarios, it determines which specific dialogue scenario the input information is most likely to belong to. For example, if the input information contains questions about product features and a positive sentiment, it can be classified as a "product consultation and recommendation" scenario.

[0093] Optionally, after inputting the target input information into the target model to obtain the target interaction response information corresponding to the target input information generated by the target model, the method further includes: determining a user profile of the target object, and determining the acoustic information corresponding to the target interaction response information based on the user profile; determining the audio data corresponding to the target interaction response information; and outputting the audio data based on the acoustic information.

[0094] After receiving the target interaction response information generated by the target model, the system further utilizes user profiles to determine appropriate acoustic information. A user profile is a file describing a user's characteristics, built by collecting and analyzing various user data (such as age, gender, region, preferences, etc.). Acoustic information encompasses attributes such as timbre, intonation, and rhythm of the speech output, used to determine a speech style that matches specific user characteristics.

[0095] The system matches user profile features with parameters in an acoustic database to select the most suitable acoustic configuration for each user. For example, a young female user might choose a softer, more lively tone and rhythm, while an older male user might prefer a more stable, deep voice.

[0096] The audio data synthesis process involves converting text to speech (TTS) and adjusting the pitch, rate, pauses, and stress of the speech according to selected acoustic parameters to generate vivid and natural speech output. Audio output is then executed based on the determined acoustic information.

[0097] By combining user profiles and acoustic information, customized voice responses can be provided for different users. This highly personalized output not only increases users' sense of identification but also creates a more comfortable and natural communication atmosphere.

[0098] To better understand the process of the above-described interaction method based on a large model, the implementation flow of the interaction based on a large model will be described below in conjunction with optional embodiments, but this is not intended to limit the technical solutions of the embodiments of this application.

[0099] This embodiment provides an interaction method based on a large model, applied to... Figure 6 Interactive devices based on large models in the middle, Figure 5 This is a timing diagram (I) of the interaction method based on a large model according to an embodiment of this application, as shown below. Figure 5 As shown, the specific steps are as follows:

[0100] Step S501: The speech recognition module acquires the user's voice input;

[0101] Step S502: The speech recognition module inputs the speech in text form to the dialogue management module;

[0102] Step S503: The dialogue management module requests a history retrieval;

[0103] Step S504: The history retrieval unit queries the user's history dialogues in the dialogue database based on the request;

[0104] Step S505: The dialogue database returns the user's historical dialogues;

[0105] Step S506: The history retrieval unit sorts and filters the user's historical conversations by time.

[0106] Step S507: The history retrieval unit returns the structured history record to the dialogue management module;

[0107] Step S508: The dialogue management module requests a fixed script;

[0108] Step S509: The script acquisition unit queries the script template in the script library based on the request;

[0109] Step S510: The script library returns script templates;

[0110] Step S511: The script acquisition unit performs scenario matching and optimization;

[0111] Step S512: The script acquisition unit returns the optimized script to the dialogue management module;

[0112] Step S513: Send build data to the input building unit;

[0113] Step S514: Construct an enhanced input sequence using input building blocks;

[0114] Step S515: The input building unit returns the enhanced input sequence to the dialogue management module;

[0115] Step S516: The dialogue management module sends the enhanced input sequence to the large language model;

[0116] Step S517: The large language model generates a human-like response;

[0117] Step S518: Return the response text to the dialogue management module;

[0118] Step S519: Send the reply text to the natural language generation module;

[0119] Step S520: The natural language generation module provides a voice output response to the user.

[0120] For example, such as Figure 7 As shown, in the scenario of personalized recommendations for intelligent customer service, the methods for generating the above response information include the following:

[0121] Step S701: The user inquires about the function of product B;

[0122] Step S702: Speech recognition converts the user's voice input into text;

[0123] Step S703: Retrieve historical conversation records;

[0124] Step S704: Based on historical conversation records, it was discovered that the user had inquired about product A;

[0125] Step S705: Obtain product recommendation scripts;

[0126] Step S706: Construct a personalized enhanced input sequence;

[0127] Step S707: Large language model processing;

[0128] Step S708: Generate personalized responses, such as: recommending product B based on product A's history, highlighting the product's unique advantages.

[0129] For example, such as Figure 8 As shown, in scenarios where the context of a multi-turn dialogue is preserved, the methods for generating the above response information include the following:

[0130] Step S801: User inputs: How much does product A cost?

[0131] Step S802: Process the query and record the history;

[0132] Step S803: The price of product A is 100 yuan;

[0133] Step S804: Voice output reply;

[0134] Step S805: User inputs: Are there any discounts?

[0135] Step S806: Generate an enhanced input sequence, which contains the history of product A;

[0136] Step S807: Output: Currently, purchasing product A entitles you to a 10% discount;

[0137] Step S808: Voice output of promotional information;

[0138] Step S809: User input: What functions does product B have?

[0139] Step S810: Generate an enhanced input sequence containing the complete history;

[0140] Step S811: Output: You were previously interested in product A, product B..…

[0141] Step S812: Output comparison information via voice.

[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0143] Figure 9 This is a structural block diagram of an interactive device based on a large model according to an embodiment of this application; as shown below. Figure 9 As shown, it includes:

[0144] The first acquisition module 92 is used to acquire first historical dialogue information corresponding to the input information in the dialogue database, and to acquire a first response template corresponding to the input information in the response database, wherein the first historical dialogue information includes: historical input information and historical response information related to the input information;

[0145] The determining module 94 is used to determine the timestamp of each sub-historical dialogue information in the first historical dialogue information and the relevance of each sub-historical dialogue information to the input information; determine the target historical dialogue information among multiple sub-historical dialogue information based on the timestamp and the relevance; and determine the dialogue scenario corresponding to the input information.

[0146] The first generation module 96 is used to determine the complement of the first response template based on the second response template corresponding to the dialogue scenario and the first response template, and add the complement to the first response template to generate the third response template;

[0147] The second generation module 98 is used to generate target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario.

[0148] The second acquisition module 100 is used to input the target input information into the target model to obtain the target interactive response information generated by the target model based on the target input information.

[0149] The aforementioned device determines first historical dialogue information related to the user's current input from the dialogue database, analyzes the relevance of the first historical dialogue information to the current input, and filters out historical dialogue information that fits the target, ensuring contextual coherence and personalization. Simultaneously, by identifying the dialogue scenario of the input information, the fourth response template is compared with the first response template, and differences are identified as complements to generate an optimized second response template. The historical dialogue, scenario, and response template are then integrated to generate the target input information, which is then input into the target model to generate interactive response information. In this embodiment, the accuracy of the input information is ensured through historical dialogue and fixed phrases, as well as scenario matching and template optimization, thereby improving the accuracy of the response content. Therefore, the above technical solution solves the problem of low accuracy of response information output by large language models.

[0150] In one exemplary embodiment, the second generation module is configured to format the target historical dialogue information, the input information, the third response template, and the dialogue scenario respectively to obtain formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scenario; add target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scenario; and generate the target input information based on the target historical dialogue information with added structured tags, the input information with added structured tags, the third response template with added structured tags, and the dialogue scenario with added structured tags.

[0151] In an exemplary embodiment, the second generation module is configured to add target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene, including: determining a set of structured tags, wherein the set of structured tags includes: multiple structured tags; determining entity information in the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene respectively using named entity recognition technology, and determining sentiment information in the formatted target historical dialogue information and formatted input information respectively using sentiment analysis technology; determining target structured tags corresponding to the entity information and the sentiment information in the set of structured tags; and adding target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene respectively.

[0152] In one exemplary embodiment, the second generation module is configured to concatenate test history dialogue information with added structured tags, test input information with added structured tags, test response template with added structured tags, and test dialogue scene with added structured tags using multiple concatenation sequences to generate multiple test input information; input the multiple test input information into the target model respectively to obtain test interaction response information generated by the target model based on each test input information; determine the accuracy of each test response information and determine the target concatenation sequence corresponding to the test response information with the highest accuracy; and concatenate the target history dialogue information with added structured tags, the input information with added structured tags, the third response template with added structured tags, and the dialogue scene with added structured tags based on the target concatenation sequence to generate the target input information.

[0153] In one exemplary embodiment, the second generation module is configured to determine whether the target input information conforms to the business logic corresponding to the dialogue scenario; if the target input information conforms to the business logic corresponding to the dialogue scenario, input the target input information into a target model; if the target input information does not conform to the business logic corresponding to the dialogue scenario, obtain second historical dialogue information corresponding to the input information from a dialogue database and obtain a fourth response template corresponding to the input information from a response database; and generate target input information based on the second historical dialogue information, the input information, and the fourth response template.

[0154] In an exemplary embodiment, a determining module is configured to determine feature information of the input information, wherein the feature information includes at least one of the following: user intent information, emotion information, and entity information; and to classify the feature information to determine the dialogue scenario corresponding to the input information.

[0155] In one exemplary embodiment, the above apparatus further includes: a natural language generation module, configured to determine a user profile of the target object, and determine acoustic information corresponding to the target interaction response information based on the user profile; determine audio data corresponding to the target interaction response information; and output the audio data based on the acoustic information.

[0156] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.

[0157] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0158] S1, obtain the first historical dialogue information corresponding to the input information from the dialogue database, and obtain the first response template corresponding to the input information from the response database, wherein the first historical dialogue information includes: historical input information and historical response information related to the input information;

[0159] S2, determine the timestamp of each sub-historical dialogue information in the first historical dialogue information and the relevance of each sub-historical dialogue information to the input information, determine the target historical dialogue information among multiple sub-historical dialogue information based on the timestamp and the relevance; and determine the dialogue scenario corresponding to the input information;

[0160] S3, based on the second response template and the first response template corresponding to the dialogue scenario, determine the complement set corresponding to the first response template, and add the complement set to the first response template to generate the third response template;

[0161] S4, Generate target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario;

[0162] S5, input the target input information into the target model to obtain the target interactive response information generated by the target model based on the target input information.

[0163] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0164] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0165] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0166] S1, obtain the first historical dialogue information corresponding to the input information from the dialogue database, and obtain the first response template corresponding to the input information from the response database, wherein the first historical dialogue information includes: historical input information and historical response information related to the input information;

[0167] S2, determine the timestamp of each sub-historical dialogue information in the first historical dialogue information and the relevance of each sub-historical dialogue information to the input information, determine the target historical dialogue information among multiple sub-historical dialogue information based on the timestamp and the relevance; and determine the dialogue scenario corresponding to the input information;

[0168] S3, based on the second response template and the first response template corresponding to the dialogue scenario, determine the complement set corresponding to the first response template, and add the complement set to the first response template to generate the third response template;

[0169] S4, Generate target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario;

[0170] S5, input the target input information into the target model to obtain the target interactive response information generated by the target model based on the target input information.

[0171] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0172] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0173] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0174] The embodiments described herein also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.

[0175] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0176] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0177] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. An interaction method based on a large model, characterized in that, include: The system retrieves first historical dialogue information corresponding to the input information from the dialogue database and first response template corresponding to the input information from the response database. The first historical dialogue information includes historical input information and historical response information related to the input information. Determine the timestamp of each sub-historical dialogue information in the first historical dialogue information and the relevance of each sub-historical dialogue information to the input information; determine the target historical dialogue information among multiple sub-historical dialogue information based on the timestamp and the relevance; and determine the dialogue scenario corresponding to the input information. Based on the second response template and the first response template corresponding to the dialogue scenario, the complement set corresponding to the first response template is determined, and the complement set is added to the first response template to generate the third response template; Target input information is generated based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario; The target input information is input into the target model to obtain the target interactive response information generated by the target model based on the target input information.

2. The interaction method based on a large model according to claim 1, characterized in that, Generate target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario, including: The target historical dialogue information, the input information, the third response template, and the dialogue scenario are formatted respectively to obtain formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scenario; Add target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scenario; The target input information is generated based on the target historical dialogue information after adding structured tags, the input information after adding structured tags, the third response template after adding structured tags, and the dialogue scenario after adding structured tags.

3. The interaction method based on a large model according to claim 2, characterized in that, Add target structured tags to the formatted target historical dialogue information, formatted input information, formatted third-response template, and formatted dialogue scene, including: Determine a set of structured tags, wherein the set of structured tags includes: multiple structured tags; Named entity recognition technology is used to determine entity information in the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene, respectively; and sentiment analysis technology is used to determine sentiment information in the formatted target historical dialogue information and formatted input information, respectively. Determine the target structured tags corresponding to the entity information and the sentiment information in the set of structured tags; Add target structured tags to the formatted target historical dialogue information, formatted input information, formatted third response template, and formatted dialogue scene respectively.

4. The interaction method based on a large model according to claim 2, characterized in that, The target input information is generated based on the target historical dialogue information with added structured tags, the input information with added structured tags, the third response template with added structured tags, and the dialogue scenario with added structured tags, including: Multiple test input information is generated by concatenating the test history dialogue information with added structured tags, the test input information with added structured tags, the test response template with added structured tags, and the test dialogue scenario with added structured tags in multiple concatenation sequences. The multiple test input information is input into the target model respectively to obtain the test interaction response information generated by the target model based on each test input information; Determine the accuracy of each test response and determine the target assembly order corresponding to the test response with the highest accuracy; Based on the target splicing order, the target historical dialogue information after adding structured tags, the input information after adding structured tags, the third response template after adding structured tags, and the dialogue scene after adding structured tags are spliced ​​together to generate the target input information.

5. The interaction method based on a large model according to claim 1, characterized in that, After generating target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario, the method further includes: Determine whether the target input information conforms to the business logic corresponding to the dialogue scenario; If the target input information matches the business logic corresponding to the dialogue scenario, the target input information is input into the target model. If the target input information does not conform to the business logic corresponding to the dialogue scenario, the system retrieves the second historical dialogue information corresponding to the input information from the dialogue database and the fourth response template corresponding to the input information from the response database; and generates the target input information based on the second historical dialogue information, the input information, and the fourth response template.

6. The interaction method based on a large model according to claim 1, characterized in that, Determining the dialogue scenario corresponding to the input information includes: The feature information of the input information is determined, wherein the feature information includes at least one of the following: user intent information, emotion information, and entity information; The feature information is classified to determine the dialogue scenario corresponding to the input information.

7. The interaction method based on a large model according to claim 1, characterized in that, After inputting the target input information into the target model to obtain the target interactive response information generated by the target model based on the target input information, the method further includes: Determine the user profile of the target object, and determine the acoustic information corresponding to the target interaction response information based on the user profile; Determine the audio data corresponding to the target interactive response information; The audio data is output based on the acoustic information.

8. An interactive device based on a large model, characterized in that, include: The first acquisition module is used to acquire first historical dialogue information corresponding to the input information from the dialogue database, and to acquire a first response template corresponding to the input information from the response database, wherein the first historical dialogue information includes: historical input information and historical response information related to the input information; The determining module is configured to determine the timestamp of each sub-historical dialogue information in the first historical dialogue information and the relevance of each sub-historical dialogue information to the input information; determine the target historical dialogue information among multiple sub-historical dialogue information based on the timestamp and the relevance; and determine the dialogue scenario corresponding to the input information. The first generation module is used to determine the complement of the first response template based on the second response template corresponding to the dialogue scenario and the first response template, and add the complement to the first response template to generate the third response template; The second generation module is used to generate target input information based on the input information, the target historical dialogue information, the third response template, and the dialogue scenario. The second acquisition module is used to input the target input information into the target model to obtain the target interactive response information generated by the target model based on the target input information.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 7.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.