Short-term traffic flow prediction method, device, terminal equipment and storage medium
Through the combination of target moving average model, target ridge regression model and target vector machine model, the problem of data demand and resource consumption of existing intelligent nonlinear models in short-term traffic flow prediction is solved, and fast and accurate traffic flow prediction is achieved. , reducing environmental impact.
Patent Information
- Application Number
- CN202111244550.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-10-26
AI Technical Summary
Existing intelligent nonlinear models require a large number of data sets for training in short-term traffic flow prediction, resulting in a large consumption of time and manpower, and the measures for spatial optimization design have inconvenience and environmental impact.
The target moving average model, target ridge regression model and target vector machine model are used to process and train the traffic flow sample data through the moving average method, ridge regression and vector machine models, and establish a preset target traffic flow prediction model to quickly Predict short-term traffic volume on roads.
It saves human resources, improves prediction efficiency, and reduces the impact on the environment. At the same time, it can accurately predict short-term traffic volume on the road and identify traffic jams.
Smart Images

Figure CN113947025B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of traffic technology, and in particular to a method, device, terminal equipment and storage medium for predicting short-term traffic flow. Background Art
[0002] In order to solve the problem of traffic congestion, the first measure is to optimize the design of existing intersections and road sections, increase or improve spatial traffic facilities to solve the problem of traffic congestion, such as widening roads, intersection channelization, and adding guide lines. However, for now, spatial solutions will bring a lot of inconvenience. Some intersections and road sections will be restricted, and the funds required to take measures will also cost a lot, which will also have an impact on the external environment.
[0003] In this regard, researchers have proposed a variety of prediction models, such as linear prediction models, traditional nonlinear prediction models or intelligent nonlinear prediction models. At present, intelligent nonlinear models are frequently used in short-term traffic flow prediction, among which neural networks are very powerful in nonlinear short-term traffic flow prediction, such as the commonly used BP neural network and artificial neural network. Neural network models can be used in combination with other models to improve the accuracy of prediction and make up for the shortcomings of the model.
[0004] However, for the application of neural networks in short-term traffic flow prediction, a large amount of data sets are generally required for training to predict the short-term traffic flow in a certain period of time in the future, which consumes a lot of time and manpower. Summary of the invention
[0005] In view of the above problems, embodiments of the present invention are proposed to provide a method, apparatus, terminal device and storage medium for predicting short-term traffic flow that overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, an embodiment of the present invention provides a method for predicting short-term traffic flow, the method comprising:
[0007] Obtain a preset time period of the road area to be predicted;
[0008] According to the preset time period and the pre-established target traffic flow prediction model, the target traffic flow of the preset time period in the road area to be predicted is obtained, wherein the pre-established target traffic flow prediction model is determined based on a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in the sample set by adopting a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set.
[0009] Optionally, the pre-established target traffic flow prediction model is obtained by:
[0010] Obtain traffic flow sample data in the sample set;
[0011] Preprocessing the traffic flow sample data to obtain initialization sample data;
[0012] Determine the moving average model according to the moving average method and the initialization sample data;
[0013] Determining a first precise parameter of the moving average model according to a first predicted value calculated by the moving average model and a standard value of traffic flow;
[0014] Using the initialization sample data to train the initial ridge regression model to determine the ridge regression model;
[0015] Determining second precise parameters of the ridge regression model based on the second predicted value calculated by the ridge regression model and the traffic flow standard value;
[0016] Using the initialization sample data to train an initial vector machine model to determine the vector machine model;
[0017] Determining a third precise parameter of the movement vector machine model according to a third prediction value calculated by the movement vector machine model and a standard value of traffic flow;
[0018] If the first precise parameter is less than a first preset value, the second precise parameter is less than a second preset value, and the third precise parameter is less than a third preset value, the moving average model is determined as a target moving average model, the ridge regression model is determined as a target ridge regression model, and the vector machine model is determined as a target vector machine model;
[0019] Determining a first weight value of the target moving average model, a second weight value of the target ridge regression model, and a third weight value of the target vector machine model;
[0020] Determine a first product of the target moving average model and a first weight value, a second product of the target regression model and the second weight value, and a third product of the target vector machine model and the third weight value;
[0021] The target traffic flow prediction model is determined according to the first product, the second product and the third product.
[0022] Optionally, determining the target traffic flow prediction model according to the first product, the second product and the third product includes:
[0023] Determining a preset error parameter according to the first precise parameter, the first weight value, the second precise parameter, the second weight value, the third precise parameter and the third weight value;
[0024] If the value of the preset error parameter is the smallest, the traffic flow prediction model corresponding to the preset error parameter is used as the target traffic flow prediction model.
[0025] Optionally, determining the moving average model according to the moving average method and the initialization sample data includes:
[0026]
[0027] in: —The quadratic moving average of period t; x t+1 is the predicted value for period t+1; is the moving average value of the tth period; n is the number of historical data participating in the moving average.
[0028] Optionally, the first precise parameter includes: relative error, average relative error, average absolute relative error and root mean square relative error, and the relative error, average relative error, average absolute relative error and root mean square relative error specifically include:
[0029] Calculate the relative error, Among them, x i is the actual value of traffic volume, y i is the traffic volume forecast value;
[0030] Calculate the average relative error,
[0031] Calculate the absolute relative error,
[0032] Calculate the RMS relative error,
[0033] Optionally, determining the target traffic flow prediction model according to the first product, the second product and the third product includes:
[0034] Settings 1 ,l 2 …,l n are the weight coefficients of n independent prediction methods, and the weight coefficients should satisfy: 1 +l 2 +…l n =1, where l 1 is the first weight value, l 2 is the second weight value, l n is the third weight value;
[0035] Get the target traffic flow prediction model as
[0036] The prediction error value of the target traffic flow prediction model at time t is obtained as
[0037] Calculate the prediction error sum of squares of the target traffic flow prediction model
[0038] According to the prediction error sum of squares, the minimum prediction error sum of squares is determined, that is,
[0039]
[0040] After the minimum prediction error sum of squares is determined, a first weight value, a second weight value, and a third weight value corresponding to the minimum prediction error sum of squares are determined;
[0041] The target traffic flow prediction model is determined according to the first weight value, the second weight value and the third weight value.
[0042] In a second aspect, an embodiment of the present invention provides a short-term traffic flow prediction device, the device comprising:
[0043] An acquisition module, used for acquiring a preset time period of a road area to be predicted;
[0044] A prediction module is used to obtain a target traffic flow for a preset time period in a road area to be predicted based on the preset time period and a pre-established target traffic flow prediction model, wherein the pre-established target traffic flow prediction model is determined based on a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in a sample set using a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set.
[0045] Optionally, the device further comprises a model building module, wherein the model building module is used to:
[0046] Obtain traffic flow sample data in the sample set;
[0047] Preprocessing the traffic flow sample data to obtain initialization sample data;
[0048] Determine the moving average model according to the moving average method and the initialization sample data;
[0049] Determining a first precise parameter of the moving average model according to a first predicted value calculated by the moving average model and a standard value of traffic flow;
[0050] Using the initialization sample data to train the initial ridge regression model to determine the ridge regression model;
[0051] Determining second precise parameters of the ridge regression model based on the second predicted value calculated by the ridge regression model and the traffic flow standard value;
[0052] Using the initialization sample data to train an initial vector machine model to determine the vector machine model;
[0053] Determining a third precise parameter of the movement vector machine model according to a third prediction value calculated by the movement vector machine model and a standard value of traffic flow;
[0054] If the first precise parameter is less than a first preset value, the second precise parameter is less than a second preset value, and the third precise parameter is less than a third preset value, the moving average model is determined as a target moving average model, the ridge regression model is determined as a target ridge regression model, and the vector machine model is determined as a target vector machine model;
[0055] Determining a first weight value of the target moving average model, a second weight value of the target ridge regression model, and a third weight value of the target vector machine model;
[0056] Determine a first product of the target moving average model and a first weight value, a second product of the target regression model and the second weight value, and a third product of the target vector machine model and the third weight value;
[0057] The target traffic flow prediction model is determined according to the first product, the second product and the third product.
[0058] Optionally, the model building module is used to:
[0059] Determining a preset error parameter according to the first precise parameter, the first weight value, the second precise parameter, the second weight value, the third precise parameter and the third weight value;
[0060] If the value of the preset error parameter is the smallest, the traffic flow prediction model corresponding to the preset error parameter is used as the target traffic flow prediction model.
[0061] Optionally, the model building module is used to:
[0062]
[0063] in: —The quadratic moving average of period t; x t+1 is the predicted value for period t+1; is the moving average value of the tth period; n is the number of historical data participating in the moving average.
[0064] Optionally, the model building module is used to:
[0065] Calculate the relative error, Among them, x i is the actual value of traffic volume, y i is the traffic volume forecast value;
[0066] Calculate the average relative error,
[0067] Calculate the absolute relative error,
[0068] Calculate the RMS relative error,
[0069] Optionally, the model building module is used to:
[0070] Settings 1 ,l 2 …,l n are the weight coefficients of n independent prediction methods, and the weight coefficients should satisfy: 1 +l 2 +…l n =1, where l 1 is the first weight value, l 2 is the second weight value, l n is the third weight value;
[0071] Get the target traffic flow prediction model as
[0072] The prediction error value of the target traffic flow prediction model at time t is obtained as
[0073] Calculate the prediction error sum of squares of the target traffic flow prediction model
[0074] According to the prediction error sum of squares, the minimum prediction error sum of squares is determined, that is,
[0075]
[0076] After the minimum prediction error sum of squares is determined, a first weight value, a second weight value, and a third weight value corresponding to the minimum prediction error sum of squares are determined;
[0077] The target traffic flow prediction model is determined according to the first weight value, the second weight value and the third weight value.
[0078] In a third aspect, an embodiment of the present invention provides a terminal device, including: at least one processor and a memory;
[0079] The memory stores a computer program; the at least one processor executes the computer program stored in the memory to implement the short-term traffic flow prediction method provided in the first aspect.
[0080] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the method for predicting short-term traffic flow provided in the first aspect is implemented.
[0081] The embodiments of the present invention include the following advantages:
[0082] The short-term traffic flow prediction method, device, terminal device and storage medium provided by the embodiment of the present invention obtain a preset time period of the road area to be predicted; according to the preset time period and the pre-established target traffic flow prediction model, the target traffic flow of the preset time period in the road area to be predicted is obtained, wherein the pre-established target traffic flow prediction model is determined according to the target moving average model, the target ridge regression model and the target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in the sample set by using the moving average method, the target ridge regression model is obtained by training the initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training the initial vector machine model with the traffic flow sample data in the sample set. Through the embodiment of the present invention, the short-term traffic volume of a road on a certain section at a certain time can be predicted, saving human resources and improving prediction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 is a flowchart of a method for predicting short-term traffic flow according to an embodiment of the present invention;
[0084] Figure 2 is a flowchart of another short-term traffic flow prediction method embodiment of the present invention;
[0085] Figure 3 is a schematic diagram of the prediction results of the moving average model in an embodiment of the present invention;
[0086] Figure 4 is a ridge regression model prediction graph in an embodiment of the present invention;
[0087] Figure 5 is a support vector machine prediction graph in an embodiment of the present invention;
[0088] Figure 6 is a comparison chart of prediction results of three models in an embodiment of the present invention;
[0089] Figure 7 It is a structural block diagram of an embodiment of a prediction device for short-term traffic flow of the present invention;
[0090] Figure 8 It is a structural schematic diagram of a terminal device of the present invention. DETAILED DESCRIPTION
[0091] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0092] An embodiment of the present invention provides a short-term traffic flow prediction method for predicting the traffic flow of a certain road section at a certain time. The execution subject of this embodiment is a short-term traffic flow prediction device, which is set on a terminal device, which can be a computer, a tablet or a mobile phone terminal.
[0093] Reference Figure 1 , shows a flowchart of a method for predicting short-term traffic flow according to an embodiment of the present invention, the method may specifically include the following steps:
[0094] S101, obtaining a preset time period of a road area to be predicted;
[0095] Specifically, short-term traffic flow refers to the volume of vehicles passing through a certain section of a road within a short time interval, usually within a time interval of (1min-15min). The prediction interval mainly selected in the embodiment of the present application is 2min, and short-term traffic flow prediction refers to the measurement of the volume of traffic passing through a certain section of a road within a short period of time in the future. Short-term traffic flow prediction requires a large amount of historical data, and then a prediction method is selected, and a model is established to perform fitting and statistical prediction, and the predicted data is used to evaluate the completion of the prediction work.
[0096] If a user wants to know whether there is a traffic jam on a certain road section at a certain time and what the traffic flow is, the user can enter the traffic section and the preset time period on the terminal device. For example, the traffic section is intersection A and the preset time period is 3:00-3:02.
[0097] S102. According to a preset time period and a pre-established target traffic flow prediction model, a target traffic flow for a preset time period in the road area to be predicted is obtained, wherein the pre-established target traffic flow prediction model is determined based on a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in the sample set using a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set.
[0098] Specifically, a target traffic flow prediction model is pre-established on the terminal device, and the target traffic flow prediction model is determined according to a target moving average model, a target ridge regression model and a target vector machine model, as well as weight values corresponding to each model;
[0099] In the specific establishment process, a moving average model, a ridge regression model and a vector machine model are established respectively, and each model is trained respectively to obtain a target moving average model, a target ridge regression model and a target vector machine model.
[0100] After obtaining the traffic section and preset time period input by the user, the terminal device inputs the traffic section and preset time period into the pre-established target traffic flow prediction model, so that the traffic flow at intersection A from 3:00 to 3:02 can be predicted. If the traffic flow exceeds the preset value, it means that there is a traffic jam at the intersection at this moment. If it is less than the preset value, it means that there is no traffic jam at the intersection at this moment and you can pass smoothly.
[0101] The short-term traffic flow prediction method provided by the embodiment of the present invention obtains a preset time period of a road area to be predicted; and obtains the target traffic flow of the preset time period in the road area to be predicted according to the preset time period and a pre-established target traffic flow prediction model, wherein the pre-established target traffic flow prediction model is determined according to a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in a sample set using a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set. The embodiment of the present invention can predict the short-term traffic volume of a road at a certain section at a certain time, thereby saving human resources and improving prediction efficiency.
[0102] Another embodiment of the present invention further supplements the short-term traffic flow prediction method provided by the above embodiment.
[0103] Optionally, the pre-established target traffic flow prediction model is obtained by:
[0104] Step A1, obtaining traffic flow sample data in a sample set;
[0105] Specifically, there are two ways to obtain short-term traffic flow data. One is a static collection device, the main facilities are detectors or cameras at fixed points at the checkpoints. Fixed-point detectors include induction coils, radars, photoelectric, infrared, etc., but if you want to obtain traffic flow in a short period of time, you can also manually shoot and then count the vehicles; the dynamic traffic data collection method is to use detectors at fixed intersections to collect data on a series of traffic flow parameters such as the real-time driving speed and space occupancy rate of vehicles passing by.
[0106] (1) Static traffic detection:
[0107] For static traffic information collection, coils and video surveillance are the most common detection devices at intersections or other locations. The coil is a variation of a magnetic detector. It obtains certain vehicle information by using one or a group of induction coils buried under the road surface of the intersection to generate changes in electromagnetic induction for vehicles passing by.
[0108] For video surveillance, the camera is used as the main acquisition device, which is used as a recording device to analyze and process images within a certain period of time to obtain detailed traffic flow information. The advantage of this method is that it can obtain detailed traffic information and has a high accuracy of data, which is a good method.
[0109] (2) Dynamic traffic detection
[0110] Therefore, the prediction of short-term traffic flow can be regarded as a simple estimation of some basic parameters that may be representative of certain traffic flows. However, the prediction of short-term traffic flow can be divided into several types, such as dynamic short-term traffic flow and non-dynamic short-term traffic flow prediction. The main purpose of dynamic prediction is to automatically adjust the established model using a certain prediction algorithm, while the main purpose of non-dynamic prediction is to adjust the predicted model to different degrees after it has been trained. The prediction of short-term transportation flow is mainly because the time distance in the prediction process is relatively small, such as the short-term traffic flow needs to last more than 15 minutes. In the urban road network, the short-term traffic and logistics conditions can change dynamically over time.
[0111] Exemplarily, static traffic detection technology is used in the embodiment of the present invention to collect data on traffic flow at intersection sections. The north-to-south lanes at the intersection of Zhongrun Avenue and Liuquan Road are selected, and the traffic volume is collected for five consecutive days (8:30-11:30) from Monday to Friday with an interval of 5 minutes. A total of 180 groups of short-term traffic volume sample data are obtained.
[0112] Step A2: preprocessing the traffic flow sample data to obtain initialization sample data;
[0113] Specifically, the collected data is obtained through the video card port of the intersection to obtain the continuous traffic flow every day. The traffic volume in the selected time period is also pre-processed, and the required data is filtered and integrated through an Excel spreadsheet. The specific situation is as follows.
[0114] (1) It is necessary to count the traffic volume in each lane in all directions, excluding left-turning and right-turning vehicles. This way, the traffic flow can be counted in the same north-south straight direction. On the one hand, while making predictions, it can also evaluate the impact on downstream intersections in the future so as to make corresponding signal controls.
[0115] The basic traffic volume acquisition method is shown in Table 1.
[0116] Table 1
[0117] LuC8KS02 Small car 2021-03-15 07:30:01 Checkpoint at the intersection of Zhongrun Avenue and Liuquan Road, east to west 2 0 East -> West Lane 6 unknown LU C152ME Small car 2021-03-15 07:30:01 At the intersection of Zhongrun Avenue and Liuquan Road, the police line is from south to north 2 0 South->North Lane 6 unknown Lu CU5T86 Small car 2021-03-15 07:30:01 2 from south to north at the intersection of Zhongrun Avenue and Liuquan Road 0 South->North Lane 6 unknown LuCF7152 Large cars 2021-03-15 07:30:02 2 from south to north at the intersection of Zhongrun Avenue and Liuquan Road 0 South->North The Fifth Lane unknown Lu CTW330 Small car 2021-03-15 07:30:02 Checkpoint at the intersection of Zhongrun Avenue and Liuquan Road, south to north 1 0 South->North Second lane unknown LU C308XE Small car 2021-03-15 07:30:02 Intersection of Zhongrun Avenue and Liuquan Road, north to south 1 0 North->South Second lane unknown LUCA327S Small car 2021-03-15 07:30:02 Checkpoint at the intersection of Zhongrun Avenue and Liuquan Road, east to west 2 0 East -> West Lane 6 unknown
[0118] (2) As shown in Table 1, this is the vehicle situation obtained at some intersections. Next, the traffic volume needs to be divided into 5-minute time intervals to completely filter out the traffic flow from north to south. Since the traffic volume of the upstream section of the intersection is selected, the number of samples required by the embodiment of the present invention is sorted out as needed.
[0119] (3) Different prediction methods require different data samples to be analyzed. This requires that the data for each method be processed separately. On the basis of retaining a set of historical data, other data should be practiced to select the appropriate method. Then, the prediction results should be compared with the originally selected traffic flow to calculate the error and various indicators.
[0120] Step A3, determining a moving average model according to the moving average method and the initialization sample data;
[0121] Specifically, in the process of performing the moving average method, the single moving average method or the double moving average method can be used. Among them, the single moving average method is to identify a set of historical data, calculate the average value of this set of data, and use this average as the predicted value of a future set of data. Simply put, in the field of short-term traffic flow, it is to perform moving average on historical data, select appropriate traffic flow sample data and appropriate number of predictions, and then compare and analyze them with the original retained data to calculate the resulting error.
[0122] A moving average is very suitable for predicting short-term traffic flow with a linear relationship. Its method is to directly use the mean of the original data as the prediction value for the next period. In the calculation process of a moving average, a reasonable moving step and prediction number are selected, and then every time a new set of data values appears, the first data value is subtracted from the moving average, and so on. The new moving average is calculated as the prediction value for the next period.
[0123] The single moving average method is generally applicable to short-term traffic flow prediction when the time series data presents a linear and stable change trend. It is not applicable to short-term traffic flow prediction of time series with long-term changes and some nonlinear change trends.
[0124] 1) Prediction model of the single moving average method
[0125]
[0126] Where: x t+1 is the predicted value for period t+1; is the moving average value of the tth period; n is the number of historical data participating in the moving average.
[0127] 2) Quadratic Moving Average Model
[0128] The quadratic moving average model is to average the traffic flow once on the basis of the first one. For the selected traffic volume, the error of the prediction result of the quadratic moving average is generally higher than that of the first average.
[0129] The calculation formula is:
[0130]
[0131] Where: —The quadratic moving average of period t.
[0132] Step A4, determining a first precise parameter of the moving average model according to the first predicted value calculated by the moving average model and the standard value (actual value) of the traffic flow;
[0133] The curve using the quadratic moving average model is as follows Figure 3 As shown, we can see the general forecast trend image. The moving average model established for this model makes a forecast of the short-term traffic flow in the later 12 time intervals, and compares and analyzes it with the original data.
[0134] Relative error:
[0135]
[0136] Mean relative error (MRE):
[0137]
[0138] Mean Absolute Relative Error (MARE):
[0139]
[0140] Root mean square relative error (RMSE):
[0141]
[0142] According to the above formula, the relative error, mean absolute error, mean relative error, and root mean square relative error of the required model can be calculated: MRE = -0.3375%, MARE = 2.6508%, RMSE = 3.2183%, as shown in Table 2.
[0143] Table 2
[0144]
[0145] Step A5: using the initial sample data to train the initial ridge regression model to determine the ridge regression model;
[0146] Specifically, the ridge regression model is a method of regression data analysis for linear deviation estimation. It is an optimization estimation method based on the least squares method. The so-called least squares method is to optimize the algorithm with the aim of finding the best function for the sample data under the condition of minimizing the sum of squares of errors. In the prediction algorithm, it is to fit the minimum sum of squares of errors between the predicted value and the actual data.
[0147] Ridge regression analysis is a statistical method that fundamentally eliminates the impact of multicollinearity. The ridge regression model reduces the impact of complex collinear eigenvectors in the least squares estimation of parameters by introducing a small ridge parameter K (1>K>0) in the correlation matrix and adding it to the main diagonal elements. It also reduces the least squares estimation method of complex collinear variable coefficients, thereby ensuring that parameter estimates are closer to the actual situation.
[0148] Its parameter formula:
[0149]
[0150] Since the ridge parameter k is not uniquely determined, the obtained ridge regression estimator is actually a family of estimators of the regression parameters. The least squares method commonly used in regression analysis is an unbiased estimate. For a well-posed problem, X is usually full. Ridge regression is an improved method based on the least squares estimation method. If the sample data has obvious linear characteristics, it can provide a more stable estimate than the least squares method, and the standard deviation of the regression coefficient is also smaller than the least squares method.
[0151] Step A6, determining a second precise parameter of the ridge regression model according to the second predicted value calculated by the ridge regression model and the standard value of the traffic flow;
[0152] Table 3
[0153] Raw data 147 136 139 128 135 133 Predicted value 147.80 136.71 132.89 133.60 136.59 140.15 Relative error -0.55% -0.52% 4.4% -4.37% -1.17% -5.38% Raw data 155 142 142 148 145 150 Predicted value 143.11 144.90 145.55 145.69 146.53 149.89 Relative error 7.67% -2.04% -2.5% 1.56% -1.06 0.07%
[0154] As shown in Table 3, under the PYTHON condition, the fit between the predicted curve and the true curve of the ridge regression model is very high. It can be seen from Table 3 that the relative error between the true value and the predicted value is approximately controlled at a positive and negative value of about 6%. To further improve the accuracy of the prediction, further improvements need to be made to this algorithm. But at the same time, it shows that the model of linear regression theory can also be used for short-term traffic flow prediction. For the ridge regression model to predict short-term traffic flow, if the sample size is large enough, the prediction accuracy may increase. For ridge regression, while predicting, it is necessary to continuously adjust the training parameters of x and y. Finally, when the fit between the predicted value and the true value is 0.90143, x = 6.4, y = 156.12. According to the existing program, for the ridge regression model, MRE = -0.3692%, MARE = 2.6075%, RMSE = 3.4417%, as shown in Figure 4 shown.
[0155] Step A7: using the initialization sample data to train the initial vector machine model to determine the vector machine model;
[0156] Specifically, the original historical data is input as training data, and each training data is marked and divided into two categories. Then the support vector regression machine is used to analyze the characteristics of the data presentation, and the new samples are assigned to one of the categories, making it a non-probabilistic two-dimensional linear classifier. The support vector regression machine model represents data points as mapping points in space, clearly separating data points of a single category. All such new data points will be mapped to the same space, and then they can be predicted based on which side of the interval they fall.
[0157] The idea of the perceptron is to find a straight line that can separate the data. If you go up to a high dimension, you will find a hyperplane and then you can separate the high-dimensional data. There may be an infinite number of perceptron hyperplanes, and the support vector regression machine can be understood as finding the best one among the infinite number of hyperplanes.
[0158] The so-called function interval is the expression of the loss function of the perceptron, and its formula is:
[0159] γ'=y(w t x+b) (8)
[0160] For geometric intervals, it refers to the distance from each sample point to the hyperplane.
[0161]
[0162] Step A8, determining a third precise parameter of the vector machine model according to the third prediction value calculated by the vector machine model and the traffic flow standard value;
[0163] Step A9: if the first precise parameter is less than the first preset value, the second precise parameter is less than the second preset value, and the third precise parameter is less than the third preset value, the moving average model is determined as the target moving average model, the ridge regression model is determined as the target ridge regression model, and the vector machine model is determined as the target vector machine model;
[0164] Repeat the above steps using the support vector machine model to calculate the third precise parameter, and then compare it with the actual value, such as Figure 5 shown.
[0165] Then compare the prediction results with the first two models, such as Figure 6 shown.
[0166] Step A10, determining a first weight value of a target moving average model, a second weight value of a target ridge regression model, and a third weight value of a target vector machine model;
[0167] Step A11, determining a first product of a target moving average model and a first weight value, a second product of a target regression model and a second weight value, and a third product of a target vector machine model and a third weight value;
[0168] Step A12: Determine a target traffic flow prediction model according to the first product, the second product and the third product.
[0169] Specifically, according to the first product, the second product and the third product, a target traffic flow prediction model is determined, including:
[0170] Determining a preset error parameter according to the first precise parameter, the first weight value, the second precise parameter, the second weight value, the third precise parameter and the third weight value;
[0171] If the value of the preset error parameter is the smallest, the traffic flow prediction model corresponding to the preset error parameter is used as the target traffic flow prediction model.
[0172] Specifically, the idea of establishing a combined model for short-term traffic flow prediction is to select a suitable weighting coefficient for each model under the constraints of 36 prediction results of three prediction models, and the weighting coefficients of the three models are 1, and then obtain the combined prediction value.
[0173] Select the same sample sequence of prediction data {x t ,t=1,2,3,4...N} adopt multiple independent prediction methods, and let the prediction value of the i-th single prediction method at time t be x it , (i=1,2...n); t=1,2,3...N, called e it =(x t -x it ) is the prediction deviation of i independent prediction methods at time t.
[0174] Assume l 1 ,l 2 …,l n are the weight coefficients of n independent prediction methods. Under the condition of limiting unbiasedness of the combined method, the weight coefficients should satisfy:
[0175] l 1 +l 2 +…l n =1 (10)
[0176] set up For x t The combined prediction result of t The prediction error of the combined model at time t is:
[0177]
[0178] The sum of squares of the forecast errors of the combined model is an important basis for adopting the weighted method, so:
[0179]
[0180] Then, the prediction weight coefficient of the optimal linear combination is obtained as long as the minimum sum of squares of prediction errors is guaranteed.
[0181]
[0182] Simply put, it is a weighted method that ensures that the square of the error is better, using the formula:
[0183]
[0184] The comparison of the predicted values of the previous three prediction models is as follows, so according to formulas (5-4)(5-5(5-6)(5-8), the weight ratios of the three models can be calculated (0.332, 0.332, 0.336).
[0185] Optionally, determining a moving average model according to a quadratic moving average method and initializing sample data includes:
[0186]
[0187] in: —The quadratic moving average of period t; x t+1 is the predicted value for period t+1; is the moving average value of the tth period; n is the number of historical data participating in the moving average.
[0188] Optionally, the first precise parameter includes: relative error, average relative error, average absolute relative error and root mean square relative error, and the relative error, average relative error, average absolute relative error and root mean square relative error specifically include:
[0189] Calculate the relative error, Among them, x i is the actual value of traffic volume, y i is the traffic volume forecast value;
[0190] Calculate the average relative error,
[0191] Calculate the absolute relative error,
[0192] Calculate the RMS relative error,
[0193] Optionally, determining a target traffic flow prediction model according to the first product, the second product, and the third product includes:
[0194] Settings 1 ,l 2 …,l n are the weight coefficients of n independent prediction methods, and the weight coefficients should satisfy: 1 +l 2 +…l n =1, where l 1 is the first weight value, l 2 is the second weight value, l n is the third weight value;
[0195] Get the target traffic flow prediction model as Among them, L represents the weight value omitted in the middle.
[0196] The prediction error value of the target traffic flow prediction model at time t is obtained as
[0197] Calculate the sum of squares of the prediction error of the target traffic flow prediction model
[0198] According to the sum of squares of the prediction errors, the minimum sum of squares of the prediction errors is determined, that is,
[0199]
[0200] After the minimum prediction error sum of squares is determined, a first weight value, a second weight value, and a third weight value corresponding to the minimum prediction error sum of squares are determined;
[0201] A target traffic flow prediction model is determined according to the first weight value, the second weight value, and the third weight value.
[0202] Through the embodiments of the present invention, short-term traffic volume in peak hours can be selected for prediction research, the adaptability and prediction accuracy of the model can be verified, the time interval can be reduced, and the time segment can be shortened, that is, a single prediction of the peak hour traffic flow at a certain moment can be made.
[0203] Figure 2 FIG. 1 is a flow chart of another method for predicting short-term traffic flow according to an embodiment of the present invention. Figure 2 As shown in the figure, the short-term traffic flow prediction method will construct a short-term traffic flow prediction model that combines a linear prediction model with a neural network prediction model to alleviate problems such as insufficient linear fitting. In view of the periodicity, similarity, uncertainty, real-time nonlinearity and randomness of traffic flow, a model that is applicable to one or more characteristics is used for prediction. Finally, the weight coefficient of each model is calculated with accuracy as an indicator, and the models are combined to obtain a new model.
[0204] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0205] The short-term traffic flow prediction method provided by the embodiment of the present invention obtains a preset time period of a road area to be predicted; and obtains the target traffic flow of the preset time period in the road area to be predicted according to the preset time period and a pre-established target traffic flow prediction model, wherein the pre-established target traffic flow prediction model is determined according to a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in a sample set using a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set. The embodiment of the present invention can predict the short-term traffic volume of a road at a certain section at a certain time, thereby saving human resources and improving prediction efficiency.
[0206] Another embodiment of the present invention provides a short-term traffic flow prediction device, which is used to execute the short-term traffic flow prediction method provided by the above embodiment.
[0207] Reference Figure 7 , shows a structural block diagram of an embodiment of a short-term traffic flow prediction device of the present invention, the device may specifically include the following modules: an acquisition module 701 and a prediction module 702, wherein:
[0208] The acquisition module 701 is used to acquire a preset time period of the road area to be predicted;
[0209] The prediction module 702 is used to obtain the target traffic flow of the preset time period in the road area to be predicted according to the preset time period and the pre-established target traffic flow prediction model, wherein the pre-established target traffic flow prediction model is determined according to the target moving average model, the target ridge regression model and the target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in the sample set by using the moving average method, the target ridge regression model is obtained by training the initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training the initial vector machine model with the traffic flow sample data in the sample set. The short-term traffic flow prediction device provided by the embodiment of the present invention obtains the preset time period of the road area to be predicted; according to the preset time period and the pre-established target traffic flow prediction model, the target traffic flow of the preset time period in the road area to be predicted is obtained, wherein the pre-established target traffic flow prediction model is determined according to the target moving average model, the target ridge regression model and the target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in the sample set by using the moving average method, the target ridge regression model is obtained by training the initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training the initial vector machine model with the traffic flow sample data in the sample set. The embodiment of the present invention can predict the short-term traffic volume of a road at a certain time on a certain road section, save human resources and improve prediction efficiency. .
[0210] Another embodiment of the present invention further supplements the short-term traffic flow prediction device provided in the above embodiment.
[0211] Optionally, the device further comprises a model building module, the model building module being used for:
[0212] Obtain traffic flow sample data in the sample set;
[0213] Preprocessing the traffic flow sample data to obtain initialization sample data;
[0214] Determine the moving average model based on the quadratic moving average method and the initial sample data;
[0215] Determining a first precise parameter of the moving average model based on a first predicted value calculated by the moving average model and a standard value of traffic flow;
[0216] The initial ridge regression model is trained using the initial sample data to determine the ridge regression model;
[0217] Determining second precise parameters of the ridge regression model based on the second predicted value calculated by the ridge regression model and the standard value of the traffic flow;
[0218] Using the initialization sample data to train the initial vector machine model, and determining the vector machine model;
[0219] Determining a third precise parameter of the vector machine model according to the third predicted value calculated by the vector machine model and the standard value of the traffic flow;
[0220] If the first precise parameter is less than the first preset value, the second precise parameter is less than the second preset value, and the third precise parameter is less than the third preset value, the moving average model is determined as the target moving average model, the ridge regression model is determined as the target ridge regression model, and the vector machine model is determined as the target vector machine model;
[0221] Determining a first weight value of a target moving average model, a second weight value of a target ridge regression model, and a third weight value of a target vector machine model;
[0222] Determine a first product of a target moving average model and a first weight value, a second product of a target regression model and a second weight value, and a third product of a target vector machine model and a third weight value;
[0223] According to the first product, the second product and the third product, a target traffic flow prediction model is determined. Optionally, the model building module is used to:
[0224] Determining a preset error parameter according to the first precise parameter, the first weight value, the second precise parameter, the second weight value, the third precise parameter and the third weight value;
[0225] If the value of the preset error parameter is the smallest, the traffic flow prediction model corresponding to the preset error parameter is used as the target traffic flow prediction model.
[0226] Optionally, the model building module is used to:
[0227]
[0228] in: —The quadratic moving average of period t; x t+1 is the predicted value for period t+1; is the moving average value of the tth period; n is the number of historical data participating in the moving average.
[0229] Optionally, the model building module is used to:
[0230] Calculate the relative error, Among them, x i is the actual value of traffic volume, y i is the traffic volume forecast value;
[0231] Calculate the average relative error,
[0232] Calculate the absolute relative error,
[0233] Calculate the RMS relative error,
[0234] Optionally, the model building module is used to:
[0235] Settings 1 ,l 2 …,l n are the weight coefficients of n independent prediction methods, and the weight coefficients should satisfy: 1 +l 2 +…l n =1, where l 1 is the first weight value, l 2 is the second weight value, l n is the third weight value;
[0236] Get the target traffic flow prediction model as
[0237] The prediction error value of the target traffic flow prediction model at time t is obtained as
[0238] Calculate the sum of squares of the prediction error of the target traffic flow prediction model
[0239] According to the sum of squares of the prediction errors, the minimum sum of squares of the prediction errors is determined, that is,
[0240]
[0241] After the minimum prediction error sum of squares is determined, a first weight value, a second weight value, and a third weight value corresponding to the minimum prediction error sum of squares are determined;
[0242] A target traffic flow prediction model is determined according to the first weight value, the second weight value, and the third weight value.
[0243] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0244] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0245] The short-term traffic flow prediction device provided by the embodiment of the present invention obtains a preset time period of a road area to be predicted; and obtains the target traffic flow of the preset time period in the road area to be predicted according to the preset time period and a pre-established target traffic flow prediction model, wherein the pre-established target traffic flow prediction model is determined according to a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in a sample set using a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set. The embodiment of the present invention can predict the short-term traffic volume of a road at a certain section at a certain time, thereby saving human resources and improving prediction efficiency.
[0246] Yet another embodiment of the present invention provides a terminal device for executing the short-term traffic flow prediction method provided in the above embodiment.
[0247] Figure 8 is a schematic diagram of the structure of a terminal device of the present invention, such as Figure 8 As shown, the terminal device includes: at least one processor 801 and a memory 802;
[0248] The memory stores a computer program; and at least one processor executes the computer program stored in the memory to implement the short-term traffic flow prediction method provided in the above embodiment.
[0249] The terminal device provided in the present embodiment obtains a preset time period of the road area to be predicted; and obtains the target traffic flow of the preset time period in the road area to be predicted according to the preset time period and a pre-established target traffic flow prediction model, wherein the pre-established target traffic flow prediction model is determined according to a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in the sample set using the moving average method, the target ridge regression model is obtained by training the initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training the initial vector machine model with the traffic flow sample data in the sample set. The embodiment of the present invention can predict the short-term traffic volume of a road on a certain section at a certain time, thereby saving human resources and improving prediction efficiency.
[0250] Yet another embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the method for predicting short-term traffic flow provided by any of the above embodiments is implemented.
[0251] According to the computer-readable storage medium of the present embodiment, a preset time period of the road area to be predicted is obtained; according to the preset time period and a pre-established target traffic flow prediction model, a target traffic flow of the preset time period in the road area to be predicted is obtained, wherein the pre-established target traffic flow prediction model is determined according to a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in the sample set using a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set. Through the embodiment of the present invention, the short-term traffic volume of a road in a certain section at a certain time can be predicted, thereby saving human resources and improving prediction efficiency.
[0252] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0253] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0254] The embodiments of the present invention are described with reference to flowcharts and / or block diagrams of methods, electronic devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing electronic device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing electronic device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0255] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing electronic device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0256] These computer program instructions can also be loaded onto a computer or other programmable data processing electronic device so that a series of operating steps are executed on the computer or other programmable electronic device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable electronic device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0257] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0258] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or electronic device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article or electronic device. In the absence of further restrictions, the elements defined by the sentence "comprises a..." do not exclude the presence of other identical elements in the process, method, article or electronic device that includes the elements.
[0259] The above is a detailed introduction to a short-term traffic flow prediction method and a short-term traffic flow prediction device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for predicting short-term traffic flow, characterized in that: The method comprises: Obtain a preset time period of the road area to be predicted; According to the preset time period and the pre-established target traffic flow prediction model, a target traffic flow of the preset time period in the road area to be predicted is obtained, wherein the pre-established target traffic flow prediction model is determined according to a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in the sample set by adopting a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set; The pre-established target traffic flow prediction model is obtained by the following method, including: Obtain traffic flow sample data in the sample set; Preprocessing the traffic flow sample data to obtain initialization sample data; Determine the moving average model according to the moving average method and the initialization sample data; Determining a first precise parameter of the moving average model according to a first predicted value calculated by the moving average model and a standard value of traffic flow; Using the initialization sample data to train the initial ridge regression model to determine the ridge regression model; Determining second precise parameters of the ridge regression model according to the second predicted value calculated by the ridge regression model and the traffic flow standard value; Using the initialization sample data to train an initial vector machine model to determine the vector machine model; Determining a third precise parameter of the vector machine model according to a third predicted value calculated by the vector machine model and a standard value of traffic flow; If the first precise parameter is less than a first preset value, the second precise parameter is less than a second preset value, and the third precise parameter is less than a third preset value, the moving average model is determined as a target moving average model, the ridge regression model is determined as a target ridge regression model, and the vector machine model is determined as a target vector machine model; Determining a first weight value of the target moving average model, a second weight value of the target ridge regression model, and a third weight value of the target vector machine model; Determine a first product of the target moving average model and a first weight value, a second product of the target ridge regression model and the second weight value, and a third product of the target vector machine model and the third weight value; The target traffic flow prediction model is determined according to the first product, the second product and the third product.
2. The method according to claim 1, characterized in that: Determining the target traffic flow prediction model according to the first product, the second product and the third product includes: Determining a preset error parameter according to the first precise parameter, the first weight value, the second precise parameter, the second weight value, the third precise parameter and the third weight value; If the value of the preset error parameter is the smallest, the traffic flow prediction model corresponding to the preset error parameter is used as the target traffic flow prediction model.
3. The method according to claim 1, characterized in that Determining the moving average model according to the moving average method and the initialization sample data includes: in: is the quadratic moving average of the tth period; x t+1 is the predicted value for period t+1; is the moving average value of the tth period; n is the number of historical data participating in the moving average.
4. The method according to claim 3, characterized in that The first precise parameter includes: relative error, average relative error, average absolute relative error and root mean square relative error. The relative error, average relative error, average absolute relative error and root mean square relative error specifically include: Calculate the relative error, Among them, x i is the actual value of traffic volume, y i is the traffic volume forecast value; Calculate the average relative error, Calculate the absolute relative error, Calculate the RMS relative error, 5. The method according to claim 3, characterized in that: Determining the target traffic flow prediction model according to the first product, the second product and the third product includes: Set l1, l2, ..., l n are the weight coefficients of n independent prediction methods, and the weight coefficients should satisfy: l1+l2+…l n =1, where l1 is the first weight value, l2 is the second weight value, and l n is the third weight value; Get the target traffic flow prediction model as The prediction error value of the target traffic flow prediction model at time t is obtained as Calculate the prediction error sum of squares of the target traffic flow prediction model According to the prediction error sum of squares, the minimum prediction error sum of squares is determined, that is, After the minimum prediction error sum of squares is determined, a first weight value, a second weight value, and a third weight value corresponding to the minimum prediction error sum of squares are determined; The target traffic flow prediction model is determined according to the first weight value, the second weight value and the third weight value.
6. A short-term traffic flow prediction device, characterized in that: The device comprises: An acquisition module, used for acquiring a preset time period of a road area to be predicted; A prediction module, used to obtain a target traffic flow of a preset time period in a road area to be predicted according to the preset time period and a pre-established target traffic flow prediction model, wherein the pre-established target traffic flow prediction model is determined according to a target moving average model, a target ridge regression model and a target vector machine model, the target moving average model is obtained by processing the traffic flow sample data in a sample set by adopting a moving average method, the target ridge regression model is obtained by training an initial ridge regression model with the traffic flow sample data in the sample set, and the target vector machine model is obtained by training an initial vector machine model with the traffic flow sample data in the sample set; The device also includes a model building module, and the model building module is used to: Obtain traffic flow sample data in the sample set; Preprocessing the traffic flow sample data to obtain initialization sample data; Determine the moving average model according to the moving average method and the initialization sample data; Determining a first precise parameter of the moving average model according to a first predicted value calculated by the moving average model and a standard value of traffic flow; Using the initialization sample data to train the initial ridge regression model to determine the ridge regression model; Determining second precise parameters of the ridge regression model according to the second predicted value calculated by the ridge regression model and the traffic flow standard value; Using the initialization sample data to train an initial vector machine model to determine the vector machine model; Determining a third precise parameter of the vector machine model according to a third predicted value calculated by the vector machine model and a standard value of traffic flow; If the first precise parameter is less than a first preset value, the second precise parameter is less than a second preset value, and the third precise parameter is less than a third preset value, the moving average model is determined as a target moving average model, the ridge regression model is determined as a target ridge regression model, and the vector machine model is determined as a target vector machine model; Determining a first weight value of the target moving average model, a second weight value of the target ridge regression model, and a third weight value of the target vector machine model; Determine a first product of the target moving average model and a first weight value, a second product of the target ridge regression model and the second weight value, and a third product of the target vector machine model and the third weight value; The target traffic flow prediction model is determined according to the first product, the second product and the third product.
7. A terminal device, characterized in that: include: at least one processor and memory; The memory stores a computer program; The at least one processor executes the computer program stored in the memory to implement the short-term traffic flow prediction method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method for predicting short-term traffic flow according to any one of claims 1 to 5 is implemented.
