A method, device, electronic device and storage medium for predicting traffic flow

By inputting the results of the long-term traffic flow prediction model into the medium-term traffic flow prediction model, and using time series recursive prediction strategies and neural networks, the problem of low long-term prediction accuracy is solved, the accuracy of medium-term prediction is improved, and the needs of highway management are met.

CN116311927BActive Publication Date: 2025-07-25LIAONING COMM TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310234749.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2025-07-25
Estimated Expiration
2043-03-13

AI Technical Summary

Technical Problem

In the prior art, the accuracy of long-term traffic flow prediction is low, and it cannot be effectively combined with the long-term development laws of traffic flow, resulting in insufficient accuracy of medium-term traffic flow prediction and cannot meet the needs of highway operation and management.

Method used

The prediction results of the long-term traffic flow prediction model are used as input data, combined with a time series-based recursive prediction strategy, and input them into the medium-time traffic flow prediction model. By constructing a lightGBM regression model and an LSTM neural network, the Laplace operator is fused to improve the time series length and accuracy of the prediction model.

Benefits of technology

It improves the accuracy of traffic flow forecast in China Times, can better consider the long-term development laws of traffic flow, and meet the needs of highway operation and management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116311927B_ABST
    Figure CN116311927B_ABST
Patent Text Reader

Abstract

The present application provides a method, apparatus, electronic device and storage medium for predicting traffic flow. The method includes: for each monitoring point on the highway within the target range, obtaining the characteristic data of the monitoring point within at least one time period to be predicted; for each time period to be predicted, performing data processing on the characteristic data of the monitoring point within the time period to be predicted, and inputting the processed characteristic data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the initial traffic flow prediction result of the monitoring point within the time period to be predicted; inputting the initial traffic flow prediction result of the monitoring point within each time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range, and using a recursive prediction strategy based on time series to determine the target traffic flow prediction result of the monitoring point within each time period to be predicted. According to the method and apparatus, the prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of traffic flow prediction. Specifically, it relates to a traffic flow prediction method, device, electronic device, and storage medium. Background Art

[0002] There are many reasons for road congestion. Whether it is the sudden increase in traffic flow or the reduction in road capacity caused by traffic accidents and construction, the root cause is that the road capacity cannot meet the current traffic flow demand. Therefore, traffic flow prediction is of great significance for preventing traffic congestion and traffic control after congestion occurs, and it is the core of intelligent traffic management.

[0003] Generally, traffic flow prediction is divided into short-term prediction (5 minutes to 30 minutes), medium-term prediction (30 minutes to several hours), and long-term prediction (more than one day) according to the prediction time span. Long-term prediction analyzes the long-term development law of road traffic flow and can be used for the arrangement of construction plans, such as avoiding arranging construction plans at locations and times prone to large traffic flows; however, due to the randomness and uncertainty of traffic data, the accuracy of long-term traffic flow prediction is relatively low, and more research is based on short-term traffic flow research of recent data; but in the actual operation and management of highways, it usually takes several hours from the occurrence of an emergency to the end of disposal and control. Medium-term traffic flow prediction usually only considers the traffic flow conditions in the previous few time intervals before the prediction time point and ignores the long-term development law of traffic flow. Generally, long-term traffic flow prediction analyzes the daily flow on a daily basis, and the predicted daily flow cannot be used in medium-term traffic flow prediction either. Summary of the Invention

[0004] In view of this, the purpose of the present application is to provide a traffic flow prediction method, device, electronic device, and storage medium, which not only considers the changes in short-term traffic flow but also combines the long-term development law of traffic flow. The prediction result of the long-term traffic flow prediction model is used as input data and input into the medium-term traffic flow prediction model, which is equivalent to increasing the length of the time series input into the medium-term traffic flow prediction model and improving the prediction accuracy.

[0005] In a first aspect, an embodiment of the present application provides a traffic flow prediction method, and the prediction method includes:

[0006] For each monitoring point on the highway within the target range, obtain the characteristic data of the monitoring point within at least one time period to be predicted;

[0007] For each time period to be predicted, the characteristic data of the monitoring point within the time period to be predicted is processed, and the processed characteristic data is input into the long-term traffic flow prediction model corresponding to the monitoring point to determine the initial traffic flow prediction result of the monitoring point within the time period to be predicted;

[0008] The initial traffic flow prediction results of the monitoring point within each time period to be predicted are input into the medium-term traffic flow prediction model corresponding to the target range, and using a recursive prediction strategy based on time series, the target traffic flow prediction results of the monitoring point within each time period to be predicted are determined.

[0009] Furthermore, the long-term traffic flow prediction model corresponding to the monitoring point is trained through the following steps:

[0010] Obtain multiple groups of historical monitoring data of the monitoring point within the historical monitoring time period; among them, the historical monitoring data includes historical characteristic data and historical traffic flow data;

[0011] For each group of historical monitoring data, the data processing is performed on the group of historical monitoring data to obtain the first sample data;

[0012] Determine the first training sample set, the first validation sample set, and the first test sample set according to multiple groups of the first sample data;

[0013] Construct a lightGBM regression model based on the first training sample set, and use the first validation sample set and the first test sample set to adjust and verify the parameters of the lightGBM regression model to obtain the long-term traffic flow prediction model corresponding to the monitoring point.

[0014] Furthermore, the medium-term traffic flow prediction model corresponding to the target range is trained through the following steps:

[0015] Obtain the schematic diagram of the monitoring point positions corresponding to the target range, and based on the positions of each monitoring point in the schematic diagram of the monitoring point positions and the flow direction of the highway where each monitoring point is located, determine the flow direction schematic diagram;

[0016] Based on the flow direction relationship between each monitoring point in the flow direction schematic diagram, draw the traffic flow directed graph corresponding to the target range, and calculate the Laplacian operator based on the traffic flow directed graph;

[0017] Fuse the Laplacian operator with the LSTM neural network to obtain the initial medium-term traffic flow prediction model;

[0018] Obtain multiple historical traffic flow data of each monitoring point within the historical monitoring time period, and use the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0019] Further, the step of using the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range includes:

[0020] For each monitoring point, with the preset time series length as the sliding window length, determine multiple groups of target historical traffic flow data within the sliding window in the multiple historical traffic flow data of this monitoring point in a sliding window manner; where each group of target historical traffic flow data includes multiple sample flow input data and the sample flow output data corresponding to the multiple sample flow input data.

[0021] For each group of target historical traffic flow data, determine the target historical monitoring time period corresponding to the sample flow output data in this group of target historical traffic flow data, obtain the target historical feature data of this monitoring point within the target historical monitoring time period, perform data processing on the target historical feature data, and input the processed target historical feature data into the long-term traffic flow prediction model corresponding to this monitoring point to determine the sample flow prediction result of this monitoring point within the target historical monitoring time period.

[0022] Determine this group of target historical traffic flow data and the sample flow prediction result corresponding to this group of target historical traffic flow data as the second sample data of this monitoring point.

[0023] Determine the second training sample set, the second validation sample set, and the second test sample set according to the multiple groups of second sample data of each monitoring point.

