A generative route recommendation method based on energy-guided spatio-temporal diffusion model

CN122925762APending Publication Date: 2026-10-16QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611416840.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-14
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

这种静态权重无法适应动态序列上下文的变化,导致不同类型的异构信息在处理时容易相互干扰,无法精准捕捉用户个性化移动模式的本质特征

Benefits of technology

[0016] The beneficial effects of this invention are as follows: It employs a trajectory diffusion generation method based on variance-preserving stochastic differential equations, replacing traditional autoregressive sequential generation with a globally parallel iterative denoising process, fundamentally solving the problem of irreversible error accumulation and propagation in long trajectory recommendations. An energy-based generation process guidance mechanism is designed, transforming geographical distance, temporal category preference, and POI transfer patterns into differentiable energy functions. Combined with time-varying guidance intensity, a penalty gradient is dynamically injected into the diffusion evolution step, solving the problem of continuous neural networks' difficulty in effectively integrating discrete physical hard constraints and avoiding heuristic post-processing operations that disrupt end-to-end consistency. A multi-view conditional representation learning module is used to fuse spatial adjacency graphs and semantic hypergraphs, enabling the model to deeply integrate POI geographical information and high-order semantic features. A masked trajectory modeling task is designed to enhance the model's ability to represent the spatiotemporal dependencies of complex trajectory contexts. Subsequently, through hypergraph contrastive learning, the model can automatically learn highly discriminative and robust user global travel preferences from sparse, unlabeled historical trajectories, effectively capturing the essential characteristics of personalized travel patterns. To address the issue that static weights in traditional conditional generation cannot adapt to dynamic sequence changes, we designed a step-level additive attention mechanism. This mechanism adaptively and intelligently integrates POI features, user global representations, and sequence features by querying the trajectory context. Simultaneously, in the downstream recommendation task, we perform a physical probability mapping with temperature scaling, combining the user-provided start and end points and expected trajectory length information to recommend complete travel routes that satisfy both spatiotemporal constraints and highly align with the user's personal intentions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure QLYQS_11
    Figure QLYQS_11
  • Figure QLYQS_13
    Figure QLYQS_13
  • Figure QLYQS_14
    Figure QLYQS_14
Patent Text Reader

Abstract

The application discloses a generative route recommendation method based on an energy guidance space-time diffusion model, and relates to the technical field of artificial intelligence.The method comprises the following steps: firstly, a multi-view graph encoder is constructed to fuse a spatial adjacency graph and a semantic hypergraph of interest points, and a double self-supervised pre-training is combined to synchronously extract global preferences and local sequence dynamic characteristics of a user;secondly, a dynamic attention mechanism is used to adaptively integrate spatial, semantic and user-specific characteristics to generate a conditional prior representation;then, a diffusion probability model based on a stochastic differential equation is constructed to globally and in parallel denoise and evolve a trajectory sequence in a continuous latent space;finally, an adaptive energy guidance mechanism is introduced to convert geographical, time and behavior constraints into a differentiable energy gradient, which is directly injected into a denoising process for real-time correction, so that a complete travel route with high accuracy and meeting physical constraints is generated for a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically to a generative route recommendation method based on an energy-guided spatiotemporal diffusion model. Background Technology

[0002] With the widespread popularity of location-based social networks such as Twitter, Flickr, and Gaode Maps, a vast amount of information with time and geographic location tags has been generated, providing a massive data foundation for research in the field of travel route recommendation. Unlike traditional single-location recommendations, travel route recommendation is essentially a highly complex sequence generation problem. Its main purpose is to provide users with a complete travel route consisting of a series of points of interest, based on a set of query conditions provided by the user.

[0003] Traditional methods for recommending travel routes often rely on autoregressive approaches, treating trajectories as discrete points of interest (POIs) and focusing on historical sequential behavior between POIs, such as early collaborative filtering and Markov models. These methods primarily depend on explicit statistical properties for modeling, making it difficult to uncover deep spatiotemporal dependencies between POIs. Furthermore, in situations with sparse data, they are prone to providing recommendations that deviate from tourists' true intentions.

[0004] With the development of deep learning, autoregressive generative models based on recurrent neural networks (RNNs) and attention mechanisms have been widely applied in route planning. However, current research and applications still face several key challenges: First, most existing deep learning route recommendation methods employ an autoregressive sequential generation paradigm. In such models, the current prediction heavily relies on the output of preceding steps. This generation mechanism suffers from irreversible error accumulation and propagation. When facing long-trajectory recommendation scenarios, early single-step prediction errors are amplified as the sequence length increases, leading to highly unreasonable final routes and severely impacting the global coherence of the routes. Second, travel route recommendation not only needs to capture user preferences but also must meet the actual physical constraints of user travel. Continuous deep neural network models often struggle to directly and effectively integrate these discrete physical constraints. To compensate for this deficiency, existing methods typically employ heuristic post-processing operations, but this directly disrupts the consistency of end-to-end training, limiting the model's performance in complex spatial relationship modeling. Finally, regarding feature fusion and user preference representation, existing models struggle to automatically learn highly discriminative and robust global travel preferences when faced with sparse, unlabeled historical trajectories. Meanwhile, traditional conditional generation models often employ static weight allocation strategies when integrating spatial information, semantic features, and user preferences. This static weighting cannot adapt to changes in the dynamic sequence context, leading to easy interference between different types of heterogeneous information during processing, and failing to accurately capture the essential characteristics of users' personalized travel patterns. In summary, overcoming the error accumulation problem caused by traditional autoregressive models and seamlessly and differentiably integrating discrete, real-world physical constraints into the end-to-end generation process to generate highly accurate, coherent, and fully realistic travel routes for users has become a pressing technical challenge in this field. Summary of the Invention

