Conversation memory method, electronic device, and computer-readable storage medium

WO2026194495A1PCT designated stage Publication Date: 2026-09-24HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/075705
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-03-21
Filing Date
2026-01-29
Publication Date
2026-09-24

Smart Images

  • Figure CN2026075705_24092026_PF_FP_ABST
    Figure CN2026075705_24092026_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a conversation memory method, an electronic device, and a computer-readable storage medium. In the conversation memory method, after acquiring a conversation statement inputted by a user in a current round of conversation (301), the electronic device performs role determination on the conversation statement, extracts entities in the conversation statement, identifies the relationship between the entities (302), generates an event interaction unit from the entities on the basis of the role determination result and the relationship between the entities (303), and finally generates an event relationship graph of the current round of conversation on the basis of the event interaction unit and according to the sequence in which the entities appear in the conversation statement inputted by the user (304). Thus, the electronic device can perform memory management on multiple rounds of conversations on the basis of the event relationship graph, ensuring the integrity of long-term multi-round conversation memory management, and achieving deep understanding of context information.
Need to check novelty before this filing date? Find Prior Art

Description

Dialogue memory methods, electronic devices and computer-readable storage media

[0001] This application claims priority to Chinese Patent Application No. 202510344437.5, filed on March 21, 2025, entitled "Dialogue Memory Method, Electronic Device and Computer-Readable Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of smart terminal technology, and in particular to a dialogue memory method, an electronic device, and a computer-readable storage medium. Background Technology

[0003] With the rapid development of artificial intelligence technology, dialogue systems have been widely used in customer service, virtual assistants, education, and healthcare. However, existing dialogue systems still face many challenges, among which memory management is a key issue. Traditional dialogue systems typically rely on simple historical dialogue records, processing user input through linear retrieval or rule matching. While this approach performs adequately in scenarios with short-term memory requirements, it falls short in long dialogues, complex contexts, or scenarios requiring contextual reasoning.

[0004] Existing technologies for dialogue memory management mainly include text retrieval-based, sequence model-based, and knowledge graph-based solutions. Text retrieval-based methods store dialogue history in text form and rely on keyword matching or semantic retrieval techniques to locate relevant content; this approach is low-cost and suitable for simple dialogue scenarios. Sequence model-based solutions use deep learning techniques to encode dialogue history into latent states, achieving implicit memory of the context. Knowledge graph-based methods, on the other hand, use structured graphical representations to explicitly model entities and relationships in the dialogue and combine them with external knowledge bases to provide semantic support for the dialogue.

[0005] However, text-based retrieval methods struggle to handle complex contextual relationships, lack semantic understanding capabilities, and their retrieval efficiency decreases as the data volume increases. While sequence model-based techniques can capture complex contexts, their hidden states are black-boxed, lacking interpretability and transparency, and making it difficult to dynamically update memory content. Knowledge graph-based solutions demonstrate advantages in explicit modeling, but their reliance on high-quality knowledge bases makes their construction costly, and their ability to update relationships in multi-turn dialogues is weak, failing to fully reflect the dynamic semantic changes of the dialogue. These shortcomings limit the practical application effectiveness of existing dialogue memory management solutions in complex multi-turn dialogue scenarios. Summary of the Invention

[0006] This application provides a dialogue memory method, an electronic device, and a computer-readable storage medium to enable the electronic device to manage the memory of multi-turn dialogues based on an event relationship diagram, ensuring the integrity of memory management in long-term multi-turn dialogues and achieving a deep understanding of contextual information.

[0007] In a first aspect, embodiments of this application provide a dialogue memory method, which acquires dialogue statements input by a user in the current round of dialogue; performs role determination on the dialogue statements and extracts entities from the dialogue statements, and identifies the relationships between the entities; generates event interaction units from the entities based on the role determination results and the relationships between the entities; and generates an event relationship diagram for the current round of dialogue based on the event interaction units and the order in which the entities appear in the dialogue statements input by the user; wherein each node in the event relationship diagram represents an event.

[0008] In the aforementioned dialogue memory method, after the electronic device acquires the dialogue statements input by the user in the current round of dialogue, it performs role determination on the dialogue statements and extracts entities from them. It then identifies the relationships between these entities and, based on the role determination results and the relationships between them, generates event interaction units. Finally, based on these event interaction units and the order in which the entities appear in the user-input dialogue statements, it generates an event relationship graph for the current round of dialogue. This allows the electronic device to manage the memory of multi-turn dialogues based on the event relationship graph, ensuring the integrity of memory management in long-term multi-turn dialogues and achieving a deep understanding of contextual information. Furthermore, this method can accurately extract core semantics, avoiding the problem of incomplete semantic understanding caused by information redundancy or loss in existing technologies. This improves the usability and accuracy of semantic information in multi-turn dialogues and enhances the ability to understand user intent.