[0024] Train the initial medium-term traffic flow prediction model based on the second training sample set, and use the second validation sample set and the second test sample set to adjust and verify the parameters of the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0025] Further, when there are multiple time periods to be predicted, the step of inputting the initial flow prediction result of this monitoring point within each time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range and using the recursive prediction strategy based on time series to determine the target flow prediction result of this monitoring point within each time period to be predicted includes:

[0026] Generate a sorting for characterizing the time sequence of all the to-be-predicted time periods, and determine the target to-be-predicted time period with the earliest time from the sorting;

[0027] Determine a plurality of historical time periods before the target to-be-predicted time period based on the preset time series length of the medium-term traffic flow prediction model, and determine the true historical flow data of each monitoring point in each of the plurality of historical time periods;

[0028] Input the initial flow prediction result of each monitoring point within the target to-be-predicted time period and the true historical flow data of each monitoring point into the medium-term traffic flow prediction model, and determine the target flow prediction result of the monitoring point within the target to-be-predicted time period;

[0029] Combine the target flow prediction result of the monitoring point within the target to-be-predicted time period with the true historical flow data of the monitoring point to obtain a first prediction data group, and determine the target prediction data group of the monitoring point within the target to-be-predicted time period from the first prediction data group based on the preset time series length;

[0030] Determine the next to-be-predicted time period adjacent to the target to-be-predicted time period from the sorting, and input the initial flow prediction result of each monitoring point within the next to-be-predicted time period and the target prediction data group of the monitoring point within the target to-be-predicted time period into the medium-term traffic flow prediction model at the same time, and determine the target flow prediction result of the monitoring point within the next to-be-predicted time period;

[0031] Combine the target prediction data group of the monitoring point within the target to-be-predicted time period with the target flow prediction result of the monitoring point within the next to-be-predicted time period to obtain a second prediction data group, and determine the target prediction data group of the monitoring point within the next to-be-predicted time period from the second prediction data group based on the preset time series length;

[0032] Determine the next to-be-predicted time period as the target to-be-predicted time period, and return to execute the step of determining the next to-be-predicted time period adjacent to the target to-be-predicted time period from the sorting until there is no next to-be-predicted time period adjacent to the target to-be-predicted time period in the sorting.

[0033] In a second aspect, an embodiment of the present application further provides a traffic flow prediction device, and the prediction device includes:

[0034] A data acquisition module, configured to acquire the feature data of each monitoring point on the highway within the target range within at least one to-be-predicted time period;

[0035] The first prediction module is used to process the feature data of the monitoring point within each prediction time period to be predicted, and input the processed feature data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the initial flow prediction result of the monitoring point within the prediction time period to be predicted;

[0036] The second prediction module is used to input the initial flow prediction result of the monitoring point within each prediction time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range, and use a recursive prediction strategy based on time series to determine the target flow prediction result of the monitoring point within each prediction time period to be predicted.

[0037] Further, the prediction device further includes a first model training module, and the first model training module is used to train the long-term traffic flow prediction model corresponding to the monitoring point through the following steps:

[0038] Obtain multiple groups of historical monitoring data of the monitoring point within the historical monitoring time period; wherein, the historical monitoring data includes historical feature data and historical traffic flow data;

[0039] For each group of historical monitoring data, perform the data processing on the group of historical monitoring data to obtain first sample data;

[0040] Determine a first training sample set, a first validation sample set, and a first test sample set according to multiple groups of first sample data;

[0041] Construct a lightGBM regression model based on the first training sample set, and use the first validation sample set and the first test sample set to adjust and verify the parameters of the lightGBM regression model to obtain the long-term traffic flow prediction model corresponding to the monitoring point.

[0042] Further, the prediction device further includes a second model training module, and the second model training module is used to train the medium-term traffic flow prediction model corresponding to the target range through the following steps:

[0043] Obtain a schematic diagram of the monitoring point positions corresponding to the target range, and determine a flow direction schematic diagram based on the positions of each monitoring point in the monitoring point position schematic diagram and the flow direction of the highway where each monitoring point is located;

[0044] Draw a traffic flow directed graph corresponding to the target range based on the flow direction relationship between each monitoring point in the flow direction schematic diagram, and calculate the Laplacian operator based on the traffic flow directed graph;

[0045] Fuse the Laplacian operator with an LSTM neural network to obtain an initial medium-term traffic flow prediction model;

[0046] Obtain multiple historical traffic flow data of each monitoring point within a historical monitoring time period, and use the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model, so as to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0047] In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the traffic flow prediction method as described above are executed.

[0048] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of the traffic flow prediction method as described above are executed.

[0049] A traffic flow prediction method, device, electronic device, and storage medium provided by an embodiment of the present application. First, for each monitoring point on the highway within the target range, obtain the feature data of the monitoring point within at least one prediction time period; then, for each prediction time period, perform data processing on the feature data of the monitoring point within the prediction time period, and input the processed feature data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the initial traffic flow prediction result of the monitoring point within the prediction time period; finally, input the initial traffic flow prediction result of the monitoring point within each prediction time period into the medium-term traffic flow prediction model corresponding to the target range, and use a recursive prediction strategy based on time series to determine the target traffic flow prediction result of the monitoring point within each prediction time period.

[0050] The traffic flow prediction method provided by the embodiment of the present application not only considers the changes in short-term traffic flow, but also combines the long-term development law of traffic flow. Taking the prediction result of the long-term traffic flow prediction model as input data and inputting it into the medium-term traffic flow prediction model is equivalent to increasing the length of the time series input into the medium-term traffic flow prediction model, thereby improving the prediction accuracy.

[0051] To make the above objects, features, and advantages of the present application more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes a detailed description as follows. Description of the Drawings

[0052] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0053] Figure 1 Flowchart of a traffic flow prediction method provided by an embodiment of the present application;

[0054] Figure 2(a) is a schematic diagram of the position of a monitoring point provided by an embodiment of the present application;

[0055] Figure 2(b) is a schematic diagram of a flow direction provided by an embodiment of the present application;

[0056] Figure 2(c) is a schematic diagram of a directed graph of flow direction provided by an embodiment of the present application;

[0057] Figure 3 Schematic diagram of a traffic flow prediction process based on a recursive strategy provided by an embodiment of the present application;

[0058] Figure 4 Schematic diagram of the structure of a traffic flow prediction device provided by an embodiment of the present application;

[0059] Figure 5 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some, rather than all, of the embodiments of the present application. Usually, the components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application claimed, but only represents the selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by those of ordinary skill in the art without creative efforts belongs to the scope of protection of the present application.

[0061] First, the applicable application scenarios of the present application will be introduced. The present application can be applied to the technical field of traffic flow prediction.

[0062] There are many reasons for road congestion. Whether it is the sudden increase in traffic flow or the reduction in road capacity caused by traffic accidents and construction, the fundamental reason is that the road capacity cannot meet the current traffic flow demand. Therefore, traffic flow prediction is of great significance for preventing traffic congestion and traffic control after congestion occurs, and it is the core of intelligent traffic management.