[0005] To overcome the shortcomings of the above technologies, this invention provides an effective solution to the error accumulation problem in long trajectory generation, and can seamlessly integrate real-world physical constraints into the end-to-end generation process, thereby providing a more coherent, accurate, and realistic generative route recommendation method based on an energy-guided spatiotemporal diffusion model.

[0006] The technical solution adopted by this invention to overcome its technical problems is: A generative route recommendation method based on an energy-guided spatiotemporal diffusion model, characterized by comprising: S1. Obtain A set of latitude and longitude information is constructed by taking one POI point, the category corresponding to each POI point, and the latitude and longitude information corresponding to each POI point. Historical check-in tracking data POI point set Time set Historical check-in category collection ; S2. Using latitude and longitude information sets for Historical check-in tracking data POI point set Time set Historical check-in category collection Construct the geographic distance matrix Spatial connectivity graph Semantic hypergraph Transition probability matrix Time-Category Matrix User-level diagram ; S3. Construct a DiffTrip model consisting of a multi-view conditional representation learning module and a trajectory diffusion generation module. The multi-view conditional representation learning module consists of a spatial graph encoder, a contrastive learning branch, a sequence modeling branch, and a dynamic feature fusion module. S4. Connect the spatial graph Semantic hypergraph The input is fed into the spatial graph encoder of the multi-view conditional representation learning module of the DiffTrip model, and the output is the POI representation. ; S5. Transform the user-level graph The input is fed into the contrastive learning branch of the multi-view conditional representation learning module, and the output is the global user representation. ; S6. Collect historical check-in records Historical check-in category collection Time set The input is fed into the sequence modeling branch of the multi-view conditional representation learning module, and the output is a local sequence representation. ; S7. Represent POI Global User Representation Local sequence representation The input is fed into the dynamic feature fusion module of the multi-view conditional representation learning module, and the output is the final allowed prior representation. ; S8. Set the historical check-in history. The final allowed prior representation Geographic distance matrix Transition probability matrix Time-Category Matrix The input is fed into the trajectory diffusion generation module of the DiffTrip model, and the output is a probability matrix. ; S9. User inputs query criteria Using probability matrices Get the recommended complete travel itinerary .

[0007] In step S1, obtain from the Flickr dataset Each POI, its category, its latitude and longitude coordinates, and its user set. ,user Trajectory set, category set , , For the first One user, , For the number of users, A set of POI points consists of several POI points. , ,in For the first The POI point, the ... The latitude and longitude information corresponding to each POI point is: , Latitude and longitude information set , , , For the first The categories of POI points , For the total number of categories, the first The trajectory set of each user is , ,in For the first The first user's A sequence of trajectories, , For the first individual users The number of trajectories, ,in For the first individual users The The first of the trajectories A check-in location, , , For the first The first user's The number of locations visited in each trajectory, all The set of each user's trajectory constitutes the historical check-in trajectory set. , , No. individual users Visit the The first trajectory Each check-in location The time is , No. individual users Visit the The time set of each trajectory is , , No. individual users Access all The time set of each trajectory is , ,all The time set of each user is , , No. individual users Visit the The first trajectory Each check-in location The category is , , No. The first user's The set of categories for each trajectory is , , No. All users The set of categories for each trajectory is , ,all The set of categories for each user constitutes the set of historical check-in categories. , .

[0008] Furthermore, step S2 includes the following steps: S2-1. Calculate the latitude and longitude information set using the Haversine formula. The Middle Latitude and longitude information corresponding to each POI point and the Latitude and longitude information corresponding to each POI point spherical distance between spherical distance Normalization is performed to obtain the normalized spatial proximity. , build OK Geographic distance matrix of columns Geographic distance matrix The Middle Line number The elements of the column are normalized spatial proximity. , , ; S2-2. When the spherical distance At that time, the first The POI point and the A set of POI points to be inserted into nodes , will the The POI point and the The set of connected edges inserted from each POI point To obtain a spatially connected graph , ; S2-3. Traverse the historical check-in trajectory set Statistically analyze the trajectory sequences of each user from the first... Points of Interest (POIs) To the Points of Interest (POIs) frequency The frequency is calculated using the first-order Markov transition probability formula. transition probability , build OK Transition probability matrix of columns transition probability matrix The Middle Line number The elements of the column are the transition probabilities. , , The K-nearest neighbor strategy is used to select the nearest neighbor with the first nearest neighbor. Points of Interest (POIs) The top 5 most frequent neighboring POIs are then compared with the 5 neighboring POIs. Points of Interest (POIs) The connected edges are respectively placed into the edge set. We obtain a semantic hypergraph that captures higher-order co-occurrence patterns. , ; S2-4. Traversing the POI set Time set Historical check-in category collection , obtained the All hours The number of users accessing the first Frequency of each category , , frequency Normalization is performed to obtain the normalized frequency. Build 48 lines Time-Category Matrix of Columns Time-Category Matrix The Middle Line number The elements of the column are frequencies. , ; S2-5. The first The first user's A trajectory sequence All check-in locations are grouped together into a single superedge, and the first... users The hyperedges formed by the trajectory sequences are inserted into the hyperedge set. In the middle, the first users After deduplicating all check-in locations in the trajectory sequence, insert them into the node set. In the process, the user-level graph is obtained. , .

[0009] Furthermore, step S4 includes the following steps: S4-1. The spatial graph encoder of the multi-view conditional representation learning module consists of a multi-head attention mechanism, a hypergraph convolutional network, a feature concatenation unit, a linear layer, a normalization layer, and a GELU activation function. S4-2. Set of POI points The input is fed into the embedding layer, and the output is the initial feature matrix. ; S4-3. Connect the spatial graphs and the initial feature matrix Input to the multi-view conditional representation learning module In a multi-head attention mechanism with multiple attention heads, the multi-head attention mechanism will be used. The aggregated feature vectors output by each attention head are concatenated along the feature dimensions to obtain the spatial representation. ; S4-4. Spatial Connectivity Graph and the initial feature matrix The input is fed into the hypergraph convolutional network of the multi-view conditional representation learning module, and the output is the semantic representation. ; S4-5. Representing Space With semantic representation The input features are concatenated along the feature dimension in the feature concatenation unit of the multi-view conditional representation learning module to obtain joint features. These joint features are then sequentially input into the linear layer, normalization layer, and GELU activation function of the multi-view conditional representation learning module, and the output is the POI representation. .