[0009] In one possible implementation, after generating the event relationship graph for the current round of dialogue, the electronic device can also determine the relationships between events in the event relationship graph based on the event relationship graph for the current round of dialogue; and adjust the connection relationships between events in the event relationship graph for the current round of dialogue based on the relationships between the events.

[0010] In one possible implementation, after adjusting the connection relationships between events in the event relationship graph of the current round of dialogue based on the relationships between the events mentioned above, the electronic device can also calculate the importance contribution value of the events based on the importance of the events in the event relationship graph of the current round of dialogue and the decision-making needs.

[0011] In this implementation, calculating the importance contribution value of the aforementioned events is to optimize resource allocation and inference efficiency in event management. After calculating the importance contribution value of the events, events with higher importance contribution values ​​are more easily retrieved when tracing back events in subsequent rounds, thereby making it easier for the dialogue system to understand the intent of the dialogue statements entered by the user in subsequent rounds of dialogue.

[0012] In one possible implementation, after generating the event relationship graph for the current round of dialogue, the electronic device can also obtain the event relationship graphs for the previous rounds; based on the event relationship graph for the current round of dialogue and the event relationship graphs for the previous rounds, the device can identify the state changes of the same event at different times; and based on the state changes, the device can perform update or deletion operations on the events in the event relationship graphs for the previous rounds.

[0013] In one possible implementation, after obtaining the event relationship graph of the historical rounds, the electronic device can also insert new events into the event relationship graph of the historical rounds; wherein, the new events include events added to the event relationship graph of the current round of dialogue relative to the event relationship graph of the historical rounds; and adjust the connection relationship between events in the event relationship graph of the historical rounds.

[0014] The above implementation method effectively links historical information of dialogues through hierarchical management, thereby uncovering implicit causal relationships and improving the overall structural organization efficiency of the event relationship diagram.

[0015] In one possible implementation, after generating event interaction units from the entities based on the role judgment result and the relationship between the entities, the electronic device can also determine whether there is a conflict between the event interaction units; if so, it performs a conflict resolution operation on the conflicting event interaction units.

[0016] Secondly, embodiments of this application provide an electronic device, including: one or more processors; a memory; multiple application programs; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the electronic device, cause the electronic device to perform the method provided in the first aspect.

[0017] It should be understood that the second aspect of the embodiments of this application is consistent with the technical solution of the first aspect of the embodiments of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be described again.

[0018] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method provided in the first aspect.

[0019] Fourthly, embodiments of this application provide a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform the method provided in the first aspect.

[0020] In one possible design, the program in the fourth aspect can be stored wholly or partially on a storage medium packaged with the processor, or it can be stored wholly or partially on a memory not packaged with the processor. Attached Figure Description

[0021] Figure 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0022] Figure 2 is a schematic diagram of the system architecture provided in one embodiment of this application;

[0023] Figure 3 is a flowchart of a dialogue memory method provided in an embodiment of this application;

[0024] Figure 4 is a schematic diagram of an event relationship provided in one embodiment of this application;

[0025] Figure 5 is a schematic diagram of an event relationship provided in another embodiment of this application;

[0026] Figure 6 is a schematic diagram of an event relationship provided in another embodiment of this application;

[0027] Figure 7 is a schematic diagram of an event relationship provided in another embodiment of this application;

[0028] Figure 8 is a schematic diagram of an event relationship provided in another embodiment of this application;

[0029] Figure 9 is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0030] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.

[0031] Existing human-computer dialogue systems have the following problems: 1) The model does not pay enough attention to and understand the core events and supporting events during the dialogue process; 2) The ability to handle memory conflicts caused by information updates during the dialogue process is lacking; 3) The modeling of dialogue events is not transparent to the user and is difficult to analyze.

[0032] With the help of large models, existing technologies mainly employ cue engineering to reorganize, summarize, and synthesize dialogue history, then input it into the large model to generate dialogue responses. This can be seen as an incremental memory-based approach to assist human-computer dialogue understanding. However, in dialogue scenarios, as the dialogue progresses, summarization presents two problems: 1) information overload; 2) information conflict. If the dialogue is synthesized before being input into the model, the content of the summary will gradually exceed the size of the summary window, making it difficult for the model to understand all the dialogue information. On the other hand, if the summary is synthesized before generating responses, numerous information conflicts between summaries will interfere with the model.

