User interpretable position prediction method and system based on space-time knowledge graph

By constructing a spatiotemporal knowledge graph and using a trajectory prediction model, the problem of low user position prediction accuracy in the prior art is solved, and higher accuracy position prediction and interpretability of spatiotemporal features are achieved.

CN119990404APending Publication Date: 2025-05-13Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411970211.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing user activity trajectory prediction method has low prediction accuracy under data sparseness and has failed to effectively explain the spatiotemporal characteristics of user position changes.

Method used

The user-interpretable position prediction method based on the space-time knowledge graph is adopted. By constructing a space-time knowledge graph, users' activity interest points and time-time information are extracted, users' activity interest points are generated, and users' activity interest points are embedded vectors are generated, and trajectory prediction models are used to predict positions. At the same time, the marginal contribution of space-time features is calculated through Shapley values ​​and the knowledge graph is updated.

Benefits of technology

It improves the accuracy of user position prediction, explains the role of spatial and temporal features on position prediction, realizes attribution analysis of spatial and temporal elements, and improves the interpretability and accuracy of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119990404A_ABST
    Figure CN119990404A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of social network user activity track prediction, in particular to a user interpretable position prediction method and system based on a spatio-temporal knowledge graph, and the method comprises the steps: extracting user activity interest points and user activity spatio-temporal information from a user historical sign-in track sequence; constructing a space-time knowledge graph by using the user activity interest points and the user activity space-time information; generating user activity interest point embedding vectors in the target area by utilizing the space-time knowledge graph, and sorting according to user activity time data to obtain time sequence interest point embedding vectors; inputting the time sequence interest point embedding vector into a trajectory prediction model for training, and predicting and outputting the position of the user at the next moment by utilizing the trajectory prediction model; marginal contribution of the spatio-temporal features in the spatio-temporal knowledge graph is obtained according to prediction output of the trajectory prediction model, and the spatio-temporal features in the spatio-temporal knowledge graph are updated through the marginal contribution. The user position prediction precision can be improved, and the purpose of explaining the space-time element effect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of social network user activity trajectory prediction, and in particular to a user explainable location prediction method and system based on spatiotemporal knowledge graph. Background Art

[0002] From population migration to entertainment and commuting, mobility is an intrinsic attribute of human behavior. With the rapid development of mobile Internet, people record their every move on social media through smart devices such as mobile phones, forming a massive amount of check-in data. Analysis of these extensive check-in data shows that in user mobility, many human activities follow certain patterns with 93% potential predictability. Accurately predicting the next location is of considerable significance. Location prediction in POI recommendation can provide personalized recommendations based on historical behavior and preference patterns. Combining location prediction with disease transmission research can help to gain a deeper understanding of the transmission mechanism of these diseases and formulate effective prevention and control measures. Despite the large amount of social media check-in data, the update frequency of data recorded by location sensors triggered by user check-ins ranges from a few minutes to a few hours. The data of a specific individual is usually sparse and cannot provide comprehensive mobility information about the individual. Therefore, establishing a spatiotemporal nonlinear correlation model under the condition of data sparsity is a necessary condition for location prediction.

[0003] To address the challenge of data sparsity, some methods add complex influences on location prediction, including personal preferences, geographic influences, temporal context, and social influences. ST-RNN and ST-PIL incorporate temporal context and geographic influences into the model, which greatly improves the accuracy of location prediction. Despite these efforts in location prediction, the complex interactions between users and locations, which usually involve human mobility, are often ignored, and the results are still unsatisfactory. Summary of the invention

[0004] To this end, the present invention provides a user-interpretable location prediction method and system based on a spatiotemporal knowledge graph to solve the problem that the existing user activity trajectory prediction results are not ideal.

[0005] According to the design scheme provided by the present invention, on the one hand, a user-interpretable location prediction method based on spatiotemporal knowledge graph is provided, comprising:

[0006] Obtain the user's historical check-in trajectory sequence based on the user's historical activity location check-in data;

[0007] Extracting user activity interest points and user activity spatiotemporal information from the user's historical check-in trajectory sequence, and using the user activity interest points and user activity spatiotemporal information to construct a spatiotemporal knowledge graph for simulating the spatiotemporal characteristics of the user's activities in the physical world and the social world, wherein the user activity spatiotemporal information is used to characterize the user activity spatial data and the user activity time data;

[0008] Generate the embedding vector of user activity points of interest in the target area using the spatiotemporal knowledge graph, and sort the embedding vector of user activity points of interest in the target area according to the user activity time data to obtain the time series embedding vector of the points of interest;

