User track recovery method and device based on graph structure

By constructing a user trajectory recovery model based on graph structure, using marginal vector graph structure and interest position points, the problem of low user trajectory recovery accuracy in the prior art is solved, and higher trajectory prediction accuracy and applicable scenarios are achieved.

CN119397164APending Publication Date: 2025-02-07CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411408462.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing user trajectory recovery methods are unable to accurately capture and learn user trajectory data due to the sparseness of user trajectory locations and the arbitrary user movement trends, resulting in a reduction in recovery accuracy.

Method used

Using a graph structure-based method, by constructing a marginal vector graph structure, combining interest position points and historical trajectory data, using the graph structure-based trajectory feature extraction module and historical trajectory transfer learning module, the user position point prediction model is constructed to perform cross entropy loss. Optimization training of function values ​​predicts the missing position points of the user.

Benefits of technology

Through the graph structure method, the nodes of the user's location of interest can be better inserted, the possible movement direction of the user can be judged, and the characterization ability and prediction accuracy of the user trajectory are improved. It is suitable for user trajectory recovery at high sparse user information and different distances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119397164A_ABST
    Figure CN119397164A_ABST
Patent Text Reader

Abstract

The invention relates to a user track recovery method and device based on a graph structure, and belongs to the field of data processing. Comprising the steps of obtaining historical track data of a user; selecting an interest position point of the user; constructing a marginal vector diagram structure; constructing a user position point prediction model; taking the cross entropy loss function value smaller than a preset cross entropy loss function value as a target, taking the marginal vector diagram structure as a training set to train a user position point prediction model, and outputting a user prediction position point, namely a corresponding missing position point in the marginal vector diagram structure; constructing a to-be-predicted marginal vector diagram structure; inputting the to-be-predicted marginal vector diagram structure into the trained user position point prediction model, and outputting a prediction missing position point corresponding to the to-be-predicted trajectory data set; and combining the prediction missing position point with the to-be-predicted trajectory data set to obtain a user recovery trajectory. The application scene of user track recovery is increased, and the user track recovery precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing, and in particular relates to a user trajectory recovery method and device based on a graph structure. Background Art

[0002] With the continuous development and improvement of emerging technologies such as big data, cloud computing, and the Internet of Things, more and more extensive location information is being collected. User location information is of great value to many fields such as traffic flow prediction, personalized location recommendation, and urban planning and construction. However, due to the limitations of positioning technology and the user's own acquisition of location-sensitive information, the user location trajectory collected by the device is usually discontinuous. Therefore, the recovery of the missing trajectory position based on the existing location information is of great research value for various location applications.

[0003] Among the current technologies related to trajectory recovery, one method is to use traditional smoothing filters such as Kalman filtering to infer the user's next location based on the position movement state information. However, in long-distance scenarios, the randomness of user movement makes this method unfeasible. Another method is to predict the location trajectory in a time series manner based on neural networks such as LSTM. However, judging only based on historical movement trajectory information is obviously incomplete, and the user's trajectory location information is usually highly sparse. In highly sparse scenarios, time series features cannot be well learned.

[0004] In summary, the current user trajectory recovery methods are limited by the sparsity of user trajectory locations and the randomness of user movement trends, which leads to the inability to accurately capture and learn user trajectory data, reducing the accuracy of user trajectory recovery. Summary of the invention

[0005] In view of the above shortcomings of the prior art, the purpose of the invention is to provide a user trajectory recovery method and device based on a graph structure, in which the user's missing position can refer to the user's mobile interest location information, the global time series information of the trajectory graph structure, and the reference information of the historical trajectory points, thereby obtaining a trajectory recovery result that is closer to the user's actual movement.

[0006] In a first aspect of the present invention, a user trajectory recovery method based on a graph structure is proposed, the method comprising:

[0007] S1, obtaining historical trajectory data of the user, wherein the historical trajectory data includes known location points and missing location points whose locations are known;

[0008] S2, select the user's interested location points based on historical trajectory data;

[0009] S3, constructing a marginal vector graph structure with historical trajectory data and interest location points, wherein the interest location points and the missing location points are unidirectionally connected, and each point in the historical trajectory data is bidirectionally connected;

[0010] S4, constructing a user location prediction model having an input module, a trajectory feature extraction module based on a graph structure, a historical trajectory transfer learning module and an output module connected in sequence, wherein the trajectory feature extraction module based on a graph structure comprises a trajectory coordinate encoding layer based on a graph structure, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the trajectory coordinate encoding layer based on a graph structure and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer;

[0011] S5, with the cross entropy loss function value being less than a preset cross entropy loss function value, the marginal vector graph structure is used as a training set to train the user position point prediction model, and the user predicted position point is output, that is, the missing position point corresponding to the marginal vector graph structure;

[0012] S6, constructing a to-be-predicted marginal vector graph structure of the to-be-predicted trajectory data group and the corresponding interest point positions;