[0033] Event graphs are a structured graph representation method based on event semantics, capable of capturing dynamic relationships and contextual semantics between entities. In natural language processing, event graphs have been widely applied to tasks such as information extraction, text generation, and semantic understanding. Compared to simple text representations, event graphs offer advantages in efficiency and intuitiveness, helping systems organize and process information in a way that more closely resembles human logic. Therefore, introducing event graphs into dialogue memory management can effectively address the problem of low efficiency in memory representation and utilization in existing methods.

[0034] The graph structure of event graphs can make memory management and updating transparent and interpretable, while its explicit relational representation can reduce the storage of redundant information and improve the efficiency and robustness of dialogue systems.

[0035] Existing research on event graphs largely focuses on the extraction and reasoning of event relationships, with few practical applications combining them with dialogue systems. In dialogue scenarios, user statements typically contain complex semantic relationships, including temporal, causal, and intentional aspects. By using event graphs to decompose the content of user dialogue into several event nodes and establishing relationships between these nodes, a deep understanding of contextual information can be achieved. Furthermore, dynamic graph updates enable efficient management of memorized content. In addition, event graphs are naturally well-suited for integration with knowledge graphs, allowing dialogue systems to be more flexible when external knowledge support is required.

[0036] However, current methods using event diagrams have the following problems: 1) Core events and supporting events are equally important to the development of the dialogue, and existing methods completely ignore supporting events; 2) The chronological order is only the basic relationship between events in the dialogue, and more important relationships between events, such as causality, coreference and / or inclusion, are not reflected; 3) Existing methods do not have the ability to update events.

[0037] Based on the above problems, this application provides a dialogue memory method that enables electronic devices to manage the memory of multi-turn dialogues based on event relationship diagrams, ensuring the integrity of memory management in long-term multi-turn dialogues and achieving a deep understanding of contextual information.

[0038] The dialogue memory method provided in this application can be applied to electronic devices, wherein the electronic device can be a server, such as a dialogue system server, which can be deployed in the cloud; or, the electronic device can be a terminal device, such as a smartphone, tablet computer, wearable device, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA) device. This application does not limit the specific type of electronic device.

[0039] For example, Figure 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. As shown in Figure 1, the electronic device 100 includes a processor 110 and a communication interface 120. Optionally, the electronic device 100 may further include a memory 130. The processor 110, the communication interface 120, and the memory 130 can communicate with each other through internal connection channels to transmit control and / or data signals. The memory 130 is used to store computer programs, and the processor 110 is used to call and run the computer programs from the memory 130.

[0040] The processor 110 and memory 130 can be combined into a single processing device, but more commonly they are independent components. The processor 110 is used to execute the program code stored in the memory 130. In specific implementations, the memory 130 can be integrated into the processor 110, or it can be independent of the processor 110.

[0041] In addition, to further enhance the functionality of the electronic device 100, the electronic device 100 may also include one or more of an input unit 160 and a display unit 170.

[0042] Optionally, the electronic device 100 may further include a power supply 150 for providing power to various devices or circuits in the electronic device 100.

[0043] It should be understood that the processor 110 in the electronic device 100 shown in Figure 1 can be a system-on-a-chip (SoC). The processor 110 may include a central processing unit (CPU) and may further include other types of processors, such as a graphics processing unit (GPU).

[0044] For ease of understanding, the following embodiments of this application will take an electronic device with the structure shown in FIG1 as an example, and in conjunction with the accompanying drawings and application scenarios, will specifically illustrate the dialogue memory method provided by the embodiments of this application.

[0045] The dialogue memory method provided in this application primarily addresses two core issues in memory management of event graph-based dialogue systems. First, in multi-turn dialogues, accurately understanding user semantics and dynamically extracting core and supporting events is a critical challenge. Core events are the main objectives or key semantic points of the dialogue, while supporting events are contextual information or supplementary semantics associated with the core events. Existing technologies often fail to effectively distinguish between core and supporting events, leading to information loss or redundant storage during memory updates and semantic reasoning. Second, discovering, reorganizing, and dynamically updating relationships between dialogue events is another significant challenge. During dialogue, complex relationships such as temporal, causal, and / or dependency often exist between different events, and these relationships may change as the dialogue progresses. Existing technologies are insufficient in dynamically modeling event relationships and lack efficient, interpretable update mechanisms, failing to meet the demands of deep understanding and real-time processing of contextual semantics in complex multi-turn dialogue scenarios. Therefore, this application aims to provide an event graph-based dialogue memory management method to effectively solve the above problems and improve the semantic understanding, memory management efficiency, and reasoning capabilities of dialogue systems.

