Real-time Point of Interest Recommendation Method Based on Urban Spatio-temporal Knowledge Graph
By constructing a city space-time knowledge graph, using GCN and LSTM models to learn the dynamic characteristics of urban entities, combined with user preferences, the problems of positive and negative samples imbalance and difficulty in information dissemination in point-of-interest recommendations are solved, and efficient point-of-interest recommendations are achieved.
Patent Information
- Application Number
- CN202211223975.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-06
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-10-06
AI Technical Summary
In the existing recommendation methods for point-of-interest recommendation methods, the proportion of positive and negative samples is imbalanced and information dissemination between urban multi-source data is difficult, and traditional methods are difficult to effectively capture the dynamic characteristics of urban entities.
The city space-time knowledge graph is constructed, and points of interest are recommended by using graph convolutional neural network (GCN) and long-term short-term memory artificial neural network (LSTM) combined with self-attention models.
It improves the performance and real-time performance of the point-of-interest recommendation system, can better characterize users' short-term and long-term preferences, and achieve efficient point-of-interest recommendations.
Smart Images

Figure CN115470362B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of point - of - interest (POI) recommendation, and mainly relates to a real - time POI recommendation method based on an urban spatio - temporal knowledge graph. Background Art
[0002] With the rapid development of the Internet and the advent of the big data era, location - based information service applications such as Yelp, Gowalla, and Dianping have been gradually widely used. Users can record their ratings and feelings about the POIs they visit on the platform by browsing, checking in, etc. Subsequently, there has been an explosive growth in POI check - in and rating data, providing a good background and data foundation for the development of POI recommendation technology. A POI is a coordinate in a geographical location system, which can refer to stores such as restaurants, gymnasiums, clothing stores, etc. There are a large number and various types of POIs, and each POI contains multiple attributes such as name, category, geographical location, brand, rating, check - in quantity, etc. The POI recommendation technology aims to combine the user's historical visit records of POIs with the rich features of POIs to recommend the stores that the user is most likely to be interested in.
[0003] Early researchers proposed methods based on traditional machine learning (such as collaborative filtering). Such methods only utilize the historical interaction information between users and POIs, and recommend similar POIs to similar users according to preferences, that is, user - based collaborative filtering; or recommend POIs to users based on the similarity between POIs, that is, content - based collaborative filtering. However, due to the limited interaction data between users and POIs and the imbalance between positive and negative samples, it is difficult to well learn the representations of users and POIs. In recent years, existing work on POI recommendation has utilized separate auxiliary information, such as geographical location (e.g., longitude and latitude), category, etc. However, the auxiliary information mainly adopts the form of a bipartite graph. Applying this information to representation learning can improve the performance of POI recommendation to a certain extent, but it cannot well structure the information. The information is isolated from each other in different bipartite graphs, which makes it difficult for information to spread between graphs. At the same time, entities such as POIs, brands, and users in a city are often dynamically changing, while the bipartite graphs constructed in previous work are often static and cannot capture the dynamic characteristics of urban entities changing over time.
[0004] To address the deficiencies and challenges of traditional point-of-interest (POI) recommendation methods, the present invention introduces a city spatio-temporal knowledge graph as an auxiliary means for POI recommendation. A knowledge graph consists of various types of entities as nodes and various types of relationships between entities as edges, depicting the concepts and relationships in the real world in the form of a graph. City knowledge graphs are often constructed from multi-source heterogeneous data. For each data source, there are numerous attribute types of the described entities, and the data dimensions for describing the same attribute may also be different. How to process, utilize, and fuse this multi-source heterogeneous data into a city knowledge graph and obtain knowledge from it has become an urgent challenge in current city computing applications based on knowledge graphs. Summary of the Invention
[0005] Object of the Invention: Regarding the deficiencies in the above-mentioned related technologies of POI recommendation, the present invention proposes a real-time POI recommendation method based on a city spatio-temporal knowledge graph to solve the problems of unbalanced positive and negative sample ratios in traditional methods and information dissemination between multi-source city data. First, construct a city spatio-temporal knowledge graph, design a method for extracting representation vectors of entities and relationships in the graph, as well as a method for extracting long-term and short-term preferences of users, and design a real-time POI recommendation algorithm to improve the performance of the recommendation algorithm.
[0006] Technical Solution: To achieve the object of the present invention, the technical solution adopted by the present invention is: a real-time POI recommendation method based on a city spatio-temporal knowledge graph, and the method includes the following steps:
[0007] Step 1. Integrate the heterogeneous multi-source data of the city to obtain the pattern of the city spatio-temporal knowledge graph, and construct the city spatio-temporal knowledge graph G = {G1, G2,... G n}, where n is the number of graph layers. For any layer of the graph, its structure is G i = {V, E}. Among them, V = {POI, CATEGORY, BRAND, BA, REGION, USER} is an entity set containing 6 domains (point of interest, category, brand, business area, region, user), and E = {E cross , E within} is an entity relationship set containing inter-domain and intra-domain relationships. Obtain the initial features p, c, b, ba, r, and u of the 6 domain entities and the initial features of the relationships through different initialization methods;
[0008] Step 2. For within one layer of the graph, use a graph convolutional neural network (GCN) model to learn the influence between different entities within one layer of the graph; for the same entity between multiple layers of the graph, use a long short-term memory artificial neural network (LSTM) to learn the dynamic features of the 6 domain entities changing over time and and the dynamic features of the relationships changing over time;
[0009] Step 3. Combine the dynamic entity vector representations in the learned urban spatio-temporal knowledge graph to obtain the long-term preferences of user u for points of interest and short-term preferences ;
[0010] Step 4. For the dynamic features of the entities and relationships in the learned knowledge graph, combine the long-term and short-term preferences of the user to generate recommendation results. The recommendation results combine the relationship-based score the score based on long-term preferences and the score based on short-term preferences to calculate the final score s for the points of interest u→p . Score the points of interest in the candidate set and sort them according to the scores, and take the top k points of interest as the recommended list of points of interest.
[0011] In Step 1, construct a spatio-temporal dynamic graph in the form of a dynamic graph. The urban features at a certain time interval are summarized in one layer of the knowledge graph. The specific construction steps are as follows:
[0012] Step 101. Construct a spatio-temporal dynamic graph with the structure G = {G1, G2, … G n}, where n is the number of graph layers. For any layer of the graph, its structure is G i = {V, E};
[0013] Step 102. Construct an entity set with the pattern V = {POI, CATEGORY, BRAND, BA, REGION, USER}, which contains sub-entity sets in 6 domains. POI = {poi1, poi2, …, poi |P|} is the entity set of points of interest, CATEGORY = {cate1, cata2, …, cata |C|} is the category entity set (a three-layer tree structure), BRAND = {brand1, brand2, …, brand |B|} is the brand entity set, BA = {ba1, ba2, …, ba |BA|} is the business district entity set, R = {region1, region2, …, region |R|} is the regional entity set, U = {user1, user2, …, user |U|} is the user entity set;
[0014] Step 103. Construct a relationship set with the pattern E = {E cross , E within}, which includes inter-domain entity relationships and intra-domain entity relationships. E cross = {E P→C , E P→B , E P→R,E P→BA ,E C→B ,E C→R ,E B→R ,E BA→R ,E U→P} is the set of edges between entities across domains, which contains 9 subsets of edge types, namely <Point of Interest, belongs to, Category>, <Point of Interest, belongs to, Brand>, <Point of Interest, is located in, Region>, <Point of Interest, is located in, Business District>, <Category, belongs to, Brand>, <Category, is located in, Region>, <Brand, is located in, Region>, <Business District, is located in, Region>, and <User, visits, Point of Interest>.
[0015] E within = {E similarBrand ,E c3ToC2 ,E c2ToC1 ,E nearByRegion ,E regionFlow} is the set of edges between entities within the domain, namely <Brand 1, is similar to, Brand 2>, <Tertiary Type, belongs to, Secondary Type>, <Secondary Type, belongs to, Primary Type>, <Region 1, is adjacent to, Region 2>, and <Region 1, transmits traffic to, Region 2>;
[0016] Step 104. Use the hyperbolic space embedding model to learn the initial representation vectors {c1, c2, …, c |C|} of the three-layer tree structure of type entities in the knowledge graph;
[0017] Step 105. Use the self-attention model, as shown in Equation (1), to learn the initial representation vectors {r1, r2, …, r |R|} of the region entities in the knowledge graph to reduce the impact of the spatial imbalance problem on learning. Considering that there are more or less impacts between all regions in the city, the self-attention model is used to learn the weight matrix W sp . This equation learns the weight matrix between regions. This matrix is a square matrix, and the element in the i-th row and j-th column of the matrix represents the weight value of the i-th region on the j-th region, which can characterize the influence size between regions:
[0018]
[0019] Step 106. Perform a regularization operation on the urban regions, as shown in Equation (2), to reduce the gap between developed regions and their surrounding regions. In the equation is the average pooling feature vector of the context where region i is located, and G i is the set of neighbor regions of region i:
[0020]
[0021] Step 107. Initialize the entity vectors of interest point types, brand types, business district types, and user types {p1, p2, …, p |P|}, {b1, b2, …, b |B|}, {ba1, ba2, …, ba |BA|}, and {u1, u2, …, u |U|} using the normal distribution.
[0022] Furthermore, in Step 2, within a single-layer graph, use the Graph Convolutional Neural Network (GCN) model to learn the influence between different entities in the single-layer graph. To utilize the information of different types of nodes and edges in the graph and fully consider the influence of node neighbors, the specific steps are as follows:
[0023] Step 20101. For a node v in the graph, the hidden vector representation at the i-th layer of the GCN is For an edge type e in the graph, the hidden vector representation at the i-th layer of the GCN is A triple in the graph is represented as (v, e, w), meaning that node v reaches node w through edge e. The calculation formula for the hidden vector of node v at the (i + 1)-th layer of the GCN is as shown in Equation (3), where σ(·) is a non-linear activation function that maps from the d-dimensional real number space to the d-dimensional real number space, is the set of neighbor nodes of node v under edge type e. is the projection matrix of edge type e at the i-th layer, and the operation ° is the element-wise multiplication operation of two vectors:
[0024]
[0025] Step 20102. Through different relationship projection matrices, during the information propagation in a single-layer graph, the importance of different edges for information propagation can be automatically identified, thereby extracting more useful urban graph knowledge. For an edge type e in the graph, the calculation of the hidden vector at the (i + 1)-th layer of the GCN is as follows:
[0026]
[0027] Step 20103. Perform the information propagation operations described in Step 20101 - Step 20102 in each layer of the multi-layer graph.
[0028] After that, in Step 2, within a single-layer graph, use the Long Short-Term Memory Artificial Neural Network (LSTM) to learn the dynamic features of the same entity changing over time among multi-layer graphs. The specific steps are as follows:
[0029] Step 20201. For multi-layer knowledge graphs, the representation vectors of the same entity across different layers can form a time series. The Long Short-Term Memory (LSTM) artificial neural network model is used to learn the temporal variation information of the entity across different layers, solving the problem that features from a long time slice ago are covered or forgotten, and at the same time avoiding the problems of gradient vanishing and gradient explosion. For the six entity sets in V = {POI, CATEGORY, BRAND, BA, REGION, USER}, considering that not only the features of users and points of interest change dynamically over time, but also the features of entities such as types, brands, and regions change over time. The corresponding feature sequences over time are input into the LSTM to learn the dynamic feature representations of different points of interest, different categories, different brands, different regions, and different users in each layer of the knowledge graph.
[0030] Step 20202. An entity v in the entity set V k The feature sequence of the entity in the n-layer knowledge graph (n time steps) is Taking this sequence as the input of the LSTM neural network, aiming to obtain the output sequence {h1, h2, …, h n} of the LSTM hidden layer and the output sequence {C1, C2, …, C n} of the long-term state. Taking the LSTM cell corresponding to time step t as an example, first calculate the entity feature according to the forget gate That is, to calculate the part of the entity feature corresponding to time step t - 1 that is forgotten, as shown in the following formula:
[0031]
[0032] Step 20203. Secondly, determine the part of the entity feature corresponding to time step t - 1 that needs to be updated according to the input gate, as shown in the following formula:
[0033]
[0034] Step 20204. Use the tanh activation layer to update the candidate entity feature corresponding to time point t, as shown in Equation (7). After the entity feature at time step t changes, the input gate generates the candidate entity feature and calculates the part of the entity feature that needs to be emphasized and remembered for updating: After the change, the input gate generates the candidate entity feature and calculates the part of the entity feature that needs to be emphasized and remembered for updating:
[0035]
[0036] Step 20205. Obtain the cumulative entity feature up to the previous t time steps, as shown in Equations (8) and (9). Among them, the cumulative entity feature of the previous t - 1 time steps is multiplied by f t to represent the old entity feature information that needs to be discarded after experiencing the previous t - 1 time steps; the latter represents the new entity feature information that needs to be added at time step t. Ct represents the entity features accumulated in the previous t time steps, and the entity features corresponding to the t-th time step are obtained through the output gate. W f , b f , W i , b i , W c , b c , W o , b o are all parameters to be learned:
[0037]
[0038] Step 20206. For the processing of point-of-interest features, type features, brand features, business district features, regional features, and user features, use Steps 20202 - 20205 to complete an information propagation operation between multiple layers of the knowledge graph (over time). Finally, obtain the dynamic entity features of points of interest, categories, brands, regions, and users and
[0039] Step 20207. Use the long-term state output sequence output by the LSTM as the input for the next round of information propagation within the knowledge graph, and alternately execute the information propagation operation within the knowledge graph layer and the information propagation operation between the knowledge graph layers to learn the high-order information related to time and space in the city;
[0040] Furthermore, in Step 3, for the dynamic entity vector representation in the learned city spatio-temporal knowledge graph, perform the long-term and short-term preference characterization of users for points of interest. The specific steps are as follows:
[0041] Step 301. At time step i (the i-th layer of the knowledge graph), for user u , characterize the user's preference for the point of interest at this time step as as shown in Equation (10). In the equation, is the user feature vector after training by GCN and LSTM, is the feature vector of the <user, visit, point of interest> type edge after training:
[0042]
[0043] Step 302. For each time point user uFor the preference for points of interest, the attention mechanism is used to calculate the preference contribution of each layer, and then its long-term preference is calculated, as shown in Equation (11). The attention mechanism focuses on how to obtain the similarity of user preferences at different time points based on the output of the LSTM neural network for the multi-layer knowledge graph sequence, in order to extract the fixed taste interests of users for points of interest over a long time. Measure the similarity between the user's access preference at time point i and the user's access preferences at other time points (taking time point i as an example). Among them and are the preferences of the user for points of interest at time points t and i respectively, and concat represents the vector concatenation operation. W a are all parameters to be learned:
[0044]
[0045] After obtaining the similarity between the user's access interest point preferences at time point t and other time points, a normalization operation is performed to facilitate model convergence. Specifically, the contribution of the user's access preference at time point t to the user's long-term access preference is expressed as the following formula:
[0046]
[0047] The final long-term access preference of the user is expressed as the following formula:
[0048]
[0049] When obtaining the user's short-term access preference, simply taking the output of the last time step as the user's short-term access preference is accidental. Therefore, the user's short-term access preference is extracted according to the access records in the recent period. An average summation operation is performed on the access preferences corresponding to the user's last K access records, as shown in Equation (14), to obtain the user's short-term access preference and achieve the goal of real-time recommendation:
[0050]
[0051] Furthermore, in step 4, for the dynamic features of the learned knowledge graph entities and relationships, combined with the user's long-term and short-term preferences, the generation of recommendation results is carried out. The specific steps are as follows:
[0052] The recommendation result scoring is divided into three parts, the score based on the relationship The score based on the long-term preference and the score based on the short-term preference The relationship-based scoring scores the possibility of the existence of the edge <user u, visit, point of interest p> in the knowledge graph at the n+1 layer through operations, as shown in Equation (15). In the equation, the ⊙ symbol means element-wise multiplication of three vectors to obtain the relationship-based scoring:
[0053]
[0054] Step 402. The scoring method based on long-term and short-term preferences is as shown in Equations (16) and (17). The preference vector of the user is multiplied by the feature vector of the candidate point of interest to obtain the long-term and short-term preference scoring of the user for the point of interest:
[0055]
[0056] Step 403. Finally, the three parts of the scoring are weighted and summed, as shown in Equation (18), to obtain the final score of the user for this point of interest. In the equation, α + β + γ = 1, which is a hyperparameter set for the model:
[0057]
[0058] Step 404. For the points of interest in the candidate point of interest set of user user u perform scoring according to Steps 401 - 403, and select the k points of interest with the highest predicted scores as the recommended result list, and recommend them to user user u Recommend.
[0059] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0060] (1) It can improve the performance of the point of interest recommendation system. For the real-time point of interest recommendation system based on the urban spatio-temporal knowledge graph, in order to address the deficiencies and challenges of traditional point of interest recommendation methods, the urban knowledge graph is often constructed from multi-source heterogeneous data. Among them, each data source has many types of entity attributes described. Utilizing these multi-source heterogeneous data, fusing them into a dynamic urban knowledge graph, and obtaining the high-order spatio-temporal features of the graph can well assist in point of interest recommendation;
[0061] (2) It can perform real-time modeling of the user's preference for points of interest. Real-time modeling of the user's recent behavior using graphs and models such as GNN and LSTM can better depict the user's short-term preferences, making this recommendation system have a certain degree of real-time performance. Description of the Drawings
[0062] Figure 1 Schematic diagram of the urban spatio-temporal knowledge graph pattern (one layer);
[0063] Figure 2 Flowchart of the real-time point of interest recommendation method based on the urban spatio-temporal knowledge graph. Detailed implementation manners
[0064] The present invention will be further illustrated below in conjunction with the accompanying drawings and specific embodiments.
[0065] The goal of the present invention is to utilize the rich multi-source heterogeneous data in the city to construct a spatio-temporal knowledge graph of the city to assist the task of point-of-interest recommendation in the city. A knowledge graph is a method of describing concepts in the real world and the relationships between them in the form of a graph, mainly composed of <subject, predicate, object> triples. A spatio-temporal knowledge graph is composed of knowledge graphs in multiple time periods, combined in the form of a dynamic graph in the form of snapshots. The nodes of the knowledge graph can include types of points of interest such as restaurants, gyms, etc., can also include brands such as "McDonald's", "Nanjing Food Stall", etc., can also include specific point-of-interest stores under these brand types, as well as regions in the city and all user entities. The edges included in the urban spatio-temporal knowledge graph may have rich information such as <McDonald's Nanjing Baijiahu Store, located in, Nanjing Baijiahu>, <McDonald's Nanjing Baijiahu Store, belongs to, McDonald's>, <McDonald's Nanjing Baijiahu Store, belongs to, fast food restaurant>, <McDonald's Nanjing Baijiahu Store, located in, Jiangning District>, etc.
[0066] The present invention constructs an urban spatio-temporal knowledge graph, proposes a knowledge graph information dissemination, user long-term and short-term preference extraction mechanism, and a recommendation result generation mechanism to provide a list of recommended points of interest for users to facilitate their travel and life. To this end, the specific implementation steps of the present invention are as follows:
[0067] Step 1. Integrate the heterogeneous multi-source data of the city to obtain the pattern of the urban spatio-temporal knowledge graph, and construct the urban spatio-temporal knowledge graph G = {G1, G2,... G n}, where n is the number of graph layers. For any layer of the graph, its structure is G i = {V, E}. Where V = {POI, CATEGORY, BRAND, BA, REGION, USER} is a set of entities containing 6 domains, namely points of interest (such as Starbucks Nanjing Xuanwu Wanda Store, McDonald's Nanjing Jiangning Baijiahu Store), categories (such as coffee shops, fast food restaurants), brands (such as Starbucks, McDonald's), business districts (such as Wanda, Golden Eagle, etc.), regions (Xuanwu District, Jiangning District) and user entities, and E = {E cross , E within} is a set of entity relationships between and within domains. The initial features p, c, b, ba, r, and u of the 6 domain entities and the initial features of the relationships are obtained through different initialization methods;
[0068] Step 2. For a single-layer graph spectrum, use the Graph Convolutional Neural Network (GCN) model to learn the influence among different entities within the single-layer graph spectrum; for the same entity across multiple-layer graph spectra, use the Long Short-Term Memory Artificial Neural Network (LSTM) to learn the dynamic features of the six domain entities over time. and the dynamic features of the relationships over time;
[0069] Step 3. Combine the learned dynamic entity vector representations in the urban spatio-temporal knowledge graph to obtain the long-term preferences of user u for points of interest as well as the short-term preferences
[0070] Step 4. For the learned dynamic features of the knowledge graph entities and relationships, combine the long-term and short-term preferences of the user to generate recommendation results. The recommendation results combine the relationship-based score the score based on long-term preferences and the score based on short-term preferences to calculate the final score s for the points of interest u→p . Score the points of interest in the candidate set, and sort according to the scores and take the top k points of interest as the recommended list of points of interest.
[0071] In Step 1, construct a spatio-temporal dynamic graph spectrum in the form of a dynamic graph. The urban features within a certain time interval are summarized in a single-layer knowledge graph. The specific construction steps are as follows:
[0072] Step 101. Construct a spatio-temporal dynamic graph spectrum with the structure G = {G1, G2, …, G n}, where n is the number of graph spectrum layers. For any layer of the graph spectrum, its structure is G i = {V, E};
[0073] Step 102. Construct an entity set with the pattern V = {POI, CATEGORY, BRAND, BA, REGION, USER}, which contains sub-entity sets of six domains. POI = {poi1, poi2, …, poi |P|} is the entity set of points of interest, CATEGORY = {cate1, cate2, …, cate |C|} is the category entity set (a three-layer tree structure), BRAND = {brand1, brand2, …, brand |B|} is the brand entity set, BA = {ba1, ba2, …, ba |BA|} is the business district entity set, R = {region1, region2, …, region |R|} is the region entity set, U = {user1, user2, …, user |U|}\ is the set of user entities;
[0074] Step 103. Construct a relationship set with the pattern \(E = \{E cross , E within \}\), which includes inter-domain entity relationships and intra-domain entity relationships. \(E cross =\{E P→C , E P→B , E P→R , E P→BA , E C→B , E C→R , E B→R , E BA→R , E U→P \}\ is the set of edges between cross-domain entities, containing 9 sub-edge type sets, namely <Point of Interest, belongs to, Category>, <Point of Interest, belongs to, Brand>, <Point of Interest, is located in, Region>, <Point of Interest, is located in, Business District>, <Category, belongs to, Brand>, <Category, is located in, Region>, <Brand, is located in, Region>, <Business District, is located in, Region>, and <User, visits, Point of Interest>.
[0075] E within =\{E similarBrand , E c3ToC2 , E c2ToC1 , E nearByyRegion , E regionFlow \}\ is the set of edges between intra-domain entities, namely <Brand 1, is similar to, Brand 2>, <Tertiary Type, belongs to, Secondary Type>, <Secondary Type, belongs to, Primary Type>, <Region 1, is adjacent to, Region 2>, and <Region 1, has traffic transmission to, Region 2>;
[0076] Step 104. Use the hyperbolic space embedding model to learn the initial representation vectors \(\{c_1, c_2, \ldots, c |C| \}\) of the three-layer tree structure of type entities in the knowledge graph;
[0077] Step 105. Use the self-attention model, as shown in Equation (1), to learn the initial representation vectors \(\{r_1, r_2, \ldots, r |R| \}\) of the region entities in the knowledge graph to reduce the impact of the spatial imbalance problem on learning. Considering that there are more or less impacts between all regions in the city, the self-attention model is used to learn the weight matrix \(W sp \). This equation learns the weight matrix between regions. This matrix is a square matrix, and the element in the \(i\)-th row and \(j\)-th column of the matrix represents the weight value of the \(i\)-th region to the \(j\)-th region, which can describe the influence size between regions:
[0078]
[0079] Step 106. Perform a regularization operation on the urban area, as shown in Equation (2), to reduce the gap between the developed area and its surrounding areas. In the formula, is the average pooling feature vector of the context where region i is located, and G i is the set of neighbor regions of region i:
[0080]
[0081] Step 107. Initialize the entity vectors of the point-of-interest type, brand type, business district type, and user type using a normal distribution {p1, p2, …, p |P|}, {b1, b2, …, b |B|}, {ba1, ba2, …, ba |BA|}, and {u1, u2, …, u |U|}.
[0082] In Step 2, within one layer of the graph, use the Graph Convolutional Neural Network (GCN) model to learn the influence between different entities in one layer of the graph. To utilize the information of different types of nodes and edges in the graph and fully consider the influence of the neighbors of the nodes, the specific steps are as follows:
[0083] Step 20101. For the node v in the graph, the hidden vector representation at the i-th layer of the GCN is For an edge e of one type in the graph, the hidden vector representation at the i-th layer of the GCN is A triple in the graph is represented as (v, e, w), which means that the node v reaches the node w through the edge e. The calculation formula for the hidden vector of the node v at the (i + 1)-th layer of the GCN is as shown in Equation (3), where σ(·) is a non-linear activation function that maps from the d-dimensional real number space to the d-dimensional real number space, is the set of neighbor nodes of the node v under the edge type e. is the projection matrix of the edge type e at the i-th layer, and the operation ° is the element-wise multiplication operation of two vectors:
[0084]
[0085] Step 20102. Through different relationship projection matrices, during the information propagation in one layer of the graph, the importance of different edges for information propagation can be automatically identified, thereby extracting more useful urban graph knowledge. For the edge type e in the graph, the calculation of the hidden vector at the (i + 1)-th layer of the GCN is as follows:
[0086]
[0087] Step 20103. Perform the information propagation described in Steps 20101 - 20102 in each layer of the multi-layer graph.
[0088] In step 2, for one layer of the knowledge graph, a long short-term memory artificial neural network (LSTM) is used to learn the dynamic features of the same entity over time among multiple layers of the knowledge graph. The specific steps are as follows:
[0089] Step 20201. For multiple layers of the knowledge graph, the representation vectors of the same entity among multiple layers of the knowledge graph can form a time series. A long short-term memory artificial neural network (LSTM) model is used to learn the time-varying information of the entity between different layers, solve the problem that the features before a long time slice are covered or forgotten, and avoid the problems of gradient disappearance and gradient explosion. For the five entity sets in V = {P, C, B, R, U}, considering that not only the features of users and points of interest change dynamically over time, but also the features of entities such as types, brands, business districts, and regions will change over time. The corresponding feature sequences over time are input into the LSTM to learn the dynamic feature representations of different points of interest, different categories, different brands, different regions, and different users in each layer of the knowledge graph.
[0090] Step 20202. An entity v in the entity set V k The feature sequence of the entity in the n-layer knowledge graph (n time steps) is This sequence is used as the input of the LSTM neural network, aiming to obtain the output sequence {h1, h2,..., h n} of the LSTM hidden layer and the output sequence {C1, C2,..., C n} of the long-term state. Taking the LSTM cell corresponding to time step t as an example, first calculate the entity feature according to the forget gate That is, to calculate the part of the entity feature corresponding to time step t - 1 that is forgotten, as shown in the following formula:
[0091]
[0092] Step 20203. Secondly, determine the part of the entity feature corresponding to time step t - 1 that needs to be updated according to the input gate, as shown in the following formula:
[0093]
[0094] Step 20204. Use the tanh activation layer to update the candidate entity feature corresponding to time point t, as shown in Equation (7). After the entity feature at time step t changes, the input gate generates a candidate entity feature and calculates the part of the entity feature that needs to be emphasized and remembered for updating: After the entity feature changes, the input gate generates a candidate entity feature and calculates the part of the entity feature that needs to be emphasized and remembered for updating:
[0095]
[0096] Step 20205. Obtain the cumulative entity feature up to the previous t time steps, as shown in Equations (8) and (9). Among them, the cumulative entity feature of the previous t - 1 time steps and ft The multiplication represents the old entity feature information that needs to be discarded after the previous t - 1 time steps; the latter represents the new entity feature information that needs to be added at the t - th time step. C t represents the entity features accumulated in the previous t time steps, and the entity features corresponding to the t - th time step are obtained through the output gate. W f , b f , W i , b i , W c , b c , W o , b o are all parameters to be learned:
[0097]
[0098] Step 20206. For the processing of point - of - interest features, type features, brand features, region features, and user features, use Steps 20202 - 20205 to complete an information propagation operation between multiple layers of the graph (over time). Finally, obtain the dynamic entity features of points of interest, categories, brands, regions, and users and
[0099] Step 20207. Use the long - term state output sequence output by the LSTM as the input for the next round of information propagation within the graph, and alternately execute the information propagation operation within the graph layer and the information propagation operation between graph layers to learn the high - order information related to time and space in the city;
[0100] In Step 3, for the dynamic entity vector representation in the learned city spatio - temporal knowledge graph, perform the long - term and short - term preference characterization of users for points of interest. The specific steps are as follows:
[0101] Step 301. At time step i (the i - th layer of the graph), for user u , characterize the user's preference for points of interest at this time step as as shown in Equation (10). In the equation, is the user feature vector after training by GCN and LSTM, is the feature vector of the <user, visit, point - of - interest> type edge after training:
[0102]
[0103] Step 302. For each time point of user uFor the preference of points of interest, the attention mechanism is used to calculate the preference contribution of each layer, and then its long-term preference is calculated, as shown in Equation (11). The attention mechanism focuses on how to obtain the similarity of user preferences at different time points based on the output of the LSTM neural network for the multi-layer knowledge graph sequence, in order to extract the user's fixed taste interest in points of interest over a long period of time. Measure the similarity between the user's access preference at time point i and the user's access preferences at other time points (taking time point i as an example). Among them and are the preferences of the user for points of interest at time points t and i respectively, and concat represents the vector concatenation operation. W a are all parameters to be learned:
[0104]
[0105] After obtaining the similarity between the user's access interest point preferences at time point t and other time points, a normalization operation is performed to facilitate model convergence. Specifically, the contribution of the user's access preference at time point t to the user's long-term access preference is expressed as the following formula:
[0106]
[0107] The long-term access preference of the final user is expressed as the following formula:
[0108]
[0109] When obtaining the user's short-term access preference, simply taking the output of the last time step as the user's short-term access preference is accidental. Therefore, the user's short-term access preference is extracted based on the access records in the recent period. An average summation operation is performed on the access preferences corresponding to the user's last K access records, as shown in Equation (14), to obtain the user's short-term access preference and achieve the goal of real-time recommendation:
[0110]
[0111] In step 4, for the dynamic features of the learned knowledge graph entities and relationships, combined with the user's long-term and short-term preferences, the generation of recommendation results is carried out. The specific steps are as follows:
[0112] The recommendation result scoring is divided into three parts, the relationship-based scoring the long-term preference-based scoring and the short-term preference-based scoring The relationship-based scoring scores the possibility of the existence of the edge <user u, visit, point of interest p> in the knowledge graph at the n+1 layer through operations, as shown in Equation (15). In the equation, the ⊙ symbol means element-wise multiplication of three vectors to obtain the relationship-based scoring:
[0113]
[0114] Step 402. The scoring method based on long-term and short-term preferences is as shown in Equations (16) and (17). The preference vector of the user is multiplied by the feature vector of the candidate point of interest to obtain the long-term and short-term preference scoring of the user for the point of interest:
[0115]
[0116] Step 403. Finally, the three parts of the scoring are weighted and summed, as shown in Equation (18), to obtain the final score of the user for this point of interest. In the equation, α+β+γ = 1, which are hyperparameters set for the model:
[0117]
[0118] Step 404. For the points of interest in the candidate point of interest set of user u score them according to Steps 401 - 403, and select the k points of interest with the highest predicted scores as the recommended result list to recommend to user u recommend.
Claims
1. A real-time recommendation method for points of interest based on an urban spatio-temporal knowledge graph, characterized in that, The method includes the following steps: Step 1. Integrate the heterogeneous multi-source data of the city to obtain the urban spatio-temporal knowledge graph schema, and construct the urban spatio-temporal knowledge graph G = {G1, G2, … G n}, where n is the number of graph layers; for any layer of the graph, its structure is G i = {V, E}; where V = {POI, CATEGORY, BRAND, BA, REGION, USER} is a set of entities containing 6 domains, namely points of interest, categories, brands, business districts, regions, and users, and E = {E cross , E within} is a set of entity relationships including inter-domain and intra-domain relationships; obtain the initial features p, c, b, ba, r, and u of the 6 domain entities and the initial features of the relationships through different initialization methods; Step 2. For entities within one layer of the graph, use a graph convolutional neural network model to learn the influence between different entities within one layer of the graph; for the same entity across multiple layers of the graph, use a long short-term memory artificial neural network to learn the dynamic features of the six domain entities over time and the dynamic features of the relationships over time; Step 3. Combine the dynamic entity vector representations in the learned urban spatio-temporal knowledge graph to obtain the long-term preferences of user u for points of interest and short-term preferences Step 4. For the dynamic features of the learned knowledge graph entities and relationships, combined with the long-term and short-term preferences of the user, generate the recommendation results; the recommendation results are combined with the relationship-based scoring Scoring based on long-term preferences And scoring based on short-term preferences Calculate the final score s for the point of interest u→p ; Score the points of interest in the candidate set, and sort according to the scores and take the top k points of interest as the recommended point of interest list; In step 2, for one layer of the graph spectrum, a graph convolutional neural network model is used to learn the influence between different entities within one layer of the graph spectrum. In order to utilize the information of different types of nodes and edges in the graph spectrum and fully consider the influence of the neighbors of the nodes, the specific steps are as follows: Step 20101. For node v in the graph spectrum, the hidden vector representation at the i-th layer of the GCN is For a type of edge e in the graph spectrum, the hidden vector representation at the i-th layer of the GCN is A triple in the graph spectrum is represented as (v, e, w), meaning that node v reaches node w through edge e; the calculation formula for the hidden vector of node v at the (i + 1)-th layer of the GCN is as shown in Equation (3), where σ(·) is a non-linear activation function that maps from the d-dimensional real number space to the d-dimensional real number space. is the set of neighbor nodes of node v under edge type e; is the projection matrix of edge type e at the i-th layer, and the operation ° is the element-wise multiplication operation of two vectors: Step 20102. Through different relationship projection matrices, during the information propagation in one layer of the graph spectrum, the importance of different edges for information propagation can be automatically identified, so as to extract more useful urban graph spectrum knowledge; for the edge type e in the graph spectrum, the hidden vector calculation in the (i + 1)-th layer of the GCN is as follows: Step 20103. In each layer of the multi-layer graph spectrum, the information propagation operation described in steps 20101 - 20102 is performed.
2. The real-time POI recommendation method based on the urban spatio-temporal knowledge graph according to claim 1, wherein, In step 1, a spatio-temporal dynamic graph spectrum is constructed in the form of a dynamic graph, and the urban features within a certain time interval are summarized in one layer of the knowledge graph. The specific construction steps are as follows: Step 101. Construct a spatio-temporal dynamic map with the structure G = {G1, G2, … G n}, where n is the number of map layers; for any layer of the map, its structure is G i = {V, E}; Step 102. Construct an entity set with the pattern V = {POI, CATEGORY, BRAND, BA, REGION, USER}, which contains sub-entity sets of 6 domains; POI = {poi1, poi2, …, poi |P|} is the point-of-interest entity set, CATEGORY = {cate1, cate2, …, cate |C|} is the category entity set, BRAND = {brand1, brand2, …, brand |B|} is the brand entity set, BA = {ba1, ba2, …, ba |BA|} is the business district entity set, R = {region1, region2, …, region |R|} is the region entity set, U = {user1, user2, …, user |U|} is the user entity set; Step 103. Construct a relationship set with the pattern E = {E cross , E within}, which includes inter-domain entity relationships and intra-domain entity relationships; E cross = {E P→C , E P→B , E P→R , E P→BA , E C→B , E C→R , E B→R , E BA→R , E U→P} is the edge set between cross-domain entities, including 9 sub-edge type sets, namely <Point of Interest, belongs to, Category>, <Point of Interest, belongs to, Brand>, <Point of Interest, is located in, Region>, <Point of Interest, is located in, Business District>, <Category, belongs to, Brand>, <Category, is located in, Region>, <Brand, is located in, Region>, <Business District, is located in, Region>, and <User, accesses, Point of Interest>; E within ={E similarBrand , E c3ToC2 , E c2ToC1 , E nearByRegion , E regionFlow} is the set of edges between entities within the domain, which are <Brand 1, similar to, Brand 2>, <Tertiary type, belongs to, Secondary type>, <Secondary type, belongs to, Primary type>, <Region 1, adjacent to, Region 2>, and <Region 1, traffic transmission, Region 2> respectively; Step 104. Use the hyperbolic space embedding model to learn the initial representation vectors {c1, c2, …, c |C|} of the three-layer tree structure of type entities in the knowledge graph; Step 105. Use a self-attention model, as shown in Equation (1), to learn the initial representation vectors {r1, r2, …, r |R|} of the regional entities in the knowledge graph to reduce the impact of the spatial imbalance problem on learning; considering that there are more or less influences among all regions of the city, a self-attention model is used to learn the weight matrix W sp between regions; this equation learns the weight matrix between regions. This matrix is a square matrix, and the element in the i-th row and j-th column of the matrix represents the weight value of the i-th region on the j-th region, which can characterize the magnitude of the influence between regions: Step 106. Perform a regularization operation on the urban area as shown in Equation (2) to reduce the gap between the developed area and the surrounding areas; where is the average pooling feature vector of the context where region i is located, and G i is the set of neighbor regions of region i: Step 107. Initialize the entity vectors of interest point types, brand types, business district types, and user types {p1, p2, …, p |P|}, {b1, b2, …, b |B|}, {ba1, ba2, …, ba |BA|}, and {u1, u2, …, u |U|} using the normal distribution.
3. The real-time POI recommendation method based on the urban spatio-temporal knowledge graph according to claim 1, characterized in that, In step 2, for one layer of the graph spectrum, a long short-term memory artificial neural network is used to learn the dynamic features of the same entity changing over time between multiple layers of the graph spectrum. The specific steps are as follows: Step 20201. For between multiple layers of the graph spectrum, the representation vectors of the same entity between multiple layers of the graph spectrum can form a time series. A long short-term memory artificial neural network model is used to learn the time-varying information of the entity between different layers, solve the problem that the features before a longer time slice are covered or forgotten, and at the same time avoid the problems of gradient disappearance and gradient explosion; for the 6 entity sets in V = {POI, CATEGORY, BRAND, BA, REGION, USER}, considering that not only the features of users and points of interest change dynamically over time, but also the features of entities will change over time; the corresponding feature sequences over time are input into the long short-term memory artificial neural network to learn the dynamic feature representations of different points of interest, different categories, different brands, different regions and different users in each layer of the graph spectrum; Step 20202. An entity v in the entity set V k The feature sequence of the entity in n time steps of the n-layer knowledge graph is Taking this sequence as the input of the LSTM neural network, aiming to obtain the output sequence {h1, h2, …, h n} of the LSTM hidden layer and the output sequence {C1, C2, …, C n}; Taking the LSTM cell corresponding to time step t as an example, first calculate the entity feature according to the forget gate That is, to calculate the part of the entity feature corresponding to time step t-1 that is forgotten, as shown in the following formula: Step 20203. Secondly, according to the input gate, determine the part of the entity feature corresponding to the (t - 1) time step that needs to be updated, as follows: Step 20204. Update the candidate entity features corresponding to time point t using the tanh activation layer, as shown in Equation (7); the entity features at time step t After the entity features change, the input gate generates candidate entity features and calculates the part of the entity features that needs to be remembered and used for updating: Step 20205. Obtain the entity features accumulated up to the previous t time steps, as shown in Equations (8) and (9); among them, the entity features accumulated in the previous t - 1 time steps are multiplied by f t , representing the old entity feature information that needs to be discarded after experiencing the previous t - 1 time steps; the latter represents the new entity feature information that needs to be added at the t time step; C t represents the entity features accumulated in the previous t time steps, and the entity features corresponding to the t time step are obtained through the output gate; W f , b f , W i , b i , W c , b c , W o , b o are all parameters to be learned: Step 20206. The processing of the point-of-interest feature, type feature, brand feature, regional feature, and user feature uses Steps 20202 - 20205 to complete an information propagation operation between multiple layers of the multi-layer graph over time; finally, the entity dynamic features of the point of interest, category, brand, region, and user are obtained. and Step 20207. Use the long-term state output sequence output by the LSTM as the input for the next round of information propagation within the graph spectrum, and alternately execute the information propagation operation within the graph spectrum layer and the information propagation operation between the graph spectrum layers to learn the high-order information related to time and space in the city.
4. The real-time POI recommendation method based on the urban spatio-temporal knowledge graph according to claim 1, wherein In step 3, for the dynamic entity vector representation in the learned urban spatio-temporal knowledge graph, the long-term and short-term preferences of users for points of interest are characterized. The specific steps are as follows: Step 301. At time step i, in the i-th layer of the graph spectrum, for user user u , characterize the user's preference for points of interest at this time step as as shown in Equation (10); where is the user feature vector after being trained by GCN and LSTM, is the feature vector of the <user, visit, point of interest> type edge after training: Step 302. For each time point of user user u Regarding the preference for points of interest, use the attention mechanism to calculate the preference contribution of each layer, and then calculate its long-term preference, as shown in Equation (11); The attention mechanism focuses on how to obtain the similarity of user preferences at different time points based on the output of the long short-term memory artificial neural network for the multi-layer knowledge graph sequence, in order to extract the long-term fixed taste interests of users for points of interest; Measure the similarity of the user access preference at the i time point and the user access preferences at other time points; wherein and are the preferences of the user for the point of interest at time points t and i respectively, and concat represents the vector concatenation operation; W a are all parameters to be learned: Step 303. After obtaining the similarity of the user access interest point preferences at the t time point and other time points, perform a normalization operation to facilitate the convergence of the model; specifically, the contribution of the user access preference at the t time point to the user's long-term access preference is expressed as follows: Step 304. Finally, the long-term access preference of the user is expressed as follows: When obtaining the user's short-term access preference in step 305, simply taking the output of the last time step as the user's short-term access preference is accidental. Therefore, the user's short-term access preference is extracted according to the access records in the recent period; An average summation operation is performed on the access preferences corresponding to the user's last K access records, as shown in Equation (14), to obtain the user's short-term access preference and achieve the goal of real-time recommendation: 。 5. The real-time POI recommendation method based on the urban spatio-temporal knowledge graph according to claim 1, characterized in that In step 4, for the dynamic features of the learned knowledge graph entities and relationships, combined with the user's long-term and short-term preferences, the generation of recommendation results is carried out. The specific steps are as follows: Step 401. The recommendation result scoring is divided into three parts, the relationship-based scoring The scoring based on long-term preferences and the scoring based on short-term preferences The relationship-based scoring is to score the possibility that the edge of <user u, access, point of interest p> exists in the knowledge graph at the n+1 layer through operations, as shown in Equation (15); in the formula, the ⊙ symbol means element-wise multiplication of three vectors to obtain the relationship-based scoring: Step 402. Based on the scoring method of long-term and short-term preferences as shown in Equations (16) and (17), the product operation is performed on the user's preference vector and the feature vector of the candidate point of interest to obtain the long-term and short-term preference scores of the user for the point of interest: Step 403. Finally, the three parts of the scores are weighted and summed, as shown in Equation (18), to obtain the final score of the user for this point of interest; where α + β + γ = 1, which is the hyperparameter set for the model: Step 404. For the user user u Score the points of interest in the candidate points of interest set according to Steps 401 - 403, and select the k points of interest with the highest predicted scores as the recommended result list, and recommend them to the user user u Recommend.
Citation Information
Patent Citations
Interest point recommendation method based on user positive and negative preference learning
CN110555112A
Interest point recommendation method based on user dynamic preference and attention mechanism
CN110929164A