Holiday traffic flow prediction method based on benchmark shape extraction and annual transformation parameter evolution and medium

CN122551567APending Publication Date: 2026-08-11UNIV OF SHANGHAI FOR SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-03
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

这导致历史数据在时间轴上无法直接对齐,传统时间序列模型难以直接应用,深度学习模型也因输入序列长度不一致而难以训练

Benefits of technology

(1)本发明通过先提取流量基准形状,再通过年度变换参数演化完成预测,以及在演化过程中利用基于分位截断的年度参数稳健外推方法有效规避异常样本干扰,引入留一交叉验证方法进行模型寻优,保障选出的最优基准形状函数模型泛化能力更强,从而既提升参数外推的稳定性,又强化模型泛化能力,大幅提高节假日交通流量预测结果的可靠性与精准度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551567A_ABST
    Figure CN122551567A_ABST
Patent Text Reader

Abstract

This invention relates to a method and medium for predicting holiday traffic flow based on baseline shape extraction and annual transformation parameter evolution. The method includes the following steps: obtaining the holiday schedule for each year and constructing an observation traffic flow matrix; decoupling and solving the observation traffic flow matrix to obtain a discrete baseline shape point sequence and annual transformation parameters; fitting the discrete baseline shape point sequence to establish a baseline shape function model library; predicting the final annual transformation parameters for the target year using a robust extrapolation method based on quantile truncation using the annual transformation parameters; obtaining the optimal baseline shape function model from the baseline shape function model library using leave-one-out cross-validation, and predicting holiday traffic flow based on the optimal baseline shape function model and the final annual transformation parameters for the target year. Compared with existing technologies, this invention has the advantages of significantly improving the accuracy and robustness of holiday traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic flow prediction, and in particular to a method and medium for predicting holiday traffic flow based on baseline shape extraction and annual transformation parameter evolution. Background Technology

[0002] Highways bear extremely heavy traffic pressure during holidays. According to statistics from the Ministry of Transport, the average daily traffic flow on highways during holidays is typically one to two times that of weekdays. During holidays, traffic congestion, accidents, and travel delays occur frequently, seriously impacting the safety and efficiency of public travel and placing enormous scheduling pressure on traffic management departments. Therefore, accurately predicting the daily traffic flow on highways during holidays is of significant practical importance for road network scheduling, congestion warnings, staffing, and emergency resource allocation.

[0003] Existing traffic flow prediction methods mainly include statistical time series methods such as ARIMA (e.g., patent application CN112183868A), machine learning-based methods such as random forests and gradient boosting, and deep learning-based methods such as LSTM and Prophet. These methods generally face the following technical bottlenecks when processing holiday data: (1) Calendar discrepancies. The Gregorian calendar dates corresponding to statutory holidays change every year, and the number of holiday days and the adjustment of work schedules are not fixed every year. This makes it impossible to directly align historical data on the timeline, making it difficult to apply traditional time series models directly, and deep learning models are also difficult to train due to inconsistent input sequence lengths.

[0004] (2) Small sample size and extrapolation collapse problem. For specific holidays, the effective sample size for each year is only one cycle. When using only a few years of historical data to predict future years, traditional regression methods are prone to overfitting due to abnormal fluctuations in a single year. The model's extrapolation generalization ability is extremely poor, and future predictions are prone to serious deviations, i.e., the predicted values ​​show unreasonable exponential growth or precipitous drop. Deep learning methods such as LSTM also have difficulty converging to a stable solution in such small sample scenarios.

[0005] (3) The coupling problem between shape and magnitude. The holiday traffic flow curve includes both its inherent "shape characteristics" (such as the relative positions of the outbound peak and return peak) and its "absolute magnitude" affected by factors such as the macroeconomy, oil prices, and policies of the year. Existing models have difficulty effectively decoupling these two aspects, resulting in low prediction accuracy and an inability to accurately reflect the true evolution of holiday traffic flow. Summary of the Invention

[0006] The purpose of this invention is to provide a method and medium for predicting holiday traffic flow based on baseline shape extraction and annual transformation parameter evolution, which can significantly improve the reliability and accuracy of holiday traffic flow prediction results.

[0007] The objective of this invention can be achieved through the following technical solutions: A holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution includes the following steps: Obtain the holiday schedule for each year and construct an observation flow matrix; The observed flow matrix is ​​decoupled and solved to obtain a discrete reference shape point sequence and initial annual transformation parameters; Fit the discrete reference shape point sequence to establish a reference shape function model library; Based on the initial annual transformation parameters, the final annual transformation parameters for the target year are predicted using a robust extrapolation method based on quantile truncation. The optimal baseline shape function model is obtained from the baseline shape function model library using leave-one-out cross-validation. Based on the optimal baseline shape function model and the final annual transformation parameters of the target year, the holiday traffic flow is predicted.

[0008] Furthermore, the steps for constructing the observed flow matrix include: Based on the aforementioned annual holiday schedule, Gregorian calendar dates are mapped to relative day order, wherein the annual holiday schedule includes statutory holidays, the number of days before the holiday, the number of days after the holiday, and adjusted workdays. The mapping expression for the relative day order is as follows: ; In the formula, For relative date order, subscript Used to identify the pairing relationship between any specific date and its corresponding relative date sequence. For any date, This refers to the actual start date of a holiday in a given year. Based on the relative day order, construct the historical observation flow matrix. , is represented as: ; In the formula, elements in For the first Year in relative day order Actual daily traffic flow, subscript The number of historical years, subscript This represents the number of grid cells for the relative day sequence.