[0046] The dialogue memory method provided in this application first decomposes the entire dialogue and detects the existence of core and supporting events in each dialogue round. Next, while maintaining the temporal logical relationship, it judges the relationships between different events. This scheme dynamically accompanies the dialogue, thereby dynamically constructing a fine-grained dialogue event graph at each moment, solving the first challenge. After obtaining the dialogue event graph at this moment, the hierarchical event graph construction module associates key event nodes from historical moments. This reveals the implicit causal relationships arising from the temporal logic of events, completing the discovery and reorganization of relationships between event nodes. Simultaneously, for different states of the same event node at different times, the hierarchical structure facilitates the updating and preservation of states, solving the second challenge.

[0047] The dialogue memory method provided in this application can be widely applied to various dialogue system architectures and complex multi-turn dialogue scenarios, providing efficient support for the semantic understanding, memory management, and reasoning capabilities of dialogue systems. The following are typical application scenarios and system architectures of this application:

[0048] 1) Intelligent Customer Service and User Support System: In intelligent customer service scenarios, the system needs to handle complex multi-turn user interactions, quickly understand the user's core needs, and provide relevant solutions. Through the method provided in this application embodiment, the system can dynamically extract core and supporting events from user dialogues, accurately capture user intent, and establish causal and / or dependency relationships between events in multi-turn dialogues. This can significantly reduce response delays caused by information loss or redundant storage, thus optimizing the user experience.

[0049] 2) Intelligent voice assistants and task-oriented dialogue systems: For intelligent voice assistants and task-oriented dialogue systems, the dynamic event graph construction function provided in this application embodiment can support the decomposition and management of complex task chains. For example, when a user issues a multi-step task (such as booking tickets, making payments, and scheduling), the system can dynamically discover the core objective and related tasks, and dynamically update the memory graph according to the progress of the dialogue to ensure the continuity and accuracy of the task chain.

[0050] 3) Education and training dialogue system: In education or training dialogue scenarios, the method provided in this application embodiment can help the system deeply understand the questions and background raised by learners, and dynamically update the knowledge graph according to the dialogue content, providing accurate personalized learning support. For example, in the process of language learning, the system can dynamically identify key knowledge points based on the learner's multi-turn dialogue, and optimize the learning path through event relationship modeling.

[0051] Figure 2 is a schematic diagram of the system architecture provided in an embodiment of this application. As shown in Figure 2, the system architecture may include three modules: a dialogue memory event graph unit extraction and construction module, a dialogue memory event graph reasoning chain construction module, and a dialogue memory event graph hierarchical index construction module.

[0052] The three modules will be explained below.

[0053] I. Dialogue Memory Event Graph Unit Extraction and Construction Module

[0054] This module includes a sentence-level event discriminator and an event unit extraction module. The sentence-level event discriminator is responsible for identifying the existence of events from a single-turn dialogue, while the event unit extraction module is responsible for further extracting fine-grained information about the events.

[0055] What (what does the Dialogue Memory Event Graph Unit Extraction Module do): Identify and extract the core and supporting events in the dialogue, and determine the entities of the events.

[0056] When: Execute immediately after each round of dialogue to ensure the real-time nature of the information.

[0057] Where (Scenario): Applicable to all multi-turn dialogue scenarios, especially task-oriented dialogues that require high accuracy in semantic understanding.

[0058] How it works: First, the sentence-level event discriminator performs sentiment analysis on the user-input dialogue to identify the sentiment tendency of the input and makes single-sentence role determinations. Then, the event unit extraction module performs fine-grained decomposition of the user-input dialogue, extracting entities from the fine-grained dialogue sentences and identifying the relationships between these entities; these entities can include time, location, action, person, and / or object, etc. Finally, based on the role determination results and the relationships between the entities, the entities are generated into event interaction units, ready to be passed to the next module. Additionally, after generating event interaction units, it can be determined whether there are conflicts between them, such as time conflicts or task conflicts. If so, conflict resolution operations are performed on the conflicting event interaction units. Specifically, in the event interaction units generated in the same round of dialogue, if there are conflicting event interaction units, the event interaction unit with a later time sequence can replace the event interaction unit with a earlier time sequence.

[0059] This module relies on existing natural language processing technologies such as named entity recognition (NER) and sentiment analysis, and further develops an event discrimination mechanism suitable for event graphs.

[0060] II. Dialogue Memory Event Graph Reasoning Chain Construction Module

[0061] This module includes an event reasoning simulation module. Its core function is to construct an event relationship graph based on event interaction units, simulate the logical relationships (such as causal relationships) between events, and calculate the importance contribution value of events in the above event relationship graph.

[0062] What (what does the Dialogue Memory Event Graph Reasoning Chain Building Module do): Identify the relationships between events, including chronological order, causal chains, and / or dependencies, and calculate the importance contribution value of each event.

