Moving target long trajectory prediction method and device

By converting the moving trajectory data set of the moving target into graph structure data and encoding it into trajectory representation vectors, similarity measurement learning is performed, and the problem of low accuracy in long-term trajectory prediction is solved, and higher trajectory prediction accuracy and more efficient GPU memory usage is achieved.

CN115130768BActive Publication Date: 2025-06-10INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210794045.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2025-06-10
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

The existing trajectory similarity measurement mechanism is mainly applicable to the prediction of short-term trajectories. There is a problem of low accuracy for long-term trajectories and poor prediction accuracy.

Method used

By obtaining the action trajectory data set of different moving targets, converting it into graph structure data, encoding it as a trajectory representation vector, similarity measurement learning is performed, and the overlap of trajectories in the space-time dimension is predicted.

Benefits of technology

It improves the accuracy of trajectory similarity calculation in long trajectories, improves the trajectory prediction accuracy of mobile targets, and reduces GPU memory consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115130768B_ABST
    Figure CN115130768B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for predicting long trajectories of moving targets. The method includes: obtaining an action trajectory data set of different moving targets; converting the action trajectory data set into graph-structured data; encoding the graph-structured data into a trajectory representation vector; performing similarity metric learning based on the trajectory representation vector to obtain trajectory similarity; and predicting the overlap degree of the action trajectories of different moving targets in the spatio-temporal dimension based on the trajectory similarity. This method improves the accuracy of trajectory similarity calculation in long trajectories, and thus improves the trajectory prediction accuracy of moving targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of trajectory prediction, and in particular, to a method and device for predicting long trajectories of moving targets. Background Art

[0002] In the context of the rapid development of technologies such as mobile Internet and location services, GPS devices have become standard equipment for various moving objects. With the activities of such moving objects, a large amount of trajectory data is generated. The rich trajectory data depicts the behavior patterns of moving objects from different angles and levels, providing great assistance for applications based on trajectory data. By analyzing and mining the trajectory data, specific behavior information and patterns can be discovered, which have important significance and value in applications such as urban planning, epidemic prevention and control, and traffic control. Trajectory similarity calculation, as a core task in trajectory data mining, measures the similarity degree between different trajectory data, and its results are of great significance for trajectory clustering, pattern discovery, anomaly detection, target recognition, etc.

[0003] However, the existing trajectory similarity measurement mechanisms are mainly applicable to the prediction of short-term trajectories, and there are problems of low accuracy in trajectory similarity calculation and poor prediction accuracy for long-term trajectories. Summary of the Invention

[0004] Aiming at the deficiencies of the prior art, the present invention proposes a method and device for predicting long trajectories of moving targets, which improves the accuracy of trajectory similarity calculation in long trajectories, and further improves the trajectory prediction accuracy of moving targets.

[0005] To achieve the above object, on the one hand, the present invention provides a method for predicting long trajectories of moving targets, including:

[0006] Obtain the action trajectory data sets of different moving targets;

[0007] Convert the action trajectory data set into graph structure data;

[0008] Encode the graph structure data into a trajectory representation vector;

[0009] Perform similarity measurement learning based on the trajectory representation vector to obtain trajectory similarity;

[0010] Predict the coincidence degree of the action trajectories of different moving targets in the spatio-temporal dimension based on the trajectory similarity.

[0011] Optionally, based on the quadtree structure, converting the action trajectory data set into graph structure data includes:

[0012] Count all the trajectory position points in the action trajectory data set, and determine the first trajectory distribution area in the data set;

[0013] Recursively divide the first trajectory distribution region into four sub-trajectory distribution regions equally. Each time, divide each of the obtained sub-trajectory distribution regions into four sub-trajectory distribution regions of equal size until the number of trajectory position points contained in the smallest sub-trajectory distribution region does not exceed the preset position number threshold, and construct the spatial hierarchical structure of the graph structure model of the action trajectory dataset.

[0014] Optionally, converting the action trajectory dataset into graph structure data further includes:

[0015] Constructing the target nodes of the graph structure model of the action trajectory dataset includes:

[0016] Obtain each original action trajectory in the action trajectory dataset;

[0017] Generate the first nodes corresponding to all trajectory points in each of the original action trajectories. Each of the first nodes contains all the information of a trajectory point in the original action trajectory;

[0018] Obtain the second nodes from the spatial hierarchical structure;

[0019] Obtain the target nodes of the graph structure model of the action trajectory dataset based on the first nodes and the second nodes.

[0020] Optionally, converting the action trajectory dataset into graph structure data further includes:

[0021] Constructing the edge connection relationship of the graph structure model of the action trajectory dataset includes:

[0022] Construct the cross-layer edges of the nodes between different levels in the spatial hierarchical structure;

[0023] Construct the intra-layer edges of the nodes between the same levels in the spatial hierarchical structure;

[0024] Obtain the edge connection relationship of the graph structure model of the action trajectory dataset based on the cross-layer edges and the intra-layer edges.

[0025] Optionally, converting the action trajectory dataset into graph structure data further includes:

[0026] Generating the target trajectory features of the graph structure model of the action trajectory dataset includes:

[0027] Generate trajectory position features;

[0028] Generate trajectory distribution region features;