[0009] Furthermore, the steps for obtaining the discrete reference shape point sequence and the initial annual transformation parameters include: Based on the observed flow matrix, a spatial transformation mode is used for decoupling to obtain the reference shape. and initial annual transformation parameters, wherein the spatial transformation mode includes one of the kb mode and the kab mode, wherein the decoupling expression of the kb mode is: ; In the formula, Relative date sequence The corresponding daily traffic flow For magnification parameters, Based on the basic shape, For constant bias; The decoupling expression for the kab mode is: ; In the formula, Linear bias; By alternately fixing the reference shape and initial annual transformation parameters By performing iterative solutions using the alternating least squares method, a discrete reference shape point sequence is obtained. , is represented as: ; In the formula, This is the baseline shape sequence after the iterative convergence of the alternating least squares method. This is an operation for calculating the arithmetic mean.

[0010] Furthermore, in the iterative solution process of the alternating least squares method, the first... The iteration process includes: Fixed number Sub-basic shape For each year By solving the least squares problem, we obtain the... The initial annual transformation parameters are taken from the historical observed flow matrices. The median sequence is used as the initial reference shape. The least squares problem is expressed as: ; In the formula, For the first Annual multiplier parameters For the first Linear bias for the year. For the first Annual constant bias. For the first Year in relative day order Actual daily traffic flow For the first The relative date sequence obtained in the next iteration The corresponding baseline shape value; Fixed number The initial annual transformation parameters for each relative day sequence By utilizing actual daily traffic flow data, the baseline shape point can be determined. The reference shape point Represented as: ; In the formula, For the first The sky contains a set of years with valid actual observations of daily traffic flow. for The average value.

[0011] Furthermore, the reference shape function model library contains various heterogeneous mathematical models, including high-order polynomial models, third-order Fourier series models, natural boundary cubic spline interpolation models, smooth cubic B-spline models, and bi-Gaussian mixture models. The construction steps for the high-order polynomial models include: relative date sequence z-score standardization is performed to obtain the standardized relative day order. , is represented as: ; In the formula, The mean of all relative day points. The standard deviation of all relative day points; Based on the standardized relative day order The higher-order polynomial model is defined as: ; In the formula, Relative date sequence The corresponding baseline shape fitting value, Let be the order of the polynomial. For the first Coefficients of a polynomial of order 1; The construction steps of the third-order Fourier series model include: Assume relative date sequence The range is Then the relative day sequence span for: ; In the formula, This represents the maximum value of the relative day sequence. This is the minimum value of the relative day sequence; Based on the range and relative day sequence span The third-order Fourier series model is defined as follows: ; In the formula, For constant terms, Let be the order of the Fourier series. and The first The coefficients of the cosine and sine terms, Pi; The construction steps of the natural boundary cubic spline interpolation model include: Let the spline nodes be ,in, It is the largest spline node in the relative day sequence; The corresponding baseline shape value is: ,in, for The corresponding baseline shape value; In any interval Within this framework, the cubic spline interpolation model for natural boundaries is defined as follows: ; In the formula, For interval The spline fitting function within, i.e., relative day sequence The corresponding baseline shape fitting value, , , , They are intervals The coefficients of the inner cubic polynomial, This is the index of the segmented sub-interval formed by adjacent spline nodes. and These are adjacent relative day sequences; The natural boundary conditions are as follows: , This represents the second derivative of the spline fitting function; The steps for constructing the smooth cubic B-spline model include: Let the cubic B-spline basis function be... The smoothed cubic B-spline model is then expressed as: ; In the formula, For the first A cubic B-spline basis function, where the subscript 3 indicates that the spline is of degree three. For the corresponding spline coefficients, The number of spline basis functions; The spline coefficients are determined by the following objective function. : ; In the formula, For the first A discrete reference shape value, Relative date sequence The corresponding baseline shape fitting value, To smooth out the penalty coefficient, for The second derivative; The double Gaussian mixture model is defined as follows: ; In the formula, The basic flow shape is horizontal and constant. and These are the amplitude parameters for the Gaussian travel peak and the Gaussian return peak, respectively. and These represent the relative daily positions of the Gaussian travel peak and the Gaussian return peak, respectively. and These are the width parameters for the Gaussian travel peak and the Gaussian return peak, respectively.

[0012] Furthermore, the prediction step for the final annual transformation parameters of the target year includes: For the magnification parameter Log-linear regression was used for fitting, and the expression for log-linear regression is: ; In the formula, For the intercept term, The slope These are the initial multiplier parameters predicted for the target year. For the target year; For linear bias and constant bias Ordinary linear regression was used for fitting, and the expression for ordinary linear regression is: ; ; In the formula, This is the initial linear bias for the target year. The initial constant bias for the target year. and The intercept is... and The slope; Extracting initial annual transformation parameters The distribution quantiles are the 10th percentiles. and 90% distribution quantile Then calculate the range ; Based on the 10% distribution quantile 90% distribution quantile And the range, setting an absolute safety boundary for robust prediction, is expressed as: ; ; In the formula, For an absolutely safe lower bound, For the upper limit of absolute safety, For dynamic expansion coefficients; Based on the aforementioned absolute safety boundary, the initial annual transformation parameters for the target year are... After making corrections, the final annual transformation parameters for the target year are obtained, where the correction expression is: ; ; ; In the formula, , , The multiplier parameter, linear bias, and constant bias for the target year constitute the final annual transformation parameters for the target year. .

