A multi-turn dialogue context dynamic scheduling method and system

CN122986003APending Publication Date: 2026-10-27ZIGUANG HENGYUE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611274690.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0006]为了克服上述不足,本发明提供一种多轮对话上下文动态调度方法及系统,以解决现有技术中交叉话题导致上下文碎片化、指代消解成本高以及提示词缓存利用率低的技术问题

Benefits of technology

本发明提出一种多轮对话上下文动态调度方法及系统,通过历史话题锚点的向量表示与当前轮次用户输入的语义表示之间的匹配关系实现历史话题命中,并在命中后将关联的历史对话数据加入模型输入上下文,使得用户通过代词或模糊表述发起的跨话题追问能够被准确识别和响应,解决了传统关键词匹配在隐式指代场景下失效的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986003A_ABST
    Figure CN122986003A_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-wheel dialogue context dynamic scheduling method and system, belong to natural language processing technical field.The method includes: in response to current session meets context scheduling condition, after carrying out noise reduction processing to multi-wheel dialogue data, write into current context storage area;According to the semantic variation degree of new writing content and existing content, judge whether topic switching occurs;When topic switching occurs, generate historical topic anchor point based on the content before switching and store historical dialogue data in association;In response to current round user input, determine whether historical topic is hit based on the matching relationship between semantic representation and historical topic anchor point;When hit, the associated historical dialogue data is added to model input context;According to the update frequency of each component of model input, after hierarchical assembly, it is sent to large language model.The application realizes the smooth reentry and merging of cross topic, avoids context fragmentation, and simultaneously improves prompt word cache hit rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and specifically discloses a method and system for dynamic scheduling of multi-turn dialogue context. Background Technology

[0002] With the widespread application of large language models in scenarios such as intelligent customer service, personal assistants, and knowledge-based question answering, long-cycle, multi-turn dialogues have become the mainstream interaction form. In long-cycle, multi-turn dialogues, users may engage in multiple different topics over dozens or even hundreds of rounds, with frequent switching between topics. How to efficiently manage the dialogue context, retain key information and filter redundant content within a limited context window, and accurately restore the relevant context when the user returns to a previous topic has become a key technical problem for improving the dialogue quality and inference efficiency of large language models.

[0003] Existing application-layer multi-turn dialogue context management solutions mainly include sliding window mechanisms, global summarization mechanisms, and static retrieval-enhanced generation mechanisms. The sliding window mechanism only retains dialogue content from the most recent fixed number of turns or tokens. When the dialogue turns exceed the window's range, factual details and task states from earlier dialogues are directly discarded, preventing large language models from backtracking historical information. The global summarization mechanism preserves long-term information by compressing and summarizing historical dialogues, but the summarization process loses specific entity details, numerical parameters, and dialogue temporal logic, and the summarization itself consumes additional inference resources from the large language model. The static retrieval-enhanced generation mechanism segments historical dialogues and stores them in a vector database, retrieving relevant fragments in each turn of dialogue. However, this mechanism lacks the ability to identify topic boundaries, and the retrieval results often disrupt the coherence of dialogues within the same topic, and it cannot handle cross-topic references made by users through pronouns or vague expressions.

[0004] Furthermore, in real-world complex dialogue scenarios and the large language model technology ecosystem, existing solutions still face the following unresolved technical bottlenecks: First, high-frequency cross-topic interactions lead to context fragmentation. Real user dialogues are often non-linear; for example, a user might discuss topic A, then insert topic B, and then return to topic A. Existing systems lack mechanisms for re-entering and merging similar historical topics, generating independent context fragments with each topic switch, easily resulting in a large number of fragmented state nodes and severing the common context. Second, there is a contradiction between accuracy and cost in referential resolution and intent routing. When users use pronouns or vague expressions to ask questions across topics, traditional keyword matching directly fails, while each round of calling the large language model for intent routing introduces unacceptable latency and token overhead. Third, the utilization rate of the underlying large language model's prompt word caching mechanism is low. As prompt word caching technology supporting key-value caching reuse gradually becomes more widespread, existing systems lack orchestration strategies that separate long-term historical structures from instantaneous dynamic dialogues, leading to frequent prefix cache failures and failing to truly reduce the cost of long text reasoning.

[0005] Therefore, there is an urgent need for a dynamic scheduling scheme for multi-turn dialogue contexts that can achieve accurate identification of topic boundaries, efficient re-entry and merging of historical topics, and coordinated optimization with the underlying prompt word caching mechanism. Summary of the Invention

[0006] To overcome the above shortcomings, this invention provides a method and system for dynamic scheduling of multi-turn dialogue context, in order to solve the technical problems of context fragmentation caused by cross-topic issues, high cost of referential resolution, and low utilization rate of prompt word caching in the prior art.

[0007] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for dynamic scheduling of multi-turn dialogue contexts, the method comprising: In response to the current session meeting the context scheduling condition, the multi-turn dialogue data of the current session is obtained, the multi-turn dialogue data is subjected to noise reduction processing, the dialogue content to be retained is determined, and the dialogue content to be retained is written into the current context storage area. Based on the degree of semantic change between the newly written dialogue content in the current context storage area and the existing dialogue content in the current context storage area, determine whether a topic switch has occurred; When a topic switch is detected, a historical topic anchor is generated based on the dialogue content before the switch, and the historical topic anchor is associated with and stored with the corresponding historical dialogue data. In response to receiving user input for the current round, semantic representation is performed on the user input for the current round, and based on the matching relationship between the semantic representation and the stored historical topic anchors, it is determined whether a historical topic is hit; When a historical topic is hit, the historical dialogue data associated with the historical topic anchor is added to the model input context of the current round. Based on the update frequency of each component in the model input to be sent to the large language model in the current round, the model input is hierarchically assembled, and the assembled model input is sent to the large language model.