[0029] Generate the spatial hierarchical structure features of the graph structure model,

[0030] Fuse the trajectory position feature, trajectory distribution area feature, and spatial hierarchical structure feature to obtain the target trajectory feature.

[0031] Optionally, generating the trajectory position feature includes:

[0032] Use the longitude and latitude coordinates of the corresponding trajectory position points in the original action trajectory as the first original position feature of the first node;

[0033] Use the coordinates of the spatial region corresponding to the second node in the spatial hierarchical structure as the second original position feature of the second node,

[0034] Generate the trajectory position feature using the first original position feature and the second original position feature.

[0035] Optionally, encoding the graph structure data into a trajectory representation vector according to the target trajectory feature includes:

[0036] Perform pre-training on spatial structure encoding according to the tree structure of the graph structure model of the action trajectory dataset to obtain the spatial encoding representation of each node in the tree structure;

[0037] Add the trajectory position feature, trajectory distribution area feature, and spatial hierarchical structure feature to the spatial encoding representation to obtain the trajectory representation vector.

[0038] On the other hand, the present invention also provides a long-term trajectory prediction method for moving targets, which is applied to the epidemic prevention and control scenario, including:

[0039] Obtain the action trajectory datasets of different moving targets, where the action trajectory datasets include the first behavior trajectories of confirmed patients and the second behavior trajectories of non-confirmed patients;

[0040] Convert the action trajectory datasets into graph structure data;

[0041] Encode the graph structure data into a trajectory representation vector;

[0042] Perform similarity metric learning based on the trajectory representation vector to obtain the trajectory similarity between the first behavior trajectory and the second behavior trajectory;

[0043] Predict the coincidence degree of the action trajectories of non-confirmed patients and confirmed patients in the spatio-temporal dimension according to the trajectory similarity.

[0044] On the other hand, the present invention also provides a long-term trajectory prediction method for moving targets, which is applied to the traffic control scenario, including:

[0045] Obtain the action trajectory datasets of different moving targets, where the moving targets are moving vehicles;

[0046] Convert the action trajectory dataset into graph-structured data;

[0047] Encode the graph-structured data into a trajectory representation vector;

[0048] Perform similarity metric learning based on the trajectory representation vector to obtain trajectory similarity;

[0049] Predict the overlap degree of different moving target action trajectories in the spatio-temporal dimension based on the trajectory similarity;

[0050] Perform traffic control based on the overlap degree.

[0051] On the other hand, the present invention also provides a long trajectory prediction device for moving targets, which adopts the above-mentioned long trajectory prediction method for moving targets and at least includes:

[0052] An acquisition module, configured to acquire the action trajectory datasets of different moving targets;

[0053] A graph structure model construction module, configured to convert the action trajectory dataset into graph-structured data;

[0054] A trajectory similarity determination module, which encodes the graph-structured data into a trajectory representation vector, and

[0055] is configured to perform similarity metric learning based on the trajectory representation vector to obtain trajectory similarity;

[0056] A prediction module, configured to predict the overlap degree of different moving target action trajectories in the spatio-temporal dimension based on the trajectory similarity.

[0057] On the other hand, the present invention also provides a storage medium for storing a computer program for executing the above-mentioned long trajectory prediction method for moving targets.

[0058] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the above-mentioned long trajectory prediction method for moving targets is implemented.

[0059] From the above solutions, the advantages of the present invention are as follows:

[0060] The long-term trajectory prediction method for moving targets provided by the present invention includes obtaining action trajectory datasets of different moving targets; converting the action trajectory datasets into graph structure data; encoding the graph structure data into trajectory representation vectors; performing similarity metric learning based on the trajectory representation vectors to obtain trajectory similarities; and predicting the overlap degree of the action trajectories of different moving targets in the spatio-temporal dimension. This method solves the problem of low prediction accuracy of existing representation learning-based algorithms in long-term trajectory prediction and reduces the consumption of GPU memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 FIG. is a schematic flowchart of the long-term trajectory prediction method for moving targets provided by an embodiment of the present invention;

[0062] Figure 2 FIG. is a specific flowchart of the long-term trajectory prediction method for moving targets applied to the epidemic prevention and control scenario;

[0063] Figure 3 FIG. is a specific flowchart of the long-term trajectory prediction method for moving targets applied to the traffic control scenario;

[0064] Figure 4 FIG. is a framework diagram of the long-term trajectory prediction device for moving targets of the present invention;

[0065] Figure 5 FIG. is a schematic structural diagram of an electronic device;

[0066] Wherein:

[0067] 400 - Long-term trajectory prediction device for moving targets;

[0068] 401 - Acquisition module;

[0069] 402 - Graph structure model construction module;

[0070] 403 - Trajectory similarity determination module;

[0071] 404 - Prediction module;

[0072] 500 - Electronic device;

[0073] 501 - Processor;

[0074] 502 - Memory. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0075] In order to make the above features and effects of the present invention more clearly and understandably described, the following specific embodiments are given and detailed descriptions are made in conjunction with the accompanying drawings of the specification as follows.

[0076] Refer to Figure 1 as shown in Figure 1Shows a schematic flowchart of the long - trajectory prediction method for moving targets provided in the first embodiment;

[0077] A long - trajectory prediction method for moving targets, comprising:

[0078] S11. Obtain the action trajectory datasets of different moving targets;

[0079] According to the accuracy performance of the existing similarity calculation methods based on representation learning on trajectory datasets in different length intervals, the trajectory data with no more than 150 recorded points is called mixed trajectory, and the trajectory data with no less than 200 recorded points is called long trajectory. When obtaining the action trajectory datasets of different moving targets, specifically obtain long - trajectory data with no less than 200 recorded points of trajectory positions for analysis.

[0080] S12. Convert the action trajectory datasets into graph - structured data.

[0081] Existing methods based on representation learning all use RNN to encode trajectories and then implement model training through backpropagation. This results in the model only being able to capture short - term dependencies, and the encoded representation vectors can only well cover the information of the tail recorded points of the trajectory, unable to encompass all the information of the entire trajectory, leading to a decline in the performance of the model on long - trajectory datasets. At the same time, existing methods based on representation learning perform graph - structured modeling of spatial information by learning the shared representations of the same - sized grids, resulting in weak connections between records that are far apart in sequence modeling. In addition, the uneven distribution of recorded points in the trajectory dataset also causes the representations of some grids in space to not be fully trained, further causing a decline in the performance of the graph - structured model on long - trajectory datasets.

[0082] Therefore, in this embodiment, based on the quadtree structure, the action trajectory datasets are converted into graph - structured data, specifically including:

[0083] First, count all the trajectory position points in the action trajectory datasets to determine the first trajectory distribution area in the dataset. Recursively divide the first trajectory distribution area into four sub - trajectory distribution areas equally. Each of the obtained sub - trajectory distribution areas is divided into four sub - trajectory distribution areas of equal size again until the number of trajectory position points contained in the smallest sub - trajectory distribution area does not exceed the preset position number threshold, and construct the spatial hierarchical structure of the graph - structured model of the action trajectory datasets. Through this process, the spatial trajectory distribution area corresponding to the action trajectory datasets is divided into an asymmetric hierarchical space according to the density of the distribution of trajectory position points.

[0084] Secondly, for the construction of the nodes, edges, and trajectory features of the graph - structured model, they are respectively realized through the following processes:

[0085] For the target nodes of the graph structure model for constructing the action trajectory dataset, it includes:

[0086] Obtain each original action trajectory in the action trajectory dataset;

[0087] Generate the first nodes corresponding to all the trajectory points in each of the original action trajectories, and each of the first nodes contains all the information of a trajectory point in the original action trajectory.

[0088] In a specific implementation, given an original action trajectory T, construct the graph structure model T through the grid cells corresponding to it in the quadtree g =(N, E), where E is the set of edges in the graph structure and N is the set of nodes in the graph structure. T g contains the original trajectory record and the hierarchical information in the quadtree.

[0089] The construction of the graph structure is based on the quadtree. The nodes in T g are composed of the original nodes in T and the grid cells associated with them at different levels in the quadtree. Suppose the length of the original action trajectory T is L. First, generate the first nodes N r ={n 1 ,…n L} corresponding to all the trajectory points in the original action trajectory T. Each node n i contains all the information of the original trajectory point. Consider the first nodes N r as the nodes of the 0th layer of the graph structure data. Then, recursively find the grid cells that have not been traversed and are connected to the nodes of the previous layer in the quadtree. Divide the nodes of the 0th layer into the leaf nodes in the quadtree according to the inclusion relationship of spatial positions. These involved leaf nodes in the quadtree are the nodes of the 1st layer of the graph structure data. Similarly, the nodes of the 2nd layer of the graph structure data can be obtained. Divide the nodes of the 1st layer into the non-leaf nodes of the first layer in the quadtree according to the inclusion relationship of spatial positions. These involved non-leaf nodes in the quadtree are used as the nodes of the 2nd layer of the graph structure data.

[0090] Obtain the second nodes from the spatial hierarchical structure, that is, all the nodes obtained from the spatial hierarchical structure of the quadtree are used as the second nodes, denoted by , where η represents from which layer in the quadtree this set is obtained, represents the subset of the nodes of the i-th layer. η is a key hyperparameter in the process of constructing the graph structure.

[0091] Obtain the target nodes of the graph structure model of the action trajectory dataset based on the first nodes and the second nodes.

[0092] For the edge connection relationship of the graph structure model for constructing the action trajectory dataset, it includes:

[0093] Construct cross-layer edges between nodes at different levels in the spatial hierarchical structure;

[0094] Construct intra-layer edges between nodes at the same level in the spatial hierarchical structure;

[0095] Based on the cross-layer edges and the intra-layer edges, obtain the edge connection relationship of the graph structure model of the action trajectory dataset.

[0096] In a specific implementation, in the graph structure model T g two types of edge connection relationships are designed. The first type is cross-layer edges E c , and the edges in E c connect nodes belonging to different levels in Ν. Since the regions corresponding to the leaf nodes in the quadtree cover the entire dataset region, all nodes in the first node N r can be divided into the regions corresponding to the leaf nodes in the quadtree. Thus, the edges connecting the nodes between the first node N r and the second node are constructed through their subordination relationships. Correspondingly, the edges between the nodes of the second node and can be constructed through their edge connection relationships in the tree structure of the quadtree. The second type is Intra-layer connection edge . To improve the utilization rate of GPU memory and reduce the computational complexity of the graph structure model, in this embodiment, intra-layer edges are only added between the nodes of the second node N h . For each layer of point sets in the trajectory graph structure data, full-connection edge connection relationships are added between the nodes in the second node . The edges between these nodes in each layer obtain intra-layer edges. The edges in the edge connection relationship E are all undirected, and the node information on both sides of the edge can be propagated bidirectionally through the edge.

[0097] For the target trajectory features of the graph structure model for generating the action trajectory dataset, they are implemented through the original action trajectory T and the quadtree, including several parts such as trajectory position features, trajectory distribution region features, and spatial hierarchical structure features.

[0098] For the trajectory position feature f l , use the longitude and latitude coordinates of the corresponding trajectory position points in the original action trajectory as the first original position feature of the first node; use the coordinates of the spatial region corresponding to the second node in the spatial hierarchical structure as the second original position feature of the second node, and generate the trajectory position feature using the first original position feature and the second original position feature.

[0099] Specifically, each point in the point set N represents a spatial element in the dataset region, which may represent a location point coordinate or a rectangular spatial region. For the first node N r in the points, the model directly uses the longitude and latitude coordinates of the corresponding trajectory position point in the original action trajectory T as the first original position feature. For the second node N h in the points, the model takes the centroid coordinates of its corresponding spatial rectangular region as the second original position feature. All the coordinates used as the first and second original position features exist in the form of GPS point pairs and need to be converted into directly usable position features. First, the GPS coordinate pairs are regularized using the Min-Max normalization method, and then the regularized coordinate pair data is non-linearly transformed using a multi-layer perceptron. Suppose X i =(lat i , lon i ) is the position coordinate corresponding to the node n i ∈N, then the trajectory position feature f l is obtained through the following transformation:

[0100] x i , y i =Normalize(lat i , lon i ),

[0101]

[0102] For the trajectory distribution region feature f r , the graph structure model uses the region feature as the information representing the region size. For n i ∈N h , the model extracts the height h i and width w i of the spatial rectangular region corresponding to n i , and obtains the region feature of n i through non-linear transformation. If n i ∈N r , the model defaults h i =0; w i =0, and processes h i , w i through non-linear transformation to obtain the trajectory distribution region feature of n i . The formula for this process is as follows:

[0103]

[0104] In addition, for the spatial hierarchical structure feature f h, the graph structure model directly uses the spatial structure representation matrix of the pre-trained quadtree. For the points in the first node N r among them, the model adds specific eigenvalue in to represent the spatial structure features corresponding to such original action trajectory points in the first node N r . In this way, the trajectory points that are in a neighbor relationship at the spatial level share the same hierarchical structure features. For the points in the second node N h among them, the model obtains a certain eigenvalue in through the point number, and this eigenvalue is the hierarchical structure feature of this point. The formulaic expression of this process is as follows:

[0105]

[0106] Finally, fuse the trajectory position feature, trajectory distribution area feature, and spatial hierarchical structure feature to obtain the target trajectory feature, that is

[0107] For generality, assume that the dimensions of the three features are all d f , and the dimension of the node feature f i is d = 3×d f .

[0108] In this embodiment, through the above process of the graph structure model for constructing the action trajectory data set based on the quadtree structure, the trajectory data of the sequence structure can be transformed into a graph structure. The vertices in the graph represent the composition of real trajectory points or spatial nodes in the quadtree, the edges in the graph are constituted by the spatial coverage relationship of the nodes, and the features of the nodes are composed of position features, area features, and hierarchical structure features. The obtained graph-structured trajectory data can retain the information in the original trajectory data to the greatest extent.

[0109] S13. Encode the graph structure data into a trajectory representation vector.

[0110] In a specific implementation, according to the target trajectory feature, encoding the graph structure data into a trajectory representation vector includes: performing pre-training on spatial structure encoding according to the tree structure of the graph structure model of the action trajectory data set to obtain the spatial encoding representation of each node in the tree structure; adding the trajectory position feature, trajectory distribution area feature, and spatial hierarchical structure feature to the spatial encoding representation to obtain the trajectory representation vector.

[0111] Specifically

[0112] In the calculation of the trajectory representation vector, the encoding process of the representation vector of each node does not require all other nodes in the trajectory to participate. By combining with the graph structure data of the constructed trajectory, the information between nodes is made to flow during the encoding process. When encoding the features of a node, the feature information between nodes that are far apart in terms of spatial distance can also be utilized by it.

[0113] Before inputting the graph structure data of the trajectory into the encoding model, first, trajectory position encoding information is added to each node. The added bit encoding information contains two parts. One part is the position information of the trajectory point sequence corresponding to the first node N r , and the other part is the spatial structure position information in the graph corresponding to the second node N h .

[0114] To construct the sequence position information, a sequential traversal scheme for the graph structure model T g is designed. First, a list-type data L for storing the order between nodes is created, and then the nodes in T g are sequentially added to the list L in the order from the 0th layer to the ηth layer. For the nodes in the 0th layer, that is, the nodes in the first node N r , the model adds them to the list L in the original order in the trajectory data T. For the nodes in the ith layer, the model adds them to the list L in the order of the nodes in the second node connected to it. In this process, each node will not be added repeatedly, where η≥i>0.

