CN109300310B - Traffic flow prediction method and device - Google Patents

Traffic flow prediction method and device Download PDF

Info

Publication number
CN109300310B
CN109300310B CN201811415714.3A CN201811415714A CN109300310B CN 109300310 B CN109300310 B CN 109300310B CN 201811415714 A CN201811415714 A CN 201811415714A CN 109300310 B CN109300310 B CN 109300310B
Authority
CN
China
Prior art keywords
traffic flow
prediction
sets
training data
data sets
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811415714.3A
Other languages
Chinese (zh)
Other versions
CN109300310A (en
Inventor
吴壮伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811415714.3A priority Critical patent/CN109300310B/en
Publication of CN109300310A publication Critical patent/CN109300310A/en
Application granted granted Critical
Publication of CN109300310B publication Critical patent/CN109300310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • G08G1/0129Traffic data processing for creating historical data or processing based on historical data

Abstract

The invention is suitable for the technical field of traffic flow prediction, and provides a traffic flow prediction method and a device, wherein the method comprises the following steps: obtaining a plurality of historical traffic flows with time series to obtain a historical data set, respectively adjusting the historical data set according to N preset adjustment sets to obtain N training data sets with different distribution patterns, constructing N prediction models according to N training data sets, obtaining the current traffic flow, selecting a prediction model matched with the current traffic flow from the N prediction models for prediction to obtain a traffic flow prediction value, a prediction model is built by adjusting the historical data set, the prediction model matched with the current traffic flow is selected for prediction, so that the training data set is the same as the current traffic flow distribution, the prediction model can be selected according to the current traffic flow, therefore, the prediction model is dynamically adjusted along with real-time data, the traffic flow prediction with higher accuracy is realized, and more reasonable travel routes are timely recommended for drivers.

Description

Traffic flow prediction method and device
Technical Field
The invention belongs to the technical field of traffic flow prediction, and particularly relates to a traffic flow prediction method and device.
Background
With the increase of automobile holding capacity and traffic flow, traffic jam frequently occurs, and real-time and accurate traffic flow prediction is the key of intelligent traffic control and dispersion, and is beneficial to efficient travel of people. The traffic flow prediction is divided into long-term traffic flow prediction and short-term traffic flow prediction according to time span, particularly, the short-term traffic prediction has burstiness and randomness, and is always a hot point of research of domestic and foreign traffic experts and scholars.
For short-time traffic flow prediction, a traditional prediction method is to construct a prediction model according to historical traffic flow and predict current data according to the prediction model. Because the road traffic system is a time-varying and non-stationary random system, short-time traffic flow has high uncertainty due to various reasons such as climate factors, psychological states of drivers, emergencies, traffic accidents and the like, the distribution of the current traffic flow is no longer consistent with the distribution of historical traffic flow, and inaccurate traffic flow prediction can be caused if a prediction model of a traditional prediction method is still adopted for prediction. Meanwhile, due to the fact that real-time traffic conditions are sudden, a prediction model of the traditional prediction method cannot be dynamically adjusted along with current real-time data, the prediction model is not suitable for the current data any more, the traffic flow cannot be accurately predicted, and a more reasonable travel route cannot be timely recommended to a driver.
Disclosure of Invention
In view of this, embodiments of the present invention provide a traffic flow prediction method and apparatus, so as to solve the problems that the traffic flow cannot be accurately predicted and a more reasonable travel route cannot be timely recommended in the prior art.
A first aspect of an embodiment of the present invention provides a traffic flow prediction method, including:
obtaining a plurality of historical traffic flows with a time sequence to obtain a historical data set;
respectively adjusting the historical data sets according to N preset adjustment sets to obtain N training data sets with different distribution modes, wherein N is a positive integer;
constructing N prediction models according to N training data sets;
and obtaining the current traffic flow, and selecting a prediction model matched with the current traffic flow from the N prediction models for prediction to obtain a traffic flow prediction value.
In one possible implementation, the number of elements in all preset adjustment sets is the same and equal to the number of elements in the historical data set;
the distribution pattern is determined by a mean and a variance;
respectively adjusting the historical data sets according to N preset adjustment sets to obtain N training data sets with different distribution patterns, wherein the method comprises the following steps:
and adding or multiplying the N preset adjustment sets with elements at corresponding positions of the historical data sets respectively to obtain N training data sets, wherein the N training data sets have different distribution modes.
In one possible implementation manner, the obtaining of the current traffic flow and the selecting of the prediction model matched with the current traffic flow from the N prediction models for prediction to obtain the predicted traffic flow value includes:
obtaining the traffic flow in a first time period before the current moment as on-line test data, wherein the on-line test data is used for predicting the traffic flow at the current moment;
respectively inputting the on-line test data to the N prediction models to predict the traffic flow at the current moment to obtain N predicted values;
acquiring a monitoring value of the traffic flow at the current moment;
respectively calculating the accuracy of the N predicted values according to the monitoring values;
selecting a prediction model corresponding to a prediction value with accuracy rate meeting a preset condition as a prediction model matched with the current traffic flow;
and predicting the traffic flow in a second time period after the current moment according to the selected prediction model to obtain a traffic flow predicted value.
In a possible implementation manner, the predicting the traffic flow in a second time period after the current time according to the selected prediction model to obtain a predicted traffic flow value includes:
judging the number of the selected prediction models;
if the number is one, predicting the traffic flow in a second time period after the current moment according to a selected prediction model to obtain a predicted value of the traffic flow;
if the number is multiple, respectively predicting the traffic flow in a second time period after the current time according to the selected multiple prediction models to obtain multiple intermediate prediction values, calculating the average value of the multiple intermediate prediction values, and determining the average value as a traffic flow prediction value.
In a possible implementation manner, the constructing N prediction models according to N training data sets includes:
initializing the N training data sets to obtain N initialization result sets;
and training the N initialization result sets according to the long-short term memory network LSTM to obtain N prediction models.
In a possible implementation manner, the initializing the N training data sets to obtain N initialization result sets includes:
carrying out stabilization processing on the N training data sets;
and carrying out standardization processing on the N training data sets subjected to the stabilization processing to obtain N initialization result sets.
In one possible implementation, the smoothing process includes: difference processing;
the normalizing the smoothed training data set comprises: mapping the training data set subjected to the smoothing processing into the range of [ -1, 1 ].
A second aspect of an embodiment of the present invention provides a traffic flow prediction device, including:
the acquisition module is used for acquiring a plurality of historical traffic flows with time series to obtain a historical data set;
the adjusting module is used for respectively adjusting the historical data sets according to N preset adjusting sets to obtain N training data sets with different distribution modes, wherein N is a positive integer;
the construction module is used for constructing N prediction models according to the N training data sets;
the acquisition module is also used for acquiring the current traffic flow;
and the prediction module is used for selecting a prediction model matched with the current traffic flow from the N prediction models to predict to obtain a traffic flow prediction value.
A third aspect of an embodiment of the present invention provides a terminal device, including:
a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method as described above when executing the computer program.
A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, including:
the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps of the method described above.
The invention provides a traffic flow prediction method and a traffic flow prediction device, wherein the method comprises the following steps: obtaining a plurality of historical traffic flows with time series to obtain a historical data set, respectively adjusting the historical data set according to N preset adjustment sets to obtain N training data sets with different distribution patterns, wherein N is a positive integer, constructing N prediction models according to N training data sets to obtain the current traffic flow, selecting a prediction model matched with the current traffic flow from the N prediction models to predict to obtain a traffic flow predicted value, a prediction model is built by adjusting the historical data set, the prediction model matched with the current traffic flow is selected for prediction, so that the training data set is the same as the current traffic flow distribution, the prediction model can be selected according to the current traffic flow, therefore, the prediction model is dynamically adjusted along with real-time data, the traffic flow prediction with higher accuracy is realized, and more reasonable travel routes are timely recommended for drivers.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of a traffic flow prediction method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating an implementation of a traffic flow prediction method according to a second embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating an implementation of a traffic flow prediction method according to a third embodiment of the present invention;
fig. 4 is a schematic view of a traffic flow predicting apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic diagram of a terminal device according to a fifth embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Fig. 1 is a schematic flow chart of an implementation of a traffic flow prediction method according to an embodiment of the present invention, and as shown in fig. 1, an implementation subject of the present embodiment is a traffic flow prediction device, and the traffic flow prediction method according to the present embodiment includes:
and 11, acquiring a plurality of historical traffic flows with time series to obtain a historical data set.
The traffic flow prediction device acquires a plurality of historical traffic flows having a time series offline as a historical data set. For example, obtaining the traffic flow at a certain traffic intersection: the traffic flow is source1 at 1-2, is source2 and … at 2-3, and is source n at n-n +1, so as to obtain a historical data set [ source1, source2, … and source n ], wherein n is a positive integer.
And step 12, respectively adjusting the historical data sets according to the N preset adjustment sets to obtain N training data sets with different distribution modes. Wherein N is a positive integer.
Optionally, the number of elements in all preset adjustment sets is the same and equal to the number of elements in the historical data set. Since the preset adjustment sets are used for adjusting the historical data sets, the number of elements of all the preset adjustment sets is equal to the number of elements of the historical data sets.
Optionally, the distribution pattern is determined by a mean and a variance. Presetting a plurality of mean threshold values and a plurality of variance threshold values, and adjusting the mean threshold values and the variance threshold values according to the distribution condition of the historical data set to obtain a plurality of training data sets with different distribution modes. The number N of the distribution modes is determined by the number of the mean threshold values and the number of the variance threshold values. For example, taking two mean thresholds (a first mean threshold and a second mean threshold) and two variance thresholds (a first variance threshold and a second variance threshold) as examples, defining that the mean is smaller than the first mean threshold as "mean small", not smaller than the first mean threshold and smaller than the second mean threshold as "mean medium", not smaller than the second mean threshold as "mean large", defining that the variance is smaller than the first variance threshold as "variance small", not smaller than the first variance threshold and smaller than the second variance threshold as "variance medium", and not smaller than the second variance threshold as "variance large", thereby combining to obtain 9 distribution patterns, as specifically shown in table 1.
TABLE 1 9 distribution patterns partitioned according to two mean thresholds and two variance thresholds
Small mean and variance The mean value is medium and the variance is small Large mean and small variance
Small mean and middle variance Mean and variance Large mean and middle variance
Small mean and large variance Mean medium and variance large Large mean and large variance
Wherein the first mean threshold, the second mean threshold, the first variance threshold, and the second variance threshold are pre-set according to the mean and variance of the historical data set.
Still taking the above example as an example, the number of elements of all the preset adjustment sets of the traffic intersection is N, the 1 st preset adjustment set is [ noise11, noise12, …, noise1N ], the 2 nd preset adjustment set is [ noise21, noise22, …, noise2N ], …, and the nth preset adjustment set is [ noise1, noise2, …, noise nn ]. And adjusting the historical data set according to the I preset adjustment set to obtain an I training data set [ mergeI1, mergeI2, … and mergeIn ], wherein I is a positive integer not greater than N.
Optionally, the historical data sets are respectively adjusted according to N preset adjustment sets to obtain N training data sets with different distribution patterns, which may specifically include: and adding the N preset adjustment sets with elements at corresponding positions of the historical data sets respectively to obtain N training data sets, wherein the N training data sets have different distribution modes.
For example, the history data set [ source1, source2, …, source ] is adjusted by using the I-th preset adjustment set [ noiseI1, noiseI2, …, noiseIn ], to obtain the 1 st training data set [ mergeI1, mergeI2, …, mergeIn ], wherein the mergeI1 is source1+ noiseI1, the mergeI2 is source2+ noiseI2, …, and the mergeIn is source + noiseIn. Specifically, assume that the acquired historical data set is [2.3, 2.5, 2.7, 2.5, 2.3], a preset adjustment set is [0.1, 0.2, 0.4, 0.2, 0.1], and the training data set obtained by adding the elements at the corresponding positions of the two sets is [2.4, 2.7, 3.1, 2.7, 2.4 ].
Optionally, the historical data sets are respectively adjusted according to N preset adjustment sets to obtain N training data sets with different distribution patterns, which may specifically include: and multiplying the N preset adjustment sets with elements at corresponding positions of the historical data sets respectively to obtain N training data sets, wherein the N training data sets have different distribution modes.
For example, the historical data set [ source1, source2, …, source ] is adjusted using the I-th preset adjustment set [ noiseI1, noiseI2, …, noiseIn ], resulting in the 1 st training data set [ mergeI1, mergeI2, …, mergeIn ], where mergeI1 is source1 by noiseI1, mergeI2 is source2 by noiseI2, …, and mergeIn is source by noiseIn ]. Specifically, assume that the acquired historical data set is [2.3, 2.5, 2.7, 2.5, 2.3], a preset adjustment set is [0.1, 0.2, 0.4, 0.2, 0.1], and the training data set obtained by multiplying the elements at the corresponding positions of the two sets is [0.23, 0.5, 1.08, 0.5, 0.23 ].
And step 13, constructing N prediction models according to the N training data sets.
The N training data sets obtained in step 12 are constructed into N prediction models according to preset processing steps, for example, the ith training data set [ mergeI1, mergeI2, …, mergeIn ] is processed according to preset processing steps to obtain an ith prediction model, which is labeled modelI.
And step 14, acquiring the current traffic flow.
And step 15, selecting a prediction model matched with the current traffic flow from the N prediction models for prediction to obtain a traffic flow prediction value.
The traffic flow prediction device selects a prediction model matched with the obtained current traffic flow distribution from the N prediction models, and predicts by adopting the selected prediction model to obtain a traffic flow prediction value according with the current traffic flow distribution.
For example, if the current data is integrated with a distribution mode with a small mean and a small variance, a matched prediction model is selected from the N prediction models, a training data set for constructing the selected prediction model is also integrated with a distribution mode with a small mean and a small variance, and if the current data is integrated with a distribution mode with a medium mean and a large variance, the selected prediction model is a prediction model constructed according to a training data set of a distribution mode with a medium mean and a large variance, so that the construction of the prediction model is guaranteed to be matched with the current data set, and the predicted traffic flow is more accurate.
The embodiment provides a traffic flow prediction method, which includes: obtaining a plurality of historical traffic flows with time series to obtain a historical data set, respectively adjusting the historical data set according to N preset adjustment sets to obtain N training data sets with different distribution patterns, wherein N is a positive integer, constructing N prediction models according to N training data sets to obtain the current traffic flow, selecting a prediction model matched with the current traffic flow from the N prediction models to predict to obtain a traffic flow predicted value, a prediction model is built by adjusting the historical data set, the prediction model matched with the current traffic flow is selected for prediction, so that the training data set is the same as the current traffic flow distribution, the prediction model can be selected according to the current traffic flow, therefore, the prediction model is dynamically adjusted along with real-time data, the traffic flow prediction with higher accuracy is realized, and more reasonable travel routes are timely recommended for drivers.
Fig. 2 is a schematic flow chart of an implementation of a traffic flow prediction method according to a second embodiment of the present invention, and as shown in fig. 2, an execution subject of this embodiment is a traffic flow prediction device, and this embodiment is step 13 shown in fig. 1: one possible implementation manner for constructing N prediction models according to N training data sets specifically includes:
and step 21, initializing the N training data sets to obtain N initialization result sets.
Optionally, the initialization includes a smoothing process and a normalization process.
Because the road traffic system is a time-varying non-stationary random system, generally acquired traffic flow is non-stationary data, and a training data set obtained by adjustment is also non-stationary data, in order to research the variation trend of future traffic flow, the non-stationary traffic flow data is subjected to stationary processing, then the stationary processed traffic flow data is standardized to complete initialization, and the initialized traffic flow data is input into a network for training to obtain a prediction model.
In this embodiment, the N training data sets are smoothed, and the N training data sets that are smoothed are normalized to obtain N initialization result sets. The normalizing the smoothed training data set comprises: mapping the training data set subjected to the smoothing processing into the range of [ -1, 1 ].
The smoothing processing includes difference processing, and performing first difference is called first-order difference, and when the training data cannot be integrated into a smooth time sequence by using the first-order difference, high-order difference can be used to make the training data become the smooth time sequence.
And step 22, training the N initialization result sets according to the long-short term memory network LSTM to obtain N prediction models.
Take an LSTM network with a middle layer as 100 dimensions as an example:
an input layer: firstly, respectively inputting N initialization result sets into an LSTM network;
entering the LSTM 1 layer: the data of the current input node is 1 dimension, and the data of the current output node is 100 dimensions;
entering the LSTM 2 layer: the data of the current input node is 100 dimensions, and the data of the current output node is 100 dimensions;
entering LSTM 3 layer: the data of the current input node is 100-dimensional, and the data of the current output node is 1-dimensional;
an output layer: and outputting the predicted value of the next time.
Optionally, in this embodiment, a dropout layer is adopted, and in the training process of the deep learning network, for the neural network unit, the neural network unit is temporarily discarded from the network according to a certain probability, so as to increase the speed of the LSTM network, and meanwhile, overfitting can be avoided in the training process. Preferably, in the present embodiment, the dropout layer temporary discarding rate is 20%.
The traffic flow prediction method provided by this embodiment initializes N training data sets, trains N initialization result sets according to the LSTM network to obtain N prediction models, realizes that training data sets of a plurality of different distribution modes construct a plurality of different prediction models, adapts to traffic flow data predictions of a plurality of different distributions, selects a prediction model matched with a current traffic flow to perform prediction, dynamically adjusts the prediction model along with real-time data, improves accuracy of traffic flow prediction compared with the prior art that only one prediction model is used for traffic flow prediction, and can timely recommend a more reasonable travel route for a driver.
Fig. 3 is a schematic flow chart of an implementation of a traffic flow prediction method according to a third embodiment of the present invention, as shown in fig. 3, an implementation subject of this embodiment is a traffic flow prediction device, and this embodiment is a possible implementation manner of step 14 and step 15 shown in fig. 1, and specifically includes:
and step 31, obtaining the traffic flow in a first time period before the current time as on-line test data, wherein the on-line test data is used for predicting the traffic flow at the current time.
In this embodiment, first, data of a first time period at the current time is obtained to perform a test. For example, the traffic flow within the latest 1 hour at the present time is acquired as the on-line test data.
And 32, respectively inputting the on-line test data to the N prediction models to predict the traffic flow at the current moment to obtain N predicted values.
And inputting the online test data into the N prediction models to obtain N predicted traffic flow predicted values at the current moment.
And step 33, acquiring the monitoring value of the traffic flow at the current moment.
And the traffic flow predicting device acquires the monitoring value of the traffic flow at the current moment again, wherein the monitoring value is the measured value of the traffic flow.
And step 34, respectively calculating the accuracy of the N predicted values according to the monitoring values.
Comparing the monitored value with the N predicted values according to
Figure BDA0001879406660000101
And calculating the accuracy of the I-th predicted value, wherein y is a monitoring value, and x is the I-th predicted value. The rate of accuracy is [0, 1]]The closer the rate is to 1, the higher the accuracy, at which time the predicted x is closer to the monitored value y.
And step 35, selecting a prediction model corresponding to the prediction value with the accuracy rate meeting the preset condition as the prediction model matched with the current traffic flow.
And determining a prediction model corresponding to the prediction value with the accuracy rate meeting the preset condition as the prediction model. The preset condition is preset, for example, the preset condition is that the accuracy is greater than or equal to 0.9.
And step 36, predicting the traffic flow in a second time period after the current moment according to the selected prediction model to obtain a traffic flow prediction value.
Predicting the traffic flow in a second time period after the current moment according to the selected prediction model to obtain a traffic flow prediction value, wherein the number of the selected prediction models is judged; if the number is one, predicting the traffic flow in a second time period after the current moment according to a selected prediction model to obtain a predicted value of the traffic flow; if the number is multiple, respectively predicting the traffic flow in a second time period after the current time according to the selected multiple prediction models to obtain multiple intermediate prediction values, calculating the average value of the multiple intermediate prediction values, and determining the average value as a traffic flow prediction value. Specifically, if only 1 prediction model with accuracy rate greater than or equal to 0.9 meets the preset condition is used as the predicted value of the traffic flow, and when 3 prediction models with accuracy rate greater than or equal to 0.9 meet the preset condition are used, the average value of the 3 predicted values predicted by the 3 prediction models is used as the predicted value of the traffic flow. Optionally, when the prediction models meeting the preset conditions are multiple, the weight can be distributed to each predicted value according to the accuracy degree, the accuracy is high, the weight is large, the accuracy is low, the weight is small, then the average value is calculated, the accuracy of the calculated predicted value is higher, and more reasonable travel routes can be timely recommended for the driver.
Fig. 4 is a schematic diagram of a traffic flow prediction device according to a fourth embodiment of the present invention, and as shown in fig. 4, the traffic flow prediction device according to the fourth embodiment includes:
the obtaining module 41 is configured to obtain a plurality of historical traffic flows with a time series, so as to obtain a historical data set.
And an adjusting module 42, configured to adjust the historical data sets respectively according to N preset adjusting sets, so as to obtain N training data sets with different distribution patterns, where N is a positive integer.
And a construction module 43, configured to construct N prediction models according to the N training data sets.
The obtaining module 41 is further configured to obtain a current traffic flow.
And the prediction module 44 is configured to select a prediction model matched with the current traffic flow from the N prediction models to perform prediction, so as to obtain a traffic flow prediction value.
The traffic flow prediction apparatus provided in this embodiment is used to implement the traffic flow prediction method described in the first embodiment, where the functions of each module may refer to the corresponding descriptions in the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 5 is a schematic diagram of a terminal device according to a fifth embodiment of the present invention, and as shown in fig. 5, the terminal device 5 according to the embodiment includes: a processor 50, a memory 51 and a computer program 52, such as a traffic prediction program, stored in said memory 51 and executable on said processor 50. The processor 50, when executing the computer program 52, implements the steps in each of the embodiments of the traffic flow prediction method described above, such as the steps 11 to 15 shown in fig. 1. Alternatively, the processor 50, when executing the computer program 52, implements the functions of the modules in the above-described embodiments of the traffic flow prediction device, such as the functions of the modules 41 to 44 shown in fig. 4.
Illustratively, the computer program 52 may be partitioned into one or more modules/units that are stored in the memory 51 and executed by the processor 50 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 52 in the terminal device 5. For example, the computer program 52 may be divided into an acquisition module, an adjustment module, a construction module, and a prediction module (unit module in the virtual device), and each module has the following specific functions:
the acquisition module is used for acquiring a plurality of historical traffic flows with time series to obtain a historical data set;
the adjusting module is used for respectively adjusting the historical data sets according to N preset adjusting sets to obtain N training data sets with different distribution modes, wherein N is a positive integer;
the construction module is used for constructing N prediction models according to the N training data sets;
the acquisition module is also used for acquiring the current traffic flow;
and the prediction module is used for selecting a prediction model matched with the current traffic flow from the N prediction models to predict to obtain a traffic flow prediction value.
The terminal device 5 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device 5 may include, but is not limited to, a processor 50 and a memory 51. It will be understood by those skilled in the art that fig. 5 is only an example of the terminal device 5, and does not constitute a limitation to the terminal device 5, and may include more or less components than those shown, or combine some components, or different components, for example, the terminal device 5 may further include an input-output device, a network access device, a bus, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used for storing the computer program and other programs and data required by the terminal device 5. The memory 51 may also be used to temporarily store data that has been output or is to be output.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is merely used as an example, and in practical applications, the foregoing function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the terminal device is divided into different functional units or modules to perform all or part of the above-described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; 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; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (9)