[0013] Furthermore, the step of obtaining the optimal baseline shape function model includes: For the observed flow matrix , carry out Leave-one-out cross-validation, where in each leave-one-out cross-validation, a certain year is excluded. Observed flow By extracting a baseline shape function model from the observed flow rates of the remaining years and training the annual transformation parameters for the corresponding years, the model can then predict the years to be removed from the list. Fitted flow rate ; For the extracted multiple benchmark shape function models, calculate the RMSE of each benchmark shape function model under leave-one-out cross-validation and the RMSE of each benchmark shape function model under each cross-validation. The average RMSE in leave-one-out cross-validation is used, and the baseline shape function model that minimizes the average RMSE is selected as the optimal baseline shape function model for holidays. The expression for calculating RMSE is as follows: ; In the formula, The average root mean square error, The number of grid cells is relative to the day sequence. Relative date sequence The corresponding actual observed flow rate, Relative date sequence The corresponding predicted flow.

[0014] Furthermore, the step of predicting holiday traffic flow includes: Using the aforementioned optimal baseline shape function model, combined with the final annual transformation parameters for the target year. The daily predicted traffic flow for the target year during the holiday period is reconstructed using a prediction formula. The predicted daily traffic flow satisfies the physical constraint that the daily predicted traffic flow is not less than 0. , , These are the target year's multiplier parameter, linear bias, and constant bias, respectively.

[0015] Furthermore, the prediction formula includes the following two: The first type: ; The second type: ; In the formula, For the target year Daily traffic flow forecasts For relative date order, the value is [value]. , Used as the reference shape.

[0016] The present invention also provides a storage medium storing a program that, when executed, implements the holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution as described above.

[0017] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention first extracts the traffic flow baseline shape, then completes the prediction through annual transformation parameter evolution, and effectively avoids abnormal sample interference by using a robust extrapolation method of annual parameters based on quantile truncation during the evolution process. It also introduces leave-one-out cross-validation method to optimize the model, ensuring that the selected optimal baseline shape function model has stronger generalization ability. This not only improves the stability of parameter extrapolation but also strengthens the model's generalization ability, thus greatly improving the reliability and accuracy of holiday traffic flow prediction results.

[0018] (2) This invention adopts a robust extrapolation method based on annual parameters, which is well-suited to the characteristics of unstable traffic and many anomalies during holidays. By introducing a quantile truncation mechanism, the predicted value of the trend extrapolation is protected by absolute upper and lower limits, which effectively suppresses the trend overfitting caused by extreme fluctuations in individual years, solves the problem of small sample extrapolation collapse, and ensures the stability of the prediction results.

[0019] (3) This invention decouples the shape and magnitude by decomposing the holiday traffic into a baseline shape that does not change with the year and an annual transformation parameter that evolves with the year. This enables the model to independently learn the inherent morphological characteristics and annual scale changes of the traffic, significantly improving the prediction accuracy. Furthermore, the introduction of a quantile truncation mechanism suppresses extrapolation collapse under small sample conditions, effectively solving problems such as non-fixed holiday dates, few historical samples, and easy prediction collapse, and significantly improving the robustness of holiday traffic prediction.

[0020] (4) This invention uses a baseline shape function model library and a year-leave-one cross-validation mechanism to automatically select the optimal baseline shape function model for different holidays and different observation points. In particular, it significantly enhances the adaptability of the prediction method in scenarios with small samples and scarce holiday data. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 The gantry A of this invention – annual observation and fitting results for New Year's Day; Figure 3 The results of annual observation and fitting of gantry B during the Spring Festival according to the present invention; Figure 4 The gantry C of this invention is the annual observation and fitting results for the Qingming Festival; Figure 5 The gantry D of this invention is the annual observation and fitting results for Labor Day; Figure 6 The gantry E of this invention represents the annual observation and fitting results for the Dragon Boat Festival. Figure 7 The results of annual observation and fitting of the gantry F-Dragon Boat Festival of this invention. Detailed Implementation

[0022] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0023] This embodiment provides a holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution. The aim is to significantly improve the accuracy and robustness of holiday traffic flow prediction by decomposing holiday traffic flow into a baseline shape that does not change with the year and annual transformation parameters that evolve with the year, and by introducing a quantile truncation mechanism to suppress extrapolation collapse under small sample conditions. Specifically, as... Figure 1 As shown, the method includes the following steps: Step 1: Construct a relative daily coordinate system and a historical flow matrix.

[0024] Step 1-1: Map the Gregorian calendar dates to relative day order based on the holiday schedule of previous years.

[0025] In this embodiment, the holiday schedule for each year includes statutory holidays, the number of days before the holiday, the number of days after the holiday, and adjusted workdays. Let the actual start date of a holiday in a given year be defined as... For any date Its relative day order Defined as: That is, any date With start date The number of days between them.