[0008] Optionally, the context scheduling conditions include round number conditions, capacity conditions, round end conditions, request conditions, and time interval conditions; The round count condition is that the number of dialogue rounds in the current session reaches a preset number; The capacity condition is when the cumulative text length or cumulative token count in the current context storage area reaches a preset threshold; The round ends when the current round of dialogue ends; The request condition is that a context reconstruction request has been received; The time interval condition is that the time interval between the current session and the last context scheduling reaches a preset time threshold.

[0009] Optionally, the noise reduction process includes pre-checking and semantic incremental filtering; The dependency pre-check includes obtaining the previous round model response content or the system output content returned to the user in the current round, detecting whether the previous round model response content or the system output content returned to the user contains a preset confirmation intent identifier, and if the confirmation intent identifier is contained, then the interaction content of the current round is determined as the dialogue content to be retained. The semantic incremental filtering includes using a semantic coding model to calculate the semantic similarity between the dialogue content of the current round and the dialogue content of the most recent N rounds in the current context storage area, where N is a preset positive integer. When the semantic similarity is greater than a preset similarity threshold and the text length of the dialogue content of the current round is less than a preset length threshold, the dialogue content of the current round is determined as dialogue content that will not be written into the current context storage area. Dialogue content determined to be retained in the dependency pre-check takes precedence over dialogue content determined not to be written to the current context storage area in the semantic incremental filtering.

[0010] Optionally, calculating the cosine distance between the first centroid vector and the second centroid vector, and using the cosine distance as the degree of semantic change, includes: Obtain the vector set of the first number of newly written dialogue content in the current context storage area, and calculate the first centroid vector of the vector set; Obtain the vector set of historical dialogue content located before the first number of rounds of dialogue content in the current context storage area, and calculate the second centroid vector of the vector set of historical dialogue content. Calculate the cosine distance between the first centroid vector and the second centroid vector, and use the cosine distance as the degree of semantic change; When the degree of semantic change is greater than a preset drift threshold for M consecutive rounds, a topic switch is determined to have occurred; M is a preset integer greater than or equal to 2.

[0011] Optionally, the historical topic anchor includes anchor identifier, summary information, status information, vector representation, time range, and storage address; The summary information is obtained by extracting a summary of the dialogue content before the switch; The status information is obtained by extracting unanswered questions, pending confirmations, pending tasks, and pending follow-up items from the dialogue content before the switch based on preset rules; The vector representation is obtained by aggregating and calculating the vector set of the dialogue content before the switch; The time range is used to characterize the range of dialogue rounds or time range corresponding to the dialogue content before the switch; The storage address is used to point to the historical dialogue data associated with the historical topic anchor.

[0012] Optionally, the matching relationship includes: The user input for the current round is vectorized to obtain the input vector; Calculate the cosine similarity between the input vector and the vector representation of each historical topic anchor point; When the highest cosine similarity is greater than the preset hit threshold, the hit historical topic is determined, and the historical topic anchor point with the highest cosine similarity is determined as the hit historical topic anchor point.

[0013] Optionally, adding the historical dialogue data associated with the hit historical topic anchor to the model input context of the current round includes: When the text length or number of tokens of the historical dialogue data does not exceed the preset dynamic area budget, the historical dialogue data is added to the current round's model input context in chronological order of the dialogue occurrence, at the position before the dialogue content in the current context storage area. When the text length or number of tokens in the historical dialogue data exceeds the preset dynamic area budget, the historical dialogue data is truncated, filtered, or summarized and compressed according to the proximate time, the priority of state information, and the similarity with the user input in the current round, and the processed historical dialogue data is added to the model input context of the current round.

[0014] Optionally, the method further includes: When subsequent dialogue content is collapsed and stored due to topic switching, it is determined whether the subsequent dialogue content and the hit historical topic anchor point meet the preset association conditions. The preset association conditions include similarity association conditions and continuous interval association conditions. The similarity association condition is that the similarity between the subsequent dialogue content and the vector representation of the hit historical topic anchor point is greater than a preset additional threshold. The continuous interval association condition is that the subsequent dialogue content is located within the continuous dialogue interval after the hit historical topic anchor point is hit, and no new topic switching is detected within the continuous dialogue interval. If the similarity association condition or the continuous interval association condition is met, the subsequent dialogue content is appended to the historical dialogue data associated with the hit historical topic anchor point to obtain the appended historical dialogue data. Based on the added historical dialogue data, the vector representation of the hit historical topic anchor point is recalculated, and the summary information and status information of the hit historical topic anchor point are extracted again.

[0015] Optionally, the layered assembly includes: A low-frequency update layer containing system-level instructions is placed in front of the model input; The mid-frequency update layer containing historical topic anchor indexes is placed after the low-frequency update layer; A high-frequency update layer containing the hit historical dialogue data, the dialogue content in the current context storage area, and the user input of the current round is placed at the back end of the model input.

[0016] Secondly, the present invention provides a multi-turn dialogue context dynamic scheduling system, comprising: The noise reduction and writing module is used to respond to the current session meeting the context scheduling conditions, obtain the multi-turn dialogue data of the current session, perform noise reduction processing on the multi-turn dialogue data, determine the dialogue content to be retained, and write the dialogue content to be retained into the current context storage area. The topic switching judgment module is used to determine whether a topic switching has occurred based on the degree of semantic change between the newly written dialogue content in the current context storage area and the existing dialogue content in the current context storage area. An anchor point generation and storage module is used to generate historical topic anchor points based on the dialogue content before the switch when a topic switch is determined to occur, and to associate and store the historical topic anchor points with the corresponding historical dialogue data. The historical topic matching module is used to respond to the user input received in the current round, perform semantic representation on the user input in the current round, and determine whether a historical topic is matched based on the matching relationship between the semantic representation and the stored historical topic anchors. The context addition module is used to add the historical dialogue data associated with the historical topic anchor to the current round's model input context when a historical topic is hit. The model input assembly module is used to perform hierarchical assembly of the model input according to the update frequency of each component in the model input to be sent to the large language model in the current round, and send the assembled model input to the large language model.