1. A traffic flow prediction method, comprising:
obtaining a plurality of historical traffic flows with a time sequence to obtain a historical data set;
respectively adjusting the historical data sets according to N preset adjustment sets to obtain N training data sets with different distribution modes, wherein N is a positive integer;
constructing N prediction models according to N training data sets;
obtaining the current traffic flow, and selecting a prediction model matched with the current traffic flow from N prediction models to predict to obtain a traffic flow prediction value;
the number of elements of all preset adjustment sets is the same and is equal to the number of elements of the historical data set;
the distribution pattern is determined by a mean and a variance;
the adjusting the historical data sets according to the N preset adjusting sets respectively to obtain N training data sets with different distribution patterns, including:
and adding or multiplying the N preset adjustment sets with elements at corresponding positions of the historical data sets respectively to obtain N training data sets, wherein the N training data sets have different distribution modes.
2. The method according to claim 1, wherein the obtaining the current traffic flow, and selecting a prediction model matched with the current traffic flow from the N prediction models for prediction to obtain a predicted traffic flow value comprises:
obtaining the traffic flow in a first time period before the current moment as on-line test data, wherein the on-line test data is used for predicting the traffic flow at the current moment;
respectively inputting the on-line test data to the N prediction models to predict the traffic flow at the current moment to obtain N predicted values;
acquiring a monitoring value of the traffic flow at the current moment;
respectively calculating the accuracy of the N predicted values according to the monitoring values;
selecting a prediction model corresponding to a prediction value with accuracy rate meeting a preset condition as a prediction model matched with the current traffic flow;
and predicting the traffic flow in a second time period after the current moment according to the selected prediction model to obtain a traffic flow predicted value.
3. The method according to claim 2, wherein the predicting the traffic flow in a second time period after the current time according to the selected prediction model to obtain a predicted traffic flow value comprises:
judging the number of the selected prediction models;
if the number is one, predicting the traffic flow in a second time period after the current moment according to a selected prediction model to obtain a predicted value of the traffic flow;
if the number is multiple, respectively predicting the traffic flow in a second time period after the current time according to the selected multiple prediction models to obtain multiple intermediate prediction values, calculating the average value of the multiple intermediate prediction values, and determining the average value as a traffic flow prediction value.
4. The method of claim 1, wherein the constructing N predictive models from N training data sets comprises:
initializing the N training data sets to obtain N initialization result sets;
and training the N initialization result sets according to the long-short term memory network LSTM to obtain N prediction models.
5. The method of claim 4, wherein initializing the N training data sets to obtain N initialization result sets comprises:
carrying out stabilization processing on the N training data sets;
and carrying out standardization processing on the N training data sets subjected to the stabilization processing to obtain N initialization result sets.
6. The method of claim 5, wherein the smoothing process comprises: difference processing;
the normalizing the smoothed training data set comprises: mapping the training data set subjected to the smoothing processing into the range of [ -1, 1 ].
7. A traffic flow prediction device characterized by comprising:
the acquisition module is used for acquiring a plurality of historical traffic flows with time series to obtain a historical data set;
the adjusting module is used for respectively adjusting the historical data sets according to N preset adjusting sets to obtain N training data sets with different distribution modes, wherein N is a positive integer;
the construction module is used for constructing N prediction models according to the N training data sets;
the acquisition module is also used for acquiring the current traffic flow;
the prediction module is used for selecting a prediction model matched with the current traffic flow from the N prediction models to carry out prediction to obtain a traffic flow prediction value;
the number of elements of all preset adjustment sets is the same and is equal to the number of elements of the historical data set;
the distribution pattern is determined by a mean and a variance;
the adjusting the historical data sets according to the N preset adjusting sets respectively to obtain N training data sets with different distribution patterns, including:
and adding or multiplying the N preset adjustment sets with elements at corresponding positions of the historical data sets respectively to obtain N training data sets, wherein the N training data sets have different distribution modes.
8. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN201811415714.3A 2018-11-26 2018-11-26 Traffic flow prediction method and device Active CN109300310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811415714.3A CN109300310B (en) 2018-11-26 2018-11-26 Traffic flow prediction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811415714.3A CN109300310B (en) 2018-11-26 2018-11-26 Traffic flow prediction method and device