[0026] This step replaces absolute dates with relative dates to align traffic data for the same type of holidays in different years, eliminating data misalignment caused by annual date offsets and differences in holiday duration.

[0027] Step 1-2: Extract data from multiple historical years and construct an observation flow matrix.

[0028] In this embodiment, an observation traffic matrix is ​​constructed based on the historical holiday data obtained in step 1-1. ,in, elements in Indicates the first Year in relative day order Actual daily traffic flow This indicates the number of historical years (abbreviated as "historical years"). The grid number represents the relative day order. Defined as: .

[0029] Step 2: Extract the discrete reference shape point sequence based on the alternating least squares (ALS) method.

[0030] Step 2-1: Decouple the observed flow rate into a baseline shape and annual transformation parameters.

[0031] In this embodiment, one of the following two spatial transformation modes is used for decoupling: kb mode (pure scaling + translation): ; Kab mode (introducing linear tilt distortion): ; in, Relative date sequence The corresponding daily traffic flow Based on the basic shape, For magnification parameters, For linear bias, For constant bias, These are the initial annual transformation parameters for each year. The kb model is preferred when the historical sample size is small or the linear trend between years is not significant; the kab model is preferred when there is a systematic linear shift between years, such as a long-term growth trend combined with intraday sloping.

[0032] Step 2-2: Solve the problem by alternating fixed reference shape and annual transformation parameters using the alternating least squares method, and finally extract the normalized discrete reference shape point sequence.

[0033] In this embodiment, the historical observed flow matrix is ​​first obtained. The median sequence as the initial Then iterate again, until the 1st... Taking the next iteration as an example: (1) Fixed number Sub-basic shape Solve the first... Initial annual transformation parameters for each year: Solve the least squares problem: ; In the formula, For the first Annual multiplier parameters For the first Linear bias for the year. For the first Annual constant bias. For the first Year in relative day order Actual daily traffic flow For the first The relative date sequence obtained in the next iteration The corresponding baseline shape value; (2) Fixed number The initial annual transformation parameters are updated. For each relative day sequence By utilizing all valid daily traffic flow observations, the baseline shape point is determined inversely. : ; in, For the first The sky contains a set of years with valid actual observations of daily traffic flow. for The average value. After the iteration converges, the mean of the reference shape points is normalized (the mean is approximately 1): , For discrete reference shape point sequences, This is the baseline shape sequence after the iterative convergence of the alternating least squares method.

[0034] This step uses alternating least squares to decompose the normalized flow matrix, accurately removing noise and random fluctuations, and efficiently extracting the common change patterns of holiday flow. Compared with conventional methods such as mean and simple clustering, the extracted baseline shape is closer to the actual flow evolution pattern, and the shape fitting accuracy is higher.

[0035] Step 3: Multi-model mathematical expression of the baseline shape and construction of the baseline shape function model library.

[0036] Multiple mathematical models are used to fit discrete reference shape point sequences, and a reference shape function model library is established.

[0037] The established baseline shape function model library includes five heterogeneous mathematical models: Model A: High-order polynomial model; To prevent Runge's phenomenon and singularity of numerical matrices caused by high-order polynomials, z-score normalization is introduced: ; in, For relative date order, The mean of all relative day points. The standard deviation of all relative day points, This refers to the standardized relative day sequence variable.

[0038] The higher-order polynomial model is defined as: ; in, Relative date sequence The corresponding baseline shape fitting value, Let be the order of the polynomial. For the first Polynomial coefficients of order 1. Based on historical flow patterns of different holidays and different gantry structures, You can choose five, six, or other preset orders.

[0039] Model B: Third-order Fourier series model; The third-order Fourier series model is used to characterize the periodic or fluctuating changes in traffic flow curves before and after holidays. Let the relative daily range be... The sequence span is: ; in, This represents the maximum value of the relative day sequence. This is the minimum value of the relative day sequence. This refers to the relative day sequence span.

[0040] The third-order Fourier series model is defined as: ; in, Relative date sequence The corresponding baseline shape fitting value, For constant terms, Let be the order of the Fourier series. and The first The coefficients of the cosine and sine terms, Pi. In the third-order Fourier model It can express the low-frequency and medium-frequency fluctuation characteristics of traffic flow curves before and after holidays.

[0041] Model C: Natural boundary cubic spline interpolation model; The natural boundary cubic spline interpolation model is used to construct a piecewise cubic function between adjacent relative day points, ensuring the fitted curve remains continuous and smooth at each node. Let the spline nodes be: ; in, It is the largest spline node in the relative day sequence; The corresponding baseline shape value is: ; in, for The corresponding baseline shape value; In any interval Within this model, the cubic spline function (natural boundary cubic spline interpolation model) is defined as: ; in, For interval spline fitting function within, and For two adjacent relative day sequences, , , , These are the coefficients of the cubic polynomial within that interval. It is the index of the segmented sub-interval formed by adjacent spline nodes.

[0042] The natural boundary conditions are: ; in, This represents the second derivative of the spline fitting function. This condition indicates that the curvature of the curve is zero at both ends, thereby reducing abnormal oscillations at the boundaries.