[0017] Compared with the closest existing technology, the present invention has the following advantages: This invention proposes a dynamic scheduling method and system for multi-turn dialogue context. It achieves historical topic matching by matching the vector representation of historical topic anchors with the semantic representation of the user input in the current turn. After the match, the associated historical dialogue data is added to the model input context, so that cross-topic follow-up questions initiated by users through pronouns or vague expressions can be accurately identified and responded to, thus solving the problem of traditional keyword matching failing in implicit reference scenarios.

[0018] This invention determines whether subsequent dialogue content should be added to the hit historical topic anchor point by pre-setting association conditions, thereby achieving seamless merging of newly generated dialogues after the cross-topic ends with the same historical interval, avoiding the context fragmentation and micro-state explosion problems caused by the traditional time-linear segmentation strategy in cross-chat scenarios.

[0019] This invention employs a two-stage noise reduction process that combines dependency pre-checking with semantic increment filtering. While filtering redundant dialogues without substantial semantic increments, it ensures that the short text content of key decisions made before the response system is forcibly retained by confirming the detection of intent identifiers, thereby avoiding the accidental deletion of key task status information and ensuring the logical closed loop of the dialogue state machine.

[0020] This invention uses the centroid cosine distance of continuous window dialogue vectors combined with a continuous multi-round judgment mechanism to detect topic drift. Compared with directly calling a large language model for topic discrimination, the computational cost is significantly reduced, and the topic segmentation boundary has stability and reproducibility.

[0021] This invention assembles components of the model input in a hierarchical manner based on their update frequency. The system-level instructions with the lowest update frequency are placed at the front end, the historical topic anchor indexes with a medium update frequency are placed in the middle section, and the dynamic content that changes in each round is placed at the back end. This ensures that the content at the front end and in the middle section remains stable in multiple rounds of interaction, thereby synergizing with the prefix prompt word caching mechanism of the underlying large language model, improving the hit rate of key-value caching, and reducing the computational overhead and first token latency of long text inference. Attached Figure Description

[0022] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0023] Figure 1 This is a flowchart of a multi-turn dialogue context dynamic scheduling method provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the noise reduction process that relies on pre-checking and semantic incremental filtering, provided in an embodiment of the present invention. Figure 3 A schematic diagram illustrating the principle of topic switching judgment based on the cosine distance of the centroid vector, provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of a multi-turn dialogue context dynamic scheduling system provided in an embodiment of the present invention; Figure 5 This is an internal structure diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0024] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of the present invention and are therefore merely examples, and should not be construed as limiting the scope of protection of the present invention.

[0025] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application should have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.

[0026] This invention provides a method and system for dynamic scheduling of multi-turn dialogue contexts. The embodiments of this invention are described below with reference to the accompanying drawings.

[0027] Example 1: As Figure 1As shown, Embodiment 1 of this application provides a multi-turn dialogue context dynamic scheduling method, applied to a dialogue system deployed with a large language model. The dialogue system includes a dialogue interaction interface, a context scheduling engine, a semantic encoding model, a historical topic storage area, and a large language model inference service. The context scheduling engine is communicatively connected to the dialogue interaction interface, the semantic encoding model, the historical topic storage area, and the large language model inference service. The current context storage area is located in the memory or cache of the context scheduling engine and is used to store the dialogue content corresponding to the currently active topic; the historical topic storage area is used to store collapsed historical topic anchors and their associated historical dialogue data.

[0028] Please see Figure 1 The method includes steps S101 to S106, which will be described in detail below.

[0029] Step S101: In response to the current session meeting the context scheduling condition, obtain the multi-turn dialogue data of the current session, perform noise reduction processing on the multi-turn dialogue data, determine the dialogue content to be retained, and write the dialogue content to be retained into the current context storage area.

[0030] The context scheduling conditions are used to trigger the context scheduling engine to process the dialogue data of the current session. In this embodiment, the context scheduling conditions include round count conditions, capacity conditions, round end conditions, request conditions, and time interval conditions; context scheduling is triggered when any one of these conditions is met.

[0031] The round count condition is that the number of dialogue rounds in the current session reaches a preset number. The preset number of rounds can be configured according to the context window size of the large language model and the dialogue scenario. For example, it can be set to 10 rounds, that is, a context scheduling is triggered every time the current session has completed a total of 10 rounds of dialogue.

[0032] The capacity condition is that the cumulative text length or cumulative token count in the current context storage area reaches a preset threshold. The preset threshold can be set as a preset proportion of the large language model context window capacity, for example, 4000 tokens. When the cumulative number of dialogue content tokens stored in the current context storage area reaches 4000, context scheduling is triggered to avoid the current context storage area occupying too much context window resources.

[0033] The end condition for each round is the completion of the current round of dialogue, that is, context scheduling is triggered after each round of user input and model response interaction. This condition is suitable for scenarios with high requirements for real-time context, ensuring that the context state is updated after each round of dialogue.

[0034] The request condition is receiving a context reconstruction request. The context reconstruction request can be initiated by the user or by other modules in the dialogue system when a specific event is detected, such as when the user inputs a clear topic switching command or when the system detects an abnormal context state.

[0035] The time interval condition is that the time interval between the current session and the last context scheduling reaches a preset time threshold. The preset time threshold can be set to, for example, 5 minutes, to periodically perform context tidying in sessions that have not been scheduled for a long time.

[0036] After triggering context scheduling, the context scheduling engine obtains multi-turn dialogue data for the current session from the dialogue interaction interface. The multi-turn dialogue data includes multiple sets of user input content and corresponding model response content, with each set of user input content and model response content constituting one turn of dialogue.

[0037] Please see Figure 2 The noise reduction process includes two stages: dependency pre-check and semantic incremental filtering. The two stages are executed sequentially, and the determination result of dependency pre-check takes precedence over the determination result of semantic incremental filtering.

