CN117252307A - Traffic prediction method, traffic prediction device, computer equipment and storage medium - Google Patents

Traffic prediction method, traffic prediction device, computer equipment and storage medium Download PDF

Info

Publication number
CN117252307A
CN117252307A CN202311510238.4A CN202311510238A CN117252307A CN 117252307 A CN117252307 A CN 117252307A CN 202311510238 A CN202311510238 A CN 202311510238A CN 117252307 A CN117252307 A CN 117252307A
Authority
CN
China
Prior art keywords
transition probability
prediction model
station
target
data
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.)
Granted
Application number
CN202311510238.4A
Other languages
Chinese (zh)
Other versions
CN117252307B (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.)
Beijing Apoco Blue Technology Co ltd
Original Assignee
Beijing Apoco Blue Technology 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 Beijing Apoco Blue Technology Co ltd filed Critical Beijing Apoco Blue Technology Co ltd
Priority to CN202311510238.4A priority Critical patent/CN117252307B/en
Publication of CN117252307A publication Critical patent/CN117252307A/en
Application granted granted Critical
Publication of CN117252307B publication Critical patent/CN117252307B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Abstract

The application relates to a traffic prediction method, a traffic prediction device, a computer device and a storage medium. The method comprises the following steps: acquiring characteristic data corresponding to each block in a target area; obtaining vehicle circulation data of each station in each block at each preset time period according to the characteristic data and the vehicle circulation prediction model; determining a target transition probability matrix under each preset period based on the feature data, the vehicle circulation data, the first transition probability prediction model and the second transition probability prediction model; processing a target transition probability matrix of each preset time period and a station state matrix of the target time period based on a multi-order Markov algorithm to obtain a vehicle flow result of each station of the target time period; the preset time period comprises a target time period; the vehicle flow results are used to assist in vehicle scheduling decisions. By adopting the method, the accuracy of flow prediction can be improved.

Description

