A multi-source context fusion travel and tourism dialogue interaction system

CN122885115APending Publication Date: 2026-10-09SHENZHEN SHENLAN TRAVEL INVESTMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611066967.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0006]针对现有技术的不足,本发明提供了一种多源上下文融合的文旅对话交互系统,解决了现有文旅交互系统存在上下文融合不足导致的语义割裂、同步模型调用引发的系统资源阻塞,以及路线规划算法未充分结合用户偏好与客观物理限制导致方案不合理的问题

Benefits of technology

1、本发明通过构建多源上下文融合机制,提取用户画像、历史交互数据与历史对话缓存进行拼接,在数据处理过程中,利用双向编码器网络计算语义特征的余弦相似度,并引入时间衰减因子对特征权重进行动态更新,使得系统能够有效召回与当前意图相关的前置业务参数,这种机制避免了由于单轮输入信息不足或长期记忆缺失导致的前后语义割裂,保障了多轮交互场景下数据流转的连贯性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122885115A_ABST
    Figure CN122885115A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of natural language processing, and discloses a travel dialogue interaction system based on multi-source context fusion. A conversation management module performs intent recognition based on user input information and determines a dialogue or route generation request. When the dialogue generation module determines a dialogue request, the dialogue generation module fuses a user portrait, historical data and a cache splicing prompt word to obtain a reply text, and writes a feature entity into a memory bank in a structured manner. When the route generation module determines a route generation request, the route generation module generates a candidate node pool by weighting node data in combination with a user portrait, obtains distance and time consumption parameters, performs path search to generate a candidate travel route sequence, and a recommendation reason generation module extracts sequence features to generate a text explanation. After the data persistence module writes the text explanation into a storage layer, a response is issued. The application guarantees semantic coherence in the interaction stage and can generate a travel route that takes into account user preferences and objective physical limitations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, specifically to a multi-source context fusion-based cultural tourism dialogue and interaction system. Background Technology

[0002] With the development of artificial intelligence technology, intelligent dialogue systems are being widely used in cultural and tourism scenarios. Users expect to directly obtain personalized travel suggestions and itinerary planning solutions through natural language interaction. However, existing cultural and tourism interactive systems still have some limitations in practical applications.

[0003] In terms of natural language interaction processing, most existing systems rely on short-term historical request caching to maintain the dialogue state, lacking the ability to aggregate and restructure multi-source data. When faced with complex travel dialogues spanning multiple rounds or long periods, the system struggles to accurately extract and integrate memory data such as users' deep preferences and historical trajectories from past expressions. This results in output responses lacking necessary supporting background information, easily leading to semantic incoherence or cognitive gaps.

[0004] In terms of system architecture and scheduling, integrating generative language models for text reasoning typically involves high network latency and computational time. Traditional system designs often employ synchronous transaction chain processing models. Under high concurrency, lengthy external network operations can easily lead to prolonged congestion of internal database write locks or connection pool resources, reducing the overall system throughput and stability. Furthermore, in the numerical computation phase of low-level data processing, error-proofing mechanisms for boundary conditions or extreme parameter inputs are often inadequate. When performing division operations for high-dimensional vector similarity comparison or sequence combination cost evaluation, errors can easily occur due to the denominator approaching zero.

[0005] In the core travel route planning stage, existing route generation models generally focus on finding the shortest path for a single spatial distance, or simply stacking points of interest based on static popularity. This planning logic fails to perform in-depth joint constraint calculations on the user's personalized profile characteristics and the estimated travel time, spatial distribution decay, and richness of node categories in the real physical world. As a result, travel sequences generated by traditional algorithms are prone to meaningless spatial back-and-forth trips, or highly homogenized daily itineraries, and the final solutions often deviate from objective spatial physical constraints and the user's actual travel needs. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a multi-source context fusion-based cultural tourism dialogue and interaction system. This system solves the problems of semantic fragmentation caused by insufficient context fusion, system resource blocking caused by synchronous model calls, and unreasonable solutions due to route planning algorithms not fully incorporating user preferences and objective physical constraints in existing cultural tourism interaction systems.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a multi-source context fusion cultural tourism dialogue interaction system, comprising a conversation management module, a dialogue generation module, a route generation module, a recommendation reason generation module, and a data persistence module.

[0008] The session management module is used to parse request messages to extract feature parameters and user input information, perform intent recognition based on user input information, and determine whether the request type is a dialogue request or a route generation request.

[0009] The dialogue generation module is used to extract user profile feature vectors, historical interaction data and historical dialogue cache when a dialogue request is determined, and concatenate them with user input information to form prompt text, which is then sent to the model service layer to obtain the response text. The feature entities in the response text are then converted into structured data and written to the long-term memory.

[0010] The route generation module is used to obtain node data and user profile feature vectors when a route generation request is determined. It combines the user profile feature vectors to perform weighting operations to generate a candidate node pool, obtain distance and time parameters, and perform path search in the candidate node pool to generate a candidate travel route sequence.

[0011] The recommendation reason generation module and the data persistence module are used to extract the attribute features of candidate travel route sequences to generate text descriptions, write the reply text or candidate travel route sequences into the data storage layer, encapsulate the response message and send it to the mobile device.

[0012] The multi-source context fusion cultural tourism dialogue and interaction system also includes a user profiling module. This module receives historical behavior data from mobile devices, extracts basic interest tags and access frequencies from the historical behavior data, converts them numerically according to preset feature dimensions, and generates interest preference feature vectors, travel style feature vectors, and frequently used destination feature vectors. These feature vectors are then concatenated to generate a user profile feature vector. The system extracts the time difference between the newly collected historical behavior data and the current statistical time, calculates a time decay factor, and periodically updates the user profile feature vector based on this time decay factor.

[0013] The session management module calls a pre-defined natural language processing component to parse the natural language text sequence corresponding to the user input information, outputs entity category labels and the probability value that the overall text belongs to the route generation intent, and extracts a set of feature entities. When the number of elements in the feature entity set is not less than the intent determination threshold, and the feature entity set contains explicit city or regional spatial parameters, the current request type is determined to be a route generation request; where the intent determination threshold is a positive integer greater than 0.

[0014] The system's context fusion module utilizes a pre-defined text vectorization component to map the natural language text sequence corresponding to user input information and long-term memory text records (serving as historical interaction data) into semantic embedding vectors. These semantic embedding vectors include the current input vector and the vectors of each memory record. The system calculates the cosine similarity between the current input vector and each memory record vector. Before performing the cosine similarity calculation, the system checks the L2 norm of the current input vector and each memory record vector, adding a pre-defined minimal constant smoothing term to the denominator to prevent system-level errors caused by a zero denominator that could lead to process crashes. The system extracts the header memory text with similarity scores greater than a pre-defined similarity threshold to form the target memory subset to be fused; the pre-defined similarity threshold is a value between 0 and 1.

[0015] Before initiating a remote model inference command, the dialogue generation module obtains the historical dialogue state of the current session, serializes it, and stores it in a distributed cache database to generate a chat memory snapshot. When generating the chat memory snapshot, it binds the current session identifier and a globally incrementing version timestamp. The system employs a long-short transaction separation mechanism, defining the remote inference process of the model service layer as an asynchronous long transaction. When the remote inference call returns a successful network status code and the response text is not empty and conforms to a preset natural language parsing format, the system initiates a local database write short transaction, writing the user input information, response text, and the link log of this call as an atomic operation to the data storage layer. When the remote call triggers a timeout threshold, the system aborts the short transaction write link and activates a snapshot-based failure rollback mechanism to overwrite the historical dialogue cache using the chat memory snapshot; the timeout threshold is a positive integer between 10 and 30 seconds.

[0016] The memory management module appends a creation timestamp to memory records written to the long-term memory bank and calculates a memory validity score. Memory records consist of structured data. The system extracts the confidence probability parameter output by the model service layer and multiplies it by a time decay term to obtain the memory validity score. The time decay term is obtained by calculating the negative exponent of the natural constant; the exponent is the product of a preset memory decay coefficient and the time difference, which is the difference between the current absolute timestamp and the absolute timestamp at the time of initial creation of the corresponding memory record. When the memory validity score decreases below the retention threshold, and the memory category classification code corresponding to the memory record does not belong to the baseline label that needs to be permanently saved, the system marks the corresponding memory record as archived.