[0063] When (when to do): Triggered after the event interaction unit is formed, the event relationship graph is updated round by round.

[0064] Where (Scenario): Applicable to scenarios requiring high-complexity semantic reasoning, such as open-domain dialogue and medical diagnostic assistance.

[0065] How it works: First, the event reasoning simulation module generates an event relationship graph for the current round of dialogue based on the event interaction units and the order in which entities appear in the user-input dialogue statements. Each node in the event relationship graph represents an event. Then, based on the event relationship graph for the current round of dialogue, a multi-agent simulation mechanism is used to analyze the logical chains between events and determine the relationships between them, such as whether causal and / or dependency relationships exist. Based on these relationships, the connections between events in the event relationship graph for the current round of dialogue are adjusted. Finally, based on the importance of the events and decision-making needs, the importance contribution value of each event is calculated to optimize resource allocation and reasoning efficiency in event management. This module relies on graph computing and causal reasoning algorithms and has been extended to be applicable to dynamic multi-turn dialogue scenarios.

[0066] III. Dialogue Memory Event Graph Hierarchical Index Construction Module

[0067] This module includes a hierarchical backtracking index module, whose main function is to update and manage the status of event nodes, ensuring the effective preservation and utilization of historical information.

[0068] What (the Dialogue Memory Event Graph Hierarchical Index Building Module does): It performs hierarchical management of historical event nodes, including node updates, node deletions, relationship reconstruction, and / or connectivity restoration.

[0069] When: Triggered after each round of dialogue to maintain the hierarchical structure of the event graph.

[0070] Where (Scenario): Applicable to scenarios involving long-duration dialogues and the need to preserve complex historical semantic relationships, such as education and training and long-term task collaboration.

[0071] How it works: First, the hierarchical backtracking index module compares the event graph of the current dialogue round with the event graphs of previous rounds to identify state changes of the same event at different times. Then, for events with state changes, it updates or deletes events in the event graphs of previous rounds. For events newly added to the event graph of the current dialogue round compared to those of previous rounds, these new events are inserted into the event graphs of previous rounds, and the connections between events in the event graphs of previous rounds are dynamically adjusted. Finally, for graph connectivity issues caused by event deletion or changes in node relationships, a connectivity recovery algorithm is used to reconstruct the hierarchical structure of the event graph, ensuring the overall semantic coherence. This module relies on graph structure manipulation techniques, such as node merging, relationship updating, and graph connectivity algorithms.

[0072] Through the collaborative work of the above three modules, the dialogue memory method provided in this application embodiment realizes the identification of core events, reasoning of event relationships and dynamic management in multi-turn dialogues, which can greatly improve the ability of dialogue systems in semantic understanding, memory management and logical reasoning.

[0073] The dialogue memory method provided in this application embodiment will be described in detail below with reference to the system architecture shown in Figure 2.

[0074] Figure 3 is a flowchart of a dialogue memory method provided in an embodiment of this application. The dialogue memory method provided in this embodiment can be executed by an electronic device 100.

[0075] As shown in Figure 3, the above-mentioned dialogue-based memory method may include:

[0076] Step 301: Obtain the dialogue statements entered by the user in the current round of dialogue.

[0077] The current round of dialogue can refer to the current round of dialogue between the user and the dialogue system.

[0078] Step 302: Perform role determination on the above dialogue statements, extract entities from the above dialogue statements, and identify the relationships between the above entities.

[0079] Specifically, role determination for the above dialogue statements can be performed by identifying individual sentences, also known as role labeling or semantic role labeling. Individual sentence role determination identifies the roles of various components within a sentence, particularly the participants and their functions related to the main verb. Simply put, it determines who did what, to whom, and when.

[0080] The entities in the aforementioned dialogue statements can include information such as time, location, action, person, and / or object. In practice, NER (Network Executioner) technology can be used to extract these entities from the dialogue statements.

[0081] Specifically, identifying the relationships between the aforementioned entities can be done by identifying which entities among the extracted entities have specific actions or interactions.

[0082] This step enables accurate extraction of core semantics, avoiding the problem of incomplete semantic understanding caused by information redundancy or loss in existing technologies. This improves the availability and accuracy of semantic information in multi-turn dialogues and enhances the ability to understand user intent.

[0083] Step 303: Based on the result of the role judgment and the relationship between the above entities, generate event interaction units for the above entities.

[0084] In some examples, after step 303, the electronic device 100 can further determine whether there is a conflict between the aforementioned event interaction units. If so, a conflict resolution operation is performed on the conflicting event interaction units. For example, the conflict could be a time conflict or a task conflict. Specifically, among the event interaction units generated in the same round of dialogue, if there are conflicting event interaction units, the event interaction unit with a later timing sequence can replace the event interaction unit with a earlier timing sequence.