[0063] It has been found through research that traffic flow prediction is generally divided into short-term prediction (5 minutes to 30 minutes), medium-term prediction (30 minutes to several hours), and long-term prediction (more than one day) according to the prediction time span. Long-term prediction analyzes the long-term development law of road traffic flow and can be used for the arrangement of construction plans, such as avoiding arranging construction plans at locations and times prone to large traffic flows; however, due to the randomness and uncertainty of traffic data, the accuracy of long-term traffic flow prediction is relatively low, and more research is based on short-term traffic flow research of recent data; but in the actual operation and management of highways, it usually takes several hours from the occurrence of an emergency to the end of disposal and control. Medium-term traffic flow prediction usually only considers the traffic flow conditions in the previous few time intervals before the prediction time point and ignores the long-term development law of traffic flow, while general long-term traffic flow prediction analyzes and predicts the daily traffic flow in units of days, and the predicted daily traffic flow cannot be used in medium-term traffic flow prediction either.

[0064] Based on this, the embodiments of the present application provide a traffic flow prediction method, device, electronic device, and storage medium. The prediction result of the long-term traffic flow prediction model is used as input data and input into the medium-term traffic flow prediction model, which is equivalent to increasing the length of the time series input into the medium-term traffic flow prediction model and improving the prediction accuracy.

[0065] Please refer to Figure 1 , Figure 1 which is a flowchart of a traffic flow prediction method provided by the embodiments of the present application. As Figure 1 shown in, the prediction method provided by the embodiments of the present application includes:

[0066] S101, for each monitoring point on the highway within the target range, obtain the characteristic data of this monitoring point within at least one time period to be predicted.

[0067] It should be noted that the target range refers to the geographical range that is preset and for which traffic flow prediction is to be carried out. For example, the target range can be Liaoning Province, and the present application does not make specific limitations thereto. The monitoring point refers to each point on the highway that can measure traffic flow data. Specifically, the monitoring points can be each toll gate and each gantry on the highway. The period to be predicted refers to the future time period for which traffic flow prediction is desired. Here, the period to be predicted has an hourly time range. When performing traffic flow prediction, one period to be predicted can be selected. For example, the period to be predicted is "9:00 on January 11, 2023 - 10:00 on January 11, 2023", or multiple periods to be predicted can be selected. For example, multiple periods to be predicted include "9:00 on January 11, 2023 - 10:00 on January 11, 2023", "10:00 on January 11, 2023 - 11:00 on January 11, 2023", and "11:00 on January 11, 2023 - 12:00 on January 11, 2023", etc., and the present application does not make limitations thereto. According to the embodiments provided by the present application, the feature data can include hourly features, weekly features, holiday features, historical traffic flow features, and weather features. In specific implementation, for each period to be predicted, hourly features are extracted from the time information. For example, the time feature for the period to be predicted from 0 am to 1 am is 0, and the time feature for the period to be predicted from 7 pm to 8 pm is 19. The weekly features and holiday features are extracted from the period to be predicted in combination with calendar information. For example, if June 2, 2022 is Thursday and a working day, the weekly feature is 4 and the holiday feature is 0; if June 3, 2022 is Friday and the Dragon Boat Festival, its weekly feature is 5 and the holiday feature is 1. At the same time, considering that the traffic flow of the previous day will also affect the traffic flow of the current day, for example, if there are holidays or traffic control on the previous day, it will have a corresponding impact on the traffic flow of the next day. Therefore, it is also necessary to count the daily traffic flow of the previous day as the historical traffic flow feature. Finally, in combination with meteorological data, weather features are marked for each period to be predicted. For example, sunny, windy, rainy, snowy, and foggy are represented by 1, 2, 3, 4, and 5 respectively. Continuing the above embodiment, when the period to be predicted is "9:00 on January 11, 2023 - 10:00 on January 11, 2023", the feature data for this period to be predicted are: the hourly feature is 9, the weekly feature is 3, the holiday feature is 0, the historical traffic flow feature on January 10, 2023, and the weather feature is 1.

[0068] For the above-mentioned step S101, in specific implementation, for each monitoring point on the highway within the target range, the feature data of this monitoring point within at least one period to be predicted is obtained.

[0069] Traffic flow has a certain cycle and regularity. Long-term traffic flow prediction is to analyze the long-term development law of traffic flow. For example, the traffic flow on highways during holidays is higher than that on non-holiday days, the traffic flow during morning and evening rush hours is higher than that in the early morning, and the traffic flow is also lower than usual during bad weather, so as to predict the traffic flow at any future moment. The traffic flow conditions at different locations on the highway are different, and the locations where congestion often occurs are more likely to be congested during the peak congestion period. Therefore, it is necessary to build models and analyze each monitoring point separately.

[0070] S102. For each time period to be predicted, process the feature data of the monitoring point within the time period to be predicted, and input the processed feature data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the initial traffic flow prediction result of the monitoring point within the time period to be predicted.

[0071] It should be noted that data processing includes normalization processing and encoding processing. The long-term traffic flow prediction model is pre-trained and used to predict the traffic flow of the monitoring point within the time period to be predicted.

[0072] For the above step S102, in specific implementation, for each time period to be predicted, process the feature data of the monitoring point within the time period to be predicted. Specifically, data processing includes normalization processing and encoding processing. Perform maximum-minimum normalization processing on the hour feature, week feature, holiday feature, and historical traffic flow feature in the feature data respectively, and perform OneHot encoding on the weather feature to obtain the processed feature data. Then input the processed feature data into the long-term traffic flow prediction model corresponding to the monitoring point to obtain the prediction result, and then perform inverse normalization on the prediction result to obtain the initial traffic flow prediction result of the monitoring point within the time period to be predicted.

[0073] Specifically, according to the embodiments provided in the present application, the long-term traffic flow prediction model corresponding to the monitoring point is trained through the following steps:

[0074] A: Obtain multiple groups of historical monitoring data of the monitoring point within the historical monitoring time period.

[0075] It should be noted that the historical monitoring time period refers to the historical time period during which the traffic flow of the monitoring point is monitored. For example, the historical monitoring time period can be the past year, and the present application does not make specific limitations on this. The historical monitoring data includes historical feature data and historical traffic flow data. The historical feature data is the hour feature, week feature, holiday feature, historical traffic flow feature, and weather feature of each hour in the historical monitoring time period. The historical traffic flow data is the historical traffic flow data of the monitoring point for each hour in the historical monitoring time period.

[0076] For the above-mentioned step A, in specific implementation, multiple groups of historical monitoring data of the monitoring point within the historical monitoring time period are obtained. Here, when obtaining multiple historical traffic flow data of the monitoring point within the historical monitoring time period, the data also needs to be processed, and the processing process includes but is not limited to the following: 1. Data fusion. The historical flow data all comes from the flow detected by the radar or video monitoring equipment of the monitoring point. If the data comes from multiple source devices, data fusion is required. 2. Data validity check. Check whether the historical flow data meets the validity rules of data quality. For example, if the monitoring time does not conform to the facts, such as the monitoring time of a certain historical traffic flow data is 2025, it needs to be excluded. 3. Data deduplication. Identify and deduplicate duplicate data. In principle, the same gantry, the same moment, and the same vehicle will only be identified once. However, due to reasons such as antenna anomalies or one vehicle having multiple cards and multiple tags, the passing data may be repeatedly recorded, and deduplication processing is required. 4. Abnormal data processing. The vehicle trajectory should meet certain spatial logic. Restore the vehicle trajectory, and use the passing time, the passing gantry, and the entry and exit information of the toll station to restore the vehicle trajectory. Combine the road network structure to correct the unreasonable passing data.