[0017] The tool invocation and auditing module extracts discrete data items from the response text, encapsulates these discrete data items into structured parameter payloads, and obtains the memory entity data sequence to be deposited along with accompanying context parameters. These context parameters include model invocation identifiers, session identifiers, user identifiers, and device identifiers. The system performs a string concatenation operation on the model invocation identifier, the current session identifier, the user identifier, and the memory entity data sequence to be deposited, based on a preset delimiter. The system uses a cryptographic secure hash algorithm to construct a hash mapping function to convert the concatenation result into a tool invocation fingerprint. The system queries the audit log cache pool. If no physical record matching the tool invocation fingerprint exists in the audit log cache pool, or if a matching record exists but the absolute difference in trigger times exceeds the security blocking window threshold, the system determines the tool invocation instruction is valid and triggers the underlying application programming interface to complete the write-to-database writing of the structured data consisting of the memory entity data sequence to be deposited. The security blocking window threshold is a positive integer between 500 milliseconds and 2000 milliseconds.

[0018] The route generation module calculates the comprehensive recommendation weight of each candidate graph node in the candidate node pool. The comprehensive recommendation weight is obtained by weighted summation of the matching degree function, the hit indicator function, and the spatial distribution decay function. The system extracts the maximum and minimum extreme values ​​of distance and time for each candidate travel route sequence and performs max-min normalization preprocessing to obtain normalized spatial physical distance and normalized estimated traffic time. The system subtracts the normalized spatial physical distance and normalized estimated traffic time from the sum of the comprehensive recommendation weights and adds the richness score parameter of the location category to obtain the comprehensive evaluation score of the candidate travel route sequences. The sequences are then sorted in descending order, and the top few optimal route sequences are selected as the final output candidate travel route sequences.

[0019] The map abstraction module triggers a local degradation calculation component when an external map service times out. The system calculates the great circle distance between two points using the law of cosines based on the latitude and longitude coordinates of candidate map nodes in the candidate node pool. This distance is used as the numerator. Traffic mode feature parameters are extracted, and the product of the prior reference speed parameter for the user-selected traffic mode feature parameter and the traffic congestion adjustment coefficient is used as the basic denominator. A very small non-zero positive real number smoothing term is added to the basic denominator to form the final denominator. The system then adds the result of the division between the numerator and the final denominator to the fixed action penalty time under the corresponding traffic mode feature parameter to obtain the estimated traffic time. The positive real number smoothing term is set to a value of 10. -5 Up to 10 -3 between.

[0020] The recommendation reason generation module performs a logarithmic summation operation on the word generation conditional probabilities output by the classifier at the end of the model network in the model service layer. It then performs division and decay multiplication operations using an exponential term containing the total length parameter of the current sequence, and forcibly appends a minimal positive real number smoothing term to the denominator to truncate the sequence with the highest score as the text description. When synchronously writing candidate travel route sequences to the data storage layer, the system extracts the core identifier sequence and the total number of subordinate stations from the candidate travel route sequence, performs a standard secure hash operation to generate a unique integrity check character as an independent field, and stores it in the database along with the candidate travel route sequence. The positive real number smoothing term is set to a value range of 10. -5 Up to 10 -3 between.

[0021] This invention provides a multi-source context fusion-based dialogue and interaction system for cultural tourism. It has the following beneficial effects: 1. This invention constructs a multi-source context fusion mechanism, extracts user profiles, historical interaction data, and historical dialogue cache and concatenates them. During data processing, a bidirectional encoder network is used to calculate the cosine similarity of semantic features, and a time decay factor is introduced to dynamically update the feature weights. This enables the system to effectively recall the preceding business parameters related to the current intent. This mechanism avoids semantic fragmentation caused by insufficient single-round input information or long-term memory loss, and ensures the continuity of data flow in multi-round interaction scenarios.

[0022] 2. This invention sets up a fault-tolerant isolation mechanism at the system interaction architecture and underlying mathematical operation level. The system adopts asynchronous calls of the service layer of the long and short transaction separation processing model, and combines chat memory snapshots containing version timestamps to realize state rollback, avoiding the blocking of local database connection resources by long-time network requests. At the same time, a preset minimal positive real number smoothing term is introduced in the division operation unit for calculating similarity and route score, which constrains the lower limit boundary of the underlying numerical calculation, eliminates the calculation anomaly caused by the denominator being zero under extreme data input conditions, and improves the system's operational stability under high concurrency requests.

[0023] 3. This invention uses a joint evaluation model under multiple constraints to generate travel routes. Based on the comprehensive recommendation and weighting of candidate nodes, the algorithm introduces normalized spatial physical distance and travel time as cost penalty parameters in the route sequence evaluation stage, and performs joint optimization in combination with the richness scoring mechanism of location categories. This operation logic can actively eliminate invalid sequences with spatial backtracking or single node type in the algorithm space, so that the output travel route sequence can meet objective geographical and temporal constraints while taking into account user preferences, and has physical feasibility in actual travel. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of the system architecture of the present invention; Figure 2 This is a flowchart of the method of the present invention; Figure 3 This is a flowchart of the dialog generation process based on long and short transaction isolation and snapshot rollback of the present invention; Figure 4 This is a flowchart illustrating the tool invocation and long-term memory anti-re-deposition process of the present invention; Figure 5 This is a flowchart of the multi-constraint intelligent travel route generation and scoring process of the present invention; Figure 6 This is a logic diagram for map capability abstraction and degradation estimation in this invention; Figure 7 This is a diagram illustrating the hierarchical structure and persistence logic of travel plan data in this invention. Figure 8 This is the logic diagram for the multi-source context dynamic fusion and alignment of the present invention; Figure 9 This is a flowchart of the RAG process of the present invention. Detailed Implementation

[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] Please see the appendix Figure 1 This invention provides a multi-source context fusion-based cultural tourism dialogue and interaction system, comprising a mobile device, a backend server, a model service layer, a data storage layer, and an operation management platform. The mobile device receives user input and renders and displays the interaction results. The backend server handles core business logic and data flow. The model service layer performs natural language processing and text generation tasks. The data storage layer persistently stores business data and system logs. The operation management platform provides interfaces for setting and maintaining basic data.

[0027] The backend server contains multiple functional modules, including a user profiling module, a session management module, a context fusion module, a dialogue generation module, a memory management module, a tool invocation and auditing module, a knowledge graph module, a list management module, a route generation module, a map abstraction module, a recommendation reason generation module, and a data persistence module. These modules interact with each other via in-process calls or remote procedure call protocols.

[0028] Please see the appendix Figure 2 This invention provides a method for cultural tourism dialogue and route generation based on multi-source context fusion, comprising the following steps: S10: Receive a request message sent by a mobile device, parse the request message through the session management module to extract feature parameters, and perform intent recognition on the user input information to determine whether the current request type is a dialogue request or a route generation request. S20, when a dialogue request is determined, the dialogue generation module is triggered. The context fusion module extracts user profile features, historical interaction data and historical dialogue cache, and concatenates them with user input information to form prompt text, which is then sent to the model service layer for inference to obtain the response text. The tool call and audit module extracts the feature entities in the response text, converts them into structured data and writes them into the long-term memory. S30, when a route generation request is determined, the route generation module is triggered, the list management module and knowledge graph module are called to obtain node data, and the weighting operation is performed in combination with user profile features to generate a candidate node pool. The distance and time parameters are obtained through the map abstraction module, and the path search algorithm is executed in the candidate node pool to generate multiple candidate travel route sequences. S40, the recommendation reason generation module is called to extract the attribute features of the candidate travel route sequence to generate text descriptions. The interaction results or route sequence are written to the data storage layer through the data persistence module, and the response message is encapsulated and sent to the mobile device.

[0029] The user profiling module in the backend server is used to collect, extract, and structure user feature data. Based on the above processing, this module provides basic user preference parameters to support multi-source context fusion and multi-constraint route generation. In this embodiment, its specific processing flow is described as follows: The system receives user basic attributes and historical behavior data from mobile devices. User basic attributes include user identifier, persistent coordinate parameters, and demographic characteristic tags. Considering the system needs to construct a multi-dimensional preference system, the historical behavior data used as input parameters includes user interaction logs within the system, specifically covering historical browsing interest records, search keyword records, and historically completed travel plan data. For the asynchronous collection and data cleaning process of the front-end interaction logs, those skilled in the art can use conventional data collection and message queue techniques, which are well-known in the field and will not be elaborated upon here.

[0030] Based on historical behavioral data, multidimensional preference parameters of users are extracted to construct structured user profile feature vectors. Before the specific calculation steps, the system needs to perform noise reduction and semantic alignment processing on the unstructured text data. In this embodiment, the system uses a preset text analysis component to perform lexical analysis on the search keyword records, extracting entity words associated with the travel scenario as basic interest tags. The text analysis component has a built-in entity dictionary for the travel domain, and the system maps discrete search keywords to standardized point-of-interest category identifiers through string sequence matching. The system categorizes and summarizes the historical browsing point-of-interest records, extracts the category attributes of each target location, and counts the access frequency of different locations.