[0009] The time series point of interest embedding vector is input into the trajectory prediction model for training, and the trajectory prediction model is used to predict and output the user's location at the next moment; and the marginal contribution of the spatiotemporal features in the spatiotemporal knowledge graph is obtained based on the predicted output of the trajectory prediction model, and the spatiotemporal features in the spatiotemporal knowledge graph are updated using the marginal contribution.

[0010] As a user explainable location prediction method based on spatiotemporal knowledge graph of the present invention, further, obtaining a user historical check-in trajectory sequence according to the user's historical activity location check-in data includes:

[0011] Based on the user's historical activity location check-in platform, the user's historical activity location check-in data is obtained, and the user's historical activity location check-in data is divided according to the user ID to obtain the user's historical check-in trajectory sequence.

[0012] As a user-interpretable location prediction method based on the spatiotemporal knowledge graph of the present invention, further, the spatiotemporal knowledge graph is constructed using user activity interest points and user activity spatiotemporal information, including:

[0013] The spatial transfer relationship characteristics between user activity interest points are represented by using the user activity interest points, the spatial transfer relationship between each user activity interest point and the frequency of occurrence of each user activity interest point pair in the user historical check-in trajectory sequence;

[0014] The check-in time relationship characteristics of the user at the user activity point of interest are represented by using the user activity point of interest, the check-in time relationship of the user at the user activity point of interest, the time period, and the number of times the user activity point of interest is visited within the time period;

[0015] The spatial proximity relationship characteristics of user activity interest points are represented by using user activity interest points, the spatial proximity relationship between user activity interest points and the direct Euclidean distance;

[0016] Representing the attribute relationship characteristics of user activity interest points by using user activity interest points, attribute relationships of user activity interest points, attribute information of user activity interest points, and attribute relationship weights of user activity interest points;

[0017] A spatiotemporal knowledge graph is constructed based on spatial transfer relationship features, check-in time relationship features, spatial proximity relationship features and attribute relationship features.

[0018] As a user-interpretable location prediction method based on the spatiotemporal knowledge graph of the present invention, further, the spatiotemporal knowledge graph is used to generate an embedding vector of user activity interest points in the target area, including:

[0019] Generate a spatiotemporal knowledge graph subgraph according to the spatiotemporal feature type in the spatiotemporal knowledge graph, wherein the spatiotemporal knowledge graph subgraph includes a spatial transfer relationship feature subgraph, a check-in time relationship feature subgraph, a spatial proximity relationship feature subgraph, and an attribute relationship feature subgraph;

[0020] A graph convolutional neural network is used to represent and learn the nodes in the spatiotemporal knowledge graph subgraph to obtain a node feature embedding vector in the spatiotemporal knowledge graph subgraph. The graph convolutional neural network uses a graph attention mechanism and a multi-head attention mechanism to assign attention weights to the neighbor nodes of the nodes in the corresponding spatiotemporal knowledge graph subgraph and dynamically adjusts the information aggregation parameters used to obtain the feature embedding vector according to the neighbor node attention weights.

[0021] As a user-interpretable location prediction method based on spatiotemporal knowledge graph of the present invention, further, the interest point embedding vectors of user activities in the target area are sorted according to the user activity time data, including:

[0022] Extract the time entity vector in the spatiotemporal knowledge graph, represent the time entity vector into time periods, and use linear functions and activation functions to generate the query time vector representation within the specified time period;

[0023] For each entity vector in the spatiotemporal knowledge graph, a pre-trained embedding layer is used to obtain the specified user preference vector representation;

[0024] A representation fuser is used to fuse the embedding vectors of user activity interest points in the target area, the query time vector representation and the specified user preference vector representation to generate a time series interest point embedding vector with spatiotemporal information. The representation fuser is composed of an embedding layer and a vector concatenation operation.

[0025] As a user-interpretable location prediction method based on a spatiotemporal knowledge graph of the present invention, further, the trajectory prediction model is constructed based on a self-attention encoder and a fully connected layer decoder, wherein the self-attention encoder is composed of a stack of Transformer encoders, which is used to extract multiple time series features in an input vector, and each Transformer encoder is composed of a multi-head self-attention layer and a feedforward neural network layer, and the multi-head self-attention layer is used to perform multiple attention calculations on the input vector using different weight matrices and obtain multiple attention vectors, each attention vector representing sequence features at different levels; the fully connected layer decoder is composed of four fully connected layers, which are used to map time series features to the location probability of user activity interest points.

[0026] As a user-interpretable location prediction method based on the spatiotemporal knowledge graph of the present invention, further, the marginal contribution of the spatiotemporal features in the spatiotemporal knowledge graph is obtained according to the prediction output of the trajectory prediction model, including:

[0027] The corresponding feature Shapley value is calculated based on the spatiotemporal feature set participating in the model user trajectory prediction and all spatiotemporal feature sets in the spatiotemporal knowledge graph, and the marginal contribution of the corresponding spatiotemporal feature is represented by the Shapley value, so as to update the spatiotemporal features in the spatiotemporal knowledge graph using the marginal contribution. All spatiotemporal feature sets in the spatiotemporal knowledge graph include the spatiotemporal features of the spatiotemporal knowledge graph masked during model prediction and the spatiotemporal features of the spatiotemporal knowledge graph participating in the model prediction.

[0028] In another aspect, the present invention further provides a user-interpretable location prediction system based on a spatiotemporal knowledge graph, comprising: a data acquisition module, a graph construction module, a vector generation module and a location prediction module, wherein:

[0029] A data acquisition module, used to acquire a user's historical check-in trajectory sequence based on the user's historical activity location check-in data;

[0030] A graph construction module is used to extract user activity interest points and user activity spatiotemporal information from the user's historical check-in trajectory sequence, and use the user activity interest points and user activity spatiotemporal information to construct a spatiotemporal knowledge graph for simulating the spatiotemporal characteristics of the user's activities in the physical world and the social world. The user activity spatiotemporal information is used to represent the user activity spatial data and the user activity time data;

[0031] A vector generation module is used to generate an embedding vector of user activity points of interest in the target area using the spatiotemporal knowledge graph, and sort the embedding vectors of user activity points of interest in the target area according to the user activity time data to obtain a time series embedding vector of the points of interest;

[0032] The location prediction module is used to input the time series point of interest embedding vector into the trajectory prediction model for training, and use the trajectory prediction model to predict and output the user's next location; and obtain the marginal contribution of the spatiotemporal features in the spatiotemporal knowledge graph based on the predicted output of the trajectory prediction model, and use the marginal contribution to update the spatiotemporal features in the spatiotemporal knowledge graph.

[0033] Beneficial effects of the present invention:

[0034] The present invention is based on the user's historical activity location check-in data and uses the knowledge graph to simulate the user's activities in the physical world and the social world. It learns the feature vector representation in the knowledge graph through a graph structure neural network, maps the different spatiotemporal information in the knowledge graph to the corresponding vector positions to achieve factor decoupling, and uses the trajectory prediction model to predict the probability of the target user's location at the next moment. The Shapley value is further introduced to calculate the contribution value of different factors in the model prediction, and the attribution analysis of spatiotemporal factors is realized, so as to achieve the purpose of improving the accuracy of location prediction and explaining the role of spatiotemporal characteristics. It has good application prospects in the field of user population activity prediction and analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a schematic diagram of a user-interpretable location prediction process based on a spatiotemporal knowledge graph in an embodiment;

[0036] Figure 2 This is a schematic diagram of the principle architecture of user-interpretable position prediction in the embodiment;

[0037] Figure 3 It is a schematic diagram of the multi-GAT principle in the embodiment;

[0038] Figure 4 It is a bar chart showing the Shapley values ​​in the embodiments. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the present invention clearer and more understandable, the present invention is further described in detail below in conjunction with the accompanying drawings and technical solutions.

[0040] Knowledge graph is a graphical data structure that can effectively analyze complex user activities in the physical and social world. POI refers to a point of interest, in which the map is a very core element. Any entity in the map can be used as a POI, such as restaurants, hotels, tourist attractions, etc. The user's historical activity data containing POI can be used to construct a knowledge graph to predict user trajectories using knowledge graph analysis. Figure 1 As shown, a user-interpretable location prediction method based on spatiotemporal knowledge graph is provided, including:

[0041] S101. Acquire a user's historical check-in trajectory sequence based on the user's historical activity location check-in data.

[0042] Specifically, the user's historical activity location check-in data can be obtained based on the user's historical activity location check-in platform, and the user's historical activity location check-in data can be divided according to the user ID to obtain the user's historical check-in trajectory sequence. The check-in platform can be a Forsquare platform.

[0043] like Figure 2 As shown, a spatiotemporal knowledge graph in the user activity trajectory is constructed based on historical data, the knowledge graph is used to analyze and predict the user trajectory, and the knowledge graph is modified through attribution analysis to improve the accuracy and efficiency of location prediction.

[0044] S102. Extracting user activity interest points and user activity spatiotemporal information from the user's historical check-in trajectory sequence, and using the user activity interest points and user activity spatiotemporal information to construct a spatiotemporal knowledge graph for simulating the spatiotemporal characteristics of the user's activities in the physical world and the social world, wherein the user activity spatiotemporal information is used to characterize the user activity spatial data and the user activity time data.

[0045] Specifically, the spatiotemporal knowledge graph is constructed using user activity interest points and user activity spatiotemporal information, which can be designed to include:

[0046] The spatial transfer relationship characteristics between user activity interest points are represented by using the user activity interest points, the spatial transfer relationship between each user activity interest point and the frequency of occurrence of each user activity interest point pair in the user historical check-in trajectory sequence;

[0047] The check-in time relationship characteristics of the user at the user activity point of interest are represented by using the user activity point of interest, the check-in time relationship of the user at the user activity point of interest, the time period, and the number of times the user activity point of interest is visited within the time period;

[0048] The spatial proximity relationship characteristics of user activity interest points are represented by using user activity interest points, the spatial proximity relationship between user activity interest points and the direct Euclidean distance;

[0049] Representing the attribute relationship characteristics of user activity interest points by using user activity interest points, attribute relationships of user activity interest points, attribute information of user activity interest points, and attribute relationship weights of user activity interest points;

[0050] A spatiotemporal knowledge graph is constructed based on spatial transfer relationship features, check-in time relationship features, spatial proximity relationship features and attribute relationship features.

[0051] In this embodiment, the traditional triples of the knowledge graph are expanded into quadruples, weight information is added, and the spatial distribution pattern of POIs, the transfer pattern of users between POIs, the time pattern of user check-ins, and POI attribute information elements are selected to construct the spatiotemporal knowledge graph ST-KG, which comprehensively simulates the activities of users in the physical world and the social world. The formalization of the spatiotemporal knowledge graph ST-KG can be expressed as:

[0052] G=(f T,H,S,A )

[0053] In the formula, f T represents the four-tuple consisting of the spatial transfer relationship between users in POIs; f H represents the four-tuple consisting of the check-in time relationship of the user at the POI point; f s represents a four-tuple consisting of POI spatial proximity relationships; f A Represents a four-tuple consisting of POI attribute relationships. The four influencing factors are specifically defined in the following form:

[0054] The spatial transfer relationship between users and POIs can be expressed as f T :

[0055] f T = <e POI1,transfer,POI2 ,w f >

[0056] In the formula, e POI Indicates the POIs visited by the user; r transferto Indicates the spatial transfer relationship; w f Represents the frequency of the pair (POI1, OI2) appearing in the check-in sequence.

[0057] The check-in time relationship of the user at the POI point can be expressed as f H :

[0058] f H = < e POI,check-in,hour ,w h >

[0059] In the formula, r check-in Indicates the sign-in time relationship, that is, signed in or not signed in a certain time period, e hour Indicates time period. A day can be divided into 24 time periods. h It is the number of times a POI is visited in a certain period of time.

[0060] The spatial proximity relationship of POI can be expressed as f S :

[0061] f S = < e POI1 ,r spatialproximity ,e POI2 ,w d >

[0062] In the formula, r spatial proximity Represents the spatial proximity relationship of POIs. The distance can be used to measure the spatial proximity relationship between two POIs. d Indicates the direct Euclidean distance between two POIs.

[0063] POI attribute relationship can be expressed as f A :

[0064] f A = < e POI ,r attribute ,e category ,w c >

[0065] In the formula, r attribute Represents the POI attribute relationship, that is, whether there is a POI attribute or not. For example, when a user signs in at a park, r attribute To indicate that the POI has this park attribute, e category Represents attribute information, which can refer to the name, type, and other information of the POI. When a relationship exists, the weight w c Assign a value of 1.

[0066] S103, using the spatiotemporal knowledge graph to generate an embedding vector of the interest points of user activities in the target area, and sorting the embedding vectors of the interest points of user activities in the target area according to the user activity time data to obtain a time series interest point embedding vector.

[0067] Specifically, the spatiotemporal knowledge graph is used to generate the embedding vector of the user activity interest points in the target area, which can be summarized as:

[0068] Generate a spatiotemporal knowledge graph subgraph according to the spatiotemporal feature type in the spatiotemporal knowledge graph, wherein the spatiotemporal knowledge graph subgraph includes a spatial transfer relationship feature subgraph, a check-in time relationship feature subgraph, a spatial proximity relationship feature subgraph, and an attribute relationship feature subgraph;

[0069] A graph convolutional neural network is used to represent and learn the nodes in the spatiotemporal knowledge graph subgraph to obtain a node feature embedding vector in the spatiotemporal knowledge graph subgraph. The graph convolutional neural network uses a graph attention mechanism and a multi-head attention mechanism to assign attention weights to the neighbor nodes of the nodes in the corresponding spatiotemporal knowledge graph subgraph and dynamically adjusts the information aggregation parameters used to obtain the feature embedding vector according to the neighbor node attention weights.

