A trajectory prediction method, apparatus, device, medium and computer program product
By constructing spatiotemporal correlation metric features and combining hierarchical temporal embedding and dynamic trajectory memory network, the problem of limited accuracy in existing trajectory prediction methods is solved, and efficient pedestrian trajectory prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-05
AI Technical Summary
Existing trajectory prediction methods struggle to fully capture the dynamic relationships of pedestrian trajectories, resulting in significantly limited prediction accuracy. In particular, they require high computational resources and lack robustness in complex scenarios.
By acquiring the spatial and time interval features of check-in points, and combining location and time information, a spatiotemporal correlation metric feature is constructed. Feature extraction and prediction are performed using a hierarchical temporal embedder, a multi-scale spatiotemporal attention unit, and a dynamic trajectory memory network.
It improves the accuracy and efficiency of trajectory prediction, reduces computational complexity, meets real-time requirements, and enhances the adaptability and accuracy of multi-location trajectory prediction.
Smart Images

Figure CN122153352A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a trajectory prediction method, apparatus, device, medium, and computer program product. Background Technology
[0002] Existing trajectory prediction methods typically model spatial and temporal dependencies through spatiotemporal graph networks or feature fusion, but fail to explicitly extract spatiotemporal correlation metrics. This makes it difficult to comprehensively capture the dynamic relationships of pedestrian trajectories, especially in complex scenarios, significantly limiting prediction accuracy. Furthermore, these methods rely on highly complex modules such as Graph Convolutional Networks (GCNs) and Transformers (GCNs have a complexity of O(∣V∣)). 2 The complexity of Transformer is O(n^2). 2 (where |V| is the number of vertices and n is the sequence length), has a large number of parameters, high computational resource requirements, and is not suitable for resource-constrained devices.
[0003] Existing methods model time series using models such as Temporal Convolutional Networks (TCNs), but TCNs have limited receptive fields, making it difficult to capture long-term spatial-temporal dependencies and resulting in insufficient modeling of dynamic changes in pedestrian movement behavior. Furthermore, these methods are not designed with resource-constrained devices in mind, leading to low computational efficiency and difficulty in meeting real-time operational requirements.
[0004] Existing technologies lack effective handling of noise and heterogeneity issues when processing multimodal spatiotemporal data. Trajectory data often contains noise (such as sensor errors) or heterogeneity (such as trajectory patterns in different scenarios), and existing methods have not optimized for these issues, resulting in insufficient robustness of models in complex or incomplete data scenarios. Summary of the Invention
[0005] The purpose of this invention is to provide a trajectory prediction method, apparatus, device, medium, and computer program product to solve the problem that existing trajectory prediction methods are unable to fully capture the dynamic correlation of pedestrian trajectories, resulting in significantly limited prediction accuracy.
[0006] To achieve the above objectives, embodiments of the present invention provide a trajectory prediction method, comprising: Based on the location and time information of the target user at each of the multiple check-in points in the historical trajectory data, the fused trajectory features corresponding to the check-in points are obtained; Feature embedding is performed on the spatial interval and time interval between at least one target check-in point and its corresponding first adjacent check-in point from the plurality of check-in points to obtain the spatiotemporal correlation metric feature corresponding to the target check-in point; wherein, the first adjacent check-in point is the check-in point that is temporally adjacent to the target check-in point from the plurality of check-in points; the spatial interval is obtained based on the location information of the target check-in point and the location information of the first adjacent check-in point; the time interval is obtained based on the time information of the target check-in point and the time information of the first adjacent check-in point. Based on the fused trajectory features, spatiotemporal correlation metric features, location information, and time information corresponding to each target check-in point, extract the historical trajectory correlation features of the target check-in point; Based on the historical trajectory association features corresponding to each target check-in point, dynamic association features of the predicted trajectory are generated, and the predicted features corresponding to the predicted trajectory are obtained. Based on the fusion trajectory features and spatiotemporal correlation metric features corresponding to each target check-in point, and the prediction features corresponding to the prediction trajectory, the predicted trajectory corresponding to the target user is obtained.
[0007] Optionally, the method, wherein obtaining the fused trajectory features corresponding to each check-in point based on the location and time information of the target user at each of the multiple check-in points in historical trajectory data, includes: The time information is decomposed into day-level features and hour-level features; The time encoding vector is obtained based on the day-level features and the hour-level features; Obtain the location embedding vector based on the location information; The time encoding vector and the location embedding vector are concatenated to obtain the original fused trajectory features; The original fused trajectory features are optimized using a feedforward neural network to obtain the fused trajectory features.
[0008] Optionally, the method, wherein extracting historical trajectory association features of the target check-in point based on the fused trajectory features, the spatiotemporal correlation metric features, the location information, and the time information corresponding to each target check-in point, includes: Based on the fusion trajectory features and spatiotemporal correlation metric features corresponding to each target check-in point, the spatiotemporal attention features of the target check-in point are obtained; Based on the spatiotemporal attention features, location information, and time information corresponding to each target check-in point, the historical trajectory association features of the target check-in point are extracted.
[0009] Optionally, the method, wherein extracting the historical trajectory association features of the target check-in point based on the spatiotemporal attention features, the location information, and the time information corresponding to each target check-in point, includes: Based on the location information and time information corresponding to each target check-in point, a second adjacent check-in point is determined; wherein, the second adjacent check-in point is a check-in point among the plurality of check-in points that is adjacent to the target check-in point in time or location; The spatiotemporal attention features of the second adjacent check-in point are weighted and aggregated to determine the historical trajectory association features of the target check-in point.
[0010] Optionally, the method, wherein generating dynamic association features of the predicted trajectory based on the historical trajectory association features corresponding to each target check-in point, and obtaining the predicted features corresponding to the predicted trajectory, includes: The historical trajectory association features are subjected to a nonlinear transformation to obtain the dynamic association features of the predicted trajectory; Based on the dynamic correlation features, generate the original prediction features; The original prediction features are optimized using a feedforward neural network to obtain the predicted features.
[0011] Optionally, the method, wherein obtaining the predicted trajectory corresponding to the target user based on the fused trajectory features and the spatiotemporal correlation metric features corresponding to each target check-in point, and the predicted features corresponding to the predicted trajectory, includes: The spatial-temporal characteristics of each target check-in point are obtained based on the spatiotemporal correlation metric characteristics corresponding to each target check-in point. For each target check-in point, the fused trajectory features, the spatial-temporal features, and the predicted features are concatenated into vectors to generate the comprehensive features of the predicted trajectory. The comprehensive features are probabilistically processed by a normalized exponential function to generate conditional probability distributions of multiple predicted check-in points given the historical trajectory data. Based on the conditional probability distribution, a first preset number of predicted check-in points are selected from the plurality of predicted check-in points to generate the predicted trajectory.
[0012] Optionally, the method further includes: Obtain the original trajectory prediction model, as well as the test sample data and the true values corresponding to the test sample data; The test sample data is input into the original trajectory prediction model to obtain the test predicted trajectory; The cross-entropy loss is obtained based on the test predicted trajectory and the true value, and the regularization loss is obtained based on the model parameters of the original trajectory prediction model. The model parameters are adjusted based on the cross-entropy loss and the regularization loss to obtain a trajectory prediction model; wherein, the trajectory prediction model is used to obtain the predicted trajectory based on the historical trajectory data.
[0013] To achieve the above objectives, embodiments of the present invention provide a trajectory prediction device, comprising: The first acquisition module is used to acquire the fused trajectory features corresponding to the check-in point based on the location information and time information of the target user at each of the multiple check-in points in the historical trajectory data. The second acquisition module is used to embed features into the spatial interval and time interval between at least one target check-in point and its corresponding first adjacent check-in point from the plurality of check-in points, thereby acquiring the spatiotemporal correlation metric features corresponding to the target check-in point; wherein, the first adjacent check-in point is the check-in point that is temporally adjacent to the target check-in point from the plurality of check-in points; the spatial interval is acquired based on the location information of the target check-in point and the location information of the first adjacent check-in point; the time interval is acquired based on the time information of the target check-in point and the time information of the first adjacent check-in point. The first processing module is used to extract the historical trajectory association features of the target check-in point based on the fused trajectory features, the spatiotemporal correlation metric features, the location information and the time information corresponding to each target check-in point; The third acquisition module is used to generate dynamic association features of the predicted trajectory based on the historical trajectory association features corresponding to each target check-in point, and obtain the predicted features corresponding to the predicted trajectory. The fourth acquisition module is used to acquire the predicted trajectory corresponding to the target user based on the fusion trajectory features and the spatiotemporal correlation metric features corresponding to each target check-in point, as well as the predicted features corresponding to the predicted trajectory.
[0014] To achieve the above objectives, embodiments of the present invention provide a trajectory prediction device, comprising: a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the trajectory prediction method as described above.
[0015] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the trajectory prediction method as described above.
[0016] To achieve the above objectives, embodiments of the present invention provide a computer program product, which includes computer instructions that, when executed by a processor, implement the steps of the trajectory prediction method as described above.
[0017] The beneficial effects of the above-described technical solution of the present invention are as follows: This invention, in its embodiments, obtains spatiotemporal correlation measurement features based on the spatial and time intervals between check-in points and their neighboring points in historical trajectory data. Combined with fused trajectory features obtained through location and time information, historical trajectory correlation features are extracted to further obtain the predicted trajectory of the target user. By constructing spatiotemporal correlation features through the spatial and time intervals between check-in points, the accuracy and efficiency of trajectory feature extraction are enhanced, solving the problem in existing technologies where it is difficult to comprehensively capture the dynamic correlation of pedestrian trajectories, leading to significantly limited prediction accuracy. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the trajectory prediction method according to an embodiment of the present invention; Figure 2 This is a flowchart of the trajectory prediction method described in an embodiment of the present invention; Figure 3 This is a schematic diagram of the trajectory prediction device according to an embodiment of the present invention. Detailed Implementation
[0019] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0020] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0021] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0022] In addition, the terms "system" and "network" are often used interchangeably in this article.
[0023] In the embodiments provided by this invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.
[0024] For ease of understanding, the following describes some aspects of the embodiments of the present invention: like Figure 1 As shown, an embodiment of the present invention provides a trajectory prediction method, which includes: Step A10: Based on the location and time information of the target user at each of the multiple check-in points in the historical trajectory data, obtain the fused trajectory features corresponding to the check-in point; It should be noted that, as Figure 2 As shown, in step S1, user historical trajectory data is acquired, including check-in records with GPS coordinates and timestamps, and preprocessed to form a check-in sequence; and in step S2, a hierarchical temporal embedding algorithm is used to encode multi-level time information (daily and hourly timestamps) into a sinusoidal position matrix to generate a time-aware trajectory representation. Check-in records collected from location-based social networks are defined as quadruples. ,in For user ID, For location ID, GPS coordinates This is a timestamp (i.e., the time information). Grouped by user ID and sorted in ascending order by time truncation, a sequence is formed. Maximum length Filter out abnormal check-ins. If the distance between adjacent check-ins exceeds 5km and recovers to within 2km within 30 minutes, the intermediate point is removed. The abnormality detection formula is: ; In the formula, Indicates the first and Anomaly detection results for each check-in point This is an indicator function that outputs 1 when the condition is true. Indicates calculation and Haversine formula for spherical distance between two points. and The first and The GPS coordinates of each check-in point.
[0025] Next, the area to be studied (e.g., a certain city or a certain province) will be divided into... The grid (grid size can be adjusted as needed) maps GPS coordinates to grid IDs. The grid mapping formula is: ; In the formula, This serves as a unique identifier for the mapped grid. and These are the latitude and longitude of the GPS coordinates, respectively. and These represent the latitude and longitude span (500 meters) of a single grid cell, respectively. This indicates the total number of grids divided along the longitude direction. This is a rounding down function. A preprocessed sequence is generated, containing user ID, grid ID, GPS coordinates, and a timestamp. The location information includes the grid ID and GPS coordinates; subsequent steps typically use the grid ID. The time information includes the timestamp.
[0026] A hierarchical temporal embedding unit (HTEU) is constructed to encode the daily and hourly features in the timestamp (i.e., the time information) to generate a time-encoded vector. Then, the time-encoded vector of the check-in point and the location embedding vector obtained based on the location information are fused to obtain the fused trajectory feature corresponding to the check-in point.
[0027] Step A20: Feature embedding is performed on the spatial interval and time interval between at least one target check-in point and its corresponding first adjacent check-in point from the plurality of check-in points to obtain the spatiotemporal correlation metric feature corresponding to the target check-in point; wherein, the first adjacent check-in point is the check-in point that is temporally adjacent to the target check-in point from the plurality of check-in points; the spatial interval is obtained based on the location information of the target check-in point and the location information of the first adjacent check-in point; the time interval is obtained based on the time information of the target check-in point and the time information of the first adjacent check-in point; It should be noted that, in Figure 2In step S3, a space-time relationship matrix is constructed based on the geography and time intervals between check-in points, and integrated into a self-attention mechanism using a multi-scale spatio-temporal attention unit (MSTAU) to enhance spatial correlation. By constructing a MSTAU, the spatio-temporal correlation metric features corresponding to the target check-in point are obtained based on the geography and time intervals between check-in points. The attention mechanism based on the spatio-temporal correlation metric enhances the accuracy and efficiency of trajectory feature extraction. The space and time intervals between check-in points (i.e., between the target check-in point and its corresponding first adjacent check-in point) are extracted to generate the spatio-temporal correlation metric features. : ; The formula outputs the combined spatiotemporal interval for any pair of check-in points j and k in the historical trajectory, defined as the superposition of spatial distance and time span. and These are the GridIDs (i.e., the location information) for check-in points j and k, respectively. and This is the corresponding timestamp (i.e., the time information). To calculate the geographical distance (i.e., the spatial interval) between two points using the Havesing formula. Indicates the time interval (in seconds).
[0028] The above formula generates a two-dimensional vector by calculating geographical distance and time difference, quantifying the geo-Chronological Correlation Metric (GCCM), which represents the interval characteristics of adjacent check-in points (in time) in the geographic space and time dimensions in the pedestrian trajectory, and is used to capture dynamic correlations.
[0029] Step A30: Extract the historical trajectory association features of the target check-in point based on the fused trajectory features, the spatiotemporal correlation metric features, the location information, and the time information corresponding to each target check-in point; It should be noted that, based on the fusion trajectory features corresponding to each target check-in point... The spatiotemporal correlation measurement features The location information GridID and the time information Extract the historical trajectory association features of the target check-in point. .
[0030] Step A40: Generate dynamic association features of the predicted trajectory based on the historical trajectory association features corresponding to each target check-in point, and obtain the predicted features corresponding to the predicted trajectory. It should be noted that, in Figure 2 In step S4, a dynamic trajectory memory network (DTMN) is used to model future spatial-temporal relationships from historical data to achieve personalized trajectory prediction. By constructing a DTMN module, the dynamic association of future trajectories is predicted based on historical trajectory relationships. This is achieved through the historical trajectory association features corresponding to each target check-in point. Dynamic correlation features for generating predicted trajectories Obtain the prediction features corresponding to the predicted trajectory. .
[0031] Step A50: Based on the fusion trajectory features and spatiotemporal correlation metric features corresponding to each target check-in point, and the prediction features corresponding to the prediction trajectory, obtain the prediction trajectory corresponding to the target user. It should be noted that, in Figure 2 In step S5, the user's future trajectory is predicted by combining the encoding representation, attention output, and spatial-temporal relationship memory module, supporting next-position recommendation and multi-position trajectory prediction. The future trajectory sequence is generated by combining the outputs of the hierarchical temporal embedder, multi-scale spatiotemporal attention unit, and dynamic trajectory memory network module through a decoder, supporting next-position recommendation and multi-position trajectory prediction (i.e., the predicted trajectory).
[0032] In this embodiment, spatiotemporal correlation metrics are obtained based on the spatial and time intervals between check-in points and their neighboring points in historical trajectory data. These metrics are then combined with fused trajectory features obtained through location and time information to extract historical trajectory correlation features, further leading to the predicted trajectory of the target user. By constructing spatiotemporal correlation features using the spatial and time intervals between check-in points, the accuracy and efficiency of trajectory feature extraction are enhanced. This solves the problem in existing technologies where it is difficult to comprehensively capture the dynamic correlations of pedestrian trajectories, resulting in significantly limited prediction accuracy.
[0033] Optionally, the method, wherein step A10 includes: The time information is decomposed into day-level features and hour-level features; The time encoding vector is obtained based on the day-level features and the hour-level features; Obtain the location embedding vector based on the location information; The time encoding vector and the location embedding vector are concatenated to obtain the original fused trajectory features; The original fused trajectory features are optimized using a feedforward neural network to obtain the fused trajectory features.
[0034] In this embodiment, the timestamp is decomposed into day level. (Daily level characteristics) and hourly level Features (i.e., hourly-level features); time representation is generated through an encoding function: ; ; In the formula, It is a time-aware high-dimensional encoding vector (i.e., the time encoding vector). This represents the encoding function of a hierarchical temporal embedded unit (HTEU). Features at the daily level Features at the hour level =7 and =24 is the frequency parameter that controls the encoding cycle at the daily and hourly levels, respectively.
[0035] Embedded vectors for location (dimension) ): ; in, It is a learnable embedding matrix.
[0036] By fusing temporal and positional representations, a high-dimensional representation is generated: ; In the formula, This is the high-dimensional representation of the fused trajectory (i.e., the original fused trajectory features). and These are the weight matrix and bias vector of the fusion layer, respectively. This is the time-coded output (i.e., the time-coded vector). This indicates a vector concatenation operation.
[0037] Optimize high-dimensional representation: ; In the formula, For the optimized trajectory feature representation (i.e., the fused trajectory feature), FFN is a feedforward network.
[0038] Optionally, the method, wherein step A30 includes: Based on the fusion trajectory features and spatiotemporal correlation metric features corresponding to each target check-in point, the spatiotemporal attention features of the target check-in point are obtained; Based on the spatiotemporal attention features, location information, and time information corresponding to each target check-in point, the historical trajectory association features of the target check-in point are extracted.
[0039] In this embodiment, feature extraction is enhanced through an attention mechanism: ; In the formula, The output features of the multi-scale spatiotemporal attention unit, It is a computation function based on scaled dot product attention. The optimized trajectory features (i.e., the fused trajectory features). For the spatiotemporal correlation metric feature matrix (dimension) (i.e., the spatiotemporal correlation measurement feature).
[0040] Spatial-temporal features (i.e., the spatiotemporal attention features) are generated through multi-layer processing: ; FFN stands for feedforward network.
[0041] Optionally, the method, wherein extracting the historical trajectory association features of the target check-in point based on the spatiotemporal attention features, the location information, and the time information corresponding to each target check-in point, includes: Based on the location information and time information corresponding to each target check-in point, a second adjacent check-in point is determined; wherein, the second adjacent check-in point is a check-in point among the plurality of check-in points that is adjacent to the target check-in point in time or location; The spatiotemporal attention features of the second adjacent check-in point are weighted and aggregated to determine the historical trajectory association features of the target check-in point.
[0042] In this embodiment, the second adjacent check-in points that are temporally or spatially adjacent to each target check-in point j are determined and formed into a spatiotemporal neighbor point set. Then, the dynamic correlation features of historical trajectories (i.e., the historical trajectory correlation features) are constructed: ; In the formula, Represents the j-th check-in point and its historical memory vector. The attention-weighted result of (i.e., the second adjacent check-in point), It was generated by MSTAU. The k-th row vector, This is the second set of adjacent check-in points. Measured by weighting coefficients and The formula extracts the historical trajectory association features of check-in point j by weighted aggregation of the features of neighboring points to determine the degree of correlation.
[0043] Optionally, the method, wherein step A40 includes: The historical trajectory association features are subjected to a nonlinear transformation to obtain the dynamic association features of the predicted trajectory; Based on the dynamic correlation features, generate the original prediction features; The original prediction features are optimized using a feedforward neural network to obtain the predicted features.
[0044] In this embodiment, a future association representation (i.e., the dynamic association feature) is generated through a nonlinear transformation: ; ; In the formula, This is a dynamic association representation of future trajectories (i.e., the dynamic association features). This is the transformation function for the dynamic trajectory memory network module. This is the historical trajectory correlation matrix (i.e., the historical trajectory correlation features). It is a normalized parameter.
[0045] Based on the dynamic correlation features, the original prediction features are generated: ; In the formula, These are the preliminary prediction features (i.e., the original prediction features). and These are the weight matrix and bias vector of the prediction layer, respectively.
[0046] Optimize the original prediction features to obtain the prediction features: ; FFN stands for feedforward network.
[0047] Optionally, the method, wherein step A50 includes: The spatial-temporal characteristics of each target check-in point are obtained based on the spatiotemporal correlation metric characteristics corresponding to each target check-in point. For each target check-in point, the fused trajectory features, the spatial-temporal features, and the predicted features are concatenated into vectors to generate the comprehensive features of the predicted trajectory. The comprehensive features are probabilistically processed by a normalized exponential function to generate conditional probability distributions of multiple predicted check-in points given the historical trajectory data. Based on the conditional probability distribution, a first preset number of predicted check-in points are selected from the plurality of predicted check-in points to generate the predicted trajectory.
[0048] In this embodiment, feature extraction is enhanced through an attention mechanism: ; In the formula, The output features of the multi-scale spatiotemporal attention unit, It is a computation function based on scaled dot product attention. The optimized trajectory features (i.e., the fused trajectory features). For the spatiotemporal correlation metric feature matrix (dimension) (i.e., the spatiotemporal correlation measurement feature).
[0049] Spatial-temporal features (i.e., the spatiotemporal attention features) are generated through multi-layer processing: ; FFN stands for feedforward network.
[0050] Optimize the spatiotemporal attention features to obtain the spatial-temporal features: ; LayerNorm is the layer normalization function.
[0051] Integrate the outputs of each module (i.e., the fused trajectory features and spatial-temporal features corresponding to each target check-in point, as well as the predicted features) to generate a comprehensive feature: ; In the formula, For the comprehensive feature vector, and These are the weights and biases of the splicing layer, respectively. , , These are the output features of the hierarchical temporal embedder, the multi-scale spatiotemporal attention unit, and the dynamic trajectory memory network, respectively.
[0052] Probability distribution is generated using the decoder: ; In the formula, Represents a given historical trajectory (i.e., the historical trajectory data) predicts the trajectory. The conditional probability distribution, For normalized exponential functions, and These are decoder parameters.
[0053] Generate a sequence of future trajectories (i.e., the predicted trajectories): ; in, The predicted length (i.e., the first preset quantity).
[0054] Optionally, the method further includes: Obtain the original trajectory prediction model, as well as the test sample data and the true values corresponding to the test sample data; The test sample data is input into the original trajectory prediction model to obtain the test predicted trajectory; The cross-entropy loss is obtained based on the test predicted trajectory and the true value, and the regularization loss is obtained based on the model parameters of the original trajectory prediction model. The model parameters are adjusted based on the cross-entropy loss and the regularization loss to obtain a trajectory prediction model; wherein, the trajectory prediction model is used to obtain the predicted trajectory based on the historical trajectory data.
[0055] In this embodiment, the original trajectory prediction model is trained using cross-entropy loss. For cross-entropy loss, The number of samples (i.e., the test sample data). and The predicted test trajectory and the actual value are respectively: ; At the same time, stability is enhanced by incorporating regularization loss. For L2 regularization loss, The regularization coefficient is . The model parameter matrix (i.e., the model parameters of the original trajectory prediction model): ; The optimizer iteratively optimizes on the training set (i.e., the test sample data), evaluates performance on the validation set, and generates the final trajectory on the test set. This generation process is repeated until a specified number of trajectory sequences are output. This yields the trajectory prediction model used to obtain the predicted trajectory based on the historical trajectory data.
[0056] It should be noted that the embodiments of the present invention have the following advantages: (1) The Hierarchical Temporal Embedder (HTEU), Multi-Scale Spatiotemporal Attention Unit (MSTAU), and Dynamic Trajectory Memory Network (DTMN) modules are adopted to reduce computational complexity through efficient feature extraction and processing mechanisms. By proposing a lightweight architecture and integrating efficient modules, the computational complexity is reduced, and the inference time is shortened from 500ms to 200ms, which meets the real-time requirements while maintaining prediction accuracy.
[0057] (2) By constructing the space-time relationship matrix Rinterval, the geography and time interval between check-in points are explicitly modeled.
[0058] (3) The long-term dependency relationship between historical trajectories and future trajectories is modeled by the DTMN module. The relationship between future trajectories is modeled from historical data by the dynamic trajectory memory network module. Combined with the personalized prediction mechanism, the F1 score of multi-location trajectory prediction is improved from 0.65 to 0.80, which further improves the adaptability and accuracy of prediction.
[0059] (4) Time information at the daily and hourly levels is hierarchically encoded using the HTEU module to generate a time-aware high-dimensional representation. By explicitly modeling spatiotemporal correlation metrics and multi-level time features (daily and hourly levels), the accuracy of pedestrian trajectory prediction is increased from 75% to 90%, solving the problem of insufficient dynamic correlation modeling in traditional methods.
[0060] like Figure 3 As shown, to achieve the above objectives, embodiments of the present invention provide a trajectory prediction device, comprising: The first acquisition module 301 is used to acquire the fused trajectory features corresponding to the check-in point based on the location information and time information of the target user at each of the multiple check-in points in the historical trajectory data. The second acquisition module 302 is used to embed features into the spatial interval and time interval between at least one target check-in point and its corresponding first adjacent check-in point from the plurality of check-in points, thereby acquiring the spatiotemporal correlation metric features corresponding to the target check-in point; wherein, the first adjacent check-in point is the check-in point that is temporally adjacent to the target check-in point from the plurality of check-in points; the spatial interval is obtained based on the location information of the target check-in point and the location information of the first adjacent check-in point; the time interval is obtained based on the time information of the target check-in point and the time information of the first adjacent check-in point. The first processing module 303 is used to extract the historical trajectory association features of the target check-in point based on the fused trajectory features, the spatiotemporal correlation measurement features, the location information and the time information corresponding to each target check-in point; The third acquisition module 304 is used to generate dynamic association features of the predicted trajectory based on the historical trajectory association features corresponding to each target check-in point, and obtain the predicted features corresponding to the predicted trajectory. The fourth acquisition module 305 is used to acquire the predicted trajectory corresponding to the target user based on the fusion trajectory features and the spatiotemporal correlation metric features corresponding to each target check-in point, as well as the predicted features corresponding to the predicted trajectory.
[0061] Optionally, in the aforementioned apparatus, the first acquisition module 301 includes: The first processing unit is used to decompose the time information into day-level features and hour-level features; The first acquisition unit is used to acquire a time encoding vector based on the day-level features and the hour-level features; The second acquisition unit is used to acquire a location embedding vector based on the location information; The third acquisition unit is used to perform vector concatenation on the time encoding vector and the position embedding vector to obtain the original fused trajectory features; The fourth acquisition unit is used to optimize the original fused trajectory features through a feedforward neural network to acquire the fused trajectory features.
[0062] Optionally, in the aforementioned apparatus, the first processing module 303 includes: The fifth acquisition unit is used to acquire the spatiotemporal attention features of the target check-in point based on the fusion trajectory features and the spatiotemporal correlation metric features corresponding to each target check-in point; The second processing unit is used to extract the historical trajectory association features of the target check-in point based on the spatiotemporal attention features, the location information, and the time information corresponding to each target check-in point.
[0063] Optionally, in the aforementioned apparatus, the second processing unit includes: The first determining component is used to determine a second adjacent check-in point of the target check-in point based on the location information and time information corresponding to each target check-in point; wherein, the second adjacent check-in point is a check-in point among the plurality of check-in points that is adjacent to the target check-in point in time or in location; The second determining component is used to perform weighted aggregation of the spatiotemporal attention features of the second adjacent check-in point to determine the historical trajectory association features of the target check-in point.
[0064] Optionally, in the aforementioned apparatus, the third acquisition module 304 includes: The sixth acquisition unit is used to perform a nonlinear transformation on the historical trajectory association features to acquire the dynamic association features of the predicted trajectory; The first generation unit is used to generate original prediction features based on the dynamic association features; The seventh acquisition unit is used to optimize the original prediction features through a feedforward neural network to acquire the prediction features.
[0065] Optionally, in the aforementioned apparatus, the fourth acquisition module 305 includes: The eighth acquisition unit is used to acquire the spatial-temporal features of the target check-in point based on the spatiotemporal correlation metric features corresponding to each target check-in point; The second generation unit is used to perform vector concatenation on the fused trajectory features, the spatial-temporal features, and the predicted features corresponding to each target check-in point to generate the comprehensive features of the predicted trajectory. The third generation unit is used to perform probabilistic processing on the comprehensive features through a normalized exponential function to generate a conditional probability distribution of multiple predicted check-in points given the historical trajectory data. The fourth generation unit is used to select a first preset number of predicted check-in points from the plurality of predicted check-in points according to the conditional probability distribution, and generate the predicted trajectory.
[0066] Optionally, the device further includes: The fifth acquisition module is used to acquire the original trajectory prediction model, as well as the test sample data and the true values corresponding to the test sample data; The sixth acquisition module is used to input the test sample data into the original trajectory prediction model to acquire the test prediction trajectory; The seventh acquisition module is used to acquire cross-entropy loss based on the test predicted trajectory and the true value, and to acquire regularization loss based on the model parameters of the original trajectory prediction model. The eighth acquisition module is used to adjust the model parameters according to the cross-entropy loss and the regularization loss to acquire a trajectory prediction model; wherein the trajectory prediction model is used to acquire the predicted trajectory based on the historical trajectory data.
[0067] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0068] To achieve the above objectives, embodiments of the present invention provide a trajectory prediction device, comprising: a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the trajectory prediction method as described above.
[0069] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the trajectory prediction method as described above.
[0070] To achieve the above objectives, embodiments of the present invention provide a computer program product, which includes computer instructions that, when executed by a processor, implement the steps of the trajectory prediction method as described above.
[0071] It should be further noted that the terminals described in this specification include, but are not limited to, smartphones, tablets, etc., and many of the functional components described are referred to as modules in order to emphasize the independence of their implementation.
[0072] In this embodiment of the invention, the module can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.
[0073] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.
[0074] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.
[0075] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of the range and any subranges in between.
[0076] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A trajectory prediction method, characterized in that, include: Based on the location and time information of the target user at each of the multiple check-in points in the historical trajectory data, the fused trajectory features corresponding to the check-in points are obtained; Feature embedding is performed on the spatial interval and time interval between at least one target check-in point and its corresponding first adjacent check-in point from the plurality of check-in points to obtain the spatiotemporal correlation metric feature corresponding to the target check-in point; wherein, the first adjacent check-in point is the check-in point that is temporally adjacent to the target check-in point from the plurality of check-in points; the spatial interval is obtained based on the location information of the target check-in point and the location information of the first adjacent check-in point; the time interval is obtained based on the time information of the target check-in point and the time information of the first adjacent check-in point. Based on the fused trajectory features, spatiotemporal correlation metric features, location information, and time information corresponding to each target check-in point, extract the historical trajectory correlation features of the target check-in point; Based on the historical trajectory association features corresponding to each target check-in point, dynamic association features of the predicted trajectory are generated, and the predicted features corresponding to the predicted trajectory are obtained. Based on the fusion trajectory features and spatiotemporal correlation metric features corresponding to each target check-in point, and the prediction features corresponding to the prediction trajectory, the predicted trajectory corresponding to the target user is obtained.
2. The method according to claim 1, characterized in that, Based on the location and time information of the target user at each of the multiple check-in points in the historical trajectory data, the fused trajectory features corresponding to the check-in points are obtained, including: The time information is decomposed into day-level features and hour-level features; The time encoding vector is obtained based on the day-level features and the hour-level features; Obtain the location embedding vector based on the location information; The time encoding vector and the location embedding vector are concatenated to obtain the original fused trajectory features; The original fused trajectory features are optimized using a feedforward neural network to obtain the fused trajectory features.
3. The method according to claim 1, characterized in that, Based on the fused trajectory features, spatiotemporal correlation metric features, location information, and time information corresponding to each target check-in point, historical trajectory correlation features of the target check-in point are extracted, including: Based on the fusion trajectory features and spatiotemporal correlation metric features corresponding to each target check-in point, the spatiotemporal attention features of the target check-in point are obtained; Based on the spatiotemporal attention features, location information, and time information corresponding to each target check-in point, the historical trajectory association features of the target check-in point are extracted.
4. The method according to claim 3, characterized in that, Based on the spatiotemporal attention features, location information, and time information corresponding to each target check-in point, the historical trajectory association features of the target check-in point are extracted, including: Based on the location information and time information corresponding to each target check-in point, a second adjacent check-in point is determined; wherein, the second adjacent check-in point is a check-in point among the plurality of check-in points that is adjacent to the target check-in point in time or location; The spatiotemporal attention features of the second adjacent check-in point are weighted and aggregated to determine the historical trajectory association features of the target check-in point.
5. The method according to claim 1, characterized in that, Based on the historical trajectory association features corresponding to each target check-in point, dynamic association features of the predicted trajectory are generated, and the predicted features corresponding to the predicted trajectory are obtained, including: The historical trajectory association features are subjected to a nonlinear transformation to obtain the dynamic association features of the predicted trajectory; Based on the dynamic correlation features, generate the original prediction features; The original prediction features are optimized using a feedforward neural network to obtain the predicted features.
6. The method according to claim 1, characterized in that, Based on the fused trajectory features and spatiotemporal correlation metric features corresponding to each target check-in point, and the prediction features corresponding to the predicted trajectory, the predicted trajectory corresponding to the target user is obtained, including: The spatial-temporal characteristics of each target check-in point are obtained based on the spatiotemporal correlation metric characteristics corresponding to each target check-in point. For each target check-in point, the fused trajectory features, the spatial-temporal features, and the predicted features are concatenated into vectors to generate the comprehensive features of the predicted trajectory. The comprehensive features are probabilistically processed by a normalized exponential function to generate conditional probability distributions of multiple predicted check-in points given the historical trajectory data. Based on the conditional probability distribution, a first preset number of predicted check-in points are selected from the plurality of predicted check-in points to generate the predicted trajectory.
7. The method according to claim 1, characterized in that, The method further includes: Obtain the original trajectory prediction model, as well as the test sample data and the true values corresponding to the test sample data; The test sample data is input into the original trajectory prediction model to obtain the test predicted trajectory; The cross-entropy loss is obtained based on the test predicted trajectory and the true value, and the regularization loss is obtained based on the model parameters of the original trajectory prediction model. The model parameters are adjusted based on the cross-entropy loss and the regularization loss to obtain a trajectory prediction model; wherein, the trajectory prediction model is used to obtain the predicted trajectory based on the historical trajectory data.
8. A trajectory prediction device, characterized in that, include: The first acquisition module is used to acquire the fused trajectory features corresponding to the check-in point based on the location information and time information of the target user at each of the multiple check-in points in the historical trajectory data. The second acquisition module is used to embed features into the spatial interval and time interval between at least one target check-in point and its corresponding first adjacent check-in point from the plurality of check-in points, thereby acquiring the spatiotemporal correlation metric features corresponding to the target check-in point; wherein, the first adjacent check-in point is the check-in point that is temporally adjacent to the target check-in point from the plurality of check-in points; the spatial interval is acquired based on the location information of the target check-in point and the location information of the first adjacent check-in point; the time interval is acquired based on the time information of the target check-in point and the time information of the first adjacent check-in point. The first processing module is used to extract the historical trajectory association features of the target check-in point based on the fused trajectory features, the spatiotemporal correlation metric features, the location information and the time information corresponding to each target check-in point; The third acquisition module is used to generate dynamic association features of the predicted trajectory based on the historical trajectory association features corresponding to each target check-in point, and obtain the predicted features corresponding to the predicted trajectory. The fourth acquisition module is used to acquire the predicted trajectory corresponding to the target user based on the fusion trajectory features and the spatiotemporal correlation metric features corresponding to each target check-in point, as well as the predicted features corresponding to the predicted trajectory.
9. A trajectory prediction device, comprising: A processor, a memory, and a program or instructions stored in the memory and executable on the processor; characterized in that, when the processor executes the program or instructions, it implements the trajectory prediction method as described in any one of claims 1-7.
10. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps in the trajectory prediction method as described in any one of claims 1-7.
11. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the trajectory prediction method as described in any one of claims 1-7.