[0031] To quantify users' preferences for different travel elements and avoid biased judgments caused by extreme high-frequency visits, the system numerically transforms the extracted basic interest tags and visit frequencies according to preset feature dimensions to generate the user profile feature vector. In this embodiment, the user profile feature vector It is composed of multiple sub-feature vectors, specifically by concatenating and splicing the user's interest preference feature vector, travel style feature vector, and frequently used destination feature vector. The interest preference feature vector contains numerical preference weights for different location categories; the travel style feature vector contains quantitative indicators of trip time compactness and estimated spending range; and the frequently used destination feature vector records the identifiers of target cities frequently visited by the user.

[0032] The internal weights of the aforementioned feature vectors are not static but are periodically updated based on newly collected historical behavior data, incorporating a time decay factor. This time decay factor ranges from (0,1), and its specific value is inversely proportional to the time difference between the historical behavior data and the current statistical time. By introducing time decay logic, the system can calculate weight decay for distant historical interaction data, thereby more accurately reflecting users' recent travel preferences.

[0033] The constructed user profile feature vector The data is written to the data storage layer, and a feature reading interface is set up for internal modules to call. The system establishes user identifiers and user profile feature vectors in the underlying relational database. The system uses a mapping data table to persist feature data to disk. To reduce the latency of fetching pre-processed data when triggering subsequent dialogue model inference tasks, the system synchronously stores user profile feature vectors. The serialized data is stored in a distributed key-value pair in-memory database. Based on the aforementioned dual-write storage mechanism, when the context fusion module or route generation module receives a call instruction containing a user identifier, the system searches and matches the data in the distributed key-value pair in-memory database and returns the corresponding user profile feature vector to the caller. This is for use in subsequent data splicing or weighted scoring calculations.

[0034] The session management module within the backend server is responsible for parsing request messages, managing global state, and routing and distributing core tasks. In this embodiment, this module converts unstructured user requests into standardized data streams that can be processed by various components within the system. The specific processing flow is as follows: The system receives request messages from mobile devices and performs feature parsing operations on them. Based on a preset communication protocol, the system uses a protocol parsing engine to separate key identification parameters from the header and payload of the request message, specifically extracting the user identifier, session identifier, and device context features. To meet the input requirements of personalized location-aware services in subsequent route planning, the aforementioned device context features are defined as a structured dataset containing the mobile terminal's operating system type, application version parameters, and the latitude and longitude coordinates currently acquired by the terminal.

[0035] Before executing specific task routing, the system needs to resolve the ambiguity of natural language input. Based on the acquired user input information, the system executes an intent recognition algorithm to determine the specific business request type of the current interaction task. Considering that the generation of travel routes strongly depends on spatial and temporal preconditions, the current natural language text sequence input by the user is defined as... The system utilizes embedded natural language processing components to... Extract a set of feature entities that are strongly related to itinerary planning. This entity set includes spatial destination nodes, time constraint parameters, and preset planning action words.

[0036] To ensure the accuracy of entity extraction and the transparency of the network structure, in this embodiment, the natural language processing component adopts a sequence labeling and classification model based on a multi-layer Transformer architecture, and the natural language text sequence... The text is processed sequentially through word segmentation and word embedding layers, mapping the resulting vectors into a fixed-dimensional word vector matrix. This matrix is ​​then input into a multi-layer self-attention encoder for contextual feature extraction. The model's output passes through a fully connected layer and a Softmax activation function, outputting in parallel the entity category label for each word and the probability value that the overall text belongs to the route generation intent.

[0037] The model adopts a context-based prompt word engineering architecture. The system extracts preset intent classification task instructions and entity extraction constraint boundaries, and retrieves several typical manually annotated few-sample examples from the travel dialogue corpus. The system serializes and concatenates the task instructions, constraint boundaries and few-sample examples to construct a structured intent recognition prompt template. The input instructions guide the self-attention encoder to directly output the corresponding feature entities and probability distributions in a fine-tuning-free state.

[0038] The system is based on a set of feature entities. The characteristic state is used to determine the execution condition. The intent determination threshold is set to... ,in This is a positive integer greater than 0, and its specific value is obtained based on statistics from a daily travel dialogue test set, used to balance the sensitivity and accuracy of recognition. To avoid relying on a single dimension for biased judgment, the judgment logic is specifically as follows: if the number of elements in the extracted feature entity set is greater than or equal to the intent judgment threshold... If the extracted entity features contain explicit city or regional spatial parameters, the system will classify the current request as a travel route generation request. If the extracted entity features fail to meet the above multi-dimensional combination conditions, the system will classify it as a travel companion dialogue request.

[0039] Based on the determined business request type, the system routes and distributes tasks while simultaneously maintaining the global lifecycle of the dialogue context. The system allocates independent memory storage space for each continuously interacting session identifier in a distributed cache database and writes the arrival timestamp and request message body of the current request. When the request type is determined to be a travel companion dialogue request, the session management module generates a call command and triggers the backend dialogue generation module, while simultaneously activating the data loading mechanism that reads historical dialogue snapshots. When the request type is determined to be a travel route generation request, the system routes the request data and previously extracted device context features to the route generation module so that it can extract latitude and longitude coordinates as reference points for subsequent spatial distance estimation.

[0040] While request distribution is underway, a stateful cleanup daemon runs concurrently in the background. To prevent invalid sessions from consuming system memory resources for extended periods, this daemon periodically scans the arrival timestamps in the distributed cache database. To avoid blocking the system's input / output links due to a sudden surge in state data cleanup, the system employs a smooth cleanup mechanism with a buffer queue. For session identifiers whose time difference from the current system time exceeds a preset quiet period, the system moves them to the background buffer queue and triggers a cache reclamation mechanism, asynchronously deleting their corresponding temporary state data from the memory storage space. This ensures the stability of the entire system's operating state and the reliability of resource scheduling under high concurrency scenarios.

[0041] Please see the appendix Figure 8 The context fusion module within the backend server addresses the semantic fragmentation and lack of personalization issues caused by the lack of prior information in traditional natural language interaction. In this embodiment, this module aggregates and structurally reorganizes discretely distributed multi-source business data. The specific processing flow is as follows: Based on the currently received user natural language input sequence, the system concurrently calls the backend storage node to obtain multi-dimensional context parameters. To reduce the system input / output latency caused by the serial reading mechanism, the system uses an asynchronous thread pool to execute multiple data acquisition links simultaneously. The system sends a query command to the user profiling module to obtain user profile feature vectors containing user interests and travel styles. ; Initiate a read command to the memory management module to retrieve a structured long-term memory text set, which stores travel taboos and special constraints declared by the user in past interactions; Simultaneously retrieve a historical dialogue snapshot of the current session from the distributed cache database, which records multiple rounds of dialogue interaction data before the current moment in the form of a time-series table.

[0042] Before data fusion, the system performs filtering and semantic alignment on the acquired long-term memory text set. Considering the context length truncation limitation of large language models in a single inference, directly inputting the entire memory data would lead to wasted computing power and loss of focus on key information. In this embodiment, the system uses a text vectorization component to map the user's natural language input sequence to each record in the long-term memory text set into semantic embedding vectors. To ensure the accuracy of semantic feature conversion, the text vectorization component adopts a network architecture based on a multi-layer bidirectional Transformer encoder. The natural language input sequence is mapped to an initial tensor after being processed by a word embedding layer and position encoding, and then input into a multi-layer multi-head self-attention encoder for context feature interaction extraction. The system extracts the hidden state vector corresponding to the starting special identifier in the last layer of the encoder and linearly maps it to a fixed-dimensional semantic embedding vector through a fully connected network layer.

[0043] After obtaining the semantic embedding vector, the system sorts the long-term memory text set in descending order by calculating the cosine similarity between the current input vector and each memory record vector. To ensure the completeness of the calculation logic and avoid abnormal matrix division operations, the system checks the L2 norm of the vectors before performing the cosine similarity calculation. If the norm product in the denominator approaches zero, the system adds a preset minimal constant smoothing term to the denominator to prevent system-level errors caused by division by zero that could lead to process crashes. After completing the similarity calculation, the system extracts the head memory texts with similarity scores greater than a preset similarity threshold to form the target memory subset to be fused. The preset similarity threshold is set to the range (0,1), and its specific value is determined by the system through cross-validation and optimization based on the feature recall rate of historical offline test sets. This filtering logic aims to filter out redundant memory parameters that are irrelevant to the current intent.

