CN113450566A - Urban traffic flow prediction method - Google Patents
Urban traffic flow prediction method Download PDFInfo
- Publication number
- CN113450566A CN113450566A CN202110690799.1A CN202110690799A CN113450566A CN 113450566 A CN113450566 A CN 113450566A CN 202110690799 A CN202110690799 A CN 202110690799A CN 113450566 A CN113450566 A CN 113450566A
- Authority
- CN
- China
- Prior art keywords
- data
- traffic flow
- prediction method
- flow prediction
- urban traffic
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 238000012706 support-vector machine Methods 0.000 claims abstract description 16
- 238000011478 gradient descent method Methods 0.000 claims abstract description 7
- 238000007781 pre-processing Methods 0.000 claims abstract description 7
- 238000005457 optimization Methods 0.000 claims description 7
- 239000013598 vector Substances 0.000 claims description 6
- 239000012634 fragment Substances 0.000 claims description 4
- 238000000926 separation method Methods 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 abstract description 7
- 238000012549 training Methods 0.000 description 10
- 238000012545 processing Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0125—Traffic data processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
- G06N20/20—Ensemble learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/40—Business processes related to the transportation industry
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Human Resources & Organizations (AREA)
- Economics (AREA)
- Strategic Management (AREA)
- Software Systems (AREA)
- Analytical Chemistry (AREA)
- Chemical & Material Sciences (AREA)
- General Business, Economics & Management (AREA)
- Marketing (AREA)
- Tourism & Hospitality (AREA)
- Quality & Reliability (AREA)
- Development Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Game Theory and Decision Science (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Operations Research (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Primary Health Care (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses an urban traffic flow prediction method, which comprises the steps of collecting real-time traffic data through devices such as a sensor and the like and preprocessing the real-time traffic data to form a track data stream, converting the traffic data into a plurality of pieces in batches through Spark Streaming to generate a data set, reading the data in the data set in a Direct mode, then establishing a support vector machine model and solving the support vector machine model by using a random gradient descent method to obtain traffic condition trend prediction data; the urban traffic flow prediction method has small memory pressure on the chip, high prediction precision and high calculation speed, is suitable for the domestic Loongson 3B3000 chip, and expands the software ecology of the domestic chip.
Description
Technical Field
The invention relates to an urban traffic flow prediction method.
Background
An effective way for relieving traffic jam is to establish an intelligent traffic system on the infrastructure of the existing road, design and realize an accurate and real-time traffic flow prediction algorithm which is the prerequisite for the operation of the intelligent traffic system, and how to ensure that massive urban traffic flow data is mined and analyzed in as short a time as possible and accurately predict the urban short-time traffic flow state in real time is the problem to be solved urgently at present; in addition, because the domestic chips cannot reach the level of the international latest chips at present, the current traffic flow prediction method has high requirements on resource utilization rate, memory utilization rate and the like, and cannot be adapted to most domestic chips.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to provide a city traffic flow prediction method which has small pressure on a chip memory, high prediction precision and high calculation speed.
The technical scheme is as follows: the urban traffic flow prediction method comprises the following steps: (1) collecting real-time traffic data and preprocessing the real-time traffic data; (2) converting the data preprocessed in the step (1) into a plurality of batch fragments and generating a data set; (3) establishing a support vector machine model and solving by using a random gradient descent method to obtain traffic condition trend prediction data; (4) the model is validated and updated based on the traffic data and traffic situation trend prediction data.
The method comprises the following steps that (1) real-time traffic data are collected through a sensor or a satellite and uploaded to a server, the real-time traffic data are preprocessed to form a track data stream, and the track data stream is transmitted into a Kafka message queue. The preprocessing is to fuse redundant data in the trace data stream and filter false data.
Further, in the step (2), data in the data set is read in a Direct manner, and the traffic data is converted into batch fragments through Spark Streaming.
Has the advantages that: compared with the prior art, the invention has the following remarkable advantages: (1) the resource utilization rate and the memory utilization rate are low, data consumption is carried out based on a Direct mode, parallel reading is simplified, and the resource utilization rate and the memory utilization rate of application are reduced; (2) the prediction real-time performance is strong, the prediction precision is high, a Support Vector Machine (SVM) model based on a random gradient descent (SGD) method is constructed, and the optimal solution can be effectively and quickly solved; (3) the software ecology of a domestic chip is expanded, the SVMWithSGD model is used for predicting the rail traffic flow, the method is suitable for a domestic Loongson 3B3000 chip, and the requirements of high safety, strong real-time performance and high prediction precision of a domestic chip platform under the current big data background are met.
Drawings
FIG. 1 is a block diagram of an urban traffic flow forecast overview of the present invention;
FIG. 2 is a diagram of a Spark Streaming combination Kafka real-time processing system according to the present invention;
FIG. 3 is a flowchart of the SVMWithSGD algorithm training of the present invention.
Detailed Description
The technical scheme of the invention is further explained by combining the attached drawings.
As shown in FIG. 1, the urban traffic flow prediction method provided by the invention utilizes Spark Streaming to perform real-time Streaming processing on the preprocessed track data, simultaneously performs data compression to retain original data so as to facilitate model adjustment and reduce storage space, and finally constructs a gradient optimization SVM model to realize a track prediction function, so that the method can meet the requirements of high safety, strong real-time performance and high prediction precision of a domestic chip platform under the current big data background.
(1) Collecting and pre-processing traffic flow data
The method comprises the steps of collecting real-time traffic data by using devices such as sensors and satellites, transmitting the real-time traffic data into a server of a big data analysis center for data preprocessing, fusing redundant data, filtering false data, transmitting the data into a Kafka message queue, compressing the preprocessed urban traffic flow data to form a track data stream, reducing storage space, and storing the data for model verification and updating.
(2) Track data stream conversion batch (batch) slicing and generating data sets
As shown in fig. 2, a continuously input track-forming data stream is converted into a plurality of batch fragments through Spark Streaming, and data is read based on a Direct method that does not require a special Receiver any more, that is, data is read when calculation is required. When the batch task is triggered, the data is read by the executive and participates in the data calculation process of other executors, and when the batch task is triggered next time, the Kafka data is read by the executive and calculated. The requirement of data consumption based on the Direct mode on the memory is not high, only the memory required by batch calculation needs to be considered, meanwhile, the data accumulation cannot be influenced when the batch task is accumulated, and a data set generated after data stream processing is used as a training data set T of the random gradient optimization SVM model.
(3) Building a SVMWithSGD model
The learning algorithm of the SVM is an optimization algorithm for solving convex quadratic programming, and the learning strategy of the SVM is interval maximization, can be formalized into a problem for solving the convex quadratic programming, and is also equivalent to a minimization problem of a regularized hinge loss function. The basic principle of the SVM algorithm is to solve a separation hyperplane, which is infinite for a linearly separable data set, but the separation hyperplane which can correctly divide a training data set and has the largest geometrical interval is unique. And wx + b is 0, namely the separating hyperplane. The gradient descent method is the most common method for solving the unconstrained optimization problem, and is an iterative method, and the main operation of each step is to solve the gradient vector of an objective function, and take the negative gradient direction of the current position as the search direction. The gradient descent method is characterized in that: the closer to the target value, the smaller the step size, the slower the descent speed. The random gradient descent randomly selects a sub-gradient approximate integral gradient of a training sample to calculate when calculating the direction of the fastest descent instead of scanning all training data sets, and simultaneously updates the required separation hyperplane method vector w through multiple iterations, so that the optimal solution of w can be effectively and quickly calculated, and the iteration speed is accelerated.
The solution of the SVM optimal problem can be divided into two directions, one of which can be expressed as the dual of the solution of the original problem, and the other is to directly optimize the original problem. The SGD randomly selects a sub-gradient of a training sample to approximate the whole gradient to calculate when calculating the direction of the fastest descending, instead of scanning all training data sets, and meanwhile, the optimal solution of w can be effectively and quickly solved by updating the solved separated hyperplane normal vector w through multiple iterations, so that the iteration speed is accelerated.
As shown in fig. 3, which is a SVMWithSGD algorithm training flow chart, firstly, the SVM model parameters are determined by using the processed feature vectors, and then, a gradient optimization method is used for solving; training data set T { (x)1,y1),(x2,y2),...,(xN,yN) In which xi∈Rn,yi∈{+1,-1},i=1,2,...,N,xiIs the i-th feature vector, yiIs a class label, which is positive when it equals +1 and negative when it equals-1. Then, let the training data set be linearly separable, λ be the optimization parameter, λ ≧ 0. The quadratic programming model is as follows:
the gradient of w is:
st.yiwTxi<1,i=1,2,...,n
the batch gradient descent method needs to substitute all samples into a model for calculation and solution, when the n-dimensional data quantity with the number of the samples being m is subjected to cyclic iteration to solve the descent gradient, the calculation complexity is O (mn), and when the processed data quantity is the same as the batch data of the urban traffic, the iteration frequency needs to be large, the program operation time is slow, and the requirement of traffic flow prediction cannot be met. Therefore, the SGD is selected to solve the SVM model to obtain traffic condition trend prediction data, such as the average speed pre-data of the vehicles at the entrance, the prediction data of the jam condition at the entrance and the like, and the updating process at each time is as follows.
Wherein wtIn the descending direction, g (w)t) Is a gradient representation in the falling direction, etatStep size, i.e. the step size is searched in the descending direction, t ═ 1, 2.
(4) Timely updating SVMWithSGD model
And adjusting the prediction result in real time according to the continuously input urban traffic data stream, carrying out batch processing on the compressed preprocessed data to verify the accuracy of the model and updating the model.
Claims (7)
1. The urban traffic flow prediction method is characterized by comprising the following steps:
(1) collecting real-time traffic data and preprocessing the real-time traffic data;
(2) converting the data preprocessed in the step (1) into a plurality of batch fragments and generating a data set;
(3) establishing a support vector machine model and solving by using a random gradient descent method to obtain traffic condition trend prediction data;
(4) the model is validated and updated based on the traffic data and traffic situation trend prediction data.
2. The urban traffic flow prediction method according to claim 1, wherein the support vector machine model in step (3) is:
wherein (x)i,yi) And (3) regarding the data in the data set in the step (2), wherein w is a separation hyperplane normal vector, n is a sample dimension in the data set, and lambda is an optimization parameter.
3. The urban traffic flow prediction method according to claim 1, wherein the iterative formula for solving the support vector machine model by using the stochastic gradient descent method in step (3) is as follows:
wherein wtIn the descending direction, ηtFor the search step size, g (w)t) For the gradient in the descending direction, t is 1, 2.
4. The urban traffic flow prediction method according to claim 1, wherein the step (1) is: real-time traffic data are collected through a sensor or a satellite and uploaded to a server, and are preprocessed to form a track data stream which is transmitted into a Kafka message queue.
5. The urban traffic flow prediction method according to claim 4, wherein the preprocessing is to fuse redundant data in the trajectory data stream and filter spurious data.
6. The urban traffic flow prediction method according to claim 1, characterized in that in step (2), data in the data set is read in a Direct manner.
7. The urban traffic flow prediction method according to claim 1, wherein the traffic data is converted into batch segments through Spark Streaming in step (2).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110690799.1A CN113450566A (en) | 2021-06-22 | 2021-06-22 | Urban traffic flow prediction method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110690799.1A CN113450566A (en) | 2021-06-22 | 2021-06-22 | Urban traffic flow prediction method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113450566A true CN113450566A (en) | 2021-09-28 |
Family
ID=77812072
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110690799.1A Pending CN113450566A (en) | 2021-06-22 | 2021-06-22 | Urban traffic flow prediction method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113450566A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105160866A (en) * | 2015-08-07 | 2015-12-16 | 浙江高速信息工程技术有限公司 | Traffic flow prediction method based on deep learning nerve network structure |
CN106384507A (en) * | 2016-09-20 | 2017-02-08 | 宁波大学 | Travel time real-time estimation method based on sparse detector |
CN110287189A (en) * | 2019-06-25 | 2019-09-27 | 浪潮卓数大数据产业发展有限公司 | A kind of method and system based on spark streaming processing mobile cart data |
US20200118423A1 (en) * | 2017-04-05 | 2020-04-16 | Carnegie Mellon University | Deep Learning Methods For Estimating Density and/or Flow of Objects, and Related Methods and Software |
-
2021
- 2021-06-22 CN CN202110690799.1A patent/CN113450566A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105160866A (en) * | 2015-08-07 | 2015-12-16 | 浙江高速信息工程技术有限公司 | Traffic flow prediction method based on deep learning nerve network structure |
CN106384507A (en) * | 2016-09-20 | 2017-02-08 | 宁波大学 | Travel time real-time estimation method based on sparse detector |
US20200118423A1 (en) * | 2017-04-05 | 2020-04-16 | Carnegie Mellon University | Deep Learning Methods For Estimating Density and/or Flow of Objects, and Related Methods and Software |
CN110287189A (en) * | 2019-06-25 | 2019-09-27 | 浪潮卓数大数据产业发展有限公司 | A kind of method and system based on spark streaming processing mobile cart data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wang et al. | Multi-step ahead wind speed prediction based on optimal feature extraction, long short term memory neural network and error correction strategy | |
CN110175580B (en) | Video behavior identification method based on time sequence causal convolutional network | |
Laptev et al. | Time-series extreme event forecasting with neural networks at uber | |
CN110147321B (en) | A method for identifying high-risk modules with defects based on software network | |
CN101334845B (en) | Video frequency behaviors recognition method based on track sequence analysis and rule induction | |
CN106709588B (en) | Prediction model construction method and device and real-time prediction method and device | |
CN107103332A (en) | A kind of Method Using Relevance Vector Machine sorting technique towards large-scale dataset | |
US20230326191A1 (en) | Method and Apparatus for Enhancing Performance of Machine Learning Classification Task | |
CN106951976A (en) | A Method of Bus Passenger Flow Prediction Based on Pattern Classification | |
CN114548592A (en) | Non-stationary time series data prediction method based on CEMD and LSTM | |
CN101853573A (en) | A system and method for predicting short-term traffic information on urban expressways | |
CN115690545B (en) | Method and device for training target tracking model and target tracking | |
CN111626327A (en) | Aircraft heavy landing prediction method, device, computer equipment and storage medium | |
CN113095443A (en) | Real-time weather prediction algorithm based on LSTM-DNN network model | |
CN117728403A (en) | Wind power probability prediction method and system under severe wind scene of cold weather | |
CN111667694A (en) | A Short-term Traffic Flow Prediction Method Based on Improved DTW-KNN | |
CN118781815B (en) | Intelligent traffic information acquisition method and system based on big data | |
CN113450566A (en) | Urban traffic flow prediction method | |
CN117829822B (en) | Power transformer fault early warning method and system | |
CN119051705A (en) | A congestion perception and fault prediction method for large-scale low-orbit satellite networks | |
CN118366136A (en) | Risk driving behavior recognition method and device based on bayonet track data | |
Tarwani et al. | Deep learning approach for weather classification using pre-trained convolutional neural networks | |
CN111860598A (en) | A data analysis method and electronic device for motion behavior and relationship recognition | |
CN112101427A (en) | Traffic pattern recognition method, device and storage medium | |
CN118246313A (en) | Fan bearing degradation performance prediction method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210928 |