[0010] Furthermore, step S5 includes the following steps: S5-1. Calculate the user-level graph using the PageRank algorithm. For each check-in location, its importance score within the individual's visit history is used. The location with the lowest importance score undergoes the first data augmentation to obtain the augmented hypergraph. The first data enhancement is a random insertion, random deletion, random masking, or random truncation; S5-2. Calculating User-Level Graphs Using the PageRank Algorithm For each check-in, the importance score of the visited location in the individual's visit history is used. The visit location with the lowest importance score is then subjected to a second data augmentation to obtain the augmented hypergraph. The second data augmentation is a random insertion, random deletion, random masking, or random truncation, and the method of the second data augmentation is different from that of the first data augmentation. S5-3. The contrastive learning branch of the multi-view conditional representation learning module consists of a hypergraph convolutional network, an attention pooling layer, and an average pooling layer. S5-4. Enhanced Hypergraph With the initial feature matrix The input is fed into the hypergraph convolutional network of the contrastive learning branch, and the output is the final feature matrix. The enhanced hypergraph With the initial feature matrix The input is fed into the hypergraph convolutional network of the contrastive learning branch, and the output is the final feature matrix. ; S5-5. The final feature matrix The input is fed into the attention pooling layer of the contrastive learning branch, and the output is a graph-level user representation. The final feature matrix The input is fed into the attention pooling layer of the contrastive learning branch, and the output is a graph-level user representation. , to represent graph-level users Representation with graph-level users The input is fed into the average pooling layer of the contrastive learning branch, and the output is the global user representation. .

[0011] Furthermore, step S6 includes the following steps: S6-1. The sequence modeling branch of the multi-view conditional representation learning module consists of an embedding layer and an encoder of the Transformer model; S6-2. Set up historical check-in records The Middle The trajectory sequence is input into the embedding layer of the sequence modeling branch, and the output is the... POI embedding vectors of trajectory sequences , In the historical check-in category set Query the first The categories of all visited locations in the trajectory sequence are constructed to obtain the first category. The category sequence of the trajectory sequence is obtained by inputting the category set into the embedding layer of the sequence modeling branch, and the output is the _th_ trajectory sequence. The class embedding vector of a trajectory sequence In time set The query user accessed the first The time of all visited locations in the trajectory sequence, and all times are used to construct the first... The time series of the trajectory sequence is input into the embedding layer of the sequence modeling branch, and the output is the first time series. The time embedding vector of a trajectory sequence , will the POI embedding vectors of trajectory sequences Category embedding vector Temporal embedding vector Concatenate along the feature dimensions to obtain a vector. ,all The initial embedding of the trajectory sequence is composed of vectors of several trajectory sequences. ; S6-3. Initial embedding of trajectory sequences Perform random masking to obtain the masked embedding representation. ; S6-4. Embedded representation after masking The input is fed into the encoder of the Transformer model in the sequence modeling branch, and the output is a local sequence representation. .

[0012] Furthermore, step S7 includes the following steps: S7-1. The dynamic feature fusion module of the multi-view conditional representation learning module consists of a splicing unit and an attention mechanism; S7-2. Represent POI Global User Representation Local sequence representation The input is concatenated along the feature dimension in the concatenation unit of the dynamic feature fusion module to obtain the features. ; S7-3. Features With local sequence representation The input is fed into the attention mechanism of the dynamic feature fusion module, and the output is the weights. , , ; S7-4. General Formula The final allowed prior representation is calculated. .

[0013] Furthermore, step S8 includes the following steps: The trajectory diffusion generation module of the S8-1.DiffTrip model is composed of a diffusion model, and the Transformer model is used as the conditional denoising network for the diffusion model. S8-2. Set up historical check-in records The first in The first trajectory sequence is input into the embedding layer, and the output is the first... Initial feature matrix of a trajectory sequence , The forward noise pair of the initial feature matrix is ​​used with a diffusion model. From time step 1 to time step Add noise gradually, the first The noisy trajectory state matrix at each time step is: Time step The output is a pure noise matrix. , , No. The number of locations visited in the trajectory sequence is ; S8-3. Time step Trajectory state matrix The final allowed prior representation The time steps are input into the Transformer model of the diffusion model. The input is fed into the embedding layer, and the output is the temporal embedding. Embedding time Trajectory State Matrix After mapping to the same dimension, the features are added together to obtain the fused feature matrix. , will fuse feature matrix With the final allowed prior representation The input is fed into the cross-attention mechanism, and the output is the global spatiotemporal features. The global spatiotemporal features The input is fed into a fully connected layer, and the output is the time step. The original noise component matrix below ; S8-4. Transfer the trajectory state matrix With the initial feature matrix After calculating the inner product similarity, the result is fed into the Softmax activation function, which outputs the current continuous state mapped onto the discrete POI space. OK Column soft alignment probability distribution matrix Extract the soft alignment probability distribution matrix The Row as probability vector ; S8-5. Time step Trajectory State Matrix The input is fed into a multilayer perceptron, and the output is the adaptive weights of the geographic constraints. Adaptive weights with time constraints Adaptive weights for transition probability constraints Through formula The energy function was calculated. In the formula, For transpose, The soft alignment probability distribution matrix The The probability vector for row extraction; S8-6. On the energy function The energy gradient matrix is ​​obtained by differentiation. Through formula The time-varying guiding strength was calculated. In the formula, , ; S8-7. Through formula The target score function matrix is ​​calculated. ; S8-8. Target score function matrix Pure noise matrix The inverse integration process of the input to the diffusion model yields the denoised continuous trajectory state matrix. ; S8-9. Continuous trajectory state matrix and the initial feature matrix The input is fed into the mapping layer for inner product similarity calculation, yielding the logarithmic matrix of candidate probabilities for the sequence positions in the discrete POI space. The candidate probability logarithmic matrix Normalization is performed to obtain the probability matrix. .