Publications (2)

Publication Number Publication Date
CN109300310A CN109300310A (en) 2019-02-01
CN109300310B true CN109300310B (en) 2021-09-17

Family

ID=65143432

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811415714.3A Active CN109300310B (en) 2018-11-26 2018-11-26 Traffic flow prediction method and device

Country Status (1)

Country Link
CN (1) CN109300310B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859469A (en) * 2019-02-15 2019-06-07 重庆邮电大学 A kind of vehicle flowrate prediction technique based on integrated LSTM neural network
CN110009429B (en) * 2019-04-10 2021-04-16 金瓜子科技发展(北京)有限公司 Method and device for predicting flow data and computer equipment
CN111833594B (en) * 2019-04-23 2022-07-05 杭州海康威视系统技术有限公司 Traffic flow prediction method, traffic flow prediction device, electronic device, and storage medium
CN110222739A (en) * 2019-05-23 2019-09-10 中国银行股份有限公司 Model construction, site cash Demand Forecast method, apparatus and storage medium
CN111862585B (en) * 2019-07-23 2021-11-02 北京嘀嘀无限科技发展有限公司 System and method for traffic prediction
CN112884190B (en) * 2019-11-29 2023-11-03 杭州海康威视数字技术股份有限公司 Flow prediction method and device
CN111091708B (en) * 2019-12-13 2020-11-03 中国科学院深圳先进技术研究院 Vehicle track prediction method and device
CN111402579A (en) * 2020-02-29 2020-07-10 深圳壹账通智能科技有限公司 Road congestion degree prediction method, electronic device and readable storage medium
CN111401609B (en) * 2020-03-04 2023-01-17 平安科技(深圳)有限公司 Prediction method and prediction device for traffic flow time series
CN111679952B (en) * 2020-06-08 2023-09-19 中国银行股份有限公司 Alarm threshold generation method and device
CN112149901B (en) * 2020-09-23 2024-04-16 华北电力科学研究院有限责任公司 Steam turbine low-pressure final-stage pressure field prediction method and device
CN112652172B (en) * 2021-01-19 2022-01-25 东南大学 Road section traffic volume analysis method based on vehicle GPS track
CN115311842A (en) * 2021-05-07 2022-11-08 杭州海康威视数字技术股份有限公司 Traffic flow prediction model training and traffic flow prediction method, device and electronic equipment
CN113222266B (en) * 2021-05-22 2022-11-25 深圳市创仁科技有限公司 Prediction model matching method based on large daily water meter data
CN114596702B (en) * 2021-11-12 2023-07-04 南方科技大学 Traffic state prediction model construction method and traffic state prediction method
CN114999182B (en) * 2022-05-25 2023-07-04 中国人民解放军国防科技大学 Traffic flow prediction method, device and equipment based on LSTM feedback mechanism

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646534A (en) * 2013-11-22 2014-03-19 江苏大学 A road real time traffic accident risk control method
CN105701571A (en) * 2016-01-13 2016-06-22 南京邮电大学 Short-term traffic flow prediction method based on nerve network combination model
CN105788249A (en) * 2014-12-16 2016-07-20 高德软件有限公司 Traffic flow prediction method, prediction model generation method and device
CN106033425A (en) * 2015-03-11 2016-10-19 富士通株式会社 A data processing device and a data processing method
CN108229724A (en) * 2017-12-06 2018-06-29 华南理工大学 A kind of transport data stream Forecasting Methodology in short-term based on Spatial-temporal Information Fusion

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8392343B2 (en) * 2010-07-21 2013-03-05 Yahoo! Inc. Estimating probabilities of events in sponsored search using adaptive models

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646534A (en) * 2013-11-22 2014-03-19 江苏大学 A road real time traffic accident risk control method
CN105788249A (en) * 2014-12-16 2016-07-20 高德软件有限公司 Traffic flow prediction method, prediction model generation method and device
CN106033425A (en) * 2015-03-11 2016-10-19 富士通株式会社 A data processing device and a data processing method
CN105701571A (en) * 2016-01-13 2016-06-22 南京邮电大学 Short-term traffic flow prediction method based on nerve network combination model
CN108229724A (en) * 2017-12-06 2018-06-29 华南理工大学 A kind of transport data stream Forecasting Methodology in short-term based on Spatial-temporal Information Fusion