[0070] Graph Attention Network (GAT) is a graph neural network model based on the attention mechanism, which can effectively capture the relationship and importance between nodes and achieve excellent performance in many graph-related tasks. In this embodiment, a neural network model composed of multiple GATs (multi-GAT) is used, such as Figure 3 As shown in the figure, they are used to extract the spatial distance features, user movement features, POI attribute features and time features of POIs, further improving the performance of the graph attention mechanism in the knowledge graph, so that vector representations of different dimensions can correspond to different relationship features. The core idea of ​​GAT is to assign different attention weights to the neighbors of each node, so as to dynamically adjust the way of information aggregation according to the importance of neighboring nodes, and better capture the complex structure and relationship in the graph.

[0071] like Figure 3 In the spatial proximity relationship subgraph, user transfer relationship subgraph, POI attribute relationship subgraph, and check-in time feature subgraph shown in the figure, in order to calculate the attention score α between node i and its neighbor node j in each subgraph, the original graph attention calculation is expanded to calculate the attention score α between node i and its neighbor node j in each subgraph, and the original graph attention calculation is extended ... e Assign d-dimensional embedding vector The attention score between nodes i and j is calculated as follows:

[0072]

[0073] Among them, a represents the learnable weight vector, h i ,h j represents the feature vector of node i, j, represents the set of neighbor nodes of node i, [·∥·] represents the feature concatenation of nodes i and j, and W is the learnable parameter matrix.

[0074] Multi-head attention uses different weight matrices to perform multiple attention calculations on the feature vector of the node to obtain multiple attention vectors. Each self-attention vector represents the node features at different levels. The calculation formula is as follows:

[0075]

[0076] in, represents the attention score obtained by performing the k-th attention calculation, Perform the kth attention calculation for the node to obtain the vector representation. ∥ indicates the concatenation operation of the vector representations obtained by multiple attention calculations.

[0077] In the representation of the last layer (Lth), multiple attention vectors are averaged:

[0078]

[0079] In order to prevent the gradient from exploding or disappearing and make the model training converge smoothly, L2 normalization is used to normalize the output results:

[0080]

[0081] in, is the average result of multiple attention vectors, o i is the vector representation of node i, o i ∈P n*d , n is the number of edge types, and d is the selected vector embedding dimension.

[0082] Among them, sorting the interest point embedding vectors of user activities in the target area according to the user activity time data may include:

[0083] Extract the time entity vector in the spatiotemporal knowledge graph, represent the time entity vector into time periods, and use linear functions and activation functions to generate the query time vector representation within the specified time period;

[0084] For each entity vector in the spatiotemporal knowledge graph, a pre-trained embedding layer is used to obtain the specified user preference vector representation;

[0085] A representation fuser is used to fuse the embedding vectors of user activity interest points in the target area, the query time vector representation and the specified user preference vector representation to generate a time series interest point embedding vector with spatiotemporal information. The representation fuser is composed of an embedding layer and a vector concatenation operation.

[0086] In order to incorporate the time information of user activities into the model to query activities within the time period, the query time representation function can be used. First, the time entity vectors from the knowledge graph represent different time periods, and then a linear function and activation function are used to generate a low-dimensional dense vector representation of the query value:

[0087] e q =tanh(e t W q +b q )

[0088] Where W q is the weight matrix, b q is the bias term and tanh is the activation function.

[0089] To capture the general behavior of a particular user u, an embedding layer is trained to project each user into a low-dimensional vector:

[0090] e u =f embed (u)

[0091] In the formula, u is a given user, f embed is the embedding layer, e u Generate user vector representations through the embedding layer to learn user preferences.

[0092] The representation fuser is used to fuse the POI representation, user preference representation, and query time representation to generate a check-in trajectory vector representation with rich spatiotemporal information. The representation fuser consists of an embedding layer and a splicing operation. The calculation principle can be expressed as follows:

[0093]

[0094] In the formula, e p is the vector representation of POI, e q To represent the query time, the symbol Represents vector concatenation.

[0095] S104. Input the time series point of interest embedding vector into the trajectory prediction model for training, and use the trajectory prediction model to predict and output the user's location at the next moment; and obtain the marginal contribution of the spatiotemporal features in the spatiotemporal knowledge graph based on the predicted output of the trajectory prediction model, and use the marginal contribution to update the spatiotemporal features in the spatiotemporal knowledge graph.