[0038] The dependency pre-check is used to identify dialogue content that is crucial for making pre-requisite decisions in the response system, preventing such content from being misjudged as redundant and filtered out. Specifically, the context scheduling engine obtains the previous round's model response or the system's output to the user, and checks whether the previous round's model response or the system's output contains a preset confirmation intent identifier. The confirmation intent identifier includes, but is not limited to, interrogative sentences ending with a question mark, and statements such as "Please confirm," "Do you agree?", "Do you authorize?", "Please select," etc. If the previous round's model response or the system's output contains the confirmation intent identifier, it indicates that the user input in the current round is a response to the previous round's system request and is crucial content necessary for the task state machine closure. Regardless of the text length or semantic information content of the current round's interaction, the current round's interaction content is determined as dialogue content to be retained. For example, if the model's response in the previous round was "Do you confirm submitting this order?", and the user's input in the current round is "confirm", even though "confirm" only contains two words, because the previous round's response contained a confirmation intent identifier, the current round's "confirm" is determined to be dialogue content to be retained.

[0039] If the pre-check fails (i.e., the previous model response or the system's output to the user does not contain a confirmation intent identifier), the semantic incremental filtering stage begins. This semantic incremental filtering uses a semantic encoding model to calculate the semantic similarity between the current round of dialogue content and the N most recent rounds of dialogue content in the current context storage area, where N is a preset positive integer, for example, 3. The semantic encoding model is a lightweight text vector encoding model that can map text content into a fixed-dimensional vector representation. Specifically, the context scheduling engine vectorizes the current round of dialogue content and each of the N most recent rounds of dialogue content in the current context storage area, obtaining a current round vector and N historical round vectors. It then calculates the cosine similarity between the current round vector and each historical round vector, and takes the maximum value as the semantic similarity between the current round of dialogue content and the N most recent rounds of dialogue content. When the semantic similarity is greater than a preset similarity threshold and the text length of the current round's dialogue content is less than a preset length threshold, it indicates that the current round's dialogue content highly overlaps with the dialogue content of the most recent N rounds and is extremely short. This constitutes sequential content with no substantial incremental change. Therefore, the current round's dialogue content is determined not to be written into the current context storage area and can be marked with an ignore tag, receiving only a shallow response without being included in context management. The preset similarity threshold can be set, for example, to 0.95, and the preset length threshold can be set, for example, to 10 characters.

[0040] It is important to emphasize that dialogue content identified as to be retained in the dependency pre-check takes precedence over dialogue content identified as not to be written to the current context storage area in the semantic incremental filtering. That is, if the dialogue content of the current round has already been identified as to be retained in the dependency pre-check, then semantic incremental filtering will not be performed, and it will be directly written to the current context storage area. This priority design ensures that confirmation-type content for critical decisions in the response system will not be mistakenly deleted due to high semantic similarity or short text.

[0041] After noise reduction processing, the context scheduling engine writes the dialogue content identified as to be retained into the current context storage area. The current context storage area stores the dialogue content to be retained in the chronological order in which the dialogue occurred, with each dialogue content associated with its corresponding dialogue round number and timestamp.

[0042] Step S102: Determine whether a topic switch has occurred based on the degree of semantic change between the newly written dialogue content in the current context storage area and the existing dialogue content in the current context storage area.

[0043] Please see Figure 3 In this embodiment, the degree of semantic change is quantified by the cosine distance between centroid vectors, specifically including the following sub-steps: First, the vector set of the first number of newly written dialogue content rounds in the current context storage area is obtained, and the first centroid vector of the vector set is calculated. The first number is a preset positive integer, for example, set to 2, that is, taking the two most recently written dialogue content rounds. The context scheduling engine uses the semantic encoding model to vectorize the first number of dialogue content rounds, obtaining a first number of dialogue vectors, which constitute a first vector set. The arithmetic mean of all dialogue vectors in the first vector set is taken by dimension to obtain the first centroid vector. The first centroid vector represents the center position of the most recently written dialogue content in the semantic space.

[0044] Next, a vector set of historical dialogue content preceding the first number of rounds of dialogue content in the current context storage area is obtained, and a second centroid vector of the vector set of historical dialogue content is calculated. The historical dialogue content refers to all dialogue content in the current context storage area except for the most recently written first number of rounds of dialogue content, or the second number of rounds of dialogue content preceding the first number of rounds of dialogue content, where the second number is a preset positive integer, for example, 5. Similarly, the historical dialogue content is vectorized using the semantic encoding model to obtain a second vector set. The arithmetic mean of all dialogue vectors in the second vector set is taken by dimension to obtain the second centroid vector. The second centroid vector represents the center position of the previous dialogue content in the semantic space.

[0045] Then, the cosine distance between the first centroid vector and the second centroid vector is calculated, and this cosine distance is used as the degree of semantic change. The cosine distance ranges from 0 to 2; a larger value indicates a greater semantic difference between the two centroid vectors, i.e., a higher degree of topic drift. The cosine distance is calculated as follows: first, the dot product of the first centroid vector and the second centroid vector is calculated, then divided by the product of the magnitudes of the first and second centroid vectors to obtain the cosine similarity; subtracting the cosine similarity from 1 yields the cosine distance.

[0046] Finally, when the degree of semantic change exceeds a preset drift threshold for M consecutive rounds, a topic switch is determined to have occurred, where M is a preset integer greater than or equal to 2, for example, set to 2. The preset drift threshold is an adaptive threshold, which can be dynamically adjusted according to the semantic change distribution of historical dialogues, or it can be preset to a fixed value according to the dialogue scenario, for example, set to 0.3. Using continuous M-round determination instead of single-round determination effectively avoids misjudgments caused by semantic fluctuations in a single round of dialogue, ensuring that topic switching is only triggered when the dialogue topic undergoes continuous drift, thus improving the stability of topic boundary recognition.

[0047] When it is determined that no topic switch has occurred, the current context storage area remains in its current state and continues to receive subsequent dialogue content.

[0048] Step S103: When a topic switch is determined to occur, a historical topic anchor is generated based on the dialogue content before the switch, and the historical topic anchor is associated with and stored with the corresponding historical dialogue data.

[0049] The dialogue content before the switch refers to all dialogue content belonging to the old topic that is about to end, stored in the current context storage area before the topic switch occurs. The context scheduling engine removes the dialogue content before the switch from the current context storage area and stores it as historical dialogue data in the historical topic storage area, while generating historical topic anchors based on the dialogue content before the switch.

[0050] The historical topic anchor includes six fields: anchor identifier, summary information, status information, vector representation, time range, and storage address.

[0051] The anchor point identifier is a globally unique identifier for the historical topic anchor point, used to uniquely identify the historical topic anchor point in the historical topic storage area. The anchor point identifier can be generated using a universally unique identification code format, or it can be generated using a session identifier plus a sequence number format.

[0052] The summary information is obtained by extracting a summary from the dialogue content before the switch. This summary extraction can employ an extractive summarization method, selecting key sentences from the dialogue content before the switch to form a summary; or it can employ a generative summarization method, calling a lightweight summarization model to summarize and generate a summary of the dialogue content before the switch. This summary information is used to quickly display the core content of the historical topic in the historical topic anchor index, assisting the large language model in understanding the overall picture of the historical topic.

[0053] The status information is obtained by extracting unanswered questions, pending confirmations, pending tasks, and pending follow-up items from the dialogue content before the switch, based on preset rules. The preset rules include matching interrogative sentences, imperative sentences, and statements containing keywords such as "pending," "needed," and "not yet" using regular expressions. This status information is used to prompt the large language model for unfinished items in the historical topic when the topic is re-entered, ensuring the continuity of the task status.

[0054] The vector representation is obtained by aggregating and calculating the vector set of the dialogue content before the switch. Specifically, each round of dialogue in the dialogue content before the switch is vectorized using the semantic encoding model to obtain a dialogue vector set for that topic. The arithmetic mean of all vectors in the dialogue vector set is then taken according to their dimensions to obtain the vector representation. The vector representation is an aggregated vector of the historical topic anchor points in a high-dimensional semantic space, used for subsequent similarity matching with the semantic representation of the user input in the current round.

[0055] The time range is used to characterize the range of dialogue rounds or time periods corresponding to the dialogue content before the switch, including the start round number, end round number, start timestamp, and end timestamp. The time range is used to retrieve and locate historical dialogue data by time dimension when needed.

[0056] The storage address is used to point to the storage location of the historical dialogue data associated with the historical topic anchor in the historical topic storage area. The complete historical dialogue data corresponding to the historical topic anchor can be quickly read through the storage address.

[0057] After generating historical topic anchors, the context scheduling engine stores the historical topic anchors in the anchor index of the historical topic storage area, and stores the dialogue content before the switch as historical dialogue data in the data area of ​​the historical topic storage area. The association between the historical topic anchors and the historical dialogue data is established through the storage address of the historical topic anchors. Meanwhile, the current context storage area only retains the dialogue content of the new topic after the topic switch.

[0058] Step S104: In response to receiving user input for the current round, perform semantic representation on the user input for the current round, and determine whether a historical topic is matched based on the matching relationship between the semantic representation and the stored historical topic anchors.

[0059] In this embodiment, the matching relationship is achieved through vector similarity calculation, specifically including the following sub-steps: First, the user input for the current round is vectorized to obtain an input vector. The context scheduling engine uses the same semantic encoding model as in the previous steps to map the user input text for the current round into a fixed-dimensional vector representation, i.e., the input vector. Using the same semantic encoding model ensures that the user input vector and the vector representation of historical topic anchors are in the same semantic space, making similarity calculations comparable.

[0060] Next, the cosine similarity between the input vector and the vector representations of each historical topic anchor point is calculated. The context scheduling engine traverses all historical topic anchor points in the anchor index of the historical topic storage area, and calculates the cosine similarity between the input vector and the vector representation of each historical topic anchor point. The cosine similarity value ranges from -1 to 1, with a larger value indicating that the current round of user input is more semantically relevant to the historical topic.

[0061] Finally, when the highest cosine similarity is greater than a preset hit threshold, a historical topic is determined to have been hit, and the historical topic anchor with the highest cosine similarity is identified as the hit historical topic anchor. The preset hit threshold can be configured according to the characteristics of the dialogue scenario and the semantic encoding model, for example, set to 0.7. When the cosine similarity between all historical topic anchors and the input vector is not greater than the preset hit threshold, a historical topic is determined not to have been hit, and the current round of dialogue is considered to either continue the topic in the current context storage area or start a new topic.

[0062] Through the vector matching mechanism described above, this embodiment can naturally support implicit referential resolution. For example, if a user has discussed "Beijing travel guide" in a historical topic, and later switches to another topic, the user may input "Is that place worth visiting?" Although the input does not explicitly mention "Beijing", its vector representation in the high-dimensional semantic space will have a high cosine similarity with the vector representation of the historical topic anchor point containing "Beijing travel", thus hitting the historical topic and achieving cross-topic implicit referential recognition.

[0063] Step S105: When a historical topic is hit, the historical dialogue data associated with the hit historical topic anchor point is added to the model input context of the current round.

[0064] The context scheduling engine reads the corresponding historical dialogue data from the historical topic storage area based on the storage address of the hit historical topic anchor. The historical dialogue data is a complete dialogue record under that historical topic, including multiple sets of user inputs and model responses.

[0065] When adding historical dialogue data to the model input context, it is necessary to consider the relationship between the size of the historical dialogue data and the preset dynamic range budget, and handle it in two cases: In the first scenario, when the text length or number of tokens in the historical dialogue data does not exceed the preset dynamic area budget, the historical dialogue data is added to the current round's model input context, positioned before the dialogue content in the current context storage area, according to the chronological order of the dialogue occurrences. The preset dynamic area budget is the maximum number of tokens allocated to the historical dialogue data in the model input context, which can be set, for example, to 2000 tokens. Placing the historical dialogue data before the dialogue content in the current context storage area ensures the continuity of the dialogue sequence, allowing the large language model to first read the complete context of the historical topics, and then read the dialogue content of the currently active topics and the user input of the current round.

[0066] In the second scenario, when the text length or number of tokens in the historical dialogue data exceeds the preset dynamic zone budget, the historical dialogue data is truncated, filtered, or summarized and compressed according to temporal proximateness, status information priority, and similarity to the current round's user input. The processed historical dialogue data is then added to the current round's model input context. Specifically, the temporal proximateness dimension prioritizes retaining the most recent dialogue rounds in the historical dialogue data; the status information priority dimension prioritizes retaining dialogue content related to unanswered questions, pending confirmations, pending tasks, and pending follow-up items recorded in the status information of the historical topic anchors; and the similarity to the current round's user input prioritizes retaining dialogue rounds with high semantic similarity to the current round's user input. The historical dialogue data is sorted and filtered based on these three dimensions, selecting content with a total token count not exceeding the preset dynamic zone budget to be added to the model input context. If the budget is still exceeded after filtering, the remaining content is summarized and compressed, replacing the original dialogue content with a summary. Through this processing, key historical information related to the current round's user input is preserved to the maximum extent within the limited dynamic zone budget.

[0067] When a historical topic is not matched, the model input context does not include historical dialogue data, but only the dialogue content in the current context storage area and the user input in the current round.

[0068] Step S106: Based on the update frequency of each component in the model input to be sent to the large language model in the current round, perform hierarchical assembly of the model input, and send the assembled model input to the large language model.

[0069] In this embodiment, the model input is divided into three levels according to the update frequency of each component: low-frequency update layer, medium-frequency update layer, and high-frequency update layer, arranged from front to back in order of update frequency from low to high.

[0070] The low-frequency update layer is placed at the front end of the model input and contains system-level instructions. These system-level instructions include global configuration information such as the personality settings, role definitions, output format constraints, and security rules of the large language model. These system-level instructions remain essentially unchanged throughout the entire session, have the lowest update frequency, and are placed at the very front of the model input, ensuring complete consistency of text prefixes across multiple rounds of interaction, thereby permanently hitting the prefix suggestion cache of the underlying large language model.

[0071] The mid-frequency update layer, placed after the low-frequency update layer, contains a historical topic anchor index. This index includes the anchor identifiers and summary information of all historical topic anchors in the historical topic storage area, but does not contain complete historical dialogue data. The update frequency of the historical topic anchor index is moderate: during multiple rounds of interaction without boundary segmentation of the current topic, the index remains text-locked; incremental appending or state updates are only performed when topic folding is triggered to generate new historical topic anchors, or when cross-topic re-entry and merging of historical topic anchors occurs. This long-term stability and low-frequency abrupt changes ensure that the mid-frequency update layer can reliably hit the prefix cache of the underlying large language model within the lifecycle of a single topic.

[0072] The high-frequency update layer is located at the back end of the model input and includes the hit historical dialogue data, the dialogue content in the current context storage area, and the user input in the current round. The content of the high-frequency update layer is updated with each round of dialogue and changes most frequently. Placing it at the back end of the model input can prevent its frequent changes from disrupting the prefix cache continuity of the front-end low-frequency update layer and the mid-end medium-frequency update layer, so that the stable content of the front-end and mid-end can be continuously reused by the key-value cache of the underlying large language model.

[0073] After completing the hierarchical assembly, the context scheduling engine sends the assembled model input to the large language model inference service for inference, obtains the response content generated by the large language model, and returns the response content to the user through the dialogue interaction interface. Simultaneously, the user input and model response content of the current round are included in the processing scope of the next round of context scheduling.

[0074] After hitting a historical topic in step S105 and adding the historical dialogue data associated with the hit historical topic anchor point to the model input context, when subsequent dialogue content is folded and stored due to topic switching, an append merging mechanism needs to be executed to avoid context fragmentation caused by cross-topics.

[0075] Specifically, when subsequent dialogue content is collapsed and stored due to topic switching, the context scheduling engine determines whether the subsequent dialogue content and the hit historical topic anchor point meet preset association conditions. The preset association conditions include similarity association conditions and continuous interval association conditions; meeting either condition is considered to meet the preset association conditions.

[0076] The similarity association condition is that the similarity between the subsequent dialogue content and the vector representation of the hit historical topic anchor point is greater than a preset additional threshold. Specifically, the subsequent dialogue content is vectorized using the semantic encoding model, and the cosine similarity between it and the vector representation of the hit historical topic anchor point is calculated. When the cosine similarity is greater than the preset additional threshold, it indicates that the subsequent dialogue content is highly semantically related to the historical topic and belongs to the continuation of the same topic. The preset additional threshold can be the same as the preset hit threshold, or it can be set to a different value as needed.

[0077] The continuous interval association condition is that the subsequent dialogue content is located within the continuous dialogue interval after the hit historical topic anchor point is hit, and no new topic switching is detected within the continuous dialogue interval. Specifically, from the round in which the hit historical topic anchor point is hit to the round in which the subsequent dialogue content is collapsed and stored, if no new topic switching event occurs within this interval, it indicates that the subsequent dialogue content is a dialogue that continues after the historical topic is re-entered, and belongs to the natural continuation of the historical topic.

[0078] When the similarity association condition or the continuous interval association condition is met, the context scheduling engine does not create a new historical topic anchor point. Instead, it appends the subsequent dialogue content to the historical dialogue data associated with the hit historical topic anchor point, resulting in appended historical dialogue data. The appending is performed in the chronological order of the dialogue occurrence, adding the subsequent dialogue content to the end of the original historical dialogue data.

[0079] Subsequently, based on the added historical dialogue data, the vector representation of the hit historical topic anchors is recalculated, and the summary information and status information of the hit historical topic anchors are re-extracted. Specifically, the semantic encoding model is used to re-vectorize and aggregate all the added historical dialogue data, updating the vector representation; the summary information is re-extracted from all the added historical dialogue data, updating the summary information; and unanswered questions, pending confirmations, pending tasks, and pending follow-up items are re-extracted from all the added historical dialogue data based on preset rules, updating the status information. Simultaneously, the time range of the historical topic anchors is updated, extending the end round number and end timestamp to the round and time corresponding to the subsequent dialogue content.

[0080] Through the above-mentioned addition and merging mechanism, when a user re-enters a historical topic, engages in several rounds of dialogue, and then switches topics again, the newly generated dialogue content will not generate independent fragmented anchor points. Instead, it will be seamlessly stitched into the original historical topic anchor points, completely eliminating the problem of anchor point fragmentation in cross-dialogue scenarios and maintaining the integrity and coherence of the context of the same topic.

[0081] Example 2: Based on the same technical concept, Example 2 of this application also provides a multi-turn dialogue context dynamic scheduling system, such as... Figure 4 As shown, it includes: a noise reduction writing module 210, a topic switching judgment module 220, an anchor point generation and storage module 230, a historical topic hit module 240, a context addition module 250, and a model input assembly module 260.

[0082] The noise reduction writing module 210 is configured to, in response to the current session meeting the context scheduling condition, acquire the multi-turn dialogue data of the current session, perform noise reduction processing on the multi-turn dialogue data, determine the dialogue content to be retained, and write the dialogue content to be retained into the current context storage area. The noise reduction writing module performs all the functions of the aforementioned step S101, including the detection of the context scheduling condition, the execution of dependency pre-checking, and the semantic incremental filtering.

[0083] The topic switching judgment module 220 is used to determine whether a topic switch has occurred based on the degree of semantic change between the newly written dialogue content in the current context storage area and the existing dialogue content in the current context storage area. The topic switching judgment module performs all the functions of the aforementioned step S102, including the calculation of the first centroid vector and the second centroid vector, the calculation of the cosine distance, and the judgment in M ​​consecutive rounds.

[0084] The anchor point generation and storage module 230 is used to generate historical topic anchor points based on the dialogue content before the switch when a topic switch is determined to occur, and to associate and store the historical topic anchor points with the corresponding historical dialogue data. The anchor point generation and storage module performs all the functions of the aforementioned step S103, including the generation of each field of the historical topic anchor points and the association and storage of the historical topic anchor points with the historical dialogue data.

[0085] The historical topic matching module 240 is used to respond to the user input received in the current round, perform semantic representation on the user input in the current round, and determine whether a historical topic is matched based on the matching relationship between the semantic representation and the stored historical topic anchors. The historical topic matching module performs all the functions of the aforementioned step S104, including input vectorization, cosine similarity calculation, and matching threshold determination.

[0086] The context addition module 250 is used to add the historical dialogue data associated with the hit historical topic anchor point to the model input context of the current round when a historical topic is hit. The context addition module performs all the functions of the aforementioned step S105, including dynamic area budget judgment, extraction and filtering of historical dialogue data, and summary compression. In addition, the context addition module also performs the functions of the aforementioned appending and merging mechanism, including preset association condition judgment, appending subsequent dialogue content, and updating historical topic anchor points.

[0087] The model input assembly module 260 is used to perform hierarchical assembly of the model input according to the update frequency of each component in the model input to be sent to the large language model in the current round, and then send the assembled model input to the large language model. The model input assembly module performs all the functions of the aforementioned step S106, including hierarchical assembly of low-frequency update layer, medium-frequency update layer and high-frequency update layer.

[0088] The modules described above are interconnected via an internal bus to collaboratively perform dynamic scheduling of multi-turn dialogue contexts. The system can be deployed on a server and provides context scheduling services to dialogue applications through an application programming interface (API).

[0089] Example 3: In one embodiment, Example 3 of the present invention also provides an electronic device; the electronic device may be a terminal, and its internal structure diagram may be as follows. Figure 5 As shown. The electronic device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements the multi-turn dialogue context dynamic scheduling method described in any one of steps S101 to S106. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.

[0090] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0091] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0093] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0094] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0095] The above are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval.