[0014] Furthermore, in step S9, the user inputs the query conditions. , The POI point given by the user as the starting point. For the POI point given by the user as the destination, The query conditions will be based on the number of POIs provided by the user. Input probability matrix The recommended complete travel route is obtained through Top-k sampling. .

[0015] Furthermore, through the formula The total loss was calculated. In the formula, , , All of these are hyperparameters. For mean square error loss, For InfoNCE losses, For cross-entropy loss, the AdamW optimizer is used to utilize the total loss. Train the DiffTrip model.

[0016] The beneficial effects of this invention are as follows: It employs a trajectory diffusion generation method based on variance-preserving stochastic differential equations, replacing traditional autoregressive sequential generation with a globally parallel iterative denoising process, fundamentally solving the problem of irreversible error accumulation and propagation in long trajectory recommendations. An energy-based generation process guidance mechanism is designed, transforming geographical distance, temporal category preference, and POI transfer patterns into differentiable energy functions. Combined with time-varying guidance intensity, a penalty gradient is dynamically injected into the diffusion evolution step, solving the problem of continuous neural networks' difficulty in effectively integrating discrete physical hard constraints and avoiding heuristic post-processing operations that disrupt end-to-end consistency. A multi-view conditional representation learning module is used to fuse spatial adjacency graphs and semantic hypergraphs, enabling the model to deeply integrate POI geographical information and high-order semantic features. A masked trajectory modeling task is designed to enhance the model's ability to represent the spatiotemporal dependencies of complex trajectory contexts. Subsequently, through hypergraph contrastive learning, the model can automatically learn highly discriminative and robust user global travel preferences from sparse, unlabeled historical trajectories, effectively capturing the essential characteristics of personalized travel patterns. To address the issue that static weights in traditional conditional generation cannot adapt to dynamic sequence changes, we designed a step-level additive attention mechanism. This mechanism adaptively and intelligently integrates POI features, user global representations, and sequence features by querying the trajectory context. Simultaneously, in the downstream recommendation task, we perform a physical probability mapping with temperature scaling, combining the user-provided start and end points and expected trajectory length information to recommend complete travel routes that satisfy both spatiotemporal constraints and highly align with the user's personal intentions. Detailed Implementation

[0017] The present invention will be further described below.

[0018] A generative route recommendation method based on an energy-guided spatiotemporal diffusion model, characterized by comprising: S1. Obtain A set of latitude and longitude information is constructed by taking one POI point, the category corresponding to each POI point, and the latitude and longitude information corresponding to each POI point. Historical check-in tracking data POI point set Time set Historical check-in category collection .

[0019] S2. Using latitude and longitude information sets for Historical check-in tracking data POI point set Time set Historical check-in category collection Construct the geographic distance matrix Spatial connectivity graph Semantic hypergraph Transition probability matrix Time-Category Matrix User-level diagram .

[0020] S3. Construct a DiffTrip model consisting of a multi-view conditional representation learning module and a trajectory diffusion generation module. The multi-view conditional representation learning module consists of a spatial graph encoder, a contrastive learning branch, a sequence modeling branch, and a dynamic feature fusion module.

[0021] S4. Connect the spatial graph Semantic hypergraph The input is fed into the spatial graph encoder of the multi-view conditional representation learning module of the DiffTrip model, and the output is the POI representation. .

[0022] S5. Transform the user-level graph The input is fed into the contrastive learning branch of the multi-view conditional representation learning module, and the output is the global user representation. .

[0023] S6. Collect historical check-in records Historical check-in category collection Time set The input is fed into the sequence modeling branch of the multi-view conditional representation learning module, and the output is a local sequence representation. .

[0024] S7. Represent POI Global User Representation Local sequence representation The input is fed into the dynamic feature fusion module of the multi-view conditional representation learning module, and the output is the final allowed prior representation. .

[0025] S8. Set the historical check-in history. The final allowed prior representation Geographic distance matrix Transition probability matrix Time-Category Matrix The input is fed into the trajectory diffusion generation module of the DiffTrip model, and the output is a probability matrix. .

[0026] S9. User inputs query criteria Using probability matrices Get the recommended complete travel itinerary .

[0027] An adaptive energy guidance mechanism is introduced to transform geographical, temporal, and behavioral constraints into differentiable energy gradients, which are directly injected into the denoising process for real-time correction. This generates highly accurate and physically constrained complete travel routes for users.

[0028] In one embodiment of the present invention, step S1 involves obtaining data from the Flickr dataset. Each POI, its category, its latitude and longitude coordinates, and its user set. ,user Trajectory set, category set , , For the first One user, , For the number of users, A set of POI points consists of several POI points. , ,in For the first The POI point, the ... The latitude and longitude information corresponding to each POI point is: , Latitude and longitude information set , , , For the first The categories of POI points , For the total number of categories, the first The trajectory set of each user is , ,in For the first The first user's A sequence of trajectories, , For the first individual users The number of trajectories, ,in For the first individual users The The first of the trajectories A check-in location, , , For the first The first user's The number of locations visited in each trajectory, all The set of each user's trajectory constitutes the historical check-in trajectory set. , , No. individual users Visit the The first trajectory Each check-in location The time is , No. individual users Visit the The time set of each trajectory is , , No. individual users Access all The time set of each trajectory is , ,all The time set of each user is , , No. individual users Visit the The first trajectory Each check-in location The category is , , No. The first user's The set of categories for each trajectory is , , No. All users The set of categories for each trajectory is , ,all The set of categories for each user constitutes the set of historical check-in categories. , .