[0085] Step 304: Based on the above event interaction unit, generate the event relationship diagram for the current round of dialogue according to the order in which entities appear in the dialogue statements input by the user; wherein each node in the above event relationship diagram represents an event.

[0086] The following example illustrates this. Assume the current round is dialogue round 1. In dialogue round 1, the user (User) and assistant (Assistant) are conversing. The assistant (Assistant) can be considered a robot in the dialogue system. The dialogue statements between the user (User) and assistant (Assistant) in dialogue round 1 are as follows:

[0087] [Corrected on March 23, 2026 according to Rule 26] User: Hello! I just watched a movie and now I'm planning to have dinner with Joey at 6 pm. What's your plan for today?

[0088] [Corrected from Rule 26, March 23, 2026] Assistant: Hey! Sounds like you had a fun evening. I don't have any special plans today, so I'm just relaxing and reading. What movie did you watch?

[0089] After obtaining the user's input dialogue statement, a role determination can be performed on the dialogue statement. This role determination reveals that "I" is the entity performing the action, and "I" is the User; therefore, the role determination result is "I->User". Then, the electronic device 100 can extract the entities from the dialogue statement. In this example, the entities in the user's input dialogue statement may include "I", "watch", "movie", "plan", "have", "dinner", "Joey", "6pm", "what's", and "your plan". Next, the relationships between these entities are identified, that is, which entities have specific actions or interactions. For example, there is a specific action relationship between the entities "watch" and "movie".

[0090] Next, based on the role determination results and the relationships between the aforementioned entities, event interaction units are generated from these entities. In this example, the generated event interaction unit may include one core event and four supporting events, as shown below:

[0091] Key events: (user, share, schedule)

[0092] Supporting events: (user,watch,movie),(user,plan a dinner,Joey),(dinner,taken at,6pm),(user,enquiry,plan)

[0093] Finally, based on the aforementioned event interaction unit, an event relationship diagram for the current round of dialogue is generated according to the order in which entities appear in the user-input dialogue statements. In this example, the order in which entities appear in the user-input dialogue statements is "watch", "movie", "plan", "have", "dinner", "Joey", "6pm", "what's", and "your plan". Therefore, the event relationship diagram for the current round of dialogue can be shown in Figure 4. Figure 4 is a schematic diagram of an event relationship diagram provided in an embodiment of this application. As can be seen from Figure 4, each node in the event relationship diagram represents an event.

[0094] In some examples, after step 304, the electronic device 100 can also determine the relationship between events in the event relationship diagram based on the event relationship diagram of the current round of dialogue, and adjust the connection relationship between events in the event relationship diagram of the current round of dialogue based on the relationship between the events.

[0095] The relationships between the aforementioned events can include causal relationships, dependency relationships, and / or parallel relationships, etc. This embodiment does not limit the relationships between the aforementioned events. Specifically, the electronic device 100 can analyze the logical chains between events and determine the relationships between events through a multi-agent simulation mechanism. Taking the event relationship diagram shown in Figure 4 as an example, after generating the event relationship diagram shown in Figure 4, the electronic device 100 analyzes the logical chains between events through a multi-agent simulation mechanism and can determine that the four events in Figure 4 are not sequential but parallel. Therefore, the electronic device 100 can adjust the connection relationships between events in the event relationship diagram shown in Figure 4. The adjusted event relationship diagram can be shown in Figure 5, which is a schematic diagram of an event relationship diagram provided in another embodiment of this application.

[0096] In this example, after adjusting the connections between events in the event relationship graph of the current round of dialogue based on the relationships between the events mentioned above, the electronic device 100 can also calculate the importance contribution value of the events based on their importance and decision-making needs in the event relationship graph of the current round of dialogue, thereby optimizing resource allocation and inference efficiency in event management. Specifically, after calculating the importance contribution value of the events, events with higher importance contribution values ​​are more easily retrieved during subsequent event backtracking, making it easier for the dialogue system to understand the intent of the dialogue statements entered by the user in subsequent rounds of dialogue.

[0097] In other examples, after step 304, the electronic device 100 can also acquire the event relationship diagram of the historical rounds, identify the state changes of the same event at different times based on the event relationship diagram of the current round of dialogue and the event relationship diagram of the historical rounds, and perform update or deletion operations on the events in the event relationship diagram of the historical rounds according to the state changes.

[0098] Furthermore, in this example, after obtaining the event relationship graph of the historical rounds, new events can be inserted into the aforementioned event relationship graph of the historical rounds, and then the connections between events in the event relationship graph of the historical rounds can be adjusted. The newly added events include events added to the event relationship graph of the current round of dialogue relative to the event relationship graph of the historical rounds. This example, through hierarchical management, effectively links historical dialogue information, thereby uncovering implicit causal relationships and improving the overall structural organization efficiency of the event relationship graph.