Claims

1. A method for dynamic scheduling of multi-turn dialogue context, characterized in that, The method includes: In response to the current session meeting the context scheduling condition, the multi-turn dialogue data of the current session is obtained, the multi-turn dialogue data is subjected to noise reduction processing, the dialogue content to be retained is determined, and the dialogue content to be retained is written into the current context storage area. Based on the degree of semantic change between the newly written dialogue content in the current context storage area and the existing dialogue content in the current context storage area, determine whether a topic switch has occurred; When a topic switch is detected, a historical topic anchor is generated based on the dialogue content before the switch, and the historical topic anchor is associated with and stored with the corresponding historical dialogue data. In response to receiving user input for the current round, semantic representation is performed on the user input for the current round, and based on the matching relationship between the semantic representation and the stored historical topic anchors, it is determined whether a historical topic is hit; When a historical topic is hit, the historical dialogue data associated with the historical topic anchor is added to the model input context of the current round. Based on the update frequency of each component in the model input to be sent to the large language model in the current round, the model input is hierarchically assembled, and the assembled model input is sent to the large language model.

2. The method according to claim 1, characterized in that, The context scheduling conditions include round number conditions, capacity conditions, round end conditions, request conditions, and time interval conditions; The round count condition is that the number of dialogue rounds in the current session reaches a preset number; The capacity condition is when the cumulative text length or cumulative token count in the current context storage area reaches a preset threshold; The round ends when the current round of dialogue ends; The request condition is that a context reconstruction request has been received; The time interval condition is that the time interval between the current session and the last context scheduling reaches a preset time threshold.