[0043] Model D: Smoothed cubic B-spline model; This model is used to suppress local anomalous fluctuations while fitting a baseline shape sequence. Let the cubic B-spline basis function be... Then the smoothed spline function (smoothed cubic B-spline model) can be expressed as: ; in, Relative date sequence The corresponding baseline shape fitting value, For the first A cubic B-spline basis function, where the subscript 3 indicates that the spline is of degree three. For the corresponding spline coefficients, denoted as the number of spline basis functions.

[0044] Smoothing cubic B-splines involves determining the spline coefficients using the following objective function. : ; in, The first one obtained in step 2 A discrete reference shape value, This represents the fitted value of the model at this relative day point. To smooth out the penalty coefficient, For the fitting function The second derivative. The first term controls the fitting error, and the second term controls the curvature of the curve. When When the value is larger, the curve is smoother; when When the value is smaller, the curve is closer to the original discrete point.

[0045] Model E: Bigaussian mixture model; The double Gaussian mixture model is used to characterize the bimodal structure of travel peaks and return peaks that may occur during holidays. The double Gaussian mixture model is defined as follows: ; in, Relative date sequence The corresponding baseline shape fitting value, The basic flow shape is horizontal and constant. and These are the amplitude parameters of the two Gaussian peaks. and These represent the relative diurnal positions corresponding to the two Gaussian peaks. and These are the width parameters of the two Gaussian peaks. Typically, one Gaussian peak can be used to depict the travel peak before or at the beginning of a holiday, while the other Gaussian peak can be used to depict the return travel peak at the end of the holiday or after the holiday.

[0046] Step 4: Predict annual transformation parameters based on quantile truncation.

[0047] Step 4-1: Use log-linear or linear trend extrapolation to predict the initial annual transformation parameters for the target year.

[0048] In this embodiment, for non-negative magnification parameters Log-linear regression was used for fitting: ; In the formula, For the intercept term, The slope These are the initial multiplier parameters predicted for the target year. For the target year; For linear bias and constant bias Ordinary linear regression was used for fitting: ; ; In the formula, This is the initial linear bias for the target year. The initial constant bias for the target year. and The intercept is... and The slope For the target year.

[0049] The robust extrapolation mechanism for annual transformation parameters introduced in this step is specifically adapted to the characteristics of unstable traffic and numerous anomalies during holidays.

[0050] Step 4-2: Extract the initial annual transformation parameter distribution quantiles of each year, set the dynamic expansion coefficient, perform "quantile truncation" protection on the predicted values ​​of the trend extrapolation with absolute upper and lower limits, and output the final annual transformation parameters of the target year.

[0051] In this embodiment, if the target year is used directly Initial magnification parameters When an extreme low occurs in a given year, the slope of the linear regression... This could be extremely large, leading to errors of tens of thousands of percent when extrapolated to the following year. Therefore, initial transformation parameters from historical years are extracted. 10% and 90% quantiles and Calculate the range .

[0052] Define the absolute safety margin for robust forecasting: ; ; In the formula, For an absolutely safe lower bound, For the upper limit of absolute safety, For dynamic expansion coefficients; The final target year parameter is revised as follows: ; ; ; In the formula, , , These are the multiplier parameter, linear offset, and constant offset of the target year after quantile truncation protection, which together constitute the final annual transformation parameters of the target year. , For the target year.

[0053] This mechanism ensures that the system can both capture the growth trend of traffic and possess the "robustness" to resist abnormal changes in individual years. If there are fewer than four historical year samples, it directly degenerates into historical median prediction, thereby completely cutting off the spread of erroneous trends.

[0054] Step 5: Optimize the optimal baseline shape function model based on leave-one-out cross-validation (LOOCV).

[0055] Step 5-1: Based on historical years, conduct annual leave-one cross-validation evaluation. In each leave-one cross-validation, use the data of the remaining years to predict the parameters of the excluded years through step 4, and combine with step 3 to reconstruct the flow curve.

[0056] In this embodiment, the observed flow matrix for historical years is considered. , carry out Leave-one-out cross-validation, in each leave-one-out cross-validation, removes a certain year (e.g., year). ) observed flow By using the observed flow rates of the remaining years, a baseline shape function model is extracted from the baseline shape function model library and a parameter prediction model is trained to predict the years to be removed. Fitted flow rate .

[0057] Step 5-2: Calculate the root mean square error (RMSE) of each model under leave-one cross-validation and the average root mean square error of each model under each cross-validation step. The average RMSE in leave-one-out cross-validation is used to select the model with the smallest average RMSE as the optimal baseline shape function model for that holiday.

[0058] In this embodiment, RMSE is calculated as a performance evaluation metric: ; Comparing the average RMSE of the five mathematical models under leave-one-out validation across all years, the mathematical model with the smallest error was selected as the optimal baseline shape function model for that holiday. The number of grid cells is relative to the day sequence. Relative date sequence The corresponding actual observed flow rate, Relative date sequence The corresponding predicted flow.

[0059] This step specifically uses leave-one-out cross-validation to optimize the model, making it suitable for scenarios with small samples and scarce data during holidays.

[0060] Step 6: Future traffic reconstruction and output.

[0061] In this embodiment, the final reference shape is extracted using all historical data. The final annual transformation parameters for the target year are obtained by applying robust parameter prediction methods. By mapping the annual holiday and "adjusted workday" schedule back to the Gregorian calendar, the final predicted traffic flow is generated: ; or ; Physical constraints are imposed: the predicted value cannot be less than 0 and is limited by the dynamic multiple limit of the historical maximum observed extreme value (such as a 3-fold limit) to ensure the absolute stability of engineering applications.

