Disclosure of Invention
The present application is directed to solving at least one of the problems in the prior art. Therefore, the application provides a travel time prediction method, a travel time prediction system and a storage medium, which can realize travel time prediction.
An embodiment of a first aspect of the present application provides a travel time prediction method, including:
acquiring road network and track data;
obtaining final road representation data according to the road network and the track data;
splicing the final road representation data with the historical driving time of the corresponding road to obtain a first input parameter;
carrying out normal distribution sampling on the road final representation data to obtain a second input parameter;
inputting the first input parameter and the second input parameter into an objective function for generating a countermeasure network to obtain a prediction result;
and fitting by adopting Gaussian distribution to obtain travel time prediction distribution data.
According to the travel time prediction method of the embodiment of the first aspect of the application, at least the following beneficial effects are achieved: according to the travel time prediction method, the road network and the track data are obtained firstly, and then the final road representation data are obtained according to the road network and the track data; splicing the final representation data of the road and the historical driving time of the corresponding road to obtain a first input parameter; carrying out normal distribution sampling on the final road representation data to obtain a second input parameter; inputting the first input parameter and the second input parameter into an objective function for generating the countermeasure network to obtain a prediction result; the travel time prediction distribution data are obtained by adopting Gaussian distribution to perform fitting, the travel time prediction can be realized, and people can plan a travel plan conveniently.
According to some embodiments of the first aspect of the present application, the deriving road final representation data from the road network and the trajectory data comprises:
obtaining road embedding according to the road network;
obtaining road traffic information of nodes corresponding to the road network according to the road network and the track data;
carrying out graph convolution operation on the road traffic information to obtain a graph learning result;
and obtaining final road representation data according to the road embedding and the image learning result.
According to some embodiments of the first aspect of the present application, the road network is a directed graph G ═ (V, E) of mutually interleaved roads, where V ═ V-1,v2,...,vNIs a set of nodes in the road network, E ═ E1,e2,...,eMIs a set of roads in the road network.
According to some embodiments of the first aspect of the application, the trajectory data is a set of sequential sample points pi={lati,loni,Ti},latiCharacterizing the latitude, lon, of the ith pointiCharacterizing the longitude, T, of the ith pointiThe timestamp characterizing the ith point.
According to some embodiments of the first aspect of the present application, the performing a graph convolution operation according to real-time traffic information of nodes of the road network to obtain a graph learning result includes:
according to a first formula, a graph convolution network is adopted to construct a spatial dependency,
wherein Relu is an activation function, X is road traffic information at a corresponding moment,
is composed of
Is a unit matrix, W
0Is a weight matrix of the first layer graph convolutional network, W
1A weight matrix for the second-layer graph convolution network, sigma (-) representing the sigmoid activation function, X
GCAnd the picture learning result is obtained.
According to some embodiments of the first aspect of the application, the objective function is as follows:
wherein s characterizes the first input parameter, z characterizes the second input parameter, G characterizes the generative model, D characterizes the discriminative model, pzCumulative distribution function, p, characterizing random variablesdataCharacterizing travel time distribution in a dataset, Es characterizing pdata(s)Ez characterizes pz(s)The mathematical expectation of (a) is that,
and the prediction result is obtained.
According to some embodiments of the first aspect of the application, the objective function is as follows:
wherein x characterizes the first input parameter, z characterizes the second input parameter, y characterizes a specific time period, G characterizesGeneration of model, D characterization of identification model, pzCumulative distribution function, p, characterizing random variablesdataCharacterizing travel time distribution in a dataset, Es characterizing pdata(s)Ez characterizes pz(s)The mathematical expectation of (a) is that,
and the prediction result is obtained.
According to some embodiments of the first aspect of the present application, the travel time prediction distribution data is calculated as follows:
wherein si characterizes said first input parameter, ti characterizes said corresponding historical travel time of said prediction, N (-) characterizes a Gaussian distribution, μ(s)i) Characterizing from siLearned average, σ(s), of two fully connected layersi) Characterizing from siThe standard deviation values of the two fully connected layers learned,
P(ti|si) And predicting distribution data for the travel time.
An embodiment of a second aspect of the present application provides a travel time prediction system, including:
at least one memory;
at least one processor;
at least one program;
the programs are stored in the memory, and the processor executes at least one of the programs to implement:
a method of predicting travel time as claimed in any one of the embodiments of the first aspect of the present application.
In a third aspect, embodiments of the present application provide a computer-readable storage medium, which stores computer-executable signals for performing:
a method of predicting travel time as claimed in any one of the embodiments of the first aspect of the present application.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different from that in the flowcharts. The terms etc. in the description and claims and the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In the description of the present application, if there are first and second described only for the purpose of distinguishing technical features, it is not understood that relative importance is indicated or implied or that the number of indicated technical features or the precedence of the indicated technical features is implicitly indicated or implied.
In the description of the present application, unless otherwise expressly limited, terms such as set, mounted, connected and the like should be construed broadly, and those skilled in the art can reasonably determine the specific meaning of the terms in the present application by combining the detailed contents of the technical solutions.
Referring to fig. 1, an embodiment of the first aspect of the present application provides a travel time prediction method, including, but not limited to, step S110, step S120, step S130, step S140, step S150, and step S160.
Step S110, acquiring road network and track data;
step S120, obtaining final road representation data according to the road network and the track data;
step S130, splicing the final road representation data with the historical driving time of the corresponding road to obtain a first input parameter;
step S140, carrying out normal distribution sampling on the road final representation data to obtain a second input parameter;
step S150, inputting the first input parameter and the second input parameter into a target function for generating the countermeasure network to obtain a prediction result;
and step S160, fitting by adopting Gaussian distribution to obtain travel time prediction distribution data.
According to the travel time prediction method, the road network and the track data are obtained firstly, and then the final road representation data are obtained according to the road network and the track data; splicing the final representation data of the road and the historical driving time of the corresponding road to obtain a first input parameter; carrying out normal distribution sampling on the final road representation data to obtain a second input parameter; inputting the first input parameter and the second input parameter into an objective function for generating the countermeasure network to obtain a prediction result; the travel time prediction distribution data are obtained by adopting Gaussian distribution to perform fitting, travel time prediction can be realized, people can plan a travel plan conveniently, and data support is provided for an intelligent transportation system, so that urban traffic planning and management can be completed conveniently.
Referring to fig. 2 and 3, step S120 may include, but is not limited to, step S210, step S220, step S230, and step S240.
Step S210, obtaining road embedding according to a road network;
step S220, obtaining road traffic information of nodes corresponding to the road network according to the road network and the track data;
step S230, carrying out graph convolution operation on the road traffic information to obtain a graph learning result;
and step S240, obtaining road final representation data according to the road embedding and image learning results.
It can be understood that the road network may be collected by an intelligent transportation system, and the road network is a directed graph G ═ (V, E) composed of roads that are interlaced with each other, where V ═ E1,v2,...,vNIs a set of nodes in the road network, E ═ E1,e2,...,eMIs the set of roads in the road network. For sparsity of the road network, the road network is stored using the neighboring matrix as a data structure, let the neighboring matrix be M ∈ RN×N. If node viAnd vjIf there is a road in between, then M (i, j) is 1, otherwise M (i, j) is 0, where 1 < i < N, 1 < j < M. For road e in directed graph GiAnd n-type characteristic information thereof is expressed as { c0,c1,…,cn) The characteristic information of the road may include a road number, a road type, a number of lanes, a date and a time point, etc., wherein the date refers to a certain day of each week, and may be monday or tuesday, for example. The characteristic information of the road may further include other information, which is not limited in the embodiment of the present application, and the embodiment of the present application inputs the characteristic information of the road into the neural network of the graph, so that road embedding, that is, discretization embedding, can be obtained. Road embedding can convert features from static text representation to low-dimensional numerical representation, and features with similar semantic representation and close distance can be embedded into an embedding space. Embedding learning layer pass and weight matrix W epsilon RN×EMatrix multiplication is performed to convert the features into embedded values, where N is the number of roads and E is the dimension of the embedded feature. The embedded features are computationally efficient and can reduce the size of the input dimension.
It will be appreciated that the trajectory data is a set of sequential sample points pi={lati,loni,Ti},latiCharacterizing the latitude, lon, of the ith pointiCharacterizing the longitude, T, of the ith pointiThe timestamp characterizing the ith point. According to the travel time prediction method, the road traffic information of the nodes of the road network can be obtained according to the road network and the track data, and the road traffic information comprises the traffic flow speed and the road average vehicle passing speed.
It can be understood that, in the travel time prediction method according to the embodiment of the first aspect of the present application, in step S230, the obtaining of the graph learning result by performing the graph convolution operation according to the road traffic information of the nodes of the road network includes:
according to a first formula, a graph convolution network is adopted to construct a spatial dependency,
wherein Relu is an activation function, X is road traffic information at a corresponding moment,
is composed of
Is a unit matrix, W
0Is a weight matrix of the first layer graph convolutional network, W
1A weight matrix for the second-layer graph convolution network, sigma (-) representing the sigmoid activation function, X
GCThe results of the image learning are shown.
It will be appreciated that the graph convolution network is a matrix multiplication process with a time complexity expressed as:
Time~O(N2·L)
n is the space size of the graph network, L is the size of the feature, the time complexity of the graph convolution network is simple, and the training time can be shortened by adopting the graph convolution network.
It can be understood that, referring to fig. 3, the road final representation data is subjected to normal distribution sampling to obtain a second input parameter, the second input parameter is denoted as z, a pseudo-time prediction is generated when z passes through the generation model Generator, and the pseudo-time prediction is spliced with z to be expressed as g (z).
It is understood that, in step S150, the objective function is as follows:
wherein s represents a first input parameter, z represents a second input parameter, G represents a generative model Generator, D represents an identification model Discriminator, pzCumulative distribution function, p, characterizing random variablesdataCharacterizing travel time distribution in a dataset, Es characterizing pdata(s)Ez characterizes pz(s)The mathematical expectation of (a) is that,
It is understood that, in other embodiments, in step S150, the objective function may also be as follows:
wherein x represents a first input parameter, z represents a second input parameter, y represents a specific time period, G represents a generative model Generator, D represents a discriminant model, pzCumulative distribution function, p, characterizing random variablesdataCharacterizing travel time distribution in a dataset, Es characterizing pdata(s)Ez characterizes pz(s)The mathematical expectation of (a) is that,
to predict the outcome, y characterizes a particular time period, e.g., y may be morning, noon, afternoon, evening, early morning, etc.
It is understood that, in step S160, the travel time prediction distribution data is calculated as follows:
wherein si represents a first input parameter, ti represents the corresponding historical travel time of the prediction, N (-) represents a Gaussian distribution, μ(s)i) Characterizing from siLearned average, σ(s), of two fully connected layersi) Characterizing from siThe standard deviation values of the two fully connected layers learned,
P(ti|si) Distribution data is predicted for travel time.
It can be understood that, in step S160, fitting is performed by using gaussian distribution to obtain a predicted time distribution, where the obtained predicted time distribution is:
wherein several roads may form a route Rj={ei,...,enA set of roads, representing an ordered sequence of paths for a route. T isRjCharacterisation route RjPredicted time distribution of (1), teiCharacterizing a road eiThe predicted temporal distribution of (2).
An embodiment of a second aspect of the present application provides a travel time prediction system, including:
at least one memory;
at least one processor;
at least one program;
the program is stored in the memory, and the processor executes at least one program to implement:
a method of predicting travel time as claimed in any one of the embodiments of the first aspect of the present application.
The processor and memory may be connected by a bus or other means.
The memory, which is a non-transitory readable storage medium, may be used to store non-transitory software instructions as well as non-transitory executable instructions. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. It will be appreciated that the memory can alternatively comprise memory located remotely from the processor, and that such remote memory can be coupled to the processor via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor executes the non-transitory software instructions, instructions and signals stored in the memory, thereby implementing various functional applications and data processing, i.e. implementing the travel time prediction method of the embodiment of the first aspect.
The non-transitory software instructions and instructions required to implement the travel time prediction method of the above-described embodiment are stored in the memory, and when executed by the processor, perform the travel time prediction method of the first aspect embodiment or the travel time prediction method of the second aspect embodiment of the present application, for example, perform the above-described method steps S110 to S160 in fig. 1, and method steps S210 to S240 in fig. 2.
In a third aspect, embodiments of the present application provide a computer-readable storage medium, where a computer-executable signal is stored in the computer-readable storage medium, and the computer-executable signal is configured to perform:
a method of predicting travel time as claimed in any one of the embodiments of the first aspect of the present application.
For example, the above-described method steps S110 to S160 in fig. 1, and the method steps S210 to S240 in fig. 2 are performed.
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 the 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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
From the above description of embodiments, those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable signals, data structures, instruction modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer-readable signals, data structures, instruction modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
The embodiments of the present application have been described in detail with reference to the drawings, but the present application is not limited to the embodiments, and various changes can be made without departing from the spirit of the present application within the knowledge of those skilled in the art.