[0096] The trajectory prediction model extracts multiple temporal features from the sequence embedding vector through the multi-head self-attention mechanism in the self-attention encoder, and maps the features to the probability of the user visiting the POI location in the set through the fully connected layer decoder to achieve location prediction. Among them, the self-attention encoder is composed of three standard Transformer encoders stacked together, each of which consists of a multi-head self-attention layer and a feedforward neural network layer. The multi-head self-attention layer uses different weight matrices to perform multiple self-attention calculations on the input trajectory vector representation to obtain multiple attention vectors, each of which represents sequence features at different levels. The multi-head self-attention layer consists of self-attention heads, residual connections, and layer normalization. The decoder fits the trajectory sequence feature matrix formed by the self-attention encoder and maps it into the probability of the user visiting the POI set in the area. Since the enhanced representation of the check-in trajectory incorporates rich external information, adding spatiotemporal constraints during prediction can improve the model's ability to extract multiple spatiotemporal features. Therefore, a fully connected layer is added to the decoder to predict the POI category attributes. The decoder consists of four fully connected layers, which are used to predict the POIs and category attributes that the user will visit.

[0097] The corresponding feature SHAP value can be calculated based on the spatiotemporal feature set participating in the model user trajectory prediction and all spatiotemporal feature sets in the spatiotemporal knowledge graph, and the marginal contribution of the corresponding spatiotemporal feature can be represented by the SHAP value, so as to update the spatiotemporal features in the spatiotemporal knowledge graph using the marginal contribution. All spatiotemporal feature sets in the spatiotemporal knowledge graph include the spatiotemporal features of the spatiotemporal knowledge graph masked during model prediction and the spatiotemporal features of the spatiotemporal knowledge graph participating in the model prediction.

[0098] The importance of elements in the spatiotemporal knowledge graph is determined by introducing the Shapley value. According to the output of the trajectory prediction model, the marginal contribution of various spatiotemporal features in the spatiotemporal knowledge graph is calculated, the spatiotemporal features that play a positive role in the prediction results are identified, and the negative features are removed, thereby improving the accuracy of position prediction and reducing the complexity of the model. When predicting the model, different spatiotemporal features of the knowledge graph can be shielded to allow different features to participate in trajectory prediction, and then the feature SHAP value is calculated based on the prediction results. For a single sample x, the expression of the explanation is as follows:

[0099]

[0100] In the formula, g represents the explanatory model; M represents the number of spatiotemporal features in the prediction model; z i ′ ∈{0,1} M Indicates whether the i-th feature participates in model prediction; φ0 represents the benchmark value; φ i Represents the SHAP value of the i-th feature, that is, the contribution value\attribution value.

[0101] The SHAP value calculation formula is:

[0102]

[0103] In the formula, φ i represents the SHAP value of the i-th feature; S represents the set of spatiotemporal features involved in the prediction; F represents the set of all spatiotemporal features; f represents the trajectory prediction model.

[0104] When the g(x) value corresponding to the spatiotemporal feature x obtained by the above calculation is positive, the spatiotemporal feature can be determined as a spatiotemporal feature that plays a positive role in the prediction result. If the g(x) value is negative, the spatiotemporal feature can be determined as a spatiotemporal feature that plays a negative role in the prediction result, and the negative feature is removed from the spatiotemporal knowledge graph.

[0105] Furthermore, based on the above method, an embodiment of the present invention also provides a user-interpretable location prediction system based on spatiotemporal knowledge graph, comprising: a data acquisition module, a graph construction module, a vector generation module and a location prediction module, wherein:

[0106] A data acquisition module, used to acquire a user's historical check-in trajectory sequence based on the user's historical activity location check-in data;

[0107] A graph construction module is used to extract user activity interest points and user activity spatiotemporal information from the user's historical check-in trajectory sequence, and use the user activity interest points and user activity spatiotemporal information to construct a spatiotemporal knowledge graph for simulating the spatiotemporal characteristics of the user's activities in the physical world and the social world. The user activity spatiotemporal information is used to represent the user activity spatial data and the user activity time data;

[0108] A vector generation module is used to generate an embedding vector of user activity points of interest in the target area using the spatiotemporal knowledge graph, and sort the embedding vectors of user activity points of interest in the target area according to the user activity time data to obtain a time series embedding vector of the points of interest;

[0109] The location prediction module is used to input the time series point of interest embedding vector into the trajectory prediction model for training, and use the trajectory prediction model to predict and output the user's next location; and obtain the marginal contribution of the spatiotemporal features in the spatiotemporal knowledge graph based on the predicted output of the trajectory prediction model, and use the marginal contribution to update the spatiotemporal features in the spatiotemporal knowledge graph.

[0110] In order to verify the effectiveness of this solution, the following is a further explanation based on experimental data:

[0111] The embodiment selects hit rate (HR@K) and mean reciprocal rank (MRR) as evaluation indicators and verifies them on the check-in dataset of location A.

[0112] The experiment selected different trajectory prediction baseline methods (ST-RNN, DeepMove, PLSPL and GETNext) for comparative analysis, as shown in Table 1.

[0113] Table 1 Comparison of the accuracy of this solution and common location prediction methods (%)

[0114]

[0115] As shown in Table 1, our solution outperforms other baseline methods in both HR@K and MRR accuracy evaluation indicators. Compared with the baseline methods, the GETNext model based on the multi-head self-attention mechanism and our solution outperform ST-RNN, DeepMove, and PLSPL based on recurrent neural networks because the attention mechanism solves the problem of difficult extraction of multiple periodic features and long-distance dependencies in sequence models by simulating human-like focus. When representing POIs, GETNext only models the transfer mode, but our solution models the user's check-in activities in the real world through the spatiotemporal knowledge graph, making the representation of POIs more comprehensive. Therefore, our solution has higher prediction accuracy than GETNex.

[0116] In order to analyze the role of different elements in the spatiotemporal knowledge graph, Shapley value is used to perform feature attribution analysis, such as Figure 4 As shown in the figure. It can be found that in the Singapore dataset, the addition of features such as POI category attributes, user spatial transfer patterns, and POI spatial distribution all play a positive role in the model's prediction, but the time features formed by the user's check-in time have a negative effect on the model's prediction. Check-in data is only recorded when the user actively registers, which makes the check-in data have a certain deviation and cannot fully reflect the user's activities. In the construction of the spatiotemporal knowledge graph, 1h is used as the time granularity. However, in these flow patterns, time features are most likely to fluctuate. When events such as traffic jams occur, users are more likely to record, and time features may have a negative impact on location prediction. In this case, by introducing the Shapley value to calculate the contribution value of different factors in the model prediction, the attribution analysis of spatiotemporal elements is realized, which can achieve the purpose of improving the accuracy of location prediction and explaining the role of spatiotemporal features. The above experimental data can show that this case can also solve the problems of factor decoupling and unclear role in existing deep learning location prediction, and has good application prospects in the field of studying crowd activity trajectories.

[0117] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0118] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0119] The units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation is not considered to be beyond the scope of the present invention.

[0120] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits, and accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of software function modules. The present invention is not limited to any specific form of combination of hardware and software.

[0121] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A user-interpretable location prediction method based on spatiotemporal knowledge graph, characterized in that: Include: Obtain the user's historical check-in trajectory sequence based on the user's historical activity location check-in data; Extracting user activity interest points and user activity spatiotemporal information from the user's historical check-in trajectory sequence, and using the user activity interest points and user activity spatiotemporal information to construct a spatiotemporal knowledge graph for simulating the spatiotemporal characteristics of the user's activities in the physical world and the social world, wherein the user activity spatiotemporal information is used to characterize the user activity spatial data and the user activity time data; Generate the embedding vector of user activity points of interest in the target area using the spatiotemporal knowledge graph, and sort the embedding vector of user activity points of interest in the target area according to the user activity time data to obtain the time series embedding vector of the points of interest; The time series point of interest embedding vector is input into the trajectory prediction model for training, and the trajectory prediction model is used to predict and output the user's location at the next moment; and the marginal contribution of the spatiotemporal features in the spatiotemporal knowledge graph is obtained based on the predicted output of the trajectory prediction model, and the spatiotemporal features in the spatiotemporal knowledge graph are updated using the marginal contribution.

2. The user-interpretable location prediction method based on spatiotemporal knowledge graph according to claim 1, characterized in that: Obtain the user's historical check-in trajectory sequence based on the user's historical activity location check-in data, including: Based on the user's historical activity location check-in platform, the user's historical activity location check-in data is obtained, and the user's historical activity location check-in data is divided according to the user ID to obtain the user's historical check-in trajectory sequence.

3. The user-interpretable location prediction method based on spatiotemporal knowledge graph according to claim 1, characterized in that: Use user activity points of interest and user activity spatiotemporal information to build a spatiotemporal knowledge graph, including: The spatial transfer relationship characteristics between user activity interest points are represented by using the user activity interest points, the spatial transfer relationship between each user activity interest point and the frequency of occurrence of each user activity interest point pair in the user historical check-in trajectory sequence; The check-in time relationship characteristics of the user at the user activity point of interest are represented by using the user activity point of interest, the check-in time relationship of the user at the user activity point of interest, the time period, and the number of times the user activity point of interest is visited within the time period; The spatial proximity relationship characteristics of user activity interest points are represented by using user activity interest points, the spatial proximity relationship between user activity interest points and the direct Euclidean distance; Representing the attribute relationship characteristics of user activity interest points by using user activity interest points, attribute relationships of user activity interest points, attribute information of user activity interest points, and attribute relationship weights of user activity interest points; A spatiotemporal knowledge graph is constructed based on spatial transfer relationship features, check-in time relationship features, spatial proximity relationship features and attribute relationship features.