[0013] S7, inputting the to-be-predicted marginal vector graph structure into the trained user position point prediction model, and outputting the predicted missing position points corresponding to the to-be-predicted trajectory data group;

[0014] S8, combining the predicted missing position points with the trajectory data group to be predicted to obtain the user recovery trajectory.

[0015] A second aspect of the present invention provides a user trajectory recovery device based on a graph structure, which is used to implement any one of the user trajectory recovery methods based on a graph structure in the first aspect, and the device includes:

[0016] An acquisition module, used to acquire historical trajectory data of a user, wherein the historical trajectory data includes known location points and missing location points whose locations are known;

[0017] A selection module is used to select user's interested locations based on historical trajectory data;

[0018] A first construction module is used to construct a marginal vector graph structure with historical trajectory data and interest location points, wherein the interest location points and the missing location points are unidirectionally connected, and each point in the historical trajectory data is bidirectionally connected;

[0019] A second construction module is used to construct a user location prediction model having an input module, a trajectory feature extraction module based on a graph structure, a historical trajectory transfer learning module and an output module connected in sequence, wherein the trajectory feature extraction module based on a graph structure includes a trajectory coordinate encoding layer based on a graph structure, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the trajectory coordinate encoding layer based on a graph structure and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer;

[0020] A training module is used to train the user position point prediction model by taking the cross entropy loss function value less than the preset cross entropy loss function value as the target, using the marginal vector graph structure as a training set, and outputting the user predicted position point, that is, the missing position point corresponding to the marginal vector graph structure;

[0021] The third construction module is used to construct a to-be-predicted marginal vector graph structure of the to-be-predicted trajectory data group and the position of the interest point;

[0022] An input module, used for inputting the edge vector graph structure to be predicted into the trained user position point prediction model, and outputting the predicted missing position points of the trajectory data group to be predicted;

[0023] The combination module is used to combine the predicted missing position points with the trajectory data group to be predicted to obtain the user recovery trajectory.

[0024] The beneficial effects of the present invention are as follows:

[0025] In an embodiment of the present invention, a graph structure is used to replace the time series to define the user trajectory, and various related information that affects the movement of the user trajectory is comprehensively considered. Under this graph structure, the user's interested position node can be well inserted to determine the user's possible movement direction, thereby greatly enhancing the representation ability of the user trajectory, so as to better learn and predict the user's movement trend and improve the prediction accuracy of the user trajectory. On the other hand, the present invention constructs a user location point prediction model with a trajectory feature extraction module based on a graph structure and a historical trajectory transfer learning module, wherein the trajectory feature extraction module based on the graph structure includes a trajectory coordinate encoding layer based on a graph structure, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the trajectory coordinate encoding layer based on the graph structure and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer, and the graph structure data is continuously temporally encoded and feature extracted by using the model, and the historical trajectory reflecting the user's movement habits is transferred and learned to obtain more information about the user, and the user's movement trend can be well learned and predicted even under highly sparse user information and user trajectories at different distances, further increasing the user trajectory prediction accuracy and improving the applicable scenarios of user trajectory recovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0027] Figure 1 It is a flowchart of a user trajectory recovery method based on a graph structure provided by an embodiment of the present invention;

[0028] Figure 2 is a structural schematic diagram of a marginal vector graph structure provided by an embodiment of the present invention;

[0029] Figure 3 is a structural schematic diagram of a trajectory feature extraction module based on a graph structure provided by an embodiment of the present invention;

[0030] Figure 4 is a structural diagram of a historical trajectory transfer learning module provided by an embodiment of the present invention;

[0031] Figure 5 is a structural schematic diagram of a user location prediction model provided by an embodiment of the present invention;

[0032] Figure 6 It is a structural schematic diagram of a user trajectory recovery device based on a graph structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.

[0034] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.

[0035] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0036] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.

[0037] The present invention proposes a user trajectory recovery method and device based on a graph structure to solve the problems that the existing user trajectory recovery method is limited by the sparsity of user trajectory positions and the randomness of user movement trends, which leads to the inability to accurately capture and learn user trajectory data and reduces the accuracy of user trajectory recovery.

[0038] Method Embodiment

[0039] Reference Figure 1 , which shows a flow chart of a user trajectory recovery method based on a graph structure provided by an embodiment of the present invention.

[0040] An embodiment of the present invention provides a method for recovering user trajectories based on a graph structure, the method comprising:

[0041] Specifically, the method includes steps S1 to S8.

[0042] S1, obtain the user's historical trajectory data.

[0043] The historical trajectory data includes known location points and missing location points whose locations are known.

[0044] Among them, user historical trajectory data refers to the location information record of the user in the past period of time, and these trajectory data are usually composed of multiple location points in a time series.

[0045] S2, select the user's interested location points based on historical trajectory data.

[0046] Among them, points of interest refer to places that users frequently visit or show special interest in in their historical trajectory. These points of interest can usually be identified by factors such as the user's stay time and number of visits, reflecting the user's preferences or important behavior locations in a specific area. By focusing on high-value points that users frequently visit, we can more accurately reflect the user's behavioral preferences and habits and achieve more precise route planning.

