Method for predicting next interest point of user based on deep learning and trajectory diagram
By constructing trajectory maps and learning user and location embedding representations using hierarchical graph convolutions, combining multi-task learning strategies, the problem of failure to fully utilize topological relationships and time period preferences in the prior art is solved, and more accurate predictions of users' next point of interest are achieved.
Patent Information
- Application Number
- CN202311505671.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2025-05-13
AI Technical Summary
Existing deep learning-based user next point of interest prediction methods fail to fully utilize the topological relationships between user historical visit locations and travel preference patterns that distinguish different time periods.
By constructing a global trajectory map and a sub-graph of user trajectory, using hierarchical graphs to convolutionize the learning location and the user's embedded representation, and modeling the user's historical travel records in periodic times, including long-term, short-term and medium-term preferences, combined with multi-task learning strategies for prediction.
This method can more accurately model the user's travel mode, make full use of historical access record information, improve prediction effect, and provide additional auxiliary information through multitasking learning to improve prediction accuracy.
Smart Images

Figure CN119990381A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile behavior prediction, and in particular to a method for predicting a user's next point of interest based on deep learning and a trajectory graph. Background Art
[0002] The user mobility behavior prediction problem has extremely important applications in many fields. On the one hand, accurately predicting the short-term travel destinations of a large number of users can guide the intelligent transportation system to perform efficient and accurate scheduling. For example, the public transportation system can estimate the travel needs of passengers at a specific location and better formulate strategies to meet the travel needs of passengers, thereby improving travel efficiency. On the other hand, analyzing the long-term mobility behavior patterns and travel preferences of users can guide the formulation of public policies and help improve urban planning strategies. For example, for the concentrated visit behavior of users to a certain location in a specific time period, the travel needs of a large number of users can be met by adding bus routes and setting tidal lanes to avoid traffic congestion. The study of user mobility behavior patterns plays an important role in public health, urban planning, and policy formulation. The next point of interest prediction problem is one of the important contents of user mobility behavior prediction. How to analyze the travel preferences of a large number of users from historical trajectories and recommend points of interest to users at future moments will help further understand the behavior patterns of a large number of users and thus help analyze user mobility behavior.
[0003] According to the different prediction methods, the prediction methods of the user's next point of interest can be divided into prediction based on patterns or traditional machine learning methods and prediction based on deep learning models. Among them, the pattern-based prediction method mines the mobile behavior patterns from the existing user history trajectory, and predicts the location information that the user may visit in the future based on the extracted behavior patterns. Some machine learning-based methods use matrix decomposition and metric embedding-based methods to predict the user's points of interest at future moments, and many works also use collaborative filtering-based recommendation methods to predict the user's future points of interest. Although such methods based on specific patterns or machine learning have certain effects in real scene data sets, such methods have great limitations-they are more dependent on feature engineering, and explicit features rely on professional domain knowledge and need to be reasonably constructed. With the development of deep learning, many prediction works based on deep learning models for user mobile behavior have emerged. Methods such as convolutional neural networks and recurrent neural networks have great advantages in automatic feature extraction, eliminating the difficulties of manual feature design, and can make full use of various types of mobile behavior data to model the complex relationship between structured and unstructured data, thereby fully mining user behavior patterns. In particular, trajectory modeling based on recurrent neural networks and methods for learning user preferences from user historical trajectories are widely used, and related technologies in the field of natural language processing have also been applied to user mobility behavior modeling in the problem of point of interest recommendation in recent years. However, these deep learning-based models do not well mine the topological relationship between users' historically visited locations, nor do they distinguish multiple time periods to model users' historical travel preference patterns, so that the inherent topological relationship between locations and users' historical visit record information are not fully utilized. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method for predicting the next point of interest of a user based on deep learning and trajectory graph.
[0005] The present invention is achieved through the following technical solutions:
[0006] A method for predicting the next point of interest of a user based on deep learning and trajectory graph is provided, including:
[0007] Perform data preprocessing operations to filter and segment the user's original travel record data, and divide it into training sets and test sets;
[0008] Design a graph learning module to construct a global trajectory graph and user trajectory subgraphs, and use layered graph convolution to learn additional embedding representations of locations and users.
[0009] Encode the historical travel trajectories of all users for subsequent modeling of user travel preferences;
[0010] The user's travel preferences are divided into long-term, short-term and medium-term preferences, and the user's travel preferences at different times are learned using user subgraph reading, sequence model modeling and attention mechanism.
[0011] Based on the user's travel preferences at different times and combined with the user ID data, a multi-layer perceptron combined with a multi-task learning strategy is used to predict the next point of interest that the user is most likely to visit in the future.
[0012] The recall rate and average reciprocal rank are used as the metric of the prediction results to evaluate the prediction effect of the model.
[0013] Preferably, the data preprocessing operation is performed to screen and segment the original user travel record data, and divide the training set and the test set, including:
[0014] Each user's travel record is divided into a time window of one week, and each user's full historical sequence is divided into several subsequences with a time window of one week;
[0015] Filter locations and users, remove locations with less than 5 total visit records, remove users with less than 5 total visit location sets or less than 2 corresponding subsequences after historical visit records are split, and obtain the processed data set;
[0016] Divide the training set and test set. At each user level, sort the user's subsequences in chronological order, use the first 80% of the subsequence data as the training set, and the last 20% of the data as the test set.
[0017] Preferably, a graph learning module is designed to construct a global trajectory graph and a user trajectory subgraph, and to learn additional embedding representations of places and users using a layered graph convolution method, including:
[0018] Based on the historical travel trajectories of all users in the training set, a global trajectory subgraph is constructed. The nodes in the graph correspond to specific locations, and the directed edges between nodes represent the migration records between locations.
[0019] Initialize edge and node features on the global trajectory graph, run graph convolution operations on the global trajectory graph, and obtain updated location embedding representations;
[0020] For each user's historical travel trajectory, a user trajectory subgraph is constructed. The nodes in the graph correspond to specific locations, and the directed edges between nodes represent the migration records between different locations in the user's historical records.
[0021] Initialize the node features on the user trajectory subgraph, perform graph convolution and subgraph readout operations on each user subgraph, and obtain the user's subgraph representation;
[0022] Preferably, initializing edge and node features on the global trajectory graph, running a graph convolution operation on the global trajectory graph, and obtaining an updated location embedding representation includes:
[0023] Initialize the node feature representation on the global trajectory subgraph by combining location ID, location category, longitude and latitude and other features;
[0024] Initialize the edge feature representation on the global trajectory graph by combining the physical distance between locations and the migration records of all users between locations on the global trajectory graph;
[0025] A two-layer graph convolution layer is used on the global trajectory graph. During the convolution process, the embedded representations of nodes and edges in the graph are iteratively updated based on the neighborhood information of the nodes and the information of the connecting edges, and the embedded representation z of the final node is output. i ;
[0026] Preferably, the node features on the user trajectory subgraph are initialized, and graph convolution and subgraph reading operations are performed on each user subgraph to obtain a representation of the user subgraph, including:
[0027] Use the node embedding representation obtained by the convolution operation on the global trajectory graph to initialize the node features on each user subgraph;
[0028] Use 2 layers of graph convolution on each user subgraph. During the convolution process, the node embedding representation in the user trajectory subgraph is iteratively updated according to the neighborhood information of the node to obtain the embedding representation of each node under the user subgraph.
[0029] For each user subgraph, the weight of each location in the graph is calculated based on the number of user visits to different locations. Based on the node weights and node embeddings in the user subgraph, weighted aggregation of nodes is performed to obtain the readout result of the user subgraph, which corresponds to the representation of the user subgraph.
[0030] Preferably, the historical travel trajectories of all users are encoded for subsequent modeling of user travel preferences, including:
[0031] The user's historical travel trajectory is regarded as a sequence of records of the user's visits to specific locations, where each visit contains specific location information and visit time information;
[0032] For each visit record, the location embedding obtained in the graph learning module is obtained according to the location number, and the location category information obtained by the Embedding layer encoding and the access time encoding information obtained by Time2Vec are concatenated to obtain the encoding of each record;
[0033] Encode each record in the historical travel trajectory, and obtain the encoded trajectory as a coding sequence;
[0034] Preferably, the user travel preferences are divided into long-term, short-term and medium-term preferences, and the user travel preferences at different times are learned using user subgraph reading, sequence model modeling and attention mechanism, including:
[0035] The user subgraph representation obtained by the user subgraph reading operation in the graph learning module is regarded as the user's long-term preference, which contains the information in all the user's historical records;
[0036] The user's trajectory in the past week is regarded as the user's short-term trajectory, and the trajectory is encoded as the input of the sequence model. The output of the sequence model is regarded as the user's short-term preference u i h ;
[0037] The user's travel trajectory in the past 2 to 3 weeks is regarded as the user's medium-term trajectory. After trajectory encoding, the user's medium-term preference u is obtained using the attention mechanism based on the encoded medium-term trajectory and the user's short-term preference. i ;
[0038] Preferably, based on the encoded medium-term trajectory and the user's short-term preference, an attention mechanism is used to obtain the user's medium-term preference, including:
[0039] Based on the position encoding method in Transformer, additional position encoding information is added to the encoded mid-term trajectory for the calculation of the subsequent attention mechanism;
[0040] Based on the obtained user short-term preference and the embedded representation of each record in the encoded medium-term trajectory, a nonlinear layer is used to calculate the score of a specific record in the medium-term trajectory under the short-term preference;
[0041] After obtaining the scores of specific records in all mid-term trajectories, they are processed through a softmax layer to obtain the weight of each record in the mid-term trajectory under the user's short-term preference;
[0042] Based on the weights and embedded representations of specific records in the mid-term trajectory, the encoded mid-term trajectory is aggregated to obtain the embedded representation of the entire mid-term trajectory as the user's mid-term preference information;
[0043] Preferably, based on the user's travel preferences at different times, combined with the user ID data, a multi-layer perceptron combined with a multi-task learning strategy is used to predict the next point of interest that the user is most likely to visit in the future, including:
[0044] For user ID information, use the Embedding layer to encode and get the user ID embedding representation Emb(u i );
[0045] For the state of a specific user at a specific moment, the long-term preference, short-term preference and medium-term preference embedding representations of the user are obtained according to the method, and the long-term preference embedding representation, medium-term preference embedding representation, short-term preference embedding representation and user ID embedding representation are concatenated to obtain the user state representation;
[0046] According to the user status representation information, a multi-task learning strategy is adopted to simultaneously predict the user's next visited location and the category information of the next visited location;
[0047] Preferably, in the prediction phase, a multi-task learning strategy is adopted according to the user state representation information to simultaneously predict the user's next visited location and the category information of the next visited location, including:
[0048] Use a multi-layer perceptron to predict the next location that the user is most likely to visit based on the user state representation information. The predictor outputs the probability information of all locations and uses cross entropy As the objective function;
[0049] Use a multi-layer perceptron to predict the category information of the next place the user is most likely to visit based on the user state representation information. The predictor outputs the probability information of all categories. Similarly, cross entropy is used as the objective function of this prediction task.
[0050] Linearly combine the objective function of the next location prediction task and the objective function of the next location category prediction task Obtain the objective function of multi-task learning to guide the model to simultaneously predict the user's next visited location and the category to which the next visited location belongs;
[0051] Preferably, recall rate and average reciprocal rank are used as the metric of the prediction results to evaluate the prediction effect of the model, including:
[0052] After obtaining the output of the next location predictor, the top K = 10 locations that are most likely to be visited are obtained based on the probabilities of all the predicted locations. This result is regarded as the predicted candidate location set, and the ranking of each prediction result score corresponds to the rank of the result.
[0053] Select recall and average reciprocal ranking As a metric for prediction effect, it quantitatively evaluates the prediction effect of the model during the model training phase;
[0054] Due to the adoption of the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0055] The method for predicting the user's next point of interest based on deep learning and trajectory graph proposed in the present invention can fully and effectively utilize the user's historical visit record data. By constructing a graph learning module, the method can fully learn the spatial relationship between locations and learn the user's long-term travel pattern from the user trajectory subgraph. In addition, the method models the user's historical travel records in periods. In addition to using the graph learning module to learn long-term travel preferences, it also models the user's short-term preferences based on the travel records of the last week, and models the user's medium-term preferences based on the travel records of the last 2 to 3 weeks. It effectively utilizes the user's historical travel trajectory information and can more accurately model the user's travel pattern. In the prediction stage, a multi-task learning strategy is used to predict the category of the next visited location while predicting the next visited location, providing additional auxiliary information, which can improve the prediction effect of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0057] Figure 1 Flow chart of a method for predicting the next point of interest of a user based on deep learning and trajectory graph in a preferred example of the present invention DETAILED DESCRIPTION
[0058] The following is a detailed description of the embodiments of the present invention: This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
[0059] The method for predicting the next point of interest of a user based on deep learning and trajectory graph provided by the present invention is based on graph neural network, deep sequence model and attention mechanism. Through data preprocessing operation, the original travel trajectory record of the user is divided into subsequences according to the time window size of 1 week, and the location and user are screened and the data set is divided. The user trajectory subgraph of the global trajectory graph is constructed through the graph learning module, and the embedded representation of the location and the user is learned by running the graph convolution operation, so as to well learn the spatial relationship between the locations and the long-term travel mode of the user. When modeling the user travel trajectory, the user's short-term and medium-term travel preferences are explicitly modeled from the user trajectory according to different time periods, and the user's historical travel data is fully utilized. In the prediction stage, the method uses a multi-task learning strategy, taking the next location prediction task as the main task and the next location category prediction task as the auxiliary task to help improve the model prediction effect. In the model training stage, the cross entropy of the linear combination is used as the objective function to guide the model training, and the recall rate and the average reciprocal ranking are used to measure the prediction effect of the model.
[0060] This example provides a method for predicting the user's next point of interest based on deep learning and trajectory graphs. Figure 1 As shown, the following steps are included:
[0061] Step S1: data preprocessing, user trajectory segmentation, screening and removing locations and users with small number of records; dividing into training set and test set;
[0062] Step S2: In the graph learning module, a global trajectory graph and a user trajectory subgraph are constructed, and the embedding of locations and users is learned using layered graph convolution.
[0063] Step S3, encoding the user's historical travel trajectory and learning the user's short-term and medium-term travel preferences;
[0064] Step S4: Integrate the user’s preferences and user ID information at different time periods at a specific moment, and use a multi-task learning strategy to make predictions
[0065] Step S5: During the model training phase, the prediction effect of the model is tested based on the prediction results of the model.
[0066] As a preferred embodiment, step S1 includes:
[0067] First, we integrate the visit records of all users to all locations, consider the locations with less than 5 total visit records as abnormal locations, and filter out the relevant records of these locations in the data preprocessing stage;
[0068] Divide the historical travel trajectories of all users into time windows of one week in size, and divide each user's historical travel trajectory into several subsequences;
[0069] Screen users and remove relevant records of users whose total visited locations are less than 5 or whose corresponding subsequences after historical visit records are split are less than 2, to obtain the preprocessed data set;
[0070] Divide the training set and test set. At each user level, sort the user's subsequences in chronological order, divide the first 80% of the user's subsequence data into the training set, and divide the last 20% of the data into the test set, to obtain the division of the original data into the training set and the test set.
[0071] As a preferred embodiment, step S2 includes:
[0072] Based on the travel trajectories of all users in the training set, a global trajectory graph is constructed. The nodes in the graph correspond to real locations, and the directed edges between nodes represent the migration records of all users between locations.
[0073] Based on the historical travel trajectory of each user in the training set, a user trajectory subgraph is constructed for each user. Each node in the user trajectory subgraph corresponds to a real location visited by the user, and the directed edges between nodes represent the migration records of the user between locations.
[0074] Initialize the nodes of the global trajectory graph, and use the Embedding layer to generate the embedding representation Emb(l) of the location ID and location category based on the location information corresponding to each node in the global trajectory graph. i )、Emb(c i ), and then splice it with the specific longitude and latitude of the location to obtain the initial feature representation of each node in the global trajectory graph
[0075] Initialize the edges of the global trajectory graph, calculate the straight-line distance between the actual locations corresponding to the edges, the total number of migration records, and the distribution information of the migration records within 24 hours to initialize the feature representation of the edges; specifically, for the location l i To the location j , construct a vector flow with a dimension of 24 i→j The value at the subscript k represents the number of times in the training data from location I to k+1. i To location I j The total number of records is counted as the migration record. i→j , the initialization feature representation of the edge is obtained as
[0076] Set up the graph convolution operation on the global trajectory graph, use the 2-layer EGraphSAGE layer as the graph convolution layer on the global trajectory graph, set a 50% edge random drop probability during the convolution process, and each edge has a 50% probability of being dropped during the graph convolution;
[0077] When performing graph convolution on each layer of the global trajectory graph, the node neighborhood information obtained by the node neighbor nodes and edges in each layer is first aggregated.
[0078] Update the node embedding representation of the next layer based on the node neighborhood and the embedding of the current layer node
[0079] Update the edge embedding representation of the next layer based on the edge embedding of the current layer and the node embedding of the next layer
[0080] Output of 2-layer graph convolution operation on the global trajectory graph The updated embedding representation of each node
[0081] Concatenate the node embedding updated by the graph convolution operation with the initialized node embedding for nonlinear transformation Get the final node embedding representation z i That is, the embedding representation of the corresponding location;
[0082] Initialize the user trajectory subgraph, and use the location embedding representation obtained by graph convolution and nonlinear transformation on the global trajectory graph to initialize the corresponding nodes on each user trajectory subgraph;
[0083] Set the graph convolution operation of the user trajectory subgraph, and use a 2-layer GraphSAGE layer as the graph convolution layer on each user trajectory subgraph;
[0084] When performing graph convolution on each layer of the user trajectory subgraph, the node neighbor information in each layer is first aggregated to obtain the node neighborhood information
[0085] Generate the node embedding representation of the next layer based on the node neighborhood and the node embedding representation of the current layer The graph convolution operation on the user trajectory subgraph generates a unique location embedding representation for each user;
[0086] For each user u i Subgraph of the user's total historical access records RN i , and the user visits a specific location l in the subgraph j The number of historical records η i,j , calculate the weight data w for a specific location i,j =η i,j / RN i ;
[0087] According to the embedding representation and weight of each node in the user subgraph, weighted aggregation of nodes in the user subgraph is performed to read out each user subgraph. As an embedded representation of the user
[0088] As a preferred embodiment, step S3 includes:
[0089] The user's historical travel trajectory is regarded as a historical visit sequence of multiple locations. i At time t j Places visited j This record finds the encoding representation z corresponding to the location from the graph learning module j , use the Embedding layer to encode the category information of the place, and use the Time2Vec method to encode the specific time information of the user visiting the place;
[0090] For each access record, concatenate the above information to obtain the encoding representation of a single location access record Correspondingly, the encoding of the historical travel trajectory in the form of a location encoding representation array is obtained;
[0091] The user's travel trajectory data in the past week is regarded as the user's short-term trajectory, and the encoded short-term trajectory is used as the input of the sequence model. GRU is used to directly process the encoded user short-term trajectory to obtain the user's short-term preference information.
[0092] The new trajectories of the user in the past 2 to 3 weeks are regarded as the user's medium-term trajectory, and the encoded medium-term trajectory is obtained. According to the position encoding method in Transformer, the position encoding information is added to each location visit record in the encoded medium-term trajectory, and the encoded medium-term trajectory is updated;
[0093] The user's short-term preference is concatenated with the encoding corresponding to each visit record in the medium-term trajectory, and a nonlinear layer is used to calculate the score of all locations in the medium-term trajectory under the current short-term preference. Preferably, the weight of each record in the mid-term trajectory is calculated by a softmax operation, and the weight of each location is expressed as
[0094] Based on the embedding representation of each access record in the mid-term trajectory and the corresponding weight information, perform aggregation of the access record embedding in the mid-term trajectory Get the user's mid-term preference information representation
[0095] As a preferred embodiment, step S4 includes:
[0096] After the graph learning module and the trajectory encoding and processing module, the embedded representation of the user's long-term, medium-term and short-term preferences is obtained. Use the Embedding layer to process the user's unique ID information;
[0097] The user's long-term, medium-term and short-term preferences are combined with the encoded user ID information Emb(u i ) to obtain the overall travel preference of a specific user at a specific time.
[0098] A multi-layer perceptron is set up to predict the user's next visit location. The user's overall travel preference is used as input and the output is a vector of dimension N. Each dimension corresponds to the probability of each location in the location set. The cross entropy is set during training. As the objective function of this task;
[0099] In order to make full use of the user's historical visit record information, the task of predicting the next visited location is set as an auxiliary task. Another independent multi-layer perceptron is set up to use the same method to predict the category of the next visited location. The cross entropy is also used as the objective function of the auxiliary task of the category of the next location.
[0100] The next location prediction task is taken as the main task, and the next location category prediction task is taken as the auxiliary task. The objective functions of the two tasks are combined by linear combination as the objective function of the entire model, guiding the training model to predict the category of the next location while predicting the next location to be visited.
[0101] As a preferred embodiment, step S5 includes:
[0102] After obtaining the output of the next location predictor, sort all the predicted locations in descending order to obtain the top K = 10 locations that are most likely to be visited. This result is regarded as the predicted candidate location set.
[0103] Setting the recall rate and average reciprocal ranking As a metric for prediction effect, m represents the number of prediction samples, and quantitatively evaluates the prediction effect of the model during the model training phase;
[0104] The above specific embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. The above specific implementations can be modified by those skilled in the art without departing from the principles and purpose of the present invention, or some or all of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the present invention.
Claims
1. A method for predicting the next point of interest of a user based on deep learning and trajectory graph, characterized in that: Includes steps: S1. Obtain the user's historical travel trajectory data, perform preprocessing, filter out places and users with a small number of records, and divide the original data into training sets and test sets; S2. Based on the historical travel trajectories of all users, a global trajectory graph and user trajectory subgraphs are constructed, node and edge features of the trajectory graph are initialized based on location features, and additional embedding representations of locations and users are learned using a layered graph convolution method; S3. Use the location coding information, location category information, and the user's visit time information to encode the historical travel trajectories of all users for subsequent modeling of user travel preferences; S4. According to the length of the time period, the user's travel preferences are divided into long-term, short-term and medium-term preferences, and the user's travel preferences at different times are learned using user subgraph reading, sequence model modeling and attention mechanism respectively; S5. Based on the user's travel preferences at different times, combined with the user ID data, a multi-layer perceptron combined with a multi-task learning strategy is used to predict the next point of interest that the user is most likely to visit in the future; S6. Use recall and average reciprocal rank as metrics for prediction results to evaluate the prediction effect of the model during the model training phase.
2. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 1, characterized in that: S1. Obtain the user's historical travel trajectory data, perform preprocessing, filter out places and users with a small number of records, and divide the original data into training sets and test sets. The specific steps include the following: S1.1 obtains the user's historical travel trajectory data, and divides each user's travel record into a time window of one week, and divides each user's full historical sequence into several subsequences with a time window of one week; S1.2 Filter locations and users, remove locations with a total number of visited records less than 5; remove users with a total number of visited locations less than 5 or a number of corresponding subsequences less than 2 after historical visit records are split, and obtain a processed data set; S1.3 At each user level, sort the user’s subsequences in chronological order, use the first 80% of the subsequence data as the training set, and the last 20% of the data as the test set.
3. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 1, characterized in that: S2. constructs a global trajectory graph and a user trajectory subgraph based on the historical travel trajectories of all users, initializes the trajectory graph node and edge features based on the location features, and uses the layered graph convolution method to learn additional embedding representations of locations and users, specifically including: S2.1 constructs a global trajectory graph based on the historical travel trajectories of all users in the training set, where each node corresponds to each location and the directed edges between nodes represent migration records between different locations; S2.2 Initialize the node and edge features of the global trajectory graph based on the inherent attributes of each location and the migration record features of users between different locations in the training set data; S2.3 Perform graph convolution on the global graph to generate an embedding representation z for each location j ; S2.4 constructs a user trajectory subgraph for each user's historical travel trajectory, where each node corresponds to a specific location, and the directed edges between nodes represent the migration records between different locations in the user's historical records; S2.5 Initialize each node on the user trajectory subgraph using the location embedding vector obtained from the global trajectory graph; S2.6 Perform graph convolution on each user trajectory subgraph to generate an embedding representation z for each location j After updating the embedding of each node in the user trajectory subgraph, the user trajectory subgraph is read out to obtain the embedding representation corresponding to each user.
4. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 3, characterized in that: The step S2.2 described in the above method is to initialize the node and edge features of the global trajectory graph based on the inherent attributes of the location and the migration record features of the user between different locations in the training set data, specifically including: S2.2.1 For the information of each location in the global trajectory map, use the Embedding layer to generate the location ID and location category representation vector, and then splice it with the latitude and longitude information of the location to obtain the initialization feature representation of each node in the global trajectory map S2.2.2 For locations l i To the location j The edges are constructed in the form of [a0,a1,…,a 23 ] is a vector flow with a dimension of 24 i→j , where the value a at the subscript k is k Indicates that in the training data, from location l within time k to k+1 i To the location j The total number of records is counted as the migration record. i→j , the initialization feature of the edge is 5. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 3, characterized in that: The step S2.5 uses the location embedding vector obtained from the global trajectory graph to initialize each node on the user trajectory subgraph; specifically: S2.5.1 Construct the second layer of EGraphSAGE. When performing graph convolution on the global trajectory graph, set a 50% edge random discard probability, that is, each edge has a 50% probability of being discarded during graph convolution. Aggregate the neighbors of the node and the corresponding edge information in each layer to obtain the neighborhood information of the node. S2.5.2 Generate the node embedding representation of the next layer based on the node's neighborhood information and the node embedding representation of the current layer S2.5.3 Update the edge embedding of the next layer based on the edge embedding of the current layer and the node embedding of the next layer S2.5.4 After two layers of graph convolution operations on the global trajectory graph, the updated embedding representation of each node is obtained S2.5.5 Concatenate the node embedding obtained after graph convolution with the initialized node embedding and perform a nonlinear transformation Get the final node embedding representation z i That is, the embedding representation of the corresponding location.
6. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 3, characterized in that: Step 2.6 performs a graph convolution operation on each user trajectory subgraph to generate an embedding representation z for each location. j After updating the embedding of each node in the user trajectory subgraph, the user trajectory subgraph is read out to obtain the embedding representation corresponding to each user. Specifically include: S2.6.1 Use the node embedding representation obtained after the graph convolution operation on the global trajectory graph to initialize the embedding representation of the corresponding node on each user trajectory subgraph; S2.6.2 builds a 2-layer GraohSAGE layer for the user trajectory subgraph. In the graph convolution operation, only the neighbor information of the node is aggregated in each layer to obtain the neighborhood information of the node. S2.6.3 Generate the node embedding representation of the next layer based on the node's neighborhood information and the node embedding representation of the current layer After such a convolution operation on the user trajectory subgraph, the updated embedding representation of each node is obtained. After this operation, the node embeddings in different user trajectory subgraphs are unique to the user, that is, different locations correspond to different embedding representations in different user subgraphs; S2.6.4 For each user u i The corresponding user subgraph, statistics of user u i Total number of historical access records RN i and visit specific locations j The frequency η i,j , calculate the weight w of a specific location i,j =η i,j / RN i ; S2.6.5 Based on the node embedding representation obtained after the convolution operation on the user subgraph, weighted aggregation is performed based on the weight information to calculate Get the readout of each user subgraph, corresponding to the embedding representation of each user As the user's long-term preference information.
7. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 1, characterized in that: Use location code information, location category information, and visit time information to encode the historical travel trajectories of all users for subsequent modeling, including: The user's historical trajectory is decomposed into a sequence of visits to multiple historical locations. i At time t j Places visited j This record uses the Embedding layer to encode the location l j The corresponding category information c j , find the encoding representation z obtained by the graph learning module corresponding to the location j , use the Time2Vec method to encode the specific time when the user visited the location; Encode the visit record of a single location, represented as Correspondingly, the user's historical travel trajectory is encoded into a sequence consisting of multiple location codes.
8. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 1, characterized in that: According to the length of the time period, the user's travel preferences are divided into long-term, short-term and medium-term preferences. The user's travel preferences at different times are learned using user subgraph reading, sequence model modeling and attention mechanism, including: The constructed user subgraph is regarded as data containing all the historical travel information of the user, and the user subgraph updated by the graph convolution operation is used to read out the information as the user's long-term preference. The user's travel trajectory in the past week is regarded as the user's short-term trajectory and encoded. The encoded short-term trajectory is used as the input of the sequence model. The GRU model is used to process the encoded user's travel trajectory data in a week to obtain the user's short-term preference. The user's travel trajectory in the past 2 to 3 weeks is regarded as the user's medium-term trajectory, and the encoded medium-term trajectory data is obtained. The location encoding information is added to each location in the encoded medium-term trajectory. Based on the short-term preferences learned by the deep sequence model and the encoded medium-term trajectory, the attention mechanism is used to calculate the weight corresponding to each location in the medium-term trajectory. The embedding of each location in the medium-term trajectory is weighted and aggregated to obtain the user's medium-term preference representation.
9. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 8, characterized in that: The above method adds position encoding information to each location in the encoded medium-term trajectory, uses the attention mechanism to calculate the weight corresponding to each location in the medium-term trajectory based on the short-term preferences learned by the deep sequence model and the encoded medium-term trajectory, and performs weighted aggregation on the embedding of each location in the medium-term trajectory to obtain the user's medium-term preference representation include: According to the position encoding method proposed in the Transformer model, the position encoding information corresponding to each location in the mid-term trajectory is calculated and directly added to the existing location encoding to provide additional position information for the mid-term trajectory encoding; For each record in the user's mid-term trajectory, the embedding representation is concatenated with the user's short-term preference and a multi-layer perceptron is used to calculate the score. Furthermore, the weight of each record in the mid-term trajectory is calculated through the softmax operation, and the weight of each location is expressed as According to the embedding of each location in the mid-term trajectory and the weight calculated by the attention mechanism, the mid-term preference information is represented by weighted aggregation 10. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 1, characterized in that: S5. Based on the user's travel preferences at different times, combined with the user ID data, a multi-layer perceptron combined with a multi-task learning strategy is used to predict the next point of interest that the user is most likely to visit in the future, including: After the graph learning module and the trajectory encoding and processing module, the encoding representation of the user's long-term, medium-term and short-term preferences is obtained. Use Embedding to process the user's inherent ID information, and then embed the user's long-term, medium-term, and short-term preferences with the encoded user ID information Embed (u i ) to obtain the travel preferences of a specific user at a specific time. In the prediction phase, a multi-task learning strategy is set up, with the next location prediction task as the main task and the next location category prediction task as the auxiliary task; Design two independent multi-layer perceptrons to predict the next location and the category of the next location respectively. Take the next location prediction task as an example and let the user u i Corresponding As the input of the MLP for predicting the next location, the final output dimension is an N-dimensional vector processed by softmax, where N corresponds to the size of the location set, and each dimension of the vector represents the probability of visiting the corresponding location at a certain time in the future. By sorting the locations according to the probability, we can get a set of candidate locations; Using cross entropy as next location prediction And the objective function of the next category prediction task, combining the objective functions of the two tasks through linear combination As the objective function of the whole method, the model is guided to predict the category of the next visited location while predicting the next visited location.
11. The method for predicting the next point of interest of a user based on deep learning and trajectory graph according to claim 1, characterized in that: S6. uses recall and average reciprocal rank as metrics of prediction results to evaluate the prediction effect of the model, including: Based on the candidate location scores obtained by the prediction module, the top 10 locations with the highest scores are selected as the prediction results. The ranking of each prediction result score corresponds to the rank of the result. In the next location prediction task and the next location category prediction task, recall is used and average reciprocal ranking to measure the accuracy of the prediction.