[0029] In one embodiment of the present invention, step S2 includes the following steps: S2-1. Calculate the latitude and longitude information set using the Haversine formula. The Middle Latitude and longitude information corresponding to each POI point and the Latitude and longitude information corresponding to each POI point spherical distance between spherical distance Normalization is performed to obtain the normalized spatial proximity. , build OK Geographic distance matrix of columns Geographic distance matrix The Middle Line number The elements of the column are normalized spatial proximity. , , .

[0030] S2-2. When the spherical distance When this occurs, it indicates that there is a connected edge between the two, and the first edge is... The POI point and the A set of POI points to be inserted into nodes , will the The POI point and the The set of connected edges inserted from each POI point To obtain a spatially connected graph , .

[0031] S2-3. Traverse the historical check-in trajectory set Statistically analyze the trajectory sequences of each user from the first... Points of Interest (POIs) To the Points of Interest (POIs) frequency The frequency is calculated using the first-order Markov transition probability formula. transition probability , build OK Transition probability matrix of columns transition probability matrix The Middle Line number The elements of the column are the transition probabilities. , , The K-nearest neighbor strategy is used to select the nearest neighbor with the first nearest neighbor. Points of Interest (POIs) The top 5 most frequent neighboring POIs are then compared with the 5 neighboring POIs. Points of Interest (POIs) The connected edges are respectively placed into the edge set. We obtain a semantic hypergraph that captures higher-order co-occurrence patterns. , .

[0032] S2-4. Traversing the POI set Time set Historical check-in category collection , obtained the All hours The number of users accessing the first Frequency of each category , , frequency Normalization is performed to obtain the normalized frequency. Build 48 lines Time-Category Matrix of Columns Time-Category Matrix The Middle Line number The elements of the column are frequencies. , .

[0033] S2-5. The first The first user's A trajectory sequence All check-in locations are grouped together into a single superedge, and the first... users The hyperedges formed by the trajectory sequences are inserted into the hyperedge set. In the middle, the first users After deduplicating all check-in locations in the trajectory sequence, insert them into the node set. In the process, the user-level graph is obtained. , .

[0034] In one embodiment of the present invention, step S4 includes the following steps: S4-1. The spatial graph encoder of the multi-view conditional representation learning module consists of a multi-head attention mechanism, a hypergraph convolutional network, a feature concatenation unit, a linear layer, a normalization layer, and a GELU activation function.

[0035] S4-2. Set of POI points The input is fed into the embedding layer, and the output is the initial feature matrix. .

[0036] S4-3. Connect the spatial graphs and the initial feature matrix Input to the multi-view conditional representation learning module In a multi-head attention mechanism with multiple attention heads, the multi-head attention mechanism will be used. The aggregated feature vectors output by each attention head are concatenated along the feature dimensions to obtain the spatial representation. .

[0037] S4-4. Spatial Connectivity Graph and the initial feature matrix The input is fed into the hypergraph convolutional network of the multi-view conditional representation learning module, and the output is the semantic representation. .

[0038] S4-5. Representing Space With semantic representation The input features are concatenated along the feature dimension in the feature concatenation unit of the multi-view conditional representation learning module to obtain joint features. These joint features are then sequentially input into the linear layer, normalization layer, and GELU activation function of the multi-view conditional representation learning module, and the output is the POI representation. .

[0039] In one embodiment of the present invention, step S5 includes the following steps: S5-1. Calculate the user-level graph using the PageRank algorithm. For each check-in location, its importance score within the individual's visit history is used. The location with the lowest importance score undergoes the first data augmentation to obtain the augmented hypergraph. The first data enhancement is a random insertion, random deletion, random masking, or random truncation.

[0040] S5-2. Calculating User-Level Graphs Using the PageRank Algorithm For each check-in, the importance score of the visited location in the individual's visit history is used. The visit location with the lowest importance score is then subjected to a second data augmentation to obtain the augmented hypergraph. The second data augmentation is a random insertion, random deletion, random masking, or random truncation, and the method of the second data augmentation is different from that of the first data augmentation.

[0041] S5-3. The contrastive learning branch of the multi-view conditional representation learning module consists of a hypergraph convolutional network, an attention pooling layer, and an average pooling layer.

[0042] S5-4. Enhanced Hypergraph With the initial feature matrix The input is fed into the hypergraph convolutional network of the contrastive learning branch, and the output is the final feature matrix. The enhanced hypergraph With the initial feature matrix The input is fed into the hypergraph convolutional network of the contrastive learning branch, and the output is the final feature matrix. .

[0043] S5-5. The final feature matrix The input is fed into the attention pooling layer of the contrastive learning branch, and the output is a graph-level user representation. The final feature matrix The input is fed into the attention pooling layer of the contrastive learning branch, and the output is a graph-level user representation. , to represent graph-level users Representation with graph-level users The input is fed into the average pooling layer of the contrastive learning branch, and the output is the global user representation. .

[0044] In one embodiment of the present invention, step S6 includes the following steps: S6-1. The sequence modeling branch of the multi-view conditional representation learning module consists of an embedding layer and an encoder of the Transformer model.

[0045] S6-2. Set up historical check-in records The Middle The trajectory sequence is input into the embedding layer of the sequence modeling branch, and the output is the... POI embedding vectors of trajectory sequences , In the historical check-in category set Query the first The categories of all visited locations in the trajectory sequence are constructed to obtain the first category. The category sequence of the trajectory sequence is obtained by inputting the category set into the embedding layer of the sequence modeling branch, and the output is the _th_ trajectory sequence. The class embedding vector of a trajectory sequence In time set The query user accessed the first The time of all visited locations in the trajectory sequence, and all times are used to construct the first... The time series of the trajectory sequence is input into the embedding layer of the sequence modeling branch, and the output is the first time series. The time embedding vector of a trajectory sequence , will the POI embedding vectors of trajectory sequences Category embedding vector Temporal embedding vector Concatenate along the feature dimensions to obtain a vector. ,all The initial embedding of the trajectory sequence is composed of vectors of several trajectory sequences. .