[0044] The filtered and aligned multi-source data are concatenated and merged according to a preset structured template to generate prompt text for model inference. Based on the above preprocessing, the current input sequence at the current time is defined as... The filtered target memory subset is Historical dialogue snapshots are The system constructs a fusion context feature that includes global features. To ensure that the subsequent inference model can accurately distinguish the business weights and instruction boundaries of different data sources, the specific combination mechanism of this fusion context feature is as follows: based on preset label identifiers, the user profile feature vector is combined... Target memory subset Historical dialogue snapshots With the current input sequence Perform text sequence concatenation operations. In actual engineering implementation, the system uses system-level prompt word templates with role labels and scope qualifiers to transform the aforementioned independent variables into structured control instructions.

[0045] The system will use user profile feature vectors With the target memory subset Encapsulated within user attribute tags, serving as a long-term static constraint; historical conversation snapshots With the current input sequence Encapsulated within the current session tag, it serves as short-term dynamic semantics. Through multi-source context fusion operations, the system provides complete prior instruction inputs to the large language model service layer, thereby ensuring that the final generated interaction data has semantic continuity across rounds.

[0046] Please see the appendix Figure 3 The backend server's internal dialogue generation module is responsible for converting the fused context into natural language responses and ensuring the consistency of the underlying database state and system availability under high concurrency scenarios. In this embodiment, this module handles large model interactions by introducing external calls and a local transaction isolation mechanism. Its specific processing flow is as follows: Before initiating a remote model inference command, the system obtains the historical dialogue state of the current session and serializes it into a distributed cache database, generating an independent chat memory snapshot. To ensure strict alignment of time and working conditions in scenarios with multiple concurrent requests, the system binds the current session identifier and a globally incrementing version timestamp when generating the snapshot. This prevents state overwriting during out-of-order network callbacks, as the inference process of large language models has high network transmission latency and computation time. If the system's global state is directly changed during a request, irreversible damage to the cached context data will occur if the external network call is interrupted or packets are lost. Based on the above considerations, the system locks the set of historical dialogue states at the current moment in memory space, using this as the baseline data point for subsequent state recovery.

[0047] The system sends the fusion context features generated by the front-end module to the model service layer, triggering a remote inference call task. To avoid long-running external network operations causing internal database connection pool blocking, the system employs a long-short transaction separation mechanism to handle this call chain. The system defines the remote inference process of the model service layer as an independent asynchronous long transaction. At the technical implementation level, the system sends external requests based on an asynchronous non-blocking network communication framework. During the lifecycle of this transaction awaiting execution results, the system's main thread does not open or request any write locks or connection resources for relational databases, thereby achieving physical-level isolation between external model calls and local database read / write operations.

[0048] The system executes branch processing logic based on the network status code and response data returned by the model service layer, achieving atomic commit or safe rollback of the status. To avoid dirty data being written to the database due to relying on a single network status code, the system performs multi-dimensional verification on the model's returned results. When a remote inference call returns a successful network status code, and the system verifies that the response text sequence is not empty and conforms to the preset natural language parsing format, the system initiates a short write transaction to the local database. This writes the user's original input, the generated response text, and the call's log as an atomic operation to the data storage layer, and simultaneously updates the latest status in the distributed cache database. Based on this short transaction mechanism, the system compresses the database transaction time to the millisecond level, avoiding system-level resource deadlocks caused by slow responses from large models.

[0049] Conversely, when a remote call triggers a timeout threshold or the aforementioned multi-dimensional checks fail, the system suspends the current short transaction write link and activates a snapshot-based failure rollback mechanism. The aforementioned timeout threshold is typically set as a positive integer between 10 and 30 seconds, with its specific value dynamically set by the system based on historical average latency data from external network services. This design aims to balance user waiting experience with overall system throughput. During the rollback operation, the following is defined: This is a snapshot of the chat history saved before it was accessed. The system generates a sequence of response texts. The system updates the latest dialogue cache set for the current session based on the execution status. Its state update function expression is: ; In the formula, the status identifier Used to indicate the final execution result and internal format verification result of remote inference transactions; This indicates an append / merge operation on the data set. If the above state update function fails, the system directly utilizes the stored chat memory snapshot. Overwrite any currently corrupted or interrupted session cache. This error-prevention logic ensures that failed rounds or duplicate requests caused by network retries do not result in invalid text entering the dialogue context, thus guaranteeing the purity of cross-round travel interaction semantics and the consistency of state.

[0050] The memory management module within the backend server is used to build and maintain a structured knowledge base for travel scenarios. In this embodiment, this module transforms the personalized attributes expressed by users in fragmented conversations into persistently stored digital assets, thereby working with the dialogue generation engine to solve the cognitive loss problem caused by the ephemeral nature of chat logs in traditional natural language interaction. Its specific processing flow is as follows: A structured long-term memory data model is defined, and a corresponding knowledge base set is initialized at the data storage layer. Considering the diverse types and varying lengths of information expressed by users in travel conversations, the system uses a non-relational database supporting nested document structures as the underlying storage medium. The system establishes a standardized field template for each memory record, specifically including a user identifier, a unique memory identifier, a memory category classification code, and detailed memory text. The aforementioned memory category classification codes are enumerated and defined as a fixed set containing travel preferences, dietary restrictions, planned itineraries, companion relationships, and important facts to ensure the standardization and consistency of business data dimensions during subsequent external calls.

[0051] The system receives unstructured memory entities extracted from upstream components and performs semantic mapping and vectorization preprocessing operations on them. When the model service layer captures the user's personalized expression during dialogue interaction and triggers the tool's write command, the memory management module obtains the feature entities to be backfilled. To support the semantic similarity comparison requirements of the subsequent context fusion stage, the system calls the text vectorization component to extract features and reduce the dimensionality of the memory detail text. To clarify the internal data processing chain of this component, in this embodiment, the text vectorization component adopts a deep neural network based on a multi-layer bidirectional Transformer architecture.

[0052] After lexical segmentation, the memory details text is mapped into sequence-based word embedding vectors, which are then injected into the network's multi-head self-attention layer. The network removes redundant sequence padding interference by extracting the contextual hidden states of the bidirectional text sequence and performing global average pooling on the output of the last layer. The system maps the processed dimensionality reduction result into fixed-dimensional floating-point memory feature vectors and uses them as extended features to supplement the original memory records.

[0053] The system performs persistent storage of memory data and calculates the validity score of each memory record based on timeliness status parameters. Considering that users' travel preferences may dynamically evolve or self-correct at different stages, the system manages the lifecycle of persistently stored memory entries by attaching a creation timestamp to each newly entered memory record and using system computing power to calculate its memory validity score at the current retrieval time. The specific calculation logic for this validity score is as follows: The confidence probability parameter output by the upstream large language model (its value range is within the interval (0,1]) is extracted and multiplied by a time decay term. This time decay term is obtained by calculating the negative exponent of the natural constant, with the exponent being the product of a preset memory decay coefficient and the time difference. The aforementioned time difference is obtained by subtracting the current absolute timestamp from the absolute timestamp at the time of initial creation of the memory record. The aforementioned memory decay coefficient is a very small positive real number, set by the system developers based on the user preference change cycle in the business, aiming to control the rate at which the passage of time mathematically weakens the confidence of historical memories.

[0054] By introducing the aforementioned continuous scoring mechanism based on time decay logic, the system can naturally distinguish between a user's recent core needs and long-term historical preferences at the underlying database level. To avoid biased judgments caused by relying on a single time variable, the system incorporates multi-dimensional logic in the status determination stage. Only when the memory validity score decreases over time to below the system's set retention limit, and the memory category code to which the memory belongs does not belong to a baseline label that needs to be permanently saved (such as special medical contraindications), will the memory record be silently marked as archived in the background and will no longer be scheduled to participate in regular context data assembly.

[0055] The system exposes multi-dimensional memory query and update application interfaces to various business units within the system. After preprocessing and persisting the source data to disk, the system sets up service routing nodes for cross-module calls. The system provides a primary key-based precise query interface based on user identifiers, supporting the context fusion module or route generation module to obtain the full structured feature dataset of active users. Simultaneously, the system provides an approximate nearest neighbor retrieval interface based on floating-point memory feature vectors to support semantic generalization retrieval services in high-concurrency scenarios. Through the above interface isolation and data encapsulation, the system can dynamically update the time parameters and text entities of existing memory records, thereby constructing a continuously evolving underlying cognitive architecture.

