A Personalized Recommendation System for Tourist Routes Based on AI Matrix Algorithm
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]路线方案生成后缺少标准化筛选与排序机制,输出内容同质化问题突出,出行可行性与内容多样性无法兼顾
[0063]与现有技术相比,本发明的优点和积极效果在于:
Smart Images

Figure CN122572829A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent tourism recommendation technology, and in particular to a personalized tourism route recommendation system based on AI matrix algorithm. Background Technology
[0002] The digital transformation of the cultural and tourism industry is accelerating, and intelligent travel route recommendations have become an important part of travel services. Existing conventional recommendation systems mostly rely on fixed user tags and historical preferences for basic matching, resulting in limited data collection dimensions and difficulty in simultaneously integrating personal characteristics, long-term behavioral records, and real-time scenario information. Various types of user data are independent and fragmented; trip feedback and environmental spatiotemporal factors cannot participate in recommendation calculations. A single static data model struggles to capture changes in users' periodic interests, leading to a deviation between recommended content and actual travel needs.
[0003] Traditional user feature modeling methods suffer from rigid computational logic and fixed attention weights, failing to dynamically adjust based on behavioral temporal changes and contextual relevance. This hinders the effective extraction of deep features from dynamic behavioral data. User-defined attribute data lacks standardized feature fusion and embedding processes, resulting in static profiles with limited representation and an inability to form multi-dimensional structured vector representations. Mainstream recommendation models lack a matrix-based resource management architecture, with scattered distribution of attractions and activities, simple and fixed matching methods, and a lack of multi-round iterative filtering and global path optimization capabilities.
[0004] The lack of standardized filtering and sorting mechanisms after route plans are generated results in significant homogenization of output content, failing to balance travel feasibility and content diversity. Current tourism services demand higher standards for recommendation models, requiring dynamic and static user feature modeling, matrix-based intelligent matching, and refined plan filtering. Existing technical architectures cannot meet the requirements for personalized, scenario-based, and diversified tourism route recommendations. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a personalized travel route recommendation system based on an AI matrix algorithm.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a personalized travel route recommendation system based on AI matrix algorithm, comprising:
[0007] The data acquisition module acquires the target user's personal characteristic data, historical behavior data, and real-time scene data. The personal characteristic data includes user profile tags and explicit preference statements. The historical behavior data includes multi-dimensional historical travel records and implicit feedback sequences. The real-time scene data includes geographical location, time, and weather.
[0008] The vector generation module performs an improved multi-head attention algorithm on the historical behavior data and real-time scene data to generate dynamic user interest vectors. The improved multi-head attention algorithm optimizes the attention weight allocation based on time decay and scene relevance. It also performs feature fusion and embedding processing on the personal feature data to generate static user profile vectors.
[0009] The route generation module inputs the dynamic user interest vector and the static user profile vector into the tourism route AI matrix algorithm model. The tourism route AI matrix algorithm model performs multiple rounds of iterative matching and path optimization in the candidate scenic spot and activity matrix to generate a set of personalized tourism route schemes.
[0010] The results processing module performs feasibility constraint filtering and diversity sorting on the personalized travel route plan set, generates a final recommendation list, and pushes the final recommendation list to the target user's terminal device for display.
[0011] As a further aspect of the present invention, an improved multi-head attention algorithm is applied to the historical behavior data and real-time scene data to generate a dynamic user interest vector, including:
[0012] The multi-dimensional historical itinerary records are analyzed to extract the sequence of attractions, the sequence of stay duration, and the sequence of activity types for each itinerary. The implicit feedback sequence is then quantified to generate a time series of interest intensity.
[0013] The scenic spot sequence and activity type sequence are mapped into high-dimensional embedding vectors, and then concatenated with the interest intensity time sequence and stay duration sequence to form a historical behavior feature tensor.
[0014] The real-time scene data is encoded into a scene feature vector;
[0015] The historical behavior feature tensor and the scene feature vector are input into the improved multi-head attention algorithm. The improved multi-head attention algorithm is computed in parallel by multiple independent attention heads. Each attention head focuses on the part of the historical behavior feature tensor that is highly correlated with the dimension of the specific scene feature vector.
[0016] When allocating attention weights, the improved multi-head attention algorithm introduces a time decay function to apply low weights to historical behavioral features from a long time ago, and introduces a scene correlation function to apply high weights to behavioral features from historical scenes that are similar to the current scene feature vector.
[0017] The outputs of all attention heads are concatenated and linearly transformed to generate the dynamic user interest vector that represents the user's real-time interest orientation in the current scene.
[0018] As a further aspect of the present invention, feature fusion and embedding processing is performed on the personal feature data to generate a static user profile vector, including:
[0019] The user profile tags are multi-hot encoded to generate tag feature vectors;
[0020] The explicit preference statement is subjected to text analysis and sentiment analysis to extract preference keywords and their sentiment polarities. Each preference keyword is mapped to a word vector and combined with the sentiment polarity in a weighted manner to generate a preference feature vector.
[0021] The label feature vector and the preference feature vector are input into a feature fusion network, which learns the implicit relationship between labels and preferences through fully connected layers and nonlinear cross transformations.
[0022] The fused features output by the feature fusion network are reduced in dimensionality and smoothed by a pooling layer, resulting in a static user profile vector with fixed dimensions.
[0023] As a further aspect of the present invention, the dynamic user interest vector and the static user profile vector are input into a tourism route AI matrix algorithm model. The tourism route AI matrix algorithm model then performs multiple rounds of iterative matching and path optimization within the candidate attraction and activity matrix to generate a set of personalized tourism route solutions, including:
[0024] Construct a candidate attraction and activity matrix, where each row of the matrix represents a candidate attraction or activity, and each column represents an attribute dimension, including category, price, duration, popularity, and seasonal suitability.
[0025] The dynamic user interest vector and the static user profile vector are concatenated to form a comprehensive user vector;
[0026] In the AI matrix algorithm model for the tourism route, the comprehensive user vector is multiplied by the candidate attraction and activity matrix to calculate the initial matching score of the user corresponding to each candidate attraction or activity.
[0027] Based on the initial matching score, and combined with the spatial distance, temporal connection logic and thematic coherence between attractions, multiple rounds of iterative path optimization are performed in the solution space defined by the matrix. The multiple rounds of iterative path optimization process simulates path search, and each iteration selects and expands the currently locally optimal path node.
[0028] After multiple iterations, several complete travel routes from the starting point to the destination, including different combinations of attractions and activities, are generated as the set of personalized travel route schemes.
[0029] As a further aspect of the present invention, based on the initial matching score, and combining the spatial distance between attractions, temporal connection logic, and thematic coherence, multiple rounds of iterative path optimization are performed within the solution space defined by the matrix, including:
[0030] Define the path status, which includes the currently visited sequence of attractions, the cumulative time spent, the cumulative cost, and the current location;
[0031] The initial path state is a sequence containing only the starting point;
[0032] In each iteration, starting from the last attraction in the current path state, a set of reachable candidate subsequent attractions is selected based on the spatial proximity matrix;
[0033] For each attraction in the candidate set of subsequent attractions, calculate its overall gain after being added to the current path. The overall gain is determined by the attraction's initial matching score, the time connection cost with the previous attraction, the spatial movement cost, and the theme coherence gain.
[0034] Select one or more candidate attractions with the highest overall gain and add them to the current path to expand the new path status;
[0035] The iterative process is repeated until the path meets the preset termination conditions, which include reaching the maximum number of attractions, the total time or total cost exceeding the budget, or no reachable candidate attractions.
[0036] Record all complete paths generated during the expansion process to form the personalized travel route scheme set.
[0037] As a further aspect of the present invention, the personalized travel route plan set is subjected to feasibility constraint filtering and diversity ranking to generate a final recommendation list, including:
[0038] Obtain the hard constraints set by the user, including total time budget, total cost budget, a list of must-see attractions, and unacceptable types of activities;
[0039] Each route in the personalized travel route scheme set is compared with the hard constraints, and any route scheme that does not meet the hard constraints is filtered out to obtain a set of candidate feasible route schemes.
[0040] For each route in the set of candidate feasible route options, a diversity score is calculated. The diversity score is calculated based on the overlap of attractions, the difference in the distribution of activity types, and the difference in the path structure among the route options.
[0041] The route options in the candidate feasible route option set are sorted in descending order based on the diversity score;
[0042] The top few route options are selected from the sorted list to form the final recommendation list.
[0043] As a further aspect of the present invention, the improved multi-head attention algorithm introduces a time decay function to apply low weights to historical behavioral features from long ago, and introduces a scene correlation function, including:
[0044] The time decay function adopts an exponential decay form. Its input is the time difference between the time when the historical behavior occurred and the current time, and its output is a decay coefficient between zero and one. The larger the time difference, the smaller the decay coefficient.
[0045] The scene correlation function calculates the cosine similarity between the scene feature vector when the historical behavior occurred and the scene feature vector obtained by encoding the current real-time scene data. The cosine similarity is then mapped to a correlation weight through a scaling and translation function.
[0046] When calculating the attention weight corresponding to each historical behavior feature, the decay coefficient is multiplied by the correlation weight to obtain the base weight, which is then subjected to standard attention Softmax normalization to obtain the final attention weight.
[0047] As a further aspect of the present invention, the feature fusion network learns the implicit correlation between labels and preferences through fully connected layers and nonlinear cross-transformations, including:
[0048] The label feature vector is input into the first fully connected layer for nonlinear transformation, and the first hidden feature vector is output.
[0049] The preference feature vector is input into the second fully connected layer for nonlinear transformation, and the second hidden feature vector is output.
[0050] A cross-transformation process is performed on the first hidden feature vector and the second hidden feature vector. The cross-transformation process generates an interaction matrix through an outer product operation. The interaction matrix is then vectorized to obtain the cross feature vector.
[0051] The first hidden feature vector, the second hidden feature vector, and the cross feature vector are concatenated to form a fused feature vector;
[0052] The fused feature vector is input into the third fully connected layer, and a nonlinear transformation is performed through an activation function to output the fused features of the feature fusion network.
[0053] As a further aspect of the present invention, the spatial distance, temporal connection logic, and thematic coherence between attractions defined and used in the tourism route AI matrix algorithm model include:
[0054] The spatial distance is calculated based on the latitude and longitude coordinates of the scenic spot using Euclidean distance or actual road network distance, and then converted into estimated travel time.
[0055] The time connection logic checks whether the opening times of two attractions overlap, and whether the time required to leave the first attraction and move to the second attraction is within the opening time window of the second attraction.
[0056] The theme coherence is based on the category labels of attractions and activities. The relevance or naturalness of the transition between two attractions is calculated through a predefined theme map, which defines the strength of association between different categories.
[0057] As a further aspect of the present invention, the calculation of the overall gain after adding it to the current path includes:
[0058] Calculate the initial matching score of the attractions as the base revenue;
[0059] Calculate the time connection cost and spatial movement cost required to add attractions to the current route. The time connection cost is calculated based on the matching degree of the opening time window, and the spatial movement cost is calculated based on spatial distance and mode of transportation conversion.
[0060] Calculate the theme coherence gain resulting from adding attractions to the current path, which is measured by comparing the change in theme consistency before and after the addition.
[0061] Set weighting coefficients for basic revenue, time connection cost, spatial movement cost, and thematic coherence gain;
[0062] Based on the aforementioned weighting coefficients, the basic gain is summed with the theme coherence gain, and then the time connection cost and spatial movement cost are subtracted to obtain the overall gain.
[0063] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0064] The internal weight allocation rules of the multi-head attention algorithm are optimized, and dynamic adjustment is achieved by combining time decay law and scene correlation to perform deep feature mining on historical behavior data and real-time scene data. Based on the improved computational logic, the correlation between temporal behavior information and environmental variables is analyzed to continuously output dynamic user interest vectors. Standardized feature fusion and embedding processing is performed on personal feature data to unify the expression form of multi-class attribute data and generate independent static user profile vectors. The modeling dimensions of static inherent attributes and dynamic real-time preferences are distinguished, and the dual-vector representation system is improved to fully cover user inherent characteristics and stage-based behavioral preferences, enriching the structured expression dimensions of user preference information.
[0065] A tourism route AI matrix algorithm model is constructed, which integrates candidate attractions and activity resources into a standardized matrix structure. Based on dual-vector input conditions, multiple rounds of iterative matching operations are performed to optimize the entire route according to the resource arrangement rules within the matrix, generating a batch of personalized tourism route schemes with multiple combinations. The matrix-based operation mode expands the resource matching scope, increases the number of route combinations generated, strengthens the correlation and matching capabilities between multiple elements, and enriches the coverage and combination types of the initial route schemes.
[0066] For a large number of route options, a unified feasibility constraint screening is performed to eliminate invalid options that do not meet actual travel conditions. The options are then arranged in an orderly manner according to diversity evaluation rules to regulate the distribution structure of recommended content and reduce the concentration of similar options. After standardization, a standardized final recommendation list is formed, ensuring stable data push and content display to terminals. A multi-level screening and sorting mechanism balances the reasonable and differentiated attributes of the options, continuously adapting to the selection preferences of different users, improving the actual adaptability of route options, and enriching the output levels of personalized travel recommendations. Attached Figure Description
[0067] Figure 1 This is a state diagram of a personalized travel route recommendation system based on an AI matrix algorithm, as described in this invention.
[0068] Figure 2 Flowchart for generating dynamic user interest vectors;
[0069] Figure 3 A flowchart for generating static user profile vectors. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0071] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0072] See Figure 1This invention provides a personalized travel route recommendation system based on AI matrix algorithm, the specific system comprising:
[0073] The system comprises a data acquisition module, a vector generation module, a route generation module, and a result processing module. The data acquisition module obtains the target user's personal characteristic data, historical behavior data, and real-time scene data. Personal characteristic data includes user profile tags and explicit preference statements; historical behavior data includes multi-dimensional historical travel records and implicit feedback sequences; and real-time scene data includes geographical location, time, and weather. The vector generation module performs an improved multi-head attention algorithm on the historical behavior data and real-time scene data to generate dynamic user interest vectors. This improved multi-head attention algorithm optimizes attention weight allocation based on time decay and scene relevance. This module also performs feature fusion and embedding processing on the personal characteristic data to generate static user profile vectors. The route generation module inputs the dynamic user interest vectors and static user profile vectors into a tourism route AI matrix algorithm model. This model performs multiple rounds of iterative matching and path optimization between candidate attractions and activity matrices to generate a set of personalized tourism route options. The result processing module performs feasibility constraint filtering and diversity ranking on the personalized tourism route option set, generates a final recommendation list, and pushes the final recommendation list to the target user's terminal device for display.
[0074] In one embodiment of the present invention, the process of generating dynamic user interest vectors includes performing an improved multi-head attention algorithm on historical behavior data and real-time scene data. See also... Figure 2This process analyzes multi-dimensional historical itinerary records, extracting the sequence of attractions, duration of stay, and activity type for each trip, and quantifies the implicit feedback sequence to generate an interest intensity time series. The attraction and activity type sequences are mapped to high-dimensional embedding vectors and concatenated with the interest intensity and duration of stay time series to form a historical behavior feature tensor. Real-time scene data is encoded into scene feature vectors. The historical behavior feature tensor and scene feature vectors are input into an improved multi-head attention algorithm. This algorithm uses multiple independent attention heads to compute in parallel, with each attention head focusing on the portion of the historical behavior feature tensor that is highly correlated with the dimension of a specific scene feature vector. In attention weight allocation, the improved multi-head attention algorithm introduces a time decay function, assigning low weights to distant historical behavior features, and a scene correlation function, assigning high weights to behavior features from historical scenes similar to the current scene feature vector. The time decay function uses an exponential decay form; its input is the time difference between the historical behavior occurrence and the current time, and its output is a decay coefficient between zero and one; the larger the time difference, the smaller the decay coefficient. The scene correlation function calculates the cosine similarity between the scene feature vector at the time of the historical behavior and the scene feature vector obtained by encoding the current real-time scene data. This cosine similarity is then mapped to a correlation weight using a scaling and translation function. When calculating the attention weight corresponding to each historical behavior feature, the decay coefficient is multiplied by the correlation weight to obtain the base weight, which is then normalized using standard attention Softmax to obtain the final attention weight. The outputs of all attention heads are concatenated and linearly transformed to generate a dynamic user interest vector representing the user's real-time interest orientation in the current scene.
[0075] In practical implementation, the generation of dynamic user interest vectors relies on the processing of historical behavioral data and real-time scene data. The following example scenario illustrates this. The example user's historical behavioral data includes two trip records. The first trip record occurred on October 1, 2025, with a visit sequence of "Tiananmen Square - Forbidden City - Jingshan Park," corresponding to a stay duration sequence of "2 hours - 3 hours - 1 hour," and an activity type sequence of "sightseeing - historical and cultural tour - city overview." The implicit feedback sequence records the user's clicks, favorites, and 15 minutes of detail browsing behavior at the "Forbidden City." The second trip record occurred on April 15, 2026, with a visit sequence of "Summer Palace - Yuanmingyuan," corresponding to a stay duration sequence of "4 hours - 2 hours," and an activity type sequence of "garden tour - historical site visit." The implicit feedback sequence records relatively fewer interactive behaviors. The real-time scene data is for April 28, 2026, with the user located in Haidian District, Beijing, on a sunny day at 10:00 AM.
[0076] In practice, multi-dimensional historical itinerary records are analyzed to extract the sequence of attractions, duration of stay, and activity type for each trip. Implicit feedback sequences are quantified to generate interest intensity time series; for example, actions such as clicks, favorites, and browsing duration are mapped to values between 0 and 1, with higher values indicating greater interest intensity, generating serialized representations like "Forbidden City: 0.9, Summer Palace: 0.6". The attraction and activity type sequences are mapped into high-dimensional embedding vectors using pre-trained embedding models, with each attraction or activity type corresponding to a fixed-length dense vector. The duration of stay and interest intensity time series are used as scalar features and concatenated with the aforementioned embedding vectors to form a historical behavior feature tensor. This historical behavior feature tensor organizes different historical itinerary segments of the user along the time dimension.
[0077] In practice, real-time scene data is encoded into scene feature vectors. The geographical location "Haidian District, Beijing" is converted into a region ID embedding vector through geocoding. The time "10:00 AM, April 28, 2026" is decomposed into multiple periodic features such as day of the week, month, and time and encoded. The weather "Sunny" is mapped to a weather category embedding vector. These encoded features are concatenated and compressed through a fully connected layer to form a unified scene feature vector.
[0078] In some embodiments, a historical behavior feature tensor and a scene feature vector are input into an improved multi-head attention algorithm. The improved multi-head attention algorithm computes in parallel using multiple independent attention heads, each focusing on the portion of the historical behavior feature tensor that is highly correlated with the dimension of a specific scene feature vector. For example, one attention head might focus more on historical behaviors related to the current "morning" time, while another might focus more on historical behaviors related to "sunny" weather. When assigning attention weights, the improved multi-head attention algorithm introduces a time decay function to assign low weights to older historical behavior features and a scene correlation function to assign high weights to behavior features from historical scenes similar to the current scene feature vector.
[0079] The time decay function uses an exponential decay form. The input to the time decay function is the time difference between the historical event and the current moment, and the output is a decay coefficient between zero and one. The larger the time difference, the smaller the decay coefficient. The expression for the time decay function is:
[0080]
[0081] in: This represents the decay coefficient output by the time decay function. It is a decay rate hyperparameter that is greater than zero. This represents the time difference (in days) between the historical event and the current moment. The scene correlation function calculates the cosine similarity between the scene feature vector at the time the historical event occurred and the scene feature vector obtained by encoding the current real-time scene data. The cosine similarity is then mapped to a correlation weight using a scaling and translation function. The scaling and translation function can be a simple linear transformation that maps the cosine similarity from the range [-1, 1] to a positive interval, such as [0.5, 1.5].
[0082] When calculating the attention weight for each historical behavioral feature, the decay coefficient is multiplied by the correlation weight to obtain the base weight. This base weight is then subjected to standard attention Softmax normalization to obtain the final attention weight. It can be understood that, in this way, the "garden visit" behavior that occurred on April 15, 2026 (recent, spring) may receive a higher weight in the final attention allocation than the "historical and cultural visit" behavior that occurred on October 1, 2025 (more distant, autumn), due to its higher time decay coefficient and higher correlation weight with the current sunny spring weather scene. The improved multi-head attention algorithm concatenates and linearly transforms the outputs of all attention heads to generate a dynamic user interest vector representing the user's real-time interest orientation in the current scenario. The dynamic user interest vector comprehensively reflects the user's recent behavioral patterns and their correlation with the current context.
[0083] In one embodiment of the present invention, the process of generating a static user profile vector includes performing feature fusion and embedding processing on personal feature data. See also... Figure 3 The system performs multi-hot encoding on user profile tags to generate tag feature vectors. It then performs text analysis and sentiment analysis on explicit preference statements to extract preference keywords and their sentiment polarities. Each preference keyword is mapped to a word vector and weighted with its sentiment polarity to generate a preference feature vector. The tag feature vector and preference feature vector are input into a feature fusion network. This network learns the implicit relationship between tags and preferences through fully connected layers and non-linear cross-transformations. Specifically, the tag feature vector is input into the first fully connected layer for a non-linear transformation, outputting the first hidden feature vector. The preference feature vector is input into the second fully connected layer for a non-linear transformation, outputting the second hidden feature vector. A cross-transformation is performed on the first and second hidden feature vectors. This cross-transformation generates an interaction matrix through an outer product operation, which is then vectorized to obtain a cross-feature vector. The first, second, and cross-feature vectors are concatenated to form a fused feature vector. This fused feature vector is input into the third fully connected layer and subjected to a non-linear transformation through an activation function, outputting the fused features of the feature fusion network. The fused features are then subjected to dimensionality reduction and smoothing through a pooling layer, outputting a static user profile vector with fixed dimensions.
[0084] In practice, the generation of static user profile vectors is based on the processing of personal feature data. The following example user scenario illustrates this. The user profile tags provided by the example user are "photography enthusiast," "history buff," and "food explorer." The explicit preference statement filled in by the example user during registration is a text: "I like quiet, historic old towns, I can tolerate moderate walking, but I really hate crowded amusement parks with long lines, and I hope to have local food experiences during my trip."
[0085] In practice, user profile tags are multi-hot encoded to generate tag feature vectors. The system predefines a tag library covering all possible interest categories, including dozens of dimensions such as "natural scenery," "historical sites," "urban shopping," "theme parks," "food experiences," "photography destinations," and "outdoor hiking." Each tag corresponds to a specific position in the vector. The "photography enthusiast" tag activates the "photography destinations" dimension, the "history buff" tag activates the "historical sites" dimension, and the "food explorer" tag activates the "food experiences" dimension. Activated dimensions are set to 1, and inactive dimensions are set to 0, thus generating a high-dimensional, sparse binary tag feature vector that directly reflects the user's self-proclaimed interest category affiliation.
[0086] In practice, explicit preference statements undergo text analysis and sentiment analysis to extract preference keywords and their sentiment polarities. Through word segmentation and named entity recognition, keywords such as "quiet," "historical," "ancient town," "moderate walking," "crowded," "long queues," "amusement park," and "local delicacies" are identified as key concepts. The sentiment analysis module determines that "like" and "hope" correspond to positive sentiment polarities, while "dislike" corresponds to negative sentiment polarities. Each preference keyword is mapped to a word vector, derived from a word embedding model pre-trained on a large-scale corpus. Each keyword is converted into a dense real-valued vector of fixed dimensions. The mapped word vectors are weighted and combined with sentiment polarities to generate a preference feature vector. The combination method involves multiplying the word vectors by a scalar weight set according to the intensity of sentiment polarity; for example, the weight for positive preferences is +1, and the weight for strong negative preferences is -1.5. Then, all weighted word vectors are summed and normalized to form a preference feature vector that summarizes the user's specific preference statements and their sentiment tendencies.
[0087] In some embodiments, the label feature vector and the preference feature vector are input into a feature fusion network. The feature fusion network learns the implicit relationship between labels and preferences through fully connected layers and non-linear cross-transformations. The label feature vector is input into a first fully connected layer for a non-linear transformation. The first fully connected layer uses the ReLU activation function and outputs a first hidden feature vector with reduced dimensionality. The preference feature vector is input into a second fully connected layer for a non-linear transformation. The second fully connected layer also uses the ReLU activation function and outputs a second hidden feature vector with the same dimensionality as the first hidden feature vector. It can be understood that through the non-linear transformation of the fully connected layers, the original sparse binary label features and the summed preference features are mapped to the same more expressive latent semantic space.
[0088] A cross-transformation is performed on the first and second hidden feature vectors. This cross-transformation generates an interaction matrix through an outer product operation. The outer product operation multiplies the first and second hidden feature vectors to obtain an interaction matrix that captures the combination relationship between label features and preference features across different dimensions. The mathematical expression of the cross-transformation is as follows:
[0089]
[0090] in: This represents the output cross feature vector. Represents the vectorization operation of a matrix. This represents the outer product operation of vectors. This represents the first hidden feature vector. This represents the second hidden feature vector. The vectorization operation flattens this two-dimensional interaction matrix into a one-dimensional cross feature vector. The first hidden feature vector, the second hidden feature vector, and the cross feature vector are concatenated to form a longer fused feature vector, which retains both the independent information of each feature and the second-order interaction information between them.
[0091] In some embodiments, the fused feature vector is input into a third fully connected layer, and a nonlinear transformation is performed through an activation function to output the fused features of the feature fusion network. The third fully connected layer uses an activation function such as Tanh to further perform nonlinear combination and information compression on the concatenated features. Optionally, the fused features output by the feature fusion network are passed through a pooling layer for dimensionality reduction and smoothing. The pooling layer can use global average pooling to integrate the fused features and output a static user profile vector with fixed dimensions. The static user profile vector is a dense, low-dimensional real-number vector that integrates deep, implicit consistency patterns in user-claimed tags and text preferences. For example, from the "history buff" tag and the preference for "liking historically significant ancient towns," a strong representation of "in-depth cultural heritage tours" is fused; from the "foodie" tag and the preference for "local specialty food," a tendency towards "authentic dining" is fused, while the dimension related to "crowded amusement parks" is weakened. Optionally, the final generated static user profile vector will be fed into the downstream route generation module and used in conjunction with dynamic user interest vectors.
[0092] In one embodiment of the present invention, the route generation module operates by inputting dynamic user interest vectors and static user profile vectors into a tourism route AI matrix algorithm model. This model performs multiple rounds of iterative matching and path optimization within a candidate attraction and activity matrix to generate a set of personalized tourism route options. A candidate attraction and activity matrix is constructed, where each row represents a candidate attraction or activity, and each column represents an attribute dimension, including category, price, travel time, popularity, and seasonal suitability. The dynamic user interest vector and static user profile vector are concatenated to form a comprehensive user vector. In the tourism route AI matrix algorithm model, the comprehensive user vector is multiplied by the candidate attraction and activity matrix to calculate the initial matching score for each candidate attraction or activity. This model defines and uses spatial distance, temporal connection logic, and thematic coherence between attractions. Spatial distance is calculated based on the latitude and longitude coordinates of the attractions using Euclidean distance or actual road network distance, and converted into estimated travel time. The temporal connection logic checks whether the opening times of two attractions overlap, and whether the time required to leave the previous attraction and move to the next attraction is within the opening time window of the next attraction. Thematic coherence is based on the category labels of attractions and activities. A predefined thematic graph is used to calculate the thematic relevance or naturalness of transition between two attractions, defining the strength of association between different categories. Based on the initial matching score, and considering spatial distance, temporal connection logic, and thematic coherence between attractions, multiple rounds of iterative path optimization are performed within the solution space defined by the matrix. This process simulates path search, with each iteration selecting and expanding the currently locally optimal path nodes. After multiple iterations, multiple complete travel routes from the starting point to the destination, containing different combinations of attractions and activities, are generated as a set of personalized travel route options.
[0093] In practical implementation, the route generation module inputs dynamic user interest vectors and static user profile vectors into the tourism route AI matrix algorithm model. The model then performs multiple rounds of iterative matching and path optimization between candidate attractions and activity matrices. The following example scenario illustrates this: A user plans a day trip in Beijing. The dynamic user interest vector and static user profile vector are concatenated into a comprehensive user vector. This vector encodes the user's interest in historical sites, gardens, and distinctive restaurants, while also reflecting their aversion to crowded places.
[0094] In implementation, a candidate attraction and activity matrix is constructed. Each row of the matrix represents a candidate attraction or activity, and each column represents an attribute dimension. Attribute dimensions include category, price, duration, popularity, and seasonal suitability. The category dimension consists of coded category labels, such as "historical sites," "royal gardens," "city parks," and "specialty dining." The price dimension represents the level of average spending per person. The duration dimension represents the estimated visit time in minutes. The popularity dimension represents a normalized value based on historical visitor flow data. Seasonal suitability represents the suitability rating of the attraction for the current month. A simplified candidate attraction and activity matrix is shown in Table 1.
[0095] Table 1: Candidate Attractions and Activities Matrix
[0096]
[0097] In practice, the user vector and the candidate attraction / activity matrix are multiplied together to calculate the initial matching score for each candidate attraction or activity. The formula for calculating the initial matching score is as follows:
[0098]
[0099] in: This represents the initial matching score for the i-th candidate attraction or activity. Represents the composite user vector. Let represent the attribute vector corresponding to the i-th row of the candidate scenic spot and activity matrix. This represents the vector dot product operation. Indicates the bias term. The sigmoid activation function is used to map the results to the (0,1) interval. This can be understood as measuring the correlation between the user's overall interest vector and the attribute vectors of each attraction in a multi-dimensional space. Dimensions related to "historical sites" and "gardens" in the overall user vector will produce higher dot product values with the corresponding attribute dimensions of the Palace Museum and the Summer Palace, while the "rejection of crowds" dimension may have a negative effect on the high popularity attribute of Universal Beijing Resort, thus affecting the initial matching score.
[0100] In some embodiments, the AI matrix algorithm model for tourist routes defines and utilizes spatial distance, temporal connection logic, and thematic coherence between attractions. Spatial distance is calculated based on the latitude and longitude coordinates of the attractions using Euclidean distance or actual road network distance, and converted into estimated travel time. For example, a geographic information system query shows that the driving distance from the Palace Museum to the Summer Palace is approximately 18 kilometers, and the estimated travel time based on real-time traffic conditions is approximately 40 minutes. The temporal connection logic checks whether the opening hours of two attractions overlap, and whether the time required to leave the first attraction and move to the second attraction is within the opening time window of the second attraction. For example, if the Palace Museum closes for entry at 4 PM, and a user plans to leave the Palace Museum at 3 PM, plus 40 minutes of travel time, the arrival time at the Summer Palace would be approximately 3:40 PM. Since the Summer Palace closes for entry at 4:30 PM, the temporal connection logic determines that this connection is feasible. Thematic coherence is based on the category labels of attractions and activities. A predefined thematic graph is used to calculate the thematic relevance or transitional naturalness between two attractions, defining the strength of association between different categories. For example, the correlation between "historical sites" and "royal gardens" is relatively strong in the thematic map, while the correlation between "historical sites" and "theme parks" is relatively weak. The thematic coherence gain from going from the Palace Museum (historical site) to the Summer Palace (royal garden) is higher than that from going to Universal Beijing Resort (theme park).
[0101] In practical implementation, based on the initial matching score, and combined with the spatial distance, temporal connection logic, and thematic coherence between attractions, multi-round iterative path optimization is performed within the solution space defined by the matrix. The multi-round iterative path optimization process simulates path search, with each iteration selecting and expanding the currently locally optimal path node. For example, if the starting point is set as the user's hotel location, the Palace Museum, with its high initial matching score, is selected as the first attraction to be added to the path. Among the remaining candidate attractions, the algorithm calculates a comprehensive evaluation score for each candidate attraction after it is added to the path, based on spatial proximity, temporal connection, and thematic coherence, and selects the Summer Palace, with the highest score, as the next expanded node. In some embodiments, optional optimization strategies include bundle search, where multiple potential local paths are retained in each iteration instead of just one. After multiple iterations, multiple complete tourist routes from the starting point to the destination, containing different combinations of attractions and activities, are generated, such as the "Hotel -> Palace Museum -> Jingshan Park -> Quanjude (Dinner)" route and the "Hotel -> Summer Palace -> Nanluoguxiang" route. These routes constitute a set of personalized tourist route options.
[0102] In one embodiment of the invention, a path state is defined, including the currently visited sequence of attractions, cumulative time spent, cumulative cost, and current location. The path state is initialized to a sequence containing only the starting point. In each iteration, starting from the last attraction in the current path state, a set of reachable candidate subsequent attractions is selected based on a spatial proximity matrix. For each attraction in the candidate subsequent attraction set, its overall gain after being added to the current path is calculated. The overall gain is determined by the attraction's initial matching score, the time connection cost with the previous attraction, the spatial movement cost, and the theme coherence gain. The initial matching score of the attraction is calculated as the base gain. The time connection cost and spatial movement cost required to add the attraction to the current path are calculated. The time connection cost is calculated based on the matching score of the open time window, and the spatial movement cost is calculated based on spatial distance and mode of transportation conversion. The theme coherence gain brought about by adding the attraction to the current path is calculated. The theme coherence gain is measured by comparing the change in theme consistency before and after the addition. Weighting coefficients are set for the base gain, time connection cost, spatial movement cost, and theme coherence gain. Based on weighted coefficients, the basic gain and the theme coherence gain are summed, and then the time connection cost and spatial movement cost are subtracted to obtain the comprehensive gain. One or more candidate attractions with the highest comprehensive gain are selected and added to the current path to expand new path states. This iterative process is repeated until the path meets preset termination conditions, including reaching the maximum number of attractions, total time or total cost exceeding the budget, or no reachable candidate attractions. All complete paths generated during the expansion process are recorded to form a set of personalized travel route plans.
[0103] The specific calculation method for time connection cost is as follows: Obtain the estimated end time of the visit to the previous attraction, add the estimated travel time required to move from the previous attraction to the candidate subsequent attraction, and obtain the estimated arrival time. Compare the estimated arrival time with the effective opening time window of the candidate subsequent attraction for the day; this opening time window is the time interval during which the attraction is allowed to enter. If the estimated arrival time is earlier than the start time of the opening time window, a waiting time will occur; the longer the waiting time, the higher the time connection cost. If the estimated arrival time is later than the latest acceptable arrival time obtained by subtracting the minimum suggested visit time for the candidate attraction from the end time of the opening time window, the connection is considered infeasible, and the time connection cost is set to a large fixed value. If the estimated arrival time falls between the latest acceptable arrival time and the start time of the opening time window, calculate the time difference between the estimated arrival time and the start time of the opening time window, and based on this time difference and waiting factors, obtain the time connection cost value through a preset monotonically increasing mapping function. This time connection cost is a non-negative real number; the smaller the value, the smoother the connection.
[0104] The specific calculation method for spatial movement cost is as follows: First, obtain the coordinates of the current scenic spot and the coordinates of candidate scenic spots. Then, calculate the actual road network distance or straight-line distance between the two coordinates using a geographic information system (GIS) and convert it into estimated travel time. Combined with the user's preset travel mode or the system's distance-recommended mode, determine the corresponding inconvenience coefficient for that mode of transportation. This inconvenience coefficient comprehensively reflects the time consumption, physical exertion, and comfort level of that mode of transportation. The estimated travel time multiplied by the inconvenience coefficient is used as the base movement cost. When the movement involves a change of mode of transportation, the number of changes is counted, and a preset change penalty is added for each change. The final spatial movement cost is the sum of the base movement cost and the change penalty. A higher spatial movement cost indicates a greater time, physical exertion, or inconvenience cost incurred during the movement.
[0105] The specific calculation method for the theme coherence gain is as follows: Based on the scenic spot sequence already included in the current planned path, the theme association strength between every two adjacent scenic spots in the sequence is calculated based on a predefined theme map. The average of the association strength values of all adjacent pairs is then used as the theme consistency score of the current path. When attempting to add a candidate scenic spot to the end of the current path, a temporary scenic spot sequence is constructed. This sequence appends the candidate scenic spot to the end of the original sequence, and the average association strength of all adjacent scenic spot pairs in the temporary sequence is recalculated to obtain the theme consistency score of the new sequence. The theme consistency score of the new sequence is subtracted from the theme consistency score of the current path; the difference is the theme coherence gain. If the gain is positive, it means that adding the candidate scenic spot makes the theme of the entire path more coherent and the transition more natural; if the gain is negative, it means that there is a break in theme between the candidate scenic spot and the existing scenic spot sequence.
[0106] In practice, a multi-round iterative path optimization process is initiated, which is described below with reference to a specific path expansion step. Define the path state, which includes the currently visited sequence of attractions, cumulative time spent, cumulative cost, and current location. Initialize the path state to a sequence containing only the starting point "the user's hotel," with cumulative time spent and cumulative cost both set to zero, and the current location set to the hotel coordinates.
[0107] In the specific implementation, in the first iteration, starting from the last attraction in the current path state, "the user's hotel," a set of reachable candidate attractions is selected based on a spatial proximity matrix, which is pre-calculated based on a distance threshold. Assuming that the set of candidate attractions reachable within a reasonable timeframe from the hotel includes "The Palace Museum," "The Temple of Heaven Park," and "Nanluoguxiang," for each attraction in the candidate set, the overall gain after adding it to the current path is calculated. An initial matching score for the attraction is calculated as the base gain, derived from the aforementioned matrix multiplication. The time connection cost and spatial movement cost required to add the attraction to the current path are calculated. The time connection cost is calculated based on the matching degree within the open time window, and the spatial movement cost is calculated based on spatial distance and mode of transportation conversion. The theme coherence gain brought about by adding the attraction to the current path is calculated, measured by comparing the change in theme consistency before and after the addition. Weighting coefficients are set for the base gain, time connection cost, spatial movement cost, and theme coherence gain. Based on the weighting coefficients, the basic gain and the theme coherence gain are summed, and then the time connection cost and spatial movement cost are subtracted to obtain the comprehensive gain. In a specific calculation example, the data comparisons are as follows (see Table 2):
[0108] Table 2: Calculation Table of Comprehensive Gain of Candidate Scenic Spots
[0109]
[0110] In practical implementation, the formula for calculating the overall gain is as follows:
[0111]
[0112] in: This represents the overall gain of the candidate attractions. This indicates the initial matching score (basic benefit) of the attraction. This indicates the time connection cost required to add the attraction to the current route. Indicates the cost of spatial movement. Indicates the gain in topic coherence. These are the weighting coefficients for basic benefits, time connection costs, spatial movement costs, and thematic coherence gains. These weighting coefficients are set through an offline hyperparameter optimization process. Specifically, this involves collecting historical user feedback on multiple different route options, actual completion rates, and user-initiated ratings, and integrating this behavioral data into a comprehensive route satisfaction index. Using these weighting coefficients as the hyperparameter vector to be optimized, within a preset search range, grid search or Bayesian optimization methods are used to generate corresponding personalized travel route recommendations for each weighting coefficient combination. The comprehensive route satisfaction index is used as the evaluation target, and the weighting coefficient combination that optimizes the evaluation target is selected as the system's default configuration. Business rules can also preset weighting coefficient templates for different scenarios based on actual operational needs. For example, increasing the weighting of time connection costs in time-sensitive scenarios and increasing the weighting of thematic coherence gains in leisure experience scenarios. Based on the example data in the table, assuming the weighting coefficients are the above values, the data for the "Palace Museum" is substituted: The value is approximately 0.60 (simplified values are shown in the table). One or more candidate attractions with the highest overall gain are selected and added to the current path, expanding the path state. In the example shown in the table, "Palace Museum" has the highest overall gain and is therefore selected to be added to the path. The new path state is updated to: attraction sequence "Hotel -> Palace Museum". The cumulative time spent increases the Palace Museum visit time and travel cost, the cumulative expenditure increases the ticket price, and the current location is updated to the Palace Museum coordinates.
[0113] In some embodiments, the iterative process is repeated, with the next iteration starting from "Palace Museum". The algorithm again filters the set of candidate subsequent attractions reachable from Palace Museum based on the spatial proximity matrix, which may include "Jingshan Park", "Beihai Park", and "Quanjude (Wangfujing Branch)". For each candidate in the set, the comprehensive gain after adding it to the current path is calculated again. At this time, the time connection cost needs to consider the matching of the Palace Museum's departure time and the candidate attraction's opening time, the spatial movement cost is calculated based on the distance from the Palace Museum to the candidate point, and the theme coherence gain needs to calculate the correlation strength from "historical site" (Palace Museum) to the candidate attraction category. Assuming that "Jingshan Park" has the highest comprehensive gain after calculation, the path is expanded to "hotel -> Palace Museum -> Jingshan Park". The iterative process is repeated until the path meets the preset termination conditions, which include reaching the maximum number of attractions, the total time or total cost exceeding the budget, or no reachable candidate subsequent attractions. For example, a maximum of 4 attractions can be set, and iteration stops when 4 attractions are already included in the route; alternatively, when expanding to include the next attraction, if the total time exceeds the user's set budget of 10 hours, then further expansion along this route stops. All complete routes generated during the expansion process are recorded, forming a set of personalized travel route options. Optionally, in each iteration, the K candidate attractions with the highest overall gain can be selected for parallel route expansion to explore more possible route combinations.
[0114] In one embodiment of the present invention, the result processing module performs feasibility constraint filtering and diversity ranking on the personalized travel route plan set to generate a final recommendation list. It obtains the user-defined hard constraints, including total time budget, total cost budget, a list of must-see attractions, and unacceptable activity types. Each route plan in the personalized travel route plan set is compared with the hard constraints, filtering out any route plan that does not meet any of the hard constraints, resulting in a set of candidate feasible route plans. For each route plan in the candidate feasible route plan set, its diversity score is calculated, based on the overlap of attractions, differences in activity type distribution, and differences in route structure among the route plans. The route plans in the candidate feasible route plan set are sorted in descending order according to the diversity scores. The top few route plans are selected from the sorted list to form the final recommendation list.
[0115] In practice, the results processing module performs feasibility constraint filtering and diversity ranking on the personalized travel route plan set. The following example scenario describes the process of generating the final recommendation list. Example user plans a one-day trip to Beijing. The route generation module produces a set of 10 personalized travel route plans containing different combinations of attractions and activities. The user's hard constraints include: total time budget not exceeding 10 hours, total cost budget not exceeding 800 yuan, the "Palace Museum" being a must-see attraction, and "large amusement parks" and "long-distance hiking" being unacceptable activities.
[0116] In practice, the system obtains the user-defined hard constraints, including total time budget, total cost budget, a list of must-see attractions, and unacceptable activity types. Each route in the personalized travel itinerary set is compared against these hard constraints, filtering out any that do not meet them. For example, a route including "Universal Beijing Resort" (a "large amusement park") is filtered out because it violates the "unacceptable activity type" constraint; another route with an estimated total time of 11 hours or a total cost of 1000 yuan is filtered out because it exceeds the time or budget constraints; and a route that does not include "The Palace Museum" is filtered out because it does not meet the must-see attraction requirement. Through this process of comparison and filtering, a set of five candidate feasible route options is obtained, all of which satisfy all hard constraints.
[0117] In some embodiments, a diversity score is calculated for each route in the set of candidate feasible route options. The diversity score is calculated based on the degree of overlap of attractions, differences in activity type distribution, and differences in route structure among the route options. The degree of overlap of attractions is calculated using the Jaccard similarity coefficient to determine the degree of overlap between the sets of attractions of any two routes; the overall attraction overlap score for a route is the average of its attraction overlap scores with all other routes in the set. Differences in activity type distribution are determined by calculating the time percentage of each type of activity (e.g., "historical sites," "gardens," "dining," "shopping") on each route, and then comparing the cosine distance or Euclidean distance between the activity type distribution vectors of any two routes. Differences in route structure are determined by comparing the sequential similarity of the route sequences, for example, using edit distance based on the attraction sequence or by comparing structural features specifically targeting the turning points, regional distribution, etc., of the tourist routes. It can be understood that the diversity score is a comprehensive indicator designed to quantify the degree of difference between route options from multiple dimensions, including attraction selection, activity arrangement, and spatial tour sequence.
[0118] The formula for calculating the diversity score is:
[0119]
[0120] in: The score represents the diversity of a single route option. The higher the score, the greater the overall difference and uniqueness of the route compared to other routes in the set. This indicates the average degree of overlap in attractions between this route and all other routes in the set of candidate feasible routes. It represents the reciprocal of the difference between the average activity type distribution of this route and all other routes in the set (for ease of calculation, the distribution similarity is usually calculated first and then inverted). It represents the reciprocal of the difference in average path structure between this route and all other routes in the set. It is a coefficient used to balance the weights of three factors: overlap of attractions, differences in the distribution of activity types, and differences in route structure, and satisfies the following conditions: During the calculation, first calculate the value of each route i separately. , , Then, substitute the values into the formula to obtain its diversity score. .
[0121] In implementation, the route options in the candidate feasible route set are sorted in descending order based on their diversity scores. Assume the diversity scores of the five candidate routes are calculated and ranked as follows: Route D (score 0.85), Route A (score 0.78), Route E (score 0.70), Route B (score 0.65), and Route C (score 0.60). After sorting, Route D, with the highest diversity score, is placed at the top of the list, and Route C, with the lowest score, is placed at the bottom. The top few route options are selected from the sorted list to form the final recommendation list. For example, if the system presets a recommendation quantity of 3 routes, then the top three sorted routes, namely Route D, Route A, and Route E, are selected to form the final recommendation list. Optionally, when the final recommendation list is pushed to users, it can be sorted from highest to lowest diversity score, or a mixed sort can be used, combining the original matching scores. Optionally, when displayed on the target user's terminal device, each route will be accompanied by a key information overview, such as total time, total cost, and a sequence of key attractions. The generation of the recommendation list ensures that, while meeting all the user's hard requirements, it provides the user with a set of differentiated options in terms of attractions, activities, and tour structure, thus avoiding the problem of overly homogenized recommendation results.
[0122] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A personalized travel route recommendation system based on AI matrix algorithm, characterized in that, The system includes: The data acquisition module acquires the target user's personal characteristic data, historical behavior data, and real-time scene data. The personal characteristic data includes user profile tags and explicit preference statements. The historical behavior data includes multi-dimensional historical travel records and implicit feedback sequences. The real-time scene data includes geographical location, time, and weather. The vector generation module performs an improved multi-head attention algorithm on the historical behavior data and real-time scene data to generate dynamic user interest vectors. The improved multi-head attention algorithm optimizes the attention weight allocation based on time decay and scene relevance. It also performs feature fusion and embedding processing on the personal feature data to generate static user profile vectors. The route generation module inputs the dynamic user interest vector and the static user profile vector into the tourism route AI matrix algorithm model. The tourism route AI matrix algorithm model performs multiple rounds of iterative matching and path optimization in the candidate scenic spot and activity matrix to generate a set of personalized tourism route schemes. The results processing module performs feasibility constraint filtering and diversity sorting on the personalized travel route plan set, generates a final recommendation list, and pushes the final recommendation list to the target user's terminal device for display.
2. The personalized travel route recommendation system based on AI matrix algorithm according to claim 1, characterized in that, An improved multi-head attention algorithm is applied to the historical behavior data and real-time scene data to generate dynamic user interest vectors, including: The multi-dimensional historical itinerary records are analyzed to extract the sequence of attractions, the sequence of stay duration, and the sequence of activity types for each itinerary. The implicit feedback sequence is then quantified to generate a time series of interest intensity. The scenic spot sequence and activity type sequence are mapped into high-dimensional embedding vectors, and then concatenated with the interest intensity time sequence and stay duration sequence to form a historical behavior feature tensor. The real-time scene data is encoded into a scene feature vector; The historical behavior feature tensor and the scene feature vector are input into the improved multi-head attention algorithm. The improved multi-head attention algorithm is computed in parallel by multiple independent attention heads. Each attention head focuses on the part of the historical behavior feature tensor that is highly correlated with the dimension of the specific scene feature vector. When allocating attention weights, the improved multi-head attention algorithm introduces a time decay function to apply low weights to historical behavioral features from a long time ago, and introduces a scene correlation function to apply high weights to behavioral features from historical scenes that are similar to the current scene feature vector. The outputs of all attention heads are concatenated and linearly transformed to generate the dynamic user interest vector that represents the user's real-time interest orientation in the current scene.
3. The personalized travel route recommendation system based on AI matrix algorithm according to claim 1, characterized in that, The personal feature data is subjected to feature fusion and embedding processing to generate a static user profile vector, including: The user profile tags are multi-hot encoded to generate tag feature vectors; The explicit preference statement is subjected to text analysis and sentiment analysis to extract preference keywords and their sentiment polarities. Each preference keyword is mapped to a word vector and combined with the sentiment polarity in a weighted manner to generate a preference feature vector. The label feature vector and the preference feature vector are input into a feature fusion network, which learns the implicit relationship between labels and preferences through fully connected layers and nonlinear cross transformations. The fused features output by the feature fusion network are reduced in dimensionality and smoothed by a pooling layer, resulting in a static user profile vector with fixed dimensions.
4. The personalized travel route recommendation system based on AI matrix algorithm according to claim 1, characterized in that, The dynamic user interest vector and static user profile vector are input into the tourism route AI matrix algorithm model. The model then performs multiple rounds of iterative matching and path optimization within the candidate attraction and activity matrix to generate a set of personalized tourism route solutions, including: Construct a candidate attraction and activity matrix, where each row of the matrix represents a candidate attraction or activity, and each column represents an attribute dimension, including category, price, duration, popularity, and seasonal suitability. The dynamic user interest vector and the static user profile vector are concatenated to form a comprehensive user vector; In the AI matrix algorithm model for the tourism route, the comprehensive user vector is multiplied by the candidate attraction and activity matrix to calculate the initial matching score of the user corresponding to each candidate attraction or activity. Based on the initial matching score, and combined with the spatial distance, temporal connection logic and thematic coherence between attractions, multiple rounds of iterative path optimization are performed in the solution space defined by the matrix. The multiple rounds of iterative path optimization process simulates path search, and each iteration selects and expands the currently locally optimal path node. After multiple iterations, several complete travel routes from the starting point to the destination, including different combinations of attractions and activities, are generated as the set of personalized travel route schemes.
5. A personalized travel route recommendation system based on AI matrix algorithm according to claim 4, characterized in that, Based on the initial matching score, and considering the spatial distance between attractions, temporal connection logic, and thematic coherence, multiple rounds of iterative path optimization are performed within the solution space defined by the matrix, including: Define the path status, which includes the currently visited sequence of attractions, the cumulative time spent, the cumulative cost, and the current location; The initial path state is a sequence containing only the starting point; In each iteration, starting from the last attraction in the current path state, a set of reachable candidate subsequent attractions is selected based on the spatial proximity matrix; For each attraction in the candidate set of subsequent attractions, calculate its overall gain after being added to the current path. The overall gain is determined by the attraction's initial matching score, the time connection cost with the previous attraction, the spatial movement cost, and the theme coherence gain. Select one or more candidate attractions with the highest overall gain and add them to the current path to expand the new path status; The iterative process is repeated until the path meets the preset termination conditions, which include reaching the maximum number of attractions, the total time or total cost exceeding the budget, or no reachable candidate attractions. Record all complete paths generated during the expansion process to form the personalized travel route scheme set.
6. The personalized travel route recommendation system based on AI matrix algorithm according to claim 1, characterized in that, The personalized travel route options are filtered for feasibility constraints and ranked for diversity to generate a final recommendation list, including: Obtain the hard constraints set by the user, including total time budget, total cost budget, a list of must-see attractions, and unacceptable types of activities; Each route in the personalized travel route scheme set is compared with the hard constraints, and any route scheme that does not meet the hard constraints is filtered out to obtain a set of candidate feasible route schemes. For each route in the set of candidate feasible route options, a diversity score is calculated. The diversity score is calculated based on the overlap of attractions, the difference in the distribution of activity types, and the difference in the path structure among the route options. The route options in the candidate feasible route option set are sorted in descending order based on the diversity score; The top few route options are selected from the sorted list to form the final recommendation list.
7. A personalized travel route recommendation system based on AI matrix algorithm according to claim 2, characterized in that, The improved multi-head attention algorithm introduces a time decay function to apply low weights to historical behavioral features from long ago, and introduces a scene relevance function, including: The time decay function adopts an exponential decay form. Its input is the time difference between the time when the historical behavior occurred and the current time, and its output is a decay coefficient between zero and one. The larger the time difference, the smaller the decay coefficient. The scene correlation function calculates the cosine similarity between the scene feature vector when the historical behavior occurred and the scene feature vector obtained by encoding the current real-time scene data. The cosine similarity is then mapped to a correlation weight through a scaling and translation function. When calculating the attention weight corresponding to each historical behavior feature, the decay coefficient is multiplied by the correlation weight to obtain the base weight, which is then subjected to standard attention Softmax normalization to obtain the final attention weight.
8. A personalized travel route recommendation system based on AI matrix algorithm according to claim 3, characterized in that, The feature fusion network learns the implicit association between labels and preferences through fully connected layers and nonlinear cross-transformations, including: The label feature vector is input into the first fully connected layer for nonlinear transformation, and the first hidden feature vector is output. The preference feature vector is input into the second fully connected layer for nonlinear transformation, and the second hidden feature vector is output. A cross-transformation process is performed on the first hidden feature vector and the second hidden feature vector. The cross-transformation process generates an interaction matrix through an outer product operation. The interaction matrix is then vectorized to obtain the cross feature vector. The first hidden feature vector, the second hidden feature vector, and the cross feature vector are concatenated to form a fused feature vector; The fused feature vector is input into the third fully connected layer, and a nonlinear transformation is performed through an activation function to output the fused features of the feature fusion network.
9. A personalized travel route recommendation system based on AI matrix algorithm according to claim 4, characterized in that, The spatial distance, temporal connection logic, and thematic coherence between attractions defined and used in the AI matrix algorithm model for the tourist route include: The spatial distance is calculated based on the latitude and longitude coordinates of the scenic spot using Euclidean distance or actual road network distance, and then converted into estimated travel time. The time connection logic checks whether the opening times of two attractions overlap, and whether the time required to leave the first attraction and move to the second attraction is within the opening time window of the second attraction. The theme coherence is based on the category labels of attractions and activities. The relevance or naturalness of the transition between two attractions is calculated through a predefined theme map, which defines the strength of association between different categories.
10. A personalized travel route recommendation system based on AI matrix algorithm according to claim 5, characterized in that, The calculation of the overall gain after adding it to the current path includes: Calculate the initial matching score of the attractions as the base revenue; Calculate the time connection cost and spatial movement cost required to add attractions to the current route. The time connection cost is calculated based on the matching degree of the opening time window, and the spatial movement cost is calculated based on spatial distance and mode of transportation conversion. Calculate the theme coherence gain resulting from adding attractions to the current path, which is measured by comparing the change in theme consistency before and after the addition. Set weighting coefficients for basic revenue, time connection cost, spatial movement cost, and thematic coherence gain; Based on the aforementioned weighting coefficients, the basic gain is summed with the theme coherence gain, and then the time connection cost and spatial movement cost are subtracted to obtain the overall gain.