An individual moving track generation method fusing life mode learning and attention perception
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PEKING UNIV SHENZHEN GRADUATE SCHOOL
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies struggle to accurately capture long-term dependencies and complex spatiotemporal behavioral patterns in individual movement trajectories. Traditional methods lack interpretability and are inefficient in processing long sequences. Deep learning models struggle to incorporate human behavioral patterns, resulting in deviations between generated trajectories and reality.
By introducing lifestyle pattern learning and attention perception mechanisms, and combining Markov matrices and lifestyle pattern matrices through the Transformer framework, attention mechanisms are used to dynamically reconcile macroscopic and microscopic information to generate individual movement trajectories.
It improves the accuracy and rationality of individual movement trajectory prediction, can efficiently capture long-range dependencies, and generates trajectories that closely match real urban activities and possess rich random details.
Smart Images

Figure CN122309903A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart cities and intelligent traffic management, and in particular relates to a method for generating individual movement trajectories that integrates lifestyle learning and attention perception. Background Technology
[0002] In the fields of smart cities and intelligent transportation, high-precision prediction of individual movement trajectories has become one of the core technologies. Accurate prediction of individual movement behavior not only provides a scientific basis for urban traffic planning, congestion management, and public transportation scheduling, but also supports important applications such as epidemic transmission simulation, emergency evacuation management, and location service optimization. Traditional methods based on questionnaires or simple statistics are insufficient to capture the complex spatiotemporal behavioral patterns of large-scale populations. However, with the widespread adoption of spatiotemporal big data such as mobile phone signaling and GPS trajectories, data-driven individual movement trajectory generation technology is gradually becoming the foundation for refined urban management and intelligent services.
[0003] Traditional individual movement trajectory prediction techniques can be broadly categorized into two types. The first type is based on rule-based or traditional statistical models, such as Markov chain models. These methods predict the next possible location using historical transition probabilities, offering high computational efficiency and interpretability. However, their drawbacks are significant: the Markov property assumes the next state depends only on the current state, ignoring long-term historical dependencies and complex spatiotemporal context information, making it difficult to capture periodic and trend-based patterns. Furthermore, these models struggle with sparse data and have poor generalization ability for unseen combinations of location transitions. The second type is based on deep learning methods, such as Recurrent Neural Networks (RNNs) and Long Short-Term Memory Networks (LSTMs). These methods can capture long-term dependencies in sequences and exhibit better performance than traditional methods in trajectory prediction tasks. However, it still has significant drawbacks: RNN-type models are slow to train and difficult to parallelize, and are prone to gradient vanishing or exploding problems when processing long sequences; more importantly, these methods are usually data-driven black box models, lacking interpretability and difficult to incorporate human movement behavior rules (such as weekday commuting patterns), which may cause the generated trajectories to deviate from the real situation in macroscopic patterns.
[0004] To address the aforementioned problems, this invention introduces two key technologies. First, an attention-aware mechanism calculates attention weights for different movement pattern components, enabling the model to dynamically focus on the most relevant spatiotemporal features, thereby enhancing the model's interpretability and ability to preserve key patterns. Second, a Transformer model with a self-attention architecture can capture long-range global dependencies and complex spatiotemporal interactions in movement sequences in parallel, overcoming the inherent limitations of RNN models in handling long sequences. By embedding individual life pattern matrices and Markov transition matrices into the Transformer framework and fusing them with the attention-aware mechanism, this invention achieves accurate capture of macroscopic life patterns while preserving microscopic transition patterns, significantly improving the accuracy and rationality of generated trajectories.
[0005] Therefore, this invention proposes an individual movement trajectory generation method that integrates lifestyle pattern learning and attention perception. It introduces lifestyle pattern learning and attention perception mechanisms and uses the Transformer framework to predict individual movement trajectories, aiming to improve the efficiency and accuracy of individual movement trajectory prediction in the fields of smart cities and intelligent transportation. Summary of the Invention
[0006] The purpose of this invention is to address the shortcomings of existing technologies by proposing a method for generating individual movement trajectories that integrates lifestyle learning and attention perception.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] S1. Extract the dwell points of individual u from the raw mobility data at the city scale. Identify key locations from the dwell points based on spatiotemporal rules. Key locations are divided into residential locations H, workplaces W, and other locations O, thus obtaining the key location set K for the u-th individual. u ={H u W u O u}
[0009] Furthermore, the residential location H is a place where one stays for more than 5 hours per day from 20:00 to 8:00 the next day, and for 2 / 3 of the observation days; the work location W is a place where one stays for more than 4 / 5 hours from 8:00 to 20:00 on weekdays, and is not a residential location H; other locations O are non-residential / work locations where one stays for more than 30 minutes.
[0010] S2. Using Equation 1, we obtain the transition probability p(l, k, d, u, t) of individual u moving from location l to location k on date d and time period t. The individual's lifestyle pattern is represented by the vector LP. u=[ p(l, k, d, u, t) ] ; Obtain the life pattern vectors of all individuals, and combine the life pattern vectors of all individuals into the life pattern matrix LP as shown in Equation 2.
[0011] Formula 1:
[0012] Formula 2:
[0013] in, This represents the number of times individual u moves from a stop point in class l to a stop point in class k on a date in class d and during a time period in class t. d is divided into two categories: weekdays and rest days. n is the total number of individuals, and m is the total number of transfer probabilities.
[0014] S3. Perform SVD decomposition on the lifestyle pattern matrix LP. Calculate the i-th singular value δ i Attention weight α i =softmax(δ i / τ i Reconstructing a weighted lifestyle matrix Where U and V are two orthogonal matrices after decomposition, Σ is a diagonal matrix, and δ... i Let α be the i-th singular value of the elements on the diagonal of the diagonal matrix Σ. i It is the i-th singular value δ i Attention weights, τ i It is a temperature parameter that controls the smoothness of the weight distribution, and softmax() represents the normalization exponential function.
[0015] S4. Based on the original movement data, calculate the key location s for each pair of dates d and time periods t for individual u using Equation 3. i s j The transition probability p(s) between pairs i , s j ), s i , s j ∈K u = H u ∪ W u ∪ O u Then, according to Equation 4, it is reorganized into a Markov matrix:
[0016] Formula 3:
[0017] Formula 4:
[0018] in, It is s i s j The transition probability between each pair It is individual u under each type of date d and each time interval t s i s j The transition probability between each pair, M u is the Markov matrix of individual u, and m is the sum of the pairwise critical location transition probabilities.
[0019] S5. Combine the lifestyle pattern matrix LP with the Markov matrix M of all individuals. u Expanded into a one-dimensional vector, it is input into the Transformer model for training; the Transformer model includes a matrix preprocessing layer, a matrix fusion layer, a spatiotemporal encoder, and a trajectory decoder; the training strategy adopts the joint loss function L shown in Equation 5. tol :
[0020] Formula 5:
[0021] in, It is the joint crossover loss function. It is trajectory reconstruction loss. It is the loss of maintaining a lifestyle. Loss due to transfer patterns;
[0022] S6. For a new individual u', record its start date D1 and end date D2. Repeat S1-S4 to obtain its key location set K and Markov matrix M. u .
[0023] S7. Determine the prediction deadline D3, input D1, D2, K, and Mu into the trained Transformer model, and output the predicted trajectory R of individual u with a time interval t and a date range of D2-D3. u .
[0024] Furthermore, the predicted trajectory R is in JSON format and includes an id field, a t field, a date1 field, a date2 field, and a positions field; the positions field is a list container of positions objects, and the positions objects include lat, lon, and time fields.
[0025] The present invention has the following outstanding substantive features and significant progress compared with existing technologies:
[0026] 1. Innovatively combining the lifestyle pattern matrix (LP) representing macroscopic laws with the Markov matrix (M) characterizing microscopic randomness. uSimultaneously serving as both input and constraint to the model, the matrix fusion layer utilizes an attention mechanism to dynamically reconcile the information from both, guiding the Transformer to generate individual movement trajectories that encompass both macroscopic and microscopic perspectives. The generated trajectories exhibit a high degree of consistency with the overall pattern of real-world urban activity distribution, while also possessing rich random details at the individual level, overcoming the limitations of single-scale modeling.
[0027] 2. Achieving a balance between long-range spatiotemporal dependency modeling and computational efficiency, this paper introduces a Transformer architecture based entirely on a self-attention mechanism. Its core advantage lies in parallel processing of the entire sequence, significantly improving training efficiency. Simultaneously, its global modeling capability can directly capture the dependency relationship between any two time points, regardless of their distance, thus accurately learning long-term patterns such as "going to the gym every Friday night." Significant progress is reflected in the fact that the model not only efficiently generates long-term trajectories but also ensures the accuracy of periodic patterns, far surpassing traditional sequence models in both efficiency and long-range dependency modeling capabilities.
[0028] 3. A hybrid architecture was designed: First, an interpretable statistical model (steps S1-S4) was used to extract two core prior knowledge matrices with clear physical meaning from the raw data: "key locations" and "transition probabilities." Subsequently, instead of being directly used for generation, these matrices were injected as strong guiding signals into a powerful Transformer neural network. The significant advancements are: First, the statistical prior provides clear optimization directions and constraints for deep learning, greatly reducing the uncertainty of model learning, accelerating convergence, and ensuring the rationality of the generated trajectory in macroscopic patterns (e.g., avoiding obvious fallacies like "going to work at night"); Second, the powerful function fitting ability of deep learning compensates for the shortcomings of pure statistical models in capturing complex spatiotemporal dependencies and generating fine-grained trajectory details. Attached Figure Description
[0029] Figure 1 This is a flowchart illustrating the overall technical process of the present invention;
[0030] Figure 2 This is a flowchart of the model training steps of the present invention;
[0031] Figure 3 This is a flowchart of the trajectory prediction steps of the present invention;
[0032] Figure 4 This is a structural relationship diagram of the predicted trajectory result file of this invention. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.
[0034] Example 1, the technical flowchart of the present invention is shown below. Figure 1 The model training steps are illustrated in the flowchart below. Figure 2 ;
[0035] First, 32,768 virtual individuals are constructed based on a publicly available dataset. The dwell points of each individual u are extracted, and key locations are identified from these dwell points according to the following spatiotemporal rules, resulting in the key location set K for the u-th individual. u ={H u W u O u}
[0036] 1) Residence H: A place of stay where the observation period is 20:00–8:00 the next day for 5 hours or more per day, and for 2 / 3 of the observation days;
[0037] 2) Work location W: 4 or more hours between 8:00 and 20:00 on weekdays, and not a place of stay from residence H;
[0038] 3) Other locations O: Other non-residential / work locations where you stay for more than 30 minutes.
[0039] Equation 1 yields the transition probability p(l, k, d, u, t) of individual u moving from location l to location k on date d and during time period t (30 minutes). The individual's lifestyle pattern is represented by the vector LP. u =[ p(l, k, d, u, t) ] ; Obtain the life pattern vectors of all individuals, and combine the life pattern vectors of all individuals into a life pattern matrix LP as shown in Equation 2. In this embodiment, the number of rows represents the total number of individuals, which is 32768, and the number of columns represents the total number of transition probabilities of each individual u, which is m.
[0040] Formula 1:
[0041] Formula 2:
[0042] in, This indicates the number of times an individual u moves from a stop point in category l to a stop point in category k on a date in category d and during a time period in category t. d is divided into two categories: weekdays and rest days.
[0043] SVD decomposition of the lifestyle pattern matrix LP Calculate the i-th singular value δ iAttention weight α i =softmax(δ i / τ i Reconstructing a weighted lifestyle matrix Where U and V are two orthogonal matrices after decomposition, Σ is a diagonal matrix, and δ... i Let α be the i-th singular value of the elements on the diagonal of the diagonal matrix Σ. i It is the i-th singular value δ i Attention weights, τ i It is a temperature parameter that controls the smoothness of the weight distribution, and softmax() represents the normalization exponential function.
[0044] Based on the raw mobility data, Equation 3 is used to calculate the individual u's position at each pair of key locations s for each date d and each time period t. i s j The transition probability p(s) between pairs i , s j ), s i , s j ∈K u = H u ∪ W u ∪ O u Then, according to Equation 4, it is reorganized into a Markov matrix:
[0045] Formula 3:
[0046] Formula 4:
[0047] in, It is s i s j The transition probability between each pair It is individual u under each type of date d and each time interval t s i s j The transition probability between each pair, M u is the Markov matrix of individual u, and m is the sum of the pairwise critical location transition probabilities.
[0048] The life pattern matrix LP and the Markov matrix M of all individuals are combined. u Expanded into a one-dimensional vector, it is input into the Transformer model for training; the Transformer model includes a matrix preprocessing layer, a matrix fusion layer, a spatiotemporal encoder, and a trajectory decoder; the training strategy adopts the joint loss function L shown in Equation 5. tol :
[0049] Formula 5:
[0050] in, It is the joint crossover loss function. It is trajectory reconstruction loss. It is the loss of maintaining a lifestyle. Loss due to transfer patterns;
[0051] Trajectory prediction steps, see flowchart for trajectory prediction steps. Figure 3 :
[0052] First, for the new individual u' to be predicted, obtain its historical trajectory data, recording its start date D1=2025-07-25 and end date D2=2025-08-19. Repeat S1-S4 to obtain its key location set K and Markov matrix M. u .
[0053] The prediction deadline D3 is set to 2025-08-22. D1, D2, K, and Mu are input into the trained Transformer model, which outputs the predicted trajectory R for individual u with a time interval of t=30min and a date range from 2025-08-20 to 2025-08-22. u .
[0054] The predicted trajectory R output format is JSON, containing id, t, date1, date2, and positions fields. The positions field is a list container containing 144 position objects, each with lat, lon, and time fields. The file structure is as follows: Figure 4 As shown.
[0055] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the scope of protection of the appended claims.
Claims
1. A method for generating individual movement trajectories that integrates lifestyle learning and attention perception, characterized in that, Includes the following steps: S1. Extract the dwell points of individual u from the raw mobility data at the city scale. Identify key locations from the dwell points based on spatiotemporal rules. Key locations are divided into residential locations H, workplaces W, and other locations O, thus obtaining the key location set K for the u-th individual. u ={H u W u O u }; S2. Using Equation 1, we obtain the transition probability p(l, k, d, u, t) of individual u moving from location l to location k on date d and time period t. The individual's lifestyle pattern is represented by the vector LP. u =[ p(l, k, d, u, t) ] ; Obtain the life pattern vectors of all individuals, and combine the life pattern vectors of all individuals into the life pattern matrix LP as shown in Equation 2; Formula 1: Formula 2: in, This represents the number of times individual u moves from a stop point in class l to a stop point in class k on a date in class d and time period t, where d is divided into two categories: weekdays and rest days; n is the total number of individuals, and m is the total number of transfer probabilities. S3. Perform SVD decomposition on the lifestyle pattern matrix LP. Calculate the i-th singular value δ i Attention weight α i =softmax(δ i / τ i Reconstructing a weighted lifestyle matrix Where U and V are two orthogonal matrices after decomposition, Σ is a diagonal matrix, and δ... i Let α be the i-th singular value of the elements on the diagonal of the diagonal matrix Σ. i It is the i-th singular value δ i Attention weights, τ i It is a temperature parameter that controls the smoothness of the weight distribution, and softmax() represents the normalization exponential function; S4. Based on the original movement data, calculate the key location s for each pair of dates d and time periods t for individual u using Equation 3. i s j The transition probability p(s) between pairs i , s j ), s i , s j ∈K u = H u ∪ W u ∪ O u Then, according to Equation 4, it is reorganized into a Markov matrix; Formula 3: Formula 4: in, It is s i s j The transition probability between each pair It is individual u under each type of date d and each time interval t s i s j The transition probability between each pair, M u is the Markov matrix of individual u, and m is the sum of the pairwise critical location transition probabilities; S5. Combine the lifestyle pattern matrix LP with the Markov matrix M of all individuals. u Expanded into a one-dimensional vector, it is input into the Transformer model for training; the Transformer model includes a matrix preprocessing layer, a matrix fusion layer, a spatiotemporal encoder, and a trajectory decoder; the training strategy adopts the joint loss function L shown in Equation 5. tol : Formula 5: in, It is the joint crossover loss function. It is trajectory reconstruction loss. It is the loss of maintaining a lifestyle. Loss due to transfer patterns; S6. For a new individual u', record its start date D1 and end date D2. Repeat S1-S4 to obtain its key location set K and Markov matrix M. u ; S7. Determine the prediction deadline D3, input D1, D2, K, and Mu into the trained Transformer model, and output the predicted trajectory R of individual u with a time interval t and a date range of D2-D3. u .
2. The method for generating individual movement trajectories that integrates lifestyle learning and attention perception according to claim , characterized in that, The residential location H is the place where the stay is greater than or equal to 5 hours / day from 20:00 to 8:00 the next day, and continues for 2 / 3 of the observation days; the work location W is the place where the stay is greater than or equal to 4 / 5 hours from 8:00 to 20:00 on weekdays, and is not the residential location H; other locations O are non-residential / work locations where the stay is greater than 30 minutes.
3. The method for generating individual movement trajectories that integrates lifestyle learning and attention perception according to claim , characterized in that, The predicted trajectory R is in JSON format and includes id, t, date1, date2 and positions fields; the positions field is a list container of position objects, and the position objects include lat, lon and time fields.