[0077] B: For each group of historical monitoring data, perform the above-mentioned data processing on the group of historical monitoring data to obtain the first sample data.

[0078] For the above-mentioned step B, in specific implementation, after obtaining multiple groups of historical monitoring data, for each group of historical monitoring data, perform the above-mentioned data processing on the group of historical monitoring data to obtain the first sample data. Specifically, the method of processing the historical feature data is the same as the method of processing the feature data in the above-mentioned step S102 and can achieve the same technical effect, which will not be elaborated here. When processing the historical traffic flow data, normalization processing is also performed according to the maximum and minimum values.

[0079] C: Determine the first training sample set, the first verification sample set, and the first test sample set according to multiple groups of the first sample data.

[0080] It should be noted that the training sample set refers to the sample data used to construct the model. The verification sample set refers to the sample data used to tune and optimize the model. The test sample set refers to the sample data used to verify the accuracy of the model.

[0081] Regarding the above-mentioned step C, in specific implementation, after determining multiple groups of first sample data, a first training sample set, a first validation sample set, and a first test sample set are determined based on the multiple groups of first sample data. As an optional implementation manner, the multiple groups of first sample data can be divided proportionally. For example, a 6:3:1 proportion is used for division, that is, 60% of the first sample data is used as the first training sample set, 30% of the first sample data is used as the first validation sample set, and 10% of the first sample data is used as the first test sample set.

[0082] D: Construct a lightGBM regression model based on the first training sample set, and use the first validation sample set and the first test sample set to adjust and verify the parameters of the lightGBM regression model to obtain the long-term traffic flow prediction model corresponding to this monitoring point.

[0083] Regarding the above-mentioned step D, in specific implementation, after dividing the first training sample set, a lightGBM regression model is established with the historical feature data in the first training sample set as the input and the historical traffic flow data as the output. Then, the first validation sample set is used to tune and optimize the parameters of the lightGBM regression model, and the first test sample set is used to verify the accuracy of the trained model to obtain the long-term traffic flow prediction model corresponding to this monitoring point. Here, the methods of how to construct a lightGBM regression model using the training sample set, how to tune the model parameters using the validation sample set, and how to verify the model accuracy using the test sample set are described in detail in the prior art and will not be elaborated here.

[0084] S103: Input the initial traffic flow prediction results of this monitoring point in each time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range, and use a recursive prediction strategy based on time series to determine the target traffic flow prediction results of this monitoring point in each time period to be predicted.

[0085] Regarding the above-mentioned step S103, in specific implementation, the initial traffic flow prediction results of this monitoring point in each time period to be predicted are input into the medium-term traffic flow prediction model corresponding to the target range, and a recursive prediction strategy based on time series is used to determine the target traffic flow prediction results of this monitoring point in each time period to be predicted.

[0086] Specifically, according to the embodiments provided in this application, the medium-term traffic flow prediction model corresponding to the target range is trained through the following steps:

[0087] I: Obtain the schematic diagram of the monitoring point positions corresponding to the target range, and determine the flow direction schematic diagram based on the positions of each monitoring point in the schematic diagram of the monitoring point positions and the flow direction of the highway where each monitoring point is located.

[0088] For the above step I, in specific implementation, obtain the schematic diagram of the monitoring point positions corresponding to the target range. There are multiple monitoring points in the schematic diagram of the monitoring point positions, as well as the flow directions of the expressways where each monitoring point is located. Then, based on the positions of each monitoring point in the schematic diagram of the monitoring point positions and the flow directions of the expressways where each monitoring point is located, determine the schematic diagram of the flow direction reflecting the highway traffic flow. In practice, the expressway is closed, and the sources of vehicle flow are the upstream gantries, toll stations, and other intersecting expressways. The flow direction of the vehicle flow is the downstream gantries, toll stations, and other intersecting expressways. However, the flow direction of the traffic flow is not based on the distance but on the upstream and downstream relationship, that is, flowing out upstream and flowing in downstream. The upstream gantry of the toll station can only flow out to the toll station, and the flow of the toll station can only flow into the downstream gantry of the toll station. For the four pairs of gantries near the hub where two expressways intersect, the outflow of the traffic flow of one expressway only occurs upstream of the hub, and the outflowing traffic flow can only flow into the downstream gantry of the other expressway at the hub.

[0089] Please refer to FIG. 2(a) and FIG. 2(b). FIG. 2(a) is a schematic diagram of a schematic diagram of the monitoring point positions provided by an embodiment of the present application, and FIG. 2(b) is a schematic diagram of a schematic diagram of the flow direction provided by an embodiment of the present application. As shown in FIG. 2(a), the figure records the positions of each monitoring point on the expressway. In the figure, A1A2, B1B2, C1C2, D1D2, and E1E2 are five pairs of expressway gantries, and S1S2 are the exits and entrances of the toll station. The gantries and toll stations are the main sources of traffic flow data. The expressway gantries are arranged in pairs to monitor the one-way traffic flow, generally arranged between the toll station interchange and the interchange and the hub interchange. The traffic flow of the toll station is divided into the inbound traffic flow and the outbound traffic flow. As shown in FIG. 2(b), for the expressway in the G2 direction, the traffic flow of the B2 gantry located upstream flows out to the toll station exit S1, and the traffic flow entering the toll station S2 can only flow into the A2 gantry located downstream of the toll station. For the G3 expressway, only the E1 located upstream of the hub will have the outflow of the traffic flow, and the outflowing traffic flow can only flow into the A1 located downstream of the hub of G1 or flow into the gantry C2 located downstream of the G2, while only the traffic flow flows into the D1 gantry located downstream of the G3 expressway hub.

[0090] II: Draw the directed graph of the traffic flow corresponding to the target range based on the flow direction relationship between each monitoring point in the schematic diagram of the flow direction, and calculate the Laplace operator based on the directed graph of the traffic flow.

[0091] For the above step II, in specific implementation, after obtaining the flow direction schematic diagram, use the flow direction relationship between each monitoring point in the flow direction schematic diagram to draw a flow directed graph corresponding to the target range. After obtaining the flow directed graph, calculate the Laplacian operator based on the flow directed graph. Please refer to Fig. 2(c), which is a schematic diagram of a flow directed graph provided by an embodiment of the present application. The flow directed graph can be drawn according to the flow direction relationship between each monitoring point in Fig. 2(b). After obtaining the flow directed graph, the Laplacian operator can be calculated

[0092] Here, the propagation rule of the neural network layer is defined in the graph convolutional network GCN as follows:

[0093]

[0094] Among them, H (l) represents the activation output result of the l-th layer, H (l+1) represents the activation output of the (l + 1)-th layer, σ represents the sigmoid activation function, W (l) represents the weight matrix of the l-th layer, is the Laplacian matrix, i.e., the graph convolutional operation. In the Laplacian matrix A represents the adjacency matrix of the undirected graph, and I represents the identity matrix of the same size, i.e., the adjacency matrix considering its own nodes, which is multiplied by the feature matrix of the nodes. That is, the new feature of each node is calculated by the sum of the features of the node itself and its neighboring nodes. However, considering that the number of neighboring nodes of each node is different, is introduced, i.e., the diagonal matrix formed by the degrees of the matrix . The Laplacian matrix is to standardize it using the degree matrix of the adjacency matrix .

