A user trajectory prediction method and system based on multi-relation fusion analysis
By constructing a trajectory relationship diagram and using an attention mechanism LSTM model, combining information about users of similar historical trajectories and adjacent users, the problems of inaccurate trajectory prediction and insufficient influence utilization in the existing technology are solved, and more efficient and accurate trajectory prediction.
Patent Information
- Application Number
- CN202111573021.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The existing trajectory prediction methods have inaccurate prediction problems in granularity division, have not fully utilized user influence information, and have simple influence modeling methods, so they cannot effectively capture the behavioral characteristics of complex people.
Using a multi-relational fusion analysis method, the trajectory relationship diagram of the user's historical trajectory similarity relationship and position proximity relationship is constructed, and the trajectory prediction is performed using the LSTM model integrated with the attention mechanism, combining the information of users with historical trajectory similarity and position proximity users. Make predictions.
It improves the accuracy and robustness of trajectory prediction, fully explores social behavior information, takes into account the differences in influence of different users, and enhances the accuracy and time efficiency of prediction.
Smart Images

Figure CN114461931B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer data mining and analysis, in particular to the technical field of stream data mining, and specifically refers to a trajectory prediction method and system based on multi-relation fusion analysis. Background Art
[0002] The topic of human motion trajectory prediction has been a hot topic for domestic and foreign scholars in recent years due to its complexity. With the rise and popularization of artificial intelligence technology, intelligent applications such as intelligent security systems, self-driving cars, and robot navigation systems have gradually come into the public eye. If we can understand and predict the trajectory of people in complex real-life scenarios and dynamically predict the future location of each individual in real time, intelligent applications can improve the service accuracy and availability of the above intelligent applications based on real-time locations, which is of great significance to the development of intelligent applications.
[0003] Most existing trajectory prediction methods only rely on the user's historical trajectory data for prediction, which can be roughly divided into two categories: prediction methods based on traditional data mining and prediction methods based on deep learning.
[0004] Most prediction methods based on traditional data mining are based on restricted road networks, which require first dividing a fixed and large location area into multiple small areas. For the possibility of the user being in each sub-area, this method models each possibility as a separate state, abstracting the location prediction problem into a problem of state transfer and state selection. In this study, three types of methods are widely used: modeling based on interaction relationships, based on probabilistic graph models, and based on sequence analysis. These methods generally need to divide the road network first when performing trajectory prediction, so depending on the size of the division granularity, there are different degrees of prediction inaccuracy.
[0005] Most prediction methods based on deep learning use RNN and its variants, including LSTM, GRU, etc., to abstract trajectory prediction as a sequence prediction problem. RNN network structures have been widely and successfully applied in trajectory prediction tasks. Most early methods regard each user as a piece of training data, and the prediction of each piece of data is an independent process. In order to incorporate more relevant features, some methods that predict multiple users at the same time have emerged in recent years. Most of these methods adopt similar assumptions, that is, individuals with similar geographical locations may be affected by each other's trajectory behaviors. When the target individual is located in an area with dense population, the trajectory behavior characteristics of most people can reflect the decision-making and response of the human brain to complex scenes to a certain extent, and the behavior of the target individual may also tend to follow or approach the behavioral characteristics of the majority of people. This type of method generally believes that the nearby pedestrians of the target individual at the current moment will affect the position of the target at the next moment. In essence, it is an approximation of the hotspot route, and the social behavior of users has not been deeply explored. In addition, most methods only conduct fine-grained trajectory prediction experiments. Their effectiveness in the task of mobile Internet user trajectory prediction with a longer time range needs further verification. At the same time, this type of method has a relatively simple way of modeling user influence and lacks consideration of the differences in influence among different users. Summary of the invention
[0006] In order to solve the problems of inaccurate prediction caused by the need to divide the granularity of existing user trajectory prediction algorithms, insufficient utilization of user influence information, and a relatively simple way to measure influence, the present invention provides a user trajectory prediction method and system based on multi-relationship fusion analysis.
[0007] The technical solution adopted by the present invention to solve its technical problem is:
[0008] A user trajectory prediction method based on multi-relation fusion analysis includes the following steps:
[0009] Construct a trajectory relationship graph based on the user's historical trajectory similarity and location proximity;
[0010] Based on the relationship between users in the trajectory relationship graph, the trajectory prediction model with attention mechanism is used to predict the future trajectory of the target user.
[0011] Furthermore, constructing a trajectory relationship graph according to the historical trajectory similarity relationship and location proximity relationship of the user includes:
[0012] Each element in the user set is regarded as a vertex in the graph. If the users represented by two vertices are judged to have similar historical trajectories, an edge is added between the vertices representing the two users. For the current moment, if the users represented by two vertices in the time slice are geographically adjacent at the current moment, an edge is added between the vertices representing the two users.
[0013] Furthermore, the following steps are used to screen users with similar historical trajectories to obtain the similarity relationship of the historical trajectories:
[0014] Encode part of the historical trajectories of all users as the initial user codes;
[0015] The users are clustered using their initial codes, and the similarity of the initial codes between users is calculated. Based on the similarity, people with similar historical trajectories are obtained.
[0016] Furthermore, the encoding of a portion of the historical tracks of all users as the user initial code includes:
[0017] Determine a fixed length as the history trajectory length used for encoding history trajectories, set up an LSTM network with the fixed length, and randomly extract multiple trajectory segments of the fixed length from the dataset, and use these trajectory segments to train the LSTM;
[0018] For each user, the trajectory data of the previous time slice of equal length is taken as the user's initial coding trajectory segment, and the initial coding trajectory segment is input into the trained LSTM sequence, and the trajectory points are input in sequence, where the output supervision data of each LSTM unit is the vector of the next trajectory point; the user's initial coding is the hidden state output by the last unit after the user's initial coding trajectory segment is input into the LSTM sequence.
[0019] Furthermore, clustering users using their initial codes, calculating the similarity of initial codes between users, and obtaining people with similar historical trajectories according to the similarity includes:
[0020] At the initial moment, the initial code obtained is used as the basis for judging the similarity of historical trajectories between users. The cosine similarity is used to calculate the similarity of the codes of two users as the similarity of the historical trajectories of users. For the similarity of historical trajectories obtained, a threshold is taken. When the similarity of a pair of users is greater than the threshold, the pair of users is considered to have similar historical trajectories. In the actual prediction process, a suitable time interval is selected to update the similarity of historical trajectories at regular intervals.
[0021] Furthermore, based on the relationship between users in the trajectory relationship graph, the trajectory prediction model incorporating the attention mechanism is used to predict the future trajectory of the target user, including trajectory independent sequence prediction and relationship fusion prediction:
[0022] In trajectory independent sequence prediction, a single person is regarded as a sequence, and the trajectory of each target user is divided into segments according to the window. Each segment constitutes a separate data. Then, an LSTM network is constructed, and the trajectory data is input into the LSTM sequence to complete the training and prediction of each data. The input of each LSTM unit is the position point of the current time slice of the trajectory segment, the hidden state of the previous unit in the LSTM sequence, and the hidden state of the previous moment in the LSTM sequence of the user trajectory that has two similar relationships with the user. The output of the LSTM unit is the hidden state of the unit and a predicted position vector.
[0023] In relational fusion prediction, the update formula of LSTM is adjusted, and the relationship in the trajectory relationship graph is used to update and predict LSTM.
[0024] A user trajectory prediction system based on multi-relation fusion analysis using the above method comprises:
[0025] A trajectory relationship graph construction module is used to construct a trajectory relationship graph based on the user's historical trajectory similarity relationship and location proximity relationship;
[0026] The trajectory prediction module is used to predict the future trajectory of the target user based on the relationship between users in the trajectory relationship graph using a trajectory prediction model that incorporates an attention mechanism.
[0027] The beneficial effects of the present invention are as follows:
[0028] 1. The present invention fully considers the temporal regularity characteristics of user travel and fully explores the social behavior information of the crowd. The experimental results show that the prediction accuracy of the present invention is significantly improved compared with the trajectory prediction algorithm that does not use social behavior information.
[0029] 2. The model of the present invention is not a traditional data mining method, does not require the division of regional networks, is not limited by the division granularity, improves the accuracy of position prediction, and enhances the robustness of the prediction method for coarse-grained trajectory data.
[0030] 3. The present invention mainly adopts the attention mechanism to capture the influence between nodes and type information, and can improve the time efficiency of the model through parallel computing.
[0031] 4. The present invention takes into account the complexity of similar relationships among people, uses a trajectory relationship graph that incorporates an attention mechanism to calculate the size of the influence, and incorporates the differences in the impact of different users on the trajectory, which is more in line with the actual situation.
[0032] 5. The present invention not only utilizes the trajectory behavior information of pedestrians in adjacent positions, but also considers the trajectory of users with similar historical trajectories, combines the two types of influencing groups together to construct a trajectory relationship graph, and solves the problem of how to model multiple types of information. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a model diagram based on multi-feature deep coding of the present invention. In the figure, u1, u2, and u3 represent three users in the data set respectively. They represent the weights of the similarity between all other users and users u1, u2, and u3 at the i-th moment, which can be used to calculate the weighted average of the hidden states of all users with similar relationships to the user. This diagram shows that there is a location proximity relationship or a historical trajectory similarity relationship between user u2 and user u1, and between user u2 and user u3.
[0034] Figure 2 It is a schematic diagram of constructing a trajectory relationship graph. The figure shows that the construction of the trajectory relationship graph is based on the location proximity relationship and the historical trajectory similarity relationship, where the historical trajectory similarity relationship is determined by initially encoding the front-end trajectory and calculating the similarity.
[0035] Figure 3 This is a schematic diagram of the LSTM sequence model. For the input position at each moment, its supervision data is the position at the next moment. DETAILED DESCRIPTION
[0036] The present invention is further described in detail below through specific embodiments and drawings.
[0037] The present invention provides a user trajectory prediction technology based on multi-relation fusion analysis. This method proposes a new hypothesis that not only utilizes the trajectory behavior information of pedestrians in adjacent positions, but also considers the trajectory of users with similar historical trajectories, and combines the two influencing groups to construct a trajectory relationship graph. Then, based on the relationship between users in the trajectory relationship graph, an improved LSTM model is used to add an attention mechanism to synchronize the group user trajectories, and the future trajectory of the target user is predicted, taking into account the differences in the impact of different users on the trajectory. Figure 1 It is a model diagram based on multi-feature deep coding of the present invention, and there is a positional proximity relationship or a historical trajectory similarity relationship between user u2 and user u1, and between user u2 and user u3.
[0038] The method of the present invention mainly includes two processes: constructing a trajectory relationship graph and predicting a trajectory sequence using a model. The trajectory relationship graph construction includes two processes: screening users with similar historical trajectories and building a graph; and the model prediction includes two processes: trajectory independent sequence prediction and relationship fusion prediction. Figure 2 It is a schematic diagram of constructing a trajectory relationship diagram.
[0039] In the process of screening users with similar historical trajectories, first of all, a part of the historical trajectory of all users is intercepted and encoded as the initial code of the user. The specific approach is to determine a fixed length as the historical trajectory length used when encoding the historical trajectory. Set up an LSTM network with the fixed length, and randomly extract multiple trajectory segments of the same length from the data set, and use these trajectory segments to train the LSTM. For each user in the data set, take the trajectory data of the previous time slice of equal length as the initial encoded trajectory segment of the user, and input the initial encoded trajectory segment into the trained LSTM sequence. The trajectory points are input in sequence, where the output supervision data of each LSTM unit is the vector of the next trajectory point, such as Figure 3 As shown. In addition, in order to obtain deeper information, an extended dimension should be set in actual operation. Then the user initial code is used to cluster the users, and the initial code similarity between users is calculated, and the users with higher similarity are classified as people with similar historical trajectories. At the initial moment, the obtained initial code is used as the basis for judging the similarity of historical trajectories between users, and the cosine similarity is used to calculate the similarity of the pair of user codes as the similarity value of the historical trajectory of the user. For the obtained historical trajectory similarity, a threshold is taken. When the similarity of a pair of users is greater than the threshold, the pair of users is considered to have similar historical trajectories. For user pairs with similar historical trajectories, the similarity value is retained for subsequent weight calculations. In addition, considering that in the actual prediction process, the trajectory characteristics of users may change over time, and the historical trajectory similar users of the same user may also change, a suitable time interval should be selected in the actual prediction process to update the similarity of historical trajectories every once in a while.
[0040] The mapping process uses users with high initial coding similarity and users at the same location at the current moment to build a trajectory relationship graph. The historical trajectory similarity relationship and adjacent relationship between individuals can be represented as an undirected graph similar to a social network. These two types of relationships are modeled as an undirected graph, in which each element in the user set can be regarded as a vertex in the graph. If two users represented by the vertices are judged to have a historical trajectory similarity relationship, an edge is added between the vertices representing the two users. In addition, for the current moment, if the users represented by two vertices in the time slice are geographically adjacent at the current moment, an edge is added between the vertices representing the two users. The trajectory relationship graph is formed by these two rules.
[0041] In the trajectory prediction part, this method predicts the future trajectory of the target user based on the dependency relationship in the trajectory relationship graph and uses a trajectory prediction model that incorporates an attention mechanism.
[0042] In trajectory independent sequence prediction, a single person is regarded as a sequence, and the trajectory of each target user is divided into segments according to the window. Each segment constitutes a separate data. Then, an LSTM network is constructed, and the trajectory data is input into the LSTM sequence to complete the training and prediction of each data. The trajectory information is used in the network as follows: the input of each LSTM unit is the position point of the current time slice of the trajectory segment, the hidden state of the previous unit in the LSTM sequence, and the hidden state of the previous moment in the LSTM sequence of the user trajectory with two similar relationships with the user; the output of the LSTM unit is the hidden state of the unit and a predicted position vector. During training, the output supervision data is the vector of the next trajectory point of the trajectory sequence; during prediction, the position point output by the previous unit is used as the input position point of the next unit. After obtaining the hidden state of the last unit output after the initial encoding trajectory segment is input into the LSTM sequence.
[0043] In the relational fusion prediction, the update formula of LSTM is adjusted so that the hidden state of each target is affected by two associated users, that is, the relationship in the trajectory relationship graph is used to update and predict LSTM. In order to jointly model and predict between multiple users, the present invention can use the hidden state of the LSTM sequence to simulate the influence on the user. For the LSTM network, the hidden state of each LSTM unit can represent the motion characteristics and trends of the trajectory at that moment to a certain extent. By transferring the mutual influence of users to the hidden state, the associated user trajectory characteristics of the target user can be included in the consideration range of the next LSTM unit, and the purpose of trajectory prediction using associated users can be achieved to a certain extent.
[0044] In this model, for each LSTM unit, its hidden state is determined by the hidden state of the previous unit in the LSTM sequence and the hidden state of the previous LSTM unit of the adjacent user in the trajectory relationship graph of the user in the current time slice. The specific update formula is as follows:
[0045]
[0046] in, represents the output of the last LSTM unit, that is, the hidden state of the LSTM sequence of the nth user at time t-1, H (t-1) Represents the hidden state of the LSTM sequence of all users at the t-1th moment.
[0047]
[0048] Among them, Sim (t) It represents the similarity of LSTM hidden states between two users at time t, and Norm represents the L2 norm.
[0049]
[0050] Among them, A (t) Represents the weighted average of the hidden states of all users with similar relationships to the current user; It is a mask matrix, which is an intermediate value. It only retains the similarity of the hidden states between users with similar relationships, and sets the similarity of users without similar relationships (i.e., not adjacent in the graph) to 0 for the next step of calculation.
[0051] Using this formula, With H (t-1) For each user, we can get the weighted average of the hidden states of all users with similar relationships to the user. (t) Update the LSTM.
[0052] Zt=σ(W Z A (t) +U Z H (t-1) )
[0053] R t =σ(W R A (t) +U R H (t-1) )
[0054]
[0055] The above formula is the LSTM internal parameter update method, where Z t represents the output of the update gate in the LSTM unit, σ represents the sigmoid activation function, and R t Represents the output of the forget gate part in the LSTM unit, W Z Indicates that it corresponds to A (t) The update gate can train the weight parameter, U Z Indicates that it corresponds to H (t-1) The update gate can train the weight parameter, W R Indicates that it corresponds to A (t) The forget gate can train the weight parameter, U R Indicates that it corresponds to H (t-1) The forget gate can train the weight parameter, W represents the corresponding weight of A (t) The output gate of H can be trained with weight parameters, U represents the corresponding (t-1) The output gate of can train the weight parameters, Represents the raw output of the LSTM unit.
[0056] The output formula is Y (t) =LSTM(H (t-1) , X (t-1)), where X (t-1) is the input position information matrix, Y (t) It is the position information matrix output at this moment.
[0057] After every fixed number of windows, the trajectory relationship graph is updated, and the updated trajectory relationship graph is used to continue to make predictions using the aforementioned method.
[0058] An embodiment of the present invention discloses a user trajectory prediction method based on multi-relation fusion, comprising the following steps:
[0059] Assume that given user i and user j, the sequence represents a trajectory sequence of length n for user i, where represents the trajectory point of user i in the kth time slice, Respectively represent the longitude and latitude of the trajectory point. The specific process of predicting the trajectory of user i is as follows:
[0060] (1) Determine a fixed length l pre As the length of the history track used when encoding the history track. Set a length of l pre LSTM network, and randomly extract multiple segments of length l in the dataset pre These trajectory segments are used to train the LSTM.
[0061] (2) Take the first l of user i pre The trajectory data of each time slice is used as the initial encoding trajectory segment of user i, and the trajectory segment is input into the trained LSTM sequence. The initial encoding of user i is the hidden state output by the last unit after the initial encoding trajectory segment of user i is input into the LSTM sequence.
[0062] (3) Using the initial code obtained in (2) as the initial value, calculate the cosine similarity between the two user codes as the similarity value of user i to the historical trajectory.
[0063] (4) For the obtained historical trajectory similarity, a threshold δ is taken. If the similarity between user i and user j is greater than the threshold δ, user i and user j are considered to have similar historical trajectories. Users with higher similarity are classified as people with similar historical trajectories. Repeat this process to obtain all users with similar historical trajectories to user i. For user pairs with similar historical trajectories, the similarity value is retained for subsequent weight calculation.
[0064] (5) Using the users with high initial code similarity of user i and the users with the same current position, a trajectory relationship graph G = (U, E) is established. Each element in the user set can be regarded as a vertex in the graph G, U is the vertex set, and E is the edge set.
[0065] (6) If user i and user j are judged to have a historical trajectory similarity relationship, then an edge is added between vertices a and b representing user i and user j in set U, that is, an edge (a, b) is added in E.
[0066] (7) If user i and user j are determined to be geographically adjacent at the current moment, an edge is added between vertices a and b representing user i and user j respectively in set U, that is, an edge (a, b) is added in E.
[0067] (8) Divide the trajectory of user i into segments according to the window, and each segment constitutes a separate data. For each trajectory, use the first half of the trajectory for model training, and predict the second half of the trajectory and compare it with the actual trajectory. Set up an LSTM network with the same length as the trajectory sequence, and pre-train the network. Correspond to the time slice of each trajectory, and use the time slice as the time reference. In each time slice, input the trajectory points of all trajectories at that moment into their respective LSTM networks. Sequentially Input into the kth LSTM unit. For the kth LSTM unit, its supervision data is
[0068] (9) Obtain the hidden state H of the LSTM sequence of all users at time t-1 (t-1) .
[0069] (10) Calculate similarity Only the similarity of the hidden states of users with similar relationships to user i is retained, and the similarity of users without similar relationships (i.e., not adjacent in the graph) is set to 0.
[0070] (11) With H (t-1) Perform multiplication to obtain the weighted average value A of the hidden states of users with similar relationships to user i (t) , and H (t-1) Combine to get a new hidden state and input it into the next LSTM unit. Use the output value H (t) Update the LSTM.
[0071] (12) After every fixed number of windows, the trajectory relationship graph is updated, and the updated trajectory relationship graph is used to continue the above method for prediction.
[0072] The present invention conducted relevant experiments to verify the accuracy of the method in trajectory prediction tasks. The data sets used in the experiment include:
[0073] (1) ETH: Contains 750 pedestrian trajectories in 2 scenes.
[0074] (2) UCY: contains trajectories of 786 pedestrians in 2 scenes.
[0075] (3) Group behavior analysis business data: Contains 3-month trajectories of 6,000 users.
[0076] This paper uses two types of data sets in the experiment: public data sets and business data sets. Among them, the ETH and UCY data sets are public data sets, and the scenes contain various group travel trajectories such as pedestrians accompanying and walking towards each other. The business data set is the business data for group behavior analysis, which is the real data in the research motivation of this method. Due to the insufficient accuracy of this data, the comparative experiment used in this paper cannot be applied to this data. Therefore, this method and the comparative method are first compared on the public data set to verify the effectiveness of this method, and then this method is applied to the business data set for verification.
[0077] This method uses the social force model, the basic LSTM model, and the Social-LSTM model as experimental comparison models. In addition, compared with previous work, this method adds consideration of users with similar historical trajectories and adds an attention mechanism. In order to verify the effectiveness of these two new experimental settings in this model, two model variants are set up for ablation experiments based on these two assumptions. The experimental results are shown in Table 1.
[0078] In Table 1, ST represents the social force model, LSTM represents the method of predicting a single person's trajectory using only LSTM, and S-LSTM represents the Social-LSTM model. GBTP represents the trajectory prediction model based on multi-relation fusion analysis proposed in this scheme. GBTP (Without ST) and GBTP (Without Attention) both remove some modules based on GBTP. Among them, GBTP (Without ST) represents the removal of the consideration of the trajectory characteristics of users with similar historical trajectories based on the GBTP model, that is, when modeling the undirected graph of target user-associated users, only the relationship between the target user and the users with adjacent positions is considered. GBTP (Without Attention) represents the removal of the attention mechanism based on the GBTP model, that is, the difference in the influence of different associated users on the trajectory of the target user is ignored.
[0079] Table 1
[0080]
[0081] By analyzing the experimental results, we can see that when using this scheme for trajectory prediction, on all experimental data sets, whether using a complete model or a model with some missing parts, the experimental results are significantly improved compared to existing methods. At the same time, this scheme has achieved the best results on most data sets.
[0082] Based on the same inventive concept, another embodiment of the present invention is a user trajectory prediction system based on multi-relationship fusion analysis using the above method, which includes:
[0083] A trajectory relationship graph construction module is used to construct a trajectory relationship graph based on the user's historical trajectory similarity relationship and location proximity relationship;
[0084] The trajectory prediction module is used to predict the future trajectory of the target user based on the relationship between users in the trajectory relationship graph using a trajectory prediction model that incorporates an attention mechanism.
[0085] Based on the same inventive concept, another embodiment of the present invention provides an electronic device (computer, server, smart phone, etc.), which includes a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing each step in the method of the present invention.
[0086] Based on the same inventive concept, another embodiment of the present invention provides a computer-readable storage medium (such as ROM / RAM, disk, CD), which stores a computer program. When the computer program is executed by a computer, it implements the various steps of the method of the present invention.
[0087] The specific embodiments of the present invention disclosed above are intended to help understand the content of the present invention and implement it accordingly. It can be understood by those skilled in the art that various replacements, changes and modifications are possible without departing from the spirit and scope of the present invention. The present invention should not be limited to the contents disclosed in the embodiments of this specification, and the scope of protection of the present invention shall be subject to the scope defined in the claims.
Claims
1. A user trajectory prediction method based on multi-relation fusion analysis, characterized in that: The following steps are involved: Construct a trajectory relationship graph based on the user's historical trajectory similarity and location proximity; Based on the relationship between users in the trajectory relationship graph, the trajectory prediction model with attention mechanism is used to predict the future trajectory of the target user; The step of constructing a trajectory relationship graph based on the historical trajectory similarity relationship and location proximity relationship of the user includes: Each element in the user set is regarded as a vertex in the graph. If the users represented by two vertices are judged to have similar historical trajectories, an edge is added between the vertices representing the two users. At the current moment, if the users represented by two vertices in the time slice are geographically adjacent to each other at the current moment, an edge is added between the vertices representing the two users; Based on the relationship between users in the trajectory relationship graph, the trajectory prediction model with attention mechanism is used to predict the future trajectory of the target user, including trajectory independent sequence prediction and relationship fusion prediction: In trajectory independent sequence prediction, a single person is regarded as a sequence, and the trajectory of each target user is divided into segments according to the window. Each segment constitutes a separate data. Then, an LSTM network is constructed, and the trajectory data is input into the LSTM sequence to complete the training and prediction of each data. The input of each LSTM unit is the position point of the current time slice of the trajectory segment, the hidden state of the previous unit in the LSTM sequence, and the hidden state of the previous moment in the LSTM sequence of the user trajectory that has two similar relationships with the user. The output of the LSTM unit is the hidden state of the unit and a predicted position vector. In relational fusion prediction, the update formula of LSTM is adjusted, and the relationship in the trajectory relationship graph is used to update and predict LSTM.
2. The method according to claim 1, characterized in that: The following steps are used to screen users with similar historical trajectories to obtain the similarity relationship of the historical trajectories: Encode part of the historical trajectories of all users as the initial user codes; The users are clustered using their initial codes, and the similarity of the initial codes between users is calculated. Based on the similarity, people with similar historical trajectories are obtained.
3. The method according to claim 2, characterized in that The encoding of a portion of the historical tracks of all users as the user initial code includes: Determine a fixed length as the history trajectory length used for encoding history trajectories, set up an LSTM network with the fixed length, and randomly extract multiple trajectory segments of the length from the dataset, and use these trajectory segments to train the LSTM; For each user, the trajectory data of the previous time slice of equal length is taken as the user's initial coding trajectory segment, and the initial coding trajectory segment is input into the trained LSTM sequence, and the trajectory points are input in sequence, where the output supervision data of each LSTM unit is the vector of the next trajectory point; the user's initial coding is the hidden state output by the last unit after the user's initial coding trajectory segment is input into the LSTM sequence.
4. The method according to claim 2, characterized in that: The user initial codes are used to cluster the users, and the similarity of the initial codes between the users is calculated, and the group of people with similar historical trajectories is obtained according to the similarity, including: At the initial moment, the initial code obtained is used as the basis for judging the similarity of historical trajectories between users. The cosine similarity is used to calculate the similarity of the codes of two users as the similarity of the historical trajectories of users. For the similarity of historical trajectories obtained, a threshold is taken. When the similarity of a pair of users is greater than the threshold, the pair of users is considered to have similar historical trajectories. In the actual prediction process, a suitable time interval is selected to update the similarity of historical trajectories at regular intervals.
5. The method according to claim 1, characterized in that The method of updating and predicting the LSTM by using the relationship in the trajectory relationship graph includes: in, represents the hidden state of the LSTM sequence of the nth user at time t-1, H (t-1) Represents the hidden state of the LSTM sequence of all users at the t-1th moment; Among them, Sim (t) It represents the similarity of LSTM hidden states between two users at time t, and Norm represents the L2 norm; Among them, A (t) Represents the weighted average of the hidden states of all users with similar relationships to the current user; is the mask matrix, which is an intermediate value. It only retains the similarity of the hidden states between users with similar relationships and sets the similarity of users without similar relationships to 0. With H (y-1) Perform multiplication operation, and for each user, obtain the weighted average of the hidden states of all users with similar relationships to the user; use the obtained output value H (y) Update the LSTM.
6. A user trajectory prediction system based on multi-relation fusion analysis using the method described in any one of claims 1 to 5, characterized in that: include: A trajectory relationship graph construction module is used to construct a trajectory relationship graph based on the user's historical trajectory similarity relationship and location proximity relationship; The trajectory prediction module is used to predict the future trajectory of the target user based on the relationship between users in the trajectory relationship graph using a trajectory prediction model that incorporates an attention mechanism.
7. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the method according to any one of claims 1 to 5 is implemented.
