Trajectory generation model training method, trajectory generation method and apparatus

文档序号:1937706 发布日期:2021-12-07 浏览:7次 中文

阅读说明:本技术 轨迹生成模型训练方法、轨迹生成方法及装置 (Trajectory generation model training method, trajectory generation method and apparatus ) 是由 王寰东 李勇 张启钟 金德鹏 于 2021-08-12 设计创作,主要内容包括:本发明提供一种轨迹生成模型训练方法、轨迹生成方法及装置,该训练方法包括:将历史移动数据输入到逆向生成模型,得到对应的隐含移动特征;将隐含移动特征输入到轨迹生成模型,分别得到时间维度的指数分布和空间维度的多项式分布;训练并优化由逆向生成模型和轨迹生成模型共同构成的变分时间点过程模型,得到轨迹生成模型。本发明提供的轨迹生成模型训练方法、轨迹生成方法及装置,在保留了神经网络模型的强大建模能力、捕获了序列数据中的不确定性的同时提升了其可解释性,且能够通过基于概率模型的数据交互机制有效的引入专家知识,有更强的灵活性、建模能力,对不均衡数据的高度适应性和鲁棒性,在移动数据生成问题上具有巨大的潜力。(The invention provides a trajectory generation model training method, a trajectory generation method and a trajectory generation device, wherein the training method comprises the following steps: inputting historical movement data into a reverse generation model to obtain corresponding implicit movement characteristics; inputting the implicit movement characteristics into a track generation model, and respectively obtaining exponential distribution of time dimension and polynomial distribution of space dimension; and training and optimizing a variation time point process model formed by the reverse generation model and the track generation model to obtain a track generation model. The trajectory generation model training method, the trajectory generation method and the trajectory generation device provided by the invention have the advantages that the strong modeling capability of a neural network model is reserved, the uncertainty in sequence data is captured, the interpretability of the neural network model is improved, expert knowledge can be effectively introduced through a data interaction mechanism based on a probability model, the flexibility and the modeling capability are higher, the high adaptability and the robustness to unbalanced data are realized, and the great potential is realized in the aspect of mobile data generation.)

1. A trajectory generation model training method is characterized by comprising the following steps:

inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data;

inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension;

and training and optimizing a variation time point process model jointly formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training.

2. The trajectory generation model training method according to claim 1, wherein the historical movement data includes user static information, location information, time to enter a location, and dwell time after entering a location;

inputting the historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data, wherein the implicit movement characteristics comprise:

inputting the time of entering the place into a position coding network to obtain the time of entering the place through position coding; respectively inputting the stay time, the user static information and the place information into an embedded coding network to obtain the stay time, the user static information and the place information which are subjected to embedded coding;

inputting the time of entering the place after the position coding, the stay time after the embedded coding, the user static information and the place information into a full connection layer, and splicing to obtain a first vector;

inputting the first vector into an LSTM neural network to obtain a first hidden state variable;

and respectively inputting the first hidden state variable into a mean encoder and a variance encoder to obtain hidden movement characteristics corresponding to the historical movement data.

3. The trajectory generation model training method according to claim 2, wherein the inputting the implicit movement features into the trajectory generation model to obtain an exponential distribution of a time dimension and a polynomial distribution of a space dimension respectively comprises:

inputting the implicit moving features, the embedded coded user static information and the position coded time of the place of entry into the LSTM neural network to obtain a second implicit state variable;

inputting the second hidden state variable into a time decoder to obtain an intensity function, and obtaining the exponential distribution of the time dimension according to the intensity function; wherein the time decoder comprises a fully-connected layer and the output of the last fully-connected layer is processed via an exponential function;

inputting the second hidden state variable into a first place decoder to obtain polynomial distribution based on a time point process, and obtaining the polynomial distribution of the space dimensionality according to the polynomial distribution based on the time point process; wherein the first site decoder includes fully connected layers, and an output dimension of a last fully connected layer is set to a total number of numbered regions.

4. The trajectory generation model training method according to claim 1, wherein the historical movement data includes user static information, location information, time to enter a location, dwell time after entering a location, and location POI information;

inputting the historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data, wherein the implicit movement characteristics comprise:

inputting the time of entering the place into a position coding network to obtain the time of entering the place through position coding; respectively inputting the stay time, the user static information, the place information and the place POI information into an embedded coding network to obtain the stay time, the user static information, the place information and the place POI information which are coded in an embedded mode;

inputting the time of entering the place after the position coding, the stay time after the embedded coding, the user static information, the place information and the place POI information into a full connection layer, and splicing to obtain a second vector;

inputting the second vector into an LSTM neural network to obtain a third hidden state variable;

and respectively inputting the third hidden state variable into a mean encoder and a variance encoder to obtain the hidden motion characteristics corresponding to the historical motion data.

5. The trajectory generation model training method according to claim 4, wherein the inputting the implicit movement features into the trajectory generation model to obtain an exponential distribution of a time dimension and a polynomial distribution of a space dimension respectively comprises:

inputting the implicit moving features, the embedded coded user static information and the position coded time of the place of entry into the LSTM neural network to obtain a fourth implicit state variable;

inputting the fourth hidden state variable into a time decoder to obtain an intensity function, and obtaining the exponential distribution of the time dimension according to the intensity function; wherein the time decoder comprises a fully-connected layer and the output of the last fully-connected layer is processed via an exponential function;

inputting the fourth hidden state variable into a second place decoder to obtain polynomial distribution based on a time point process, inputting the fourth hidden state variable into a third place decoder to obtain polynomial distribution based on regional function consideration, and performing weighted summation on the polynomial distribution based on the time point process and the polynomial distribution based on the regional function consideration to obtain polynomial distribution of the spatial dimension; wherein the second location decoder comprises a fully connected layer, and an output dimension of a last fully connected layer is set to a total number of numbered regions; the third site decoder includes fully-connected layers, and an output dimension of one of the fully-connected layers is equal to a POI data dimension.

6. The trajectory generation model training method according to any one of claims 2 to 5, wherein the training and optimizing a variational time point process model formed by the inverse generation model and the trajectory generation model together comprises:

calculating KL divergence of approximate distribution and posterior distribution of the implicit movement characteristics, and taking the KL divergence as a loss function;

eliminating integral calculation of an evidence lower bound ELBO in the KL divergence by using a reparameterization skill;

and based on the loss function, optimizing by using a back propagation algorithm to obtain model network parameters.

7. A trajectory generation method based on the trajectory generation model training method according to any one of claims 1 to 6, comprising:

carrying out position coding on the time reaching the previous region to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension;

sampling the polynomial distribution of the spatial dimension to obtain information of the previous area, and sampling the exponential distribution of the time dimension to obtain the residence time in the previous area;

obtaining the time for reaching the next area according to the time for reaching the previous area and the residence time in the previous area;

circularly executing the processes until the sum of the residence time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

8. A trajectory generation model training apparatus, comprising:

an encoding processing module to: inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data;

a decode processing module to: inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension;

a training module to: and training and optimizing a variation time point process model jointly formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training.

9. A trajectory generation device, comprising:

a distribution information acquisition module configured to: carrying out position coding on the time reaching the previous region to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension;

a location and dwell time information acquisition module to: sampling the polynomial distribution of the spatial dimension to obtain information of the previous area, and sampling the exponential distribution of the time dimension to obtain the residence time in the previous area;

a time of arrival acquisition module for a next zone, configured to: obtaining the time for reaching the next area according to the time for reaching the previous area and the residence time in the previous area;

a loop processing module to: circularly executing the processes until the sum of the residence time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the trajectory generation model training method according to any one of claims 1 to 6 or the steps of the trajectory generation method according to claim 7 when executing the program.

11. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the steps of the trajectory generation model training method according to any one of claims 1 to 6 or the steps of the trajectory generation method according to claim 7.