[0095] For the above step II, in specific implementation, after obtaining the flow directed graph of the traffic flow , first calculate its adjacency matrix A according to the flow directed graph, and sum it with the identity matrix to obtain the adjacency matrix considering itself Here, the present application does not limit the construction method of the adjacency matrix, which can be an unweighted matrix or a weighted matrix. When constructing a weighted matrix, the closer the distance between two points, the greater the weight value, such as calculating the weight value using a Gaussian kernel function. Then, find the in-degree of the adjacency matrix to form a diagonal matrix with the node in-degree as the diagonal Finally, the Laplacian operator of the flow directed graph can be obtained

[0096] III: Integrate the Laplace operator with the LSTM neural network to obtain an initial medium-term traffic flow prediction model.

[0097] Here, the LSTM neuron is implemented by the operations of three gates:

[0098] Forget gate: f t = σ(W f [h t-1 , X t + b f ), which is used to forget the cell state C of the previous step t-1 ;

[0099] Input gate: i t = σ(W i [h t-1 , X t + b i ), to update the new information generated by the input: ;

[0100] Use the forget gate and the input gate to obtain a new cell state

[0101] Output gate: o t = σ(W o [h t-1 , X t + b o ), to process the new state C t to obtain the output h at time t t = o t ⊙ tanh(C t ).

[0102] For the above step III, in specific implementation, the LSTM neuron contains four fully connected operations. Integrate the Laplace operator with the LSTM neural network, replace the fully connected operation with a graph convolution operation, and use the Laplace operator calculated in the above step II to obtain the initial medium-term traffic flow prediction model:

[0103] Forget gate:

[0104] Input gate:

[0105] New information:

[0106] Output gate:

[0107] IV: Obtain multiple historical traffic flow data of each monitoring point within the historical monitoring time period, and use the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0108] For the above step IV, in specific implementation, after obtaining the initial medium-term traffic flow prediction model, obtain multiple historical traffic flow data of each monitoring point within the historical monitoring time period, and use the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0109] Further, for the above step IV, the process of using the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range includes:

[0110] i: For each monitoring point, with the preset time series length as the sliding window length, determine multiple groups of target historical traffic flow data within the sliding window from the multiple historical traffic flow data of this monitoring point in a sliding window manner.

[0111] It should be noted that the preset time series length refers to the window length set in advance for obtaining the second sample data in a sliding window manner. For example, the preset time series length can be set to 3 in advance, and this application does not make specific limitations on this. Among them, each group of target historical traffic flow data includes multiple sample flow input data and the sample flow output data corresponding to the multiple sample flow input data.

[0112] For the above step i, in specific implementation, for each monitoring point, with the preset time series length as the sliding window length, determine multiple groups of target historical traffic flow data within the sliding window from the multiple historical traffic flow data of this monitoring point in a sliding window manner. Here, the essence of the LSTM neural network is to predict the value at the next moment of a time series with a length of s by learning the data set. For example, if the preset time series length is 3, then the data is windowed with a window size of 4. The first 3 historical traffic flow data within a window are used as sample flow input data, and the last historical traffic flow data is used as the sample flow output data, which means using the traffic flow data of the past three hours to predict the traffic flow data of the next hour.

[0113] ii: For each set of target historical traffic flow data, determine the target historical monitoring time period corresponding to the sample flow output data in the set of target historical traffic flow data, obtain the target historical feature data of the monitoring point during the target historical monitoring time period, perform data processing on the target historical feature data, and input the processed target historical feature data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the sample flow prediction result of the monitoring point during the target historical monitoring time period.

[0114] Regarding the above step ii, in specific implementation, after determining multiple sets of target historical traffic flow data of the monitoring point, for each set of target historical traffic flow data, determine the target historical monitoring time period corresponding to the sample flow output data in the set of target historical traffic flow data, and obtain the target historical feature data of the monitoring point during the target historical monitoring time period, and then perform data processing on the target historical feature data. Here, the method of performing data processing on the target historical feature data is the same as the method of performing data processing on the feature data in step S102 and can achieve the same technical effect, which will not be elaborated here. Input the processed target historical feature data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the sample flow prediction result of the monitoring point during the target historical monitoring time period.

[0115] iii: Determine the set of target historical traffic flow data and the corresponding sample flow prediction result of the set of target historical traffic flow data as the second sample data of the monitoring point.

[0116] Regarding the above step iii, in specific implementation, after determining the sample flow prediction result, determine the set of target historical traffic flow data and the corresponding sample flow prediction result of the set of target historical traffic flow data as the second sample data of the monitoring point.

[0117] iv: Determine the second training sample set, the second validation sample set, and the second test sample set according to the multiple sets of second sample data of each monitoring point.

[0118] v: Train the initial medium-term traffic flow prediction model based on the second training sample set, and use the second validation sample set and the second test sample set to adjust and verify the parameters of the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0119] For steps iv and v above, in specific implementation, after determining multiple groups of second sample data for each monitoring point, a second training sample set, a second validation sample set, and a second test sample set are determined according to the multiple groups of second sample data for each monitoring point. After dividing the second training sample set, the sample flow input data in the second training sample set is used as the input, and the sample flow output data is used as the output to train the medium-term traffic flow initial prediction model. Then, the second validation sample set is used to adjust and optimize the parameters of the medium-term traffic flow initial prediction model, and the second test sample set is used to verify the accuracy of the trained model to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0120] Specifically, for step S103 above, when there are multiple time periods to be predicted, inputting the initial flow prediction results of the monitoring point in each time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range, and using a recursive prediction strategy based on time series to determine the target flow prediction results of the monitoring point in each time period to be predicted, including:

[0121] (1) Generate a sorting for representing the time sequence of all time periods to be predicted, and determine the earliest target time period to be predicted from the sorting.

[0122] (2) Determine multiple historical time periods before the target time period to be predicted based on the preset time series length of the medium-term traffic flow prediction model, and determine the true historical flow data of each monitoring point in each of the multiple historical time periods.

[0123] (3) Input the initial flow prediction results of each monitoring point in the target time period to be predicted and the true historical flow data of each monitoring point into the medium-term traffic flow prediction model to determine the target flow prediction results of the monitoring point in the target time period to be predicted.

[0124] For the above steps (1)-(3), in specific implementation, a sorting for representing the time sequence of all the to-be-predicted time periods is generated according to the time range corresponding to each to-be-predicted time period, and the target to-be-predicted time period with the earliest time is determined from the sorting. Since the number of sample data used in training the medium-term traffic flow prediction model is determined according to the preset time series length, when the medium-term traffic flow prediction model is applied, the input data used should also be the same as the number of input data in training. Therefore, a plurality of historical time periods before the target to-be-predicted time period are determined based on the preset time series length of the medium-term traffic flow prediction model, and the true historical flow data of each monitoring point in each of the plurality of historical time periods is determined. For example, continuing the embodiment in step i above, when the preset time series length is 3, 3 historical time periods before the target to-be-predicted time period need to be determined, and the true historical flow data of each monitoring point in these 3 historical time periods is determined. Since the medium-term traffic flow prediction model uses historical traffic flow data and traffic flow data predicted by the long-term traffic flow prediction model during training, the historical traffic flow data and the traffic flow data predicted by the long-term traffic flow prediction model also need to be input into the medium-term traffic flow prediction model at the same time when it is used. Specifically, the initial flow prediction of each monitoring point in the target to-be-predicted time period predicted by the long-term traffic flow prediction model and the result of the true historical flow data of each monitoring point are input into the medium-term traffic flow prediction model to determine the target flow prediction result of the monitoring point in the target to-be-predicted time period.

