Device and method for predicting medium-term movement track of user based on space-time generation
Through the combination of space-time decoupling and spatial heterogeneous diagrams, the decoupling of the travel trajectory is a position chain and a time chain. The hierarchical encoding-decoder module design is used to solve the problem that it is difficult to accurately predict the user's mid-term movement trajectory in the prior art, and achieve a more accurate mid-term prediction effect.
Patent Information
- Application Number
- CN202311389588.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art is difficult to accurately predict the user's medium-term movement trajectory, and there is a lack of effective methods to capture the conversion relationship between positions, resulting in large cumulative errors.
The travel trajectory is decoupled into a position chain and a duration chain through a space-time decoupler, and the location information representation is learned by spatial heterogeneous graph, combined with the hierarchical encoding-decoder module design, to predict the travel trajectory of the future day, and to achieve the prediction of travel behavior in the next week through rolling prediction.
It improves the effect of medium-term prediction, captures position information and time information in historical trajectories more accurately, models the transfer rules between locations, and reduces cumulative errors.
Smart Images

Figure CN119884450A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of urban computing and spatiotemporal data mining, and in particular to a device and method for predicting a user's medium-term movement trajectory based on spatiotemporal generation. Background Art
[0002] Personal mobility prediction has recently attracted wide attention in various fields such as business planning, healthcare, and urban planning. User mobility information obtained from media such as mobile applications, mobile devices, and vehicle-mounted sensors can be applied to many fields such as commercial advertising recommendations, epidemic spread analysis and prevention, and traffic management. At present, the mainstream task of personal mobility prediction focuses on the prediction of the next location, that is, using the individual's historical data to predict the next place of interest that the individual will visit. To this end, people rely on traditional methods represented by Markov chains and deep learning methods represented by recurrent neural networks. In recent years, the emergence of graph representation learning technology has shown good capabilities, and people have adopted graph neural networks (GNNs) to enhance the prediction performance of the model.
[0003] However, the prediction of the next location alone cannot provide sufficient insight into the rhythm of user travel behavior. Existing methods lack the prediction of the user's travel trajectory for a full day or week in the future, which is called a medium-term prediction task. People can achieve the purpose of medium-term prediction by using the existing next location prediction method for rolling prediction, but this method cannot accurately capture the conversion relationship between locations, which will lead to large cumulative errors. In short, there is a lack of an effective method for predicting user mid-term travel behavior on the market.
[0004] There are still many challenges in medium-term forecasting: first, the continuous position repetition in the daily trajectory sequence may confuse the sequence model to accurately identify the position transition; second, in order to predict the trajectory of the next day, it is necessary to understand the daily travel patterns of multiple days. However, the overly long position sequence poses a challenge to the perception and memory capabilities of the deep learning model. Summary of the invention
[0005] In order to overcome the above-mentioned deficiencies of the prior art, the present invention provides a user mid-term movement trajectory prediction device and prediction method based on time-space generation.
[0006] The present invention is achieved through the following technical solutions.
[0007] A user mid-term movement trajectory prediction device based on time-space generation is characterized in that it includes the following modules:
[0008] The spatiotemporal decoupler decouples the travel trajectory into a location chain and a duration chain.
[0009] The spatial encoding module extracts the representation of the historical travel trajectory location chain.
[0010] The time encoding module extracts the representation of the duration chain of historical travel trajectories.
[0011] The spatial decoding module decodes the historical information representation of the location chain and predicts the location chain for the next day through rolling prediction.
[0012] The time decoding module decodes the historical information representation of the duration chain and combines it with the predicted position chain to obtain the duration chain of the next day.
[0013] The space coding module and the time coding module both adopt a hierarchical structure, and are composed of a day encoder and a week encoder.
[0014] The spatial encoding module uses heterogeneous graphs to learn the representation of location information.
[0015] The space-time decoupling module is connected to the space coding module and the time coding module, the space coding module is connected to the space decoding module, and the time coding module and the space decoding module are connected to the time decoding module.
[0016] The implementation process of the scheme is as follows: first, the user's historical travel trajectory is decoupled into a location chain and a time chain through the spatiotemporal decoupling module, and continuous repetitions are eliminated to directly capture the conversion pattern.
[0017] Use spatially heterogeneous graphs to extract semantic information of different locations. Spatially heterogeneous graphs integrate multi-scale urban spatial structures into the graph. The spatial structure is characterized by the mobility and adjacency between different areas.
[0018] The decoupled position chain is encoded through a spatial encoder to obtain the latent space representation of the historical travel trajectory location information.
[0019] The decoupled duration chain is encoded through a time encoder to obtain a latent space representation of the temporal information of the historical travel trajectory.
[0020] The spatial and temporal encoders use two layers of hierarchical encoders to extract daily travel patterns and weekly travel patterns, aiming to expand the receptive field and capture long-term behavioral patterns.
[0021] The position information and time information from the encoder are decoded using the spatial and temporal decoders respectively to obtain the position chain and time chain for the next day.
[0022] The location chain and time chain are synthesized to obtain the travel trajectory for the next day.
[0023] By making a rolling forecast for the next day, it is possible to predict travel behavior for the next week.
[0024] A method for predicting a user's mid-term mobile trajectory based on spatiotemporal generation is characterized in that it includes the following steps:
[0025] Decouple multi-day historical travel trajectories into location chains and duration chains.
[0026] Construct a spatially heterogeneous graph to capture the location semantic information of location chains.
[0027] A spatial encoding module is constructed to encode the position chain and obtain the latent spatial representation of the historical travel trajectory location information.
[0028] A time encoding module is constructed to encode the duration chain and obtain the latent space representation of the time information of historical travel trajectories.
[0029] Build a spatial decoding module and use rolling prediction to predict the travel location chain for the next day.
[0030] Construct a time decoding module, combine the location chain information of the next day, and predict the travel duration chain of the next day.
[0031] Combining the location chain and duration chain, we can get the predicted travel trajectory for the next day.
[0032] The parameters of the model are updated by gradient back propagation, and the loss function includes the loss of the position chain and the loss of the duration chain.
[0033] A method for predicting user mid-term mobile trajectory based on spatiotemporal generation, the specific steps are as follows:
[0034] 1) The spatiotemporal decoupler is used to calculate the user's daily travel trajectory D k Decoupling to get the corresponding position chain and duration chains
[0035] 2) Use heterogeneous graphs to learn position representation, specifically:
[0036] The location level graph is constructed with the location and town as nodes, the adjacency relationship between the locations as the adjacency edge, and the trajectory flow between the locations as the flow edge. The town level graph is constructed with the adjacency relationship between the towns as the adjacency edge and the trajectory flow between the towns as the flow edge. Then, the location level graph and the town level graph are connected with the inclusion relationship between the location and the town as the inclusion edge to obtain a spatial heterogeneous graph of the multi-scale structure of the town. The spatiotemporal decoupler first inputs the location chain into the spatial heterogeneous graph to learn the location semantic representation, and then obtains the location chain after updating the location semantic information.
[0037] 3) The space-time decoupler first sends the position chain and duration chain to the space-day encoder and time-day encoder respectively. The expression formula of the position chain is: The expression formula of the duration chain is: in, is the embedding representation of the position chain, is the embedded representation of the duration chain;
[0038] 4) Then add multiple days and The formula for obtaining the final historical information by respectively using the time length encoder and the space length encoder is:
[0039]
[0040]
[0041] 5) The encoded historical information The time decoding module and the space decoding module are sent to the time decoding module and the space decoding module respectively; the space decoding module uses the historical information to make a rolling prediction on the daily position chain to obtain the predicted position chain, which is expressed as follows:
[0042]
[0043] Among them, σ is the softmax function, is the embedding representation of the mth prediction position, and s0 is the embedding representation of the supplementary start sign;
[0044] 6) The predicted position chain is sent from the spatial decoding module to the temporal decoding module to enhance the prediction of the duration chain, connect the historical time information with the predicted position representation, and use the gated recurrent unit (GRU) to predict the duration chain. The formula can be expressed as:
[0045] 7) Combine the duration chain and the location chain to predict the trajectory of a user in the next day:
[0046] The parameters of the model are updated by back propagation. The loss function includes the loss of the position chain and the loss of the duration chain. The loss of the position chain adopts the cross entropy function, and the loss of the duration chain adopts the Hubber loss function. The formula of the loss function L is:
[0047]
[0048] Among them, L huber is the Huber loss function, L ce is the cross entropy loss function, tj and l j is the true value, and is the predicted value; based on the obtained loss function value L, the Adam (Adaptive Moment Estimation optimizer) optimizer is used to train the parameter values of each module to predict the behavior trajectory of a user in the next day.
[0049] Due to the adoption of the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0050] 1. Using the location-town multi-level spatial heterogeneous graph to learn the location information representation can learn richer location semantic information and improve the effect of medium-term prediction.
[0051] 2. Decoupling the trajectory chain into a position chain and a duration chain, and adopting a hierarchical encoder-decoder module design, can more accurately capture the location information and time information in the historical trajectory, and thus more accurately model the transfer rules between locations.
[0052] 3. The encoder adopts a layered daily encoder and weekly encoder design, which can more comprehensively learn the multi-level periodicity of user behavior in historical trajectories and capture more accurate travel patterns.
[0053] In summary, the present invention provides a new solution to the task of medium-term prediction of user travel behavior, which greatly improves the shortcomings of existing methods in predicting medium- and long-term travel behavior. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a schematic diagram of the structure of the spatiotemporal decoupled autoencoder for mid-term prediction of user travel behavior.
[0055] Figure 2 It is a flow chart of realizing medium-term prediction using the spatiotemporal decoupled autoencoder for medium-term prediction of user travel behavior of the present invention. DETAILED DESCRIPTION
[0056] The present invention will be described in detail below with reference to the accompanying drawings and embodiments, but the protection scope of the present invention shall not be limited thereto.
[0057] A user mid-term movement trajectory prediction device based on time-space generation, such as Figure 1 As shown, it specifically includes the following modules:
[0058] The spatiotemporal decoupler 1 decouples the travel trajectory into a position chain and a duration chain.
[0059] Spatial encoding module 2 extracts the representation of the historical travel trajectory location chain.
[0060] The time encoding module 3 extracts the representation of the duration chain of historical travel trajectories.
[0061] The spatial decoding module 4 decodes the historical information representation of the position chain and predicts the position chain of the next day by means of rolling prediction.
[0062] The time decoding module 5 decodes the historical information representation of the duration chain and combines it with the predicted position chain to obtain the duration chain of the next day.
[0063] The space coding module and the time coding module both adopt a hierarchical structure, and are composed of a day encoder and a week encoder.
[0064] The spatial encoding module uses heterogeneous graphs to learn the representation of location information.
[0065] The space-time decoupling module is connected to the space coding module and the time coding module, the space coding module is connected to the space decoding module, and the time coding module and the space decoding module are connected to the time decoding module.
[0066] The user medium-term mobile trajectory prediction method based on spatiotemporal generation in the present invention can predict the user's travel behavior in the next day or week based on the user's long-term historical travel trajectory information, which is also called a medium-term prediction task, such as Figure 2 As shown, it includes the following steps:
[0067] Step S1: Decouple the user's historical travel trajectory into a deduplicated location chain and a duration chain through a spatiotemporal decoupling module. The duration is the time the user stays at each location.
[0068] Step S2, using spatial heterogeneous graph to represent the semantic information of different locations. Spatially heterogeneous graph integrates multi-scale urban spatial structure into the graph. The spatial structure is characterized by the mobility and adjacency between different regions.
[0069] Step S3, encoding the decoupled position chain through a spatial encoder to obtain a latent space representation of the historical travel trajectory position information.
[0070] Step S4, encoding the decoupled duration chain through a time encoder to obtain a latent space representation of the historical travel trajectory time information.
[0071] Step S5, using a spatial decoder to decode the position information from the encoder to obtain a position chain for the next day.
[0072] Step S6, using the time decoder and combining it with the position chain of the next day, decode the time information from the encoder to obtain the duration chain of the next day.
[0073] Step S7, synthesize the position chain and the time chain to obtain the travel trajectory for the next day.
[0074] By making a rolling forecast for the next day, it is possible to predict travel behavior for the next week.
[0075] Specifically, step S1 includes,
[0076] The user's historical daily travel trajectory D k Decoupling to get the corresponding position chain and duration chains
[0077] Step S2 comprises,
[0078] Step S201 constructs a location-level graph with locations and towns as nodes, adjacency relationships between locations as adjacency edges, and trajectory flows between locations as flow edges, and constructs a town-level graph with adjacency relationships between towns as adjacency edges and trajectory flows between towns as flow edges. Then, the location-level and town-level graphs are connected with the inclusion relationship between locations and towns as inclusion edges, and a heterogeneous graph integrating the multi-scale structure of towns is obtained.
[0079] Step S202, different message passing mechanisms are used according to different types of edges to obtain node embedding information. For adjacent edges and inclusion edges, GraphSage technology is used to model the message passing of these two types of edges. For inclusion edges, Graph Attention Network (GAT) is used to model. The initial node features are initialized to the number of people per hour in the community or town. After n layers of heterogeneous graph propagation, the final location representation is obtained.
[0080] Step S3 includes:
[0081] Step S301, the position chain after embedding using the spatial heterogeneous graph is sent to the day encoder of the spatial encoding module, and the formula is expressed as: in, is the embedding representation of the position chain.
[0082] Step S302: multiple days The position history information is expressed by sending it to the spatial encoder and the temporal encoder respectively. The formula is:
[0083] Step S4 includes:
[0084] Step S401, the duration chain is fed into the day encoder of the time encoding module, in, is the embedding representation of the duration chain.
[0085] Step S402: multiple days and the corresponding Combined, fed into the time encoder and the week encoder of the time encoder, the time history information representation is obtained, the formula is
[0086] Step S5 includes:
[0087] Use the spatial decoder to make rolling predictions for the daily position chain using historical information. The formula is: where σ is the softmax function, is the embedding representation of the mth prediction position, and s0 is the embedded representation of the supplementary start sign.
[0088] Step S6 includes:
[0089] The predicted position chain is sent to the temporal decoder to enhance the prediction of the duration chain, the temporal latent vector is combined with the predicted position chain, and the gated recurrent unit (GRU) is used to predict the duration chain. The formula can be expressed as:
[0090] In step S7, the predicted duration chain and location chain are combined to obtain the travel trajectory for the next day.
Claims
1. A user mid-term movement trajectory prediction device based on time-space generation, characterized in that: include: A spatiotemporal decoupler, a time encoding module, a space encoding module, a time decoding module and a space decoding module. The time encoding module includes a first-layer time day encoder and a second-layer time length encoder. The space encoding module includes a sequentially connected spatial heterogeneous graph position embedding module, a first-layer space day encoder and a second-layer space length encoder. The output end of the space day encoder is connected to the input end of the time length encoder, the output end of the time length encoder is connected to the input end of the time decoding module, the output end of the space length encoder is connected to the input end of the space decoding module, the output end of the spatiotemporal decoupler is respectively connected to the input ends of the time day encoder and the spatial heterogeneous graph position embedding module, the duration chain output by the output end of the spatiotemporal decoupler is input to the time day encoder, the position chain output by the output end of the spatiotemporal decoupler is input to the spatial heterogeneous graph position embedding module, the time decoding module outputs a duration chain, the output end of the spatial decoding module is also connected to the second input end of the time decoding module, and the output end of the spatial decoding module outputs a position chain.
2. The user mid-term movement trajectory prediction device based on time-space generation according to claim 1 is characterized in that The spatial day encoder and spatial length encoder use the Transformer encoder as their network structure, which is mainly composed of a multi-head self-attention mechanism and a fully connected feedforward neural network.
3. The user mid-term movement trajectory prediction device based on time-space generation according to claim 1 is characterized in that The time day encoder and time length encoder use the Transformer encoder as their network structure, which is mainly composed of a multi-head self-attention mechanism and a fully connected feedforward neural network.
4. The user mid-term movement trajectory prediction device based on time-space generation according to claim 1 is characterized in that The temporal decoding module adopts a gated recurrent unit (GRU) as its main structure and has an Adam optimizer.
5. A method for predicting user mid-term movement trajectory based on spatiotemporal generation, characterized in that: The following steps are involved: 1) The spatiotemporal decoupler calculates the user’s daily travel trajectory D k Decoupling to obtain the corresponding position chain and duration chains 2) Use heterogeneous graphs to learn position representation, specifically: The location and town are respectively used as nodes, the adjacency relationship between the locations is used as the adjacency edge, and the trajectory flow between the locations is used as the flow edge to construct the location level graph, and the adjacency relationship between the towns is used as the adjacency edge, and the trajectory flow between the towns is used as the flow edge to construct the town level graph. Then, the location level graph and the town level graph are connected with the inclusion relationship between the location and the town as the inclusion edge to obtain the spatial heterogeneous graph of the multi-scale structure of the town. The spatiotemporal decoupler first inputs the location chain into the spatial heterogeneous graph to learn the location semantic representation, and obtains the location chain after updating the location semantic information. 3) The space-time decoupler first sends the position chain and duration chain to the space-day encoder and time-day encoder respectively. The expression formula of the position chain is: The expression formula of the duration chain is: in, is the embedding representation of the position chain, is the embedding representation of the duration chain, and TransEnc is the encoder of Transformer; 4) Multiple days and The formula for obtaining the final historical information by respectively using the time length encoder and the space length encoder is: 5) The encoded historical information The time decoding module and the space decoding module are sent to the time decoding module and the space decoding module respectively; the space decoding module uses the historical information to make a rolling prediction on the daily position chain to obtain the predicted position chain, which is expressed as follows: Among them, σ is the softmax function, is the embedding representation of the mth prediction position, and s0 is the embedding representation of the supplementary start sign; 6) The predicted position chain is sent from the spatial decoding module to the temporal decoding module to enhance the prediction of the duration chain, connect the historical time information with the predicted position representation, and use the gated recurrent unit (GRU) to predict and output the duration chain. The formula can be expressed as: 7) Combine the duration chain and the location chain to predict the trajectory of a user in the next day: The parameters of the model are updated by back propagation. The loss function includes the loss of the position chain and the loss of the duration chain. The loss of the position chain adopts the cross entropy function, and the loss of the duration chain adopts the Hubber loss function. The formula of the loss function L is: Among them, L huber is the Huber loss function, L ce is the cross entropy loss function, t j and l j is the true value, and is the predicted value; according to the obtained loss function value L, the Adam (Adaptive Moment Estimation optimizer) optimizer is used to train the parameter values of each module to predict the medium-term movement trajectory.