[0047] In a possible implementation, the interest locations include high-frequency locations with access frequencies greater than a preset access frequency and special points, wherein the special points include base station locations based on a positioning system and road intersection locations.

[0048] It should be noted that the advantage of this type of interest location point is that by selecting high-frequency location points and special points, it can more accurately capture the user's regular activities and key paths, improve the accuracy of trajectory prediction, and reduce unnecessary data processing.

[0049] It should be noted that those skilled in the art can set the size of the preset access frequency according to actual needs, and the present invention does not limit this herein.

[0050] Refer to the instruction manual Figure 2 , showing a structural schematic diagram of a marginal vector graph structure provided by an embodiment of the present invention.

[0051] Figure 2 A graph structure is used to construct the movement trajectory from p1 to p4, where p1, p2, p3, and p4 are known coordinates, and missing coordinates are represented by NULL. Interest positions are constructed for missing coordinates, that is, interest position point connections. When graph neural networks are used to extract features later, point position features between trajectories can be used with each other, and missing points can additionally obtain interest point position features to increase trajectory prediction accuracy.

[0052] S3, constructs a marginal vector graph structure with historical trajectory data and interest location points.

[0053] Among them, the interest location points and the missing location points are unidirectionally connected, and each point in the historical trajectory data is bidirectionally connected.

[0054] Among them, the marginal vector graph structure is a representation method based on graph theory. It takes the user's historical trajectory and interest points as nodes, and uses vectors to represent the relationship between nodes. The marginal vector graph contains the connection weights and direction information between nodes to capture the complex relationships in the trajectory. It can effectively capture the complex relationship between various location points in the user's trajectory, including the connection between interest points and missing points. Through this graph structure, the system can understand the user's trajectory more comprehensively and accurately.

[0055] Refer to the instruction manual Figure 3 , shows a structural schematic diagram of a trajectory feature extraction module based on a graph structure provided in an embodiment of the present invention.

[0056] Figure 3 The example of the specific model used for feature extraction is shown in Figure 1, which uses GCN and Max Pooling to extract such graph structure information and time series information features. GCN can effectively capture the complex relationship between nodes and their neighbors and extract global graph structure features, while Max Pooling reduces information redundancy by retaining the most significant features, improving the computational efficiency and generalization ability of the model, thereby improving the accuracy and robustness of trajectory prediction.

[0057] Refer to the instruction manual Figure 4 , which shows a schematic diagram of the structure of a historical trajectory transfer learning module provided by an embodiment of the present invention.

[0058] Figure 4 The historical trajectory in refers to the selected reference trajectory, and the current trajectory is the target trajectory that needs to be restored. The historical trajectory transfer learning module uses the multi-head attention mechanism to associate the query vector (Q) of the current trajectory with the key (K) and value (V) of the historical trajectory, and calculates the correlation weight between the two, thereby extracting the key information in the reference historical trajectory and helping to predict the missing position points of the current trajectory. Its advantage is that it can efficiently capture the similarity and correlation between different trajectories and improve the prediction accuracy.

[0059] Refer to the instruction manual Figure 5 , shows a structural schematic diagram of a user location prediction model provided by an embodiment of the present invention.

[0060] Figure 5 In the , the historical trajectory transfer learning module extracts features of the historical trajectory and the current trajectory based on the graph structure, and then inputs them into the transfer learning layer for fusion, effectively utilizing the useful information in the historical trajectory, enhancing the model's understanding of the current trajectory, and improving the prediction accuracy.

[0061] S4, construct a user location prediction model with a sequentially connected input module, a graph-based trajectory feature extraction module, a historical trajectory transfer learning module and an output module.

[0062] The graph-based trajectory feature extraction module includes a graph-based trajectory coordinate encoding layer, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the graph-based trajectory coordinate encoding layer and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer.

[0063] Among them, the input module is the first part of the trajectory optimization model, which is responsible for receiving the user's historical trajectory data and marginal vector graph structure. The trajectory feature extraction module based on the graph structure is used to extract the spatial and temporal features of the trajectory from the graph structure to help the model better understand the complex patterns in the trajectory. The historical trajectory transfer learning module is a module that uses the user's known historical trajectory data for transfer learning. By transferring the knowledge in the historical trajectory to the prediction of the missing location points, the prediction accuracy is improved. The output module is the final part of the trajectory optimization model, which is used to output the user's predicted location points, that is, to restore the missing points in the trajectory.

[0064] Among them, the trajectory coordinate encoding layer is responsible for encoding the coordinates of the location points and generating numerical representations for model calculations. The temporal trajectory structure embedding layer is used to capture the temporal information in the trajectory. By embedding the temporal features into the graph structure, the model can better understand the temporal characteristics of the trajectory. The feature aggregation layer is responsible for integrating features at different levels (such as trajectory coordinates and temporal information) to generate an overall feature vector for further learning and prediction by the model.