[0115] For the sequential nodes in the list L, a position encoding method designed based on trigonometric functions is adopted to implement the encoding work of the position information. This encoding method is an absolute position encoding method, called sine position encoding. Suppose there are M nodes in the list L, and the model constructs their sequence position encoding through the following equation:

[0116]

[0117] where i = [1,…,M], j = [1,…,d / 2]. The sequence position encoding of the node n i ∈N is represented by .

[0118] To retain the hierarchical position relationship between the target nodes in the graph structure data model T g , the model uses Laplacian position encoding. Laplacian position encoding can encode relative distance information, that is, compared with non-adjacent nodes, the Laplacian position feature encoding of a node and its adjacent nodes will be more similar. The equation representing Laplacian position encoding is as follows:

[0119]

[0120]

[0121] Among them, A is the adjacency matrix, D is the degree matrix, and Λ and U correspond to eigenvalues and eigenvectors respectively. Refers to node n i The Laplacian position encoding of, top p It means selecting the first p non-trivial eigenvalues in Λ, and the p eigenvectors related to them are the spatial structure position encoding of n after being processed by the non-linear transformation of the fully connected network, denoted as i of, denoted as

[0122] After obtaining and After that, the model combines them through a concatenation operation to form the final position encoding vector λ i , and adds it to the features of the corresponding node, and inputs it as the next parameter into the Transformer encoding layer based on GAT.

[0123]

[0124] i i = λ i + f i

[0125] Among them is the input vector of node n i in the Transformer encoding layer based on GAT.

[0126] In addition, this embodiment uses a graph-attention encoding layer to replace the self-attention encoding layer to implement trajectory encoding. For the target node n i , the operations of the encoding layer are defined as follows:

[0127]

[0128]

[0129]

[0130] In the formula refers to the set of adjacent nodes of node n i , where 1 ≤ k ≤ H refers to the number of attention heads used in the model.

[0131] Among them, the graph-attention operation is mainly implemented through three mapping matrices. Three matrices \(W\) Q , \(W\) K , \(W\) V are defined in the graph-attention operation. Through these three matrices, three linear transformations are performed on the input vectors, so that each input vector derives three new vectors \(q\), \(k\), and \(v\). To obtain the attention weights of the target node \(n\) i , the \(q\) vectors of all nodes connected to node \(n\) i are concatenated into a large matrix, which is called the query matrix \(Q\); the \(k\) vectors of all nodes connected to the target node \(n\) i are concatenated into a large matrix, which is called the key matrix \(K\); the \(v\) vectors of all nodes connected to node \(n\) i are concatenated into a large matrix, which is called the value matrix \(V\). Then, multiply the query vector \(q\) of this node i by the key matrix \(K\), and process the obtained values through softmax so that their sum is 1. After obtaining the weights, multiply the weights by their corresponding node value vectors \(v\) respectively, and finally sum these weighted value vectors to obtain the encoding vector of the target node \(n\) i . Similarly, perform the same operation on other nodes in the graph structure trajectory data \(T\) g , and all outputs of all nodes after graph-attention can be obtained. The formulaic expression of this process is as follows:

[0132] \(Q\) i = Linear q (\(h\) i ) = \(h\) i \(W\) Q

[0133] \(K\) i = Linear k (\(h\) i ) = \(h\) i \(W\) K

[0134] \(V\) i = Linear v (\(h\) i ) = \(h\) i \(W\) V

[0135]

[0136] To achieve the stability of numerical calculation, the numerical output range of the exponential operation inside softmax is limited to (-5, 5).

[0137] After obtaining the output of the attention operation the model then inputs it into a feed-forward network, performing non-linear mapping, residual connection, and batch normalization operations on it. Its formal representation is as follows:

[0138]

[0139]

[0140]

[0141] After the P-layer processes based on the encoding layer, the model obtains the hidden state vectors of all nodes in N, that is Subsequently, a mean operation is performed on the obtained hidden state vectors of all nodes to obtain the graph structure trajectory data T g of the final trajectory representation vector. The trajectory representation vector e of the original action trajectory T is obtained through the following equation:

[0142]

[0143] The output of the trajectory encoding model based on the graph structure is the representation vector of the input trajectory data, and these representation vectors can be used for the calculation work of trajectory similarity.

[0144] In this embodiment, through the above process of determining the trajectory representation vector, it is realized that in the process of encoding the representation vector of each node, more representative nodes are selectively involved, while avoiding involving all other nodes. In this way, the method enables the flow of information between nodes during the encoding process. When encoding the features of a node, the feature information between nodes that are far apart in terms of spatial distance can also be used by it. While completing the fusion task of spatial structure information and sequence structure information, it solves the problem of excessive GPU memory occupation faced by traditional Transformers when encoding long sequences.

[0145] S14. Perform similarity metric learning based on the trajectory representation vector to obtain trajectory similarity.

[0146] That is, input the obtained trajectory representation vector into a metric learning framework to complete specific similarity metric learning to obtain trajectory similarity.

[0147] S15. Predict the overlap degree of different moving target action trajectories in the spatio-temporal dimension based on the trajectory similarity.