[0062] The first prediction formula is used when the historical sample size is small or the linear trend between years is not significant, while the second prediction formula is used when there is a systematic linear shift between years.

[0063] This embodiment also uses historical daily traffic flow data from gantries on highways A and B as application objects to effectively verify the above prediction method. The data used includes fields such as gantry number, date, traffic volume, holiday type, and holiday / pre-holiday markers. The data time range is from December 29, 2021 to October 10, 2025, covering the traffic flow changes before and after multiple statutory holidays from 2022 to 2025.

[0064] This embodiment uses daily traffic flow on highway gantries before and after holidays as the modeling object. It identifies historical windows corresponding to different holidays, constructs a relative daily coordinate system with the first day of the holiday as the zero point, and employs multiple candidate functions to express the benchmark shape of holiday traffic flow. For simplified demonstration, this embodiment selects six sets of gantry data as typical cases for prediction, covering six function expressions.

[0065] The raw data consists of gantry data from Highway A, gantry data from Highway B, and a combined table of holiday markers from both highways. The gantry-level data has undergone rule cleaning, deduplication, and holiday marker processing. Both highways have continuous gantry flow observation records before and after holidays. To reflect the scale of the application, the number of records, gantry counts, date counts, and flow volume for both highways were statistically analyzed, and the results are shown in Table 1.

[0066] Table 1. Target audience and sample size; According to step 1 of this embodiment of the invention, firstly, the continuous holiday intervals of target holidays for each year are identified based on the holiday type field, and the first day of the holiday is taken as the relative date zero point, denoted as... Dates consecutively marked as "before the holiday" before the first day of the holiday are mapped to a negative relative date sequence, while dates consecutively marked as "after the holiday" after the last day of the holiday are mapped to a positive relative date sequence. When dates are not consecutive, stage labels are interrupted, or there is no valid observation data, forward or backward expansion stops. The modeling fields and their meanings are shown in Table 2.

[0067] Table 2. Modeling fields and their meanings; According to steps 2 to 5 of the present invention, the alternating least squares method is performed on the historical flow matrix to extract the normalized baseline shape sequence; then, candidate functions are fitted using a high-order polynomial model, a third-order Fourier series model, a natural boundary cubic spline interpolation model, a smooth cubic spline model, and a double Gaussian mixture model, respectively, and the optimal baseline shape function model is selected based on the RMSE of leave-one-out cross-validation.

[0068] This embodiment predicts data from six sets of gantry data. All six results use the KAB model, i.e., the annual curve generation formula is: ; in, For the target year The magnification parameter, Linear bias for the target year. This is a constant bias for the target year. Typical results are summarized in Table 3.

[0069] Table 3 Summary of typical superior results; The reference shape function expressions corresponding to each typical result are as follows: 1. Gantry A: New Year's Day (Third-order Fourier): ; 2. Gantry B: Spring Festival (smooth cubic spline): ; 3. Gantry C: Qingming Festival (Fifth-degree polynomial): ; 4. Gantry D: Labor Day (cubic spline interpolation): ; 5. Gantry E: Dragon Boat Festival (sixth degree polynomial): ; 6. Gantry F: Dragon Boat Festival (Double Gaussian Mixture): ; Figures 2 to 7 The annual observation and fitting results of traffic flow for each gantry are displayed separately. Solid lines represent the observed traffic flow for each year, while dashed lines represent the fitted traffic flow reconstructed from the optimal baseline shape function and annual transformation parameters.

[0070] From Table 3 and Figure 2 As can be seen, in the New Year's Day case, the optimal function for gantry A is a third-order Fourier model. This model can characterize the fluctuation characteristics of flow before and after New Year's Day through sine and cosine terms, and is suitable for expressing flow changes with periodic fluctuations within a short holiday window.

[0071] From Table 3 and Figure 3 As can be seen, in the Spring Festival case, the optimal function for gantry B is the smoothed cubic spline model. The Spring Festival holiday is relatively long, and the pre-holiday travel, mid-holiday fluctuations, and post-holiday return journeys are quite complex. Smoothed cubic splines can suppress local abnormal fluctuations while ensuring curve continuity, making them suitable for expressing long holiday traffic flow curves.

[0072] From Table 3 and Figure 4As can be seen, in the Qingming Festival case, the optimal function for gantry C is a fifth-degree polynomial. This function can characterize the continuous nonlinear changes between the pre-festival, holiday, and post-festival periods, reflecting the overall trend and local changes of the flow curve before and after the holiday.

[0073] From Table 3 and Figure 5 As can be seen, in the Labor Day case, the optimal function for gantry D is cubic spline interpolation. This function can effectively describe the local changes within the Labor Day window, such as the pre-holiday travel peak, the mid-holiday decline, and the post-holiday return peak, and is suitable for expressing short-term curves with significant traffic fluctuations during the holiday.

[0074] From Table 3 and Figure 6 As can be seen, in the Dragon Boat Festival case, the optimal function for gantry E is a sixth-order polynomial. This function can fit the relatively flat but locally fluctuating flow pattern before and after the Dragon Boat Festival, indicating that higher-order polynomials have a better expressive ability for the Dragon Boat Festival flow curve of this gantry.