[0046] S6-3. Initial embedding of trajectory sequences Perform random masking to obtain the masked embedding representation. .

[0047] S6-4. Embedded representation after masking The input is fed into the encoder of the Transformer model in the sequence modeling branch, and the output is a local sequence representation. .

[0048] In one embodiment of the present invention, step S7 includes the following steps: S7-1. The dynamic feature fusion module of the multi-view conditional representation learning module consists of splicing units and attention mechanisms.

[0049] S7-2. Represent POI Global User Representation Local sequence representation The input is concatenated along the feature dimension in the concatenation unit of the dynamic feature fusion module to obtain the features. .

[0050] S7-3. Features With local sequence representation The input is fed into the attention mechanism of the dynamic feature fusion module, and the output is the weights. , , .

[0051] S7-4. General Formula The final allowed prior representation is calculated. .

[0052] In one embodiment of the present invention, step S8 includes the following steps: The trajectory diffusion generation module of the S8-1.DiffTrip model consists of a diffusion model, using the Transformer model as the conditional denoising network for the diffusion model.

[0053] S8-2. Set up historical check-in records The first in The first trajectory sequence is input into the embedding layer, and the output is the first... Initial feature matrix of a trajectory sequence , The forward noise pair of the initial feature matrix is ​​used with a diffusion model. From time step 1 to time step Add noise gradually, the first The noisy trajectory state matrix at each time step is: Time step The output is a pure noise matrix. , , No. The number of locations visited in the trajectory sequence is .

[0054] S8-3. Time step Trajectory state matrix The final allowed prior representation The time steps are input into the Transformer model of the diffusion model. The input is fed into the embedding layer, and the output is the temporal embedding. Embedding time Trajectory State Matrix After mapping to the same dimension, the features are added together to obtain the fused feature matrix. , will fuse feature matrix With the final allowed prior representation The input is fed into the cross-attention mechanism, and the output is the global spatiotemporal features. The global spatiotemporal features The input is fed into a fully connected layer, and the output is the time step. The original noise component matrix below .

[0055] S8-4. Transfer the trajectory state matrix With the initial feature matrix After calculating the inner product similarity, the result is fed into the Softmax activation function, which outputs the current continuous state mapped onto the discrete POI space. OK Column soft alignment probability distribution matrix Extract the soft alignment probability distribution matrix The Row as probability vector .

[0056] S8-5. Time step Trajectory State Matrix The input is fed into a multilayer perceptron, and the output is the adaptive weights of the geographic constraints. Adaptive weights with time constraints Adaptive weights for transition probability constraints Through formula The energy function was calculated. In the formula, For transpose, The soft alignment probability distribution matrix The The probability vector extracted from the row.

[0057] S8-6. On the energy function The energy gradient matrix is ​​obtained by differentiation. Through formula The time-varying guiding strength was calculated. In the formula, , .

[0058] S8-7. Through formula The target score function matrix is ​​calculated. .

[0059] S8-8. Target score function matrix Pure noise matrix The inverse integration process of the input to the diffusion model yields the denoised continuous trajectory state matrix. .

[0060] S8-9. Continuous trajectory state matrix and the initial feature matrix The input is fed into the mapping layer for inner product similarity calculation, yielding the logarithmic matrix of candidate probabilities for the sequence positions in the discrete POI space. The candidate probability logarithmic matrix Normalization is performed to obtain the probability matrix. .

[0061] In one embodiment of the present invention, in step S9, the user inputs query conditions. , The POI point given by the user as the starting point. For the POI point given by the user as the destination, The query conditions will be based on the number of POIs provided by the user. Input probability matrix The recommended complete travel route is obtained through Top-k sampling. .

[0062] In one embodiment of the present invention, through formula The total loss was calculated. In the formula, , , All of these are hyperparameters. For mean square error loss, For InfoNCE losses, For cross-entropy loss, the AdamW optimizer is used to utilize the total loss. Train the DiffTrip model.

[0063] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A generative route recommendation method based on an energy-guided spatiotemporal diffusion model, characterized in that, include: S1. Obtain A set of latitude and longitude information is constructed by taking one POI point, the category corresponding to each POI point, and the latitude and longitude information corresponding to each POI point. Historical check-in tracking data POI point set Time set Historical check-in category collection ; S2. Using latitude and longitude information sets for Historical check-in tracking data POI point set Time set Historical check-in category collection Construct the geographic distance matrix Spatial connectivity graph Semantic hypergraph Transition probability matrix Time-Category Matrix User-level diagram ; S3. Construct a DiffTrip model consisting of a multi-view conditional representation learning module and a trajectory diffusion generation module. The multi-view conditional representation learning module consists of a spatial graph encoder, a contrastive learning branch, a sequence modeling branch, and a dynamic feature fusion module. S4. Connect the spatial graph Semantic hypergraph The input is fed into the spatial graph encoder of the multi-view conditional representation learning module of the DiffTrip model, and the output is the POI representation. ; S5. Transform the user-level graph The input is fed into the contrastive learning branch of the multi-view conditional representation learning module, and the output is the global user representation. ; S6. Collect historical check-in records Historical check-in category collection Time set The input is fed into the sequence modeling branch of the multi-view conditional representation learning module, and the output is a local sequence representation. ; S7. Represent POI Global User Representation Local sequence representation The input is fed into the dynamic feature fusion module of the multi-view conditional representation learning module, and the output is the final allowed prior representation. ; S8. Set the historical check-in history. The final allowed prior representation Geographic distance matrix Transition probability matrix Time-Category Matrix The input is fed into the trajectory diffusion generation module of the DiffTrip model, and the output is a probability matrix. ; S9. User inputs query criteria Using probability matrices Get the recommended complete travel itinerary .