[0148] In specific implementation, according to the trajectory similarity, the overlap degree of the action trajectories of different moving targets in the spatio-temporal dimension can be predicted. The predicted overlap degree of the action trajectories in the spatio-temporal dimension can be applied to epidemic prevention and control management to screen suspicious patients; it can also be applied to traffic control to conduct real-time traffic regulation, etc. Of course, the moving target long-trajectory prediction method provided in the first embodiment is not limited to the application scenarios of epidemic prevention and control and traffic regulation.

[0149] For example, applying the moving target long-trajectory prediction method provided in the first embodiment above Figure 1 to the epidemic prevention and control scenario, the flow schematic diagram of the moving target long-trajectory prediction method in the second embodiment obtained is as Figure 2 shown in, and includes:

[0150] S21. Obtain the action trajectory data sets of different moving targets, where the action trajectory data sets include the first behavior trajectories of confirmed patients and the second behavior trajectories of non-confirmed patients;

[0151] S22. Convert the action trajectory data sets into graph structure data;

[0152] S23. Encode the graph structure data into trajectory representation vectors;

[0153] S24. Perform similarity metric learning based on the trajectory representation vectors to obtain the trajectory similarity between the first behavior trajectories and the second behavior trajectories;

[0154] S25. Predict the overlap degree of the action trajectories of non-confirmed patients and confirmed patients in the spatio-temporal dimension according to the trajectory similarity.

[0155] The specific step technical solutions of the above steps and each process of the first embodiment are the same, and will not be elaborated here again in this embodiment.

[0156] In addition, applying the moving target long-trajectory prediction method provided in the first embodiment above Figure 1 to the traffic control scenario, the flow schematic diagram of the moving target long-trajectory prediction method in the third embodiment obtained is as Figure 3 shown in, and includes:

[0157] S31. Obtain the action trajectory data sets of different moving targets, where the moving targets are moving vehicles;

[0158] S32. Convert the action trajectory data sets into graph structure data;

[0159] S33. Encode the graph structure data into trajectory representation vectors;

[0160] S34. Perform similarity metric learning based on the trajectory representation vectors to obtain trajectory similarity;

[0161] S35. Predict the overlap degree of the action trajectories of different moving targets in the spatio-temporal dimension based on the trajectory similarity;

[0162] Perform traffic control based on the overlap.

[0163] In summary, the long-trajectory prediction method for moving targets provided by the present invention obtains the action trajectory datasets of different moving targets; converts the action trajectory datasets into graph-structured data; encodes the graph-structured data into trajectory representation vectors; performs similarity metric learning based on the trajectory representation vectors to obtain trajectory similarity; predicts the overlap degree of the action trajectories of different moving targets in the spatio-temporal dimension based on the trajectory similarity. This method solves the problem of low prediction accuracy of existing representation learning-based algorithms in long-trajectory prediction, and at the same time reduces the consumption of GPU memory.

[0164] Refer to Figure 4 , Figure 4 shows a long-trajectory prediction device 400 for moving targets. Using the above long-trajectory prediction method for moving targets, it at least includes:

[0165] An acquisition module 401, configured to acquire the action trajectory datasets of different moving targets;

[0166] A graph structure model construction module 402, configured to convert the action trajectory datasets into graph-structured data;

[0167] A trajectory similarity determination module 403, encoding the graph-structured data into trajectory representation vectors, and configured to perform similarity metric learning based on the trajectory representation vectors to obtain trajectory similarity;

[0168] A prediction module 404, configured to predict the overlap degree of the action trajectories of different moving targets in the spatio-temporal dimension based on the trajectory similarity.

[0169] In summary, the long-trajectory prediction device 400 for moving targets provided in this embodiment, when the long-trajectory prediction method for moving targets is applied to personal terminals and host computer terminal devices, can be implemented through the long-trajectory prediction method for moving targets as shown in Figure 1 . The long-trajectory prediction device 400 for moving targets provided in the embodiments of the present application can implement each process implemented by the above long-trajectory prediction method for moving targets.

[0170] The long-trajectory prediction device 400 for moving targets provided in this embodiment solves the problem of low prediction accuracy of existing representation learning-based algorithms in long-trajectory prediction, and at the same time reduces the consumption of GPU memory.

[0171] It should be understood that the descriptions of the long-trajectory prediction method for moving targets are equally applicable to the long-trajectory prediction 400 of moving targets according to the embodiments of the present application. To avoid repetition, they will not be described in detail here.

[0172] In addition, it should be understood that in the long-trajectory prediction device 400 of moving targets according to the embodiments of the present application, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, the long-trajectory prediction device 400 of moving targets can be divided into functional modules different from the above-exemplified modules to complete all or part of the functions described above.

[0173] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

[0174] As Figure 5 shown in the figure, an embodiment of the present application further provides an electronic device 500, including a processor 501, a memory 502, a program or instruction stored on the memory 502 and executable on the processor 501. When the program or instruction is executed by the processor 501, the steps of the above long-trajectory prediction method for moving targets are implemented, and the same technical effects can be achieved.

[0175] An embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the above long-trajectory prediction method for moving targets are implemented, and the same technical effects can be achieved.