[0056] Please see the appendix Figure 4 The backend server's internal tool call and auditing module is used to establish a secure and controllable connection between the model service layer's inference process and the underlying business database. In this embodiment, this module intercepts and parses external tool commands generated by the model, and transforms unstructured dialogue content into traceable long-term memory assets through anti-duplicate and anti-tampering mechanisms. The specific processing flow is as follows: The system captures pre-formatted call messages output by the large language model during the dialogue inference phase and extracts their execution parameters. During the streaming transmission of the model's generated response text, the system's pre-defined listening component matches the tool trigger identifier in the message in real time. Before the actual data extraction, the system deserializes the data stream based on a pre-defined data exchange protocol, constraining the call messages output by the large language model into a standard key-value pair data structure. The system's built-in syntax parsing component locates the pre-defined function call keywords and corresponding argument nodes within the message through abstract syntax tree traversal or regular expression matching. After successful extraction, the system encapsulates the discrete data items into structured parameter payloads, from which it obtains the sequence of memory entity data to be stored and the accompanying context parameters. The aforementioned context parameters are limited to a core feature group containing model call identifiers, session identifiers, user identifiers, and device identifiers, thereby ensuring that each business trigger can accurately anchor to the specific system operating conditions and end users.

[0057] Based on the extracted parameter payload, a globally unique tool call fingerprint is generated to support subsequent concurrent deduplication verification. Considering that network jitter may cause repeated front-end submissions or model inference timeout retries, potentially triggering multiple identical tool commands, directly executing database writes would waste storage resources and pollute the knowledge base graph. To mitigate these risks, before calculating the fingerprint, the system uses hashing to perform information digest calculations on variable-length feature data. In this embodiment, the specific generation logic of the tool call fingerprint is as follows: Based on a preset separator, the model call identifier of this model interaction task, the current session identifier, the user identifier, and the sequence of memory entity data to be stored are concatenated. Then, a preset hash mapping function is constructed using a cryptographically secure hash algorithm with clear anti-tampering characteristics (e.g., SHA-256 algorithm). The concatenated result is input into this hash mapping function to obtain the tool call fingerprint. By forcibly introducing the model call identifier into the hash operation, the system achieves strict time alignment between the underlying fingerprint and specific network request conditions.

[0058] The system utilizes the generated tool call fingerprint to perform conflict comparison and atomic deduplication operations at the background data storage layer. Before initiating the actual write transaction to the long-term memory database, the system uses this tool call fingerprint to query the distributed audit log cache pool. To avoid the extremely low probability of hash collision errors that might occur if only a single hash value is used for judgment, the system combines fingerprint matching and timestamp deviation to perform a multi-dimensional combined judgment. The system determines that the current tool call instruction is legal and valid only if there is no physical record in the cache pool that matches the tool call fingerprint, or if there is a matching record but the absolute difference between their trigger times exceeds the system's preset security blocking window threshold. The aforementioned security blocking window threshold is set to a positive integer between 500 milliseconds and 2000 milliseconds, and its specific value is determined based on the network timeout retransmission time constant set by the front-end client or gateway. This threshold judgment mechanism is mainly used to intercept abnormally high-frequency retransmission instructions within a short period of time at the underlying system interface side. For instructions that are determined to be legal, the system triggers the underlying application interface to complete the write of the structured memory entity to the database.

[0059] After the business logic is written, the system extracts the complete execution context and persists it to a read-only audit log repository. To meet the traceability requirements of subsequent backend operations management, the system encapsulates tool call fingerprints, original input parameter payloads, target backfill memory identifiers, interface execution time, and network status codes into standard log entries. The system uses an asynchronous message queue link to persist these standard log entries to disk, thereby transforming the invisible model inference operations at the application layer into a structured and reversible record of the execution trajectory at the data link layer.

[0060] The location knowledge graph module within the backend server is used to build a structured underlying static data support system. In this embodiment, this module abstracts discrete points of interest in the real physical world into standard digital nodes and establishes a reusable basic data layer across business modules. Its specific processing flow is as follows: The system defines a feature structure for graph nodes with points of interest (POIs) as the core data units. To meet the multiple spatial and attribute constraints of the route generation stage, the system sets a basic data model containing multi-dimensional features for each graph node. This data model encapsulates location name, city identifier, sub-region identifier, geographic latitude and longitude coordinates, location category labels reflecting business attributes, descriptive text, multimedia resource path set, system release status enumeration value, and sorting settings weights for front-end intervention. The system avoids excessive restrictions on the scalability of data fields by using fixed-length mathematical tuple formulas, allowing the underlying graph to flexibly accommodate various business feature parameters added in subsequent iterations.

[0061] Before providing data services to external modules, the system needs to address the issues of physical benchmark consistency and dirty data interception for multi-source spatial data. For extracted geographic latitude and longitude coordinate parameters, the system performs coordinate system verification and spatial transformation logic on the data entry side. The system uniformly maps and transforms non-standard coordinates obtained from different external mapping data sources into coordinates of a specific standard spatial projection system. The physical purpose of this alignment logic is to ensure that the input coordinate parameters of the subsequent multi-constraint route generation module have a unified geometric reference benchmark when calling the map abstraction layer to estimate the spatial distance between nodes. For system-published state enumeration values, the system embeds state machine interception logic at the underlying data reading link. The system verifies the state machine flag of the target node to ensure that the underlying data query interface only exposes active map nodes to the business layer, thereby cutting off invalid readings and redundant calculations of offline and obsolete data from the data source.

[0062] The system sets up a unified data aggregation service interface for each business flow, enabling cross-business layer reuse of static knowledge graph data. Based on the centralized storage architecture described above, when the system receives a request from the front end to browse location details or add a target node to the wish list, the routing layer directly locates and reads the corresponding node data object in the knowledge graph. When the route generation engine needs to build a candidate location pool, the system retrieves a batch of legal knowledge graph nodes belonging to the target city through spatial range constraint retrieval. At the backend operation and management level, the update write command for the node publication status by the operation personnel directly acts on this basic data layer and is synchronized to the global cache in real time. In addition, the aligned geographic latitude and longitude coordinate parameters in the target node are persistently locked, specifically used to support the location verification and judgment of subsequent offline check-in behavior or to provide a reference anchor point for spatial awareness capabilities. With this underlying shared and reused design, the system completely eliminates the data version conflict and read / write consistency risks caused by multiple business modules repeatedly maintaining the same physical location information from the physical storage level.

[0063] The backend server's internal list management module manages the set of locations where users have expressed a clear travel intention. In this embodiment, this module establishes a mapping relationship between user identity entities and underlying knowledge graph nodes, providing key weighted input indicators for the subsequent generation of personalized travel routes. Its specific processing flow is as follows: The system receives and records user interest expression behavior data for specific map nodes, constructing an initial intention data stream. Considering the differences in user behavior when using travel software, in this embodiment, the input source for interest expression behavior data is designed as a dual-link collection mechanism including explicit and implicit methods. One link is the user's active triggering of the "show favorites" or "add to list" operation command when browsing the basic location details page on a mobile device. The other link is the data interface request asynchronously passed through the tool invocation mechanism, based on implicit desired destination feature entities identified by the dialogue generation module during user interaction via natural language processing. Based on this dual-link data collection mechanism, the system can capture high-intent target nodes of users without omission during static browsing and dynamic companion dialogue.

[0064] The system extracts the target location identifier parameter from the intention data stream and performs data consistency verification and persistence on disk in conjunction with the underlying knowledge graph. Before solidifying the user's subjective selection into system business data, the system must prevent the introduction of illegal dirty data due to location offline or natural language recognition deviations. The system extracts the target location identifier from the input command and queries the knowledge graph across modules to verify that the location identifier exists and that its corresponding publication status enumeration value is in a normal active state. After the underlying consistency verification is passed, the system creates a record in the relational data table, establishing a primary-foreign key mapping association between the current user identifier and the valid target location identifier, thereby constructing a set of nodes for the user's desired destination list. To avoid database duplicate key value errors caused by multiple links of the same user across time periods, the system establishes a composite unique index for the combination of user identifier and target location identifier at the database table structure level. The system performs an atomic insertion operation with anti-conflict characteristics. If it detects that the record corresponding to the composite primary key already exists in the current data table, the system immediately terminates the insertion process of the current single record and returns a success status code, thereby ensuring the idempotency of data set operations and the stability of system operation.

[0065] A data retrieval interface is set up for the route generation engine, and standardized feature matching indicator parameters are output. When the multi-constraint route generation module starts the candidate pool construction task, the list management module outputs the full set of desired destination nodes for the corresponding user to the calling end in batches according to the input user identifier parameter. To support the subsequent mathematical weighting calculation of node importance at the underlying level of the route planning algorithm, the system sets and outputs a discrete hit indicator parameter while outputting the original set. Since the subsequent weighting calculation relies on continuous numerical matrix multiplication operations, the introduction of this feature indicator parameter can map the unstructured set belonging determination to a scalar factor in pure mathematical space to maintain the alignment of the calculation dimensions.

