Itinerary memory database construction method and device, computer device and storage medium
By combining vector databases and relational databases, trip summaries are generated and updated as short-term and long-term memories, solving the problem of insufficient intelligence in existing trip memory databases and achieving more efficient in-vehicle AI interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING LANDIAN AUTOMOBILE TECHNOLOGY CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-06-16
AI Technical Summary
Existing methods for constructing trip memory databases are insufficient in terms of semantic retrieval accuracy and response speed, and cannot effectively support incremental updates and synchronous reflection of semantic relevance, resulting in insufficient intelligence of in-vehicle AI interaction in intelligent driving.
By combining vector databases and relational databases, it generates and stores iterative summaries as short-term memory, updates long-term memory by combining historical dialogue interaction data, and optimizes memory updates using semantic vector similarity and text fusion techniques.
It improves the intelligence of the trip memory database, realizes the accumulation of user behavior patterns across trips and the coherent interaction of multi-turn dialogues, and enhances the response speed and semantic relevance of in-vehicle artificial intelligence interaction.
Smart Images

Figure CN121901231B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent driving technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for constructing a trip memory database. Background Technology
[0002] With the development of intelligent driving technology, a technology has emerged that integrates artificial intelligence interactive devices into vehicles. Drivers and passengers can interact with the in-vehicle AI devices via voice while driving. The AI devices can then understand the voice text uttered by the drivers and passengers, thereby completing the dialogue interaction.
[0003] In traditional technologies, dialogue interaction in in-vehicle AI relies on databases. For example, dialogue interaction can be achieved through vector databases or relational databases. Vector databases can be used to retrieve similar historical memories during dialogue, which serve as context inputs to a large model, thereby achieving the memory function. Relational databases, on the other hand, can filter relevant memories into a large model through SQL queries or rule engines to achieve the memory function.
[0004] However, while pure vector database solutions offer accurate semantic retrieval, they lack user isolation mechanisms, which severely reduces response speed and does not support incremental updates. Pure relational database solutions, on the other hand, lose the semantic relevance of memory and cannot synchronously reflect changes in semantic relationships in the vector space. Therefore, current methods for constructing trip memory databases are not intelligent enough. Summary of the Invention
[0005] Based on this, this application addresses the aforementioned technical problems by providing a method, apparatus, computer device, computer-readable storage medium, and computer program product for constructing a travel memory database that can improve the intelligence of the travel memory database construction method.
[0006] Firstly, this application provides a method for constructing a travel memory database, including:
[0007] Based on the dialogue interaction data and the trip status information associated with the dialogue interaction data, a trip summary associated with the dialogue interaction data is generated.
[0008] The trip summary is stored as short-term memory in a first trip memory database and a second trip memory database; wherein, the first trip memory database is a vector database and the second trip memory database is a relational database;
[0009] Based on the trip summary, the long-term memories stored in the first trip memory database and the second trip memory database are updated; the long-term memories are generated based on the historical trip summary associated with historical dialogue interaction data, and the historical dialogue interaction data is the dialogue data before the dialogue interaction data.
[0010] In one embodiment, the long-term memory includes a first long-term memory stored in the vector database and a second long-term memory stored in the relational database. Updating the long-term memories stored in the first and second travel memory databases based on the travel summary includes: obtaining a user identifier associated with the travel summary and a first semantic vector corresponding to the travel summary; using long-term memories stored in the vector database that match the user identifier as associated long-term memories, and obtaining a second semantic vector for each associated long-term memory; obtaining the similarity between the first semantic vector and each second semantic vector, and using the associated long-term memories with a similarity greater than a preset similarity threshold as first long-term memories; updating the first long-term memory based on the travel summary, and obtaining the second long-term memory corresponding to the first long-term memory from the relational database, so as to update the second long-term memory using the updated first long-term memory.
[0011] In one embodiment, updating the first long-term memory based on the itinerary summary includes: fusing the text content corresponding to the first long-term memory and the text content corresponding to the itinerary summary to obtain fused text content, and obtaining a third semantic vector corresponding to the fused text content; using the fused text content as the updated text content of the first long-term memory, and using the third semantic vector as the updated semantic vector of the first long-term memory; updating the second long-term memory using the updated first long-term memory includes: using the updated text content of the first long-term memory as the updated text content of the second long-term memory, and updating the attribute data of the second long-term memory.
[0012] In one embodiment, after obtaining the second semantic vectors of each of the associated long-term memories, the method further includes: if the similarity between the first semantic vector and each of the second semantic vectors is less than the preset similarity threshold, storing the user identifier, the first semantic vector, and the text content corresponding to the trip summary as first long-term memories in the vector database; obtaining the memory identifier of the first long-term memories, and storing the user identifier, the memory identifier, the text content corresponding to the trip summary, and the attribute data corresponding to the trip summary as second long-term memories in the relational database.
[0013] In one embodiment, the short-term memory includes a first short-term memory stored in the vector database and a second short-term memory stored in the relational database; storing the trip summary as short-term memory in the first trip memory database and the second trip memory database includes: obtaining a user identifier associated with the trip summary and a first semantic vector corresponding to the trip summary; storing the user identifier, the first semantic vector, and the text content corresponding to the trip summary as first short-term memory in the vector database; obtaining a memory identifier for the first short-term memory in the vector database; and storing the user identifier, the memory identifier, the text content, and the attribute data corresponding to the trip summary as second short-term memory in the relational database.
[0014] In one embodiment, generating a trip summary associated with the dialogue interaction data and the trip status information associated with the dialogue interaction data includes: obtaining pre-constructed prompt words for generating the trip summary; inputting the trip status information, the dialogue interaction data, and the prompt words into a pre-constructed large language model, and generating the trip summary through the large language model.
[0015] In one embodiment, after updating the long-term memories stored in the first trip memory database and the second trip memory database, the method further includes: upon detecting a dialogue interaction text triggered by a target user, obtaining a fourth semantic vector corresponding to the dialogue interaction text; based on the user identifier of the target user and the fourth semantic vector, obtaining a long-term memory associated with the dialogue interaction text from the vector database, and obtaining the text content corresponding to the long-term memory associated with the dialogue interaction text; and generating a dialogue response text corresponding to the dialogue interaction text based on the text content of the dialogue interaction text and the text content corresponding to the long-term memory associated with the dialogue interaction text.
[0016] In one embodiment, after updating the long-term memories stored in the first trip memory database and the second trip memory database, the method further includes: responding to a memory update operation initiated by a target user for the long-term memories stored in the relational database, obtaining attribute data and text content matching the memory update operation; based on the attribute data matching the memory update operation and the user identifier of the target user, obtaining a third long-term memory to be updated from the long-term memories stored in the relational database, and using the text content matching the memory update operation as the updated text content of the third long-term memory; obtaining a fourth long-term memory corresponding to the third long-term memory from the vector database, and obtaining a fourth semantic vector corresponding to the updated text content of the third long-term memory; using the updated text content of the third long-term memory as the updated text content of the fourth long-term memory, and using the fourth semantic vector as the updated semantic vector of the fourth long-term memory.
[0017] Secondly, this application also provides a travel memory database construction apparatus, comprising:
[0018] The itinerary summary generation module is used to generate an itinerary summary associated with the dialogue interaction data based on the dialogue interaction data and the itinerary status information associated with the dialogue interaction data.
[0019] A short-term memory storage module is used to store the trip summary as short-term memory into a first trip memory database and a second trip memory database; wherein, the first trip memory database is a vector database and the second trip memory database is a relational database;
[0020] The long-term memory storage module is used to update the long-term memories stored in the first trip memory database and the second trip memory database based on the trip summary; the long-term memories are generated based on the historical trip summary associated with historical dialogue interaction data, and the historical dialogue interaction data is the dialogue data before the dialogue interaction data.
[0021] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0022] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0023] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above aspects.
[0024] The aforementioned method, apparatus, computer device, computer-readable storage medium, and computer program product for constructing a travel memory database generate a travel summary associated with dialogue interaction data based on dialogue interaction data and travel status information associated with the dialogue interaction data. The travel summary is stored as short-term memory in a first travel memory database and a second travel memory database. The first travel memory database is a vector database, and the second travel memory database is a relational database. Based on the travel summary, the long-term memories stored in the first and second travel memory databases are updated. The long-term memories are generated based on historical travel summaries associated with historical dialogue interaction data, where historical dialogue interaction data refers to dialogue data prior to the initial dialogue interaction. This application can generate a travel summary based on dialogue interaction data and associated travel status information. The travel summary can then be stored as short-term memory in both the vector database and the relational database. Simultaneously, the long-term memories stored in both the vector database and the relational database can be updated based on the travel summary. This method combines vector and relational databases for travel data memory and can distinguish between short-term and long-term memory storage, thus improving the intelligence of the travel memory database construction method. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of an optional process for constructing a trip memory database in one embodiment;
[0027] Figure 2 This is a schematic diagram of an optional process for updating stored long-term memory in one embodiment;
[0028] Figure 3 This is a schematic diagram of an optional process for updating long-term memory based on a trip summary in one embodiment;
[0029] Figure 4 This is a schematic diagram of an optional process for storing short-term memory in one embodiment;
[0030] Figure 5 This is a schematic diagram of an optional process for generating dialogue response text in one embodiment;
[0031] Figure 6This is a schematic diagram of an optional process for updating trip memory in one embodiment;
[0032] Figure 7 This is a schematic diagram of an optional architecture for the process memory storage in one embodiment;
[0033] Figure 8 This is a schematic diagram of an optional structure of a trip memory database construction device in one embodiment;
[0034] Figure 9 This is a schematic diagram of an optional internal structure of a computer device in one embodiment. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0036] The terms "first," "second," etc., used in this application may be used to describe various elements, but these elements are not limited by these terms. These terms are used only to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0037] In one embodiment, such as Figure 1 As shown, a method for constructing a travel memory database is provided. This embodiment illustrates the method by applying it to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0038] Step S101: Based on the dialogue interaction data and the trip status information associated with the dialogue interaction data, generate a trip summary associated with the dialogue interaction data.
[0039] Dialogue interaction data refers to the dialogue data triggered by the user interacting with in-vehicle intelligent devices during vehicle operation. This dialogue interaction data can be the dialogue interaction data of a complete vehicle journey, such as the dialogue data from the time the vehicle is powered on to the time it is powered off, or the dialogue data corresponding to multiple rounds of dialogue when the cumulative number of dialogues reaches a set threshold. Trip status information can refer to the status information related to the vehicle's driving process, such as information from different dimensions such as trip information, environmental information, and vehicle status information. Trip summary refers to the summary text of the vehicle trip associated with the dialogue interaction data, which can exist in text form.
[0040] Specifically, when the vehicle is powered off or the number of conversations reaches a set threshold, the vehicle terminal can collect the aforementioned conversation interaction data and the trip status information associated with the conversation interaction data, thereby generating a trip summary using the aforementioned trip status information and conversation interaction data.
[0041] Step S102: Store the trip summary as short-term memory in the first trip memory database and the second trip memory database; wherein, the first trip memory database is a vector database and the second trip memory database is a relational database.
[0042] The first trip memory database refers to the vector database used to store trip memories, while the second trip memory database refers to the relational database used to store trip memories. Short-term memory corresponds to the trip memories of a single dialogue interaction. Specifically, after the terminal obtains a trip summary of a certain dialogue interaction data, it can store the trip summary as short-term memory in both the first and second trip memory databases, thereby storing the short-term memories corresponding to a single dialogue interaction data in the vector database and the relational database.
[0043] Step S103: Based on the trip summary, update the long-term memories stored in the first trip memory database and the second trip memory database; the long-term memories are generated based on the historical trip summary associated with the historical dialogue interaction data, and the historical dialogue interaction data is the dialogue data before the dialogue interaction data.
[0044] Long-term memory refers to the trip memory formed by multiple dialogue interaction data. For example, it can be the trip memory generated by multiple historical trip summaries. The historical trip summary refers to the trip summary associated with historical dialogue interaction data. In this embodiment, the first trip memory database and the second trip memory database can store not only short-term memory of a single dialogue interaction data, but also long-term memory obtained from trip summaries associated with multiple dialogue interaction data.
[0045] Specifically, after each historical dialogue interaction data collection, the terminal can generate a corresponding trip summary, i.e., a historical trip summary. Based on this historical trip summary, the terminal can generate long-term memories stored in a first trip memory database and a second trip memory database. Subsequently, after each dialogue interaction data acquisition, the terminal can also obtain the trip summary associated with the dialogue interaction data, thereby updating the long-term memories using the trip summary. In this way, long-term memories can be used to accumulate cross-trip user behavior patterns, preferences, and historical experiences, achieving long-term continuity in multi-turn dialogues.
[0046] In the aforementioned method for constructing a travel memory database, a travel summary associated with the dialogue interaction data is generated based on the dialogue interaction data and the travel status information associated with the dialogue interaction data. This travel summary is then stored as short-term memory in a first travel memory database and a second travel memory database. The first travel memory database is a vector database, and the second travel memory database is a relational database. Based on the travel summary, the long-term memories stored in the first and second travel memory databases are updated. The long-term memories are generated based on historical travel summaries associated with historical dialogue interaction data, where historical dialogue interaction data refers to dialogue data prior to the initial dialogue interaction. This application can generate travel summaries based on dialogue interaction data and associated travel status information. These summaries can then be stored as short-term memories in both the vector and relational databases. Furthermore, the long-term memories stored in both databases can be updated based on the travel summary. This method combines vector and relational databases for travel data memory and can distinguish between short-term and long-term memory storage, thus improving the intelligence of the travel memory database construction method.
[0047] In one embodiment, long-term memory includes a first long-term memory stored in a vector database and a second long-term memory stored in a relational database; such as Figure 2 As shown, step S103 may further include:
[0048] Step S201: Obtain the user identifier associated with the trip summary and the first semantic vector corresponding to the trip summary.
[0049] In this embodiment, the long-term memory related to the trip summary can include two types: the long-term memory related to the trip summary stored in the vector database (i.e., the first long-term memory), and the long-term memory related to the trip summary stored in the relational database (i.e., the second long-term memory). The user identifier refers to the identifier used to identify the user; this user can be the user who triggered the dialogue interaction data or the driver / passenger user. The first semantic vector refers to the semantic vector corresponding to the trip summary associated with the dialogue interaction data. Since the trip summary exists in text form, the semantic vector of the trip summary can be extracted based on its text content.
[0050] Specifically, after obtaining the trip summary, the terminal can also obtain the user identifier associated with the trip summary and extract the semantic vector corresponding to the trip summary as the first semantic vector.
[0051] Step S202: The long-term memories stored in the vector database that match the user identifier are used as associated long-term memories, and the second semantic vector of each associated long-term memory is obtained.
[0052] Associative long-term memory refers to the long-term memory in the vector database that matches the user identifier associated with the trip summary. In this embodiment, each long-term memory stored in the vector database corresponds to a user identifier. After obtaining the user identifier associated with the trip summary, if the vector database pre-stores the long-term memory corresponding to that user identifier, then the aforementioned long-term memory can be used as the associated long-term memory. Subsequently, the semantic vectors of each associated long-term memory can be extracted as the second semantic vector.
[0053] Step S203: Obtain the similarity between the first semantic vector and each second semantic vector, and use the associated long-term memory with a similarity greater than a preset similarity threshold as the first long-term memory;
[0054] Step S204: Update the first long-term memory based on the trip summary, and retrieve the second long-term memory corresponding to the first long-term memory from the relational database, so as to update the second long-term memory using the updated first long-term memory.
[0055] After obtaining the second semantic vector of each associated long-term memory, the terminal can calculate the similarity between the first semantic vector and each second semantic vector, and then use the associated long-term memory with a similarity greater than a preset similarity threshold as the first long-term memory. For example, the associated long-term memory with a similarity greater than 80% can be used as the first long-term memory, and the first long-term memory can also be updated using the trip summary.
[0056] Meanwhile, the terminal can also retrieve the second long-term memory corresponding to the first long-term memory from the long-term memory stored in the relational database. For example, the long-term memory stored in the relational database can carry an index identifier. This index identifier can be used to uniquely identify the memory data stored in the vector database. After determining the index identifier corresponding to the first long-term memory, the terminal can query the long-term memory corresponding to the index identifier in the relational database as the second long-term memory. Then, the updated first long-term memory can be used to update the second long-term memory.
[0057] In this embodiment, the user identifier of the trip summary and the first semantic vector can be used to query the associated long-term memory, and the trip summary can be used to update the first long-term memory stored in the vector database and the second long-term memory stored in the relational database. The long-term memory can be updated in this way.
[0058] Furthermore, such as Figure 3 As shown, step S204 may further include:
[0059] Step S301: The text content corresponding to the first long-term memory and the text content corresponding to the itinerary summary are fused to obtain fused text content, and the third semantic vector corresponding to the fused text content is obtained.
[0060] The fused text content refers to the text content obtained by fusing the text content corresponding to the first long-term memory with the text content corresponding to the trip summary. The third semantic vector refers to the semantic vector corresponding to the fused text content. For example, the text content corresponding to the first long-term memory could be that user A likes to listen to songs by singer A, and the text content corresponding to the trip summary could be that user A likes to listen to songs by singer B. Then the fused text content could be that user A likes to listen to songs by both singer A and singer B.
[0061] Step S302: The fused text content is used as the updated text content of the first long-term memory, and the third semantic vector is used as the updated semantic vector of the first long-term memory.
[0062] After obtaining the fused text content and the third semantic vector, the terminal can use the fused text content as the updated text content of the first long-term memory, that is, use the fused text content as the updated text content of the first long-term memory, and can also use the third semantic vector as the updated semantic vector of the first long-term memory, that is, use the third semantic vector as the updated semantic vector of the first long-term memory. In this way, the update of the first long-term memory in the vector database can be completed.
[0063] Step S303: Use the updated text content of the first long-term memory as the updated text content of the second long-term memory, and update the attribute data of the second long-term memory.
[0064] After updating the first long-term memory, the terminal can obtain the updated text content of the first long-term memory and use it as the updated text content of the second long-term memory. At the same time, the terminal updates the attribute data of the second long-term memory. This attribute data can refer to the update time of the second long-term memory. In this embodiment, the relational database can store attribute data of different trip memories, such as the generation time or update time of the trip memory. After updating the second trip memory, the terminal also needs to update the update time to ensure the accuracy of the attribute data corresponding to the second long-term memory.
[0065] In this embodiment, the text content corresponding to the first long-term memory can be fused with the text content corresponding to the itinerary summary to obtain fused text content and a corresponding third semantic vector. Then, the fused text content can be used to update the text content of the first long-term memory, and the third semantic vector can be used to update the semantic vector of the first long-term memory. At the same time, the updated text content of the first long-term memory can be used to complete the update of the text content and attribute data of the second long-term memory. This method can improve the efficiency of long-term memory updates.
[0066] In addition, after step S202, the method may further include: when the similarity between the first semantic vector and each of the second semantic vectors is less than a preset similarity threshold, storing the user identifier, the first semantic vector, and the text content corresponding to the trip summary as the first long-term memory in the vector database; obtaining the memory identifier of the first long-term memory, and storing the user identifier, the memory identifier, the text content corresponding to the trip summary, and the attribute data corresponding to the trip summary as the second long-term memory in the relational database.
[0067] If the similarity between the first semantic vector and each of the second semantic vectors is less than the preset similarity threshold, that is, the first semantic vector is not similar to each of the second semantic vectors, it means that there is no first long-term memory related to the trip summary in the vector database. At this time, the terminal can store the trip summary as a new long-term memory entry into the vector database, that is, the user identifier, the first semantic vector and the text content corresponding to the trip summary are stored as the first long-term memory in the vector database.
[0068] The memory identifier is an index identifier used to uniquely identify the first long-term memory. After the first long-term memory is stored in the vector database, the terminal can also obtain the memory identifier of the first long-term memory and store the user identifier, memory identifier, text content corresponding to the trip summary, and attribute data corresponding to the trip summary as the second long-term memory corresponding to the first long-term memory in the relational database.
[0069] In this embodiment, if the long-term memory stored in the vector database does not contain a first long-term memory related to the trip summary, the terminal can directly store the trip summary as a new long-term memory entry into the vector database and the relational database. This method can realize the storage of long-term memory.
[0070] In one embodiment, short-term memory includes a first short-term memory stored in a vector database and a second short-term memory stored in a relational database; such as Figure 4 As shown, step S102 may further include:
[0071] Step S401: Obtain the user identifier associated with the itinerary summary and the first semantic vector corresponding to the itinerary summary;
[0072] Step S402: Store the user identifier, the first semantic vector, and the text content corresponding to the trip summary as the first short-term memory into the vector database.
[0073] Similar to long-term memory, short-term memory in this embodiment can also include the following two types: short-term memory stored in a vector database, i.e., the first long-term memory, and short-term memory stored in a relational database, i.e., the second short-term memory.
[0074] Specifically, after obtaining the trip summary, the terminal can also obtain the user identifier associated with the trip summary and extract the semantic vector corresponding to the trip summary as the first semantic vector. Then, the user identifier, the first semantic vector, and the text content corresponding to the trip summary can be stored in the vector database as the first short-term memory.
[0075] Step S403: Obtain the memory identifier of the first short-term memory in the vector database;
[0076] Step S404: Store the user identifier, memory identifier, text content, and attribute data corresponding to the itinerary summary as a second short-term memory into a relational database.
[0077] The memory identifier of the first short-term memory refers to the index identifier used to uniquely identify the first short-term memory. After the first short-term memory is stored in the vector database, the terminal can also obtain the memory identifier of the first short-term memory and store the user identifier, memory identifier, text content corresponding to the trip summary, and attribute data corresponding to the trip summary as the second short-term memory corresponding to the first short-term memory in the relational database.
[0078] In this embodiment, after obtaining the trip summary, the terminal can also store the trip summary as a new short-term memory entry into the vector database and the relational database. In this way, the short-term memory of a single trip can be stored.
[0079] In addition, step S101 may further include: obtaining pre-built prompts for generating a trip summary; inputting the trip status information, dialogue interaction data and prompts into a pre-built large language model, and generating a trip summary through the large language model.
[0080] In this embodiment, the trip summary can be generated by a large language model. The terminal can obtain pre-built prompt words, which can be used to prompt the large language model to generate the trip summary. The prompt words, trip status information and dialogue interaction data are input into the large language model. For example, the large language model can summarize relevant events in the trip, including trip information, environmental information, key user interaction information and vehicle status information, etc., in text form to generate the trip summary.
[0081] In this embodiment, a trip summary can be generated using a large language model by inputting pre-built prompt words, which can improve the efficiency of trip summary generation.
[0082] In one embodiment, such as Figure 5 As shown, after step S103, the following may also be included:
[0083] Step S501: If the dialogue interaction text triggered by the target user is detected, the fourth semantic vector corresponding to the dialogue interaction text is obtained.
[0084] The fourth semantic vector refers to the contextual semantic vector corresponding to the dialogue interaction text triggered by the target user. After the vector database and relational database are constructed, it can be applied to cross-trip dialogue scenarios. Specifically, if the target user initiates a dialogue interaction during a trip, the terminal can collect the contextual semantic vector corresponding to the dialogue interaction text as the fourth semantic vector.
[0085] Step S502: Based on the target user's user identifier and the fourth semantic vector, retrieve the long-term memory associated with the dialogue interaction text from the vector database, and retrieve the text content corresponding to the long-term memory associated with the dialogue interaction text.
[0086] After obtaining the target user's user identifier and the fourth semantic vector, long-term memories associated with dialogue interaction text can be filtered from the vector database based on the user identifier and the fourth semantic vector. For example, long-term memories matching the user identifier can be filtered from the vector database first, and then long-term memories with a similarity greater than a preset threshold with the fourth semantic vector can be filtered based on the semantic vector of the long-term memories matching the user identifier. For example, long-term memories with a similarity greater than 80% with the fourth semantic vector can be used as long-term memories associated with dialogue interaction text. Afterwards, the text content corresponding to the long-term memory can be obtained.
[0087] Step S503: Generate dialogue response text corresponding to the dialogue interaction text based on the text content of the dialogue interaction text and the text content of the long-term memory associated with the dialogue interaction text.
[0088] After obtaining the text content corresponding to the long-term memory associated with the dialogue interaction text, this text content can be added to the context text content of the dialogue interaction text. This allows the AI terminal to combine the context text content and the text content corresponding to the long-term memory to obtain the corresponding dialogue response text and complete the dialogue interaction response.
[0089] In this embodiment, long-term memory stored in the vector database can also be used to complete cross-trip dialogue interaction, which can further improve the realism of in-vehicle AI interaction.
[0090] In one embodiment, such as Figure 6 As shown, after step S103, the following may also be included:
[0091] Step S601: In response to a memory update operation initiated by the target user for long-term memory stored in a relational database, obtain attribute data and text content that match the memory update operation.
[0092] A memory update operation refers to an action initiated by the target user to update long-term memories stored in a relational database. This includes actions such as editing or deleting related long-term memories. The attribute data matched by the memory update operation refers to the attribute data of the long-term memories that need to be updated. For example, if the target user can search and update long-term memories within a preset time period, then the memory update time can be added to the memory update operation, and this update time can serve as the attribute data matched by the memory update operation.
[0093] The text content corresponding to the memory update operation refers to the memory update content entered by the user. Specifically, when a user needs to update the long-term memory stored in a relational database, they can initiate a memory update operation. After receiving the memory update operation, the terminal can obtain the attribute data and text content matched by the memory update operation, that is, obtain the memory update time carried in the memory update operation and the update text content corresponding to the memory update operation.
[0094] Step S602: Based on the attribute data matched by the memory update operation and the user identifier of the target user, retrieve the third long-term memory to be updated from the long-term memory stored in the relational database, and use the text content matched by the memory update operation as the updated text content of the third long-term memory.
[0095] The third long-term memory refers to the long-term memory stored in the relational database that the target user needs to update. After the terminal obtains the attribute data that matches the memory update operation, it can combine the attribute data and the user identifier of the target user to filter out the third long-term memory that needs to be updated from the long-term memory stored in the relational database. Thus, the text content that matches the memory update operation is used as the text content after the third long-term memory is updated.
[0096] For example, when user A needs to update long-term memory A within a preset date range, a memory update operation can be triggered. The terminal can use user A's user identifier as the target user's user identifier and the preset date range as the update time data to match the memory update operation, to filter out long-term memories in the relational database that match the above update time data and the target user's user identifier, as the third long-term memory to be updated. Then, the memory text content that the user needs to update can be used as the updated text content of the third long-term memory.
[0097] Step S603: Obtain the fourth long-term memory corresponding to the third long-term memory from the vector database, and obtain the fourth semantic vector corresponding to the text content updated by the third long-term memory;
[0098] Step S604: Use the text content updated in the third long-term memory as the text content updated in the fourth long-term memory, and use the fourth semantic vector as the semantic vector updated in the fourth long-term memory.
[0099] After updating the long-term memory stored in the relational database, the terminal needs to synchronize this update to the long-term memory stored in the vector database. Specifically, the terminal can first determine the fourth long-term memory corresponding to the third long-term memory from the vector database. For example, it can identify the fourth long-term memory stored in the vector database based on the memory identifier corresponding to the third long-term memory stored in the relational database. Furthermore, the terminal can also replace the text content of the fourth long-term memory with the updated text content of the third long-term memory based on the fourth semantic vector corresponding to the updated text content of the third long-term memory, and use the fourth semantic vector as the updated semantic vector of the fourth long-term memory.
[0100] In this embodiment, the user can also update the long-term memories stored in the vector database and the second run-length database, which can further improve the intelligence of long-term memory management.
[0101] In one embodiment, a vehicle-mounted large-scale model memory method based on a combination of relational and vector databases is also provided. This method offers a hierarchical memory management architecture, dividing dialogue memory into contextual memory, short-term memory, and long-term memory. This enables efficient maintenance of dialogue context, the accumulation and reuse of trip experience, and coherent interaction in multi-turn cross-trip dialogues, significantly improving the intelligence level and user experience of the vehicle-mounted AI assistant. Furthermore, the association between the relational and vector databases in this embodiment does not rely on a mapping table, thus reducing system complexity and potential failure points, thereby improving system performance. The architecture consists of a short-term memory subsystem, a long-term memory subsystem, and a cross-trip memory fusion module. The composition and function of each component are as follows:
[0102] 1. Short-term memory subsystem:
[0103] Core function: Maintaining dialogue interaction data within a single session, generating real-time itinerary summaries, and providing contextual support for the current dialogue. The short-term memory subsystem may include:
[0104] (1) Data input layer:
[0105] Triggering sources: real-time dialogue text between the user and the AI assistant, vehicle status events (such as vehicle power on / off).
[0106] Input content: Dialogue interaction data and associated trip status information (such as current vehicle speed and navigation destination).
[0107] (2) Context storage unit:
[0108] Storage medium: Implemented using a relational database (such as MySQL) or an in-memory database (such as Redis).
[0109] Storage strategy: Supports customizable rolling storage length (e.g., retaining up to 120 most recent conversations), automatically eviction of the oldest conversation records, ensuring controllable memory usage and coverage of the complete single-trip interaction cycle.
[0110] (3) Short-term memory generating unit:
[0111] Function: Based on real-time dialogue streams, it generates a trip summary through semantic compression and key information extraction.
[0112] Storage medium: Relational database (second run-length memory database): stores structured metadata (user ID, index ID, memory generation time, update time, memory content type, memory content).
[0113] Vector database (first-trip memory database): Stores semantic vectors of trip summary content for subsequent similarity retrieval and long-term memory fusion. This vector database can be an ID-indexed vector database, such as the FAISS vector database with index type IndexIDMap2.
[0114] (4) Work process:
[0115] After the vehicle is powered on, the system initializes the short-term memory context cache. Each round of dialogue interaction data between the user and the AI assistant is written to the context storage unit in real time. When the cumulative dialogue reaches a set threshold (e.g., every N rounds of dialogue) or a key stage of the trip (e.g., before power-off), the short-term memory generation unit is triggered. Using a large model and prompt words, relevant events in this driving cycle are summarized, including trip information, environmental information, key user interactions, and vehicle status information, presented in text form to generate a trip summary.
[0116] The itinerary summary is stored in a relational database and a vector database respectively. Each time a memory vector is stored in the vector database, the stored index ID (memory identifier) needs to be stored in the relational database for subsequent CRUD operations. At the same time, the context cache is reset to prepare for the next interaction.
[0117] 2. Long-term memory subsystem:
[0118] Core function: To accumulate user behavior patterns, preferences and historical experience across processes, and to achieve long-term coherence in multi-turn dialogues.
[0119] Data input layer: Receives travel summaries from the short-term memory subsystem, as well as memory update commands triggered by the user.
[0120] (1) Long-term memory storage unit:
[0121] Relational databases store full-text structured memory metadata (user ID, memory type, vector data index, memory generation time, update time, vector database index ID, memory content), and support fast retrieval by user, time, type, and other dimensions.
[0122] Vector Database: Stores semantic vectors summarizing all trips. Through vector similarity calculation, it can quickly locate historical memories related to the current conversation.
[0123] (2) Memory update and fusion mechanism:
[0124] When a new itinerary summary (an itinerary summary associated with dialogue interaction data) is received, the system first searches the vector database for historical memories semantically similar to that summary. If a memory entry with high similarity is found (similarity greater than or equal to 80% recalled through the vector database), i.e., the first long-term memory, memory fusion and update are performed. The memory in the vector database is updated, and the "update time" and "memory content" of the corresponding second long-term memory in the relational database are also updated. If no similar memory is found, it is directly inserted as a new entry into the database. At the same time, the data related to this long-term memory in the relational database is updated.
[0125] Furthermore, the aforementioned memory updates and fusions can be implemented in the cloud, which reduces reliance on local computing power, improves local response speed, and ensures the security and scalability of short-term and long-term memories.
[0126] In summary, the storage structure of trip memory can be as follows: Figure 7 As shown.
[0127] 3. Cross-trip memory fusion module:
[0128] Its core function is to link long-term memories with current short-term memories at the start of a new journey, achieving a seamless transition between contexts.
[0129] Triggering time: When the vehicle is powered on or when a new trip begins.
[0130] Workflow:
[0131] The system retrieves the user's historical memory vector from the long-term memory vector database based on the current user ID (the target user's user identifier). It then calculates the similarity between the retrieved historical memory vector and the current short-term memory context vector (fourth semantic vector). If a highly similar historical memory is found (with an 80% threshold, and different retrieval methods can be configured), i.e., a long-term memory associated with the dialogue interaction text, its content is injected into the current short-term memory context cache, enabling the AI assistant to "recall" the user's historical preferences and thus provide a more accurate response. If no similar memory is found, the system responds solely based on the current context.
[0132] The system can also accurately query the user's preference tags in long-term memory from the relational database based on the current user ID, and present them to the user in a visual format. The user can edit or delete tag information on the interface (a memory update operation initiated for long-term memory). The user's operations on the interface are synchronously stored in the relational database, and the updated data in the relational database is synchronously updated to the vector database, so that the user's memory can be managed and can also prepare for more accurate service to the user in the future.
[0133] In this embodiment, by setting up a short-term memory subsystem (including a context storage unit and a trip summary generation unit), the system can efficiently maintain a complete dialogue context within a single trip and automatically generate a structured trip summary at key nodes. This allows the AI assistant to accurately understand the evolution of the user's intent within the current trip, avoiding irrelevant answers due to context loss, thus significantly improving the contextual coherence and response accuracy of multi-turn dialogues. Simultaneously, the long-term memory subsystem performs structured storage and vector semantic indexing of historical trip summaries, and, combined with the cross-trip memory fusion module, automatically retrieves and injects relevant historical memories when a new trip begins, enabling the system to "remember" the user's historical preferences. Therefore, it can achieve intelligent "recall" and reuse of user preferences across trips, enhancing personalized service capabilities. The short-term memory subsystem employs a rolling caching strategy (e.g., retaining a maximum of 20 dialogues) and automatically resets the context in conjunction with vehicle power-on / off events to prevent unlimited memory growth; at the same time, only compressed trip summaries, rather than the original full-text dialogues, are stored in long-term memory, reducing storage space usage. Furthermore, the context cache utilizes in-memory databases such as Redis to ensure that the single-turn dialogue response latency is controlled within 200ms, meeting the requirements of real-time in-vehicle interaction. This effectively controls memory and storage resource consumption, ensuring the real-time performance of the in-vehicle system. An incremental memory fusion mechanism (which triggers updates only when the semantic similarity between the new memory and historical memory is ≥80%) avoids the problems of frequent full-scale overwrites or redundant storage found in traditional solutions. This mechanism allows the long-term memory to maintain high information density and low redundancy during continuous use, reducing database write operations and significantly lowering I / O load and energy consumption, enabling efficient and low-overhead dynamic memory updates. This embodiment also provides two implementation methods: local deployment and cloud-edge collaborative deployment. Local deployment utilizes MySQL+Redis+FAISS to achieve low latency and high privacy protection; cloud-edge collaboration deploys computationally intensive memory fusion and vector retrieval to the cloud, reducing the CPU utilization of the in-vehicle system by more than 30%, while supporting the management of larger-scale user memory databases and adapting to different vehicle models and cost constraints. Furthermore, the long-term memory subsystem maintains both structured metadata (including memory generation time, update time, user ID, memory type, etc.) and semantic vector representation. The system allows users to query, modify, or delete stored memory entries through natural language commands (such as "delete the memory of the conversation about maintenance last week") or graphical interface operations, using text semantic similarity retrieval or time range filtering. This process can accurately manage memory content based on semantic similarity or time range, improving users' control over privacy and data.
[0134] In summary, the hierarchical memory mechanism provided in this embodiment can ensure the fluency of dialogue within a single trip and effectively accumulate cross-trip experience by separating short-term memory and long-term memory, thus solving the "forgetfulness" problem of traditional dialogue systems. It can also be combined with vector-enhanced semantic understanding, that is, using vector databases for semantic storage and retrieval, so that the association of memories no longer depends on precise keyword matching, but is based on deep semantic similarity, which greatly improves the accuracy and robustness of memory retrieval. Furthermore, it realizes dynamic memory updates, that is, through an incremental memory fusion and update mechanism, the system can efficiently maintain the latest status of users and avoid the high resource consumption of the traditional full update mode.
[0135] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0136] Based on the same inventive concept, this application also provides a trip memory database construction apparatus for implementing the trip memory database construction method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more trip memory database construction apparatus embodiments provided below can be found in the limitations of the trip memory database construction method described above, and will not be repeated here.
[0137] In one embodiment, such as Figure 8 As shown, a travel memory database construction device is provided, including: a travel summary generation module 801, a short-term memory storage module 802, and a long-term memory storage module 803, wherein:
[0138] The itinerary summary generation module 801 is used to generate an itinerary summary associated with the dialogue interaction data based on the dialogue interaction data and the itinerary status information associated with the dialogue interaction data.
[0139] The short-term memory storage module 802 is used to store the trip summary as short-term memory into a first trip memory database and a second trip memory database; wherein, the first trip memory database is a vector database and the second trip memory database is a relational database;
[0140] The long-term memory storage module 803 is used to update the long-term memories stored in the first trip memory database and the second trip memory database based on the trip summary; the long-term memories are generated based on the historical trip summary associated with historical dialogue interaction data, and the historical dialogue interaction data is the dialogue data before the dialogue interaction data.
[0141] In one embodiment, the long-term memory includes a first long-term memory stored in the vector database and a second long-term memory stored in the relational database; the long-term memory storage module 803 is further configured to obtain the user identifier associated with the trip summary and the first semantic vector corresponding to the trip summary; to use the long-term memory stored in the vector database that matches the user identifier as associated long-term memory, and to obtain the second semantic vector of each associated long-term memory; to obtain the similarity between the first semantic vector and each second semantic vector, and to use the associated long-term memory with a similarity greater than a preset similarity threshold as the first long-term memory; to update the first long-term memory based on the trip summary, and to obtain the second long-term memory corresponding to the first long-term memory from the relational database, so as to update the second long-term memory using the updated first long-term memory.
[0142] In one embodiment, the long-term memory storage module 803 is further configured to fuse the text content corresponding to the first long-term memory and the text content corresponding to the itinerary summary to obtain fused text content, and obtain a third semantic vector corresponding to the fused text content; use the fused text content as the updated text content of the first long-term memory, and use the third semantic vector as the updated semantic vector of the first long-term memory; use the updated text content of the first long-term memory as the updated text content of the second long-term memory, and update the attribute data of the second long-term memory.
[0143] In one embodiment, the long-term memory storage module 803 is further configured to, when the similarity between the first semantic vector and each of the second semantic vectors is less than the preset similarity threshold, store the user identifier, the first semantic vector, and the text content corresponding to the trip summary as first long-term memory in the vector database; obtain the memory identifier of the first long-term memory, and store the user identifier, the memory identifier, the text content corresponding to the trip summary, and the attribute data corresponding to the trip summary as second long-term memory in the relational database.
[0144] In one embodiment, the short-term memory includes a first short-term memory stored in the vector database and a second short-term memory stored in the relational database; the short-term memory storage module 802 is further configured to obtain the user identifier associated with the trip summary and the first semantic vector corresponding to the trip summary; store the user identifier, the first semantic vector, and the text content corresponding to the trip summary as the first short-term memory in the vector database; obtain the memory identifier of the first short-term memory in the vector database; and store the user identifier, the memory identifier, the text content, and the attribute data corresponding to the trip summary as the second short-term memory in the relational database.
[0145] In one embodiment, the itinerary summary generation module 801 is further configured to obtain pre-built prompts for generating the itinerary summary; input the itinerary status information, the dialogue interaction data, and the prompts into a pre-built large language model, and generate the itinerary summary through the large language model.
[0146] In one embodiment, the trip memory database construction apparatus further includes: a dialogue interaction response module, configured to, upon detecting dialogue interaction text triggered by a target user, obtain a fourth semantic vector corresponding to the dialogue interaction text; obtain long-term memory associated with the dialogue interaction text from the vector database based on the user identifier of the target user and the fourth semantic vector, and obtain text content corresponding to the long-term memory associated with the dialogue interaction text; and generate dialogue response text corresponding to the dialogue interaction text based on the text content of the dialogue interaction text and the text content corresponding to the long-term memory associated with the dialogue interaction text.
[0147] In one embodiment, the trip memory database construction apparatus further includes: a trip memory update module, configured to, in response to a memory update operation initiated by a target user for long-term memories stored in the relational database, obtain attribute data and text content matching the memory update operation; based on the attribute data matching the memory update operation and the user identifier of the target user, obtain a third long-term memory to be updated from the long-term memories stored in the relational database, and use the text content matching the memory update operation as the updated text content of the third long-term memory; obtain a fourth long-term memory corresponding to the third long-term memory from the vector database, and obtain a fourth semantic vector corresponding to the updated text content of the third long-term memory; use the updated text content of the third long-term memory as the updated text content of the fourth long-term memory, and use the fourth semantic vector as the updated semantic vector of the fourth long-term memory.
[0148] Each module in the aforementioned travel memory database construction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0149] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for constructing a travel memory database. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0150] Those skilled in the art will understand that Figure 9 The structure shown is a block diagram of a partial structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0151] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0152] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.
[0153] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0154] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0155] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program mentioned can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0156] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0157] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for constructing a travel memory database, characterized in that, The method includes: Based on dialogue interaction data and the trip status information associated with the dialogue interaction data, a trip summary associated with the dialogue interaction data is generated; this includes: obtaining pre-constructed prompt words for generating the trip summary; inputting the trip status information, the dialogue interaction data, and the prompt words into a pre-constructed large language model, and generating the trip summary through the large language model; the trip status information includes trip information, environmental information, and vehicle status information during vehicle travel, and the trip summary is a summary text of the vehicle trip associated with the dialogue interaction data; The itinerary summary is stored as short-term memory in a first itinerary memory database and a second itinerary memory database; wherein, the first itinerary memory database is a vector database and the second itinerary memory database is a relational database; including: storing the first semantic vector corresponding to the itinerary summary into the first itinerary memory database; Based on the trip summary, the long-term memories stored in the first trip memory database and the second trip memory database are updated; the long-term memories are generated based on the historical trip summary associated with historical dialogue interaction data, and the historical dialogue interaction data is the dialogue data before the dialogue interaction data; the long-term memories include the first long-term memories stored in the vector database, the first long-term memories include the semantic vector of the first long-term memories, and the text content corresponding to the first long-term memories; the step of updating the long-term memories stored in the first trip memory database and the second trip memory database based on the trip summary includes: obtaining the first long-term memories from the vector database according to the first semantic vector corresponding to the trip summary; fusing the text content corresponding to the first long-term memories and the text content corresponding to the trip summary to obtain fused text content, and obtaining the third semantic vector corresponding to the fused text content; using the fused text content as the updated text content of the first long-term memories, and using the third semantic vector as the updated semantic vector of the first long-term memories.
2. The method according to claim 1, characterized in that, The long-term memory includes the second long-term memory stored in the relational database; the update of the long-term memories stored in the first and second travel memory databases based on the travel summary includes: Obtain the user identifier associated with the trip summary, and the first semantic vector corresponding to the trip summary; The long-term memories stored in the vector database that match the user identifier are used as associated long-term memories, and the second semantic vector of each associated long-term memory is obtained. Obtain the similarity between the first semantic vector and each of the second semantic vectors, and use the associated long-term memories with similarity greater than a preset similarity threshold as the first long-term memories; The first long-term memory is updated based on the trip summary, and the second long-term memory corresponding to the first long-term memory is obtained from the relational database, so as to update the second long-term memory using the updated first long-term memory.
3. The method according to claim 2, characterized in that, The step of updating the second long-term memory using the updated first long-term memory includes: The updated text content of the first long-term memory is used as the updated text content of the second long-term memory, and the attribute data of the second long-term memory is updated.
4. The method according to claim 2, characterized in that, After obtaining the second semantic vector of each of the associated long-term memories, the method further includes: If the similarity between the first semantic vector and each of the second semantic vectors is less than the preset similarity threshold, the user identifier, the first semantic vector, and the text content corresponding to the trip summary are stored as the first long-term memory in the vector database. Obtain the memory identifier of the first long-term memory, and store the user identifier, the memory identifier, the text content corresponding to the trip summary, and the attribute data corresponding to the trip summary as the second long-term memory in the relational database.
5. The method according to claim 1, characterized in that, The short-term memory includes a first short-term memory stored in the vector database and a second short-term memory stored in the relational database; storing the trip summary as short-term memory in the first trip memory database and the second trip memory database includes: Obtain the user identifier associated with the trip summary, and the first semantic vector corresponding to the trip summary; The user identifier, the first semantic vector, and the text content corresponding to the trip summary are stored as the first short-term memory in the vector database. Obtain the memory identifier of the first short-term memory in the vector database; The user identifier, the memory identifier, the text content, and the attribute data corresponding to the itinerary summary are stored as a second short-term memory in the relational database.
6. The method according to any one of claims 1 to 5, characterized in that, After updating the long-term memories stored in the first and second travel memory databases, the method further includes: Upon detecting dialogue interaction text triggered by the target user, obtain the fourth semantic vector corresponding to the dialogue interaction text; Based on the user identifier of the target user and the fourth semantic vector, the long-term memory associated with the dialogue interaction text is obtained from the vector database, and the text content corresponding to the long-term memory associated with the dialogue interaction text is obtained. Based on the text content of the dialogue interaction text and the text content corresponding to the long-term memory associated with the dialogue interaction text, a dialogue response text corresponding to the dialogue interaction text is generated.
7. The method according to any one of claims 1 to 5, characterized in that, After updating the long-term memories stored in the first and second travel memory databases, the method further includes: In response to a memory update operation initiated by a target user for long-term memory stored in the relational database, attribute data and text content matching the memory update operation are obtained; Based on the attribute data matched by the memory update operation and the user identifier of the target user, the third long memory to be updated is obtained from the long memory stored in the relational database, and the text content matched by the memory update operation is used as the updated text content of the third long memory. Obtain the fourth long-term memory corresponding to the third long-term memory from the vector database, and obtain the fourth semantic vector corresponding to the text content updated by the third long-term memory; The text content updated by the third long-term memory is used as the text content updated by the fourth long-term memory, and the fourth semantic vector is used as the semantic vector updated by the fourth long-term memory.
8. A device for constructing a travel memory database, characterized in that, The device includes: A trip summary generation module is used to generate a trip summary associated with the dialogue interaction data based on the dialogue interaction data and the trip status information associated with the dialogue interaction data; it is further used to obtain pre-built prompt words for generating the trip summary; the trip status information, the dialogue interaction data, and the prompt words are input into a pre-built large language model, and the trip summary is generated through the large language model; the trip status information includes trip information, environmental information, and vehicle status information during vehicle travel, and the trip summary is a summary text of the vehicle trip associated with the dialogue interaction data; A short-term memory storage module is used to store the trip summary as short-term memory into a first trip memory database and a second trip memory database; wherein, the first trip memory database is a vector database and the second trip memory database is a relational database; further, it is used to store the first semantic vector corresponding to the trip summary into the first trip memory database; A long-term memory storage module is used to update the long-term memories stored in the first trip memory database and the second trip memory database based on the trip summary. The long-term memories are generated based on historical trip summaries associated with historical dialogue interaction data, where the historical dialogue interaction data is the dialogue data prior to the dialogue interaction data. The long-term memories include a first long-term memory stored in the vector database, which includes a semantic vector of the first long-term memory and the text content corresponding to the first long-term memory. The long-term memory storage module is further used to retrieve the first long-term memory from the vector database based on the first semantic vector corresponding to the trip summary; to fuse the text content corresponding to the first long-term memory and the text content corresponding to the trip summary to obtain fused text content, and to obtain a third semantic vector corresponding to the fused text content; to use the fused text content as the updated text content of the first long-term memory, and to use the third semantic vector as the updated semantic vector of the first long-term memory.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.