[0065] It should be noted that the user location prediction model constructed can extract and integrate features from multiple dimensions of trajectory data such as space and time. Through the design of modules such as trajectory coordinate encoding and time series embedding, the model can more accurately capture the complex relationships in the trajectory and improve the prediction ability of missing location points. The transfer learning module further enhances the model's use of historical trajectory information, realizes full learning and efficient prediction of data, and provides a comprehensive and accurate solution for trajectory optimization.

[0066] In a possible implementation, S4 specifically includes:

[0067] S401, converting each edge vector graph structure into a graph structure with node aggregation features through a graph structure trajectory feature extraction module.

[0068] In a possible implementation, S401 specifically includes:

[0069] S401A, extracting the position point coordinate coding of each node in the marginal vector graph structure through the trajectory coordinate coding layer of the graph structure.

[0070] S401B, extracting the location point appearance time code of each node in the marginal vector graph structure and the marginal vector graph structure feature code with timing information through the temporal trajectory structure embedding layer.

[0071] In a possible implementation, the location point coordinate encoding is specifically:

[0072]

[0073] Among them, a ij represents the importance coefficient of the jth node relative to the ith node in the marginal vector graph structure, exp represents the exponential function, and W represent learnable parameters, LeakyReLU represents the Leaky ReLU activation function, || represents feature concatenation, represents the node feature of the i-th node, and They represent the jth node feature and the kth node feature connected to the i node, respectively. i represents the total number of nodes connected to node i, σ represents the activation function, Indicates the coordinate code of the i-th position point, e loc represents the set of coordinate encodings of the location points, and T represents transposition.

[0074] Among them, the importance coefficient of the jth node relative to the i-th node in the marginal vector graph structure can increase the attention mechanism between trajectory points while avoiding excessive influence of interest points on the predicted coordinate points.

[0075] The location point appearance time code is as follows:

[0076] e t (2i) = sin(t / 10000 2i / d )

[0077] e t (2i+1)=cos(t / 10000 2i / d )

[0078] e time =[e t (2i),e t (2i+1)]

[0079] Among them, t represents the time when the position point appears, d represents the total encoding dimension, sin and cos represent the sine function and cosine function respectively, and e t (2i) represents the time code of the location point with dimension 2i, e t (2i+1) indicates the encoding of the time when the position point with dimension 2i+1 appears, i indicates the i-th dimension in the total encoding dimension, e timeIndicates the set of codes for the time when the location point appears.

[0080] The structural feature encoding of the marginal vector graph with timing information is as follows:

[0081]

[0082] in, Indicates the time code of the start point in the marginal vector graph structure e start and the starting position and ending time codes e end The marginal vector graph structural feature encoding with temporal information, e graph Represents a set of marginal vector graph structural feature encodings with temporal information.

[0083] It should be noted that by encoding the timing information in the position point coordinates, appearance time and marginal vector graph structure respectively, a multi-level feature expression is generated. Through a multi-dimensional and multi-level encoding method, the space, time and timing information are fully integrated to enhance the model's ability to capture spatiotemporal dynamics and improve the accuracy and robustness of trajectory prediction.

[0084] S401C, using the feature aggregation layer to perform feature aggregation on the location point coordinate encoding, the location point appearance time encoding and the marginal vector graph structure feature encoding with timing information, and output node aggregation features and the graph structure of node aggregation features.

[0085] In a possible implementation, the node aggregation feature and the graph structure of the node aggregation feature are specifically:

[0086]

[0087] Among them, e pos represents the node aggregation feature set, G represents the graph structure of the node aggregation feature, represents the i-th node aggregation feature, i = 1, 2, ..., T', T' represents the total number of time sampling of the historical trajectory position points corresponding to the marginal vector graph structure.

[0088] It should be noted that by constructing the aggregate features of each node into a node aggregate feature set and representing it in the form of a graph structure, it is possible to better capture the mutual relationships and temporal dependencies between nodes, improve the overall structural expression ability of trajectory data, and thus improve the accuracy of trajectory prediction and the expressiveness of the model.

[0089] S402, introducing node aggregation features of reference historical trajectories that are all known position points into the target historical trajectory with missing position points through the historical trajectory transfer learning module, and outputting missing position point features.

[0090] In a possible implementation, S402 specifically includes:

[0091] S402A, calculating the feature association importance between the target historical trajectory and each reference historical trajectory:

[0092]

[0093] in, represents the feature correlation importance between the nth reference history trajectory at time k and the target history trajectory at time t, (h) represents a single calculation in the multi-head attention mechanism, <·, ·> represents the vector inner product operation, and Both represent learnable parameters, represents the target historical trajectory position encoding at time t, represents the position code of the nth reference historical trajectory at time k, represents the encoding position of the nth reference historical trajectory at time g, and T' represents the total number of time sampling of the historical trajectory position points corresponding to the marginal vector graph structure.

[0094] S402B, according to the feature association importance, the reference historical trajectory and the target historical trajectory are spliced ​​in a residual manner:

[0095]

[0096] in, represents the importance of feature association between the reference historical trajectory and the target historical trajectory, e t ′n Represents the location features of the reference historical trajectory extracted by the multi-head attention mechanism. Indicates the location point features in the target historical trajectory, shift n.t represents the reference information of the learned reference history trajectory relative to the target history trajectory, ReLU represents the ReLU activation function, and W V and W pos Both represent learnable parameters, e t ′n(H) Represents the output features of the Hth head of the multi-head attention mechanism.

[0097] S402C, combined with reference information, adds learnable parameters to learn the changing characteristics of multiple historical trajectories over time and calculates the features of missing location points:

[0098]

[0099] Among them, W s1 , W s2 , X T ' and C both represent learnable parameters, ft Indicates the missing location point feature, α n,t and I t Both represent intermediate variables, n represents the nth reference historical trajectory, and N-1 represents the total number of reference historical trajectories.

[0100] It should be noted that by calculating the feature correlation importance of the target historical trajectory and the reference historical trajectory, the multi-head attention mechanism is used to extract the feature information of the reference trajectory, and the two are spliced ​​in a residual manner, and finally the reference information and time-varying characteristics are combined to calculate the missing position point features. Its advantage is that the use of multi-head attention mechanism and residual connection can not only effectively capture the correlation between different historical trajectories, but also enhance the learning ability of the model in complex spatiotemporal environments and improve the prediction accuracy of missing position points.

[0101] S403: Based on the missing location point feature, calculate the normalized probability of the location point corresponding to the missing location point feature with respect to all known location points.

[0102] In a possible implementation, the normalized probability is calculated as follows:

[0103]

[0104] Among them, P t (l) represents the normalized probability of missing position point l at time t, L represents the total number of known position points in the historical trajectory, and e k Indicates the coordinate code of the kth position point, e l Indicates the position point corresponding to the missing position point feature, i.e., the lth position point.

[0105] It should be noted that by calculating the similarity between the missing location point and all known location points, a normalized probability distribution is generated to determine the possible specific location of the missing location point. The advantage is that all known location points are compared through normalized probability, ensuring that the model can reasonably allocate probabilities and give priority to more relevant known location points, thereby improving the accuracy and robustness of trajectory recovery.

[0106] S404: Output the location point corresponding to the highest normalized probability as the user predicted location point.

[0107] S405, calculating the cross entropy loss function value of the user's predicted position point.

[0108] In a possible implementation, the cross entropy loss function value is calculated as follows:

[0109]

[0110] Among them, loss represents the cross entropy loss function value, pt represents the probability of the user visiting all the locations to be determined at time t, T max Indicates the maximum number of moments to be predicted, y t represents the actual location of the user at time t, that is, the actual location of the user's predicted location, and log represents a logarithmic function.

[0111] It should be noted that by calculating the difference between the probability of a user visiting a location and the actual location to obtain the cross entropy loss function value, the accuracy of the model prediction can be accurately measured. Its advantage is that the prediction error is amplified by the logarithmic function, making the model more sensitive to wrong predictions, thereby accelerating the model convergence speed, improving the prediction performance and optimizing the efficiency of parameter adjustment.

[0112] S406, when the cross entropy loss function value is less than the preset cross entropy loss function value, end the training of the user location prediction model, otherwise, adjust the learnable parameters in the user location prediction model and return to step S401.

[0113] It should be noted that the use of graph structure aggregation features and transfer learning makes the prediction of missing location points more accurate and gradually optimizes the model performance. At the same time, the feedback mechanism ensures continuous improvement of the prediction model, effectively improving the prediction accuracy and model convergence.

[0114] S5, with the cross entropy loss function value being less than the preset cross entropy loss function value as the goal, the marginal vector graph structure is used as a training set to train the user position point prediction model, and the user predicted position point is output, that is, the missing position point corresponding to the marginal vector graph structure.

[0115] Among them, the cross entropy loss function value is a function used to evaluate the prediction accuracy of the model, ensuring the performance of the model in terms of accuracy and efficiency.

[0116] S6, constructing a to-be-predicted marginal vector graph structure of the to-be-predicted trajectory data group and the corresponding interest point positions.

[0117] Among them, the trajectory data group to be predicted refers to the trajectory information set that is not yet completed or contains missing data. The model needs to be used to predict and complete the missing position points in these data groups. The marginal vector graph structure to be predicted is a graph structure constructed based on the trajectory data group to be predicted and the position of the points of interest. It represents the position points in the trajectory and their mutual relationships. The graph structure represents the user's trajectory data in vector form, which is convenient for model understanding and processing.

[0118] It should be noted that by constructing a marginal vector graph structure of the trajectory data set to be predicted and the locations of the points of interest, the spatial and temporal characteristics of the user trajectory can be fully captured. This process enables the model to represent complex trajectory relationships in the form of a graph structure, improves the ability to predict missing data, ensures the accuracy and efficiency of trajectory completion, and can adapt to trajectory data in different scenarios, enhancing the generalization ability of the model.

[0119] S7, inputting the to-be-predicted marginal vector graph structure into the trained user position point prediction model, and outputting the predicted missing position points corresponding to the to-be-predicted trajectory data group.

[0120] Among them, the trained user location point prediction model is a trained and optimized model, which is used to predict the missing user location points based on the input trajectory data. During the training process, the model has learned to extract features from historical trajectory data and can predict missing location points in practical applications. The output of the predicted missing location points of the trajectory data group to be predicted is the final output result of the model, which indicates the specific location points of the user missing in the trajectory predicted by the model. By inputting the marginal vector graph structure to be predicted, the model can infer the part of the user trajectory that has not yet been recorded.

[0121] It should be noted that by inputting the marginal vector graph structure to be predicted into the trained model and outputting the missing position points in the trajectory, the model uses the previous learning results to accurately predict the missing points in the user trajectory, thereby completing the trajectory information.

[0122] S8, combining the predicted missing position points with the trajectory data group to be predicted to obtain the user recovery trajectory.

[0123] The trajectory data set to be predicted is a set of trajectory data of the user, which contains trajectory information of missing position points that need to be filled. The user recovery trajectory is a complete user trajectory generated by combining the predicted missing position points with the trajectory data set to be predicted.

[0124] The beneficial effects of the present invention are as follows:

[0125] In an embodiment of the present invention, a graph structure is used to replace the time series to define the user trajectory, and various related information that affects the movement of the user trajectory is comprehensively considered. Under this graph structure, the user's interested position node can be well inserted to determine the user's possible movement direction, thereby greatly enhancing the representation ability of the user trajectory, so as to better learn and predict the user's movement trend and improve the prediction accuracy of the user trajectory. On the other hand, the present invention constructs a user location point prediction model with a trajectory feature extraction module based on a graph structure and a historical trajectory transfer learning module, wherein the trajectory feature extraction module based on the graph structure includes a trajectory coordinate encoding layer based on the graph structure, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the trajectory coordinate encoding layer based on the graph structure and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer, and the graph structure data is continuously temporally encoded and feature extracted by using the model, and the historical trajectory reflecting the user's movement habits is transferred and learned to obtain more information about the user, and the user's movement trend can be well learned and predicted even under highly sparse user information and user trajectories at different distances, further increasing the user trajectory prediction accuracy and improving the applicable scenarios of user trajectory recovery.

[0126] Device Embodiment

[0127] Reference Manual Attached Figure 6 , showing a schematic structural diagram of a user trajectory recovery device based on a graph structure provided by an embodiment of the present invention.

[0128] Another specific embodiment of the present invention discloses a user trajectory recovery device based on a graph structure, which is used to implement a user trajectory recovery method based on a graph structure in any one of the method embodiments. The user trajectory recovery device 20 based on a graph structure includes:

[0129] The acquisition module 201 is used to acquire the historical trajectory data of the user, wherein the historical trajectory data includes known location points and missing location points whose locations are known.

[0130] The selection module 202 is used to select the user's interested location points according to the historical trajectory data.

[0131] The first construction module 203 is used to construct a marginal vector graph structure having historical trajectory data and interest points, wherein the interest points and the missing points are unidirectionally connected, and each point in the historical trajectory data is bidirectionally connected.

[0132] The second construction module 204 is used to construct a user location point prediction model having an input module, a trajectory feature extraction module based on a graph structure, a historical trajectory transfer learning module and an output module connected in sequence, wherein the trajectory feature extraction module based on a graph structure includes a trajectory coordinate encoding layer based on a graph structure, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the trajectory coordinate encoding layer based on a graph structure and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer.

[0133] The training module 205 trains the user position point prediction model by taking the cross entropy loss function value less than the preset cross entropy loss function value as the goal, and uses the marginal vector graph structure as a training set to output the user predicted position point, that is, the missing position point corresponding to the marginal vector graph structure.

[0134] The third construction module 206 is used to construct a to-be-predicted marginal vector graph structure of the to-be-predicted trajectory data set and the interest point positions.

[0135] The input module 207 is used to input the to-be-predicted marginal vector graph structure into the trained user position point prediction model, and output the predicted missing position points of the to-be-predicted trajectory data set.

[0136] The combining module 208 is used to combine the predicted missing position points with the trajectory data group to be predicted to obtain the user recovery trajectory.

[0137] The device provided in the embodiment of the present invention can implement each process and step in the above method embodiment, and can obtain the same or similar technical effects. To avoid repetition, the present invention will not go into details.

[0138] The beneficial effects of the present invention are as follows:

[0139] In an embodiment of the present invention, a graph structure is used to replace the time series to define the user trajectory, and various related information that affects the movement of the user trajectory is comprehensively considered. Under this graph structure, the user's interested position node can be well inserted to determine the user's possible movement direction, thereby greatly enhancing the representation ability of the user trajectory, so as to better learn and predict the user's movement trend and improve the prediction accuracy of the user trajectory. On the other hand, the present invention constructs a user location point prediction model with a trajectory feature extraction module based on a graph structure and a historical trajectory transfer learning module, wherein the trajectory feature extraction module based on the graph structure includes a trajectory coordinate encoding layer based on a graph structure, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the trajectory coordinate encoding layer based on the graph structure and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer, and the graph structure data is continuously temporally encoded and feature extracted by using the model, and the historical trajectory reflecting the user's movement habits is transferred and learned to obtain more information about the user, and the user's movement trend can be well learned and predicted even under highly sparse user information and user trajectories at different distances, further increasing the user trajectory prediction accuracy and improving the applicable scenarios of user trajectory recovery.

[0140] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.

[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.

Claims

1. A user trajectory recovery method based on graph structure, characterized in that: Methods include: S1, obtaining historical trajectory data of a user, wherein the historical trajectory data includes known location points and missing location points whose locations are known; S2, selecting a user's interested location point according to the historical trajectory data; S3, constructing a marginal vector graph structure having the historical trajectory data and the interest location point, wherein the interest location point and the missing location point are unidirectionally connected, and each point in the historical trajectory data is bidirectionally connected; S4, constructing a user location prediction model having an input module, a trajectory feature extraction module based on a graph structure, a historical trajectory transfer learning module and an output module connected in sequence, wherein the trajectory feature extraction module based on a graph structure comprises a trajectory coordinate encoding layer based on a graph structure, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the trajectory coordinate encoding layer based on a graph structure and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer; S5, with the cross entropy loss function value being less than a preset cross entropy loss function value, the marginal vector graph structure is used as a training set to train the user position point prediction model, and the user predicted position point is output, that is, the missing position point corresponding to the marginal vector graph structure; S6, constructing a to-be-predicted marginal vector graph structure of the to-be-predicted trajectory data group and the corresponding interest point positions; S7, inputting the to-be-predicted marginal vector graph structure into the trained user position point prediction model, and outputting the predicted missing position points corresponding to the to-be-predicted trajectory data group; S8, combining the predicted missing position points with the to-be-predicted trajectory data group to obtain a user recovery trajectory.

2. The user trajectory recovery method based on graph structure according to claim 1 is characterized in that: The interest points include high-frequency points and special points whose access frequency is greater than a preset access frequency, wherein the special points include base station points based on a positioning system and road intersection points.

3. The user trajectory recovery method based on graph structure according to claim 1, characterized in that: The S4 specifically includes: S401, converting each edge vector graph structure into a graph structure with node aggregation features through the trajectory feature extraction module of the graph structure; S402, introducing node aggregation features of reference historical trajectories that are all known position points into the target historical trajectory with the missing position point through the historical trajectory transfer learning module, and outputting missing position point features; S403, based on the missing location point feature, calculating the normalized probability of the location point corresponding to the missing location point feature with respect to all known location points; S404, outputting the position point corresponding to the highest normalized probability as the user predicted position point; S405, calculating the cross entropy loss function value of the user predicted position point; S406, when the cross entropy loss function value is less than the preset cross entropy loss function value, end the training of the user location point prediction model; otherwise, adjust the learnable parameters in the user location point prediction model and return to step S401.

4. The user trajectory recovery method based on graph structure according to claim 3 is characterized in that: The cross entropy loss function value is calculated as follows: Among them, loss represents the cross entropy loss function value, p t represents the probability of the user visiting all the locations to be determined at time t, T max Indicates the maximum number of moments to be predicted, y t represents the actual location of the user at time t, that is, the actual location of the user's predicted location, and log represents a logarithmic function.

5. The user trajectory recovery method based on graph structure according to claim 3 is characterized in that: The S401 specifically includes: S401A, extracting the position point coordinate code of each node in the edge vector graph structure through the trajectory coordinate coding layer of the graph structure; S401B, extracting the location point appearance time code of each node in the marginal vector graph structure and the marginal vector graph structure feature code with timing information through the temporal trajectory structure embedding layer; S401C, utilizing the feature aggregation layer to perform feature aggregation on the location point coordinate encoding, the location point appearance time encoding, and the marginal vector graph structure feature encoding with timing information, and output node aggregation features and a graph structure of the node aggregation features.

6. The method for recovering user trajectories based on a graph structure according to claim 5, characterized in that: The position point coordinate encoding is specifically: Among them, a ij represents the importance coefficient of the jth node relative to the ith node in the marginal vector graph structure, exp represents the exponential function, and W represent learnable parameters, LeakyReLU represents the Leaky ReLU activation function, || represents feature concatenation, represents the node feature of the i-th node, and They represent the jth node feature and the kth node feature connected to the i node, respectively. i represents the total number of nodes connected to node i, σ represents the activation function, Indicates the coordinate code of the i-th position point, e loc represents the set of location point coordinate encodings, and T represents transposition; The location point occurrence time code is specifically: it t (2i)=sin(t / 10000 2i / d ) And t (2i+1)=cos(t / 10000 2i / d ) And time =[and t (2i),and t (2i+1)] Among them, t represents the time when the position point appears, d represents the total encoding dimension, sin and cos represent the sine function and cosine function respectively, and e t (2i) represents the time code of the location point with dimension 2i, e t (2i+1) indicates the encoding of the time when the position point with dimension 2i+1 appears, i indicates the i-th dimension in the total encoding dimension, e time Indicates the code set of the time when the location point appears; The structural feature encoding of the marginal vector graph with timing information is specifically as follows: in, Indicates the time code of the start point in the marginal vector graph structure e start and the starting position and ending time codes e end The marginal vector graph structural feature encoding with temporal information, e graph Represents a set of marginal vector graph structural feature encodings with temporal information.

7. The method for recovering user trajectories based on a graph structure according to claim 5, characterized in that: The node aggregation feature and the graph structure of the node aggregation feature are specifically: it is pos =e loc On time On graph Among them, e pos represents the node aggregation feature set, G represents the graph structure of the node aggregation feature, represents the i-th node aggregation feature, i = 1, 2, L, T', T' represents the total number of time sampling of the historical trajectory position points corresponding to the marginal vector graph structure.

8. The method for recovering user trajectories based on a graph structure according to claim 3, characterized in that: The S402 specifically includes: S402A, calculating the feature association importance between the target historical trajectory and each reference historical trajectory: in, represents the feature correlation importance between the nth reference history trajectory at time k and the target history trajectory at time t, (h) represents a single calculation in the multi-head attention mechanism, <·, ·> represents the vector inner product operation, and Both represent learnable parameters, represents the target historical trajectory position encoding at time t, represents the position code of the nth reference historical trajectory at time k, represents the encoding position of the nth reference historical trajectory at time g, and T' represents the total number of time sampling of the historical trajectory position points corresponding to the marginal vector graph structure; S402B, splicing the reference historical trajectory and the target historical trajectory in a residual manner according to the feature association importance: in, represents the importance of feature association between the reference historical trajectory and the target historical trajectory, Represents the location features of the reference historical trajectory extracted by the multi-head attention mechanism. Indicates the location point features in the target historical trajectory, shift n.t represents the reference information of the learned reference history trajectory relative to the target history trajectory, ReLU represents the ReLU activation function, and W V and W pos Both represent learnable parameters, represents the output feature of the Hth head of the multi-head attention mechanism, S402C, combining the reference information, adding learnable parameters to learn the changing characteristics of multiple historical trajectories over time, and calculating the missing location point features: Among them, W s1 , W s2 , X T ' and C both represent learnable parameters, f t Indicates the missing location point feature, α n,t and I t Both represent intermediate variables, n represents the nth reference historical trajectory, and N-1 represents the total number of reference historical trajectories.

9. The method for recovering user trajectories based on a graph structure according to claim 3, characterized in that: The normalized probability is calculated as follows: Among them, P t (l) represents the normalized probability of missing position point l at time t, L represents the total number of known position points in the historical trajectory, and e k Indicates the coordinate code of the kth position point, e l Indicates the position point corresponding to the missing position point feature, i.e., the lth position point.

10. A user trajectory recovery device based on a graph structure, characterized in that: The device includes: An acquisition module, used to acquire historical trajectory data of a user, wherein the historical trajectory data includes known location points and missing location points whose locations are known; A selection module, used to select a user's interested location point according to the historical trajectory data; A first construction module is used to construct a marginal vector graph structure having the historical trajectory data and the interest location point, wherein the interest location point and the missing location point are unidirectionally connected, and each point in the historical trajectory data is bidirectionally connected; A second construction module is used to construct a user location prediction model having an input module, a trajectory feature extraction module based on a graph structure, a historical trajectory transfer learning module and an output module connected in sequence, wherein the trajectory feature extraction module based on a graph structure comprises a trajectory coordinate encoding layer based on a graph structure, a temporal trajectory structure embedding layer and a feature aggregation layer, wherein the trajectory coordinate encoding layer based on a graph structure and the temporal trajectory structure embedding layer are both connected to the feature aggregation layer; A training module, used for training the user position point prediction model by taking the cross entropy loss function value as a target and taking the marginal vector graph structure as a training set, and outputting the user predicted position point, i.e., the missing position point corresponding to the marginal vector graph structure; A third construction module is used to construct a to-be-predicted trajectory data group and a to-be-predicted marginal vector graph structure of the position of the interest point; An input module, used for inputting the to-be-predicted marginal vector graph structure into the trained user position point prediction model, and outputting the predicted missing position points of the to-be-predicted trajectory data group; The combination module is used to combine the predicted missing position points with the to-be-predicted trajectory data group to obtain the user recovery trajectory.