[0066] Define the candidate graph nodes currently participating in route evaluation as The target user's desired list of nodes is The system selects candidate map nodes. The execution set contains matching logic to construct hit indicator functions. When the candidate map node Belongs to the list of nodes to be visited When the indicator function is hit. A value of 1 indicates a hit; conversely, a value of 0 indicates a miss if the user does not belong to the set. By exposing the structured indicator functions and set data results, the list management module transforms the user's fragmented subjective travel intentions into objective binary indicator features that can be directly read and calculated in the subsequent multi-objective route scoring algorithm.

[0067] Please see the appendix Figure 5The route generation module within the backend server is the core engine for the system's intelligent travel planning. In this embodiment, this module integrates the user's subjective travel preferences with objective spatiotemporal physical constraints, generating the optimal travel sequence through a multi-constraint solving algorithm. Its specific processing flow is as follows: The system receives route planning tasks from upstream modules and extracts structured multidimensional input parameters. When intent recognition confirms the current request is a route generation operation, the system parses the request payload, extracting the target city identifier, expected travel time parameters, and the user's preferred mode of transportation. To narrow the search space for the algorithm within the global database, the system initiates a region filtering request to the knowledge graph module. Based on the input target city identifier, the underlying database performs a pruning operation in the spatial index, extracting active interest point data belonging to that city separately to construct an initial candidate node pool for the target city. Simultaneously, to ensure sufficient input conditions for subsequent weighted calculations, the system concurrently calls the user profiling module to obtain user profile feature vectors. The list management module is invoked to retrieve the full set of desired list nodes for the corresponding user.

[0068] The system performs a fusion feature weighting operation on each graph node in the initial candidate node pool. Considering that a single popularity metric cannot accurately represent a user's true intention to visit a specific location, the system uses multi-dimensional weighted logic to score each candidate graph node independently. During the specific calculation, the system assigns a weighted score to each candidate graph node. The system calculates its comprehensive recommendation weight. The specific calculation expression for this weight is: ; In the formula, Represents user profile feature vector With candidate map nodes Location category tags The matching degree function in the feature space is quantized internally by calculating the vector inner product of the two. Indicates the hit indicator function; Represents the latitude and longitude coordinates of the node Distance from the city's core coordinates Spatial distribution decay function; , , These represent the preset matching degree weight coefficient, list hit weight coefficient, and spatial distribution weight coefficient, respectively.

[0069] To ensure a reasonable allocation of computational dimensions, the values ​​of the aforementioned weight coefficients are all constrained to the interval (0,1), and satisfy the following conditions: The mathematical constraints are established. The aforementioned coefficient values ​​were determined through iterative optimization in an offline environment using a grid search method based on the conversion rate data of historical planning schemes. By introducing this weighting model, the system mathematically quantifies user profiles, explicit intentions, and the objective spatial layout of the city, enabling locations with high matching degrees and those saved by users to have a higher probability of being selected in subsequent path searches.

[0070] The system employs a constraint-based pathfinding algorithm to generate a sequence of candidate travel routes consisting of multiple nodes. Based on the user's desired travel duration, the system calculates a reasonable upper limit for the total number of stops for the current trip. Subsequently, the system calls the underlying map abstraction module to batch obtain the spatial distance matrix and traffic time matrix between high-weight candidate nodes. For the combinatorial optimization problem in the path planning stage, the system sets up a standard heuristic search algorithm model. Based on the base of the obtained distance matrix, the algorithm engine performs topological sequence optimization in the candidate node pool within a limited time window. After multiple iterations, the system outputs several connected paths. Initial candidate travel route sequence for each station .

[0071] The generated initial candidate travel route sequences are subjected to multi-objective joint scoring and evaluation filtering. To provide users with differentiated and physically feasible planning results, the system constructs a comprehensive evaluation objective function that encompasses both benefit compensation and cost penalties. Before accumulating the objective function, to avoid the weighting factors becoming ineffective due to the significant difference in absolute numerical dimensions between spatial physical distance and travel time, the system performs max-min normalization preprocessing on the original parameters. The system extracts the maximum and minimum extreme values ​​of each sequence in terms of distance and travel time, linearly mapping them to a unified dimensionless interval. For normalized division operations, the system adds a very small non-zero constant to the denominator to handle the singular case where all sequence extreme values ​​are equivalent to zero. Based on the aligned dimensionless parameters, the specific calculation expression of the objective function is as follows: ; In the formula, Represents all contained in the sequence The sum of the overall recommendation weights of each site is used as a positive benefit item to satisfy user preferences; Represents the normalized spatial physical distance between two adjacent stations in the sequence; This represents the normalized estimated traffic time between two adjacent stations based on the user-specified mode of transportation. This represents the richness score parameter for the location categories within the route; to All are adjustment parameters greater than zero. These are the richness score parameters for this location category. The system extracts the set of location category labels corresponding to all nodes in the current sequence, performs a deduplication and counting operation on it, and then divides it by the maximum number of total stations. The structured rating coefficients, which are between 0 and 1, are obtained.

[0072] The objective function incorporates negative penalty terms for distance and time consumption to filter out invalid itinerary sequences involving spatial backtracking. A richness score helps prevent user fatigue caused by a single day's itinerary consisting entirely of homogeneous locations. The system calculates a comprehensive evaluation score for all initial candidate travel route sequences, sorts them in descending order of score, and selects the top few optimal route sequences as the final output. This ensures that each route presented to the user balances personalized interests and practical accessibility in terms of transportation time and space.

[0073] Please see the appendix Figure 6 The map abstraction module internally configured in the backend server is used to isolate the core business logic from external basic geographic data services. In this embodiment, this module encapsulates the differences in the application programming interfaces (APIs) of the underlying map surveying platform, exposing a unified spatial computation and time estimation service to the outside world, thereby improving the system's scalability when facing changes in external service dependencies. Its specific processing flow is as follows: Based on the principle of interface isolation, the system establishes an interface adapter layer independent of specific third-party service providers. In actual engineering deployments, different external map service providers often differ in their latitude and longitude offset standards and interface parameter formats. To avoid low-level code-level dependencies from the upstream route generation engine, the system defines a system-level standard spatial parameter protocol. The system uniformly maps the target city characters, origin coordinates, and destination coordinates passed in from the business end into a standard parameter carrier recognized internally by the abstract layer. Subsequently, the system uses the adapter pattern to distribute the above standard parameter carriers to the corresponding real third-party map network request components.

[0074] The system receives batch node coordinate groups from the route generation module and performs spatial physical distance and travel time calculations with a multi-level caching mechanism. When processing multi-node path planning, the algorithm engine needs to obtain the full distance matrix between nodes. Considering that high-frequency external network requests can easily trigger concurrency limits imposed by third-party service providers and increase system latency, the system internally sets up a spatial metadata cache pool based on a key-value pair structure. Before performing cache addressing, the system extracts the starting point coordinate identifier, the ending point coordinate identifier, and the mode of transportation feature parameters, serializes and concatenates them to construct a joint query key. The technical logic of including the mode of transportation in the joint query key is to avoid read / write errors in cached data caused by differences in travel time between different modes of transportation. When the corresponding distance and travel time metadata exists in the cache pool, the system directly reads the data from memory and returns it; when the cache misses, the system packages the missing coordinate groups into batch asynchronous requests and sends them to the external map service platform, and synchronously writes them back to the cache pool after obtaining the actual return results.

[0075] For situations involving external network anomalies or interface rate throttling, the system executes localized spatial geometric estimation and offline time consumption calculation logic. When a third-party map service experiences timeouts or response failures, the system triggers a local degradation calculation component to prevent the route planning task chain from being interrupted. Before specific calculation steps, the system performs parameter derivation based on fundamental physical kinematics principles. Based on the input latitude and longitude coordinates of the nodes, the system calculates the great circle spherical distance between two points using the spherical cosine theorem. For offline traffic consumption, the system introduces an empirical estimation model with compensation constraints.

[0076] The specific calculation logic is as follows: The distance of the great sphere is used as the numerator, and the product of the prior reference speed parameter for the user-selected traffic mode and the traffic congestion adjustment coefficient extracted based on the current time period is used as the basic denominator. To handle unusual conditions, a very small non-zero positive real number smoothing term is forcibly added to this basic denominator to form the final denominator. The system adds the above division result to the fixed action penalty time under the corresponding traffic mode to obtain the estimated traffic time. The traffic congestion adjustment coefficient is between 0.1 and 1.0. A non-zero positive real number smoothing term is forcibly added (its value range is precisely set to 10). -5 Up to 10 -3 The purpose of introducing (between) is to set an absolute lower limit for floating-point operations in the denominator, ensuring the system-level computational stability of the degradation processing link when the parameters approach zero in extreme congestion.