[0075] From Table 3 and Figure 7 As can be seen from the Dragon Boat Festival case, the optimal function for gantry F is a bi-Gaussian mixture model. This function can characterize multiple local peaks that may exist before and after the holiday, and is suitable for expressing the traffic flow pattern of the holiday, which has the characteristics of travel peaks and return peaks.

[0076] The comparison of traffic flow predictions for gantries E and F during the Dragon Boat Festival shows that even within the same holiday period, traffic flow patterns at different gantry locations may differ. This invention, through a candidate function library and a leave-one-out-of-year cross-validation mechanism, can automatically select a more suitable baseline shape function based on historical traffic flow patterns for different gantries and different holidays.

[0077] In summary, this embodiment demonstrates that the aforementioned prediction method can, based on holiday traffic data at the gantry level for two highways, complete historical holiday window identification, relative day sequence alignment, baseline shape extraction, candidate function model (heterogeneous mathematical model) fitting, and selection of the optimal baseline shape function model. Six sets of typical results cover different types of function models, including third-order Fourier, smoothed cubic spline, fifth-order polynomial, cubic spline interpolation, sixth-order polynomial, and double Gaussian mixture, illustrating the differences in traffic patterns across different holidays and gantry levels. This embodiment of the invention, through a baseline shape function model library and a leave-one-out-of-year cross-validation mechanism, can automatically select the optimal baseline shape function model for specific gantry levels and specific holidays, thereby enhancing the adaptability, stability, and interpretability of the holiday traffic prediction method.

[0078] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0079] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0080] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0081] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0082] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0083] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0084] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A holiday traffic flow prediction method based on benchmark shape extraction and annual transformation parameter evolution, characterized in that, Includes the following steps: Obtain the holiday schedule for each year and construct an observation flow matrix; The observed flow matrix is ​​decoupled and solved to obtain a discrete reference shape point sequence and initial annual transformation parameters; Fit the discrete reference shape point sequence to establish a reference shape function model library; Based on the initial annual transformation parameters, the final annual transformation parameters for the target year are predicted using a robust extrapolation method based on quantile truncation. The optimal baseline shape function model is obtained from the baseline shape function model library using leave-one-out cross-validation. Based on the optimal baseline shape function model and the final annual transformation parameters of the target year, the holiday traffic flow is predicted. 2.The holiday traffic flow prediction method based on benchmark shape extraction and annual transformation parameter evolution of claim 1, wherein, The steps for constructing the observed flow matrix include: Based on the aforementioned annual holiday schedule, Gregorian calendar dates are mapped to relative day order, wherein the annual holiday schedule includes statutory holidays, the number of days before the holiday, the number of days after the holiday, and adjusted workdays. The mapping expression for the relative day order is as follows: , In the formula, For relative date order, subscript Used to identify the pairing relationship between any specific date and its corresponding relative date sequence. For any date, This refers to the actual start date of a holiday in a given year. Based on the relative day order, construct the historical observation flow matrix. , is represented as: , In the formula, elements in For the first Year in relative day order Actual daily traffic flow, subscript The number of historical years, subscript This represents the number of grid cells for the relative day sequence.

3. The holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution according to claim 1, characterized in that, The steps for obtaining the discrete reference shape point sequence and the initial annual transformation parameters include: Based on the observed flow matrix, a spatial transformation mode is used for decoupling to obtain the reference shape. and initial annual transformation parameters, wherein the spatial transformation mode includes one of the kb mode and the kab mode, wherein the decoupling expression of the kb mode is: , In the formula, Relative date sequence The corresponding daily traffic flow For magnification parameters, Based on the basic shape, For constant bias; The decoupling expression for the kab mode is: , In the formula, Linear bias; By alternately fixing the reference shape and initial annual transformation parameters By performing iterative solutions using the alternating least squares method, a discrete reference shape point sequence is obtained. , is represented as: , In the formula, This is the baseline shape sequence after the iterative convergence of the alternating least squares method. This is an operation for calculating the arithmetic mean.

4. The holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution according to claim 3, characterized in that, In the iterative solution process of alternating least squares, the first... The iteration process includes: Fixed number The secondary reference shape For each year By solving the least squares problem, we obtain the... The initial annual transformation parameters are taken from the historical observed flow matrices. The median sequence is used as the initial reference shape. The least squares problem is expressed as: , In the formula, For the first Annual multiplier parameters For the first Linear bias for the year. For the first Annual constant bias. For the first Year in relative day order Actual daily traffic flow For the first The relative date sequence obtained in the next iteration The corresponding baseline shape value; Fixed number The initial annual transformation parameters for each relative day sequence By utilizing actual daily traffic flow data, the baseline shape point can be determined. The reference shape point Represented as: , In the formula, For the first The sky contains a set of years with valid actual observations of daily traffic flow. for The average value.