Technical Field

The invention relates to the technical field of computers, in particular to a trajectory generation model training method, a trajectory generation method and a trajectory generation device.

Background

Mobile Generation (Trajectory Generation) refers to the estimation of the Trajectory of human movement in the future (usually in units of X days), and a typical application scenario is to simulate the movement and communication of network users based on the synthesized Trajectory in a mobile ad hoc network or a cellular network, so as to perform reliable performance analysis on the network. Early methods modeled human movement processes based on statistical or probabilistic models. However, these models make overly simplistic assumptions about human movement behavior, leading to their shortcomings in modeling complex relationships between high-dimensional spatiotemporal trajectories.

The rise of deep learning provides a powerful solution to this problem. In early attempts, there has been work to model and generate human movement trajectories in an autoregressive manner using standard RNNs. However, due to the autoregressive training generation method of these models, the models are affected by exposure bias (exposure bias) when generating a moving track for a long time, so that errors accumulate with length, and finally, the performance of the generated result is degraded. In recent years, generation of a countermeasure network (GAN) has been highly successful in image generation, natural language generation, and the like. Existing approaches have combined GAN with CNN and RNN to generate human movement data. However, these methods have a series of requirements such as length limitation, time interval limitation and the like on the input modeled movement data, and these requirements are often satisfied by data preprocessing. The method ignores the continuous distribution characteristic of the mobile behaviors in the time domain, so that the fine-grained mobile behaviors of the user cannot be modeled, and meanwhile, the modeling only aiming at the fixed-length track also influences the sufficient mining of the long-time relevance of the mobile behaviors, so that the accuracy of the model based on the generated data is seriously influenced.

In summary, the related art has the following limitations: (1) knowledge-driven methods often make excessively simplified assumptions about the process of generating movement data, resulting in insufficient modeling capability; (2) the data-based method usually requires an input and output data form with a neat format, so that the imbalance of movement track behaviors cannot be well solved, and meanwhile, the fine-grained behaviors and long-term relevance of human movement are greatly influenced.

Disclosure of Invention

In order to solve the problems in the prior art, the invention provides a trajectory generation model training method, a trajectory generation method and a trajectory generation device.

The invention provides a trajectory generation model training method, which comprises the following steps: inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data; inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension; and training and optimizing a variation time point process model jointly formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training.

The invention also provides a track generation method, which comprises the following steps: carrying out position coding on the time reaching the previous region to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension; sampling the polynomial distribution of the spatial dimension to obtain information of the previous area, and sampling the exponential distribution of the time dimension to obtain the residence time in the previous area; obtaining the time for reaching the next area according to the time for reaching the previous area and the residence time in the previous area; circularly executing the processes until the sum of the residence time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

The invention also provides a trajectory generation model training device, comprising: an encoding processing module to: inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data; a decode processing module to: inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension; a training module to: and training and optimizing a variation time point process model jointly formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training.

The present invention also provides a trajectory generation device, including: a distribution information acquisition module configured to: carrying out position coding on the time reaching the previous region to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension; a location and dwell time information acquisition module to: sampling the polynomial distribution of the spatial dimension to obtain information of the previous area, and sampling the exponential distribution of the time dimension to obtain the residence time in the previous area; a time of arrival acquisition module for a next zone, configured to: obtaining the time for reaching the next area according to the time for reaching the previous area and the residence time in the previous area; a loop processing module to: circularly executing the processes until the sum of the residence time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

The invention further provides an electronic device, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the trajectory generation model training methods or the steps of the trajectory generation method when executing the program.

The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the trajectory generation model training method or the steps of the trajectory generation method as described in any of the above.

The invention provides a track generation model training method, a track generation method and a device, which are characterized in that historical movement data are input into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data, the implicit movement characteristics are input into the track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension, a model formed by the reverse generation model and the track generation model is trained and optimized, after the training is finished, the track generation model for track generation is obtained, the track generation model is trained based on a variation time point process model formed by the reverse generation model and the track generation model to obtain the track generation model, the interpretability of the track generation model is improved while the strong modeling capability of a neural network model is reserved and the uncertainty in sequence data is captured, and expert knowledge can be effectively introduced through a data interaction mechanism based on a probability model, the method has stronger flexibility and modeling capability, high adaptability and robustness to unbalanced data and great potential in the problem of mobile data generation.

Drawings

In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.

FIG. 1 is a schematic flow chart of a trajectory generation model training method provided by the present invention;

FIG. 2 is a schematic diagram of a reverse generative model in the trajectory generation model training method provided in the present invention;

FIG. 3 is a schematic diagram of a trajectory generation model in the trajectory generation model training method provided by the present invention;

FIG. 4 is a schematic diagram of a variation time point process model in the trajectory generation model training method provided by the present invention;

FIG. 5 is a flow chart of a trajectory generation method provided by the present invention;

FIG. 6 is a schematic diagram of a trajectory generation model in the trajectory generation method provided by the present invention;

FIG. 7 is a second flowchart of the trajectory generation method provided by the present invention;

FIG. 8 is a schematic structural diagram of a trajectory generation model training apparatus provided in the present invention;

FIG. 9 is a schematic structural diagram of a trajectory generation device provided in the present invention;

fig. 10 illustrates a physical structure diagram of an electronic device.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The trajectory generation model training method, the trajectory generation method, and the trajectory generation device of the present invention are described below with reference to fig. 1 to 10.

FIG. 1 is a schematic flow chart of a trajectory generation model training method provided by the present invention. As shown in fig. 1, the method includes:

step 101, inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data;

102, inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension;

and 103, training and optimizing a model formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training is finished.

The invention aims to construct a trajectory generation model based on a variation time point process model, wherein the variation time point process model is an organic combination of a time point process and a variation Inference (variation Inference) technology, and specifically is a combination of the trajectory generation model and a reverse generation model. The track generation model is a model based on a time point process, and the reverse generation model is a model based on a variation inference framework.

According to the invention, by combining a variational inference frame, a classical time point process and a powerful neural network model, the interpretability of the neural network model is improved while the powerful modeling capability of the neural network model is retained and the uncertainty in sequence data is captured, and the requirements of other models on data balance such as time interval of a time sequence, sequence length and the like are overcome by effectively introducing expert knowledge through a data interaction mechanism based on a probability model. Therefore, the variation time point process model has stronger flexibility and modeling capability, high adaptability and robustness to unbalanced data, and great potential in the aspect of mobile data generation.

In the training process of the track generation model, the neural network model is responsible for mining the movement characteristics contained in the historical movement track, modeling the evolution process of the movement characteristics, and finally mapping the evolution process to be parameters describing the probability distribution of the subsequent movement behaviors, wherein the parameters comprise the exponential distribution of a time dimension and the polynomial distribution of a space dimension. The probability distribution is constructed based on a time point process framework, and expert knowledge can be effectively introduced through the classical probability distribution, so that the interpretability of the model is improved.

A sequence generation neural network model (trajectory generation model) introducing a time point process cannot be optimized by using a back propagation algorithm based on a loss function such as cross entropy, like a conventional neural network. In order to solve the problem, the variation inference method is adopted to optimize the model parameters. Based on the method, an additional neural network (reverse generation model) is defined to carry out reverse process estimation of the generation model, namely, implicit characteristics are reversely deduced from the generation result, an index for measuring the quality of the generation result can be derived by combining a Bayes formula, and finally parameter training of the process model of the whole variation time point is realized.

The specific process of training is as follows: inputting the historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data; inputting the implicit movement characteristics into a track generation model, and respectively obtaining exponential distribution of time dimension and polynomial distribution of space dimension; and training and optimizing a model which is formed by the reverse generation model and the track generation model together, and obtaining the track generation model for track generation after the training is finished.