[0077] The system extracts global spatial parameters for the route to generate structured route-level map metadata. After acquiring various indicators between individual points, the system iterates through all coordinate parameters in the current candidate travel route sequence. The system calculates the geographic bounding box covering the entire route, which is constructed by extracting the maximum and minimum longitude, maximum and minimum latitude from the coordinate set to form a rectangular spatial projection boundary. Subsequently, the system encapsulates the aggregated total mileage, estimated total travel time, city center coordinates, and geographic bounding box into a standard-format map metadata object. This metadata object flows with the route plan, providing directly usable underlying location reference parameters for rendering the route trajectory view on front-end mobile devices and performing automatic screen zoom.

[0078] The recommendation reason generation module internally configured on the backend server is used to transform the route planning results understood by the machine into natural language text that is easy for users to understand. In this embodiment, this module overcomes the rigid expression defects caused by static template splicing in traditional systems. By introducing a deep learning language model, it provides users with explanatory and supportive decision-making assistance. Its specific processing flow is as follows: The system receives candidate travel route sequences from the multi-constraint route generation module and extracts source-end attribute parameters to support text generation. To enable the underlying algorithm to accurately perceive the physical form and business logic of the routes, the system extracts discrete structured features from individual candidate routes to construct route feature tuples. These tuples encapsulate the route title, route style parameters reflecting the route's rhythm, the total number of stations included in the route, the specific set of map station names, the number of hits on the "want to go" list calculated by the preceding components, the display sequence number of the candidate route in the current batch, and a global user profile feature vector. In this embodiment, the technical purpose of feature aggregation of the aforementioned heterogeneous data is to provide complete contextual conditions, including physical constraints and personalized constraints, for the subsequent generation model, ensuring that the generated explanatory text has a real basis in the physical attributes of the route, and avoiding the illusion of fabricated locations caused by the lack of feature information.

[0079] The extracted discrete feature tuples undergo data flattening and serialization preprocessing. Before forward inference, the system needs to address the format alignment issue between discrete numerical indicators and text data in the feature dimension. Using a pre-defined prompt word parser, the system assembles the multidimensional independent parameters in the aforementioned route feature tuples into a continuous natural language prefix sequence according to a pre-defined key-value pair template. The system then uses a word segmentation component to perform word segmentation on this prefix sequence, mapping it to discrete word indices, and transforming it into a continuous high-dimensional dense vector matrix through the underlying word embedding layer. For the word segmentation and dimensional transformation operations involved in converting text to a floating-point matrix, those skilled in the art can implement this using standard byte-pair encoding mechanisms, which are well-known techniques in the field and will not be elaborated upon here.

[0080] Please see the appendix Figure 9 To ensure the model possesses explanatory and expressive capabilities within the tourism vertical domain, the system introduces a retrieval-enhanced generation mechanism to replace underlying weight fine-tuning. The system pre-maps collected historical high-quality travel guides and route reviews into document feature vectors using a text embedding model, constructing a vertical domain knowledge vector library. During the online inference phase, the system uses the externally input route structured feature tuple sequence as the query basis, performing an approximate nearest neighbor search within the vertical domain knowledge vector library to recall the semantically closest historical reviews as external enhanced context. The system utilizes a pre-defined instruction combination component to concatenate the recalled external enhanced context with the original route feature tuple sequence, forming enhanced prompts containing background knowledge. The system inputs the mapped high-dimensional dense vector matrix containing the enhanced prompts into the generative language model, outputting explanatory text through an autoregressive decoding strategy. In this embodiment, the generative language model employs a decoder architecture based on a multi-layer masked multi-head self-attention network stack. Inside the network, the masked attention mechanism is used to mask the feature sequence after the current computation position, forcing the model to extract the hidden state using only known prior context information, thus strictly following the left-to-right generation logic of human natural language.

[0081] To avoid getting stuck in local optima during a single search, which could lead to a large number of repetitive short sentences in the final text, the system employs a cluster search decoding strategy to output a set of candidate texts. During sequence scoring and evaluation, the system constructs a multi-dimensional joint scoring logic incorporating a length penalty mechanism. The system performs a logarithmic summation on the word generation conditional probabilities output by the classifier at the end of the model network. To counteract the abnormal preference of the model for extremely short and meaningless sentences caused by the multiplicative nature of conditional probabilities, the system uses an exponential term containing the total length parameter of the current sequence to perform a division-decay multiplication operation on the aforementioned accumulated probabilities.

[0082] Considering that the total sequence length parameter might become zero at the initial stage of the model, directly entering the division operation would trigger a hardware-level division-to-zero overflow crash. Based on this underlying error prevention consideration, the system forcibly appends a very small positive real number smoothing term to the denominator of the length multiplication operation. The range of this smoothing term is set by the system to 10. -5 Up to 10 -3 Within the mathematical range, its physical purpose is to provide an absolutely safe floating-point lower bound for division operations, ensuring the computational stability of the underlying optimization decoding link under high concurrency calls.

[0083] The system extracts the final sequence based on the optimal decoding score and performs structured persistence and data delivery. Using the multi-dimensional penalty scoring mechanism, the system extracts the highest-scoring natural language sequence as the final recommendation text. This recommendation text clearly explains the subjective and objective reasoning behind the specific style combination of the current route option. After completing the above calculations, the system establishes a mapping relationship between this text data and the underlying structured route entities and events, and submits it to the data persistence module for storage. Finally, the assembled full route data package is delivered to the mobile device, providing intuitive decision-making guidance for users' trip planning and route selection.

[0084] Please see the appendix Figure 7 The backend server's internal travel plan and route persistence module transforms the algorithm results output from memory-level computations into persistently stored structured data. In this embodiment, this module establishes a low-level mapping between business data, providing a foundational data base for long-term interaction on mobile devices and for tracing the system's backend. Its specific processing flow is as follows: The system receives the joint memory object from the multi-constraint route generation module and the recommendation reason generation module, and performs relational entity decomposition operations on it. Since the route plan output by the upstream algorithm engine contains heterogeneous features such as geographic coordinates, recommendation text, and travel time, directly storing it in a wide table using large text fields would hinder subsequent multi-dimensional data queries and local node modifications. Based on the above storage specifications, the system, following domain-driven design principles, decomposes the joint memory object into four standard hierarchical business entities: travel plan, candidate travel routes, route stations, and route events.

[0085] The system uses the travel plan entity as the root node, responsible for carrying global constraint parameters such as user identifier, target city, and expected travel duration. A travel plan entity maps to multiple candidate travel route entities in a one-to-many relationship. Each candidate travel route entity stores map metadata, route style enumeration values, and recommendation reason text for the corresponding route. To support the user's final decision-making process among multiple candidate options at the underlying data structure level, each candidate travel route entity is additionally equipped with a scheme adoption status flag (initially defaulting to not adopted). A single candidate travel route entity continues to map to route station entities and route event entities arranged in chronological order in a one-to-many relationship. Through this hierarchical tree structure, the system establishes primary and foreign key dependency constraints in the relational database table structure, eliminating storage redundancy in complex route data.

[0086] The system initiates underlying atomic transactions in the database and executes cascading write operations with tamper-proof verification. When synchronizing the above four levels of business entities to the physical disk, any partial table write failures due to network interruptions will lead to dirty data and foreign key conflicts. The system initiates independent data write transactions through a database connection pool. Before executing cascading insert operations, to ensure the integrity of the underlying data structure, the system performs tamper-proof locking on route features based on cryptographic message digest principles. The system extracts the core identifier sequence and the total number of subordinate stations for the current specific candidate route, performs standard secure hash operations to generate a unique integrity verification character, and inserts it as an independent field along with the entity record into the database.

[0087] During the physical data writing process described above, the system adheres to the all-or-nothing principle of the underlying database transactions. The system sends a transaction commit confirmation instruction to the connection pool only if the travel plan, all candidate travel routes including the adoption status bit, and their associated stations and events are conflict-free in the underlying storage medium and the insertion is successful. If any entity level reports an insertion exception, the system immediately triggers a global state rollback, discarding all dirty data caches within the current operation batch, thereby ensuring the absolute consistency of the underlying relational mapping links.

[0088] The system extracts the primary key parameters, encapsulates the response message, and sets the corresponding data update interface for the front-end interactive state machine. After confirming that all entity records at all levels have been successfully written to the underlying disk, the system releases the table-level write lock resources. The system extracts the travel plan primary key corresponding to the root node and the business identifier parameters of each subordinate candidate travel route, combines and encapsulates them with the map metadata required for front-end rendering, and sends them to the mobile device via the network communication link.