[0176] Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0177] It should be noted that, in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or device comprising that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0178] From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.

[0179] The embodiments of the present application have been described above with reference to the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Those of ordinary skill in the art, under the inspiration of the present application and without departing from the purpose of the present application and the scope protected by the claims, can still make many forms, all of which fall within the protection scope of the present application.

Claims

1. A long - trajectory prediction method for moving targets, which is applied to the epidemic prevention and control scenario, characterized in that, it includes: Obtain the action trajectory datasets of different moving targets, where the action trajectory datasets include the first behavior trajectories of confirmed patients and the second behavior trajectories of non - confirmed patients; Based on the quadtree structure, convert the action trajectory datasets into graph - structured data, including: Count all the trajectory position points in the action trajectory datasets, and determine the first trajectory distribution area in the datasets; Recursively divide the first trajectory distribution area into four sub - trajectory distribution areas equally. Each time, divide each obtained sub - trajectory distribution area into four sub - trajectory distribution areas with equal sizes until the number of trajectory position points contained in the smallest sub - trajectory distribution area does not exceed the preset position number threshold, and construct the spatial hierarchical structure of the graph - structured model of the action trajectory datasets; Generate the trajectory position features, trajectory distribution area features, and spatial hierarchical structure features of the graph - structured model of the action trajectory datasets; Encode the graph - structured data into a trajectory representation vector, including: Perform pre - training on spatial structure encoding according to the tree - shaped structure of the graph - structured model of the action trajectory datasets to obtain the spatial encoding representations of each node in the tree - shaped structure; Add the trajectory position features, the trajectory distribution area features, and the spatial hierarchical structure features to the spatial encoding representations of each node to form the input feature vector of each node; For each node, take it as the target node, and use the graph - attention encoding layer to perform the encoding operation to obtain the output encoding vector of the target node, including: Use the mapping matrix W Q , W K , W V Perform linear transformations on the input feature vectors respectively to obtain the query vector q, key vector k, and value vector v of the target node; For the target node, collect all the nodes directly connected to it to form an adjacent node set; Concatenate the query vectors q, key vectors k, and value vectors v of all adjacent nodes into a query matrix Q, a key - value matrix K, and a value matrix V respectively; Calculate the similarity using the query vector of the target node and the key - value matrix; Perform Softmax normalization on the similarity to obtain a weight vector; Multiply the weight vector by the value matrix and sum to obtain the output encoding vector of the target node; After being processed by the graph - attention encoding layer, summarize the output encoding vectors of all nodes to form the final trajectory representation vector; Perform similarity metric learning based on the trajectory representation vector to obtain the trajectory similarity between the first behavior trajectory and the second behavior trajectory; Predict the overlap degree of the action trajectories of non - confirmed patients and confirmed patients in the spatio - temporal dimension based on the trajectory similarity.

2. The method according to claim 1, characterized in that, When converting the action trajectory datasets into graph - structured data, it further includes: Construct the target nodes of the graph - structured model of the action trajectory datasets, including: Obtain each original action trajectory in the action trajectory datasets; Generate the first nodes corresponding to all the trajectory points in each original action trajectory, and each of the first nodes contains all the information of a trajectory point in the original action trajectory; Obtain the second nodes from the spatial hierarchical structure; Obtain the target nodes of the graph structure model of the action trajectory dataset based on the first node and the second node.

3. The method according to claim 2, wherein, Converting the action trajectory dataset into graph structure data further includes: Construct the edge connection relationship of the graph structure model of the action trajectory dataset, including: Construct cross-layer edges between nodes at different levels in the spatial hierarchical structure; Construct intra-layer edges between nodes at the same level in the spatial hierarchical structure; Based on the cross-layer edges and the intra-layer edges, obtain the edge connection relationship of the graph structure model of the action trajectory dataset.

4. The method according to claim 2, wherein, Generating the trajectory position features of the graph structure model of the action trajectory dataset includes: Use the longitude and latitude coordinates of the corresponding trajectory position points in the original action trajectory as the first original position features of the first node; Use the coordinates of the spatial region corresponding to the second node in the spatial hierarchical structure as the second original position features of the second node, Generate the trajectory position features using the first original position features and the second original position features.