3. The method according to claim 1, characterized in that, The noise reduction process includes dependency pre-checking and semantic incremental filtering; The dependency pre-check includes obtaining the previous round model response content or the system output content returned to the user in the current round, detecting whether the previous round model response content or the system output content returned to the user contains a preset confirmation intent identifier, and if the confirmation intent identifier is contained, then the interaction content of the current round is determined as the dialogue content to be retained. The semantic incremental filtering includes using a semantic coding model to calculate the semantic similarity between the dialogue content of the current round and the dialogue content of the most recent N rounds in the current context storage area, where N is a preset positive integer. When the semantic similarity is greater than a preset similarity threshold and the text length of the dialogue content of the current round is less than a preset length threshold, the dialogue content of the current round is determined as dialogue content that will not be written into the current context storage area. Dialogue content determined to be retained in the dependency pre-check takes precedence over dialogue content determined not to be written to the current context storage area in the semantic incremental filtering.

4. The method according to claim 1, characterized in that, The step of calculating the cosine distance between the first centroid vector and the second centroid vector, and using the cosine distance as the degree of semantic change, includes: Obtain the vector set of the first number of newly written dialogue content in the current context storage area, and calculate the first centroid vector of the vector set; Obtain the vector set of historical dialogue content located before the first number of rounds of dialogue content in the current context storage area, and calculate the second centroid vector of the vector set of historical dialogue content. Calculate the cosine distance between the first centroid vector and the second centroid vector, and use the cosine distance as the degree of semantic change; When the degree of semantic change is greater than a preset drift threshold for M consecutive rounds, a topic switch is determined to have occurred; M is a preset integer greater than or equal to 2.

