Interest point recommendation method based on spatio-temporal knowledge graph attention network
Through the interest point recommendation method based on the space-time knowledge graph attention network, the dynamic characteristics of user check-in interest points are captured, and the problems of insufficient consideration of user dynamic behavior patterns in the prior art and the sparsity and weak semanticity of check-in data are solved, and more accurate and personalized interest point recommendations are achieved.
Patent Information
- Application Number
- CN202510003758.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-03-06
AI Technical Summary
The existing point-of-interest recommendation method fails to fully consider the dynamic behavior patterns of users, ignores the diversity of needs of different user groups, resulting in limited recommendation effects in dynamic environments, and the high sparsity and weak semanticity of check-in data limit the accuracy of recommendations.
The point of interest recommendation method based on the space-time knowledge graph attention network is adopted, and the dynamic characteristics of the user check-in points of interest are captured through multi-layer nonlinear feature fusion and dynamic feature update, and the user-interest point spatiotemporal relationship diagram is established, and the space-time knowledge graph attention network and Transformer model are used for feature enhancement and prediction.
It effectively alleviates the high sparsity and weak semantics of check-in data, significantly improves the accuracy of point-of-interest recommendations, improves the performance and robustness of the recommendation system, and can better meet users' personalized needs.
Smart Images

Figure CN119922232A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of interest point recommendation, and specifically relates to an interest point recommendation method based on a spatiotemporal knowledge graph attention network. Background Art
[0002] With the rapid development of location-based social networks (LBSN), related application platforms have been widely used in people's daily lives. These platforms not only allow users to establish social relationships, but also support users to share their physical locations and related content, such as comments, pictures, and videos, through "check-ins". Point of Interest (POI) recommendation is an important service in location-based social networks. It analyzes users' historical check-in data to mine their behavior patterns and personalized preferences, and provides support for users to plan their itineraries and companies to optimize services.
[0003] Existing POI recommendation methods usually rely on users' historical check-in data and geographic location information. However, these methods fail to fully consider users' dynamic behavior patterns and ignore the diversity of needs of different user groups. Therefore, these methods have limited recommendation effects in dynamic environments. In addition, the high sparsity and weak semantics of check-in data further restrict the accuracy of recommendations.
[0004] Since existing methods generally face the challenges of high sparsity of sign-in data, weak semantics, and insufficient modeling of dynamic spatiotemporal information, a new technical solution is urgently needed. Summary of the invention
[0005] The purpose of the present invention is to provide a point of interest recommendation method based on a spatiotemporal knowledge graph attention network. This method captures the dynamic characteristics of user check-in points of interest through multi-layer nonlinear feature fusion and dynamic feature update, effectively alleviating the problems of high sparsity and weak semantics of check-in data, thereby significantly improving the accuracy of recommendations.
[0006] To achieve the above object, the present invention provides a method for recommending points of interest based on a spatiotemporal knowledge graph attention network, comprising the following steps:
[0007] S1, establish a spatiotemporal relationship graph of user-interest points;
[0008] According to the similarity between users, the similarity relationship between points of interest and the spatiotemporal relationship between points of interest, a user-point of interest spatiotemporal relationship graph is established;
[0009] S2, embed the user-POI spatiotemporal relationship graph into a spatiotemporal knowledge graph;
[0010] S3, information coding;
[0011] The importance of the target node in the spatiotemporal knowledge graph structure is captured through centrality coding, and the spatial distance and time interval between the target nodes are calculated through spatiotemporal coding;
[0012] S4, build a spatiotemporal knowledge graph attention network;
[0013] The spatiotemporal features and multi-head attention mechanism are used to expand the receptive field of the spatiotemporal knowledge graph, so as to calculate and capture the relationship between target nodes, update the target nodes using the spatiotemporal weighted features of neighboring nodes, and use skip connections and activation functions to improve the expressiveness of the model.
[0014] S5, task prediction;
[0015] The spatiotemporal knowledge graph attention network in S4 is embedded into the multi-layer Transformer model, and feature enhancement is achieved through residual connection and normalization operations. After the target node features are enhanced by the multi-layer Transformer model, they are passed to the prediction layer to process specific prediction tasks.
[0016] Preferably, in S1, the similarity between users includes the social relationship similarity Check-in location similarity Similarity with check-in time The check-in location similarity The calculation method is as follows:
[0017]
[0018] Among them, UL i Represents user u i The check-in location vector, UL j Represents user u j The check-in position vector, For user u i A collection of interest areas that you have checked in to. For user u j The set of interest areas that have been checked in, α represents the penalty intensity parameter, Represents user u i and user u j Symmetric difference on the check-in area, Represents user u i and user u j All check-in areas, penalty items Used to penalize user pairs with large differences in check-in interest areas.
[0019] Preferably, in S2, the spatiotemporal knowledge graph embedding includes a TransR embedding method, which models the spatiotemporal check-in relationship between users and points of interest.
[0020] Preferably, in S2, the spatiotemporal knowledge graph embedding also includes an attention mechanism model, which uses the weight information of similarity edges between users and similarity edges between points of interest to perform dynamic weighted aggregation.
[0021] Preferably, in S3, the centrality encoding includes a centrality feature vector, a centrality feature vector c i The calculation method is as follows:
[0022] c i =[C D (i),C B (i),C E (i)];
[0023] Among them, C D (i) represents the degree centrality index, C B (i) represents the betweenness centrality index, C E (i) represents the eigenvector centrality index.
[0024] Preferably, in S3, the spatiotemporal coding method includes a spatiotemporal relationship function st(d ij ,t ij ), the calculation method is as follows:
[0025] If user u k At the same time, at the point of interest i and p j Signed in;
[0026] Among them, d ij Represents the spatial distance, t ij represents the time interval, σ d and σ t Represents the scaling parameter.
[0027] Preferably, in S4, the spatiotemporal knowledge graph attention network integrates the spatiotemporal features into the target node features, and the calculation method is as follows:
[0028]
[0029] in, represents the similarity score between the target node i and the neighbor node j in the Hth attention head, h i represents the feature vector of target node i, h j represents the feature vector of neighbor node j, W Q Represents the query weight matrix, W K represents the weight matrix of the key, represents the scaling factor, st(d ij,t ij ) represents the space-time relationship function.
[0030] Preferably, the similarity score Normalize to get the spatiotemporal weighted attention weights The calculation is as follows:
[0031]
[0032] All spatiotemporal weighted attention weights are concatenated and combined through the linear transformation matrix Wo to obtain MultiHead(Q, K, V), which is calculated as follows:
[0033]
[0034] Among them, Q, K and V represent the input feature matrix.
[0035] Preferably, in S4, the skip connection is calculated as follows:
[0036]
[0037] Among them, σ represents the activation function, h j Represents the feature vector of neighbor node j of target node i, h′ i represents the updated node embedding of target node i, and α represents the learnable parameter.
[0038] Preferably, in S5, the prediction layer is calculated as follows:
[0039]
[0040] Among them, W p represents the weight matrix of the prediction layer, b p represents the bias term, σ represents the output activation function, Represents the prediction result of target node i.
[0041] Therefore, the present invention adopts the above-mentioned method for recommending points of interest based on the spatiotemporal knowledge graph attention network. Compared with the existing invention, the present invention has the following significant beneficial effects:
[0042] (1) The present invention effectively alleviates the problems of high sparsity and weak semantics of check-in data by constructing a knowledge graph for recommending points of interest that integrates spatiotemporal information;
[0043] (2) The present invention conducts in-depth analysis of the check-in behaviors of similar user groups and the personalized preferences of users for similar points of interest, and builds a model to extract features and make recommendation predictions on the data, thereby significantly improving the accuracy of point of interest recommendations;
[0044] (3) The present invention can capture the importance of nodes and their spatiotemporal dynamic characteristics by designing centrality coding and spatiotemporal coding, thereby enhancing the node embedding representation capability and providing a richer feature vector for the model;
[0045] (4) The present invention can effectively solve the shortcomings of existing POI recommendation methods and significantly improve the accuracy of POI recommendation, thereby improving the performance and robustness of the recommendation system;
[0046] (5) The present invention combines the spatiotemporal knowledge graph attention mechanism and the Transformer architecture, which can dynamically update node embeddings, mine and predict points of interest that users may visit, thereby better meeting the personalized needs of users.
[0047] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is an architecture diagram of a method for recommending points of interest based on a spatiotemporal knowledge graph attention network according to the present invention;
[0049] Figure 2 This is a user-POI spatiotemporal relationship graph of a POI recommendation method based on a spatiotemporal knowledge graph attention network of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used in the present invention should be the common meaning understood by people with general skills in the field to which the present invention belongs.
[0051] Embodiment 1
[0052] like Figure 1 As shown, a method for recommending points of interest based on a spatiotemporal knowledge graph attention network of the present invention comprises the following steps:
[0053] S1, establish a spatiotemporal relationship graph of user-interest points;
[0054] In the location-dependent social network scenario, user groups with common interest preferences have an important influence on information recommendation and user behavior analysis. The present invention uses a spatiotemporal knowledge graph construction method containing four hierarchical structures, which can efficiently utilize the intrinsic connections between these users' check-in activities and location categories. The spatiotemporal knowledge graph structure includes: user group layer, user layer, point of interest layer and point of interest category layer.
[0055] The construction of the user group layer adopts the spectral clustering algorithm to divide and group users according to the similarity measurement between users. Therefore, the present invention regards the user clusters formed in the spectral clustering process as the basic node units of the user group layer, so as to effectively capture and characterize the check-in features of user groups with similar behaviors. In order to quantify the similarity between users, we use Represents the similarity between users, and the calculation formula is as follows:
[0056]
[0057] in, Represents user u i and user u j The similarity of social relationships between Represents user u i and user u j The similarity of check-in locations between Represents user u i and user u j The similarity of check-in time between them.
[0058] The more common friends two users have, the higher the similarity of their social relationships. The calculation formula is as follows:
[0059]
[0060] in, Represents user u i Friends collection, Represents user u j Friends collection, Represents user u i and user u j The collection of common friends, Represents user u i and user u j All friends collection of
[0061] By analyzing the check-in behavior of users, the similarity of the check-in locations of users is revealed. Represents user u i and user u jThe similarity of check-in locations between them.
[0062] In order to solve the sparsity problem of check-in data, the K-means clustering algorithm is used to divide the points of interest (POIs) into K regions of interest (ROIs) based on the geographic location information to achieve the aggregation of geographic locations. Then, based on the check-in records of users in each region of interest, the check-in location similarity between users is calculated by comparing the check-in frequencies of users in different regions of interest.
[0063] Define a global check-in location matrix UL M×K , the matrix records the visit check-in information of all users to each area of interest, as shown below:
[0064]
[0065] Where M represents the number of users, K represents the number of interest areas, and r i,v Represents user u i Normalized check-in times in the vth interest area. If the normalized check-in times of a user in K interest areas are represented as a vector, then user u i The check-in position vectors are:
[0066] UL i =(r i,1 ,r i,2 ,...,r i,v ,...r i,K );
[0067] User j The check-in position vector is expressed as:
[0068] UL j =(r j,1 ,r j,2 ,...,r j,v ,...r j,K ).
[0069] In order to optimize the measurement of user check-in behavior similarity, the traditional cosine similarity only considers the vector direction and ignores the actual intersection and coverage of the interest area. The check-in location similarity measurement method adopted by the present invention introduces a penalty mechanism based on cosine similarity to reduce the similarity calculation deviation between users caused by large regional differences, thereby enhancing the robustness of the similarity measurement. The calculation method is as follows:
[0070]
[0071] Among them, UL i Represents user u i The check-in location vector, UL J Represents user u j The check-in position vector, For user u i A collection of interest areas that you have checked in to. For user u j The set of interest areas that have been checked in, α represents the penalty intensity parameter, Represents user u i and user u j The symmetric difference set on the check-in areas is the set of check-in areas that are exclusively occupied by two users. Represents user u i and user u j All check-in areas, penalty items Used to penalize user pairs with large differences in check-in interest areas.
[0072] The continuous time is divided by time slot partitioning technology to quantify the time characteristics of user check-in behavior. If two users check in at the same time slots, the distribution of the check-in time slots is more similar, indicating that their check-in behaviors are more similar at the time level. The present invention divides the time continuum of a day into 96 time slots of equal length, thereby providing a fine time granularity analysis for check-in behavior. For each user, a 96-dimensional check-in time matrix UT is constructed. M×96 , where each element represents the number of check-ins of the user in the corresponding time slot, as shown below:
[0073]
[0074] Where M is the number of users, p i,k Represents user u i Normalized number of check-ins at the kth time slot.
[0075] The normalized check-in times of the user in 96 time slots are expressed as a vector, then user u i The check-in time vector is UT i =(f i,0 ,f i,1 ,...,f i,k ,...,f i,95 ), user u j The check-in time vector is UT j =(f j,0 ,f j,1 ,...,f j,k ,...,f j,95 ), then user u i and user uj Check-in time similarity The calculation method is as follows:
[0076]
[0077] The construction of the user layer uses the spectral clustering algorithm, which has the ability to process linearly inseparable data and can fully consider the relationship between entities when processing graph structure data. Especially when facing high-dimensional and sparse data sets, the spectral clustering algorithm shows excellent performance. The social relationship between users can be represented by the social relationship graph Q(U,E), where U is the number of all users (u 1, u 2, u 3, …,u M ) set, E is the weight of the edge e ij Set, construct the user similarity matrix W,
[0078]
[0079] Where M represents the number of users. For any two users u in U i and u j , e ij Represents user u i and user u j The similarity between
[0080] For a user u in the social graph i , define degree d i It is the sum of the weights of all edges connected to it, calculated as follows:
[0081]
[0082] Calculate the degree of each user node and get the M×M degree matrix D. Normalized Laplace matrix L Sysm The calculation is as follows:
[0083]
[0084] Among them, W represents the user similarity matrix and D represents the degree matrix.
[0085] Calculate L Sysm The eigenvalue of and the corresponding eigenvector The matrix composed of feature vectors f is normalized row by row to form an n×k1-dimensional feature matrix F. Each row in the matrix F is equivalent to a user with k1 features, and there are n users in total.
[0086] For the matrix F composed of n k1-dimensional vectors, the present invention uses the eigengap method to determine the number of clusters. Sysm Arrange the eigenvalues from large to small to obtain a new set of eigenvalues and calculate the eigengap sequence The subscript corresponding to the first maximum value in the eigengap sequence is the number of clusters k. Each row in the feature matrix F is regarded as a new user with k features and K-means clustering is applied to obtain the user grouping results. The user group set {U1,U2,U3,...,U k}, that is, the user group node in the spatiotemporal knowledge graph.
[0087] The clustering results are further used to optimize the user similarity matrix W to highlight the similarity of users in the same group and reduce the similarity between different groups. In order to make the similarity matrix W focus more on the similarity within the group, a weighting factor matrix A is defined, where the matrix element a ij , set according to the following rules:
[0088]
[0089] Among them, if U(u i )=U(u j )User u i and user u j belong to the same group, the weighting factor is γ, γ>1; if U(u i )≠U(u j )User u i and user u j If they do not belong to the same group, the weighting factor is δ, δ<1.
[0090] Apply the weighting factor matrix A to the user similarity matrix W to obtain the weighted user similarity matrix W', which is calculated as follows:
[0091] W'=W·A;
[0092] By constructing a POI category layer, POIs can be classified to explore the potential information between POIs. Usually POIs have their own category attributes, which usually reflect the function or scene characteristics of the POI, such as restaurants, cafes, parks, etc. Category attributes can indicate the potential intention of users when visiting the POI. For example, users who choose restaurants usually have dietary needs, while users who visit parks may seek leisure or exercise. Define C as all POI categories {C1, C2, ..., C k} collection. Among the points of interest p belonging to the same category i and points of interest i Establish a similar relationship between points of interest, and the relationship weight is expressed as b ij , as shown below:
[0093]
[0094] Among them, C(p i ) represents the point of interest p i The category to which it belongs.
[0095] like Figure 2 As shown in Figure 1, a user-POI spatiotemporal relationship graph is constructed based on user similarity, POI similarity relationship, and spatiotemporal relationship between POIs. Where u represents a user node and p represents a POI node. The edges between nodes represent different relationships, where the edges between users represent the similarity relationship between users, and the edges between users and POIs (t i ,d i ) represents the time and geographic location of the user’s check-in, and the edges between POIs represent the similarity relationship between POI categories.
[0096] S2, embed the user-POI spatiotemporal relationship graph into a spatiotemporal knowledge graph;
[0097] The present invention adopts the TransR (Translating on Relation-specific Spaces) embedding method to model the spatiotemporal check-in relationship between users and points of interest. The TransR method generates an independent projection space for each relationship type, which can effectively capture multi-dimensional complex relationship features. The check-in relationship between users and points of interest not only includes the basic connection information between users and points of interest, but also incorporates the time and geographic location information of the check-in. Through the projection mechanism of TransR, these spatiotemporal features can be effectively modeled in the embedding space. The spatiotemporal check-in relationship between users and points of interest is represented by a triple (u, r, p), where u represents the user node, r represents the check-in relationship, which includes the multi-dimensional features of time and location, and p represents the point of interest node.
[0098] The role of TransR is to pass the relationship specific projection matrix M r ∈R k×d , embed the user node u and the point of interest node p into the specific space of the relation r, so that the user's embedding vector u r It can be translated to the embedding vector p of the interest point r Alignment, calculated as follows:
[0099] u r =M r u;
[0100] p r =M r p;
[0101] In order to further enhance TransR's ability to express time and location features in the check-in relationship, the present invention selects spatiotemporal information encoding as an additional embedding feature. The check-in time t captures the regularity of the user's check-in behavior through periodic encoding, and uses sine and cosine functions for periodic representation. The calculation method is as follows:
[0102]
[0103] The geographic location (latitude and longitude) of the point of interest is encoded as a fixed-length vector (x, y). The geographic location encoding ensures that the spatial information of the check-in is included in the embedded features, thereby reflecting the user's check-in location preference. s-t The calculation method is as follows:
[0104] r s-t =concat(t,(x,y));
[0105] Use the L2 norm to calculate the distance between the positive sample triple and the negative sample triple in the embedding space. The calculation method is as follows:
[0106]
[0107]
[0108] To further optimize the model so that the distance between positive sample triplets is as small as possible and the distance between negative sample triplets is as large as possible, the spatiotemporal knowledge graph is trained using a margin-based loss function, which is calculated as follows:
[0109] L KG =∑ (u,r,p)∈S ∑ (u′,r,p′)∈S′ max(0,f r (u,p)+γ-f r (u′,p′));
[0110] Among them, L KG L represents the loss function of the spatiotemporal knowledge graph, S represents the set of positive sample triplets, S′ represents the set of negative sample triplets generated by negative sampling, and γ represents the positive boundary value, which is used to control the distance difference between positive and negative samples. KG It is used to optimize the embedding results of the model in the embedding space. Through the above method, TransR can effectively establish the relationship between users and points of interest in the spatiotemporal embedding space.
[0111] The present invention adopts the attention mechanism (GraphAttentionNetworks, GAT) model to adaptively assign weights to neighbor nodes, with the aim of enhancing the expressive power of embedding users and POIs. In the model, similarity edges between users and similarity edges between POIs are regarded as static similarity edges, while the GAT model can use the weight information of these edges for dynamic weighted aggregation. In order to accurately express the relationship between nodes, the pre-calculated similarity of user similarity edges and POI similarity edges is used as the initial value of the edge weight of the GAT model, denoted as w ij . Weight w ij represents the similarity between node i and node j. The GAT model uses the weights w of these pre-computed similarity edges ij , the influence of neighbor nodes on the target node is dynamically adjusted through the attention mechanism. The calculation formula of attention weight is as follows:
[0112]
[0113] Among them, LeakyReLU represents the activation function, P represents the feature transformation matrix, and h i represents the feature vector of target node i, h j represents the feature vector of neighbor node j, N(i) is the set of neighbor nodes of target node i, α ij Indicates the influence of neighbor node j on target node i.
[0114] Node embedding is achieved by integrating users' spatiotemporal check-in behavior information, social similarities between users, and dynamic adjustments to temporal and spatial changes. This embedding method enables the model to generate dynamic recommendations based on users' social relationships, check-in time and location features. At the same time, the embedding of POI nodes combines the spatiotemporal location features of POIs, category similarities, and preferences that change over time and space, which helps to deeply understand the connections between different POIs, thereby improving the diversity and accuracy of the recommendation system. Finally, by aggregating the features of neighboring nodes, the model can obtain updated node embeddings to enhance the recommendation effect. The calculation method is as follows:
[0115] h′ i =σ(∑ j∈N(i) a ij ·Wh j );
[0116] Among them, σ represents the nonlinear activation function, a ij represents the influence of neighbor node j on target node i, h′ i represents the updated node embedding of target node i.
[0117] Through node embedding, neighbor node representations are dynamically aggregated, enabling the model to capture richer interactive relationships between users and points of interest, thereby improving the performance and robustness of the recommendation system.
[0118] S3, information coding;
[0119] The present invention uses centrality coding to comprehensively evaluate the importance of the target node in the spatiotemporal knowledge graph structure. Centrality coding includes degree centrality index, betweenness centrality index and eigenvector centrality index.
[0120] The degree centrality index is used to measure the number of connections of the target node, reflecting the direct influence of the target node, and is used to evaluate the user's check-in frequency. The calculation formula is as follows:
[0121]
[0122] Where deg(i) represents the degree of the target node i, |V| is the total number of nodes in the spatiotemporal knowledge graph, and C D (i) represents the degree centrality value of target node i.
[0123] The betweenness centrality index is used to evaluate the role of the target node in the shortest path between different node pairs, reflecting the bridge role of the target node in information flow. The calculation method is as follows:
[0124]
[0125] Among them, σ st (i) represents the total number of shortest paths between the target node pair s and t, σ st (i) represents the number of shortest paths passing through target node i, C B (i) represents the betweenness centrality value of target node i. The betweenness centrality index can identify the target nodes that play a key intermediary role in the transmission of information flow.
[0126] The eigenvector centrality index focuses on the centrality of neighbor nodes and is suitable for identifying target nodes with high influence. The calculation method is as follows:
[0127]
[0128] Among them, A ij is the adjacency matrix, λ is the corresponding eigenvalue, N(i) is the set of neighbor nodes of target node i, C E (j) represents the eigenvector centrality value of neighbor node j of target node i, C E(i) represents the eigenvector centrality value of the target node i. The eigenvector centrality index can capture nodes with a wide range of influence in the global structure of the spatiotemporal knowledge graph.
[0129] In order to integrate the above centrality indicators, the present invention constructs a centrality characteristic vector, which is formed by combining the three centrality indicators: i , calculated as follows:
[0130] c i =[C D (i),C B (i),C E (i)];
[0131] Among them, c i The independent information of each centrality indicator is retained, which improves the overall representation of the importance characteristics of the target node.
[0132] In order to enhance the expressiveness of the model, a learnable weight matrix W is used c Generate a weighted centrality feature vector so that the model can automatically learn the importance of different centrality indicators during training. The calculation method is as follows:
[0133] important(i)=W c ·c i ;
[0134] in, is a learnable weight matrix, and d is the dimension of the mapped feature space. After training, W c The parameters of c are dynamically adjusted to optimize the importance of the centrality index in a specific task. important(i) is the weighted centrality feature vector of target node i, indicating that c i The feature vector obtained after mapping to the new feature space.
[0135] Afterwards, the weighted centrality feature vector important(i) is concatenated with other features f(i) to form the target node vector h(i), which is calculated as follows:
[0136] h(i)=[f(i),important(i)];
[0137] h(i) combines the weighted centrality information of the target node with other features, thereby enriching the feature content and improving the model's ability to understand and utilize the importance of the target node.
[0138] The spatiotemporal knowledge graph model in the present invention is presented as a dynamic graph structure, that is, the composition of the graph will change at different time points. For this reason, a spatiotemporal encoding method is proposed to more effectively process the spatial and temporal characteristics of user check-in points of interest.
[0139] Define st(d ij ,t ij ) is a spatiotemporal relationship function, which is used to calculate spatial distance and time interval and construct spatiotemporal features. Among them, the spatial distance is calculated using the Euclidean distance, and the calculation method is as follows:
[0140]
[0141] Among them, (x i ,y i ) and (x j ,y j ) represents user u k Any two check-ins at a point of interest i and points of interest j The geographical coordinates, d ij Represents user u k Points of interest for two check-ins i and points of interest j The distance between.
[0142] The time interval is calculated as follows:
[0143] t ij =|t i -t j |;
[0144] Among them, t i and t j Represents user u k Any two check-ins at a point of interest i and points of interest j The timestamp, t ij Is user u k Points of interest for two check-ins i and points of interest j time interval.
[0145] Combining spatial distance and time interval to construct the space-time relationship function, the calculation method is as follows:
[0146] If user u k At the same time, at the point of interest i and p j Signed in;
[0147] Among them, σ d and σ t represents the scaling parameter, which is used to control the influence of spatial distance and time interval, st(d ij ,t ij ) is the spatiotemporal relationship function between the target node i and its neighbor node j.
[0148] Through the spatiotemporal feature encoding method, spatial features and temporal features can be effectively integrated to provide refined spatiotemporal feature vectors for the training of spatiotemporal knowledge graph models. This encoding method can not only describe the geographical location and time relationship in the user's check-in behavior, but also adapt to the dynamic change characteristics of the spatiotemporal knowledge graph model, thereby improving the accuracy and flexibility of user interest point recommendations.
[0149] S4, build a spatiotemporal knowledge graph attention network;
[0150] In the process of constructing the spatiotemporal knowledge graph attention network, the present invention expands the receptive domain of the spatiotemporal knowledge graph model by fusing spatiotemporal features with target node features and using a multi-head attention mechanism, thereby more comprehensively calculating and capturing the relationship between target nodes. The calculation method is as follows:
[0151]
[0152] in, represents the similarity score between the target node i and the neighbor node j at the Hth attention head, h i represents the feature vector of target node i, h j represents the feature vector of neighbor node j; W Q Represents the query weight matrix, W K represents the weight matrix of the key, represents the scaling factor, st(d ij ,t ij ) represents the space-time relationship function.
[0153] Use the Softmax function to score the above similarity Normalize to get the spatiotemporal weighted attention weights The calculation is as follows:
[0154]
[0155] All spatiotemporal weighted attention weights are concatenated and combined through the linear transformation matrix Wo to obtain MultiHead(Q, K, V), which is calculated as follows:
[0156]
[0157] Among them, Q (query), K (key), and V (value) represent the input feature matrix.
[0158] The target node is updated using the spatiotemporal weighted features of each neighboring node. Skip connections are used to alleviate the gradient vanishing problem in deep models, and activation functions are combined to improve the ability to retain deep features of the model. The calculation method is as follows:
[0159]
[0160] Among them, σ represents the activation function, h j Represents the feature vector of neighbor node j of target node i, h′ i represents the updated node embedding of the target node i, and α represents a learnable parameter, which is used to control the weight of the jump connection so that the model can adaptively adjust the fusion ratio of the original features and the updated features.
[0161] Through dynamic weight calculation and jump connection, the influence of original features and aggregated features is effectively balanced, improving the adaptability and expressiveness of the model. This method not only retains the original features of the target node, but also fully absorbs the feature information of neighboring nodes, thereby significantly improving the adaptability and expressiveness of the model and achieving more accurate feature representation and reasoning capabilities.
[0162] S5, task prediction;
[0163] The spatiotemporal knowledge graph attention network (ST-KGAT) is integrated into the multi-layer Transformer model as a module, and residual connections and normalization techniques are used to enhance features to capture the complex relationships between target nodes.
[0164] After being processed by the spatiotemporal knowledge graph attention network module, the weighted feature vector of each target node is added to the original input feature through a residual connection, and the updated target node feature vector is obtained after normalization. The calculation method is as follows:
[0165]
[0166] Among them, h i represents the feature vector of target node i, ST-KGAT(h i ) indicates that the ST-KGAT module processes h i The weighted feature vector obtained after the layer normalization operation is obtained. LayerNorm represents the layer normalization operation. The updated target node feature vector is obtained through the layer normalization operation.
[0167] Then, the updated target node is fed into a feedforward neural network containing two layers of linear transformation, and an activation function is used in the middle to introduce nonlinearity to enhance the expressiveness of the model. The calculation method of the feedforward neural network is as follows:
[0168]
[0169] Among them, W1 and W2 represent weight matrices, b1 and b2 represent bias terms, and max represents the ReLU activation function.
[0170] After that, the residual connection and normalization processing are introduced again, and the calculation method is as follows:
[0171]
[0172] in, Represents the output features of the feedforward neural network. Through the residual connection in this step, the feature information of the previous spatiotemporal knowledge graph attention network layer can be retained, thereby further alleviating the gradient vanishing problem in the deep network.
[0173] After feature enhancement by the multi-layer Transformer model, the target node features are passed to the prediction layer to process specific prediction tasks. For example, in the node classification task, predict which group each user belongs to or which attribute they have, or in the connection prediction task, predict whether two users will become friends or like the same product. The prediction layer is calculated as follows:
[0174]
[0175] Among them, W p represents the weight matrix of the prediction layer, b p represents the bias term, σ represents the output activation function, Represents the prediction result of target node i.
[0176] In order to improve the performance of the recommendation task based on user implicit feedback (such as whether to visit a point of interest), the present invention uses a binary cross entropy loss function to optimize the model. This method helps the model learn to accurately identify user preferences from user behavior, thereby more effectively understanding and predicting user behavior based on implicit feedback. Using the binary cross entropy loss function as the recommendation loss function L REC , calculated as follows:
[0177]
[0178] in, Represents user u i Point of interest i The actual sign-in status (1 means signed in, 0 means not signed in), represents the user u predicted by the model i Visiting points of interest i probability.
[0179] The overall loss function L is obtained by combining the integral boundary loss function and the recommended loss function. ST-KGAT , calculated as follows:
[0180]
[0181] Among them, Θ is the parameter of the model and λ is the weight controlling the L2 regularization term.
[0182] In this way, the overall loss function L ST-KGAT It not only guides model learning during the training process, but also generates the final recommendation results through the predicted probability output by the model during the prediction stage.
[0183] Therefore, the present invention adopts the above-mentioned point of interest recommendation method based on the spatiotemporal knowledge graph attention network. This method captures the dynamic characteristics of user check-in points of interest through multi-layer nonlinear feature fusion and dynamic feature update, effectively alleviating the problems of high sparsity and weak semantics of check-in data, thereby significantly improving the accuracy of recommendations.
[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for recommending points of interest based on a spatiotemporal knowledge graph attention network, characterized in that: The following steps are involved: S1, establish a spatiotemporal relationship graph of user-interest points; According to the similarity between users, the similarity relationship between points of interest and the spatiotemporal relationship between points of interest, a user-point of interest spatiotemporal relationship graph is established; S2, embed the user-POI spatiotemporal relationship graph into a spatiotemporal knowledge graph; S3, information coding; The importance of the target node in the spatiotemporal knowledge graph structure is captured through centrality coding, and the spatial distance and time interval between the target nodes are calculated through spatiotemporal coding; S4, build a spatiotemporal knowledge graph attention network; The spatiotemporal features and multi-head attention mechanism are used to expand the receptive field of the spatiotemporal knowledge graph, so as to calculate and capture the relationship between target nodes, update the target nodes using the spatiotemporal weighted features of neighboring nodes, and use skip connections and activation functions to improve the expressiveness of the model. S5, task prediction; The spatiotemporal knowledge graph attention network in S4 is embedded into the multi-layer Transformer model, and feature enhancement is achieved through residual connection and normalization operations. After the target node features are enhanced by the multi-layer Transformer model, they are passed to the prediction layer to process specific prediction tasks.
2. According to claim 1, a method for recommending points of interest based on a spatiotemporal knowledge graph attention network is characterized in that: In S1, the similarity between users includes the similarity of social relationships. Check-in location similarity Similarity with check-in time The check-in location similarity The calculation method is as follows: Among them, UL i Represents user u i The check-in location vector, UL j Represents user u j The check-in position vector, For user u i A collection of interest areas that you have checked in to. For user u j The set of interest areas that have been checked in, α represents the penalty intensity parameter, Represents user u i and user u j Symmetric difference on the check-in area, Represents user u i and user u j All check-in areas, penalty items Used to penalize user pairs with large differences in check-in interest areas.
3. According to claim 1, a method for recommending points of interest based on a spatiotemporal knowledge graph attention network is characterized in that: In S2, the spatiotemporal knowledge graph embedding includes the TransR embedding method, which models the spatiotemporal check-in relationship between users and POIs.
4. According to claim 1, a method for recommending points of interest based on a spatiotemporal knowledge graph attention network is characterized in that: In S2, the spatiotemporal knowledge graph embedding also includes an attention mechanism model, which uses the weight information of similarity edges between users and similarity edges between points of interest to perform dynamic weighted aggregation.
5. According to claim 1, a method for recommending points of interest based on a spatiotemporal knowledge graph attention network is characterized in that: In S3, the centrality encoding includes the centrality feature vector, the centrality feature vector c i The calculation method is as follows: c i =[C D (i),C B (i),C E (i)]; Among them, C D (i) represents the degree centrality index, C B (i) represents the betweenness centrality index, C E (i) represents the eigenvector centrality index.
6. The method for recommending points of interest based on a spatiotemporal knowledge graph attention network according to claim 1, characterized in that: In S3, the spatiotemporal coding method includes the spatiotemporal relationship function st(d ij ,t ij ), the calculation method is as follows: If user u k At the same time, at the point of interest i and p j Signed in; Among them, d ij Represents the spatial distance, t ij represents the time interval, σ d and σ t Represents the scaling parameter.
7. The method for recommending points of interest based on a spatiotemporal knowledge graph attention network according to claim 1, characterized in that: In S4, the spatiotemporal knowledge graph attention network integrates spatiotemporal features into the target node features, and the calculation method is as follows: in, represents the similarity score between the target node i and the neighbor node j in the Hth attention head, h i represents the feature vector of target node i, h j represents the feature vector of neighbor node j, W Q Represents the query weight matrix, W K represents the weight matrix of the key, represents the scaling factor, st(d ij ,t ij ) represents the space-time relationship function.
8. The method for recommending points of interest based on a spatiotemporal knowledge graph attention network according to claim 7, characterized in that: Similarity score Normalize to get the spatiotemporal weighted attention weight The calculation is as follows: All spatiotemporal weighted attention weights are concatenated and combined through the linear transformation matrix Wo to obtain MultiHead(Q, K, V), which is calculated as follows: Among them, Q, K and V represent the input feature matrix.
9. The method for recommending points of interest based on a spatiotemporal knowledge graph attention network according to claim 1, characterized in that: In S4, the skip connection is calculated as follows: Among them, σ represents the activation function, h j Represents the feature vector of neighbor node j of target node i, h′ i represents the updated node embedding of target node i, and α represents the learnable parameter.
10. The method for recommending points of interest based on a spatiotemporal knowledge graph attention network according to claim 1, characterized in that: In S5, the prediction layer is calculated as follows: Among them, W p represents the weight matrix of the prediction layer, b p represents the bias term, σ represents the output activation function, Represents the prediction result of target node i.
Citation Information
Patent Citations
Interest point recommendation method based on user spatio-temporal behavior and social information
CN116257704A
Space-time dynamic perception interest point recommendation method and system and storage medium
CN117435819A
Interest point recommendation method based on knowledge graph
CN119226599A