2. The generative route recommendation method based on the energy-guided spatiotemporal diffusion model according to claim 1, characterized in that: In step S1, obtain from the Flickr dataset Each POI, its category, its latitude and longitude coordinates, and its user set. ,user Trajectory set, category set , , For the first One user, , For the number of users, A set of POI points consists of several POI points. , ,in For the first The POI point, the ... The latitude and longitude information corresponding to each POI point is: , Latitude and longitude information set , , , For the first The categories of POI points , For the total number of categories, the first The trajectory set of each user is , ,in For the first The first user's A sequence of trajectories, , For the first individual users The number of trajectories, ,in For the first individual users The The first of the trajectories A check-in location, , , For the first The first user's The number of locations visited in each trajectory, all The set of each user's trajectory constitutes the historical check-in trajectory set. , , No. individual users Visit the The first trajectory Each check-in location The time is , No. individual users Visit the The time set of each trajectory is , , No. individual users Access all The time set of each trajectory is , ,all The time set of each user is , , No. individual users Visit the The first trajectory Each check-in location The category is , , No. The first user's The set of categories for each trajectory is , , No. All users The set of categories for each trajectory is , ,all The set of categories for each user constitutes the set of historical check-in categories. , .

3. The generative route recommendation method based on an energy-guided spatiotemporal diffusion model according to claim 2, characterized in that, Step S2 includes the following steps: S2-1. Calculate the latitude and longitude information set using the Haversine formula. The Middle Latitude and longitude information corresponding to each POI point and the Latitude and longitude information corresponding to each POI point spherical distance between spherical distance Normalization is performed to obtain the normalized spatial proximity. , build OK Geographic distance matrix of columns Geographic distance matrix The Middle Line number The elements of the column are normalized spatial proximity. , , ; S2-2. When the spherical distance At that time, the first The POI point and the A set of POI points to be inserted into nodes , will the The POI point and the The set of connected edges inserted from each POI point To obtain a spatially connected graph , ; S2-3. Traverse the historical check-in trajectory set Statistically analyze the trajectory sequences of each user from the first... Points of Interest (POIs) To the Points of Interest (POIs) frequency The frequency is calculated using the first-order Markov transition probability formula. transition probability , build OK Transition probability matrix of columns transition probability matrix The Middle Line number The elements of the column are the transition probabilities. , , The K-nearest neighbor strategy is used to select the nearest neighbor with the first nearest neighbor. Points of Interest (POIs) The top 5 most frequent neighboring POIs are then compared with the 5 neighboring POIs. Points of Interest (POIs) The connected edges are respectively placed into the edge set. We obtain a semantic hypergraph that captures higher-order co-occurrence patterns. , ; S2-4. Traversing the POI set Time set Historical check-in category collection , obtained the All hours The number of users accessing the first Frequency of each category , frequency Normalization is performed to obtain the normalized frequency. Build 48 lines Time-Category Matrix of Columns Time-Category Matrix The Middle Line number The elements of the column are frequencies. , ; S2-5. The first The first user's A trajectory sequence All check-in locations are grouped together into a single superedge, and the first... users The hyperedges formed by the trajectory sequences are inserted into the hyperedge set. In the middle, the first users After deduplicating all check-in locations in the trajectory sequence, insert them into the node set. In the process, the user-level graph is obtained. , .

4. The generative route recommendation method based on an energy-guided spatiotemporal diffusion model according to claim 2, characterized in that, Step S4 includes the following steps: S4-1. The spatial graph encoder of the multi-view conditional representation learning module consists of a multi-head attention mechanism, a hypergraph convolutional network, a feature concatenation unit, a linear layer, a normalization layer, and a GELU activation function. S4-2. Set of POI points The input is fed into the embedding layer, and the output is the initial feature matrix. ; S4-3. Connect the spatial graphs and the initial feature matrix Input to the multi-view conditional representation learning module In a multi-head attention mechanism with multiple attention heads, the multi-head attention mechanism will be used. The aggregated feature vectors output by each attention head are concatenated along the feature dimensions to obtain the spatial representation. ; S4-4. Spatial Connectivity Graph and the initial feature matrix The input is fed into the hypergraph convolutional network of the multi-view conditional representation learning module, and the output is the semantic representation. ; S4-5. Representing Space With semantic representation The input features are concatenated along the feature dimension in the feature concatenation unit of the multi-view conditional representation learning module to obtain joint features. These joint features are then sequentially input into the linear layer, normalization layer, and GELU activation function of the multi-view conditional representation learning module, and the output is the POI representation. .

5. The generative route recommendation method based on the energy-guided spatiotemporal diffusion model according to claim 4, characterized in that, Step S5 includes the following steps: S5-1. Calculate the user-level graph using the PageRank algorithm. For each check-in location, its importance score within the individual's visit history is used. The location with the lowest importance score undergoes the first data augmentation to obtain the augmented hypergraph. The first data enhancement is a random insertion, random deletion, random masking, or random truncation; S5-2. Calculating User-Level Graphs Using the PageRank Algorithm For each check-in, the importance score of the visited location in the individual's visit history is used. The visit location with the lowest importance score is then subjected to a second data augmentation to obtain the augmented hypergraph. The second data augmentation is a random insertion, random deletion, random masking, or random truncation, and the method of the second data augmentation is different from that of the first data augmentation. S5-3. The contrastive learning branch of the multi-view conditional representation learning module consists of a hypergraph convolutional network, an attention pooling layer, and an average pooling layer. S5-4. Enhanced Hypergraph With the initial feature matrix The input is fed into the hypergraph convolutional network of the contrastive learning branch, and the output is the final feature matrix. The enhanced hypergraph With the initial feature matrix The input is fed into the hypergraph convolutional network of the contrastive learning branch, and the output is the final feature matrix. ; S5-5. The final feature matrix The input is fed into the attention pooling layer of the contrastive learning branch, and the output is a graph-level user representation. The final feature matrix The input is fed into the attention pooling layer of the contrastive learning branch, and the output is a graph-level user representation. , to represent graph-level users Representing graph-level users The input is fed into the average pooling layer of the contrastive learning branch, and the output is the global user representation. .