4. The user-interpretable location prediction method based on spatiotemporal knowledge graph according to claim 1 or 3, characterized in that: Generate embedding vectors of user activity points of interest in the target area using the spatiotemporal knowledge graph, including: Generate a spatiotemporal knowledge graph subgraph according to the spatiotemporal feature type in the spatiotemporal knowledge graph, wherein the spatiotemporal knowledge graph subgraph includes a spatial transfer relationship feature subgraph, a check-in time relationship feature subgraph, a spatial proximity relationship feature subgraph, and an attribute relationship feature subgraph; A graph convolutional neural network is used to represent and learn the nodes in the spatiotemporal knowledge graph subgraph to obtain a node feature embedding vector in the spatiotemporal knowledge graph subgraph. The graph convolutional neural network uses a graph attention mechanism and a multi-head attention mechanism to assign attention weights to the neighbor nodes of the nodes in the corresponding spatiotemporal knowledge graph subgraph and dynamically adjusts the information aggregation parameters used to obtain the feature embedding vector according to the neighbor node attention weights.

5. The user-interpretable location prediction method based on spatiotemporal knowledge graph according to claim 1, characterized in that: Sort the embedding vectors of the points of interest of user activities in the target area according to the user activity time data, including: Extract the time entity vector in the spatiotemporal knowledge graph, represent the time entity vector into time periods, and use linear functions and activation functions to generate the query time vector representation within the specified time period; For each entity vector in the spatiotemporal knowledge graph, a pre-trained embedding layer is used to obtain the specified user preference vector representation; A representation fuser is used to fuse the embedding vectors of user activity interest points in the target area, the query time vector representation and the specified user preference vector representation to generate a time series interest point embedding vector with spatiotemporal information. The representation fuser is composed of an embedding layer and a vector concatenation operation.

6. The user-interpretable location prediction method based on spatiotemporal knowledge graph according to claim 1, characterized in that: The trajectory prediction model is constructed based on a self-attention encoder and a fully connected layer decoder, wherein the self-attention encoder is composed of a stack of Transformer encoders, which is used to extract multiple time series features in the input vector, and each Transformer encoder is composed of a multi-head self-attention layer and a feedforward neural network layer. The multi-head self-attention layer is used to perform multiple attention calculations on the input vector using different weight matrices and obtain multiple attention vectors, each of which represents sequence features at different levels; the fully connected layer decoder is composed of four fully connected layers, which is used to map the time series features to the location probability of the user's activity interest points.

7. The user-interpretable location prediction method based on spatiotemporal knowledge graph according to claim 1, characterized in that: According to the prediction output of the trajectory prediction model, the marginal contribution of spatiotemporal features in the spatiotemporal knowledge graph is obtained, including: The corresponding feature SHAP value is calculated based on the spatiotemporal feature set participating in the model user trajectory prediction and all spatiotemporal feature sets in the spatiotemporal knowledge graph, and the marginal contribution of the corresponding spatiotemporal feature is represented by the SHAP value, so as to update the spatiotemporal features in the spatiotemporal knowledge graph using the marginal contribution. All spatiotemporal feature sets in the spatiotemporal knowledge graph include the spatiotemporal features of the spatiotemporal knowledge graph masked during model prediction and the spatiotemporal features of the spatiotemporal knowledge graph participating in the model prediction.

8. A user-interpretable location prediction system based on spatiotemporal knowledge graph, characterized in that: It includes: data acquisition module, graph construction module, vector generation module and position prediction module, among which, A data acquisition module, used to acquire a user's historical check-in trajectory sequence based on the user's historical activity location check-in data; A graph construction module is used to extract user activity interest points and user activity spatiotemporal information from the user's historical check-in trajectory sequence, and use the user activity interest points and user activity spatiotemporal information to construct a spatiotemporal knowledge graph for simulating the spatiotemporal characteristics of the user's activities in the physical world and the social world. The user activity spatiotemporal information is used to represent the user activity spatial data and the user activity time data; A vector generation module is used to generate an embedding vector of user activity points of interest in the target area using the spatiotemporal knowledge graph, and sort the embedding vectors of user activity points of interest in the target area according to the user activity time data to obtain a time series embedding vector of the points of interest; The location prediction module is used to input the time series point of interest embedding vector into the trajectory prediction model for training, and use the trajectory prediction model to predict and output the user's location at the next moment; and obtain the marginal contribution of the spatiotemporal features in the spatiotemporal knowledge graph based on the predicted output of the trajectory prediction model, and use the marginal contribution to update the spatiotemporal features in the spatiotemporal knowledge graph.

9. An electronic device, characterized in that: include: at least one processor, and a memory coupled to the at least one processor; The memory stores a computer program, and the computer program can be executed by the at least one processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 can be implemented.