5. The method according to claim 1, characterized in that, The historical topic anchor points include anchor point identifier, summary information, status information, vector representation, time range, and storage address; The summary information is obtained by extracting a summary of the dialogue content before the switch; The status information is obtained by extracting unanswered questions, pending confirmations, pending tasks, and pending follow-up items from the dialogue content before the switch based on preset rules; The vector representation is obtained by aggregating and calculating the vector set of the dialogue content before the switch; The time range is used to characterize the range of dialogue rounds or time range corresponding to the dialogue content before the switch; The storage address is used to point to the historical dialogue data associated with the historical topic anchor.

6. The method according to claim 1, characterized in that, The matching relationships include: The user input for the current round is vectorized to obtain the input vector; Calculate the cosine similarity between the input vector and the vector representation of each historical topic anchor point; When the highest cosine similarity is greater than the preset hit threshold, the hit historical topic is determined, and the historical topic anchor point with the highest cosine similarity is determined as the hit historical topic anchor point.

7. The method according to claim 1, characterized in that, The process of adding the historical dialogue data associated with the hit historical topic anchor to the model input context of the current round includes: When the text length or number of tokens of the historical dialogue data does not exceed the preset dynamic area budget, the historical dialogue data is added to the current round's model input context in chronological order of the dialogue occurrence, at the position before the dialogue content in the current context storage area. When the text length or number of tokens in the historical dialogue data exceeds the preset dynamic area budget, the historical dialogue data is truncated, filtered, or summarized and compressed according to the proximate time, the priority of state information, and the similarity with the user input in the current round, and the processed historical dialogue data is added to the model input context of the current round.