[0125] (4) Combine the target flow prediction result of the monitoring point in the target to-be-predicted time period with the true historical flow data of the monitoring point to obtain a first prediction data group, and determine the target prediction data group of the monitoring point in the target to-be-predicted time period from the first prediction data group based on the preset time series length.

[0126] For step (4) above, in specific implementation, after the target traffic flow prediction result of the monitoring point in the target time period to be predicted is determined, the target traffic flow prediction result of the monitoring point in the target time period to be predicted is combined with the true historical traffic flow data of the monitoring point to obtain a first prediction data group, and based on a preset time series length, the data with the latest time period is determined from the first prediction data group as the target prediction data group of the monitoring point in the target time period to be predicted. For example, the preset time series length is 3, the target prediction time period is T + 1, and the historical time periods corresponding to the true historical traffic flow data are T - 2, T - 1, and T respectively. The data in the combined prediction data group then includes the data in the four time periods of T - 2, T - 1, T, and T + 1. Then, 3 data with the latest time periods are taken from the first prediction data group as the target prediction data group at T + 1, that is, the data in the three time periods of T - 1, T, and T + 1.

[0127] (5) Determine the next time period to be predicted adjacent to the target time period to be predicted from the sorting, and input the initial traffic flow prediction result of each monitoring point in the next time period to be predicted and the target prediction data group in the target time period to be predicted into the medium-term traffic flow prediction model at the same time to determine the target traffic flow prediction result of the monitoring point in the next time period to be predicted.

[0128] (6) Combine the target prediction data group of the monitoring point in the target time period to be predicted with the target traffic flow prediction result of the monitoring point in the next time period to be predicted to obtain a second prediction data group, and based on the preset time series length, determine the target prediction data group of the monitoring point in the next time period to be predicted from the second prediction data group.

[0129] (7) Determine the next time period to be predicted as the target time period to be predicted, and return to execute the step of determining the next time period to be predicted adjacent to the target time period to be predicted from the sorting until there is no next time period to be predicted adjacent to the target time period to be predicted in the sorting.

[0130] For the above steps (5)-(7), in specific implementation, after the traffic flow data prediction for the target to-be-predicted time period is completed, then determine the next to-be-predicted time period adjacent to the target to-be-predicted time period from the sorting, and input the initial traffic flow prediction result of each monitoring point in the next to-be-predicted time period and the target prediction data group in the target to-be-predicted time period into the medium-term traffic flow prediction model simultaneously to determine the target traffic flow prediction result of this monitoring point in the next to-be-predicted time period. Then, combine the target prediction data group of this monitoring point in the target to-be-predicted time period with the target traffic flow prediction result of this monitoring point in the next to-be-predicted time period to obtain a second prediction data group, and determine the data with the latest time period from the second prediction data group based on the preset time series length as the target prediction data group of this monitoring point in the next to-be-predicted time period. Then, determine the next to-be-predicted time period as the target to-be-predicted time period, and return to execute the step of determining the next to-be-predicted time period adjacent to the target to-be-predicted time period from the sorting in the above step (5), and so on, continue to predict the target traffic flow prediction result of this monitoring point in the next to-be-predicted time period until there is no next to-be-predicted time period adjacent to the target to-be-predicted time period in the sorting, then the target traffic flow prediction result of this monitoring point in each to-be-predicted time period can be obtained.

[0131] Please refer to Figure 3 , Figure 3 which is a schematic diagram of a traffic flow prediction process based on a recursive strategy provided by an embodiment of the present application. As Figure 3 shown, taking the prediction of traffic flow data for the next three hours as an example, input the prediction result of the long-term traffic flow prediction model and the traffic flow data X of the historical three hours T-2 , X T-1 , X T into the medium-term traffic flow prediction model to predict the traffic flow of the T+1 period; then use the result predicted by the medium-term traffic flow prediction model as the historical traffic flow of the T+1 period, and combine it with the traffic flow data X of the historical two hours T-1 , X T as the historical traffic flow data used to predict the T+2 period, and use it together with the preliminary prediction result of the long-term traffic flow prediction model for the T+2 period as the input of the medium-term traffic flow prediction model to predict the traffic flow of the T+2 period, and so on.

[0132] According to the embodiments provided in this application, a long-term traffic flow prediction model and a medium-term traffic flow prediction model are constructed to predict traffic flow. In practical applications, it is not only necessary to predict the traffic flow in the next hour, but also to predict the traffic conditions in the next two or three hours or even a longer time span, that is, multi-step time series prediction. This application adopts a recursive strategy when predicting the traffic flow for multiple hours, that is, the prediction result of the previous moment is used as the input to predict the traffic flow of the next moment. This method has a simple structure and is more flexible. By integrating the long-term traffic flow regression prediction model, the error is reduced and the prediction accuracy is improved. Moreover, in the case of missing data, the prediction result of the long-term traffic flow can also be used as the input to predict the traffic flow in the next multiple hours.

[0133] A traffic flow prediction method provided by an embodiment of this application. First, for each monitoring point on the highway within the target range, obtain the characteristic data of this monitoring point within at least one time period to be predicted; then, for each time period to be predicted, process the characteristic data of this monitoring point within this time period to be predicted, and input the processed characteristic data into the long-term traffic flow prediction model corresponding to this monitoring point to determine the initial traffic flow prediction result of this monitoring point within this time period to be predicted; finally, input the initial traffic flow prediction result of this monitoring point within each time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range, and use a recursive prediction strategy based on time series to determine the target traffic flow prediction result of this monitoring point within each time period to be predicted.

[0134] The traffic flow prediction method provided by the embodiment of this application not only considers the changes in real-time traffic flow but also combines the long-term development law of traffic flow. The lightGBM regression algorithm is used to establish a long-term traffic flow prediction model, and the prediction result of the long-term traffic flow prediction model will be used as input data in the medium-term traffic flow prediction model, which is equivalent to increasing the length of the time series input into the medium-term traffic flow prediction model and improving the prediction accuracy. Moreover, the medium-term traffic flow prediction model uses an LSTM neural network, and the spatial features of the detector are incorporated into the LSTM neurons through graph convolution. By establishing a directed graph with the monitoring points on the highway as nodes, calculating the Laplacian operator of the directed graph, and incorporating the spatial features of the detector into the LSTM neurons through graph convolution, the fusion method is to replace the fully connected operation of the LSTM neurons with a graph convolution operation.

[0135] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of a traffic flow prediction device provided by an embodiment of this application. As Figure 4 shown in

[0136] The data acquisition module 401 is configured to obtain, for each monitoring point on the highway within the target range, the feature data of the monitoring point within at least one time period to be predicted.

[0137] The first prediction module 402 is configured to, for each time period to be predicted, perform data processing on the feature data of the monitoring point within the time period to be predicted, and input the processed feature data into the long-term traffic flow prediction model corresponding to the monitoring point, so as to determine the initial flow prediction result of the monitoring point within the time period to be predicted.

[0138] The second prediction module 403 is configured to input the initial flow prediction result of the monitoring point within each time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range, and use a recursive prediction strategy based on time series to determine the target flow prediction result of the monitoring point within each time period to be predicted.

[0139] Furthermore, the prediction device 400 further includes a first model training module, and the first model training module is configured to train the long-term traffic flow prediction model corresponding to the monitoring point through the following steps:

[0140] Obtain multiple groups of historical monitoring data of the monitoring point within the historical monitoring time period; wherein, the historical monitoring data includes historical feature data and historical traffic flow data.

[0141] For each group of historical monitoring data, perform the data processing on the group of historical monitoring data to obtain the first sample data.

[0142] Determine a first training sample set, a first validation sample set, and a first test sample set according to the multiple groups of first sample data.

[0143] Construct a lightGBM regression model based on the first training sample set, and use the first validation sample set and the first test sample set to adjust and verify the parameters of the lightGBM regression model, so as to obtain the long-term traffic flow prediction model corresponding to the monitoring point.

[0144] Furthermore, the prediction device 400 further includes a second model training module, and the second model training module is configured to train the medium-term traffic flow prediction model corresponding to the target range through the following steps:

[0145] Obtain a schematic diagram of the positions of the monitoring points corresponding to the target range, and determine a flow direction schematic diagram based on the positions of each monitoring point in the schematic diagram of the positions of the monitoring points and the flow direction of the highway where each monitoring point is located.

[0146] Draw a flow directed graph corresponding to the target range based on the flow relationship between each monitoring point in the flow direction schematic diagram, and calculate the Laplace operator based on the flow directed graph;

[0147] Fuse the Laplace operator with the LSTM neural network to obtain an initial medium-term traffic flow prediction model;

[0148] Obtain multiple historical traffic flow data of each monitoring point during the historical monitoring period, and use the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0149] Furthermore, when the second model training module is used to train the initial medium-term traffic flow prediction model with the multiple historical traffic flow data of each monitoring point to obtain the medium-term traffic flow prediction model corresponding to the target range, the second model training module is further used for:

[0150] For each monitoring point, with the preset time series length as the sliding window length, determine multiple groups of target historical traffic flow data within the sliding window in the multiple historical traffic flow data of this monitoring point in a sliding window manner; where each group of target historical traffic flow data includes multiple sample flow input data and the sample flow output data corresponding to the multiple sample flow input data;

[0151] For each group of target historical traffic flow data, determine the target historical monitoring period corresponding to the sample flow output data in this group of target historical traffic flow data, obtain the target historical feature data of this monitoring point during the target historical monitoring period, perform data processing on the target historical feature data, and input the processed target historical feature data into the long-term traffic flow prediction model corresponding to this monitoring point to determine the sample flow prediction result of this monitoring point during the target historical monitoring period;

[0152] Determine this group of target historical traffic flow data and the sample flow prediction result corresponding to this group of target historical traffic flow data as the second sample data of this monitoring point;

[0153] Determine a second training sample set, a second validation sample set, and a second test sample set according to the multiple groups of second sample data of each monitoring point;

[0154] Train the initial medium-term traffic flow prediction model based on the second training sample set, and use the second validation sample set and the second test sample set to adjust and verify the parameters of the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

[0155] Further, when there are multiple time periods to be predicted, when the second prediction module 403 inputs the initial traffic flow prediction results of the monitoring point in each time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range and uses a recursive prediction strategy based on time series to determine the target traffic flow prediction results of the monitoring point in each time period to be predicted, the second prediction module 403 is further configured to:

[0156] Generate a sorting for representing the time sequence of all time periods to be predicted, and determine the target time period to be predicted with the earliest time from the sorting;

[0157] Determine a plurality of historical time periods before the target time period to be predicted based on the preset time series length of the medium-term traffic flow prediction model, and determine the true historical traffic flow data of each monitoring point in each of the plurality of historical time periods;

[0158] Input the initial traffic flow prediction result of each monitoring point in the target time period to be predicted and the true historical traffic flow data of each monitoring point into the medium-term traffic flow prediction model to determine the target traffic flow prediction result of the monitoring point in the target time period to be predicted;

[0159] Combine the target traffic flow prediction result of the monitoring point in the target time period to be predicted with the true historical traffic flow data of the monitoring point to obtain a first prediction data group, and determine the target prediction data group of the monitoring point in the target time period to be predicted from the first prediction data group based on the preset time series length;

[0160] Determine the next time period to be predicted adjacent to the target time period to be predicted from the sorting, and input the initial traffic flow prediction result of each monitoring point in the next time period to be predicted and the target prediction data group of the monitoring point in the target time period to be predicted into the medium-term traffic flow prediction model at the same time to determine the target traffic flow prediction result of the monitoring point in the next time period to be predicted;

[0161] Combine the target prediction data group of the monitoring point in the target time period to be predicted with the target traffic flow prediction result of the monitoring point in the next time period to be predicted to obtain a second prediction data group, and determine the target prediction data group of the monitoring point in the next time period to be predicted from the second prediction data group based on the preset time series length;

[0162] Determine the next time period to be predicted as the target time period to be predicted, and return to execute the step of determining the next time period to be predicted adjacent to the target time period to be predicted from the sorting until there is no next time period to be predicted adjacent to the target time period to be predicted in the sorting.

[0163] Please refer to Figure 5 , Figure 5 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 5 shown in, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.

[0164] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 runs, the processor 510 communicates with the memory 520 through the bus 530. When the machine-readable instructions are executed by the processor 510, the steps of the traffic flow prediction method in the method embodiment as described above can be executed. The specific implementation manner can refer to the method embodiment and will not be elaborated herein. Figure 1 shown in, and will not be elaborated herein.

[0165] An embodiment of the present application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the traffic flow prediction method in the method embodiment as described above can be executed. The specific implementation manner can refer to the method embodiment and will not be elaborated herein. Figure 1 shown in, and will not be elaborated herein.

[0166] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0167] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0168] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0169] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0170] If the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.

[0171] It should be noted that: similar reference numerals and letters denote similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used for descriptive distinction and cannot be understood as indicating or implying relative importance.

[0172] Finally, it should be noted that: the above-mentioned embodiments are only specific implementation manners of the present application, used to illustrate the technical solutions of the present application, rather than limiting them. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present application can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for predicting traffic flow, characterized in that, The prediction method includes: For each monitoring point on the highway within the target range, obtain the characteristic data of the monitoring point within at least one period to be predicted; For each period to be predicted, process the characteristic data of the monitoring point within the period to be predicted, and input the processed characteristic data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the initial flow prediction result of the monitoring point within the period to be predicted; Input the initial flow prediction results of the monitoring point within each period to be predicted into the medium-term traffic flow prediction model corresponding to the target range, and use a recursive prediction strategy based on time series to determine the target flow prediction results of the monitoring point within each period to be predicted; Train the medium-term traffic flow prediction model corresponding to the target range through the following steps: Obtain the schematic diagram of the positions of the monitoring points corresponding to the target range, and determine the flow direction schematic diagram based on the positions of each monitoring point in the monitoring point position schematic diagram and the flow direction of the highway where each monitoring point is located; Draw the traffic flow directed graph corresponding to the target range based on the flow direction relationship between each monitoring point in the flow direction schematic diagram, and calculate the Laplacian operator based on the traffic flow directed graph; Fuse the Laplacian operator with the LSTM neural network to obtain an initial medium-term traffic flow prediction model; Obtain multiple historical traffic flow data of each monitoring point within the historical monitoring period, and use the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

2. The prediction method according to claim 1, wherein Train the long-term traffic flow prediction model corresponding to the monitoring point through the following steps: Obtain multiple groups of historical monitoring data of the monitoring point within the historical monitoring period; wherein, the historical monitoring data includes historical characteristic data and historical traffic flow data; For each group of historical monitoring data, perform the data processing on the group of historical monitoring data to obtain the first sample data; Determine the first training sample set, the first validation sample set, and the first test sample set according to multiple groups of the first sample data; Construct a lightGBM regression model based on the first training sample set, and use the first validation sample set and the first test sample set to adjust and verify the parameters of the lightGBM regression model to obtain the long-term traffic flow prediction model corresponding to the monitoring point.

3. The prediction method according to claim 1, characterized in that The training of the initial medium-term traffic flow prediction model with the multiple historical traffic flow data of each monitoring point to obtain the medium-term traffic flow prediction model corresponding to the target range includes: For each monitoring point, with the preset time series length as the sliding window length, determine multiple groups of target historical traffic flow data within the sliding window in the multiple historical traffic flow data of the monitoring point in a sliding window manner; wherein, each group of target historical traffic flow data includes multiple sample flow input data and the sample flow output data corresponding to the multiple sample flow input data. For each set of target historical traffic flow data, determine the target historical monitoring time period corresponding to the sample flow output data in the set of target historical traffic flow data, obtain the target historical feature data of the monitoring point during the target historical monitoring time period, perform data processing on the target historical feature data, and input the processed target historical feature data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the sample flow prediction result of the monitoring point during the target historical monitoring time period; Determine the set of target historical traffic flow data and the sample flow prediction result corresponding to the set of target historical traffic flow data as the second sample data of the monitoring point; Determine a second training sample set, a second validation sample set, and a second test sample set based on multiple sets of second sample data of each monitoring point; Train the initial medium-term traffic flow prediction model based on the second training sample set, and use the second validation sample set and the second test sample set to adjust and verify the parameters of the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

4. The prediction method according to claim 1, characterized in that When there are multiple time periods to be predicted, input the initial flow prediction result of the monitoring point in each time period to be predicted into the medium-term traffic flow prediction model corresponding to the target range, and use a recursive prediction strategy based on time series to determine the target flow prediction result of the monitoring point in each time period to be predicted, including: Generate a sorting for representing the time sequence of all time periods to be predicted, and determine the earliest target time period to be predicted from the sorting; Determine multiple historical time periods before the target time period to be predicted based on the preset time series length of the medium-term traffic flow prediction model, and determine the true historical flow data of each monitoring point in each of the multiple historical time periods; Input the initial flow prediction result of each monitoring point during the target time period to be predicted and the true historical flow data of each monitoring point into the medium-term traffic flow prediction model to determine the target flow prediction result of the monitoring point during the target time period to be predicted; Combine the target flow prediction result of the monitoring point during the target time period to be predicted with the true historical flow data of the monitoring point to obtain a first prediction data group, and determine the target prediction data group of the monitoring point during the target time period to be predicted from the first prediction data group based on the preset time series length; Determine the next time period to be predicted adjacent to the target time period to be predicted from the sorting, and input the initial flow prediction result of each monitoring point during the next time period to be predicted and the target prediction data group during the target time period to be predicted into the medium-term traffic flow prediction model to determine the target flow prediction result of the monitoring point during the next time period to be predicted; Combine the target prediction data set of the monitoring point in the target prediction time period with the target traffic flow prediction result of the monitoring point in the next prediction time period to obtain a second prediction data set, and determine the target prediction data set of the monitoring point in the next prediction time period from the second prediction data set based on the preset time series length; Determine the next prediction time period as the target prediction time period, and return to execute the step of determining the next prediction time period adjacent to the target prediction time period from the sorting until there is no next prediction time period adjacent to the target prediction time period in the sorting.

5. A traffic flow prediction device, characterized in that, The prediction device includes: A data acquisition module, configured to acquire the feature data of each monitoring point on the highway within the target range in at least one prediction time period; A first prediction module, configured to perform data processing on the feature data of each monitoring point in the prediction time period, and input the processed feature data into the long-term traffic flow prediction model corresponding to the monitoring point to determine the initial traffic flow prediction result of the monitoring point in the prediction time period; A second prediction module, configured to input the initial traffic flow prediction result of each monitoring point in each prediction time period into the medium-term traffic flow prediction model corresponding to the target range, and use a recursive prediction strategy based on time series to determine the target traffic flow prediction result of each monitoring point in each prediction time period; The prediction device further includes a second model training module, and the second model training module is configured to train the medium-term traffic flow prediction model corresponding to the target range through the following steps: Obtain a schematic diagram of the monitoring point positions corresponding to the target range, and determine a flow direction schematic diagram based on the positions of each monitoring point in the monitoring point position schematic diagram and the flow direction of the highway where each monitoring point is located; Draw a traffic flow directed graph corresponding to the target range based on the flow direction relationship between each monitoring point in the flow direction schematic diagram, and calculate the Laplacian operator based on the traffic flow directed graph; Fuse the Laplacian operator with an LSTM neural network to obtain an initial medium-term traffic flow prediction model; Obtain multiple historical traffic flow data of each monitoring point in the historical monitoring time period, and use the multiple historical traffic flow data of each monitoring point to train the initial medium-term traffic flow prediction model to obtain the medium-term traffic flow prediction model corresponding to the target range.

6. The prediction device according to claim 5, characterized in that The prediction device further includes a first model training module, and the first model training module is configured to train the long-term traffic flow prediction model corresponding to the monitoring point through the following steps: Obtain multiple groups of historical monitoring data of the monitoring point in the historical monitoring time period; wherein, the historical monitoring data includes historical feature data and historical traffic flow data; For each group of historical monitoring data, perform the data processing on the group of historical monitoring data to obtain first sample data; Determine a first training sample set, a first validation sample set, and a first test sample set according to multiple groups of first sample data; Construct a lightGBM regression model based on the first training sample set, and use the first validation sample set and the first test sample set to adjust and validate the parameters of the lightGBM regression model to obtain the long-term traffic flow prediction model corresponding to this monitoring point.

7. An electronic device, characterized in that, It includes: A processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are run by the processor, the steps of the traffic flow prediction method according to any one of claims 1 to 4 are executed.

8. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is run by the processor, the steps of the traffic flow prediction method according to any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • Traffic data prediction method and device and vehicle control method

    CN111079975A