5. A long-trajectory prediction method for moving targets, applied to traffic control scenarios, wherein, includes: Obtain the action trajectory datasets of different moving targets, where the moving targets are moving vehicles; Based on the quadtree structure, convert the action trajectory dataset into graph structure data, including: Count all the trajectory position points in the action trajectory dataset and determine the first trajectory distribution area in the dataset; Recursively divide the first trajectory distribution area into four sub-trajectory distribution areas equally, and each obtained sub-trajectory distribution area is divided into four sub-trajectory distribution areas of equal size again until the number of trajectory position points contained in the smallest sub-trajectory distribution area does not exceed the preset position number threshold, and construct the spatial hierarchical structure of the graph structure model of the action trajectory dataset; Generate the trajectory position features, trajectory distribution area features, and spatial hierarchical structure features of the graph structure model of the action trajectory dataset; Encode the graph structure data into a trajectory representation vector, including: Perform pre-training on spatial structure encoding according to the tree structure of the graph structure model of the action trajectory dataset to obtain the spatial encoding representations of each node in the tree structure; Add the trajectory position features, the trajectory distribution area features, and the spatial hierarchical structure features to the spatial encoding representations of each node to form the input feature vector of each node; For each node, use it as the target node and perform encoding operations using the graph-attention encoding layer to obtain the output encoding vector of the target node, including: Use the mapping matrix W Q , W K , W V Perform linear transformations on the input feature vectors respectively to obtain the query vector q, key vector k, and value vector v of the target node; For the target node, collect all the nodes directly connected to it to form an adjacent node set; Concatenate the query vectors q, key vectors k, and value vectors v of all adjacent nodes into a query matrix Q, a key-value matrix K, and a numerical matrix V respectively; Calculate the similarity using the query vector of the target node and the key-value matrix: Perform Softmax normalization on the similarity to obtain the weight vector; Multiply the weight vector by the numerical matrix and sum to obtain the output encoding vector of the target node; After being processed by the graph-attention encoding layer, aggregate the output encoding vectors of all nodes to form the final trajectory representation vector; Perform similarity metric learning based on the trajectory representation vector to obtain the trajectory similarity; Predict the overlap degree of different moving target action trajectories in the spatio-temporal dimension based on the trajectory similarity; Perform traffic control based on the overlap degree.

6. The method according to claim 5, wherein, Converting the action trajectory dataset into graph-structured data further includes: Constructing the target nodes of the graph-structured model of the action trajectory dataset, including: Obtain each original action trajectory in the action trajectory dataset; Generate first nodes corresponding to all trajectory points in each original action trajectory, and each first node contains all information of a trajectory point in the original action trajectory; Obtain second nodes from the spatial hierarchical structure; Obtain the target nodes of the graph-structured model of the action trajectory dataset based on the first nodes and the second nodes.

7. The method according to claim 6, wherein, Converting the action trajectory dataset into graph-structured data further includes: Constructing the edge connection relationship of the graph-structured model of the action trajectory dataset, including: Construct cross-layer edges between nodes at different levels in the spatial hierarchical structure; Construct intra-layer edges between nodes at the same level in the spatial hierarchical structure; Obtain the edge connection relationship of the graph-structured model of the action trajectory dataset based on the cross-layer edges and the intra-layer edges.

8. The method according to claim 6, wherein, Generating the trajectory position feature of the graph-structured model of the action trajectory dataset includes: Using the longitude and latitude coordinates of the corresponding trajectory position points in the original action trajectory as the first original position feature of the first node; Using the coordinates of the spatial region corresponding to the second node in the spatial hierarchical structure as the second original position feature of the second node, Generate the trajectory position feature using the first original position feature and the second original position feature.

9. A mobile target long trajectory prediction device, wherein, Adopting the mobile target long trajectory prediction method according to any one of claims 1-8, at least including: An acquisition module for acquiring action trajectory datasets of different moving targets; A graph-structured model construction module for converting the action trajectory dataset into graph-structured data based on a quadtree structure, including: Count all trajectory position points in the action trajectory dataset and determine the first trajectory distribution area in the dataset; Recursively divide the first trajectory distribution area into four sub-trajectory distribution areas, and each obtained sub-trajectory distribution area is divided into four sub-trajectory distribution areas of equal size each time until the number of trajectory position points contained in the smallest sub-trajectory distribution area does not exceed a preset position number threshold, and construct the spatial hierarchical structure of the graph-structured model of the action trajectory dataset; Generate the trajectory position features, trajectory distribution area features, and spatial hierarchical structure features of the graph structure model for the action trajectory dataset; A trajectory similarity determination module that encodes the graph structure data into a trajectory representation vector, and is used to perform similarity metric learning based on the trajectory representation vector to obtain trajectory similarity; among them, encoding the graph structure data into a trajectory representation vector includes: Performing pre-training on spatial structure encoding according to the tree structure of the graph structure model of the action trajectory dataset to obtain the spatial encoding representations of each node in the tree structure; Adding the trajectory position features, the trajectory distribution area features, and the spatial hierarchical structure features to the spatial encoding representations of each node to form the input feature vector of each node; For each node, taking it as the target node, performing an encoding operation using a graph-attention encoding layer to obtain the output encoding vector of the target node, including: Use the mapping matrix W Q , W K , W V Perform linear transformations on the input feature vectors respectively to obtain the query vector q, key vector k, and value vector v of the target node; For the target node, collect all the nodes directly connected to it to form an adjacent node set; Concatenate the query vectors q, key vectors k, and value vectors v of all adjacent nodes into a query matrix Q, a key-value matrix K, and a value matrix V respectively; Calculate the similarity using the query vector of the target node and the key-value matrix: Perform Softmax normalization on the similarity to obtain a weight vector; Multiply the weight vector by the value matrix and sum to obtain the output encoding vector of the target node; After being processed by the graph-attention encoding layer, summarize the output encoding vectors of all nodes to form the final trajectory representation vector; A prediction module for predicting the overlap degree of different moving target action trajectories in the spatio-temporal dimension based on the trajectory similarity.

Citation Information

Patent Citations

  • Clustering method for interest point tracks under multiple temporal and spatial characteristic fusion

    CN104657424A

  • Method for realizing trajectory data release k-anonymity based on point density segmentation trajectory

    CN112818402A