Traffic flow prediction method, system, device and medium based on deep forest
Through the traffic flow prediction method based on deep forests, a directed graph of the traffic flow network is constructed, and the data is processed and trained, which solves the problem of poor prediction effect of deep neural networks caused by insufficient data in the early stage of highway operation, and realizes engineering prediction of short-term and medium- and long-term traffic flows.
Patent Information
- Application Number
- CN202310007169.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-04
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2043-01-04
AI Technical Summary
Due to insufficient data in the early stage of highway operation, deep neural networks have poor results in traffic flow prediction, making it difficult to support engineering applications.
The traffic flow prediction method based on deep forest is adopted, and by constructing a directed graph of the traffic flow network, the relevant data is obtained and filled, the traffic flow timing data period is determined, the data is processed using the mobile window function, the training set and verification set with spatiotemporal characteristics are generated, and the traffic flow prediction model is inputted to the deep forest model for training to obtain the traffic flow prediction model.
It solves the problem of poor prediction effect of deep neural networks caused by insufficient data in the early stage of highway operation, and realizes engineering prediction of short-term and medium- and long-term traffic flows.
Smart Images

Figure CN116071919B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation, and more specifically, to a traffic flow prediction method and system, device and medium based on deep forest. Background Art
[0002] Highway traffic flow prediction is to use historical traffic data to predict the traffic flow of the target road in the future, which plays a vital role in highway road control. Traffic flow data has the characteristics of nonlinearity, randomness, and spatiotemporal variability, making traffic flow prediction one of the research hotspots and difficulties in the transportation field.
[0003] Unlike other time series prediction problems, the main challenge of traffic flow prediction lies in the complex coupling relationship including the topological connection relationship of the road network structure and its ever-changing spatiotemporal characteristics. Spatially, there is a strong correlation between adjacent nodes in the road network that directly affects each other, and there is also an implicit spatial correlation between non-adjacent nodes in the traffic flow pattern based on the origin-destination (OD) of the traffic trip. In terms of time, traffic data shows strong time-varying, periodic and seasonal characteristics, such as morning and evening peaks, holidays, spring and autumn, etc.
[0004] Traditional methods based on mathematical statistics and classical machine learning methods often model, analyze and predict the time series data of a certain observation point in the road network. Representative methods include historical average (HA), autoregressive integrated moving average (ARIMA) model, Kalman filtering model, nonparametric regressive model and dynamic mode decomposition. With the development of deep neural networks, end-to-end convolutional neural networks (CNN), recurrent neural networks (RNN) and their variants, long short-term memory (LSTM) networks and gated recurrent units (GRU) and other network models are widely used in time series prediction problems.
[0005] The above method can capture the nonlinear characteristics of time series data, but it is difficult to describe the mutual influence between nodes for time series prediction of a single node. In addition, for the initial operation of highways (within 6 months), the data collected by various sensing devices is still insufficient compared to the data training requirements of deep neural networks, which makes the prediction results of the above deep neural network model difficult to support engineering applications. Summary of the invention
[0006] The object of the present invention is to provide a traffic flow prediction method and system, device and medium based on deep forest to solve at least one of the problems existing in the related art.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] The first aspect of the present invention provides a traffic flow prediction method based on deep forest, comprising:
[0009] Constructing a traffic flow network directed graph, wherein the nodes in the traffic flow network directed graph are vehicle detectors, and the edges are vehicle driving trajectories with directions;
[0010] Obtain relevant data in the traffic flow network directed graph according to the forecast demand, and fill in the data to obtain a complete relevant data set;
[0011] Determine the traffic flow time series data cycle;
[0012] Setting a moving window function based on the traffic flow time series data period, and processing the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a validation set with spatiotemporal characteristics;
[0013] Inputting the traffic flow data training set with spatiotemporal characteristics into the deep forest model for training to obtain a traffic flow prediction model;
[0014] Traffic flow prediction is performed according to the traffic flow prediction model.
[0015] Optionally, the traffic flow data in the traffic flow network directed graph includes: monitoring values, influencing factors and additional factors;
[0016] The monitoring values include traffic volume, average speed and occupancy rate;
[0017] The influencing factors include meteorological information and traffic events;
[0018] The additional information includes the association information of the upstream and downstream vehicle detectors, the vehicle detectors associated with the start and end of the traffic demand, the number of lanes and the designed speed.
[0019] Optionally, the prediction demand includes predicting the vehicle traffic conditions of a single node and predicting the vehicle traffic conditions of a road section;
[0020] If the prediction demand is to predict the vehicle traffic conditions of a single node, the monitoring values, influencing factors and additional information within the corresponding time period of the vehicle detector corresponding to the single node, the upstream and downstream vehicle detectors of the vehicle detector corresponding to the single node and the vehicle detector associated with the start and end of the traffic demand are selected as relevant data;
[0021] If the prediction requirement is to predict the vehicle traffic conditions on the road section, the monitoring values, influencing factors and additional information of all vehicle detectors are selected as relevant data.
[0022] Optionally, performing data filling to obtain a complete relevant data set includes:
[0023] Relevant data in the directed graph of the traffic flow network is received, and data integrity analysis is performed on the data to obtain data with partially undefined and unrepresentable values, missing data within a certain period of time, and data with obvious abnormal values; resampling, 0 filling, mode filling, and no event filling are adopted to fill the missing data to obtain a complete relevant data set.
[0024] Optionally, determining the traffic flow time series data period includes:
[0025] Determine the operating time of the expressway. If the operating time of the expressway is less than 30 days, then based on prior knowledge, determine that the traffic flow time series data period is 12t, where t is the sampling period of the vehicle detector; if the operating time of the expressway is greater than or equal to 30 days, use the Fourier transform method combined with the autocorrelation coefficient method of the prior knowledge to calculate and confirm the traffic flow time series data period.
[0026] Optionally, the step of setting a moving window function based on the traffic flow time series data period, and processing the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a validation set with spatiotemporal characteristics comprises:
[0027] The moving window function is set as a one-dimensional or multi-dimensional input sequence with a period equal to the period of the traffic flow time series data, and the one-dimensional or multi-dimensional output of the target period is predicted. The complete relevant data set is processed by the moving window function to convert the complete relevant data set into supervised learning data to obtain a traffic flow data training set and a verification set with spatiotemporal characteristics.
[0028] Optionally, inputting the traffic flow data training set with spatiotemporal characteristics into a deep forest model for training to obtain a traffic flow prediction model includes:
[0029] The training set of traffic flow data with spatiotemporal characteristics is input into the deep forest model to be trained, and the verification set of traffic flow data with spatiotemporal characteristics is input into the trained deep forest model to obtain the detection results, which are confirmed by the absolute error value of the detection results.
[0030] The second aspect of the present invention provides a traffic flow prediction system based on deep forest, the traffic flow prediction system includes a traffic flow network construction module, a data acquisition module, a cycle determination module, a data processing module and a model training module, wherein:
[0031] The traffic flow network construction module is used to construct a traffic flow network directed graph, wherein the nodes in the traffic flow network directed graph are vehicle detectors and the edges are vehicle driving trajectories with directions;
[0032] The data acquisition module is used to acquire relevant data in the traffic flow network directed graph according to the forecast demand, and to fill the data to obtain a complete relevant data set;
[0033] The cycle determination module is used to determine the traffic flow time series data cycle;
[0034] The data processing module is used to set a moving window function based on the traffic flow time series data period, and process the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a verification set with spatiotemporal characteristics;
[0035] The model training module is used to input the traffic flow data training set with spatiotemporal characteristics into the deep forest model for training to obtain a traffic flow prediction model.
[0036] The third aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided in the first aspect of the present invention when executing the program.
[0037] A fourth aspect of the present invention provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided by the first aspect of the present invention.
[0038] The beneficial effects of the present invention are as follows:
[0039] The traffic flow prediction method based on deep forest provided by the present invention constructs a directed graph of traffic flow network, obtains relevant data in the directed graph of traffic flow network according to needs and fills the data to obtain a complete relevant data set, thereby ensuring the integrity of the data, and adopts a window function to obtain a training set and a verification set of traffic flow data with spatiotemporal characteristics based on the complete relevant data set and the traffic flow time series data period, and performs secondary extraction on the data through the window function to segment the complete relevant data set; the deep forest model is trained to obtain a traffic flow prediction model, thereby solving the problem of poor prediction effect of deep neural network caused by insufficient data in the early stage of highway operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0041] Figure 1 A flow chart of a traffic flow prediction method based on deep forest proposed by an embodiment of the present invention is shown.
[0042] Figure 2 A schematic diagram showing traffic flow data proposed by one embodiment of the present invention;
[0043] Figure 3 A schematic diagram of a traffic flow network directed graph proposed by an embodiment of the present invention is shown.
[0044] Figure 4 A schematic diagram showing a correlation empirical value proposed by an embodiment of the present invention;
[0045] Figure 5 A schematic diagram showing the correlation coefficient among the traffic volume, average speed and occupancy rate of a vehicle detector according to an embodiment of the present invention.
[0046] Figure 6 A schematic diagram showing the correlation coefficient between upstream and downstream vehicle detectors proposed in one embodiment of the present invention.
[0047] Figure 7 A schematic diagram of a deep forest-based traffic flow prediction system proposed in one embodiment of the present invention is shown.
[0048] Figure 8 A schematic diagram showing a traffic volume prediction value and an actual value of a certain highway output by a traffic flow prediction system proposed in one embodiment of the present application;
[0049] Fig. 9 A schematic diagram showing the predicted value and actual value of the average speed of a highway output by a traffic flow prediction system proposed in an embodiment of the present application.
[0050] Fig.10A schematic diagram showing the structure of a computer device proposed in one embodiment of the present application is shown. DETAILED DESCRIPTION
[0051] In order to explain the present invention more clearly, the present invention is further described below in conjunction with embodiments and drawings. Similar components in the drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and the protection scope of the present invention should not be limited thereto.
[0052] To solve at least one of the above problems, the present invention proposes a traffic flow prediction method and system, device and medium based on deep forest. The traffic flow prediction method and system, device and medium based on deep forest are described below through several specific embodiments.
[0053] The inventors found that by establishing a traffic flow training data set with spatiotemporal characteristics for traffic flow prediction in the early stage of highway operation and utilizing the obvious advantages of the deep forest algorithm in predicting small sample time series data, it is possible to achieve engineering traffic flow prediction for highways in the short term (5-30 minutes) / medium to long term (30 minutes to several hours).
[0054] Deep forest is a decision tree ensemble method based on deep models. It is implemented through cascaded random forests and has fewer adjustment parameters. It allows users to determine the cost of training based on the resources of the device and can adaptively adjust the number of training model layers. At the structural level, deep forest consists of two parts: multi-granular scanning and cascade forest. Among them, multi-granular scanning obtains multiple feature subsets through sliding window technology to enhance the difference of cascade forests. Cascade forests achieve representation learning by cascading a forest composed of decision trees. Deep forest follows the layer-by-layer processing mechanism of deep neural networks for sample feature attributes and uses a multi-level structure to achieve representation learning.
[0055] An embodiment of the present invention provides a traffic flow prediction method based on deep forest, such as Figure 1 As shown, including
[0056] Constructing a traffic flow network directed graph, wherein the nodes in the traffic flow network directed graph are vehicle detectors, and the edges are vehicle driving trajectories with directions;
[0057] Obtain relevant data in the traffic flow network directed graph according to the forecast demand, and fill in the data to obtain a complete relevant data set;
[0058] Determine the traffic flow time series data cycle;
[0059] Setting a moving window function based on the traffic flow time series data period, and processing the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a validation set with spatiotemporal characteristics;
[0060] The traffic flow data training set with spatiotemporal characteristics is input into the deep forest model for training to obtain a traffic flow prediction model.
[0061] This embodiment obtains relevant data in the directed graph of the traffic flow network according to needs and fills the data to obtain a complete relevant data set, thereby ensuring the integrity of the data. A window function is used to obtain a traffic flow data training set and a verification set with spatiotemporal characteristics based on the complete relevant data set and the traffic flow time series data period. The data is secondary extracted through the window function to segment the complete relevant data set. The deep forest model is trained to obtain a traffic flow prediction model, thereby solving the problem of poor prediction effect of the deep neural network caused by insufficient data in the early stage of highway operation.
[0062] In one possible implementation, Figure 2 As shown, the traffic flow data in the traffic flow network directed graph includes monitoring values, influencing factors and additional factors;
[0063] The monitoring values include the traffic volume, average speed and occupancy rate monitored by each vehicle detector;
[0064] The influencing factors include meteorological information and traffic events;
[0065] The additional information includes the association information of the upstream and downstream vehicle detectors, the vehicle detectors associated with the start and end of the traffic demand, the number of lanes and the designed speed.
[0066] It should be noted that if there is no corresponding sensing device for the influencing factor, it will be eliminated.
[0067] like Figure 3 As shown in FIG. 1 , it is a directed graph of a traffic flow network corresponding to a certain highway; this embodiment obtains the traffic volume of each vehicle detector, the correlation between the average speed and the occupancy rate, the correlation between the traffic volume of the upstream and downstream detectors, and the correlation between the start and end points of the traffic demand trip through correlation experience, such as Figure 4 As shown, this is a schematic diagram of empirical correlation values, with a correlation coefficient of 0.8-1.0 indicating a very strong correlation; a correlation coefficient of 0.6-0.8 indicating a strong correlation; a correlation coefficient of 0.4-0.6 indicating a moderate correlation; a correlation coefficient of 0.2-0.4 indicating a weak correlation; and a correlation coefficient of 0-0.2 indicating an extremely weak correlation or no correlation.
[0068] In a possible implementation, the correlation coefficient between the traffic volume (Traffic), average speed (Speed) and occupancy (Occupy) of the vehicle detector is calculated as follows: Figure 5 As shown in the figure, it can be seen that there is a moderate correlation between traffic volume and average speed and occupancy rate, and there is a weak correlation or no correlation between average speed and occupancy rate, which is consistent with professional prior experience.
[0069] In a possible implementation, the calculated correlation coefficient of the traffic volume of the upstream and downstream detectors is as follows: Figure 6 As shown, T1 is the detector, T0 is the upstream detector, and T2 is the downstream detector; Figure 6 It can be seen that the traffic volumes of upstream and downstream detectors are strongly correlated.
[0070] In one possible implementation, there is an implicit spatial association between non-adjacent nodes on the highway in the traffic flow pattern based on the OD (traffic travel volume) of the travel start and end points, namely the travel start and end points of the traffic demand. The OD traffic survey conducted in the highway design phase is used as the basis for calculating the association parameters of a single detector, and the correlation analysis is performed using time series data to determine the correlation.
[0071] In a specific embodiment, the prediction demand includes predicting the vehicle traffic conditions of a single node and predicting the vehicle traffic conditions of a road section;
[0072] If the prediction demand is to predict the vehicle traffic conditions of a single node, the monitoring values, influencing factors and additional information within the corresponding time period of the vehicle detector corresponding to the single node, the upstream and downstream vehicle detectors of the vehicle detector corresponding to the single node and the vehicle detector associated with the start and end of the traffic demand are selected as relevant data, wherein the corresponding time period is, for example, 5 minutes;
[0073] If the prediction requirement is to predict the vehicle traffic conditions on the road section, the monitoring values, influencing factors and additional information of all vehicle detectors are selected as relevant data.
[0074] In the early stage of highway operation, due to equipment debugging, failure or network reasons, data collection is often unstable, such as abnormal or missing. Although the collection software can eliminate most of the abnormal values according to the data processing rules, it is still incomplete time series data, especially some detectors are missing data within a certain period of time. Therefore, it is necessary to fill in the missing data according to certain rules.
[0075] To solve the above problem, this embodiment performs data filling on the relevant data in the traffic flow network directed graph to obtain a complete relevant data set, specifically including:
[0076] Relevant data in the directed graph of the traffic flow network is received, and data integrity analysis is performed on the data to obtain data with partially undefined and unrepresentable (NaN) values, missing data within a certain period of time, and data with obvious outliers; resampling, 0 filling, mode filling, and no event filling are adopted to fill the missing data to obtain a complete relevant data set.
[0077] It should be noted that the data filling rule is to use resampling to fill in the missing time series data, to use 0 to fill in the missing traffic volume and average speed monitored by the vehicle detector, to use the majority to fill in the missing weather information, and to use no event to fill in the missing event information.
[0078] This embodiment adopts different rules to fill in different types of missing data, and adopts different solutions for different situations, thereby ensuring the integrity of the data.
[0079] In a specific embodiment, the traffic flow time series data cycle is determined based on prior knowledge and the operation time of the expressway. Specifically, the steps of determining the traffic flow time series data cycle include:
[0080] Determine the operating time of the expressway. If the operating time of the expressway is less than 30 days, the traffic flow time series data period is determined to be 12t based on prior knowledge; if the operating time of the expressway is greater than or equal to 30 days, the Fourier transform method combined with the autocorrelation coefficient method of the prior knowledge is used to calculate and confirm the traffic flow time series data period, where t is the sampling period of the vehicle detector.
[0081] It should be noted that this embodiment is mainly aimed at traffic flow prediction in the initial stage of operation of a highway company, that is, the first 6 months of highway operation.
[0082] In a possible implementation, the code for determining the traffic flow time series data period is as follows:
[0083] from datetime import timedelta import nunmpy as np
[0084] from scipy.fftpack import fft,fftfreq
[0085] from statsmodels.tsa.stattools import acf
[0086] #Use Fourier transform to estimate the period
[0087] def getPeriod(data):#data:array
[0088] fft_series = fft(data)
[0089] power = np.abs(fft_series)
[0090] sample_freq = fftfreq(fft_series.size)
[0091] pos_mask = np.where(sample_freq > 0)
[0092] freqs = sample_freq[pos_mask]
[0093] powers = power[pos_mask]
[0094] #top K = 3 index
[0095] top_k_seasons = 3
[0096] top_k_idxs = np.argpartition(powers, -top_k_seasons)[-top_k_seasons:]
[0097] top_k_power = powers[top_k_idxs]
[0098] fft_periods = (1 / freqs[top_k_idxs]).astype(int)
[0099] print(f"top_k_power:{top_k_power}")
[0100] print(f"fft_periods:{fft_periods}")
[0101] # Estimate the period based on the autocorrelation coefficient
[0102] for lag in fft_periods:
[0103] acf_score = acf(data, nlags = lag)[-1]
[0104] print(f"lag:{lag} fft acf:{acf_score}")
[0105] # Prior knowledge presets the periods: 12 144 288 2016
[0106] expected_lags=np.array([timedelta(hours=1) / timedelta(minutes=5), timedelta(hours=12) / timedelta(minutes=5), timedelta(days=1) / timedelta(minutes=5), timedelta(days=7) / timedelta(minutes=5)]).astype(int)
[0107] for lag in expected_lags:
[0108] acf_score=acf(data,nlags=lag,fft=False)[-1]
[0109] print(f"lag:{lag}expected acf:{acf_score}")
[0110] As shown in the following table, the Fourier analysis of a high-speed sample combines the autocorrelation coefficient and the value of the preset period with prior knowledge:
[0111] Table 1
[0112]
[0113] In a specific embodiment, the step of setting a moving window function based on the traffic flow time series data period, and processing the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a validation set with spatiotemporal characteristics includes:
[0114] The moving window function is set as a one-dimensional or multi-dimensional input sequence with a period equal to the period of the traffic flow time series data, and the one-dimensional or multi-dimensional output of the target period is predicted. The complete relevant data set is processed by the moving window function to convert the complete relevant data set into supervised learning data to obtain a traffic flow data training set and a verification set with spatiotemporal characteristics.
[0115] In a specific embodiment, if the data interval is 5 minutes, according to the determined traffic flow time series data period T, a one-dimensional or multi-dimensional input sequence xTS with a moving window of period Tx is designed, wherein the period Tx=T, and its initial value is 12, and a one-dimensional or multi-dimensional output label yTS with a moving window of the predicted target period Ty is designed, wherein Ty=1 / 3 / 6 / 12, that is, the prediction period is 5 minutes, 15 minutes, 30 minutes or one hour; Tx and Ty are both subjected to standard normalization processing, the time series data set is converted into supervised learning data, and training samples are generated, and the same time parameters are used to generate verification samples;
[0116] The moving window function can be directly imported through a mature module, and its code is "fromtsmoothie.utils_func import create_windows".
[0117] In a specific embodiment, inputting the traffic flow data training set with spatiotemporal characteristics into a deep forest model for training to obtain a traffic flow prediction model includes:
[0118] The training set of traffic flow data with spatiotemporal characteristics is input into the deep forest model to be trained, and the verification set of traffic flow data with spatiotemporal characteristics is input into the trained deep forest model to obtain the detection results, which are confirmed by the absolute error value of the detection results.
[0119] An embodiment of the present invention provides a traffic flow prediction system based on deep forest, such as Figure 7 As shown, the traffic flow prediction system includes a traffic flow network construction module 201, a data acquisition module 202, a cycle determination module 203, a data processing module 204 and a model training module 205, wherein:
[0120] The traffic flow network construction module 201 is used to construct a traffic flow network directed graph, wherein the nodes in the traffic flow network directed graph are vehicle detectors and the edges are vehicle driving trajectories with directions;
[0121] The data acquisition module 202 is used to acquire relevant data in the traffic flow network directed graph according to the forecast demand, and perform data filling to obtain a complete relevant data set;
[0122] The cycle determination module 203 is used to determine the traffic flow time series data cycle;
[0123] The data processing module 204 is used to set a moving window function based on the traffic flow time series data period, and process the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a verification set with spatiotemporal characteristics;
[0124] The model training module 205 is used to input the traffic flow data training set with spatiotemporal characteristics into the deep forest model for training to obtain a traffic flow prediction model.
[0125] like Figure 8 As shown in FIG. 1 , it is a schematic diagram of the predicted value and actual value of a certain highway traffic volume obtained based on the traffic flow prediction model, wherein the horizontal axis is the sampling number, and the vertical axis is the traffic volume / 5 minutes, that is, the traffic volume within the sampling period; Fig. 9As shown, it is a schematic diagram of the predicted value and actual value of a highway average speed obtained based on the traffic flow prediction model. As can be seen from the figure, the accuracy of the traffic flow prediction model is high, which solves the problem of poor prediction effect of deep neural network caused by insufficient data in the early stage of road operation.
[0126] It should be noted that the principles and workflow of the deep forest-based traffic flow prediction system provided in this embodiment are similar to the principles and workflow of the above-mentioned deep forest-based traffic flow prediction method. The relevant parts can be referred to the above description and will not be repeated here.
[0127] like Fig.10 As shown, a schematic diagram of the structure of a computer device provided by the third embodiment of the present invention. Suitable for implementing the deep forest-based traffic flow prediction method provided in the above embodiment, including a central processing module (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage part to the random access memory (RAM). In the RAM, various programs and data required for the operation of the computer device are also stored. The CPU, ROM and RAM are connected to each other through a bus. The input / output (I / O) interface is also connected to the bus.
[0128] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.
[0129] In particular, according to this embodiment, the process described in the flowchart above can be implemented as a computer software program. For example, this embodiment includes a computer program product, which includes a computer program tangibly contained on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium.
[0130] A fourth embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements:
[0131] Constructing a traffic flow network directed graph, wherein the nodes in the traffic flow network directed graph are vehicle detectors, and the edges are vehicle driving trajectories with directions;
[0132] Obtain relevant data in the traffic flow network directed graph according to the forecast demand, and fill in the data to obtain a complete relevant data set;
[0133] Determine the traffic flow time series data cycle;
[0134] Setting a moving window function based on the traffic flow time series data period, and processing the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a validation set with spatiotemporal characteristics;
[0135] The traffic flow data training set with spatiotemporal characteristics is input into the deep forest model for training to obtain a traffic flow prediction model.
[0136] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0137] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0138] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0139] It should be noted that the flowcharts and schematic diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product of the present embodiment. In this regard, each box in the flowchart or schematic diagram can represent a module, a program segment or a part of a code, and a part of the above-mentioned module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the schematic diagram and / or flowchart, and the combination of the boxes in the schematic diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0140] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the implementation methods of the present invention. For ordinary technicians in this field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.
Claims
1. A traffic flow prediction method based on deep forest, characterized in that: include Constructing a traffic flow network directed graph, wherein the nodes in the traffic flow network directed graph are vehicle detectors, and the edges are vehicle driving trajectories with directions; Obtain relevant data in the traffic flow network directed graph according to the forecast demand, and fill in the data to obtain a complete relevant data set; Determine the traffic flow time series data cycle; Setting a moving window function based on the traffic flow time series data period, and processing the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a validation set with spatiotemporal characteristics; Inputting the traffic flow data training set with spatiotemporal characteristics into the deep forest model for training to obtain a traffic flow prediction model; Performing traffic flow prediction according to the traffic flow prediction model; The traffic flow data in the traffic flow network directed graph includes: monitoring values, influencing factors and additional factors; The monitoring values include traffic volume, average speed and occupancy rate; The influencing factors include meteorological information and traffic events; The additional factors include the association information of upstream and downstream vehicle detectors, the vehicle detectors associated with the start and end of the traffic demand, the number of lanes and the design speed; The prediction requirements include predicting the vehicle traffic conditions of a single node and predicting the vehicle traffic conditions of a road section; If the prediction demand is to predict the vehicle traffic conditions of a single node, the monitoring values, influencing factors and additional information within the corresponding time period of the vehicle detector corresponding to the single node, the upstream and downstream vehicle detectors of the vehicle detector corresponding to the single node and the vehicle detector associated with the start and end of the traffic demand are selected as relevant data; If the prediction requirement is to predict the vehicle traffic conditions on the road section, the monitoring values, influencing factors and additional information of all vehicle detectors are selected as relevant data; Determining the traffic flow time series data cycle includes: Determine the operation time of the expressway. If the operation time of the expressway is less than 30 days, determine the traffic flow time series data period as 12t based on prior knowledge, where t is the sampling period of the vehicle detector; if the operation time of the expressway is greater than or equal to 30 days, use the Fourier transform method combined with the autocorrelation coefficient method of the prior knowledge to calculate and confirm the traffic flow time series data period; The data filling to obtain a complete relevant data set includes: Relevant data in the directed graph of the traffic flow network is received, and data integrity analysis is performed on the data to obtain data with partially undefined and unrepresentable values, missing data within a certain period of time, and data with obvious abnormal values; resampling, 0 filling, mode filling, and no event filling are adopted to fill the missing data to obtain a complete relevant data set.
2. The traffic flow prediction method according to claim 1, characterized in that: The step of setting a moving window function based on the traffic flow time series data period, and processing the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a validation set with spatiotemporal characteristics comprises: The moving window function is set as a one-dimensional or multi-dimensional input sequence with a period equal to the period of the traffic flow time series data, and the one-dimensional or multi-dimensional output of the target period is predicted. The complete relevant data set is processed by the moving window function to convert the complete relevant data set into supervised learning data to obtain a traffic flow data training set and a verification set with spatiotemporal characteristics.
3. The traffic flow prediction method according to claim 1, characterized in that: The step of inputting the traffic flow data training set with spatiotemporal characteristics into the deep forest model for training to obtain a traffic flow prediction model includes: The training set of traffic flow data with spatiotemporal characteristics is input into the deep forest model to be trained, and the verification set of traffic flow data with spatiotemporal characteristics is input into the trained deep forest model to obtain the detection results, which are confirmed by the absolute error value of the detection results.
4. A traffic flow prediction system based on deep forest, characterized in that: The traffic flow prediction system includes a traffic flow network construction module, a data acquisition module, a cycle determination module, a data processing module and a model training module, wherein: The traffic flow network construction module is used to construct a traffic flow network directed graph, wherein the nodes in the traffic flow network directed graph are vehicle detectors and the edges are vehicle driving trajectories with directions; The data acquisition module is used to acquire relevant data in the traffic flow network directed graph according to the forecast demand, and to fill the data to obtain a complete relevant data set; The cycle determination module is used to determine the traffic flow time series data cycle; The data processing module is used to set a moving window function based on the traffic flow time series data period, and process the complete relevant data set based on the moving window function to obtain a traffic flow data training set and a verification set with spatiotemporal characteristics; The model training module is used to input the traffic flow data training set with spatiotemporal characteristics into the deep forest model for training to obtain a traffic flow prediction model. The traffic flow data in the traffic flow network directed graph includes: monitoring values, influencing factors and additional factors; The monitoring values include traffic volume, average speed and occupancy rate; The influencing factors include meteorological information and traffic events; The additional factors include the association information of upstream and downstream vehicle detectors, the vehicle detectors associated with the start and end of the traffic demand, the number of lanes and the design speed; The prediction requirements include predicting the vehicle traffic conditions of a single node and predicting the vehicle traffic conditions of a road section; If the prediction demand is to predict the vehicle traffic conditions of a single node, the monitoring values, influencing factors and additional information within the corresponding time period of the vehicle detector corresponding to the single node, the upstream and downstream vehicle detectors of the vehicle detector corresponding to the single node and the vehicle detector associated with the start and end of the traffic demand are selected as relevant data; If the prediction requirement is to predict the vehicle traffic conditions on the road section, the monitoring values, influencing factors and additional information of all vehicle detectors are selected as relevant data; Determining the traffic flow time series data cycle includes: Determine the operation time of the expressway. If the operation time of the expressway is less than 30 days, determine the traffic flow time series data period as 12t based on prior knowledge, where t is the sampling period of the vehicle detector; if the operation time of the expressway is greater than or equal to 30 days, use the Fourier transform method combined with the autocorrelation coefficient method of the prior knowledge to calculate and confirm the traffic flow time series data period; The data filling to obtain a complete relevant data set includes: Relevant data in the directed graph of the traffic flow network is received, and data integrity analysis is performed on the data to obtain data with partially undefined and unrepresentable values, missing data within a certain period of time, and data with obvious abnormal values; resampling, 0 filling, mode filling, and no event filling are adopted to fill the missing data to obtain a complete relevant data set.
5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 3 is implemented.
6. A computer storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
A distributed traffic flow prediction method and system
CN109685288A
Traffic network data prediction method based on graph space-time self-encoding network
CN114565187A
Low-complexity and high-precision time sequence multi-step prediction method and system
CN115310650A