The problem of predicting movement data of a human for a future period of time can be expressed in the form: it is known that for any user U belonging to the overall set U, its length is NuThe historical track data is defined asWhereinIs a three-dimensional coordinate point which respectively and sequentially records the time points of human beingsTime to placeAnd stay thereUnit time. The task of movement data generation is to generate completely new and usable movement data, i.e. the probability distribution of subsequent movements over time and space, from the existing historical movement trajectories.

Based on the analysis of the correlation between the trajectory features and the movement data, the final screening of features for movement data generation for each sample (i.e., one data point) may include:

{ "User _ ID"// number per individual, integer

Location _ ID,// number of geographic area with diameter of about 10km divided by longitude and latitude of the Location of the individual, integer

"Time _ Begin", "v/Time when an individual reaches a location, real number

"Time _ Last"// Time that an individual stays at that location, real numbers }

In order to filter out noise in the raw data and reduce the complexity of the model, each valid data point can be obtained through the following pre-processing:

1) merging adjacent data points with similar spatial distance

The places with the longitude and latitude difference values within a certain range belong to the same area. If the moving data of a certain individual in a certain area shows that the moving data is in the certain area, the individual can be regarded as staying in the area and only moving in the area, so as to achieve the simplification of the initial data in the spatial dimension.

2) Filtering out data points with too short a dwell time

In order to model the movement of an individual more compactly, the focus of research is on areas where the individual stays frequently, for a long time, whereas areas with shorter stays can be regarded as secondary data recorded by the individual during the movement, and do not play a decisive role in model establishment.

3) Numbering screened individuals and places according to natural numbers

To facilitate later model operations (such as one-hot coding, etc.), it is necessary to establish a natural number setAnd mapping between individuals and regions.

The invention provides a track generation model training method, which comprises the steps of inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data, inputting the implicit movement characteristics into the track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension, training and optimizing a model formed by the reverse generation model and the track generation model, obtaining a track generation model for track generation after training is finished, training on the basis of a variation time point process model formed by the reverse generation model and the track generation model to obtain the track generation model, improving interpretability of a neural network model while retaining strong modeling capacity of the neural network model and capturing uncertainty in sequence data, and effectively introducing expert knowledge through a data interaction mechanism based on a probability model, the method has stronger flexibility and modeling capability, high adaptability and robustness to unbalanced data and great potential in the problem of mobile data generation.

According to the track generation model training method provided by the invention, the historical movement data comprises user static information, location information, time for entering a location and residence time after entering the location; inputting the historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data, wherein the implicit movement characteristics comprise: inputting the time of entering the place into a position coding network to obtain the time of entering the place through position coding; respectively inputting the stay time, the user static information and the place information into an embedded coding network to obtain the stay time, the user static information and the place information which are subjected to embedded coding; inputting the time of entering the place after the position coding, the stay time after the embedded coding, the user static information and the place information into a full connection layer, and splicing to obtain a first vector; inputting the first vector into an LSTM neural network to obtain a first hidden state variable; and respectively inputting the first hidden state variable into a mean encoder and a variance encoder to obtain hidden movement characteristics corresponding to the historical movement data.

Historical movement data may be obtained through preprocessing. For example, if the user wishes to generate a movement trace of the next year for data analysis from the historical movement data that was sparse for the last 5 years. When training is performed based on historical movement data, first, construction of training data is performed. Since the historical data is sparse and more information can be extracted, the model can achieve a better effect, and a coarser processing principle can be selected and adopted when the original data is preprocessed. Specifically, on the spatial level, when adjacent data points are combined, whether the decile and the percentile of the longitude and the latitude of the two points are the same is used as a judgment basis for the fact that the two points are in a geographic area, and subsequent area numbering is carried out on the basis of the decile and the percentile; at the time level, since the data presents a local dense and overall sparse characteristic, the time period of recording the data in one day is relatively low, the threshold of the time interval may be appropriately adjusted to be high, for example, 10 minutes, during the filtering process, so as to retain the main characteristic of the trace, namely, the time period of each stay. Through the above operations, the movement data characteristics required by the model can be obtained.

The historical movement data comprises user static information, place information, time of entering the place and stay time after entering the place, and for the ith movement data record, the record can be respectively expressed as u and li,tii. Wherein, the user static information can be an individual number.

The inverse generative model can be considered as an encoder. When historical mobile data are input into a reverse generation model to obtain implicit mobile characteristics corresponding to the historical mobile data, firstly, the time of entering a place is input into a position coding network to obtain the time of entering the place through position codingRespectively inputting the stay time, the user static information and the place information into an embedded coding network to obtain the stay time subjected to embedded codingUser static information uembAnd location informationTo optimize the model effect, the resulting vectors may be useduembAccording to 64: 256: 256: 128 to highlight each region where the individual dwells and the time to reach and dwell in that region as the primary object of the modeling, while weakening the distinction between individuals.

The time of entering the place after position coding, the stay time after embedded coding, the user static information and the place information are input into a full connection layer, are spliced into a complete vector through the full connection layer and are input into an encoder LSTM neural network to extract the characteristics of the sequence data, and in order to be able to fully grasp each characteristic of the individual moving track, the dimension of the first hidden state variable can be set to 512. At this time, the characteristics of the track which are different according to individuals and time are concentrated in the obtained first hidden state variable.

In order to model these features as mutually independent normal random variables for generating a model, i.e., a decoder (trajectory generation model), to perform random sampling, and to simulate future movement trajectories of different individuals, the first hidden state variable may be input to a mean encoder and a variance encoder, which are respectively composed of two fully-connected layers, so as to determine the distribution of each trajectory feature. Specifically, the output dimensions of the first fully-connected layer may be set to 256, and the output dimensions of the second fully-connected layer may be set to 512, that is, the dimension of the hidden state space. In addition, each activation function may be set to ReLu.

For the hidden space encoded by the encoder, a certain number of eigenvectors are randomly sampled from it, i.e. a matrix of Lxn is obtained. Each row of the matrix is an eigenvector of dimension n (in this case, n is 512) representing the entire information for one data point in the trajectory, and the entire matrix will be passed through the decoder to generate a piece of motion data of length L (in this case, L is the same length as the model input data). The random sampling process is already realized when the first hidden state variable is respectively input into the mean encoder and the variance encoder to obtain the hidden motion characteristics of the corresponding historical motion data.

The track generation model training method provided by the invention comprises the steps of setting historical movement data comprising user static information, location information, time of entering a location and residence time after entering the location, coding the historical movement data through a reverse generation model to obtain a coded vector, splicing the coded vector into a complete vector through a full connection layer, outputting a first hidden state variable through an LSTM network by the spliced complete vector, and respectively inputting the first hidden state variable into a mean value coder and a variance coder to obtain hidden movement characteristics of corresponding historical movement data, thereby realizing reliable acquisition of the hidden movement characteristics.

According to the trajectory generation model training method provided by the invention, the implicit movement characteristics are input into the trajectory generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension, and the method comprises the following steps: inputting the implicit moving features, the embedded coded user static information and the position coded time of the place of entry into the LSTM neural network to obtain a second implicit state variable; inputting the second hidden state variable into a time decoder to obtain an intensity function, and obtaining the exponential distribution of the time dimension according to the intensity function; wherein the time decoder comprises a fully-connected layer and the output of the last fully-connected layer is processed via an exponential function; inputting the second hidden state variable into a first place decoder to obtain polynomial distribution based on a time point process, and obtaining the polynomial distribution of the space dimensionality according to the polynomial distribution based on the time point process; wherein the first site decoder includes fully connected layers, and an output dimension of a last fully connected layer is set to a total number of numbered regions.

The trajectory generation model may be considered a decoder. When the implicit movement characteristics are input into the track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension, the implicit movement characteristics, embedded coded user static information and position coded time of entering a place are input into the LSTM neural network to obtain a second implicit state variable. In order to further emphasize the uniqueness of the individual and the periodicity of the movement data in time, the decoder inputs the motion characteristics (implicit motion characteristics) obtained by sampling, and also embeds the individual number (embedded coded user static information) and position coding (time of entering the place after position coding) which are identical to those of the encoder, and the three groups of vectors can be spliced into a whole through a full-joint layer and then input into an LSTM neural network to obtain a second implicit state variable. The second hidden state variable has the same dimension as the input vector of the LSTM neural network of the encoder (inverse generative model), and the obtained second hidden state vector can be regarded as a feature vector containing all the movement trajectory information and needs to be further decoded into exponential distribution of time dimension and polynomial distribution of space dimension, respectively.

And inputting the second hidden state variable into a time decoder to obtain an intensity function, and obtaining the exponential distribution of the time dimension according to the intensity function. In particular, the time decoder may consist of three fully-concatenated layers, whose output dimensions may be 64, 64, 1, respectively, and where the first two layers may use ReLu as an activation function and the output of the last layer may be processed via an exponential function to ensure that it is non-negative. The finally obtained L-dimensional vector determines the probability distribution of each stay time in the subsequently generated track, namely the intensity function of the exponential distribution.

And inputting the second hidden state variable into a place decoder, wherein the place decoder comprises a first place decoder to obtain a polynomial distribution based on a time point process, and a polynomial distribution of a space dimension is obtained according to the polynomial distribution based on the time point process, so that the polynomial distribution based on the time point process can be directly used as the polynomial distribution of the space dimension. The first site decoder is structured like a time decoder and can be a three-layer fully-concatenated layer that handles LSTM hidden state variables. In order to ensure that the track features related to the geographical region in the hidden state variable can be fully extracted, the output dimension may be set to be slightly larger, for example 128, 128, N, respectively, where N is the total number of all regions after numbering, and in this example, the value is 10000. Meanwhile, the activation function can be a SeLu function, and in order to obtain non-negative polynomial probability distribution, the output of the last layer of full-link layer can be processed by a SoftMax function.

The track generation model training method provided by the invention has the advantages that the implicit moving characteristics, the embedded coded user static information and the position coded time for entering the place are input into an LSTM neural network to obtain a second hidden state variable, the second hidden state variable is input into a time decoder to obtain an intensity function, the exponential distribution of the time dimension is obtained according to the intensity function, the second hidden state variable is input into a first place decoder to obtain the polynomial distribution based on the time point process, the polynomial distribution of the space dimension is obtained according to the polynomial distribution based on the time point process, and the exponential distribution of the time dimension and the polynomial distribution of the space dimension are reliably obtained.

According to the track generation model training method provided by the invention, the historical movement data comprises user static information, location information, time for entering a location, stay time after entering the location and location POI information; inputting the historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data, wherein the implicit movement characteristics comprise: inputting the time of entering the place into a position coding network to obtain the time of entering the place through position coding; respectively inputting the stay time, the user static information, the place information and the place POI information into an embedded coding network to obtain the stay time, the user static information, the place information and the place POI information which are coded in an embedded mode; inputting the time of entering the place after the position coding, the stay time after the embedded coding, the user static information, the place information and the place POI information into a full connection layer, and splicing to obtain a second vector; inputting the second vector into an LSTM neural network to obtain a third hidden state variable; and respectively inputting the third hidden state variable into a mean encoder and a variance encoder to obtain the hidden motion characteristics corresponding to the historical motion data.

Historical movement data may be obtained through preprocessing. For example, if the user wants to generate a moving track of the next week for data analysis by using more accurate historical moving data of the past week and detailed regional functional attributes, i.e., POI information. When training is performed based on historical movement data, first, construction of training data is performed. Because the historical data is more perfect and more information can be extracted, the model can achieve a better effect, and a more precise processing principle can be selected and adopted when the original data is preprocessed. Specifically, on the spatial level, since the geographic area is often divided in the process of obtaining the POI data, when merging adjacent data points, whether the two points are in the same geographic area is judged according to the longitude and latitude instead of the distance between the two points, and the subsequent area numbering is also performed based on the POI data; in the time aspect, because the data volume is larger, the duration with data records in one day is higher, so that the threshold of the time interval can be properly reduced during filtering, for example, 5 minutes, so as to reserve data points in part of the moving process, thereby better modeling the specific moving track of an individual and avoiding the following generated moving curve as a simple broken line segment. Through the above operations, the movement data characteristics required by the model can be obtained.

FIG. 2 is a schematic diagram of a reverse generative model in the trajectory generation model training method provided by the present invention. The output of the neural network time point process sequence generation model provided by the invention generates data through probability distribution, and the probability distribution is not derivable, so that the model parameters can not be obtained by direct training through a back propagation algorithm. In order to solve the problem, a variation inference method is adopted to optimize the model. Based on the variation inference technology, an additional neural network is adopted to perform the inverse process estimation of the generation network, i.e. the implicit features are reversely deduced from the generation result, which is called approximate distribution. The approximate distribution is combined with a Bayesian formula to derive an index for measuring the quality of a generated result, and finally parameter training of the whole variation time point process model is realized.

In the neural network time point process generation model provided by the invention, the random movement characteristic z is used1:iGenerating (next) movement data ri(ii) a While in an approximate distribution will be based on the historical movement trajectory r1:iEstimating a user's current implicit movement profile ziDefining the neural network as qφ(zi|r1:i) A schematic diagram of which is shown in fig. 2. It can be seen that it utilizes the time evolution of the LSTM network modeling sequence, and the specific expression is as follows:

whereinAndthe absolute time of the ith mobile recording and its time difference from the last recording, i.e. the relative time, are shown, and the superscript PE indicates that it is position-coded. In order to ensure that the code can characterize the time periodicity and continuity of the user behavior, the following fourier transform-based position coding is proposed. For a length-2K code vector, its 2K bits and 2K +1 bits can be expressed as follows:

where γ denotes the reference frequency of the code, PE denotes the position code, PE2k(t) denotes the function of the even term with respect to the argument t, PE2k+1(t) denotes the function of the odd term with respect to the argument t, t denotes time.

On the other hand, the retention time, the place information recorded by the user movement, the static feature of the user and the semantic POI feature of the visiting place are also embedded and coded at the same time, and are respectively expressed as

Based on the output of the LSTM network, final ziIs modeled as a parameter hiIs calculated, this process is represented as follows:

wherein g is a non-linear mapping function, different forms of g functions can be tried to improve the modeling capability of the model.

Therefore, in the present embodiment, the historical movement dataIncluding user static information, location information, time to enter the location, dwell time after entering the location, and location POI information. When historical mobile data are input into a reverse generation model to obtain implicit mobile characteristics corresponding to the historical mobile data, firstly, the time of entering a place is input into a position coding network to obtain the time of entering the place through position codingRespectively inputting the stay time, the user static information, the place information and the place POI information into an embedded coding network to obtain the stay time after embedded codingUser static information uembLocation informationAnd location POI informationThe place POI information can be subjected to linear coding to obtain embedded coded POI informationLinear coding is one type of embedded coding.

To optimize the model effect, the resulting vectors may be usedAccording to 64: 256: 256: 128: 64 to highlight each area where an individual is staying and the time it takes to reach and stay in that area, the main objects of the modeling, while weakening the distinction between individuals, and taking the functional attributes of the area (location POI information) as an additional feature to input into the subsequent long-short term memory network to further optimize the model performance.

The time of entering the place after position coding, the stay time after embedded coding, the user static information, the place information and the place POI information are input into a full connection layer, are spliced into a complete vector through the full connection layer and are input into an encoder LSTM neural network to extract the characteristics of sequence data, and in order to be able to fully grasp the various characteristics of the individual moving track, the dimension of a third hidden state variable can be set to 512. At this time, the characteristics of the trajectory, which are different from one individual to another and from time to time, are concentrated in the obtained third hidden state variable.

In order to model these features as mutually independent normal random variables for generating a model, i.e., a decoder (trajectory generation model), to perform random sampling, and to simulate future movement trajectories of different individuals, a third hidden state variable may be input to a mean encoder and a variance encoder, which are respectively composed of two fully-connected layers, so as to determine the distribution of each trajectory feature. Specifically, the output dimensions of the first fully-connected layer may be set to 256, and the output dimensions of the second fully-connected layer may be set to 512, that is, the dimension of the hidden state space. In addition, each activation function may be set to ReLu.

For the hidden space encoded by the encoder, a certain number of eigenvectors are randomly sampled from it, i.e. a matrix of Lxn is obtained. Each row of the matrix is an eigenvector of dimension n (in this case, n is 512) representing the entire information for one data point in the trajectory, and the entire matrix will be passed through the decoder to generate a piece of motion data of length L (in this case, L is the same length as the model input data). The random sampling process is already realized when the third hidden state variable is respectively input into the mean encoder and the variance encoder to obtain the hidden motion characteristics of the corresponding historical motion data.

The track generation model training method provided by the invention is characterized in that historical movement data comprising user static information, location entering time, residence time after location entering and location POI information are set, a coded vector is obtained by coding a reverse generation model, the coded vector is spliced into a complete vector through a full connection layer, the spliced complete vector outputs a third hidden state variable through an LSTM network, and the third hidden state variable is respectively input into a mean value coder and a variance coder to obtain hidden movement characteristics of corresponding historical movement data, so that reliable acquisition of the hidden movement characteristics is further realized, and the information of the hidden movement characteristics is enriched.

According to the trajectory generation model training method provided by the invention, the implicit movement characteristics are input into the trajectory generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension, and the method comprises the following steps: inputting the implicit moving features, the embedded coded user static information and the position coded time of the place of entry into the LSTM neural network to obtain a fourth implicit state variable; inputting the fourth hidden state variable into a time decoder to obtain an intensity function, and obtaining the exponential distribution of the time dimension according to the intensity function; wherein the time decoder comprises a fully-connected layer and the output of the last fully-connected layer is processed via an exponential function; inputting the fourth hidden state variable into a second place decoder to obtain polynomial distribution based on a time point process, inputting the fourth hidden state variable into a third place decoder to obtain polynomial distribution based on regional function consideration, and performing weighted summation on the polynomial distribution based on the time point process and the polynomial distribution based on the regional function consideration to obtain polynomial distribution of the spatial dimension; wherein the second location decoder comprises a fully connected layer, and an output dimension of a last fully connected layer is set to a total number of numbered regions; the third site decoder includes fully-connected layers, and an output dimension of one of the fully-connected layers is equal to a POI data dimension.

The mobile sequence data is modeled using a neural network point in time process model. A point-in-time process is a type of stochastic process that is used to describe a sequence of events that contain time information. The most common point-in-time processes include the Poisson process and the Hawkes process. Specifically, in the time point process model, an event occurrence intensity function λ (t), which is simply referred to as an intensity function, is used to describe the magnitude of probability densities of different events occurring around time t. For example, in the Poisson process, strongThe degree function being a fixed value, i.e. λ (t) ═ λ0(ii) a In the Hawkes process, an event that has already occurred can stimulate or suppress a subsequent event, and thusWherein t isiFor the time of occurrence of a past event, #, is a function describing the excitation or suppression relationship of the event, alpha represents the effect of the past event on the current value of the intensity function, mu0Representing an expected, predictable, or deterministic portion of the intensity. However, whether the density function of the event occurrence in the real world conforms to the expression of the models or not is not guaranteed, and further, the moving time sequence cannot be guaranteed to be effectively and robustly modeled.

FIG. 3 is a schematic diagram of a trajectory generation model in the trajectory generation model training method provided by the present invention. In order to overcome the problems, the invention adopts a time point process of neural network modeling, namely, the neural network is used for modeling the intensity function of the neural network, meanwhile, the user selection for visiting different places is also given by fitting of the neural network, and a track generation model is a time point process model of the neural network modeling. A schematic diagram of the trajectory generation model during training is shown in fig. 3.

Specifically, the intensity function should have a more flexible expression in a more general case, but the intensity function near time t is influenced only by events occurring in the past in consideration of causality, and therefore the sign thereof is defined as λ (t | r)1:i-1) Wherein r is1:i-1Representing a historical movement trajectory. Further, the probability density of the occurrence of the next movement behavior, i.e. the ith movement record, can be expressed as follows:

a piecewise intensity function is used, i.e. the intensity of an event occurring before the ith movement occurs is constant, and the intensity of the event occurring after the ith movement occurs changes according to the event occurring. Is then integral termCan be calculated as λ (t | r)1:i-1),ti-ti-1]. Further, a Long Short-Term Memory network (LSTM) is used to model the model, and the process is expressed as follows:

hi=LSTMθ(zi,hi-1,uemb)

wherein h isiRecord the corresponding LSTM hidden state variable, h, for the ith movei-1Record the corresponding LSTM hidden state variable, z, for the i-1 th moveiThe randomness of the data generation process is modeled for random variables that characterize the user's mobility state. u. ofembAttribute features that represent that the user does not change with movement. θ represents a network parameter. Further, a hidden state hiThe relevant parameters mapped by the non-linear neural network f to the intensity function and event type are then:

[η,ΨlocPOI]=fθ(hi)

where eta is the intensity function value, so there is lambda (t | r)1:i-1) η. The neural network f can be constructed in various ways, and can use the most classical multilayer perceptron model, and can also use effective network structures such as a convolutional neural network, a graph convolutional neural network and the like.

At the same time, the moving site will synthesize the direct fitting result Ψ of the site distributionlocAnd intention distribution xiPOITwo parts are given. The method comprises the steps of depicting the intention distribution of a user by adopting POI information, wherein the POI represents the distribution of interest points with different functions (such as restaurants, houses and the like) in a city range, and defining a POI distribution matrix I epsilon R|C|×|L|Where C is a set of POI types and L is a set of spatial regions. XiPOIFor a vector of length | C |, describing the user's intent to visit different types of places, it is converted into a choice to visit different places by a matrix multiplication operation as follows:

ΨPOI=(ξPOI)T·I

the next time the userMobile location selection is modeled as ΨlocTo ΨPOIWeighted sum of (c):

Ψ(z1:i)=αΨloc+βΨPOI

the resulting vector Ψ (z)1:i) Representing the user's tendency to visit | L | locations, the next location will be called from Ψ (z)1:i) Is selected from a polynomial distribution of the parameters.

Based on the value of the intensity function lambda (t | r) by combination1:i-1) Eta and psi (z) as parameter1:i) The next access record of the mobile user can be generated by a time point process model constructed by the polynomial distribution, and further, the cyclic iteration is carried out based on the LSTM network, so that the user movement sequence is generated.

When the implicit movement characteristics are input into the track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension, the implicit movement characteristics, embedded coded user static information and position coded time of entering a place are input into the LSTM neural network to obtain a fourth implicit state variable. In order to further emphasize the uniqueness of the individual and the periodicity of the movement data in time, the decoder inputs the motion characteristics (implicit motion characteristics) obtained by sampling, and also embeds the individual number (embedded coded user static information) and position coding (time of entering the place after position coding) which are identical to those of the encoder, and the three groups of vectors can be spliced into a whole through a full-link layer and then input into an LSTM neural network to obtain a fourth implicit state variable. The fourth hidden state variable has the same dimension as the input vector of the LSTM neural network of the encoder (inverse generative model), and the obtained fourth hidden state vector can be regarded as a feature vector containing all the movement trajectory information and needs to be further decoded into exponential distribution of time dimension and polynomial distribution of space dimension, respectively.

And inputting the fourth hidden state variable into a time decoder to obtain an intensity function, and obtaining the exponential distribution of the time dimension according to the intensity function. In particular, the time decoder may consist of three fully-concatenated layers, whose output dimensions may be 64, 64, 1, respectively, and where the first two layers may use ReLu as an activation function and the output of the last layer may be processed via an exponential function to ensure that it is non-negative. The finally obtained L-dimensional vector determines the probability distribution of each stay time in the subsequently generated track, namely the intensity function of the exponential distribution.

To make full use of the regional functional features, i.e. POI data, the location decoder is more complex than the time decoder. The location decoder includes a second location decoder and a third location decoder. And inputting the fourth hidden state variable into a second place decoder to obtain the polynomial distribution based on the time point process. The second location decoder, similar to the time decoder, may be a three-layer fully-concatenated layer that handles LSTM hidden state variables. In order to ensure that the track features related to the geographical region in the hidden state variable can be fully extracted, the output dimension may be set to be slightly larger, for example 128, 128, N, respectively, where N is the total number of all regions after numbering, and in this example, the value is 10000. Meanwhile, the activation function can be a SeLu function, and in order to obtain non-negative polynomial probability distribution, the output of the last layer of full-link layer can be processed by a SoftMax function.

And inputting the fourth hidden state variable into a third place decoder to obtain the polynomial distribution based on the regional function consideration. The fourth hidden state variable is input into the third location decoder, output (one or two independent full-connected layers, or the output of the first or second full-connected layer of the second location encoder is directly utilized) can be obtained through the full-connected layer, then the output vector passes through the full-connected layer with the output dimension equal to the POI data dimension (M dimension), the output of the M dimension full-connected layer is regarded as individual preference, and then the individual track characteristic based on the regional function consideration, namely the polynomial distribution based on the regional function consideration is obtained through the other full-connected layer with the output of 1 dimension and the subsequent SoftMax function. At this time, polynomial distributions based on the time point process and the area function consideration are obtained, and finally, the two are weighted and summed at a preset ratio, for example, 9:1 (which may be a polynomial distribution based on the time point process is 9, and a polynomial distribution based on the area function consideration is 1) to perform weighted summation, and the obtained vector is used as a probability distribution of each staying location in the subsequent generated trajectory, that is, a polynomial distribution of a spatial dimension.

The track generation model training method provided by the invention is characterized in that implicit moving characteristics, embedded coded user static information and position coded time for entering a place are input into an LSTM neural network to obtain a fourth hidden state variable, the fourth hidden state variable is input into a time decoder to obtain an intensity function, time-dimension exponential distribution is obtained according to the intensity function, the fourth hidden state variable is input into a second place decoder and a third place decoder, then, space-dimension polynomial distribution is obtained through weighted summation, reliable acquisition of time-dimension exponential distribution and space-dimension polynomial distribution is realized, and information of the time-dimension exponential distribution and the space-dimension polynomial distribution is enriched.

According to the trajectory generation model training method provided by the invention, the training and optimizing a variation time point process model jointly formed by the reverse generation model and the trajectory generation model comprises the following steps: calculating KL divergence of approximate distribution and posterior distribution of the implicit movement characteristics, and taking the KL divergence as a loss function; eliminating integral calculation of an evidence lower bound ELBO in the KL divergence by using a reparameterization skill; and based on the loss function, optimizing by using a back propagation algorithm to obtain model network parameters.

FIG. 4 is a schematic diagram of a variation time point process model in the trajectory generation model training method provided by the present invention. According to the method, a variation time point process model formed by a reverse generation model and a track generation model is trained and optimized, and after training is finished, a track generation model for track generation is obtained.

Based on the neural network model of the approximate distribution, an optimization target of the model is further derived, a posterior verification distribution p (Z | R) ═ p (R | Z) p (Z)/p (R) of Z can be derived from a generated model p (R | Z) by a bayesian formula, and by comparing KL divergences of the posterior distribution and the approximate distribution, the following can be obtained:

wherein p (R) is the probability of occurrence of observation movement data, R represents a research object (a series of random variables) on a display state space, and a sample of the research object is observation data; z represents the research object (a random variable) on the hidden state space, the sample of the research object is Z, Z is the sampling result of Z, and Z isiA collection of (a). p (Z | R) represents the conditional probability distribution of R with respect to Z, p (R | Z) represents the conditional probability distribution of Z with respect to R, p (Z) represents the probability distribution of Z, and q (Z) represents the probability distribution of a random variable associated with a hidden state variable, which may be the argument of the function to be optimized.

Since it does not change with the model parameters, minimizing the KL divergence between p (Z) and p (Z | R), i.e., between q (Z) and p (Z | R), can be done by maximizing the remaining termsThis term is called Evidence Lower Bound (ELBO). However, the integrals contained in ELBO are still difficult to handle, and in order to solve this problem, a re-parameterization technique is used to solve them numerically. Specifically, the sample of z is obtained by sampling from the following distribution:

using formulasThe sampling sample is brought into an ELBO (evidence lower bound in variation inference) boundary, so that the purpose of eliminating integral calculation can be achieved, meanwhile, the obtained optimization target can still be a function of the network parameters phi and theta, and further, the network parameters can be obtained by adopting a back propagation algorithm for optimization.

In the formula (I), the compound is shown in the specification,is a random variable and follows a standard normal distribution;represents a standard normal distribution;the ith sample representing the hidden state, the broken line at the upper end representing the difference between Z of the parameterization skill and the original Z; the superscript u indicates the association with user u. (Z) represents an arbitrary function related to Z, q (Z) represents a probability density function, and the argument is Z;representing a random variable subject to a probability density function q (Z), or more specifically a sample of this random variable, i.e. a sample, i.e. in practice the current implicit movement characteristic z of the useriRepresenting a integrable function whose domain of definition containsThe value range of (2).

The model is trained and optimized by ELBO loss, and the resulting model is then used for subsequent movement data generation. After the model is trained over a certain number of epochs, the coefficients substantially converge.

According to the trajectory generation model training method provided by the invention, a variational framework optimized by taking the ELBO as a target is adopted, and a generation model (trajectory generation model) and an approximate distribution model (reverse generation model) are cooperatively optimized, so that the problem that a probability distribution layer is not derivable in a process model based on a neural network time point is solved, and the training of network parameters is finally realized; the model effectively introduces expert knowledge by combining classical probability distribution, and simultaneously can well model continuous time distribution and indefinite long tracks, thereby effectively overcoming the unbalance of moving tracks and greatly improving the robustness and the universality of the model.

Fig. 5 is a flowchart of a trajectory generation method provided by the present invention. As shown in fig. 5, the method includes:

step S1, carrying out position coding on the time reaching the previous area to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension;

step S2, sampling the polynomial distribution of the space dimension to obtain the information of the previous area, and sampling the exponential distribution of the time dimension to obtain the staying time in the previous area;

step S3, obtaining the time for reaching the next area according to the time for reaching the previous area and the staying time in the previous area;

step S4, the above processes are executed circularly until the sum of the stay time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

The track generation method provided by the invention can be used for generating the track based on the track generation model obtained by training the track generation model training method. Wherein the trajectory generation model is constructed based on historical movement data. The trajectory generation model is used for generating the trajectory, and can be used for realizing the trajectory prediction based on the historical movement data.

Fig. 6 is a schematic diagram of a trajectory generation model in the trajectory generation method provided by the present invention. The generation of the simulated trajectory is performed by using a decoder (trajectory generation model), the single-run process of the decoder is as described above, and the training and the generation are different mainly in that: and the generation of input data and the further conversion of output data into a movement track and the recycling of a model.

Firstly, a vector z obtained by randomly sampling from a hidden state space in input data is input by a reverse generation model, the reverse generation model is used for training a track generation model, and after the training is successful, the track generation can be carried out by only using the track generation model. When the trajectory generation is carried out by using the trajectory generation model, the vector z randomly sampled from the hidden state space in the input data is sampled from the standard normal distribution, because under the theoretical condition, the standard normal distribution is the convergence limit of the vector z randomly sampled from the hidden state space, and in addition, the position code in the input data is not coded by historical data any more, but is generated step by step in the generation process; secondly, the output data of the trajectory generation model determines the probability distribution of the time point sequence model only through necessary parameters, but not real specific data points, so when the movement data is generated, sampling is carried out from the population to realize random generation of the simulation trajectory.

Finally, the decoder (trajectory generation model) needs to be recycled in the generation process. An example of generating a trajectory using a trajectory generation model is as follows: setting the starting time of a track to be 0, obtaining a coding vector with the length of one through position coding at the moment, and then adding an embedded vector (embedded coded user static information) of an individual number with the same dimension and a hidden state vector to be used as the initial input of a decoder. After decoding and sampling, the first region to stay in and the time to stay in the region can be obtained, and the latter is added to the time to reach the region, so that the region change, i.e. the time to reach the next region, can be obtained. At this time, the newly added time is subjected to position coding, so that a coding vector with the length of two can be obtained, and the input data required by the second circulation can be obtained only by sampling once from the standard normal distribution. And through cyclic decoding and sampling, the last term of each output vector can be considered as the second region to stay in and the time to stay in that region. By analogy, the trajectory with any length can be generated continuously in a circulating manner, and the generation is stopped only when the time span of the trajectory reaches the preset time (if the trajectory of one week needs to be generated, the preset time is set to one week), so that the finally required mobile data can be obtained.

According to the track generation method provided by the invention, the track generation is carried out by adopting the track generation model constructed by the loop iteration method based on the historical movement data, the track generation model overcomes the requirements on data balance such as time interval of a data time sequence, sequence length and the like, and has stronger flexibility and modeling capability, and high adaptability and robustness to unbalanced data, so that more accurate track generation is realized.

Fig. 7 is a second flowchart of the trajectory generation method provided by the present invention. As shown in fig. 7, sample information (each item of historical movement data) is obtained from the historical movement data, sample feature screening (i.e., position coding and embedded coding are performed on the historical movement data), and then coding is performed by an encoder to obtain a hidden state sampling result (processing of an inverse generation model). The probability distribution of time and place is obtained by decoding by a decoder (processing of a trajectory generation model). And training a variation time point process model constructed by a reverse generation model and a track generation model step by step based on historical movement data, and obtaining the track generation model for track generation after training. And generating movement data by using the track generation model so as to simulate the movement data. The intermediate simulation track is obtained by obtaining the arrival time of the next area according to the arrival time and the stay time of the current area. And after the arrival time of the next region is subjected to position coding, the arrival time, the hidden state sampling result (sampled from the standard normal distribution) and the embedded coded user static information are jointly used as the input of a track generation model (decoder) to obtain a next output result.

The trajectory generation model training method and the trajectory generation method provided by the invention are based on the variational time point process model formed by the reverse generation model and the trajectory generation model to train to obtain the trajectory generation model, so that the interpretability of the neural network model is improved while the strong modeling capability of the neural network model is reserved and the uncertainty in sequence data is captured, expert knowledge can be effectively introduced through a data interaction mechanism based on a probability model, the method has stronger flexibility and modeling capability, high adaptability and robustness to unbalanced data, and great potential is realized in the aspect of mobile data generation.

The trajectory generation model training device provided by the present invention is described below, and the trajectory generation model training device described below and the trajectory generation model training method described above may be referred to in correspondence with each other.

Fig. 8 is a schematic structural diagram of a trajectory generation model training device provided by the present invention. As shown in fig. 8, the apparatus includes an encoding processing module 100, a decoding processing module 200, and a training module 300, wherein: the encoding processing module 100 is configured to: inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data; the decoding processing module 200 is configured to: inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension; the training module 300 is configured to: and training and optimizing a variation time point process model jointly formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training.

The invention provides a track generation model training device, which obtains implicit movement characteristics corresponding to historical movement data by inputting the historical movement data into a reverse generation model, inputs the implicit movement characteristics into the track generation model, respectively obtains exponential distribution of time dimension and polynomial distribution of space dimension, trains and optimizes a model formed by the reverse generation model and the track generation model, obtains a track generation model for track generation after the training is finished, trains based on a variation time point process model formed by the reverse generation model and the track generation model to obtain the track generation model, improves interpretability of a neural network model while retaining strong modeling capability of the neural network model and capturing uncertainty in sequence data, and can effectively introduce expert knowledge through a data interaction mechanism based on a probability model, the method has stronger flexibility and modeling capability, high adaptability and robustness to unbalanced data and great potential in the problem of mobile data generation.

According to the trajectory generation model training device provided by the invention, the historical movement data comprises user static information, location information, time for entering a location and residence time after entering the location; the encoding processing module 100 is specifically configured to: inputting the time of entering the place into a position coding network to obtain the time of entering the place through position coding; respectively inputting the stay time, the user static information and the place information into an embedded coding network to obtain the stay time, the user static information and the place information which are subjected to embedded coding; inputting the time of entering the place after the position coding, the stay time after the embedded coding, the user static information and the place information into a full connection layer, and splicing to obtain a first vector; inputting the first vector into an LSTM neural network to obtain a first hidden state variable; and respectively inputting the first hidden state variable into a mean encoder and a variance encoder to obtain hidden movement characteristics corresponding to the historical movement data.

The track generation model training device provided by the invention is characterized in that historical movement data comprising user static information, place information, time of entering a place and residence time after entering the place are set, a coding vector is obtained by coding a reverse generation model, the coding vector is spliced into a complete vector through a full connection layer, the spliced complete vector outputs a first hidden state variable through an LSTM network, and the first hidden state variable is respectively input into a mean value coder and a variance coder to obtain hidden movement characteristics of corresponding historical movement data, so that the hidden movement characteristics are reliably obtained.

According to the trajectory generation model training apparatus provided by the present invention, the decoding processing module 200 is specifically configured to: inputting the implicit moving features, the embedded coded user static information and the position coded time of the place of entry into the LSTM neural network to obtain a second implicit state variable; inputting the second hidden state variable into a time decoder to obtain an intensity function, and obtaining the exponential distribution of the time dimension according to the intensity function; wherein the time decoder comprises a fully-connected layer and the output of the last fully-connected layer is processed via an exponential function; inputting the second hidden state variable into a first place decoder to obtain polynomial distribution based on a time point process, and obtaining the polynomial distribution of the space dimensionality according to the polynomial distribution based on the time point process; wherein the first site decoder includes fully connected layers, and an output dimension of a last fully connected layer is set to a total number of numbered regions.

The trajectory generation model training device provided by the invention obtains a second hidden state variable by inputting the implicit moving characteristics, the embedded coded user static information and the position coded time of entering a place into an LSTM neural network, obtains the intensity function by inputting the second hidden state variable into a time decoder, obtains the exponential distribution of a time dimension according to the intensity function, inputs the second hidden state variable into a first place decoder, obtains the polynomial distribution based on a time point process, obtains the polynomial distribution of a space dimension according to the polynomial distribution based on the time point process, and realizes the reliable acquisition of the exponential distribution of the time dimension and the polynomial distribution of the space dimension.

According to the trajectory generation model training device provided by the invention, the historical movement data comprises user static information, location information, time for entering a location, stay time after entering the location and location POI information; the encoding processing module 100 is specifically configured to: inputting the time of entering the place into a position coding network to obtain the time of entering the place through position coding; respectively inputting the stay time, the user static information, the place information and the place POI information into an embedded coding network to obtain the stay time, the user static information, the place information and the place POI information which are coded in an embedded mode; inputting the time of entering the place after the position coding, the stay time after the embedded coding, the user static information, the place information and the place POI information into a full connection layer, and splicing to obtain a second vector; inputting the second vector into an LSTM neural network to obtain a third hidden state variable; and respectively inputting the third hidden state variable into a mean encoder and a variance encoder to obtain the hidden motion characteristics corresponding to the historical motion data.

The track generation model training device provided by the invention is characterized in that historical movement data comprising user static information, location entering time, residence time after location entering and location POI information are set, a coded vector is obtained by coding a reverse generation model, the coded vector is spliced into a complete vector through a full connection layer, the spliced complete vector outputs a third hidden state variable through an LSTM network, and the third hidden state variable is respectively input into a mean value coder and a variance coder to obtain hidden movement characteristics of corresponding historical movement data, so that the reliable acquisition of the hidden movement characteristics is further realized, and the information of the hidden movement characteristics is enriched.

According to the trajectory generation model training apparatus provided by the present invention, the decoding processing module 200 is specifically configured to: inputting the implicit moving features, the embedded coded user static information and the position coded time of the place of entry into the LSTM neural network to obtain a fourth implicit state variable; inputting the fourth hidden state variable into a time decoder to obtain an intensity function, and obtaining the exponential distribution of the time dimension according to the intensity function; wherein the time decoder comprises a fully-connected layer and the output of the last fully-connected layer is processed via an exponential function; inputting the fourth hidden state variable into a second place decoder to obtain polynomial distribution based on a time point process, inputting the fourth hidden state variable into a third place decoder to obtain polynomial distribution based on regional function consideration, and performing weighted summation on the polynomial distribution based on the time point process and the polynomial distribution based on the regional function consideration to obtain polynomial distribution of the spatial dimension; wherein the second location decoder comprises a fully connected layer, and an output dimension of a last fully connected layer is set to a total number of numbered regions; the third site decoder includes fully-connected layers, and an output dimension of one of the fully-connected layers is equal to a POI data dimension.

The track generation model training device provided by the invention obtains a fourth hidden state variable by inputting the implicit moving characteristics, embedded coded user static information and position coded time for entering a place into an LSTM neural network, obtains the intensity function by inputting the fourth hidden state variable into a time decoder, obtains the exponential distribution of a time dimension according to the intensity function, inputs the fourth hidden state variable into a second place decoder and a third place decoder, and obtains the polynomial distribution of a space dimension by weighted summation, thereby realizing the reliable acquisition of the exponential distribution of the time dimension and the polynomial distribution of the space dimension, and enriching the information of the exponential distribution of the time dimension and the polynomial distribution of the space dimension.

According to the trajectory generation model training device provided by the present invention, the training module 300, when being used for training and optimizing the variation time point process model formed by the inverse generation model and the trajectory generation model, is specifically configured to: calculating KL divergence of approximate distribution and posterior distribution of the implicit movement characteristics, and taking the KL divergence as a loss function; eliminating integral calculation of an evidence lower bound ELBO in the KL divergence by using a reparameterization skill; and based on the loss function, optimizing by using a back propagation algorithm to obtain model network parameters.

The trajectory generation model training device provided by the invention adopts a variational framework optimized by taking the ELBO as a target, and generates a model and an approximate distribution model through cooperative optimization, so that the problem that a probability distribution layer is unguided in a process model based on a neural network time point is solved, and the training of network parameters is finally realized; the model effectively introduces expert knowledge by combining classical probability distribution, and simultaneously can well model continuous time distribution and indefinite long tracks, thereby effectively overcoming the unbalance of moving tracks and greatly improving the robustness and the universality of the model.

The following describes the trajectory generation device provided by the present invention, and the trajectory generation device described below and the trajectory generation method described above may be referred to correspondingly.

Fig. 9 is a schematic structural diagram of a trajectory generation device provided by the present invention. As shown in fig. 9, the apparatus includes a distribution information acquiring module 100, a location and stay time information acquiring module 200, an arrival time acquiring module 300 of a next area, and a loop processing module 400, wherein: the distribution information obtaining module 100 is configured to: carrying out position coding on the time reaching the previous region to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension; the location and dwell time information acquisition module 200 is configured to: sampling the polynomial distribution of the spatial dimension to obtain information of the previous area, and sampling the exponential distribution of the time dimension to obtain the residence time in the previous area; the arrival time acquisition module 300 of the next area is configured to: obtaining the time for reaching the next area according to the time for reaching the previous area and the residence time in the previous area; the loop processing module 400 is configured to: circularly executing the processes until the sum of the residence time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

According to the track generation device provided by the invention, the track generation is carried out by adopting a track generation model constructed by a loop iteration method based on historical mobile data, the track generation model overcomes the requirements on data balance such as time interval of a data time sequence, sequence length and the like, and has stronger flexibility and modeling capability, and high adaptability and robustness to unbalanced data, so that more accurate track generation is realized.

Fig. 10 illustrates a physical structure diagram of an electronic device, and as shown in fig. 10, the electronic device may include: a processor (processor)1010, a communication Interface (Communications Interface)1020, a memory (memory)1030, and a communication bus 1040, wherein the processor 1010, the communication Interface 1020, and the memory 1030 communicate with each other via the communication bus 1040. Processor 1010 may invoke logic instructions in memory 1030 to perform a trajectory generation model training method comprising: inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data; inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension; training and optimizing a variation time point process model formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training is finished; or executing a trajectory generation method, the method comprising: carrying out position coding on the time reaching the previous region to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension; sampling the polynomial distribution of the spatial dimension to obtain information of the previous area, and sampling the exponential distribution of the time dimension to obtain the residence time in the previous area; obtaining the time for reaching the next area according to the time for reaching the previous area and the residence time in the previous area; circularly executing the processes until the sum of the residence time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

Furthermore, the logic instructions in the memory 1030 can be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform a trajectory generation model training method provided by the above methods, the method comprising: inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data; inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension; training and optimizing a variation time point process model formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training is finished; or executing a trajectory generation method, the method comprising: carrying out position coding on the time reaching the previous region to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension; sampling the polynomial distribution of the spatial dimension to obtain information of the previous area, and sampling the exponential distribution of the time dimension to obtain the residence time in the previous area; obtaining the time for reaching the next area according to the time for reaching the previous area and the residence time in the previous area; circularly executing the processes until the sum of the residence time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the trajectory generation model training methods provided above, the method comprising: inputting historical movement data into a reverse generation model to obtain implicit movement characteristics corresponding to the historical movement data; inputting the implicit movement characteristics into a track generation model to respectively obtain exponential distribution of time dimension and polynomial distribution of space dimension; training and optimizing a variation time point process model formed by the reverse generation model and the track generation model, and obtaining the track generation model for track generation after training is finished; or executing a trajectory generation method, the method comprising: carrying out position coding on the time reaching the previous region to obtain a position coding vector; sampling from the standard normal distribution to obtain a hidden state vector; inputting the position coding vector, the hidden state vector and the embedded coded user static information into a track generation model to obtain exponential distribution of time dimension and polynomial distribution of space dimension; sampling the polynomial distribution of the spatial dimension to obtain information of the previous area, and sampling the exponential distribution of the time dimension to obtain the residence time in the previous area; obtaining the time for reaching the next area according to the time for reaching the previous area and the residence time in the previous area; circularly executing the processes until the sum of the residence time reaches a preset value; and updating the value of the time reaching the previous area to the value of the time reaching the next area when the above processes are circularly executed.

The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.

Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

29页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种电动汽车充电方案的推荐技术

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!