[0099] Continuing with the previous example, the current dialogue round is round 2. In round 2, the dialogue between the user and the assistant is as follows:

[0100] [Corrected from Rule 26, March 23, 2026] User: The movie is *Nezha 2*. It's really good! Here's the poster. I plan to recommend it to Joey. Maybe we'll eat hotpot. What do you think?

[0101] [Amended 23.03.2026 according to Rule 26] Assistant: That sounds like a great plan! Nezha 2 looks amazing, especially with all those vibrant and dynamic elements on the poster. I'm sure Joey will enjoy it too. And hotpot is always a fantastic choice for dinner. Enjoy your evening with Joey!

[0102] After obtaining the dialogue statement entered by the user in dialogue round 2, a role determination can be performed on the dialogue statement. This role determination reveals that "I" is the entity performing the action, and "I" is the User; therefore, the role determination result is "I->User". Then, the electronic device 100 can extract the entities from the dialogue statement. In this example, the entities in the user-input dialogue statement may include "movie", "Nezha2", "poster", "recommend", "Joey", "we", "eat", and "Hotpot". Next, the relationships between these entities are identified, that is, which entities have specific actions or interactions, for example, the entities "eat" and "Hotpot" have a specific action relationship.

[0103] Next, based on the role determination results and the relationships between the aforementioned entities, event interaction units are generated from these entities. In this example, the generated event interaction unit may include one core event and two supporting events, as shown below:

[0104] Key events: (user, share, schedule)

[0105] Supporting events: (user, watch, 'Nezha2'), (user, plan to have, Hotpot)

[0106] Finally, based on the aforementioned event interaction unit, an event relationship diagram for the current round of dialogue is generated according to the order in which entities appear in the user-input dialogue statements. In this example, the order in which entities appear in the user-input dialogue statements is "movie", "Nezha2", "poster", "recommend", "Joey", "we", "eat", and "Hotpot". Therefore, the event relationship diagram for the current round of dialogue can be as shown in Figure 6. Figure 6 is a schematic diagram of an event relationship diagram provided in another embodiment of this application. Similarly, each node in the event relationship diagram shown in Figure 6 represents an event.

[0107] After generating the event relationship diagram shown in Figure 6, the electronic device 100 analyzes the logical chain between events through a multi-agent simulation mechanism. It can be determined that the six events in Figure 6 are not sequential but parallel. Therefore, the electronic device 100 can adjust the connection relationship between events in the event relationship diagram shown in Figure 6. The adjusted event relationship diagram can be shown in Figure 7. Figure 7 is a schematic diagram of the event relationship diagram provided in another embodiment of this application.

[0108] After generating the event relationship diagram shown in Figure 7, the electronic device 100 can obtain the event relationship diagram of dialogue round 1 (i.e., the event relationship diagram shown in Figure 5), and identify the state changes of the same event at different times based on the event relationship diagram shown in Figure 7 and the event relationship diagram shown in Figure 5; and perform update or deletion operations on the events in the event relationship diagram of the historical rounds according to the state changes.

[0109] In this example, after comparing Figure 5 and Figure 7, it can be seen that there is no change in the same event state in Figure 7 compared to Figure 5, but there are newly added events. For the newly added events, the electronic device 100 can insert the newly added events into the event relationship diagram of the above-mentioned historical rounds, and then adjust the connection relationship between events in the event relationship diagram of the historical rounds. In this way, after inserting the newly added events in Figure 7 compared to Figure 5 into the event relationship diagram shown in Figure 5, the event relationship diagram shown in Figure 8 can be obtained. Figure 8 is a schematic diagram of the event relationship diagram provided in another embodiment of this application.

[0110] As can be seen from the above explanation, the role of supporting events is to provide the model with richer dialogue content. If only core events are provided, then in order for the model to understand the dialogue history, the entire dialogue history still needs to be input into the model, which cannot solve the problems of information overload and information conflict. Furthermore, compared to listing events, constructing an event graph allows the model to better understand the relationships between different events.

[0111] In the above-described dialogue memory method, after the electronic device 100 obtains the dialogue statements input by the user in the current round of dialogue, it performs role judgment on the dialogue statements and extracts entities from the dialogue statements. It then identifies the relationships between the entities and generates event interaction units based on the results of the role judgment and the relationships between the entities. Finally, based on the event interaction units, it generates an event relationship diagram for the current round of dialogue according to the order in which the entities appear in the dialogue statements input by the user. This enables the electronic device 100 to perform memory management of multi-round dialogues based on the event relationship diagram, ensuring the integrity of memory management in long-term multi-round dialogues and achieving a deep understanding of contextual information.