6. The generative route recommendation method based on an energy-guided spatiotemporal diffusion model according to claim 2, characterized in that, Step S6 includes the following steps: S6-1. The sequence modeling branch of the multi-view conditional representation learning module consists of an embedding layer and an encoder of the Transformer model; S6-2. Set up historical check-in records The Middle The trajectory sequence is input into the embedding layer of the sequence modeling branch, and the output is the... POI embedding vectors of trajectory sequences , In the historical check-in category set Query the first The categories of all visited locations in the trajectory sequence are constructed to obtain the first category. The category sequence of the trajectory sequence is obtained by inputting the category set into the embedding layer of the sequence modeling branch, and the output is the _th_ trajectory sequence. The class embedding vector of a trajectory sequence In time set The query user accessed the first The time of all visited locations in the trajectory sequence, and all times are used to construct the first... The time series of the trajectory sequence is input into the embedding layer of the sequence modeling branch, and the output is the first time series. The time embedding vector of a trajectory sequence , will the POI embedding vectors of trajectory sequences Category embedding vector Temporal embedding vector Concatenate along the feature dimensions to obtain a vector. ,all The initial embedding of the trajectory sequence is composed of vectors of several trajectory sequences. ; S6-3. Initial embedding of trajectory sequences Perform random masking to obtain the masked embedding representation. ; S6-4. Embedded representation after masking The input is fed into the encoder of the Transformer model in the sequence modeling branch, and the output is a local sequence representation. .

7. The generative route recommendation method based on an energy-guided spatiotemporal diffusion model according to claim 1, characterized in that, Step S7 includes the following steps: S7-1. The dynamic feature fusion module of the multi-view conditional representation learning module consists of a splicing unit and an attention mechanism; S7-2. Represent POI Global User Representation Local sequence representation The input is concatenated along the feature dimension in the concatenation unit of the dynamic feature fusion module to obtain the features. ; S7-3. Features With local sequence representation The input is fed into the attention mechanism of the dynamic feature fusion module, and the output is the weights. , , ; S7-4. General Formula The final allowed prior representation is calculated. .

8. The generative route recommendation method based on the energy-guided spatiotemporal diffusion model according to claim 4, characterized in that, Step S8 includes the following steps: The trajectory diffusion generation module of the S8-1.DiffTrip model is composed of a diffusion model, and the Transformer model is used as the conditional denoising network for the diffusion model. S8-2. Set up historical check-in records The first in The first trajectory sequence is input into the embedding layer, and the output is the first... Initial feature matrix of a trajectory sequence , The forward noise pair of the initial feature matrix is ​​used with a diffusion model. From time step 1 to time step Add noise gradually, the first The noisy trajectory state matrix at each time step is: Time step The output is a pure noise matrix. , , No. The number of locations visited in the trajectory sequence is ; S8-3. Time step Trajectory state matrix The final allowed prior representation The time steps are input into the Transformer model of the diffusion model. The input is fed into the embedding layer, and the output is the temporal embedding. Embedding time Trajectory State Matrix After mapping to the same dimension, the features are added together to obtain the fused feature matrix. , will fuse feature matrix With the final allowed prior representation The input is fed into the cross-attention mechanism, and the output is the global spatiotemporal features. The global spatiotemporal features The input is fed into a fully connected layer, and the output is the time step. The original noise component matrix below ; S8-4. Transfer the trajectory state matrix With the initial feature matrix After calculating the inner product similarity, the result is fed into the Softmax activation function, which outputs the current continuous state mapped onto the discrete POI space. OK Column soft alignment probability distribution matrix Extract the soft alignment probability distribution matrix The Row as probability vector ; S8-5. Time step Trajectory State Matrix The input is fed into a multilayer perceptron, and the output is the adaptive weights of the geographic constraints. Adaptive weights with time constraints Adaptive weights for transition probability constraints Through formula The energy function was calculated. In the formula, For transpose, The soft alignment probability distribution matrix The The probability vector for row extraction; S8-6. On the energy function The energy gradient matrix is ​​obtained by differentiation. Through formula The time-varying guiding strength was calculated. In the formula, , ; S8-7. Through formula The target score function matrix is ​​calculated. ; S8-8. Target score function matrix Pure noise matrix The inverse integration process of the input to the diffusion model yields the denoised continuous trajectory state matrix. ; S8-9. Continuous trajectory state matrix and the initial feature matrix The input is fed into the mapping layer for inner product similarity calculation, yielding the logarithmic matrix of candidate probabilities for the sequence positions in the discrete POI space. The candidate probability logarithmic matrix Normalization is performed to obtain the probability matrix. .

9. The generative route recommendation method based on the energy-guided spatiotemporal diffusion model according to claim 2, characterized in that: In step S9, the user inputs the query criteria. , The POI point given by the user as the starting point. For the POI point given by the user as the destination, The query conditions will be based on the number of POIs provided by the user. Input probability matrix The recommended complete travel route is obtained through Top-k sampling. .

10. The generative route recommendation method based on the energy-guided spatiotemporal diffusion model according to claim 1, characterized in that: Through formula The total loss was calculated. In the formula, , , All of these are hyperparameters. For mean square error loss, For InfoNCE losses, For cross-entropy loss, the AdamW optimizer is used to utilize the total loss. Train the DiffTrip model.