[0089] Based on the aforementioned structured persistence mechanism, the mobile device presents multiple route options after receiving a response. When a user triggers a route selection action, the front-end re-initiates a network request carrying the primary key of the travel plan and the identifier of the selected candidate travel route. At this time, the system back-end receives the request and executes state machine reversal logic in the underlying data table, updating the adoption status flag of the target candidate travel route entity to the adopted status, and simultaneously releasing or archiving the remaining unadopted routes under the same plan. Through this closed-loop interaction link, the system supports lossless reloading of historical plans and dynamic selection and modification of travel nodes, while providing the back-end operation management platform with structured audit samples for global backtracking analysis.

Claims

1. A multi-source context fusion cultural tourism dialogue and interaction system, characterized in that, include: The session management module is used to parse request messages to extract feature parameters and user input information, perform intent recognition based on the user input information, and determine whether the request type is a dialogue request or a route generation request. The dialogue generation module is used to extract user profile feature vectors, historical interaction data and historical dialogue cache when a dialogue request is determined, and concatenate them with the user input information to form prompt text, which is then sent to the model service layer to obtain the response text. The feature entities in the response text are converted into structured data and written into the long-term memory. The route generation module is used to obtain node data and user profile feature vector when a route generation request is determined, perform weighting operations on the user profile feature vector to generate a candidate node pool, obtain distance and time parameters, and execute a path search algorithm in the candidate node pool to generate multiple candidate travel route sequences. The recommendation reason generation module and the data persistence module are used to extract the attribute features of the candidate travel route sequence to generate text descriptions, write the reply text or the candidate travel route sequence into the data storage layer, and encapsulate and send the message.

2. The multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The multi-source context fusion cultural tourism dialogue and interaction system also includes: The user profile module is used to receive historical behavior data from mobile devices, extract basic interest tags and access frequency from the historical behavior data, convert them into numerical values ​​according to preset feature dimensions, generate interest preference feature vectors, travel style feature vectors and frequently used destination feature vectors, and concatenate the interest preference feature vectors, travel style feature vectors and frequently used destination feature vectors to generate the user profile feature vector. Extract the time difference between the newly collected historical behavior data and the current statistical time to calculate the time decay factor; The user profile feature vector is periodically updated in conjunction with the time decay factor.

3. The multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The session management module performs intent recognition on the user input information, specifically for: The system calls a preset natural language processing component to parse the natural language text sequence corresponding to the user input information, outputs the entity category label and the probability value of the overall text belonging to the route generation intent, and extracts the feature entity set. When the number of elements in the feature entity set is greater than or equal to a preset positive integer intent determination threshold and the feature entity set contains explicit city or regional spatial parameters, the current request type is determined to be a route generation request.

4. The multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The multi-source context fusion cultural tourism dialogue and interaction system also includes: The context fusion module, used in conjunction with the dialogue generation module, extracts the historical interaction data, specifically for: Using a preset text vectorization component, the natural language text sequence corresponding to the user input information and the long-term memory text records that serve as the historical interaction data are mapped into semantic embedding vectors. The semantic embedding vectors include the current input vector and the vectors of each memory record. Calculate the cosine similarity between the current input vector and each memory record vector; Before performing cosine similarity calculation, the L2 norm of the current input vector and each memory record vector is detected, and a preset minimal constant smoothing term is added to the denominator to prevent system-level errors caused by a denominator of zero from causing process crashes. The header memory text with a similarity score greater than a preset similarity threshold is extracted to form the target memory subset to be fused; The preset similarity threshold is a value between 0 and 1.

5. A multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The dialogue generation module obtains the response text, specifically for: Before initiating a remote model inference command, the historical dialogue state of the current session is obtained, serialized and stored in a distributed cache database to generate a chat memory snapshot, and the current session identifier and a globally auto-incrementing version timestamp are bound when generating the chat memory snapshot; The remote inference process of the model service layer is defined as an asynchronous long transaction by adopting a long-short transaction separation mechanism; When a remote inference call returns a successful network status code and the response text is not empty and conforms to a preset natural language parsing format, a local database write short transaction is initiated to write the user input information, the response text, and the link log of this call as an atomic operation to the data storage layer. When a remote call triggers a timeout threshold, the short transaction write link is aborted, and a snapshot-based failure rollback mechanism is activated to overwrite the historical conversation cache with the chat memory snapshot. The timeout threshold is a positive integer within the range of 10 to 30 seconds.

6. The multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The multi-source context fusion cultural tourism dialogue and interaction system also includes: The memory management module, used in conjunction with the dialogue generation module, converts the feature entities into structured data and writes them into the long-term memory, specifically including: A creation timestamp is appended to the memory record written into the long-term memory bank, and a memory validity score is calculated, wherein the memory record is composed of the structured data; The confidence probability parameter output by the model service layer is extracted and multiplied by the time decay term to obtain the memory effectiveness score; The time decay term is obtained by calculating the negative exponent of the natural constant. The exponent part is the product of the preset memory decay coefficient and the time difference. The time difference is obtained by subtracting the current absolute timestamp from the absolute timestamp when the corresponding memory record was initialized. When the memory validity score decreases below the retention limit set by the system, and the memory category classification code corresponding to the memory record does not belong to the baseline label that needs to be permanently saved, the corresponding memory record will be marked as archived.

7. A multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The multi-source context fusion cultural tourism dialogue and interaction system also includes: The tool call and auditing module is used in conjunction with the dialogue generation module to extract the feature entities from the response text, specifically for: Discrete data items are extracted from the response text, and the discrete data items are encapsulated into a structured parameter payload to obtain the memory entity data sequence to be deposited and the accompanying context parameters. The context parameters include model call identifier, session identifier, user identifier and device identifier. Based on a preset separator, the model call identifier, the current session identifier, the user identifier of this model interaction task, and the memory entity data sequence to be deposited are concatenated into a string. A cryptographic secure hash algorithm is used to construct a hash mapping function to convert the concatenated result into a tool call fingerprint; The audit log cache pool is queried. If there is no physical record in the audit log cache pool that matches the tool call fingerprint, or if there is a matching record but the absolute difference in the trigger time between the two exceeds the security blocking window threshold, the tool call instruction is determined to be legal and valid, and the underlying application interface is triggered to complete the writing of the structured data composed of the memory entity data sequence to be deposited into the database. The security blocking window threshold is a positive integer between 500 milliseconds and 2000 milliseconds.

8. A multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The route generation module generates the candidate travel route sequence, specifically for: Calculate the comprehensive recommendation weight of each candidate graph node in the candidate node pool. The comprehensive recommendation weight is obtained by weighted summation of the matching degree function, the hit indicator function and the spatial distribution decay function. Extract the maximum and minimum extreme values ​​of distance and time for each candidate travel route sequence, perform max-min normalization preprocessing to obtain normalized spatial physical distance and normalized traffic estimated time; Subtracting the normalized spatial physical distance and the normalized estimated traffic time from the sum of the comprehensive recommendation weights, and adding the richness score parameter of the location category, yields the comprehensive evaluation score of the candidate travel route sequence. The results are then sorted in descending order, and the top few optimal route sequences are selected as the final output candidate travel route sequence.

9. A multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The multi-source context fusion cultural tourism dialogue and interaction system also includes: The map abstraction module, used in conjunction with the route generation module, is used to obtain the distance and time parameters, specifically for: The local degradation calculation component is triggered when the external map service times out and is blocked. The distance between two points is calculated using the cosine theorem of the sphere based on the latitude and longitude coordinates of the candidate map nodes in the candidate node pool. This distance is then used as the numerator. Traffic mode feature parameters are extracted, and the product of the prior reference speed parameter for the user-selected traffic mode feature parameters and the traffic congestion adjustment coefficient is used as the basic denominator. The final denominator is formed by adding a very small non-zero positive real smoothing term to the basic denominator term; The estimated traffic time is obtained by adding the result of the division between the numerator and the final denominator to the fixed action penalty time under the corresponding traffic mode characteristic parameter. The range of values ​​for the positive real number smoothing term is set to 10. -5 Up to 10 -3 between.

10. A multi-source context fusion cultural tourism dialogue and interaction system according to claim 1, characterized in that, The recommendation reason generation module is used to generate the text description, and the data persistence module is used to write the reply text or the candidate travel route sequence into the data storage layer, specifically including: Logarithmic summation is performed on the word generation conditional probabilities output by the classifier at the end of the model network in the model service layer. Division, decay, and multiplication operations are performed using the exponential term containing the total length parameter of the current sequence, and a very small positive real number smoothing term is forcibly added to the denominator to obtain the sequence with the highest score as the text description. When synchronously writing the candidate travel route sequence to the data storage layer, the core identifier sequence and the total number of subordinate stations of the candidate travel route sequence are extracted, and a standard secure hash operation is performed to generate a unique integrity verification character as an independent field, which is then stored in the database along with the candidate travel route sequence. The range of values ​​for the positive real number smoothing term is set to 10. -5 Up to 10 -3 between.