[0112] It is understood that some or all of the steps or operations in the above embodiments are merely examples, and other operations or variations thereof can be performed in the embodiments of this application. Furthermore, the steps may be performed in different orders as presented in the above embodiments, and it is not necessary to perform all the operations in the above embodiments.

[0113] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithm steps of the examples described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0114] This embodiment can divide the electronic device into functional modules according to the above method embodiment. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0115] Figure 9 is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. When each functional module is divided according to its corresponding functions, Figure 9 shows a possible composition of the electronic device 900 involved in the above embodiment. As shown in Figure 9, the electronic device 900 may include: a receiving unit 901, a processing unit 902 and a transmitting unit 903.

[0116] The processing unit 902 can be used to support the electronic device 900 in executing steps 301 to 304, and / or other processes used in the technical solutions described in the embodiments of this application.

[0117] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0118] The electronic device 900 provided in this embodiment is used to execute the above-described dialogue memory method, and thus can achieve the same effect as the above method.

[0119] It should be understood that electronic device 900 can correspond to electronic device 100 shown in FIG1. ​​The functions of receiving unit 901 and transmitting unit 903 can be implemented by processor 110 and communication interface 120 in electronic device 100 shown in FIG1; the function of processing unit 902 can be implemented by processor 110 in electronic device 100 shown in FIG1.

[0120] When using integrated units, the electronic device 900 may include a processing module, a storage module, and a communication module.

[0121] The processing module can be used to control and manage the actions of the electronic device 900. For example, it can support the electronic device 900 in executing the steps performed by the receiving unit 901, processing unit 902, and sending unit 903. The storage module can support the electronic device 900 in storing program code and data. The communication module can support communication between the electronic device 900 and other devices.

[0122] The processing module can be a processor or controller, which can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as radio frequency circuitry, a Bluetooth chip, and / or a Wi-Fi chip.

[0123] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device 900 involved in this embodiment can be a device having the structure shown in FIG1.

[0124] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to execute the method provided in the embodiments shown in Figures 3 to 8 of this application.

[0125] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to execute the method provided in the embodiments shown in Figures 3 to 8 of this application.

[0126] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0127] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0128] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0129] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0130] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. The protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A dialogic memory method, characterized in that, include: Get the dialogue statements entered by the user in the current round of the conversation; Role determination is performed on the dialogue statements, entities are extracted from the dialogue statements, and relationships between the entities are identified. Based on the result of the role determination and the relationship between the entities, the entities are used to generate event interaction units; According to the event interaction unit, an event relationship diagram for the current round of dialogue is generated in the order in which entities appear in the dialogue input by the user; wherein each node in the event relationship diagram represents an event.

2. The method according to claim 1, characterized in that, After generating the event relationship graph for the current round of dialogue, the process also includes: Based on the event relationship diagram of the current round of dialogue, determine the relationships between the events in the event relationship diagram; Based on the relationships between the events, the connections between events in the event relationship graph of the current round of dialogue are adjusted.

3. The method according to claim 2, characterized in that, After adjusting the connections between events in the event relationship graph of the current round of dialogue based on the relationships between the events, the method further includes: Based on the importance of the events and decision-making needs in the event relationship graph of the current round of dialogue, calculate the importance contribution value of the events.

4. The method according to claim 1, characterized in that, After generating the event relationship graph for the current round of dialogue, the process also includes: Obtain the event relationship diagram for each historical round; Based on the event relationship diagram of the current round of dialogue and the event relationship diagram of the historical rounds, identify the state changes of the same event at different times; Based on the changes in state, update or delete events in the event relationship graph of the historical rounds.

5. The method according to claim 4, characterized in that, After obtaining the event relationship graph of historical rounds, the process also includes: The newly added events are inserted into the event relationship graph of the historical rounds; wherein, the newly added events include events that are added to the event relationship graph of the current round of dialogue relative to the event relationship graph of the historical rounds; Adjust the connections between events in the event relationship graph of the historical rounds.

6. The method according to claim 1, characterized in that, After generating an event interaction unit for the entity based on the role determination result and the relationship between the entity, the method further includes: Determine whether there is a conflict between the event interaction units; If a conflict exists, then a conflict resolution operation is performed on the event interaction units that are in conflict.

7. An electronic device, characterized in that, include: One or more processors; Memory; Multiple applications; And one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs including instructions that, when executed by the electronic device, cause the electronic device to perform the method as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-6.

9. A computer program product, characterized in that, The computer program product includes a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-6.