Traffic prediction method, traffic prediction device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of shared bicycle scheduling technologies, and in particular, to a traffic prediction method, a device, a computer device, and a storage medium.
Background
With the development of the technology of sharing single vehicles, the sharing single vehicles become an important travel transportation tool in cities, and the sharing single vehicle dispatching reasonably arranges the distribution and the allocation of the sharing single vehicles through intelligent algorithms and data analysis so as to improve the vehicle utilization rate and meet the user demands.
In the conventional method, the traffic flow of each station can be predicted by using a first-order Markov chain. Specifically, the transition probability in each shared bicycle is determined according to station state data (or vehicle state data), a state transition matrix is generated, and the flow of each station is predicted based on the station state (or vehicle state) and the transition probability matrix so as to assist in the decision of vehicle scheduling.
However, in the conventional method for predicting the vehicle circulation situation between stations, since the circulation of the vehicles is affected by various factors, the accuracy of the conventional flow prediction method using the first-order markov chain for the flow prediction of each station is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a traffic prediction method, apparatus, computer device, and storage medium.
In a first aspect, the present application provides a traffic prediction method, including:
Acquiring characteristic data corresponding to each block in a target area;
obtaining vehicle circulation data of each station in each block at each preset time period according to the characteristic data and the vehicle circulation prediction model;
determining a target transition probability matrix under each preset period based on the characteristic data, the vehicle circulation data, a first transition probability prediction model and a second transition probability prediction model;
processing the target transition probability matrix of each preset time period and the station state matrix of the target time period based on a multi-order Markov algorithm to obtain a vehicle flow result of each station of the target time period; the preset period includes the target period; the vehicle flow results are used to assist in vehicle scheduling decisions.
In one embodiment, the feature data includes block features, period features, and cross features, and the vehicle circulation prediction model is a gradient lift tree model; obtaining the vehicle circulation data of each station in each block at each preset time interval according to the characteristic data and the vehicle circulation prediction model, wherein the vehicle circulation data comprises the following steps:
extracting features of the block features, the time period features and the cross features according to the gradient lifting tree model to obtain feature vectors;
And obtaining the vehicle circulation data of each station in each block at each preset time period based on the gradient lifting tree model and the feature vector.
In one embodiment, the determining the target transition probability matrix for each of the preset time periods based on the feature data, the vehicle circulation data, the first transition probability prediction model, and the second transition probability prediction model includes:
acquiring the number of initial vehicles contained in each station at the initial moment; the initial time is the first preset time period;
obtaining the number of vehicles in each preset period according to the initial number of vehicles and the vehicle circulation data in each preset period;
obtaining a first transition probability matrix based on the characteristic data, the number of vehicles in each preset period and a first transition probability prediction model, and obtaining a second transition probability matrix based on the characteristic data, the number of vehicles in each preset period and a second transition probability prediction model;
determining a third transition probability matrix corresponding to a preset period according to historical vehicle circulation data in the preset period;
And carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix to obtain a target transition probability matrix of each station in each preset period.
In one embodiment, the determining, according to the historical vehicle circulation data in the preset period, the third transition probability matrix corresponding to the preset period includes:
acquiring historical vehicle circulation data of the preset period under the same characteristic in the preset period;
calculating the historical vehicle circulation probability of each station in the preset period according to the historical vehicle circulation data;
and constructing a third transition probability matrix according to the historical vehicle circulation probability of each station.
In one embodiment, the weighted averaging of the first transition probability matrix, the second transition probability matrix, and the third transition probability matrix to obtain the target transition probability matrix of each station in each preset period includes:
constructing a test sample according to the characteristic data;
inputting the test sample into the first transition probability prediction model and the second transition probability prediction model respectively to obtain a first accuracy rate and a second accuracy rate;
Acquiring a weighting coefficient corresponding to a third transition probability matrix, and determining a first weighting coefficient corresponding to the first transition probability prediction model and a second weighting coefficient corresponding to the second transition probability prediction model based on the weighting coefficient, the first accuracy and the second accuracy;
and respectively carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix based on the first weight coefficient, the second weight coefficient and the preset weight coefficient to obtain a target transition probability matrix of each station in each preset period.
In one embodiment, before the determining the target transition probability matrix for each of the preset time periods based on the feature data, the vehicle circulation data, the first transition probability prediction model, and the second transition probability prediction model, the method further includes:
acquiring sample characteristic data;
taking block feature data, time period feature data and cross feature data corresponding to the stations in the preset time period in the sample feature data and the number of vehicles of each station as training samples, and taking the transition probability between each station and other stations in the preset time period in the history feature data as a sample label corresponding to the training samples;
And respectively training the first transition probability prediction model to be trained and the second transition probability prediction model to be trained through the training samples and sample labels corresponding to the training samples to obtain a first transition probability prediction model after training and a second transition probability prediction model after training.
In one embodiment, the obtaining the vehicle flow result of each station in the target period according to the target transition probability matrix of each preset period and the station state matrix of the target period includes:
determining a station state matrix of each preset period according to the number of vehicles in each preset period;
and obtaining a vehicle flow result of each station in the target period based on a multi-order Markov algorithm, the target transition probability matrix of each preset period and the station state matrix of the target period.
In a second aspect, the present application further provides a flow prediction apparatus, including:
the first acquisition module is used for acquiring characteristic data corresponding to each block in the target area;
the first prediction module is used for obtaining vehicle circulation data of each station in each block in each preset period according to the characteristic data and the vehicle circulation prediction model;
The second prediction module is used for processing the target transition probability matrix of each preset time period and the station state matrix of the target time period based on a multi-order Markov algorithm, and determining the target transition probability matrix of each preset time period;
the vehicle flow determining module is used for obtaining a vehicle flow result of each station of the target period according to the target transition probability matrix of each preset period and the station state matrix of the target period; the preset period includes the target period; the vehicle flow results are used to assist in vehicle scheduling decisions.
In one embodiment, the first prediction module is specifically configured to:
extracting features of the block features, the time period features and the cross features according to the gradient lifting tree model to obtain feature vectors;
and obtaining the vehicle circulation data of each station in each block at each preset time period based on the gradient lifting tree model and the feature vector.
In one embodiment, the second prediction module is specifically configured to:
acquiring the number of initial vehicles contained in each station at the initial moment; the initial time is the first preset time period;
Obtaining the number of vehicles in each preset period according to the initial number of vehicles and the vehicle circulation data in each preset period;
obtaining a first transition probability matrix based on the characteristic data, the number of vehicles in each preset period and a first transition probability prediction model, and obtaining a second transition probability matrix based on the characteristic data, the number of vehicles in each preset period and a second transition probability prediction model;
determining a third transition probability matrix corresponding to a preset period according to historical vehicle circulation data in the preset period;
and carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix to obtain a target transition probability matrix of each station in each preset period.
In one embodiment, the second prediction module is specifically configured to:
acquiring historical vehicle circulation data of the preset period under the same characteristic in the preset period;
calculating the historical vehicle circulation probability of each station in the preset period according to the historical vehicle circulation data;
and constructing a third transition probability matrix according to the historical vehicle circulation probability of each station.
In one embodiment, the second prediction module is specifically configured to:
constructing a test sample according to the characteristic data;
inputting the test sample into the first transition probability prediction model and the second transition probability prediction model respectively to obtain a first accuracy rate and a second accuracy rate;
acquiring a weighting coefficient corresponding to a third transition probability matrix, and determining a first weighting coefficient corresponding to the first transition probability prediction model and a second weighting coefficient corresponding to the second transition probability prediction model based on the weighting coefficient, the first accuracy and the second accuracy;
and respectively carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix based on the first weight coefficient, the second weight coefficient and the preset weight coefficient to obtain a target transition probability matrix of each station in each preset period.
In one embodiment, the apparatus further comprises:
the second acquisition module is used for acquiring sample characteristic data;
the determining module is used for taking block feature data, time period feature data and cross feature data corresponding to the stations in the preset time period in the sample feature data and the number of vehicles of each station as training samples, and taking the transition probability between each station in the preset time period in the history feature data and other stations as a sample label corresponding to the training samples;
The training module is used for respectively training the first transition probability prediction model to be trained and the second transition probability prediction model to be trained through the training sample and the sample label corresponding to the training sample to obtain a first transition probability prediction model after training and a second transition probability prediction model after training.
In one embodiment, the vehicle flow determination module is specifically configured to:
determining a station state matrix of each preset period according to the number of vehicles in each preset period;
and obtaining a vehicle flow result of each station in the target period based on a multi-order Markov algorithm, the target transition probability matrix of each preset period and the station state matrix of the target period.
In a third aspect, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring characteristic data corresponding to each block in a target area;
obtaining vehicle circulation data of each station in each block at each preset time period according to the characteristic data and the vehicle circulation prediction model;
Determining a target transition probability matrix under each preset period based on the characteristic data, the vehicle circulation data, a first transition probability prediction model and a second transition probability prediction model;
obtaining a vehicle flow result of each station of the target period according to the target transition probability matrix of each preset period and a station state matrix of the target period; the preset period includes the target period; the vehicle flow results are used to assist in vehicle scheduling decisions.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring characteristic data corresponding to each block in a target area;
obtaining vehicle circulation data of each station in each block at each preset time period according to the characteristic data and the vehicle circulation prediction model;
determining a target transition probability matrix under each preset period based on the characteristic data, the vehicle circulation data, a first transition probability prediction model and a second transition probability prediction model;
obtaining a vehicle flow result of each station of the target period according to the target transition probability matrix of each preset period and a station state matrix of the target period; the preset period includes the target period; the vehicle flow results are used to assist in vehicle scheduling decisions.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
acquiring characteristic data corresponding to each block in a target area;
obtaining vehicle circulation data of each station in each block at each preset time period according to the characteristic data and the vehicle circulation prediction model;
determining a target transition probability matrix under each preset period based on the characteristic data, the vehicle circulation data, a first transition probability prediction model and a second transition probability prediction model;
obtaining a vehicle flow result of each station of the target period according to the target transition probability matrix of each preset period and a station state matrix of the target period; the preset period includes the target period; the vehicle flow results are used to assist in vehicle scheduling decisions.
According to the traffic prediction method, the traffic prediction device, the computer equipment and the storage medium, the traffic flow prediction model is used for determining the traffic flow data of each station, the target transition probability matrix is obtained according to the first transition probability prediction model and the second transition probability prediction model, the influence of various factors on the traffic flow is considered through the transition probability prediction models of various types, the refinement degree of the prediction result obtained by the single prediction model is improved, the target transition probability matrix is obtained through the first transition probability prediction model and the second transition probability prediction model, the error caused by the single prediction model can be reduced, the target transition probability matrix of each preset period and the station state matrix of the target period are processed through the multi-order Markov algorithm, the prediction of the traffic flow of each station in the target period is realized, and the accuracy of the prediction of the traffic flow result can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for a person having ordinary skill in the art.
FIG. 1 is a flow chart of a flow prediction method in one embodiment;
FIG. 2 is a flow diagram of a method of predicting vehicle circulation data in one embodiment;
FIG. 3 is a flow diagram of a method of determining a first transition probability matrix, a second transition probability matrix, and a third transition probability matrix in one embodiment;
FIG. 4 is a schematic diagram of a first transition probability matrix, a second transition probability matrix, and a third transition probability matrix in one embodiment;
FIG. 5 is a flow diagram of a detailed method of determining a third transition probability matrix in one embodiment;
FIG. 6 is a flow diagram of a method of determining a target transition probability matrix in one embodiment;
FIG. 7 is a flow diagram of a method of constructing training samples and sample tags in one embodiment;
FIG. 8 is a flow chart of a method of determining a vehicle flow result in one embodiment;
FIG. 9 is a block diagram of a flow prediction device in one embodiment;
fig. 10 is an internal structural view of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, a traffic prediction method is provided, where this embodiment is applied to a terminal to illustrate the method, it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step 102, obtaining feature data corresponding to each block in the target area.
In this embodiment of the present application, the target area may be a city area, or may be an area that provides a shared bicycle service in a city area, and the block may be an H3 block (Uber H3, a space division and spatial index system for the earth), or may be a shared bicycle service block or a shared bicycle scheduling block that is set for user travel customization according to a behavior feature of a user. For example, the terminal may obtain the latitude and longitude coordinates of the target area and each block in the target area.
Furthermore, the terminal can obtain the feature data corresponding to each station in each block in the target area through a shared bicycle platform database, a public database, a third party data provider and other approaches. For example, the terminal may obtain, from the data source, feature data corresponding to each block in the target area through an API (Application Programming Interface, application program interface) and a data request according to the selected data source. The feature data is used to reflect the features of the user's use of the shared bicycle behavior under features of different dimensions.
And 104, obtaining the vehicle circulation data of each station in each block at each preset time period according to the characteristic data and the vehicle circulation prediction model.
In the embodiment of the present application, the preset period may be in units of hours, and several preset hours may be used as the predicted period. Because the parameters required by the first transition probability prediction model and the second transition probability prediction model are vehicle circulation data of a future preset period, and the future data cannot be directly obtained, in the embodiment of the application, the vehicle circulation data of the future preset period are predicted through the vehicle circulation prediction model, and then the vehicle circulation data corresponding to the station of each preset period in the future is obtained. Specifically, the feature data corresponding to each block in the target area acquired by the terminal may be feature data in each hour, and the feature data corresponding to each station is used for predicting the vehicle circulation data for each station through the vehicle circulation prediction model, so as to obtain the vehicle circulation data of each station in each block in each hour. The vehicle circulation data characterize the inflow and outflow of vehicles at each station within each hour. The vehicle circulation prediction model may be a time series analysis, a machine learning model, or the like.
And step 106, determining a target transition probability matrix under each preset period based on the characteristic data, the vehicle circulation data, the first transition probability prediction model and the second transition probability prediction model.
In the embodiment of the present application, the target transition probability matrix is a parameter in a multi-order markov chain, and represents the probability of the vehicle flowing in and/or flowing out to other stations in each station, and the vehicle flow result of the station can be predicted through the target transition probability matrix. Therefore, accurate estimation is required for the target transition probability matrix, the terminal can input the characteristic data corresponding to each station and the predicted vehicle circulation data into the first transition probability prediction model and the second transition probability prediction model, calculate according to the output results of the first transition probability prediction model and the second transition probability prediction model, finally obtain the target transition probability matrix under each preset time period, and further predict the vehicle flow result of each station through the transition probability matrix of each station under each preset time period.
And step 108, processing the target transition probability matrix of each preset time period and the station state matrix of the target time period based on a multi-order Markov algorithm to obtain a vehicle flow result of each station of the target time period.
Wherein the preset period includes a target period.
Wherein the vehicle flow results are used to assist in vehicle scheduling decisions.
In this embodiment of the present invention, the station state matrix is a state space matrix in a multi-order markov chain, and the terminal may obtain the state of each station in the target area according to the database of the shared bicycle platform, so as to construct the station state matrix, for example, city a includes a plurality of stations, and the terminal may construct the station state matrix according to the number of vehicles included in each station at the current moment. Based on the state matrix of each station at the current moment and the target transition probability matrix of each preset time period, the terminal can finally obtain the vehicle inflow and outflow result of each station in the target time period according to a multi-order Markov algorithm, and the vehicle inflow and outflow result is used as the vehicle flow result of the station. The multi-order markov algorithm is also called a multi-order markov chain or a multi-order markov model, and the multi-order markov algorithm may be a multi-order non-stationary markov algorithm or other forms of multi-order markov algorithms, which are not limited in the embodiments of the present application.
Optionally, after determining the vehicle flow result of the initial target period, the terminal may further calculate the target transition probability of the next preset period after the initial period according to a multi-order markov algorithm, that is, without using the foregoing transition probability prediction model (that is, the first transition probability prediction model and the second transition probability prediction model) to predict the transition probability matrix of the next preset period, and directly calculate the transition probability matrix by using the multi-order markov algorithm until the next preset period is the target period, and then predict the vehicle flow based on the obtained target transition probability matrix of each preset period before the target period and the station state space of the target period.
Optionally, the terminal may calculate the vehicle flow result of each preset period according to the station state matrix at the current moment and the multi-order markov algorithm respectively until the vehicle flow result of the target period is obtained.
In the traffic prediction method, the vehicle circulation data of each station is determined through the vehicle circulation prediction model, the target transition probability matrix is obtained according to the first transition probability prediction model and the second transition probability prediction model, the influence of various factors on the vehicle circulation is considered through the transition probability prediction models of various types, the refinement degree of the prediction result obtained by the single prediction model is improved, the target transition probability matrix is obtained through the first transition probability prediction model and the second transition probability prediction model, the error caused by the single prediction model can be reduced, and finally the target transition probability matrix of each preset period and the station state matrix of the target period are processed through the multi-order Markov algorithm, so that the prediction of the vehicle traffic of each station in the target period is realized, and the accuracy of the prediction of the vehicle traffic result can be improved.
In one embodiment, the feature data comprises block features, period features and cross features, and the vehicle circulation prediction model is a gradient lift tree model; the input of the first prediction model and the second prediction model is the stock of the number of vehicles at each station in each period, and the stock of vehicles at each station needs to be calculated before the prediction is performed by using the first prediction model and the second prediction model, as shown in fig. 2, step 104 obtains the vehicle circulation data of each station in each block under each preset period according to the feature data and the vehicle circulation prediction model, including:
And 202, extracting features of the block features, the time period features and the cross features according to the gradient lifting tree model to obtain feature vectors.
The block characteristics may include, among others, a block Area, POI (Point Of Interest ), AOI (Area Of Interest), road network, thermal value, population (number, distribution), traffic, altitude, presence or absence Of stations, POI number, POI weight sum, important POI type, road network number, road network intersection, network grade, etc. The time period characteristics include whether peak, visibility, temperature, rainfall, pressure, wind speed, wind direction, relative humidity, somatosensory temperature, cloud cover, real-time weather, PM2.5 (Particulate Matter 2.5.5 may be pulmonary particulate matter) concentration, and the like. The cross feature is a block-period cross feature, and may include a current number of riding vehicles, a number of riding vehicles out of the block, a number of riding vehicles in a previous preset period and a next preset period of the block, a number of riding vehicles out of the block, a maximum value, a minimum value, an average value and a median of the number of riding vehicles in the same preset period for approximately seven days, a maximum value, a minimum value, an average value and a median of the same preset period for approximately four days, a real-time order number, a real-time traffic volume, a traffic volume of a vehicle of an H3 block where a current block of the same preset period is located, a traffic condition, a road segment number corresponding to the traffic condition, and the like.
In this embodiment of the present application, the gradient lifting tree model may be an XGBoost model, where the terminal extracts block features, period features and cross features from feature data of each block in the target area, and performs feature stitching on the block features, the period features and the cross features, and optionally, the terminal may further perform standardized processing or dimension reduction operation on the feature data, so as to finally obtain feature vectors corresponding to each station in each block.
Step 204, obtaining vehicle circulation data of each station in each block at each preset time period based on the gradient lifting tree model and the feature vector.
In the embodiment of the application, the terminal predicts possible vehicle circulation conditions in each preset time period in the future based on the feature data of the preset time period in the future acquired at the current moment in the application process according to the learned strategy in the XGBoost model training, and obtains the vehicle circulation data of each station in each preset time period.
Aiming at the training process of the XGBoost model, the terminal takes the characteristic data of each block as a training sample and takes the historical vehicle circulation data corresponding to each characteristic data as a sample label. In each round of iteration for training samples, XGBoost trains a new decision tree according to the difference (i.e., residual) between the prediction result of the previous round and the sample label of the training sample to further improve the prediction capability of the model, and in the iterative process, the complexity of the model is controlled by limiting the complexity of each tree (such as the maximum depth of the tree, the minimum gain of node splitting, etc.) and introducing regularization terms (such as L1, L2 regularization), and the model is optimized by a gradient descent method. And calculating the gradient of the loss function according to the prediction result of the current model, and updating model parameters by using the gradient so as to minimize the loss function. And obtaining the XGBoost model after training until the loss function of the XGBoost model meets the preset training condition.
In this embodiment, the feature data including multiple dimension features corresponding to each station is predicted by the gradient lifting tree model, so that vehicle circulation data of each preset period can be obtained, and then the prediction accuracy of the target transition probability matrix for each preset period is improved.
In one embodiment, after obtaining the vehicle transition data of all stations in each period, the terminal may predict the target transition probability matrix of each period of each station based on the vehicle transition data, where a calculation process of the target transition probability matrix is shown in fig. 3, and step 106 determines the target transition probability matrix under each preset period based on the feature data, the vehicle circulation data, the first transition probability prediction model and the second transition probability prediction model, including:
step 302, obtaining the initial number of vehicles contained in each station at the initial moment.
Wherein the initial time is the first preset time period.
In the embodiment of the present application, in the application process, the initial time may be the current time, so the terminal may directly obtain, as the initial vehicle number, the vehicle number of each station in the current period according to the shared bicycle service platform.
Step 304, obtaining the number of vehicles in each preset period according to the initial number of vehicles and the vehicle circulation data in each preset period.
In the embodiment of the application, the terminal can obtain the number of vehicles corresponding to each station in the next preset time period according to the vehicle circulation data of the next preset time period at the initial time until the number of vehicles corresponding to each station in each preset time period is obtained. For example, the initial number of vehicles at station S1 is 5, and initial time 1:00, the next preset period is 1:00 to 2:00, the vehicle circulation data in the preset period is that 5 sharing single vehicles flow out and 2 sharing single vehicles flow in, and the preset period is 1:00 to 2:00 vehicles number 2 (5-5+2); the preset period is 2:00 to 3:00 vehicle circulation data are that 4 sharing single vehicles flow in and 2 sharing single vehicles flow out, and then 2:00 to 3: the number of vehicles at station S1 corresponding to the preset period of 00 is 4 (5-5+2-2+4).
Step 306, obtaining a first transition probability matrix based on the feature data, the number of vehicles in each preset period and the first transition probability prediction model, and obtaining a second transition probability matrix based on the feature data, the number of vehicles in each preset period and the second transition probability prediction model.
The first transition probability prediction model may be a logical regression model, and the second transition probability prediction model may be a tree model.
In the embodiment of the application, the terminal respectively inputs the feature data and the number of vehicles in each preset period into a first transition probability prediction model and a second transition probability prediction model, and respectively obtains a first transition probability matrix and a second transition probability matrix corresponding to each station in each period through the first transition probability matrix and the second transition probability matrix. Wherein the number of vehicles at a preset period of the station is a core feature.
Optionally, the feature data may be determined based on a tree model for selecting each type of feature in the feature data, specifically, the feature selection in the tree model refers to performing data segmentation by selecting an optimal feature when each node splits, and the decision tree includes information gain, gain rate, and the like, and the optimal feature data for predicting the transition probability matrix may be selected based on the tree model, so that the terminal may first perform data processing on the feature data by using the tree model, screen out important features, and perform data processing by using the screened important features when predicting by using the logistic regression model, so as to implement screening and dimension reduction on the feature data.
Step 308, determining a third transition probability matrix corresponding to the preset period according to the historical vehicle circulation data in the preset period.
In the embodiment of the present application, the preset period may be historical vehicle circulation data in one month of history, and the circulation probability matrix corresponding to the preset period of one month of history is calculated according to the counted historical vehicle circulation data, and the third transition probability matrix corresponding to the preset period of the current date is obtained through the average value of the circulation probability matrices of the preset period of each month.
Step 310, performing weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix to obtain a target transition probability matrix of each station in each preset period.
In this embodiment of the present application, the terminal may perform weighted average on the first transition probability matrix, the second transition probability matrix, and the third transition probability matrix according to preset weighting coefficients, as shown in fig. 4, where fig. 4 is a schematic diagram of the first transition probability matrix, the second transition probability matrix, and the third transition probability matrix, and determining element values in the target transition probability matrix. The weight selection may be determined based on an index of expert knowledge, historical data analysis, or the like.
In this embodiment, the first transition probability matrix and the second transition probability matrix are obtained through the first transition probability prediction model and the second transition probability prediction model, so that the description accuracy of the first transition probability matrix and the second transition probability matrix on the vehicle circulation condition can be improved, the third transition probability matrix is obtained by combining the historical vehicle circulation data in the preset period, and the target transition probability matrix is obtained based on weighted average of the first transition probability matrix, the second transition probability matrix and the third transition probability matrix, so that the accuracy of the target transition probability matrix can be further improved, and the accuracy of predicting the vehicle flow result is further improved.
In one embodiment, the calculation of the third transition probability matrix is a sliding average strategy, that is, the model is not used to predict the third transition probability matrix, but the calculation is performed according to the number of vehicles at each station in the historical data and the vehicle circulation data, as shown in fig. 5, step 308 determines the third transition probability matrix corresponding to the preset period according to the historical vehicle circulation data in the preset period, including:
step 502, obtaining historical vehicle circulation data of a preset period under the same characteristic in a preset period.
In this embodiment of the present invention, the preset period under the same characteristic in the preset period may be historical vehicle circulation data of the preset period in the date of the same day of week or holiday or workday attribute in one month, for example, the current date is wednesday, and the terminal may obtain vehicle circulation data of the preset period in each wednesday in the previous month of the current date, or vehicle circulation data of each holiday (holiday).
Step 504, calculating the historical vehicle circulation probability of each station in a preset period according to the historical vehicle circulation data.
In the embodiment of the application, the terminal can obtain the number of the shared single vehicles flowing out to other stations in each station and the number of vehicles originally existing in each station in the preset period in the historical data according to the historical vehicle circulation data, so as to obtain the historical vehicle circulation probability of each station.
Step 506, constructing a third transition probability matrix according to the historical vehicle circulation probability of each station.
In the embodiment of the application, the terminal constructs a third transition probability matrix according to the historical vehicle circulation probability of each station, wherein coordinates of each element in the third transition probability matrix represent the outflow station and inflow station of the shared bicycle, and values of each element represent the probability of vehicle transition and can be obtained through the ratio of the number of vehicles flowing out of the station to the number of vehicles flowing into other stations.
In this embodiment, the historical vehicle circulation probability is obtained through calculation of the historical vehicle circulation data, and the third transition probability matrix is constructed, so that the historical vehicle circulation feature of the preset period with the same feature as the current date can be used as one item for calculating the target transition probability matrix, the feature of the existing vehicle circulation probability of the history is considered, the calculation factor of the target transition probability matrix is more comprehensive, and the accuracy of the target transition probability matrix is further improved.
In one embodiment, as shown in fig. 6, step 310 of weighted averaging the first transition probability matrix, the second transition probability matrix, and the third transition probability matrix to obtain a target transition probability matrix for each station in each preset period includes:
step 602, constructing a test sample according to the characteristic data.
In the embodiment of the application, the terminal may determine the weighting coefficient of the first transition probability matrix and the weighting coefficient of the second transition probability matrix according to the accuracy of the output results of the first transition probability prediction model and the second transition probability prediction model. Therefore, the terminal can construct a test sample according to the historical characteristic data, takes the transition probability corresponding to the historical characteristic data as a test label, and verifies the accuracy of the first transition probability matrix and the second transition probability matrix after training is completed.
Step 604, inputting the test sample into the first transition probability prediction model and the second transition probability prediction model respectively, so as to obtain a first accuracy rate and a second accuracy rate.
In the embodiment of the present application, the terminal determines the weight value according to the reliability or accuracy of the probability matrix, so that a more reliable probability matrix may be given a higher weight, and a less reliable probability matrix may be given a lower weight.
The terminal inputs each test sample into a first transition probability prediction model and a second transition probability prediction model respectively, performs data processing on the test sample through the first transition probability prediction model and the second transition probability prediction model respectively, compares a predicted output value with a real label, calculates the number of correctly predicted samples to obtain a first accuracy rate, and calculates a second accuracy rate corresponding to the second transition probability model based on the same principle. Different accuracy rates can be obtained through data processing of different model algorithms.
Step 606, obtaining a weighting coefficient corresponding to the third transition probability matrix, and determining a first weighting coefficient corresponding to the first transition probability prediction model and a second weighting coefficient corresponding to the second transition probability prediction model based on the weighting coefficient, the first accuracy rate and the second accuracy rate.
In this embodiment of the present invention, since the third transition probability matrix is directly calculated from the historical data, the weighting coefficient of the third transition probability matrix may be a preset weighting coefficient, and optionally, if the accuracy of the first transition probability prediction model and the second transition probability prediction model is higher, the weighting coefficient of the third transition probability matrix may also be adaptively reduced.
And if the sum of the weighted coefficient of the third transition probability matrix and the first weighted coefficient and the second weighted coefficient is 1, the terminal can determine the first weighted coefficient and the second weighted coefficient based on the first accuracy and the second accuracy on the basis of the weighted coefficient of the calculated third transition probability matrix. As an alternative embodiment, the terminal may take the ratio of the first accuracy rate to the sum of the first accuracy rate and the second accuracy rate as the proportion of the first weight coefficient, and the ratio of the second accuracy rate to the sum of the first accuracy rate and the second accuracy rate as the proportion of the second weight coefficient. For example, the weighting coefficient of the third transition probability matrix is preset to 0.2, the first accuracy is 75%, the second accuracy is 85%, and the ratio of the first accuracy in the sum of the first accuracy and the second accuracy is 46.88% (75%/160%), that is, the ratio of the first weighting coefficient; the second accuracy is a ratio of 53.12% (85%/160%) of the sum of the first accuracy and the second accuracy, that is, a ratio of the second weight coefficient, and the remaining weight coefficient is 0.8 based on the weight coefficient calculated by the third transition probability matrix, so that the first weight coefficient is 0.425 and the second weight coefficient is 0.375 can be calculated.
Step 608, respectively carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix based on the first weight coefficient, the second weight coefficient and the preset weight coefficient to obtain a target transition probability matrix of each station in each preset period.
In the embodiment of the present application, the terminal performs weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix based on the calculated first weight coefficient representing the first transition probability matrix, the calculated second weight coefficient representing the second transition probability matrix and the calculated preset weight coefficient representing the third transition probability matrix, so as to obtain a weighted average result, and uses the weighted average result as a target transition probability matrix, so as to obtain a target transition probability matrix of each station in each preset period.
In this embodiment, the first weight coefficient and the second weight coefficient are determined according to the first accuracy rate of the model output of the first transition probability prediction model and the second accuracy rate of the model output of the second transition probability prediction model, so that the duty ratio of the model output result with high accuracy rate in the target transition probability matrix can be increased, and weighted average can be performed, and the accuracy rate of the target transition probability matrix can be improved.
In one embodiment, before predicting using the first prediction model and the second prediction model, training the first prediction model and the second prediction model is required, where the training process is shown in fig. 7, and before determining the target transition probability matrix at each preset time period based on the feature data, the vehicle circulation data, the first transition probability prediction model, and the second transition probability prediction model, step 106 further includes:
in step 702, sample feature data is obtained.
In the embodiment of the application, the terminal can acquire the sample characteristic data according to the historical data in the paths of the shared bicycle platform database, the public database, the third party data provider and the like.
Optionally, the terminal may further select a validation set in the sample feature data for evaluation of the first transition probability prediction model and the second transition probability prediction model.
Step 704, taking the block feature data, the time period feature data and the cross feature data corresponding to the stations in the preset time period in the sample feature data and the number of vehicles in each station as training samples, and taking the transition probability between each station in the preset time period in the history feature data and other stations as a sample label corresponding to the training samples.
In the embodiment of the application, the terminal takes the number of vehicles as a training sample, takes block feature data, time period feature data and cross feature data in sample feature data as features of the training sample, and takes the transition probability between each station of a preset time period in history feature data and other stations as a sample label corresponding to the training sample, so as to train an untrained first transition probability prediction model and a second transition probability prediction model.
Step 706, training the first transition probability prediction model to be trained and the second transition probability prediction model to be trained through the training samples and the sample labels corresponding to the training samples, so as to obtain a first transition probability prediction model after training and a second transition probability prediction model after training.
In this embodiment of the present application, the terminal uses a training sample as input, and a sample label corresponding to the training sample as output, trains the first transition probability prediction model and the second transition probability prediction model, and updates model parameters of the first transition probability prediction model and the second transition probability prediction model through a back propagation algorithm and an optimization algorithm (for example, gradient descent). Specifically, the terminal respectively performs data processing on the training samples through the first transition probability prediction model and the second transition probability prediction model, respectively obtains a first training result output by the first transition probability prediction model and a second training result output by the second transition probability prediction model, respectively calculates first loss of the first transition probability prediction model and second loss of the second transition probability prediction model based on the first training result and the second training result, and repeatedly iterates the training process until a preset iteration condition is met, for example, the first loss and the second loss both meet the preset iteration condition, or the number of iterations meets the preset iteration condition. Finally, the terminal takes the first transition probability prediction model and the second transition probability prediction model which meet the preset iteration conditions as the first transition probability prediction model which is completed by training and the second transition probability prediction model which is completed by seeking.
Alternatively, the terminal may evaluate the performance of the trained first transition probability prediction model using the validation set. For example, the terminal may calculate the difference between the predicted result and the actual tag (mean square error, cross entropy, etc.), or use other common evaluation metrics (accuracy, precision, recall, etc.). The terminal may tune and improve the first transition probability prediction model and the second transition probability prediction model according to the evaluation result, for example, may attempt different combinations of super parameters, and perform cross-validation and other techniques to select the best first transition probability prediction model and the second transition probability prediction model.
In this embodiment, by training the first transition probability prediction model and the second transition probability prediction model to obtain a trained first transition probability prediction model and a trained second transition probability prediction model, the accuracy of predicting the first transition probability matrix and the second transition probability matrix can be improved, and the accuracy of the target transition probability matrix can be further improved.
In one embodiment, as shown in fig. 8, step 108 processes the target transition probability matrix of each preset period and the station state matrix of the target period based on a multi-order markov algorithm to obtain a vehicle flow result of each station of the target period, including:
Step 802, determining a station state space of each preset time period according to the number of vehicles of each preset time period.
In this embodiment of the present application, the terminal may obtain the number of vehicles based on step 304, and construct a station state space of each station in each preset period according to the number of vehicles in each preset period, where each element in the station state space is the number of vehicles in each station.
Step 804, obtaining the vehicle flow result of each station in the target period based on the multi-order Markov algorithm, the target transition probability matrix of each preset period and the station state matrix of the target period.
In the embodiment of the application, the terminal can use a multi-order Markov chain to perform modeling based on the transition probability matrix and the station state of the current period, describe the change process of the station state, and can obtain the vehicle flow result of each station of the target period by iteratively using the transition probability matrix.
In this embodiment, the accuracy of calculating the vehicle flow result can be improved by obtaining the vehicle flow result of each station in the target period by using the target transition probability matrix with higher accuracy and the station state space in the target period.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a flow prediction device for realizing the flow prediction method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation of one or more embodiments of the flow prediction device provided below may be referred to the limitation of the flow prediction method hereinabove, and will not be repeated here.
In one exemplary embodiment, as shown in fig. 9, there is provided a flow prediction apparatus 900 comprising: a first acquisition module 901, a first prediction module 902, a second prediction module 903, and a vehicle flow determination module 904, wherein:
the first obtaining module 901 is configured to obtain feature data corresponding to each block in the target area;
the first prediction module 902 is configured to obtain vehicle circulation data of each station in each block at each preset time period according to the feature data and the vehicle circulation prediction model;
a second prediction module 903, configured to determine a target transition probability matrix at each preset period based on the feature data, the vehicle circulation data, the first transition probability prediction model, and the second transition probability prediction model;
the vehicle flow determining module 904 is configured to process the target transition probability matrix of each preset period and the station state matrix of the target period based on a multi-order markov algorithm, so as to obtain a vehicle flow result of each station of the target period; the preset time period comprises a target time period; the vehicle flow results are used to assist in vehicle scheduling decisions.
In one embodiment, the first prediction module 902 is specifically configured to:
extracting the characteristics of the block characteristics, the time period characteristics and the cross characteristics according to the gradient lifting tree model to obtain characteristic vectors;
And obtaining vehicle circulation data of each station in each block at each preset time period based on the gradient lifting tree model and the feature vector.
In one embodiment, the second prediction module 903 is specifically configured to:
acquiring the number of initial vehicles contained in each station at the initial moment; the initial time is a first preset period;
obtaining the number of vehicles in each preset period according to the initial number of vehicles and the vehicle circulation data in each preset period;
obtaining a first transition probability matrix based on the feature data, the number of vehicles in each preset period and the first transition probability prediction model, and obtaining a second transition probability matrix based on the feature data, the number of vehicles in each preset period and the second transition probability prediction model;
determining a third transition probability matrix corresponding to a preset period according to historical vehicle circulation data in a preset period;
and carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix to obtain a target transition probability matrix of each station in each preset period.
In one embodiment, the second prediction module 903 is specifically configured to:
acquiring historical vehicle circulation data of a preset period under the same characteristic in a preset period;
Calculating historical vehicle circulation probability of each station in a preset period according to the historical vehicle circulation data;
and constructing a third transition probability matrix according to the historical vehicle circulation probability of each station.
In one embodiment, the second prediction module 903 is specifically configured to:
constructing a test sample according to the characteristic data;
respectively inputting the test sample into a first transition probability prediction model and a second transition probability prediction model to obtain a first accuracy rate and a second accuracy rate;
acquiring a weighting coefficient corresponding to the third transition probability matrix, and determining a first weighting coefficient corresponding to the first transition probability prediction model and a second weighting coefficient corresponding to the second transition probability prediction model based on the weighting coefficient, the first accuracy and the second accuracy;
and respectively carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix based on the first weight coefficient, the second weight coefficient and the preset weight coefficient to obtain a target transition probability matrix of each station in each preset period.
In one embodiment, the apparatus 900 further comprises:
the second acquisition module is used for acquiring sample characteristic data;
the determining module is used for taking block feature data, time period feature data and cross feature data corresponding to stations in a preset time period in the sample feature data and the number of vehicles in each station as training samples, and taking the transition probability between each station in the preset time period in the history feature data and other stations as a sample label corresponding to the training samples;
The training module is used for respectively training the first transition probability prediction model to be trained and the second transition probability prediction model to be trained through the training samples and sample labels corresponding to the training samples to obtain a first transition probability prediction model after training and a second transition probability prediction model after training.
In one embodiment, the vehicle flow determination module 904 is specifically configured to:
determining a station state matrix of each preset period according to the number of vehicles in each preset period;
and obtaining a vehicle flow result of each station in the target period based on the multi-order Markov algorithm, the target transition probability matrix of each preset period and the station state matrix of the target period.
The various modules in the flow prediction device 900 described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one exemplary embodiment, a computer device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 10. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing the characteristic data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of traffic prediction.
It will be appreciated by those skilled in the art that the structure shown in fig. 10 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor performing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use, and processing of the related data are required to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random AccessMemory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as Static Random access memory (Static Random access memory AccessMemory, SRAM) or dynamic Random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. A method of traffic prediction, the method comprising:
acquiring characteristic data corresponding to each block in a target area;
obtaining vehicle circulation data of each station in each block at each preset time period according to the characteristic data and the vehicle circulation prediction model;
determining a target transition probability matrix under each preset period based on the characteristic data, the vehicle circulation data, a first transition probability prediction model and a second transition probability prediction model;
Processing the target transition probability matrix of each preset time period and the station state matrix of the target time period based on a multi-order Markov algorithm to obtain a vehicle flow result of each station of the target time period; the preset period includes the target period; the vehicle flow results are used to assist in vehicle scheduling decisions.
2. The method of claim 1, wherein the feature data includes block features, period features, and cross features, and the vehicle circulation prediction model is a gradient lift tree model; obtaining the vehicle circulation data of each station in each block at each preset time interval according to the characteristic data and the vehicle circulation prediction model, wherein the vehicle circulation data comprises the following steps:
extracting features of the block features, the time period features and the cross features according to the gradient lifting tree model to obtain feature vectors;
and obtaining the vehicle circulation data of each station in each block at each preset time period based on the gradient lifting tree model and the feature vector.
3. The method of claim 1, wherein the determining a target transition probability matrix for each of the preset time periods based on the feature data, the vehicle circulation data, a first transition probability prediction model, and a second transition probability prediction model comprises:
Acquiring the number of initial vehicles contained in each station at the initial moment; the initial time is the first preset time period;
obtaining the number of vehicles in each preset period according to the initial number of vehicles and the vehicle circulation data in each preset period;
obtaining a first transition probability matrix based on the characteristic data, the number of vehicles in each preset period and a first transition probability prediction model, and obtaining a second transition probability matrix based on the characteristic data, the number of vehicles in each preset period and a second transition probability prediction model;
determining a third transition probability matrix corresponding to a preset period according to historical vehicle circulation data in the preset period;
and carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix to obtain a target transition probability matrix of each station in each preset period.
4. The method of claim 3, wherein determining a third transition probability matrix corresponding to the preset period from historical vehicle flow data within a preset period comprises:
acquiring historical vehicle circulation data of the preset period under the same characteristic in the preset period;
Calculating the historical vehicle circulation probability of each station in the preset period according to the historical vehicle circulation data;
and constructing a third transition probability matrix according to the historical vehicle circulation probability of each station.
5. A method according to claim 3, wherein said weighted averaging of said first transition probability matrix, said second transition probability matrix and said third transition probability matrix to obtain a target transition probability matrix for each said station for each said predetermined period of time comprises:
constructing a test sample according to the characteristic data;
inputting the test sample into the first transition probability prediction model and the second transition probability prediction model respectively to obtain a first accuracy rate and a second accuracy rate;
acquiring a weighting coefficient corresponding to a third transition probability matrix, and determining a first weighting coefficient corresponding to the first transition probability prediction model and a second weighting coefficient corresponding to the second transition probability prediction model based on the weighting coefficient, the first accuracy and the second accuracy;
and respectively carrying out weighted average on the first transition probability matrix, the second transition probability matrix and the third transition probability matrix based on the first weight coefficient, the second weight coefficient and the preset weight coefficient to obtain a target transition probability matrix of each station in each preset period.
6. The method of claim 3, wherein prior to determining the target transition probability matrix for each of the preset time periods based on the feature data, the vehicle circulation data, the first transition probability prediction model, and the second transition probability prediction model, the method further comprises:
acquiring sample characteristic data;
taking block feature data, time period feature data and cross feature data corresponding to the stations in the preset time period in the sample feature data and the number of vehicles of each station as training samples, and taking the transfer probability between each station in the preset time period in the history feature data and other stations as a sample label corresponding to the training samples;
and respectively training the first transition probability prediction model to be trained and the second transition probability prediction model to be trained through the training samples and sample labels corresponding to the training samples to obtain a first transition probability prediction model after training and a second transition probability prediction model after training.
7. The method according to claim 1, wherein the processing the target transition probability matrix for each preset period and the station state matrix for a target period based on the multi-order markov algorithm to obtain a vehicle flow result for each station for the target period includes:
Determining a station state matrix of each preset period according to the number of vehicles in each preset period;
and obtaining a vehicle flow result of each station in the target period based on a multi-order Markov algorithm, the target transition probability matrix of each preset period and the station state matrix of the target period.
8. A flow prediction device, the device comprising:
the first acquisition module is used for acquiring characteristic data corresponding to each block in the target area;
the first prediction module is used for obtaining vehicle circulation data of each station in each block in each preset period according to the characteristic data and the vehicle circulation prediction model;
the second prediction module is used for determining a target transition probability matrix under each preset period based on the characteristic data, the vehicle circulation data, the first transition probability prediction model and the second transition probability prediction model;
the vehicle flow determining module is used for processing the target transition probability matrix of each preset time period and the station state matrix of the target time period based on a multi-order Markov algorithm to obtain a vehicle flow result of each station of the target time period; the preset period includes the target period; the vehicle flow results are used to assist in vehicle scheduling decisions.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202311510238.4A 2023-11-14 2023-11-14 Traffic prediction method, traffic prediction device, computer equipment and storage medium Active CN117252307B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311510238.4A CN117252307B (en) 2023-11-14 2023-11-14 Traffic prediction method, traffic prediction device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311510238.4A CN117252307B (en) 2023-11-14 2023-11-14 Traffic prediction method, traffic prediction device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117252307A true CN117252307A (en) 2023-12-19
CN117252307B CN117252307B (en) 2024-04-09

Family

ID=89137171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311510238.4A Active CN117252307B (en) 2023-11-14 2023-11-14 Traffic prediction method, traffic prediction device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117252307B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117876027A (en) * 2024-03-13 2024-04-12 北京阿帕科蓝科技有限公司 Data processing method, device, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104916124A (en) * 2015-06-04 2015-09-16 东南大学 Public bicycle system regulation and control method based on Markov model
US20200193834A1 (en) * 2018-12-13 2020-06-18 Didi Research America, Llc System and method for ride order dispatching
US20200356900A1 (en) * 2019-05-07 2020-11-12 Cerebri AI Inc. Predictive, machine-learning, locale-aware computer models suitable for location- and trajectory-aware training sets
US20210133569A1 (en) * 2019-11-04 2021-05-06 Tsinghua University Methods, computing devices, and storage media for predicting traffic matrix
CN113808400A (en) * 2021-09-16 2021-12-17 腾讯科技(深圳)有限公司 Method, device, equipment and medium for displaying traffic flow migration situation
US20220391564A1 (en) * 2021-06-02 2022-12-08 Beijing Didi Infinity Technology And Development Co., Ltd. Simulation framework for real time vehicle dispatching algorithms evaluation
CN116580563A (en) * 2023-07-10 2023-08-11 中南大学 Markov chain-based regional congestion traffic source prediction method, device and equipment
CN116934056A (en) * 2023-09-14 2023-10-24 北京阿帕科蓝科技有限公司 Vehicle scheduling method, device, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104916124A (en) * 2015-06-04 2015-09-16 东南大学 Public bicycle system regulation and control method based on Markov model
US20200193834A1 (en) * 2018-12-13 2020-06-18 Didi Research America, Llc System and method for ride order dispatching
US20200356900A1 (en) * 2019-05-07 2020-11-12 Cerebri AI Inc. Predictive, machine-learning, locale-aware computer models suitable for location- and trajectory-aware training sets
US20210133569A1 (en) * 2019-11-04 2021-05-06 Tsinghua University Methods, computing devices, and storage media for predicting traffic matrix
US20220391564A1 (en) * 2021-06-02 2022-12-08 Beijing Didi Infinity Technology And Development Co., Ltd. Simulation framework for real time vehicle dispatching algorithms evaluation
CN113808400A (en) * 2021-09-16 2021-12-17 腾讯科技(深圳)有限公司 Method, device, equipment and medium for displaying traffic flow migration situation
CN116580563A (en) * 2023-07-10 2023-08-11 中南大学 Markov chain-based regional congestion traffic source prediction method, device and equipment
CN116934056A (en) * 2023-09-14 2023-10-24 北京阿帕科蓝科技有限公司 Vehicle scheduling method, device, computer equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
刘哲华: "基于马尔可夫链的公交停靠站乘客数预测", 黑龙江交通科技, no. 11 *
李军怀等: "基于指数平滑和马尔可夫链的短时交通流量预测", 计算机系统应用, no. 12 *
陈茂娟: "共享单车的调度问题", 数学学习与研究, no. 07 *
高亮等: "基于预测库存变化率的公共自行车动态调度方法", 长安大学学报(自然科学版), no. 06 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117876027A (en) * 2024-03-13 2024-04-12 北京阿帕科蓝科技有限公司 Data processing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN117252307B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN109919358B (en) Real-time station flow prediction method based on neural network space-time attention mechanism
Tekouabou et al. Improving parking availability prediction in smart cities with IoT and ensemble-based model
US10817775B2 (en) Neural network computing systems for predicting vehicle requests
CN110998568B (en) Navigation determination system and method for embarkable vehicle seeking passengers
Cirstea et al. EnhanceNet: Plugin neural networks for enhancing correlated time series forecasting
CN110991713A (en) Irregular area flow prediction method based on multi-graph convolution sum GRU
CN107730087A (en) Forecast model training method, data monitoring method, device, equipment and medium
Kim et al. Graph convolutional network approach applied to predict hourly bike-sharing demands considering spatial, temporal, and global effects
CN117252307B (en) Traffic prediction method, traffic prediction device, computer equipment and storage medium
CN114220271A (en) Traffic flow prediction method, equipment and storage medium based on dynamic space-time graph convolution cycle network
CN109920248B (en) Bus arrival time prediction method based on GRU neural network
US11443335B2 (en) Model-based deep reinforcement learning for dynamic pricing in an online ride-hailing platform
CN111047078B (en) Traffic characteristic prediction method, system and storage medium
CN113762595B (en) Traffic time prediction model training method, traffic time prediction method and equipment
CN113591380A (en) Traffic flow prediction method, medium and equipment based on graph Gaussian process
CN111582559A (en) Method and device for estimating arrival time
Feng et al. Moment-based availability prediction for bike-sharing systems
US20240046785A1 (en) System and method for predicting road traffic speed
Brahimi et al. Modelling on car-sharing serial prediction based on machine learning and deep learning
CN116341773A (en) Vehicle demand prediction method, device, computer equipment and storage medium
CN112036598A (en) Charging pile use information prediction method based on multi-information coupling
CN111861017A (en) Charging station network optimization method based on current network data
CN117436653A (en) Prediction model construction method and prediction method for travel demands of network about vehicles
CN117217779A (en) Training method and device of prediction model and information prediction method and device
CN115952355A (en) Next interest point recommendation system based on space-time power law attention

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