Also Published As

Publication number Publication date
CN109300310A (en) 2019-02-01

Similar Documents

Publication Publication Date Title
CN109300310B (en) Traffic flow prediction method and device
US20210188290A1 (en) Driving model training method, driver identification method, apparatuses, device and medium
CN103490956A (en) Self-adaptive energy-saving control method, device and system based on traffic predication
Csikós et al. Traffic speed prediction method for urban networks—An ANN approach
CN113743673A (en) Power load prediction method during typhoon
CN103489034A (en) Method and device for predicting and diagnosing online ocean current monitoring data
CN112862546A (en) User loss prediction method and device, computer equipment and storage medium
CN112700162A (en) Method and device for evaluating running state of rail transit air conditioner
CN114912720A (en) Memory network-based power load prediction method, device, terminal and storage medium
CN113592192A (en) Short-term power load prediction method and device and terminal equipment
CN113821903A (en) Temperature control method and device, modular data center and storage medium
CN111930602A (en) Performance index prediction method and device
CN110826196B (en) Industrial equipment operation data processing method and device
CN110969296A (en) Electric heating load prediction method and device and terminal equipment
CN116739649A (en) User response potential evaluation method and device
CN110782063B (en) Regional congestion degree prediction method and device
CN112766535B (en) Building load prediction method and system considering load curve characteristics
CN113705929A (en) Spring festival holiday load prediction method based on load characteristic curve and typical characteristic value fusion
CN111626446B (en) Method, apparatus, device and storage medium for determining device maintenance time
Ming-Jun et al. Fuzzy state transition and Kalman filter applied in short-term traffic flow forecasting
CN113298309A (en) Method, device and terminal for predicting traffic congestion state
Chen et al. Improved Long Short-Term Memory-Based Periodic Traffic Volume Prediction Method
CN111178637A (en) Power grid short-term load prediction method and device
Zhang et al. Short-term traffic flow prediction based on multivariable phase space reconstruction and LSSVM
Jin Feasibility Analysis and Countermeasures of Psychological Health Training Methods for Volleyball Players Based on Artificial Intelligence Technology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant