Traffic flow prediction method and device, computer device and storage medium
By determining historical data for the base year and target time period, and combining pre-configured formulas with the influence of special factors, the problem of error accumulation in the macro-prediction of traffic flow across the province was solved, enabling rapid and accurate traffic flow prediction during holidays and providing an effective reference for highway management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SUREKAM CORP
- Filing Date
- 2023-02-10
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies lack macro-level forecasting methods for traffic flow across the entire province. The aggregation of forecasts from individual toll stations is prone to error accumulation. Insufficient historical data during holidays makes it difficult to train machine learning models, and the impact of factors such as weather and emergencies is ignored.
By determining historical data for the base year and target time period, including average daily traffic volume, annual growth rate, weekly growth rate, and traffic volume ratio, the traffic volume of toll stations throughout the province is predicted using a pre-configured traffic volume prediction formula, taking into account the influence of meteorological, planned, and accidental factors.
It enables rapid and accurate prediction of traffic flow across the province during holidays with limited historical data and without the need for complex model training, providing a reasonable reference for highway travel.
Smart Images

Figure CN116311967B_ABST
Abstract
Description
Traffic flow prediction methods, devices, computer equipment and storage media Technical Field
[0001] This invention relates to the field of traffic flow prediction technology, and in particular to traffic flow prediction methods, devices, computer equipment, and storage media. Background Technology
[0002] To cope with the surge in traffic during holidays and ensure the safe and smooth operation of the expressway network, provincial expressway management departments analyze and predict traffic volume changes in advance and issue expressway travel guides to help people plan their trips accordingly. Against this backdrop, a relatively reasonable and accurate prediction of traffic flow at toll station entrances and exits across the province during holidays from a macro perspective is of significant reference value for expressway management departments in understanding traffic trends, making advance arrangements for holiday traffic management, and issuing expressway travel guides.
[0003] However, current traffic flow forecasting in the highway sector is mostly focused on individual toll station traffic flow, lacking macro-level forecasting for the entire province. Current holiday traffic flow forecasts are largely based on individual toll stations, focusing on individual cases rather than the overall traffic flow across all toll stations in the province. Because toll stations vary in location, size, and traffic flow characteristics, forecasting individual toll stations and then summarizing the results is not only computationally cumbersome but also prone to error accumulation. Currently used machine learning and deep learning forecasting methods require extensive historical data to train high-performance models, but the amount of data available for holidays is limited. Furthermore, past limitations in detection equipment and technology have resulted in data gaps, hindering the use of machine learning and deep learning models. Additionally, current traffic flow forecasting methods are primarily time-series based, heavily relying on temporal variations and neglecting the impact of weather, planned events, and unforeseen events on traffic flow, leading to unreliable forecasts.
[0004] Therefore, current traffic flow forecasting in the highway sector is mostly focused on forecasting traffic flow at individual toll stations, lacking macro-level forecasting for the entire province. The method of forecasting traffic flow at individual toll stations separately and then summing the forecasts is computationally complex and prone to error accumulation. The limited amount of historical data during holidays makes it difficult to train forecasting models using machine learning and deep learning techniques. Time series-based forecasting methods ignore the impact of special factors other than time series on traffic flow changes. Summary of the Invention
[0005] Therefore, it is necessary to provide a traffic flow prediction method, device, computer equipment, and storage medium to address the above problems.
[0006] Firstly, a traffic flow prediction method is provided for predicting traffic flow in a target area during a target time period in the current year. The prediction method includes:
[0007] The base year is determined based on the historical traffic flow data of the target area, wherein the base year is the year preceding the current year;
[0008] Based on the base year and the target time period, target historical data for traffic flow prediction is determined using the historical traffic flow data. The target historical data includes: the average daily traffic flow for the historical time period, the annual growth rate of traffic flow for the historical time period relative to the year preceding the base year, the weekly growth rate of traffic flow for the historical time period relative to the week preceding the historical time period, the traffic flow ratio for each day of the historical time period, and the traffic flow ratio for each hour of each day of the historical time period. The historical time period refers to the time period within the base year corresponding to the target time period.
[0009] Based on the target historical data, determine the predicted traffic flow for each hour of the day for the target area during the target time period.
[0010] In one embodiment, determining the target historical data for traffic flow prediction using the historical traffic flow data includes:
[0011] According to the preset vehicle type classification rules, the historical traffic flow data is grouped, and the historical traffic flow data of the same type of vehicle is divided into a group.
[0012] For each type of vehicle, target historical data for the same type of vehicle is determined by using a set of historical traffic flow data corresponding to the same type of vehicle.
[0013] In one embodiment, determining the target historical data for traffic flow prediction using the historical traffic flow data includes:
[0014] Determine the average daily traffic volume for the first day of the historical period;
[0015] Determine the average daily traffic volume on the second day of the week preceding the historical time period;
[0016] Determine the average daily traffic flow of the third day in the period corresponding to the historical time period in the year preceding the base year;
[0017] The weekly growth rate is determined based on the first daily average traffic flow and the second daily average traffic flow;
[0018] The annual growth rate is determined based on the first average daily traffic flow and the third average daily traffic flow.
[0019] In one embodiment, determining the predicted hourly traffic flow for the target area during the target time period based on the target historical data includes:
[0020] Based on the target historical data, the hourly traffic flow prediction results for the target area during the target time period are determined using a pre-configured first traffic flow prediction formula; wherein, the expression of the first traffic flow prediction formula is:
[0021]
[0022] In the formula, F i,h This represents the traffic flow prediction result for any hour on any day within the target time period;
[0023] S represents the average daily traffic volume during the historical period;
[0024] N represents the number of days in the target time period;
[0025] d i This indicates the proportion of traffic flow on each day within the historical time period.
[0026] r i,h This indicates the proportion of traffic flow in each hour of each day during the historical time period.
[0027] A represents the annual growth rate;
[0028] B represents the weekly growth rate;
[0029] α and β represent the confidence weights of the annual growth rate and the weekly growth rate, respectively;
[0030] n represents the year difference between the base year and the current year.
[0031] In one embodiment, the prediction method further includes:
[0032] Obtain the actual traffic flow during a preset verification time period, wherein the verification time period is a time period in the base year and / or a time period in the current year;
[0033] The confidence weights for the annual growth rate and the weekly growth rate in the first traffic prediction formula are each divided into multiple parts with a minimum of 0 and a maximum of 1.
[0034] The annual growth rate confidence weight and the weekly growth rate confidence weight are combined cyclically, and the traffic flow prediction result for the verification time period under each weight combination is calculated according to the first traffic flow prediction formula.
[0035] Determine the average absolute percentage error between the traffic flow prediction result and the actual traffic flow during the verification period;
[0036] The combination of annual growth rate confidence weights and weekly growth rate confidence weights with the smallest average absolute percentage error is selected as the annual growth rate confidence weights and weekly growth rate confidence weights for the first flow prediction formula.
[0037] In one embodiment, determining the predicted hourly traffic flow for the target area during the target time period based on the target historical data includes:
[0038] Based on the target historical data, the hourly traffic flow prediction results for the target area during the target time period are determined using a pre-configured second traffic flow prediction formula; wherein, the expression of the second traffic flow prediction formula is:
[0039]
[0040] In the formula, F i,h This represents the traffic flow prediction result for any hour on any day within the target time period;
[0041] f w f e and f y These are meteorological factors, planned event factors, and accidental factors;
[0042] S represents the average daily traffic volume during the historical period;
[0043] N represents the number of days in the target time period;
[0044] d i This indicates the proportion of traffic flow on each day within the historical time period.
[0045] r i,h This indicates the proportion of traffic flow in each hour of each day during the historical time period.
[0046] A represents the annual growth rate;
[0047] B represents the weekly growth rate;
[0048] α and β represent the weights of the annual growth rate and the weekly growth rate, respectively;
[0049] n represents the year difference between the base year and the current year.
[0050] In one embodiment, the target area is the entrance and exit of the station's toll gate; the target time period is during statutory holidays; and the base year is the year preceding the current year.
[0051] Secondly, a traffic flow prediction device is provided, the prediction device comprising:
[0052] The base year determination unit is used to determine the base year based on the historical traffic flow data of the target area, wherein the base year is a year prior to the current year;
[0053] The historical data determination unit is used to determine target historical data for traffic flow prediction based on the base year and the target time period, using the historical traffic flow data. The target historical data includes: the average daily traffic flow for the historical time period of the base year; the annual growth rate of traffic flow for the historical time period of the base year relative to the previous year; the weekly growth rate of traffic flow for the historical time period of the base year relative to the previous week; the traffic flow ratio for each day of the historical time period of the base year; and the traffic flow ratio for each hour of each day of the historical time period of the base year. The historical time period refers to the time period within the base year corresponding to the target time period.
[0054] The prediction result output unit is used to determine the predicted traffic flow for each hour of the target area during the target time period based on the target historical data.
[0055] Thirdly, a computer device is provided, including a memory and a processor, wherein the memory stores computer-readable instructions, which, when executed by the processor, cause the processor to perform the steps of the traffic flow prediction method described above.
[0056] Fourthly, a storage medium storing computer-readable instructions is provided, which, when executed by one or more processors, cause the one or more processors to perform the steps of the traffic flow prediction method described above.
[0057] The aforementioned traffic flow prediction method, apparatus, computer equipment, and storage medium are used to predict traffic flow in a target area for a target period in the current year. A base year is determined based on historical traffic flow data of the target area. Based on the base year and the target period, target historical data for traffic flow prediction is determined using the historical traffic flow data. The target historical data includes: the average daily traffic flow for the historical period, the annual growth rate of traffic flow for the historical period relative to the year preceding the base year, the weekly growth rate of traffic flow for the historical period relative to the week preceding the historical period, the traffic flow ratio for each day of the historical period, and the traffic flow ratio for each hour of each day of the historical period. The historical period refers to the period within the base year corresponding to the target period. Based on the target historical data, the hourly traffic flow prediction results for each day of the target period in the target area are determined. Therefore, this invention can treat the exit traffic flow and entrance traffic flow of toll stations throughout the province as a whole. Based on the traffic flow characteristics of different vehicle types during holidays, and taking into account factors such as weather and unforeseen circumstances, it can predict the entrance and exit traffic flow of different vehicle types during holidays, obtaining relatively accurate prediction results. This provides a reference for highway management departments in various provinces to issue highway travel guidelines during holidays. Attached Figure Description
[0058] Figure 1 is a schematic diagram of an application environment of the traffic flow prediction method according to an embodiment of the present invention;
[0059] Figure 2 is a flowchart of a traffic flow prediction method according to an embodiment of the present invention;
[0060] Figure 3 is a flowchart illustrating a specific implementation of step S10 in Figure 1;
[0061] Figure 4 is a flowchart illustrating a specific implementation of step S30 in Figure 1;
[0062] Figure 5 is a flowchart illustrating a specific implementation of step S32 in Figure 4;
[0063] Figure 6 is a schematic diagram of a traffic flow prediction device according to an embodiment of the present invention;
[0064] Figure 7 is a structural schematic diagram of a computer device according to an embodiment of the present invention;
[0065] Figure 8 is another structural schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0067] It is understood that the terms "original," "test," etc., used in this application may be used to describe various elements herein, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first traffic flow prediction method script may be referred to as a test traffic flow prediction method script, and similarly, a test traffic flow prediction method script may be referred to as a test traffic flow prediction method script.
[0068] To cope with the surge in traffic during holidays and ensure the safe and smooth operation of the expressway network, expressway management departments in various provinces analyze and predict traffic volume changes in advance and issue expressway travel guides to help people plan their trips accordingly. However, accurately predicting traffic flow during holidays is challenging due to varying holiday lengths, the fact that some holidays offer free expressways for passenger cars while others do not, and the influence of weather, planned events, and unforeseen circumstances.
[0069] The traffic flow prediction method provided in this invention can be applied in the application environment shown in Figure 1 to predict the traffic flow of a target area during a target time period (such as a statutory holiday) in the current year. The client communicates with the server via a network. The server can receive the target area and target time period input by the user through the client. It determines the base year based on historical traffic flow data of the target area, where the base year is the year preceding the current year. Based on the base year and target time period, it determines the target historical data for traffic flow prediction using historical traffic flow data. The target historical data includes: the average daily traffic flow of the historical time period, the annual growth rate of traffic flow of the historical time period relative to the year before the base year, the weekly growth rate of traffic flow of the historical time period relative to the week before the historical time period, the traffic flow ratio of each day in the historical time period, and the traffic flow ratio of each hour in each day of the historical time period. The historical time period refers to the time period in the base year corresponding to the target time period. Based on the target historical data, it determines the predicted hourly traffic flow for the target area during the target time period. In this invention, for the problem of predicting traffic flow at the exits and / or entrances of toll stations in a province during statutory holidays, historical traffic flow data can be statistically analyzed and summarized to obtain corresponding target historical data. This target historical data is then substituted into a pre-set traffic flow prediction formula to calculate the traffic flow prediction result for the target time period (statutory holidays). Compared with existing methods for predicting traffic flow at highway toll stations during holidays, the method disclosed in this invention can quickly predict macro-level traffic flow during holidays with less historical data required and without complex model training processes. The prediction method is more reasonable, and the prediction results have better stability and accuracy. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.
[0070] Please refer to Figure 2, which is a flowchart illustrating a traffic flow prediction method provided in an embodiment of the present invention. This method predicts traffic flow in a target area during a target time period (such as during statutory holidays) in the current year, and includes the following steps:
[0071] S10. Determine the base year based on the historical traffic flow data of the target area, where the base year is the year preceding the current year;
[0072] It is understood that this embodiment is used to predict traffic flow in a target area for a future period. Here, the current year refers to the year in which the target period falls. For example, if the target period is the prediction of traffic flow from January 1st to 3rd, 2023 (New Year's Day holiday), then the current year is 2023. The target area can be a region, province, city, or even a multi-province collaborative development zone, such as the Beijing-Tianjin-Hebei region or the Yangtze River Delta region. The target period can refer to a holiday period. For example, if the current time is April 2022, the prediction is for May 1st to 3rd, 2022 (May Day holiday) and October 1st to 7th, 2022 (National Day holiday). The data collection location for traffic flow can be the exits and / or entrances of toll stations in a certain region. For example, the traffic flow data of a province can be inferred by statistically analyzing the traffic flow at the exits and / or entrances of toll stations passing through a certain province.
[0073] The base year is the year preceding the current year. For example, if the current year is 2022, the base year could be either 2021 or 2020. In principle, the previous year is preferred, unless the historical traffic flow data for the previous year is flawed, such as incomplete data (missing data) or special circumstances in the target area causing data anomalies, such as one or more tollbooth exits / entrances being closed for a period of time.
[0074] In some embodiments, preferably, the target time period is during statutory holidays; the base year is the year preceding the current year.
[0075] S20. Based on the base year and the target time period, determine the target historical data for traffic flow forecasting using historical traffic flow data; wherein, the target historical data includes: the average daily traffic flow of the historical time period, the annual growth rate of traffic flow of the historical time period relative to the year before the base year, the weekly growth rate of traffic flow of the historical time period relative to the week before the historical time period, the proportion of traffic flow on each day of the historical time period, and the proportion of traffic flow on each hour of each day of the historical time period; the historical time period refers to the time period in the base year that corresponds to the target time period.
[0076] Understandably, the historical time period refers to the time period in the base year that corresponds to the target time period. For example, if the target time period is January 1 to 3, 2023, then the historical time period should be January 1 to 3 of the base year. In other words, the corresponding time period means that the dates must match. Alternatively, if the target time period is a certain statutory holiday in the current year, then the historical time period is the same statutory holiday in the base year.
[0077] In some embodiments, step S20 above may include:
[0078] S201a. Based on the preset vehicle type classification rules, the historical traffic flow data is grouped, and the historical traffic flow data of the same type of vehicle is grouped together.
[0079] S201b: For each type of vehicle, the target historical data for the same type of vehicle is determined by a set of historical traffic flow data corresponding to the same type of vehicle.
[0080] Here, traffic flow is predicted for target time periods for different types of vehicles, and the corresponding historical traffic flow is also the historical traffic flow for each type of vehicle. For example, taking the historical traffic flow statistics of various vehicle types at the entrance of a highway toll station in a certain province during the New Year's Day holiday as an example, we analyze the characteristics of traffic flow changes for different vehicle types during holidays. Vehicle types on highways are divided into three categories: passenger cars, freight cars, and special-purpose vehicles. Passenger cars and freight cars have a relatively large traffic flow, while special-purpose vehicles have a relatively small traffic flow. Passenger cars include passenger cars with 7 seats or less and other passenger vehicles.
[0081] In some embodiments, step S20 above may include:
[0082] S202a, Determine the average daily traffic flow for the first historical time period;
[0083] S202b, Determine the average daily traffic flow of the second day of the previous historical period;
[0084] S202c, Determine the average daily traffic flow of the third day in the year preceding the base year that corresponds to the historical time period;
[0085] S202d. Determine the weekly growth rate based on the average traffic flow of the first and second days.
[0086] S202e. Determine the annual growth rate based on the average traffic flow on the first day and the average traffic flow on the third day.
[0087] It is understandable that the first average daily traffic volume is the average daily traffic volume during the statutory holidays, that is, the average daily traffic volume of a certain type of vehicle; the second average daily traffic volume is the average daily traffic volume of the week preceding the statutory holidays, for example, the week preceding May 1st to 3rd (the statutory holidays) is April 24th to 30th; the third average daily traffic volume is the average daily traffic volume of the period corresponding to the historical time period in the year preceding the base year, for example, taking 2022 as the base year, and October 1st to 7th (the statutory National Day holiday) as the historical time period, then the period corresponding to the historical time period is October 1st to 7th, 2021.
[0088] S30. Based on the historical data of the target area, determine the predicted traffic flow for each hour of the day for the target time period in the target area.
[0089] In some embodiments, step S30 above may include:
[0090] Based on historical data, the hourly traffic flow forecast for the target area during the target time period is determined using a pre-configured first traffic flow prediction formula. The expression for the first traffic flow prediction formula is as follows:
[0091]
[0092] In the formula, F i,h This represents the traffic flow forecast for any hour on any day within the target time period.
[0093] S represents the average daily traffic volume over a historical period;
[0094] N represents the number of days in the target time period;
[0095] d i This indicates the proportion of traffic flow on each day within a historical time period;
[0096] r i,h This indicates the proportion of traffic flow in each hour of each day within a historical time period.
[0097] A represents the annual growth rate;
[0098] B represents the weekly growth rate;
[0099] α and β represent the confidence weights for the annual growth rate and the weekly growth rate, respectively;
[0100] n represents the year difference between the base year and the current year.
[0101] The year difference between the base year and the current year refers to the number of years that the base year is compared to the current year. For example, if the current year is 2022 and the base year is 2021, then n is 1; if the current year is 2022 and the base year is 2020, then n is 2.
[0102] In one application scenario, taking the prediction of traffic flow at highway toll stations across the province during holidays as an example, the exit and entrance traffic flow of all toll stations in the province are treated as a whole. Based on the traffic flow characteristics of different vehicle types during holidays, and taking into account factors such as weather and unforeseen circumstances, the entrance and exit traffic flow of different vehicle types during holidays is predicted. Relatively accurate prediction results are obtained, providing a reference for highway management departments in various provinces to issue highway travel guidelines during holidays.
[0103] 1. Historical traffic flow data:
[0104] Taking historical traffic flow statistics of various vehicle types at highway toll station entrances in a certain province during the New Year's Day holiday as an example, this paper analyzes the characteristics of traffic flow changes for different vehicle types during holidays. Vehicle types on highways are divided into three categories: passenger cars, freight cars, and special-purpose vehicles. Passenger cars and freight cars have relatively high traffic volume, while special-purpose vehicles have relatively low traffic volume. Passenger cars include passenger cars with 7 seats or less and other passenger vehicles. The total entrance traffic volume of all highway toll stations in the province is considered as a whole, hereinafter referred to as "entrance traffic volume". The entrance traffic volume of each vehicle type in the province during the New Year's Day holiday is summarized hourly, hereinafter referred to as "hourly traffic volume". The hourly traffic volume of passenger cars, freight cars, and special-purpose vehicles during the New Year's Day holiday will then be analyzed separately.
[0105] 2. Analysis of historical passenger vehicle traffic data:
[0106] Statistical analysis of hourly passenger vehicle traffic during the New Year's Day holiday in previous years yields the following conclusions: the traffic volume changes during the New Year's Day holiday each year exhibit clear regularity, and the consistency of the change patterns in adjacent years is relatively strong. In addition, the change patterns in the last two years differ somewhat from those of previous years; with the development of the social economy, the total traffic volume during the holiday period is increasing.
[0107] Except for the special case of 2020, which only lasted one day, the New Year's Day holiday is generally three days long. We will collect the hourly traffic flow of passenger vehicles entering the city on the first, second, and third days of the New Year's Day holiday, as well as the total traffic flow of passenger vehicles entering the city on each day. We will calculate the percentage of the hourly traffic flow of passenger vehicles entering the city on each day to the total traffic flow of passenger vehicles on that day (hereinafter referred to as the "hourly traffic flow percentage" of passenger vehicles entering the city). We will also collect the average daily traffic flow of passenger vehicles entering the city during the New Year's Day holiday in each year.
[0108] Analyzing the changes in the average daily traffic flow of passenger vehicles entering the country during the New Year's Day holiday in each year, the following conclusions can be drawn: The changing patterns of the hourly traffic flow ratio of passenger vehicles on each day of the holiday are different. Specifically, on the first day, the traffic flow during the morning peak is significantly higher than that during the afternoon peak; on the second day, the traffic flow during the morning and afternoon peaks is basically the same; and on the third day, the traffic flow during the afternoon peak is significantly higher than that during the morning peak. Although the total traffic flow on each day of the holiday is different in each year, the hourly traffic flow ratio on each day of the holiday is similar, and the similarity is higher in adjacent years.
[0109] 3. Analysis of historical truck traffic flow data:
[0110] Similar to passenger cars, we also analyzed the hourly traffic flow of trucks during the New Year's Day holiday in previous years. Due to missing data from 2017 to 2020, we only analyzed the data from 2021 to 2022. We can see that the changes in the hourly traffic flow of trucks entering the city during the New Year's Day holiday in 2021 and 2022 are similar, and the daily traffic flow shows an increasing trend. The overall truck traffic flow in 2022 also increased compared to 2021.
[0111] Similar to passenger cars, we statistically analyzed the average daily traffic flow of incoming freight trucks during the New Year's Day holiday each year. We also analyzed the hourly traffic flow and total traffic flow of incoming freight trucks on the first, second, and third days of the holiday. We calculated the percentage of the hourly traffic flow of incoming freight trucks to the total traffic flow of freight trucks on each day (hereinafter referred to as the "hourly traffic flow percentage" of incoming freight trucks). The results show that the changing patterns of the hourly traffic flow percentage of freight trucks during the holiday are similar. Unlike passenger cars, freight truck traffic flow shows only one peak each day, mainly concentrated in the morning to afternoon. Although the total traffic flow varies from year to year during the holiday, the hourly traffic flow percentages are similar, with a higher similarity between adjacent years.
[0112] 4. Analysis of historical traffic flow data for special-purpose vehicles:
[0113] Due to the special purpose of special-purpose vehicles, there is no obvious pattern to the daily traffic flow. At the same time, the traffic flow of special-purpose vehicles is much less than that of passenger cars and freight cars, with a difference of orders of magnitude. Therefore, the impact on the prediction of overall traffic flow is very small. So, we will not analyze the regular characteristics of special-purpose vehicles here.
[0114] Analysis Conclusion
[0115] The above analysis, using historical traffic flow data at toll station entrances during the New Year's Day holiday in a certain province as an example, and based on extensive analysis of historical holiday traffic flow data at toll stations, leads to the following conclusions:
[0116] 1. The traffic flow patterns at toll station entrances and exits differ;
[0117] 2. Traffic flow patterns differ across different holidays;
[0118] 3. Different vehicle types exhibit different characteristics in terms of traffic flow changes;
[0119] 4. The traffic flow patterns for the same holiday are similar year by year;
[0120] 5. Overall traffic volume increases every year for the same holiday.
[0121] Based on the five conclusions summarized above, we can perform the following quantitative analysis and calculation of traffic flow at toll stations across the province during a certain holiday, distinguishing between exits / entrances and different vehicle types. Here, we still take the passenger vehicle traffic flow at toll station entrances in a certain province during the New Year's Day holiday as an example, and present the quantitative analysis and calculation process:
[0122] Select a base year. The base year should be a year that is close to the current year and whose traffic flow characteristics have not changed abruptly. This is to ensure a stable change in overall traffic flow. Here, 2021 can be selected as the base year.
[0123] Calculate the number of days in the holiday, denoted as N. For example, for New Year's Day, N = 3.
[0124] Calculate the average daily passenger vehicle traffic volume during the holiday period in the baseline year, denoted as S;
[0125] Calculate the growth rate of the average daily passenger vehicle traffic volume during the holiday period of the year before the base year compared to S, and denote this growth rate as the annual growth rate, denoted as A;
[0126] Calculate the growth rate of the average daily passenger vehicle traffic volume in the week before the holiday in the base year compared to S, and denote this growth rate as the weekly growth rate, denoted as B;
[0127] Calculate the proportion of passenger vehicle traffic on each day during the holiday period, denoted as d. For example: d = [1.15:1:1.05];
[0128] The proportion of passenger vehicle traffic volume in each hourly segment during the holiday period of the baseline year to the total passenger vehicle traffic volume on that day is denoted as γ. i ;
[0129] This embodiment provides a first traffic flow prediction formula. After calculating the values of the above parameters, substituting each parameter into the formula, the predicted value of passenger vehicle traffic flow for the h-th hour of the i-th day of a certain holiday can be obtained through calculation. The parameters defined in this embodiment, their descriptions, and their value ranges are shown in Table 1.
[0130] Table 1
[0131]
[0132] By calculating a series of parameters provided in this patent and substituting these parameters into the first traffic flow prediction formula, the predicted hourly traffic flow for a specific vehicle type at toll station entrances (or exits) throughout the province during a holiday period can be obtained. Furthermore, the predicted hourly traffic flow for each vehicle type during the holiday period can be calculated. By flexibly combining the above-mentioned prediction results, a reference can be provided for provincial highway management departments to issue highway travel guidelines in advance for holidays.
[0133] In some embodiments, a grid search method is used to iteratively update the annual growth rate confidence weight α and the weekly growth rate confidence weight β to obtain a set of optimal weights; specifically, this may include:
[0134] S301. Obtain the actual traffic flow for a preset verification time period, where the verification time period is a time period in the base year and / or a time period in the current year.
[0135] The verification period can be either the base year or the current year. It can include the same or different holiday periods. An optimal weight set can be determined using a single verification period or multiple verification periods. The optimal weight combination used in the first traffic flow prediction formula can be the same or different when calculating different target time periods, depending on the specific circumstances. For example, if the target time period is a weekend (or other statutory holidays, such as Labor Day or Dragon Boat Festival), and the prediction is for the traffic flow on the 33rd weekend of 2022 (current year is 2022), then the prediction period can be one or more weekends that have already passed in the current year (such as the 20th, 19th, and 20th weekends), the 33rd weekend of the base year, or a combination of both. The same principle applies if the weekend is replaced with holidays like Labor Day or Dragon Boat Festival. In principle, if multiple prediction time periods are selected to determine the optimal weights, the difference between the optimal weights for each prediction time period is likely to be small. If the difference is large, the optimal weights with larger differences should be eliminated first. Then, the final optimal weights are determined based on the remaining optimal weights. Specifically, the median of the larger values of α and β, or the average of the larger values of α and β, etc., can be taken, depending on the specific circumstances. This will not be elaborated further here. Once one of α and β is determined, the other is naturally determined as well.
[0136] Of course, in addition to the grid search method, in some specific application scenarios, the confidence weights α for annual growth rate and β for weekly growth rate are empirical values determined based on experience. In principle, the confidence weight β for weekly growth rate is not less than the confidence weight α for annual growth rate.
[0137] S302. Divide the annual growth rate confidence weight and weekly growth rate confidence weight in the first flow prediction formula into multiple parts according to a minimum of 0 and a maximum of 1.
[0138] S303, Confidence weights of annual growth rate and weekly growth rate of cyclic combination, calculate the prediction results of traffic flow for the verification period under each weight combination according to the first traffic flow prediction formula;
[0139] S304. Determine the average absolute percentage error between the traffic flow prediction results and the actual traffic flow during the verification period.
[0140] S305. Select the combination of annual growth rate confidence weights and weekly growth rate confidence weights with the smallest average absolute percentage error as the annual growth rate confidence weights and weekly growth rate confidence weights of the first flow prediction formula.
[0141] By treating the exit and entrance traffic volumes of all toll stations in the province as separate entities, and taking into account the traffic flow characteristics of different vehicle types during holidays, as well as influencing factors such as weather and unforeseen circumstances, relatively accurate prediction results were obtained for the entrance and exit traffic volumes of different vehicle types during holidays.
[0142] In some embodiments, step S30 above may include:
[0143] Based on historical data, the hourly traffic flow forecast for the target area during the target time period is determined using a pre-configured second traffic flow forecast formula. The expression for the second traffic flow forecast formula is as follows:
[0144]
[0145] In the formula, F i,h This represents the traffic flow forecast for any hour on any day within the target time period.
[0146] f w f e and f y These are meteorological factors, planned event factors, and accidental factors;
[0147] S represents the average daily traffic volume over a historical period;
[0148] N represents the number of days in the target time period;
[0149] d i This indicates the proportion of traffic flow on each day within a historical time period;
[0150] r i,h This indicates the proportion of traffic flow in each hour of each day within a historical time period.
[0151] A represents the annual growth rate;
[0152] B represents the weekly growth rate;
[0153] α and β represent the weights of the annual growth rate and the weekly growth rate, respectively.
[0154] This embodiment also considers the impact of certain special factors on traffic flow changes, including: meteorological factors, planned event factors, and accidental factors (such as emergencies). The specific values of these special factors can be set based on empirical values. The parameter definitions of these factors are shown in Table 2.
[0155] Table 2
[0156] Parameter description, data type, value range f w Meteorological Influence Factor FLOAT[0,1]f e Planned event impact factor FLOAT[0,1]f y The impact factor of random events is FLOAT[0,1]. surface
[0157] The accuracy of the prediction results was verified using the method provided by this invention. Specifically, the total traffic flow, passenger vehicle flow, and freight vehicle flow at all toll station entrances in a certain province during the 2022 Dragon Boat Festival were predicted, and the prediction results were verified using actual traffic flow. MAPE (Mean Absolute Percentage Error) was used as the error index to calculate the prediction error of the hourly traffic flow during the festival. According to the verification results, the errors of the prediction results remained within 5%, indicating small errors and good prediction accuracy.
[0158] As can be seen from the above scheme, by treating the exit traffic flow and entrance traffic flow of all toll stations in the province as a whole, and taking into account the traffic flow characteristics of different vehicle types during holidays, as well as weather factors and unforeseen circumstances, the scheme predicts the entrance and exit traffic flow of different vehicle types during holidays. This yields relatively accurate prediction results and provides a reference for provincial highway management departments to issue highway travel guidelines during holidays.
[0159] As can be seen, compared with existing methods for predicting traffic flow at highway toll stations during holidays, the method disclosed in this invention can quickly predict macro traffic flow during holidays with less historical data required and without a complex model training process. The prediction method is more reasonable, and the prediction results have better stability and accuracy.
[0160] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0161] In one embodiment, a traffic flow prediction device is provided, which corresponds one-to-one with the traffic flow prediction method in the above embodiments. As shown in Figure 6, the traffic flow prediction device includes a base year determination unit 101, a historical data determination unit 102, and a prediction result output unit 103. Detailed descriptions of each functional module are as follows:
[0162] The base year determination unit 101 is used to determine the base year based on the historical traffic flow data of the target area, wherein the base year is the year preceding the current year;
[0163] The historical data determination unit 102 is used to determine the target historical data for traffic flow prediction based on historical traffic flow data, according to the base year and the target time period. The target historical data includes: the average daily traffic flow of the historical time period of the base year, the annual growth rate of the traffic flow of the historical time period of the base year relative to the previous year, the weekly growth rate of the traffic flow of the historical time period of the base year relative to the previous week, the traffic flow ratio of each day of the historical time period of the base year, and the traffic flow ratio of each hour of each day of the historical time period of the base year. The historical time period refers to the time period in the base year that corresponds to the target time period.
[0164] The prediction result output unit 103 is used to determine the predicted traffic flow for each hour of the target area during the target time period based on the target's historical data.
[0165] In one embodiment, the historical data determination unit 102 is specifically used for:
[0166] Historical traffic flow data is grouped according to preset vehicle type classification rules;
[0167] Target historical data for traffic flow prediction of the same type of vehicle is determined by using historical traffic flow data from each group.
[0168] In one embodiment, the historical data determination unit 102 is specifically used for:
[0169] Determine the average daily traffic volume for the first historical time period;
[0170] Determine the average daily traffic volume of the second day of the previous week in the historical time period;
[0171] Determine the average daily traffic volume on the third day of the period corresponding to the historical time period in the year preceding the base year;
[0172] The weekly growth rate is determined based on the average traffic flow on the first day and the average traffic flow on the second day.
[0173] The annual growth rate is determined based on the average traffic flow on the first day and the average traffic flow on the third day.
[0174] In one embodiment, the prediction result output unit 103 is specifically used for:
[0175] Based on historical data, determine the predicted hourly traffic flow for the target area during the target time period, including:
[0176] Based on historical data, the hourly traffic flow forecast for the target area during the target time period is determined using a pre-configured first traffic flow prediction formula. The expression for the first traffic flow prediction formula is as follows:
[0177]
[0178] In the formula, F i,h This represents the traffic flow forecast for any hour on any day within the target time period.
[0179] S represents the average daily traffic volume over a historical period;
[0180] N represents the number of days in the target time period;
[0181] d i This indicates the proportion of traffic flow on each day within a historical time period;
[0182] r i,h This indicates the proportion of traffic flow in each hour of each day within a historical time period.
[0183] A represents the annual growth rate;
[0184] B represents the weekly growth rate;
[0185] α and β represent the confidence weights for the annual growth rate and the weekly growth rate, respectively;
[0186] n represents the year difference between the base year and the current year.
[0187] In one embodiment, the prediction result output unit 103 is further specifically used for:
[0188] Obtain the actual traffic flow for a preset verification period, which is a period in the base year and / or a period in the current year;
[0189] The confidence weights for the annual growth rate and the weekly growth rate in the first flow prediction formula are each divided into multiple parts according to a minimum of 0 and a maximum of 1.
[0190] The confidence weights of the annual growth rate and the weekly growth rate are combined in a cyclical combination. Based on the first traffic flow prediction formula, the predicted traffic flow for the verification period under each weight combination is calculated.
[0191] Determine the average absolute percentage error between the traffic flow forecast results and the actual traffic flow during the verification period;
[0192] The combination of annual growth rate confidence weights and weekly growth rate confidence weights with the smallest average absolute percentage error is selected as the annual growth rate confidence weights and weekly growth rate confidence weights for the first flow prediction formula.
[0193] In one embodiment, the prediction result output unit 103 is specifically used for:
[0194] Based on historical data, the hourly traffic flow forecast for the target area during the target time period is determined using a pre-configured second traffic flow forecast formula. The expression for the second traffic flow forecast formula is as follows:
[0195]
[0196] In the formula, F i,h This represents the traffic flow forecast for any hour on any day within the target time period.
[0197] f w f e and f y These are meteorological factors, planned event factors, and accidental factors;
[0198] S represents the average daily traffic volume over a historical period;
[0199] N represents the number of days in the target time period;
[0200] d i This indicates the proportion of traffic flow on each day within a historical time period;
[0201] r i,h This indicates the proportion of traffic flow in each hour of each day within a historical time period.
[0202] A represents the annual growth rate;
[0203] B represents the weekly growth rate;
[0204] α and β represent the weights of the annual growth rate and the weekly growth rate, respectively.
[0205] This invention provides a traffic flow prediction device. Compared with existing methods for predicting traffic flow at highway toll stations during holidays, the method disclosed in this invention can predict the traffic flow at toll stations throughout the province quickly and efficiently during holidays with less historical data required and without a complex model training process. The prediction method is more reasonable, and the prediction results have better stability and accuracy.
[0206] Specific limitations regarding the traffic flow prediction device can be found in the limitations of the traffic flow prediction method described above, and will not be repeated here. Each module in the aforementioned traffic flow prediction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0207] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram is shown in Figure 7. The computer device includes a processor, memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a traffic flow prediction method on the server side.
[0208] In one embodiment, a computer device is provided, which can be a client, and its internal structure diagram is shown in Figure 8. The computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a traffic flow prediction method on the client side.
[0209] In one embodiment, a computer device is provided for predicting traffic flow in a target area during a target time period of the current year, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0210] The base year is determined based on historical traffic flow data of the target area, where the base year is the year preceding the current year.
[0211] Based on the base year and the target time period, target historical data for traffic flow forecasting is determined using historical traffic flow data. The target historical data includes: the average daily traffic flow for the historical time period, the annual growth rate of traffic flow for the historical time period relative to the year before the base year, the weekly growth rate of traffic flow for the historical time period relative to the week before the historical time period, the proportion of traffic flow for each day of the historical time period, and the proportion of traffic flow for each hour of each day of the historical time period. The historical time period refers to the time period in the base year that corresponds to the target time period.
[0212] Based on historical data of the target area, determine the predicted traffic flow for each hour of the day for the target time period.
[0213] In one embodiment, a computer-readable storage medium is provided for predicting traffic flow in a target area during a target time period of the current year, and a computer program is stored thereon that, when executed by a processor, performs the following steps:
[0214] The base year is determined based on historical traffic flow data of the target area, where the base year is the year preceding the current year.
[0215] Based on the base year and the target time period, target historical data for traffic flow forecasting is determined using historical traffic flow data. The target historical data includes: the average daily traffic flow for the historical time period, the annual growth rate of traffic flow for the historical time period relative to the year before the base year, the weekly growth rate of traffic flow for the historical time period relative to the week before the historical time period, the proportion of traffic flow for each day of the historical time period, and the proportion of traffic flow for each hour of each day of the historical time period. The historical time period refers to the time period in the base year that corresponds to the target time period.
[0216] Based on historical data of the target area, determine the predicted traffic flow for each hour of the day for the target time period.
[0217] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0218] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0219] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0220] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A traffic flow prediction method for predicting traffic flow in a target area during a target time period of the current year, characterized in that, The prediction method includes: determining a base year based on historical traffic flow data of the target area, wherein the base year is a year preceding the current year; determining target historical data for traffic flow prediction based on the base year and the target time period using the historical traffic flow data; wherein the target historical data includes: the average daily traffic flow of the historical time period, the annual growth rate of traffic flow of the historical time period relative to the year preceding the base year, the weekly growth rate of traffic flow of the historical time period relative to the week preceding the historical time period, the traffic flow ratio of each day in the historical time period, and the traffic flow ratio of each hour in each day of the historical time period; the historical time period refers to the time period in the base year corresponding to the target time period; determining the predicted hourly traffic flow for each day of the target time period in the target area based on the target historical data; the step of determining the predicted hourly traffic flow for each day of the target time period in the target area based on the target historical data includes: determining the predicted hourly traffic flow for each day of the target time period in the target area based on the target historical data using a pre-configured first traffic flow prediction formula; wherein the expression of the first traffic flow prediction formula is: In the formula, This represents the traffic flow prediction result for any hour on any day within the target time period; This represents the average daily traffic volume during the historical period. Indicates the number of days in the target time period; This indicates the proportion of traffic flow on each day within the historical time period. This indicates the proportion of traffic flow in each hour of each day during the historical time period. This represents the annual growth rate; This represents the weekly growth rate; and These represent the confidence weights of the annual growth rate and the weekly growth rate, respectively; n represents the year difference between the base year and the current year.
2. The traffic flow prediction method as described in claim 1, characterized in that, The step of determining the target historical data for traffic flow prediction using the historical traffic flow data includes: grouping the historical traffic flow data according to a preset vehicle type classification rule, and grouping the historical traffic flow data of the same type of vehicle into one group; for each type of vehicle, determining the target historical data of the same type of vehicle by using a group of historical traffic flow data corresponding to the same type of vehicle.
3. The traffic flow prediction method as described in claim 1, characterized in that, The step of determining the target historical data for traffic flow prediction using the historical traffic flow data includes: determining the first average daily traffic flow for the historical time period; determining the second average daily traffic flow for the week preceding the historical time period; determining the third average daily traffic flow for the period corresponding to the historical time period in the year preceding the base year; determining the weekly growth rate based on the first average daily traffic flow and the second average daily traffic flow; and determining the annual growth rate based on the first average daily traffic flow and the third average daily traffic flow.
4. The traffic flow prediction method as described in claim 1, characterized in that, The prediction method further includes: obtaining the actual traffic flow for a preset verification period, wherein the verification period is a time period in the base year and / or a time period in the current year; dividing the annual growth rate confidence weight and weekly growth rate confidence weight in the first traffic flow prediction formula into multiple parts according to a minimum of 0 and a maximum of 1; cyclically combining the annual growth rate confidence weight and the weekly growth rate confidence weight, and calculating the prediction result of the traffic flow for the verification period under each weight combination according to the first traffic flow prediction formula; determining the average absolute percentage error between the traffic flow prediction result for the verification period and the actual traffic flow for the verification period; and selecting the combination of annual growth rate confidence weights and weekly growth rate confidence weights with the smallest average absolute percentage error as the annual growth rate confidence weight and weekly growth rate confidence weight of the first traffic flow prediction formula.
5. The traffic flow prediction method as described in claim 1, characterized in that, The step of determining the hourly traffic flow prediction results for the target area during the target time period based on the target historical data includes: determining the hourly traffic flow prediction results for the target area during the target time period based on the target historical data using a pre-configured second traffic flow prediction formula; wherein the expression of the second traffic flow prediction formula is: In the formula, This represents the traffic flow prediction result for any hour on any day within the target time period; 、 and These are meteorological factors, planned event factors, and accidental factors; This represents the average daily traffic volume during the historical period. Indicates the number of days in the target time period; This indicates the proportion of traffic flow on each day within the historical time period. This indicates the proportion of traffic flow in each hour of each day during the historical time period. This represents the annual growth rate; This represents the weekly growth rate; and These represent the weights of the annual growth rate and the weekly growth rate, respectively; n represents the year difference between the base year and the current year.
6. The traffic flow prediction method as described in claim 1, characterized in that, The target time period is during statutory holidays; the base year is the year preceding the current year.
7. A traffic flow prediction device, characterized in that, The prediction device is used to predict traffic flow in a target area for a target time period in the current year. The prediction device includes: a base year determination unit, used to determine a base year based on historical traffic flow data of the target area, wherein the base year is a year preceding the current year; and a historical data determination unit, used to determine target historical data for traffic flow prediction based on the base year and the target time period, using the historical traffic flow data; wherein the target historical data includes: the average daily traffic flow of the historical time period of the base year, the annual growth rate of the traffic flow of the historical time period of the base year relative to the year preceding the base year, the weekly growth rate of the traffic flow of the historical time period of the base year relative to the week preceding the historical time period, and the base year's average daily traffic flow. The traffic flow ratio for each day of the historical time period in the year and the traffic flow ratio for each hour of each day of the historical time period in the base year; the historical time period refers to the time period in the base year corresponding to the target time period; the prediction result output unit is used to determine the predicted traffic flow for each hour of each day of the target time period in the target area based on the target historical data; the step of determining the predicted traffic flow for each hour of each day of the target time period in the target area based on the target historical data includes: determining the predicted traffic flow for each hour of each day of the target time period in the target area based on the target historical data using a pre-configured first traffic flow prediction formula; wherein, the expression of the first traffic flow prediction formula is: In the formula, This represents the traffic flow prediction result for any hour on any day within the target time period; This represents the average daily traffic volume during the historical period. Indicates the number of days in the target time period; This indicates the proportion of traffic flow on each day within the historical time period. This indicates the proportion of traffic flow in each hour of each day during the historical time period. This represents the annual growth rate; This represents the weekly growth rate; and These represent the confidence weights of the annual growth rate and the weekly growth rate, respectively; n represents the year difference between the base year and the current year.
8. A computer device comprising a memory and a processor, the memory storing computer-readable instructions which, when executed by the processor, cause the processor to perform the steps of the traffic flow prediction method as claimed in any one of claims 1 to 6.
9. A storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the traffic flow prediction method as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Traffic flow prediction method and device
CN111862583A
Traffic flow prediction method based on algorithm model analysis
CN112489422A