5. The holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution according to claim 1, characterized in that, The reference shape function model library contains various heterogeneous mathematical models, including high-order polynomial models, third-order Fourier series models, natural boundary cubic spline interpolation models, smooth cubic B-spline models, and bi-Gaussian mixture models. The construction steps of the high-order polynomial models include: relative date sequence z-score standardization is performed to obtain the standardized relative day order. , is represented as: , In the formula, The mean of all relative day points. The standard deviation of all relative day points; Based on the standardized relative day order The higher-order polynomial model is defined as: , In the formula, Relative date sequence The corresponding baseline shape fitting value, Let be the order of the polynomial. For the first Coefficients of a polynomial of order 1; The construction steps of the third-order Fourier series model include: Assume relative date sequence The range is Then the relative day sequence span for: , In the formula, This represents the maximum value of the relative day sequence. This is the minimum value of the relative day sequence; Based on the range and relative day sequence span The third-order Fourier series model is defined as follows: , In the formula, For constant terms, Let be the order of the Fourier series. and The first The coefficients of the cosine and sine terms, Pi; The construction steps of the natural boundary cubic spline interpolation model include: Let the spline nodes be ,in, It is the largest spline node in the relative day sequence; The corresponding baseline shape value is: ,in, for The corresponding baseline shape value; In any interval Within this framework, the cubic spline interpolation model for natural boundaries is defined as follows: , In the formula, For interval The spline fitting function within, i.e., relative day sequence The corresponding baseline shape fitting value, , , , They are intervals The coefficients of the inner cubic polynomial, This is the index of the segmented sub-interval formed by adjacent spline nodes. and These are adjacent relative day sequences; The natural boundary conditions are as follows: , This represents the second derivative of the spline fitting function; The steps for constructing the smooth cubic B-spline model include: Let the cubic B-spline basis function be... The smoothed cubic B-spline model is then expressed as: , In the formula, For the first A cubic B-spline basis function, where the subscript 3 indicates that the spline is of degree three. For the corresponding spline coefficients, The number of spline basis functions; The spline coefficients are determined by the following objective function. : , In the formula, For the first A discrete reference shape value, Relative date sequence The corresponding baseline shape fitting value, To smooth out the penalty coefficient, for The second derivative; The double Gaussian mixture model is defined as follows: , In the formula, The basic flow shape is horizontal and constant. and These are the amplitude parameters for the Gaussian travel peak and the Gaussian return peak, respectively. and These represent the relative daily positions of the Gaussian travel peak and the Gaussian return peak, respectively. and These are the width parameters for the Gaussian travel peak and the Gaussian return peak, respectively.

6. The holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution according to claim 1, characterized in that, The prediction steps for the final annual transformation parameters of the target year include: For the magnification parameter Log-linear regression was used for fitting, and the expression for log-linear regression is: , In the formula, For the intercept term, The slope These are the initial multiplier parameters predicted for the target year. For the target year; For linear bias and constant bias Ordinary linear regression was used for fitting, and the expression for ordinary linear regression is: , , In the formula, This is the initial linear bias for the target year. The initial constant bias for the target year. and The intercept is... and The slope; Extracting initial annual transformation parameters The distribution quantiles are the 10th percentiles. and 90% distribution quantile Then calculate the range ; Based on the 10% distribution quantile 90% distribution quantile And the range, setting an absolute safety boundary for robust prediction, is expressed as: , , In the formula, For an absolutely safe lower bound, For the upper limit of absolute safety, For dynamic expansion coefficients; Based on the aforementioned absolute safety boundary, the initial annual transformation parameters for the target year are... After correction, the final annual transformation parameters for the target year are obtained, where the correction expression is: , , , In the formula, , , The multiplier parameter, linear bias, and constant bias for the target year constitute the final annual transformation parameters for the target year. .

7. The holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution according to claim 1, characterized in that, The steps for obtaining the optimal baseline shape function model include: For the observed flow matrix , carry out Leave-one-out cross-validation, where in each leave-one-out cross-validation, a certain year is excluded. Observed flow By extracting a baseline shape function model from the observed flow rates of the remaining years and training the annual transformation parameters for the corresponding years, the model can then predict the years to be removed from the list. Fitted flow rate ; For the extracted multiple benchmark shape function models, calculate the RMSE of each benchmark shape function model under leave-one-out cross-validation and the RMSE of each benchmark shape function model under each cross-validation. The average RMSE in leave-one-out cross-validation is used, and the baseline shape function model that minimizes the average RMSE is selected as the optimal baseline shape function model for holidays. The expression for calculating RMSE is as follows: , In the formula, The average root mean square error, The number of grid cells for relative day order. Relative date sequence The corresponding actual observed flow rate, Relative date sequence The corresponding predicted flow.

8. The holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution according to claim 7, characterized in that, The steps for predicting holiday traffic flow include: Using the aforementioned optimal baseline shape function model, combined with the final annual transformation parameters for the target year. The daily predicted traffic flow for the target year during the holiday period is reconstructed using a prediction formula. The predicted daily traffic flow satisfies the physical constraint that the daily predicted traffic flow is not less than 0. , , These are the target year's multiplier parameter, linear bias, and constant bias, respectively.

9. A method for predicting holiday traffic flow based on baseline shape extraction and annual transformation parameter evolution according to claim 8, characterized in that, The prediction formula includes the following two types: The first type: , The second type: , In the formula, For the target year Daily traffic flow forecasts For relative date order, the value is [value]. , Used as the reference shape.

10. A storage medium having a program stored thereon, characterized in that, When the program is executed, it implements the holiday traffic flow prediction method based on baseline shape extraction and annual transformation parameter evolution as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Construction method of traffic flow prediction model and electronic equipment

    CN112183868A