A Next POI Recommendation Method Based on User Preferences and Spatiotemporal Context Information
By constructing a next point of interest (POI) recommendation model based on user preferences and spatiotemporal context information, and utilizing a two-layer attention mechanism and GRU module to mine user behavior features, combined with geolocation encoding and vector embedding of POI categories, the problem of spatiotemporal information sparsity is solved, and the accuracy of POI recommendation is improved.
Patent Information
- Application Number
- CN202310167363.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-02-27
AI Technical Summary
Existing next-generation POI recommendation systems have failed to effectively address the sparsity problem of spatiotemporal information, resulting in low recommendation accuracy.
We adopt a recommendation method based on user preferences and spatiotemporal context information. We mine users’ historical check-in information through a two-layer attention mechanism and GRU module, and combine geolocation encoding and vector embedding of interest point categories to build the next interest point recommendation model. We then narrow down the recommendation scope through an interest point-geographic filter.
It significantly improves the accuracy of POI recommendations, alleviates the sparsity of geospatial and temporal information, and enhances the precision of recommendations.
Smart Images

Figure CN117194763B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data mining and recommendation system technology, specifically relating to a method for recommending the next POI based on user preferences and spatiotemporal context information. Background Technology
[0002] In recent years, with the popularization of mobile smart devices and the development of mobile internet technology, location-based social networks (LBSNs) have experienced rapid growth in popularity, such as Foursquare, Gowalla, and Weibo. Users can not only interact with friends on LBSNs, but also interact with locations through geotagged text and images, such as visiting a restaurant or a bus stop, thus leaving their digital footprints. These locations with geographic information are called Points of Interest (POIs), and a user's visit to a POI constitutes a check-in. The large number of check-in records generated by users provides insights into user behavior patterns. Users' spatiotemporal movement often exhibits periodicity. Deeply mining the large number of check-in records in LBSNs helps to provide more accurate recommendations that match users' preferences. Among these, the next POI recommendation task has received considerable attention in recent years and has become an important research direction in LBSN-based recommendation tasks.
[0003] Early POI recommendation systems often employed matrix factorization and Markov chains. Matrix factorization was used to learn the overall preferences of all users, and Markov chains were used to mine transition features of POI sequences before making recommendations. With the development of deep learning, some researchers have introduced methods from natural language processing into sequence mining and POI prediction recommendation systems with similar tasks. Recurrent neural networks are used to capture transition features of POI sequences before making recommendations. However, existing methods have failed to address the sparsity problem of spatiotemporal information and cannot fully mine historical information. These problems significantly affect the accuracy of POI recommendations. Summary of the Invention
[0004] This invention addresses the shortcomings of existing technologies by providing a next point of interest recommendation method based on user preferences and spatiotemporal context information. It fully leverages users' historical check-in information to alleviate the sparsity problem of spatiotemporal data, thereby improving the accuracy of recommendations.
[0005] To solve the above problems, the technical solution adopted by the present invention is as follows:
[0006] This invention provides a method for recommending the next point of interest based on user preferences and spatiotemporal context information, comprising the following steps:
[0007] Step 1: Obtain all check-in records of a group of users from a location-based social network;
[0008] Step 2, Data Preprocessing: Clean all check-in data, deleting invalid check-in records with missing users, points of interest, point of interest latitude and longitude, point of interest categories, or check-in times; deleting check-in records corresponding to points of interest accessed less than 10 times and users with fewer than 100 check-in records; then standardize the format of the remaining cleaned check-in data, specifically: generating a uniform format of "week" and "hour" based on the timestamp of each check-in record, and generating a corresponding geolocation code based on the latitude and longitude of each check-in record; save the check-in records according to user categories. The system reconstructs each user's check-in records in chronological order. Then, it determines whether a user has more than 500 check-in records. If so, it takes the 500 most recent check-in records to form a long-term check-in sequence; otherwise, it takes all of the user's check-in records to form a long-term check-in sequence. Each user's check-in records are then divided into short-term check-in sequences, with the last s1 check-in records and the previous s-s1 check-in records forming another short-term check-in sequence. Finally, the system iterates through all users to obtain the long-term and short-term check-in sequences for each user.
[0009] Step 3, Vector embedding of check-in record information: Low-dimensional dense vectors are used to embed points of interest and various auxiliary information. The vector embedding of auxiliary information is performed on users, geolocation codes, point of interest categories, "time" and "week", and category preferences.
[0010] Step 4: Construct and train the next interest point recommendation model based on user preferences and spatiotemporal context information, specifically including: (1) Constructing a user preference feature extraction module; this module uses a two-layer attention mechanism to mine user preference features in the user's long-term check-in sequence. The first layer attention mechanism uses a Transformer encoder based on a multi-head self-attention mechanism to capture the interrelationships between check-in records in the entire long-term check-in sequence in parallel; the second layer attention mechanism uses a bilinear attention mechanism to capture the contribution of each check-in record to the user's category preference; (2) Constructing a long-term behavior feature extraction module: the input of this module is the user's long-term check-in sequence, which extracts the interest points of each check-in record, The geolocation encoding, point of interest category, and "time" and "week" attribute embedding vectors are concatenated, and then the concatenated vector of the entire long-term check-in sequence is input into a multi-layer GRU. The output vector of the multi-layer GRU is concatenated with the user embedding vector, and then added to the output vector of the user preference feature extraction module through a fully connected layer; (3) Construct a short-term behavior feature extraction module: The input of this module is the user's short-term check-in sequence. The point of interest embedding vector, geolocation encoding embedding vector, and point of interest category embedding vector of each check-in record are concatenated with its time embedding vector to obtain three concatenated vectors. The three concatenated vectors are input into three GRUs with different parameters, and the outputs of the three GRUs are concatenated. The vectors are weighted and added together, then concatenated with the user embedding vector, and then added to the output vector of the user preference feature extraction module through a fully connected layer; (4) Constructing the prediction module: The output of the long and short-term behavioral feature extraction modules is passed through a nonlinear layer to output two interest point probability distribution vectors and two geolocation coding probability distribution vectors. The two interest point probability distribution vectors are merged into one interest point probability distribution vector through the interest point fusion layer, and the two geolocation coding probability distribution vectors are merged into one geolocation coding probability distribution vector through the geolocation fusion layer; then, the interest point probability distribution vector and the geolocation coding probability distribution vector are sorted from largest to smallest according to their probability values, and the geolocation is selected. The top 10 geolocation codes with the highest probability values are encoded, and the top k points of interest with the highest probability values within these geolocation codes are selected to form a recommendation list output, where k is 1, 5 or 10, to obtain the next point of interest recommendation model based on user preferences and spatiotemporal context information; (5) Training the next point of interest recommendation model based on user preferences and spatiotemporal context information: a training set is constructed based on each user's long-term check-in sequence and short-term check-in sequence, and the cross-entropy loss function is used to calculate the point of interest prediction loss and geolocation code prediction loss of the next point of interest recommendation model, and the Adam optimizer is used to update the parameters of the next point of interest recommendation model, thereby realizing the training of the next point of interest recommendation model;
[0011] Step 5: Input the user's long-term check-in sequence and short-term check-in sequence into the trained next interest point recommendation model based on user preferences and spatiotemporal context information to generate k interest points and recommend them to the user.
[0012] Preferably, the geolocation coding uses the DBSCAN clustering algorithm.
[0013] Preferably, the specific process of embedding the point of interest is as follows:
[0014] ① Based on the check-in sequence of all users, a homogeneous graph is established, with each point of interest as a node in the homogeneous graph network, the transition relationship between points of interest as an edge in the homogeneous graph network, the weight of the edge being the number of transitions between two points of interest, and the direction from point of interest to point of interest is marked according to the time order to form a directed graph.
[0015] ② Set the sampling length, sample based on the weights of edges in the isomorphic graph, and use a structured deep network embedding model to learn the sequence obtained by the above sampling, embedding all interest points on the directed graph into vectors.
[0016] Preferably, the embedding of user, geolocation code, point of interest category, "time" and "week" is specifically carried out as follows: the user, geolocation code, point of interest category, "time" and "week" in the check-in data are encoded into one-hot vectors respectively, and the one-hot vectors are input into a normal embedding model to obtain the embedding vectors of user, geolocation code, point of interest category, "time" and "week".
[0017] Preferably, the specific process of embedding the category preference is as follows: initialize a Y-dimensional vector [v0, ... v] for user u∈U. Y-1 The number of times user u accesses each interest category is recorded in the corresponding position of the vector, and the interest category that is not accessed is recorded as 0;
[0018] We obtain the vector [v0, ... v] Y-1 After that, the category preference vector for user u is defined as follows:
[0019]
[0020] Iterate through all users in U to obtain the category preference vector for each user.
[0021] Preferably, the specific calculation process of the long-term behavioral feature extraction module is as follows:
[0022]
[0023] Among them, O longThis represents the output of the long-term behavioral feature extraction module. FC(·) represents a fully connected layer, and MulGRU(·) represents a multi-layer GRU. The calculation process of GRU is as follows:
[0024]
[0025] z i =σ(W xz x i +W hz h i-1 +b z )
[0026] r i =σ(W xr x i +W hr h i-1 +b r )
[0027] c i =tanh(W xc x i +r i ⊙(W hc h i-1 )+b c )
[0028] h i =(1-z) i )⊙c i +z i ⊙h i-1
[0029] Where σ represents the Sigmoid function, x i Given the input at time i, h i h is the output at time i. i-1 The output at time i-1, z i r i c i W is an intermediate variable. xz W hz W xr W hr W xc W hc For trainable parameters, b z b r b c The trainable bias term is tanh(), which is the tanh activation function, and ⊙ represents element-wise multiplication.
[0030] Preferably, the specific calculation process of the short-term behavioral feature extraction module is as follows:
[0031]
[0032]
[0033] Among them, O short V represents the output of the short-term behavioral feature extraction module, α, β, and γ represent the weights, GRU(·) represents a single-layer GRU module, and V l V g V c and V t These represent the embedding vectors of all points of interest, all geolocation encoding, all points of interest category, and all time embedding vectors in the short-term check-in sequence, respectively.
[0034] Preferably, the cross-entropy loss function is defined as:
[0035]
[0036] Loss = Loss poi +Loss geo
[0037] Loss poi Loss geo Loss represents the interest point prediction loss, geolocation encoding prediction loss, and total loss, respectively. i For user u at time t i Points of interest visited, g i For points of interest i Geographic location code, For the prediction module At time t i The probability value, For the prediction module At time t i The probability value.
[0038] The present invention has the following beneficial effects:
[0039] This invention introduces three vector embedding methods (vector embedding of points of interest, vector embedding of user, geolocation encoding, point of interest category, "time" and "week", and vector embedding of category preference) to fully mine point of interest to point of interest transition sequences with obvious graph structure features. It alleviates the sparsity of geospatial information by introducing spatial clustering algorithm, and alleviates the sparsity of temporal information by extracting time sub-attributes from timestamps. It learns the transition information of sequences by introducing GRU module with simpler structural parameters and better performance, and better mines user behavioral features by introducing a two-layer attention mechanism. Finally, it narrows the recommendation range through point of interest-geographic filter, which greatly improves the accuracy of recommendation. Attached Figure Description
[0040] Figure 1 This is a flowchart of the method of the present invention.
[0041] Figure 2 This is a flowchart illustrating the vector embedding of sign-in record information in this invention.
[0042] Figure 3 This is a structural diagram of the next point of interest recommendation model based on user preferences and spatiotemporal context information in this invention.
[0043] Figure 4 This is a schematic diagram of the point of interest-geographic filter in this invention. Detailed Implementation
[0044] The invention will now be further described with reference to the accompanying drawings.
[0045] like Figure 1 As shown, the next point of interest recommendation method based on user preferences and spatiotemporal context information includes the following steps:
[0046] Step 1: Obtain all check-in records of a set of users from a location-based social network (LBSN). Each check-in record contains five pieces of information: user, point of interest, point of interest category, point of interest latitude and longitude, and check-in timestamp.
[0047] Step 2: Process all check-in records obtained in Step 1 as follows: Delete invalid check-in records with missing information, delete check-in records corresponding to points of interest accessed less than 10 times, and delete check-in records of users with less than 100 check-in records, to obtain valid check-in records. Arrange the valid check-in records in chronological order to obtain the check-in data.
[0048] To better illustrate with examples, based on the above sign-in data, the following definitions are made:
[0049] Define U = {u0, u1, ..., u} M-1} represents the set of users in the check-in data; define L = {l0, l1, ..., l...} N-1} represents the set of points of interest in the check-in data; this invention uses the DBSCAN clustering algorithm to perform spatial clustering based on the latitude and longitude of all points of interest in the check-in data, and assigns a geographic location code to each point of interest based on the clustering results, defining G = {g0, g1, ..., g...} X1-1} represents the set of geolocation codes for points of interest in the check-in data; define C = {c0, c1, ..., c...} Y-1} represents the set of interest point categories (e.g., restaurants, schools, etc.) in the check-in data; the timestamps of the original check-in records are continuous, and by extracting the time sub-attributes "hour" (what time) and "day of the week" (what day of the week) from the check-in timestamps, all timestamps are separated into intervals of the same length. M, N, X1, and Y are the total number of users, the total number of interest points, the total number of geolocation codes, and the total number of interest point categories in the check-in data, respectively.
[0050] Define the check-in sequence for user u∈U as H u ={h0, h1, ..., h n-1 The sequence consists of check-in records, where n is the length of the check-in sequence, which is a time-series sequence. Each check-in record h... i ∈H u It contains four attributes (l) i g i c i , t i ), indicating that user u is at time t i Visited points of interest i g i For points of interest i geolocation code, c i For points of interest i The category, where t i It is a binary pair consisting of "hour" and "week".
[0051] Define the long-term check-in sequence for user u∈U as L u ={h0, h1, ..., h l-1 If user u's total number of check-in records exceeds 500, the 500 most recent check-in records from user u are selected to form a long-term check-in sequence, i.e., l = 500. Otherwise, all of user u's check-in records are selected to form a long-term check-in sequence. A user generating a large number of check-in records over a long period to form a long-term check-in sequence implies the user's long-term activity characteristics, i.e., long-term behavioral characteristics.
[0052] Split all check-in sequences for user u∈U into a group (or multiple) of short check-in sequences of length s, and take S. u ={h0, h1, ..., h s-1}
[0053] Iterate through all users in U to obtain the long-term check-in sequence and short-term check-in sequence for each user. Take the last short-term check-in sequence for each user to form the test dataset, and the rest to form the training dataset.
[0054] Step 3: Vector embedding of check-in record information. For example... Figure 2 As shown, it specifically includes:
[0055] (1) Interest Point Embedding: Graph embedding technology is used to map interest points into vectors. Check-in sequences have obvious graph structure features. In a large number of check-in sequences, the lines connecting interest points form isomorphic graphs. Traditional word embedding methods cannot well represent the structural information and latent features of check-in sequences. Graph embedding technology can map graph data into low-dimensional dense vectors. Each interest point on the isomorphic graph is embedded to obtain a vector representation, which well preserves the spatial features and interaction relationships between interest points.
[0056] The specific process is as follows:
[0057] ① Construct an isomorphic graph based on the check-in sequence of all users, treat each point of interest as a node in the isomorphic graph network, treat the transition relationship between points of interest as an edge in the isomorphic graph network, the weight of the edge is the number of transitions between two points of interest, and mark the direction from point of interest to point of interest according to the time order to form a directed graph G.
[0058] ② Set the sampling length, sample based on the edge weights in the isomorphic graph, and use the Structured Deep Network Embedding (SDNE) model to learn the sequence obtained from the above sampling. Embed all interest points in the directed graph G as vectors, with the dimension of the interest point embedding vector being D. l .
[0059] (2) User, geolocation code, point of interest category, "time" and "week" embedding: Encode the user, geolocation code, point of interest category, "time" and "week" in the check-in data into one-hot vectors. Input the one-hot vectors into a common embedding model (such as PyTorch's nn.Embedding embedding model) to obtain the embedding vectors for user, geolocation code, point of interest category, "time" and "week". Use D u D g D c D h and D w These represent the dimensions of the user embedding vector, geolocation encoding embedding vector, point of interest category embedding vector, "time" embedding vector, and "week" embedding vector, respectively. For ease of explanation, the embedding vectors for "time" and "week" are concatenated, resulting in a dimension of D. t =D h +D w .
[0060] (3) Category preference embedding: Initialize a Y-dimensional vector [v0, ... v0] for user u∈U. Y-1 The number of times user u accesses each interest category is recorded in the corresponding position of the vector, and the interest categories that are not accessed are recorded as 0.
[0061] We obtain the vector [v0, ... v] Y-1After that, the category preference vector for user u is defined as follows:
[0062]
[0063] Iterate through all users in U to obtain the category preference vector for each user.
[0064] Step 4: Build and train the next point of interest recommendation model based on user preferences and spatiotemporal context information, such as... Figure 3 As shown, it specifically includes:
[0065] (1) Construct a user preference feature extraction module. This module uses a two-layer attention mechanism to mine user preference features from long-term check-in sequences. The input is the long-term check-in sequence H of user u∈U. u ={h0, h1, ..., h l-1 To fully consider the contextual information of long-term check-in sequences, each check-in record h is... i ∈H u The four attributes are concatenated:
[0066]
[0067] in, This represents vector concatenation. and h represents each sign-in record i ∈H u Four attributes (l) i g i c i , t i The embedding vector of ).
[0068] The first layer of attention mechanism employs a Transformer encoder based on multi-head self-attention, which can capture the relationships between each check-in record in the entire long-term check-in sequence in parallel. Since the Transformer is a parallel computational mechanism, it cannot capture positional information in the sequence like a recurrent neural network; therefore, it needs to concatenate the entire long-term check-in sequence into a vector V. P After being added to the corresponding bits of the position vector PE, the results are input in parallel to the Transformer encoder.
[0069] The input of a Transformer encoder is represented as X = V P +PE, the output is represented as:
[0070] O E =lNo(lNo(X+MulH(X))+FFN(lNo(X+MulH(X))))
[0071] Where lNo(·) represents layer normalization, FFN(·) represents a fully connected feedforward network, and MulH(·) represents a multi-head self-attention mechanism.
[0072] This invention references the following geolocation code:
[0073] and
[0074] in, and This represents the values of the even and odd dimensions of the position vector, where i represents the position of the check-in record in the check-in sequence, and E... size Represents concatenated vectors The dimension, k is from 0 to Integer values between [a certain range].
[0075] The second-layer attention mechanism employs a bilinear attention mechanism, which captures the contribution of each check-in record to the user's category preference, forming a normalized vector output O. per :
[0076]
[0077]
[0078]
[0079] Among them, O per The output vector of the user preference feature extraction module. For O E The i-th dimension vector, α i Let f(·) be the weight, f(·) be the bilinear attention function, and W be the learnable parameter matrix.
[0080] (2) Construct a long-term behavioral feature extraction module. The input of this module is the long-term check-in sequence L of user u∈U. u ={h0, h1, ..., h l-1}, record each sign-in record h i ∈L u The four attributes are concatenated, and then the concatenated vector V of the entire long-term check-in sequence is generated. P The input is fed into a multi-layer GRU, and the output vector of the multi-layer GRU is compared with the user embedding vector V. u The vectors are concatenated, then added to the output vector of the user preference feature extraction module via a fully connected layer. The specific calculation process is as follows:
[0081]
[0082] Among them, O longThis represents the output of the long-term behavioral feature extraction module. FC(·) represents a fully connected layer, and MulGRU(·) represents a multi-layer GRU. The calculation process of GRU is as follows:
[0083] x i =V i P
[0084] z i =σ(W xz x i +W hz h i-1 +b z )
[0085] r i =σ(W xr x i +W hr h i-1 +b r )
[0086] c i =tanh(W xc x i +r i ⊙(W hc h i-1 )+b c )
[0087] h i =(1-z) i )⊙c i +z i ⊙h i-1
[0088] Where σ represents the Sigmoid function, x i Given the input at time i, h i h is the output at time i. i-1 The output at time i-1, z i r i c i W is an intermediate variable. xz W hz W xr W hr W xc W hc For trainable parameters, b z b r b c The trainable bias term is tanh(), which is the tanh activation function, and ⊙ represents element-wise multiplication.
[0089] (3) Construct a short-term behavioral feature extraction module. The input of this module is the short-term check-in sequence S of user u∈U. u={h0, h1, ..., h s-1}, record each sign-in record h i ∈S u The point of interest (POI) embedding vector, geolocation encoding embedding vector, and POI category embedding vector are concatenated with their time embedding vectors to obtain three concatenated vectors. All three concatenated vectors are input into three GRUs with non-shared parameters. The output vectors of the three GRUs are then weighted and summed, and finally combined with the user embedding vector V. u The vectors are concatenated and then added to the output vector of the user preference feature extraction module through a fully connected layer. The specific calculation process is as follows:
[0090]
[0091]
[0092] Among them, O short V represents the output of the short-term behavioral feature extraction module, α, β, and γ represent the weights, GRU(·) represents a single-layer GRU module, and V l V g V c and V t These represent the embedding vectors of all points of interest, all geolocation encoding, all points of interest category, and all time embedding vectors in the short-term check-in sequence, respectively.
[0093] (4) Construct the prediction module. The output of the long-term behavioral feature extraction module is passed through a nonlinear layer NL. POI 1 and NL Geo 1 The output of the short-term behavioral feature extraction module is passed through a nonlinear layer NL. POI 2 and NL Geo 2 The system outputs two point-of-interest (POI) probability distribution vectors and two geolocation code probability distribution vectors. The two POI probability distribution vectors are merged into one POI probability distribution vector through an POI fusion layer, and the two geolocation code probability vectors are merged into one geolocation code probability vector through a geolocation fusion layer. The specific calculation process is as follows:
[0094]
[0095]
[0096] Where Pre represents the final recommendation result. and For encoding the probability distribution vectors of points of interest and geographic locations, Softmax() is the Softmax function, NLPOI 1 NL POI 2 NL Geo 1 and NL Geo 2 This is a non-linear layer, where λ and μ are learnable parameters. Non-linear layers include Dropout(), ReLU(), and fully connected layers, which can improve the model's generalization ability and transform the input vector into the desired dimension.
[0097] Then, the recommendation list Pre is output through the point of interest-geographic filter GeoFilter(·). The operation of the point of interest-geographic filter is as follows: Figure 4 As shown, the probability distribution vector of interest points and the probability distribution vector of geographic location codes are sorted from largest to smallest according to their probability values. The top 10 geographic location codes with the highest probability values are selected, and the top k interest points with the highest probability values within these geographic location codes are selected to form a recommendation list for output. The value of k is 1, 5 or 10, which yields the next interest point recommendation model based on user preferences and spatiotemporal context information.
[0098]
[0099] (5) Training the next point of interest (POI) recommendation model based on user preferences and spatiotemporal context information. A training set is constructed based on each user's long-term and short-term check-in sequences. The cross-entropy loss function is used to calculate the POI prediction loss and geolocation encoding prediction loss of the POI recommendation model. The Adam optimizer is then used to update the parameters of the POI recommendation model, thus achieving the training of the POI recommendation model. The cross-entropy loss function is defined as:
[0100]
[0101] Loss = Loss poi +Loss geo
[0102] Loss poi Loss geo Loss represents the interest point prediction loss, geolocation encoding prediction loss, and total loss, respectively. i For user u at time t i Points of interest visited, g i For points of interest i Geographic location code, For the prediction module At time t i The probability value, For the prediction module At time t i The probability value.
[0103] Step 5: Input the user's long-term check-in sequence and short-term check-in sequence into the trained next interest point recommendation model based on user preferences and spatiotemporal context information to generate k interest points and recommend them to the user.
Claims
1. A method for recommending the next POI based on user preferences and spatiotemporal context information, characterized by: Includes the following steps: Step 1: Obtain all check-in records of a group of users from a location-based social network; Step 2, Data Preprocessing: Clean all check-in data, deleting invalid check-in records with missing users, points of interest, point of interest latitude and longitude, point of interest categories, or check-in times; deleting check-in records corresponding to points of interest accessed less than 10 times and check-in records of users with less than 100 check-in records; then, standardize the format of the remaining check-in data after cleaning, specifically: generate a uniform format of "week" and "hour" based on the timestamp of each check-in record, and generate a corresponding geolocation code based on the latitude and longitude of each check-in record; The sign-in records are stored according to user categories, and each user's sign-in records are reconstructed in chronological order. Next, a decision is made: if a user has more than 500 sign-in records, the 500 most recent sign-in records are used to form a long-term sign-in sequence; otherwise, all sign-in records are used to form a long-term sign-in sequence. Then, every 's' sign-in records in each user's sign-in sequence are divided into a short-term sign-in sequence, and the last 's1' sign-in records are combined with the previous 's-s1' sign-in records to form another short-term sign-in sequence. This process is repeated for all users to obtain the long-term and short-term sign-in sequences for each user. Step 3, Vector embedding of check-in record information: Low-dimensional dense vectors are used to embed points of interest and various auxiliary information. The vector embedding of auxiliary information is performed on users, geolocation codes, point of interest categories, "time" and "week", and category preferences. Step 4: Construct and train the next interest point recommendation model based on user preferences and spatiotemporal context information, specifically including: (1) Constructing a user preference feature extraction module; This module uses a two-layer attention mechanism to mine user preference features in the long-term check-in sequence. The first layer of attention mechanism uses a Transformer encoder based on a multi-head self-attention mechanism to capture the interrelationships between check-in records in the entire long-term check-in sequence in parallel. The second layer of attention mechanism uses a bilinear attention mechanism to capture the contribution of each check-in record to the user's category preference. (2) Construct a long-term behavioral feature extraction module: The input of this module is the user's long-term check-in sequence. The interest points, geolocation codes, interest point categories, and "time" and "week" attributes of each check-in record are concatenated into a vector. Then, the entire long-term check-in sequence is processed. The concatenated vector of the column is input into a multi-layer GRU. The output vector of the multi-layer GRU is concatenated with the user embedding vector, and then added to the output vector of the user preference feature extraction module through a fully connected layer. (3) Construct a short-term behavior feature extraction module: The input of this module is the user's short-term check-in sequence. The interest point embedding vector, geolocation encoding embedding vector and interest point category embedding vector of each check-in record are concatenated with their time embedding vectors to obtain three concatenated vectors. The three concatenated vectors are input into three GRUs with different parameters. The output vectors of the three GRUs are added with weights and then concatenated with the user embedding vector. After passing through a fully connected layer, the concatenated vector is added to the user embedding vector. (3) Add the output vector of the user preference feature extraction module to the layer; (4) Construct the prediction module: pass the output of the long and short-term behavior feature extraction modules through a nonlinear layer to output two interest point probability distribution vectors and two geographic location coding probability distribution vectors. The two interest point probability distribution vectors are merged into one interest point probability distribution vector through the interest point fusion layer, and the two geographic location coding probability distribution vectors are merged into one geographic location coding probability vector through the geographic location fusion layer. Then, sort the interest point probability distribution vector and the geographic location coding probability distribution vector according to the probability value from large to small, and take the top 10 geographic location coding probability values. Location encoding, taking the top k points of interest with the highest probability values within these geolocation codes to form a recommendation list output, where k takes the value of 1, 5 or 10, to obtain the next point of interest recommendation model based on user preferences and spatiotemporal context information; (5) Training the next point of interest recommendation model based on user preferences and spatiotemporal context information: construct a training set based on each user's long-term check-in sequence and short-term check-in sequence, use the cross-entropy loss function to calculate the point of interest prediction loss and geolocation encoding prediction loss of the next point of interest recommendation model, and use the Adam optimizer to update the parameters of the next point of interest recommendation model, thereby realizing the training of the next point of interest recommendation model; Step 5: Input the user's long-term check-in sequence and short-term check-in sequence into the trained next interest point recommendation model based on user preferences and spatiotemporal context information to generate k interest points and recommend them to the user; The specific process of embedding the interest points is as follows: ① Based on the check-in sequence of all users, a homogeneous graph is established, with each point of interest as a node in the homogeneous graph network, the transition relationship between points of interest as an edge in the homogeneous graph network, the weight of the edge being the number of transitions between two points of interest, and the direction from point of interest to point of interest is marked according to the time order to form a directed graph. ② Set the sampling length, sample based on the weights of edges in the isomorphic graph, and use a structured deep network embedding model to learn the sequence obtained by the above sampling, embedding all interest points on the directed graph into vectors.
2. The next POI recommendation method based on user preferences and spatiotemporal context information according to claim 1, characterized in that: The geolocation coding uses the DBSCAN clustering algorithm.
3. The next POI recommendation method based on user preferences and spatiotemporal context information according to claim 1, characterized in that: The specific process for embedding user, geolocation code, point of interest category, "time" and "week" is as follows: the user, geolocation code, point of interest category, "time" and "week" in the check-in data are encoded into one-hot vectors respectively, and the one-hot vectors are input into a normal embedding model to obtain the embedding vectors of user, geolocation code, point of interest category, "time" and "week".
4. The next POI recommendation method based on user preferences and spatiotemporal context information according to claim 1, characterized in that: The specific process of embedding the category preference is as follows: initialize a Y-dimensional vector [v0,…v] for user u∈U. Y-1 The number of times user u accesses each interest category is recorded in the corresponding position of the vector, and the interest category that is not accessed is recorded as 0; We obtain the vector [v0,…v Y-1 After that, the category preference vector for user u is defined as follows: Iterate through all users in U to obtain the category preference vector for each user.
5. The next POI recommendation method based on user preferences and spatiotemporal context information according to claim 1, characterized in that: The specific calculation process of the long-term behavioral feature extraction module is as follows: Among them, O long V represents the output of the long-term behavioral feature extraction module. P V is the concatenated vector of the entire long-term check-in sequence. u Embedding vectors for users, O per Let FC(·) represent a fully connected layer and MulGRU(·) represent a multi-layer GRU. The calculation process of GRU is as follows: x i =V i P z i =σ(W xz x i +W hz h i-1 +b z ) r i =σ(W xr x i +W hr h i-1 +b r ) c i =tanh(W xc x i +r i ⊙(W hc h i-1 )+b c ) h i =(1-z i )⊙c i +z i ⊙h i-1 Where σ represents the Sigmoid function, x i Given the input at time i, h i h is the output at time i. i-1 The output at time i-1, z i r i c i W is an intermediate variable. xz W hz W xr W hr W xc W hc For trainable parameters, b z b r b c The trainable bias term is tanh(), which is the tanh activation function, and ⊙ represents element-wise multiplication.
6. The next POI recommendation method based on user preferences and spatiotemporal context information according to claim 1, characterized in that: The specific calculation process of the short-term behavioral feature extraction module is as follows: Among them, O short V represents the output of the short-term behavioral feature extraction module. u Embedding vectors for users, O per V represents the output vector of the user preference feature extraction module, where α, β, and γ represent weights, GRU(·) represents a single-layer GRU module, and V l V g V c and V t These represent the embedding vectors of all points of interest, all geolocation encoding, all points of interest category, and all time embedding vectors in the short-term check-in sequence, respectively.
7. The next POI recommendation method based on user preferences and spatiotemporal context information according to claim 1, characterized in that: The cross-entropy loss function is defined as follows: Loss=Loss poi +Loss geo Loss poi Loss geo Loss represents the interest point prediction loss, geolocation encoding prediction loss, and total loss, respectively. i For user u at time t i Points of interest visited, g i For points of interest i Geographic location code, For the prediction module At time t i The probability value, For the prediction module At time t i The probability value, and Let N be the probability distribution vector of points of interest and the probability distribution vector of geographic location codes, where N is the total number of points of interest and X1 is the total number of geographic location codes.
Citation Information
Patent Citations
Continuous interest point recommendation method based on social spatio-temporal information and user preference
CN115422441A