8. The method according to claim 1, characterized in that, The method further includes: When subsequent dialogue content is collapsed and stored due to topic switching, it is determined whether the subsequent dialogue content and the hit historical topic anchor point meet the preset association conditions. The preset association conditions include similarity association conditions and continuous interval association conditions. The similarity association condition is that the similarity between the subsequent dialogue content and the vector representation of the hit historical topic anchor point is greater than a preset additional threshold. The continuous interval association condition is that the subsequent dialogue content is located within the continuous dialogue interval after the hit historical topic anchor point is hit, and no new topic switching is detected within the continuous dialogue interval. If the similarity association condition or the continuous interval association condition is met, the subsequent dialogue content is appended to the historical dialogue data associated with the hit historical topic anchor point to obtain the appended historical dialogue data. Based on the added historical dialogue data, the vector representation of the hit historical topic anchor point is recalculated, and the summary information and status information of the hit historical topic anchor point are extracted again.

9. The method according to claim 1, characterized in that, The layered assembly includes: A low-frequency update layer containing system-level instructions is placed in front of the model input; The mid-frequency update layer containing historical topic anchor indexes is placed after the low-frequency update layer; A high-frequency update layer containing the hit historical dialogue data, the dialogue content in the current context storage area, and the user input of the current round is placed at the back end of the model input.

10. A multi-turn dialogue context dynamic scheduling system, characterized in that, include: The noise reduction and writing module is used to respond to the current session meeting the context scheduling conditions, obtain the multi-turn dialogue data of the current session, perform noise reduction processing on the multi-turn dialogue data, determine the dialogue content to be retained, and write the dialogue content to be retained into the current context storage area. The topic switching judgment module is used to determine whether a topic switching has occurred based on the degree of semantic change between the newly written dialogue content in the current context storage area and the existing dialogue content in the current context storage area. An anchor point generation and storage module is used to generate historical topic anchor points based on the dialogue content before the switch when a topic switch is determined to occur, and to associate and store the historical topic anchor points with the corresponding historical dialogue data. The historical topic matching module is used to respond to the user input received in the current round, perform semantic representation on the user input in the current round, and determine whether a historical topic is matched based on the matching relationship between the semantic representation and the stored historical topic anchors. The context addition module is used to add the historical dialogue data associated with the historical topic anchor to the current round's model input context when a historical topic is hit. The model input assembly module is used to perform hierarchical assembly of the model input according to the update frequency of each component in the model input to be sent to the large language model in the current round, and send the assembled model input to the large language model.