Public transport vehicle real-time scheduling and path optimization method driven by artificial intelligence

By using a real-time bus dispatching and route optimization method that integrates multi-source data fusion and a three-level AI model, the problem of inaccurate dispatching in traditional bus dispatching systems under dynamic traffic events and passenger flow fluctuations has been solved, achieving efficient and dynamic resource allocation and improved passenger experience.

CN121583137APending Publication Date: 2026-02-27CCCC XIONGAN URBAN CONSTRUCTION DEVELOPMENT CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511752699.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Traditional public transport dispatching systems struggle to achieve precise dispatching in the face of dynamic traffic events and passenger flow fluctuations, resulting in excessively long passenger waiting times, high vehicle empty-running rates, low route punctuality rates, insufficient data utilization, information asymmetry, and uneven resource allocation, all of which reduce the efficiency and attractiveness of public transport.

Method used

An AI-driven real-time bus dispatching and route optimization method is adopted. Through multi-source data fusion and three-level AI model collaboration, including machine learning, deep learning and reinforcement learning, real-time dispatching decisions are generated and routes are dynamically optimized, forming a closed-loop feedback mechanism to continuously iterate and optimize model parameters.

Benefits of technology

It enables accurate prediction of passenger flow and road conditions, dynamic response to traffic changes, optimization of resource allocation, reduction of passenger waiting time and vehicle empty runs, improvement of route punctuality and passenger satisfaction, and construction of a highly efficient public transportation system with self-learning capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121583137A_ABST
    Figure CN121583137A_ABST
Patent Text Reader

Abstract

The invention provides an artificial intelligence-driven bus real-time scheduling and path optimization method. The artificial intelligence-driven bus real-time scheduling and path optimization method comprises the following steps: S1, multi-source data acquisition; s2, data preprocessing; s3, constructing an artificial intelligence scheduling optimization model; s4, generating a real-time scheduling decision; s5, vehicle execution and data feedback; and S6, path dynamic optimization. Through deep fusion of an artificial intelligence technology and public transportation services, the precision, dynamic and intelligent scheduling decision is realized, and finally the operation efficiency and service quality of a public transportation system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and traffic control systems, and in particular to an artificial intelligence-driven method for real-time scheduling and route optimization of public transportation vehicles. Background Technology

[0002] The current public transportation dispatching system mainly faces the following challenges: Insufficient dynamic adaptability: Traditional scheduling relies on human experience and fixed timetables, making it difficult to cope with dynamic scenarios such as sudden traffic events (such as congestion and accidents) and passenger flow fluctuations (such as morning and evening rush hours and large-scale events), which can easily lead to excessively long waiting times for passengers or excessively high vehicle empty running rates.

[0003] Insufficient data utilization: The multi-source data (vehicle status, road conditions, passenger flow, etc.) generated by the public transportation system are stored in a scattered manner and in different formats. They lack systematic integration and in-depth analysis and have failed to be transformed into an effective basis for scheduling decisions.

[0004] Decision-making and execution are disconnected: After scheduling instructions are generated, it is difficult to dynamically adjust them according to the real-time execution situation, and route planning often ignores changes in road conditions, resulting in the "optimal decision" being less effective in actual execution.

[0005] Passenger experience needs improvement: Information asymmetry (such as inaccurate vehicle arrival times and delayed detour information) and uneven resource allocation (such as overcrowding at some stations) reduce the attractiveness of public transportation.

[0006] These problems lead to inefficiency and instability in public transportation. Summary of the Invention

[0007] This invention provides an AI-driven method for real-time bus dispatching and route optimization. By using AI technology, it constructs a full-process bus dispatching solution that integrates "data-driven, intelligent decision-making, dynamic optimization, and continuous iteration," solving problems such as "inaccurate prediction, delayed decision-making, and rigid routes" in traditional bus dispatching. Ultimately, it achieves the goals of "shortest passenger waiting time, highest vehicle utilization, and optimal route punctuality."

[0008] To achieve the above objectives, the present invention adopts the following technical solution: An AI-driven method for real-time bus dispatching and route optimization includes the following steps: S1. Collect real-time status data of buses, real-time traffic data, passenger-related data, basic data of bus stops and routes, and constraint data to generate a raw multi-source bus data set; S2. Clean, integrate, standardize, and divide the original multi-source bus data set to generate model training dataset, model validation dataset, and real-time bus operation basic dataset; S3. Based on the model training dataset and the model validation dataset, construct and train a pre-trained scheduling optimization model with a three-level fusion architecture, which includes: (1) Machine learning prediction layer: predict the cumulative number of passengers at each bus stop through the random forest model and predict the traffic speed of each road segment through the extreme gradient boosting model. (2) Deep learning temporal layer: The prediction results of the random forest model are input into the long short-term memory network model for temporal correction to obtain the corrected cumulative number of passengers; The prediction results of the extreme gradient boosting model are input into the gated recurrent unit model for temporal correction to obtain the corrected traffic speed of each road segment; (3) Reinforcement learning decision layer: Based on the corrected cumulative number of passengers and the passage speed of each road segment, the deep Q network model generates discrete scheduling decisions such as departure interval adjustment, temporary addition of vehicles, station adjustment, and replacement of faulty vehicles. The near-end strategy optimization model generates path optimization decisions. S4. Generate real-time dispatching decision instructions based on the pre-trained scheduling optimization model and the real-time bus operation basic dataset; S5. Public buses execute real-time dispatching decisions and collect data during the execution process; S6. Based on real-time scheduling decision instructions, execution process data, and real-time traffic changes, dynamically optimize the path through the near-end strategy optimization model and generate path optimization adjustment instructions.

[0009] In this specification, the AI-driven real-time scheduling and route optimization method for buses also includes S7: Based on the execution results of the execution process data and route optimization adjustment instructions, the scheduling effect is evaluated. If the evaluation indicators are not met, the execution process data is added to the model training dataset, and the process is returned to S3 to retrain the model to complete the iteration.

[0010] In this specification, the interaction process between the machine learning prediction layer and the deep learning temporal layer in S3 includes: using the passenger cumulative number prediction sequence output by the random forest model as the input of the long short-term memory network model, the long short-term memory network model captures temporal features through a gating mechanism and outputs a correction value, and then obtains the final passenger volume prediction result through weighted fusion; using the traffic speed prediction sequence of each road segment output by the extreme gradient boosting model as the input of the gated recurrent unit model, the gated recurrent unit model captures temporal features through update gates and reset gates and outputs a correction value, and then obtains the final road segment speed prediction result through weighted fusion.

[0011] In this specification, the interaction process between the deep learning temporal layer and the reinforcement learning decision layer in S3 includes: integrating the corrected cumulative number of passengers and the predicted traffic speed of each road segment into a state vector, and inputting it into the deep Q-network model and the near-end policy optimization model; the deep Q-network model calculates the Q value of each scheduling decision based on the state vector and selects the optimal decision; the near-end policy optimization model optimizes the path strategy based on the decision results of the state vector and the deep Q-network model, and generates the optimal path.

[0012] In this specification, S3 constructs a dynamic feedback closed loop, which specifically includes: adjusting the fusion weights of the machine learning prediction layer and the deep learning temporal layer in real time based on the total model loss, with the total model loss comprehensively considering passenger volume prediction error, road segment speed prediction error, and decision effect loss; when the total model loss does not decrease for a preset number of consecutive rounds, the weight adjustment is stopped, and the closed loop optimization is completed.

[0013] In this manual, when generating real-time scheduling decision instructions in S4, different decision types need to be triggered based on the passenger delay risk and congestion risk output by S3 for the next 15 minutes: when the passenger delay risk is high, the decision to shorten the departure interval or temporarily add vehicles is triggered; when the congestion risk is high, the decision to change the route is triggered; when the station is temporarily closed, the decision to adjust the station is triggered.

[0014] In this specification, the specific process of dynamic route optimization in S6 includes: evaluating the remaining travel time of the current route based on real-time traffic data, generating 3 to 5 alternative routes that meet the requirements of station overlap rate ≥ 80% and detour distance increase ≤ 10%; calculating the comprehensive score of each alternative route through the near-end strategy optimization model, and selecting the route with the highest score as the dynamic optimization route.

[0015] In this specification, S7 includes evaluation metrics such as average passenger waiting time, vehicle punctuality rate, vehicle empty-running rate, route travel time saving rate, and passenger satisfaction. When any metric fails to meet the standard, model iteration is triggered. Iteration includes increasing the training sample size, adjusting the number of neurons in the hidden layer of the long short-term memory network model, or optimizing the reward function weights of the proximal strategy model.

[0016] In this manual, in S5, the execution process data includes the actual departure time, actual travel route, actual number of passengers getting on and off at each station, average vehicle speed, and passenger satisfaction. The execution process data is fed back to S2, S6, and S7 in real time.

[0017] In this specification, the termination condition for the dynamic feedback closed loop is: the MAE of passenger volume forecast < 5%, RMSE < 8%, and R 2 >0.90, the predicted speed of the road segment is MAE <10%, RMSE <15%, and R 2>0.85, while the decision-making effect meets the requirements of average passenger waiting time ≤5 minutes, vehicle empty running rate ≤10%, and route punctuality rate ≥90%.

[0018] In summary, the present invention has at least the following beneficial effects: Improve the real-time performance and accuracy of scheduling: Through real-time collection of multi-source data and intelligent model prediction, accurate prediction of passenger flow and road conditions can be achieved, and scheduling decisions can be shifted from "experience-driven" to "data-driven", enabling rapid response to dynamic scene changes.

[0019] Optimize resource allocation efficiency: Generate optimal scheduling strategies (such as dynamically adjusting departure intervals and adding vehicles appropriately) through reinforcement learning models to reduce vehicle idling and resource waste, while reducing passenger waiting time and achieving a balance between supply and demand.

[0020] Enhanced route adaptability: By combining real-time traffic conditions and historical data, the route dynamic optimization module continuously adjusts the driving route to avoid congested sections, shorten travel time, and improve the on-time rate of the route.

[0021] Improve passenger travel experience: Reduce passenger information asymmetry through accurate arrival prediction and timely dispatch information push (such as detour notices), and reduce station congestion by balancing passenger flow distribution, thereby improving travel satisfaction.

[0022] Construct a closed-loop optimization system: Through execution feedback and effect evaluation, continuously iterate and optimize model parameters to enable the system to have self-learning capabilities, adapt to long-term changes in the traffic environment, and maintain efficient operation. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating the AI-driven real-time scheduling and route optimization method for public transportation involved in this invention.

[0024] Figure 2 This is a schematic diagram of the process of constructing AI model fusion involved in this invention.

[0025] Figure 3 This is a schematic diagram of the real-time scheduling and path optimization process involved in this invention.

[0026] Figure 4 This is a schematic diagram of the effect evaluation and model iteration process involved in this invention. Detailed Implementation

[0027] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0028] like Figure 1 As shown, this embodiment provides an artificial intelligence-driven method for real-time scheduling and route optimization of public transportation vehicles, including the following steps: S1. Collect real-time status data of buses, real-time traffic data, passenger-related data, basic data of bus stops and routes, and constraint data to generate a raw multi-source bus data set; S2. Clean, integrate, standardize, and divide the original multi-source bus data set to generate model training dataset, model validation dataset, and real-time bus operation basic dataset; S3. Based on the model training dataset and the model validation dataset, construct and train a pre-trained scheduling optimization model with a three-level fusion architecture, which includes: (1) Machine learning prediction layer: predict the cumulative number of passengers at each bus stop through the random forest model and predict the traffic speed of each road segment through the extreme gradient boosting model. (2) Deep learning temporal layer: The prediction results of the random forest model are input into the long short-term memory network model for temporal correction to obtain the corrected cumulative number of passengers; The prediction results of the extreme gradient boosting model are input into the gated recurrent unit model for temporal correction to obtain the corrected traffic speed of each road segment; (3) Reinforcement learning decision layer: Based on the corrected cumulative number of passengers and the passage speed of each road segment, the deep Q network model generates discrete scheduling decisions such as departure interval adjustment, temporary addition of vehicles, station adjustment, and replacement of faulty vehicles. The near-end strategy optimization model generates path optimization decisions. S4. Generate real-time dispatching decision instructions based on the pre-trained scheduling optimization model and the real-time bus operation basic dataset; S5. Public buses execute real-time dispatching decisions and collect data during the execution process; S6. Based on real-time scheduling decision instructions, execution process data, and real-time traffic changes, dynamically optimize the path through the near-end strategy optimization model and generate path optimization adjustment instructions.

[0029] In some embodiments, the AI-driven real-time scheduling and route optimization method for buses further includes S7: evaluating the scheduling effect based on the execution process data and the execution results of the route optimization adjustment instructions; if the evaluation indicators do not meet the standards, supplementing the execution process data into the model training dataset and returning to S3 to retrain the model to complete the iteration.

[0030] In some embodiments, in S3, the interaction process between the machine learning prediction layer and the deep learning temporal layer includes: using the passenger cumulative number prediction sequence output by the random forest model as the input of the long short-term memory network model, the long short-term memory network model captures temporal features through a gating mechanism and outputs a correction value, and then obtains the final passenger volume prediction result through weighted fusion; using the traffic speed prediction sequence of each road segment output by the extreme gradient boosting model as the input of the gated recurrent unit model, the gated recurrent unit model captures temporal features through update gates and reset gates and outputs a correction value, and then obtains the final road segment speed prediction result through weighted fusion.

[0031] In some embodiments, in S3, the interaction process between the deep learning temporal layer and the reinforcement learning decision layer includes: integrating the corrected cumulative number of passengers and the predicted traffic speed of each road segment into a state vector, and inputting it into the deep Q-network model and the near-end policy optimization model; the deep Q-network model calculates the Q value of each scheduling decision based on the state vector and selects the optimal decision; the near-end policy optimization model optimizes the path strategy based on the decision results of the state vector and the deep Q-network model, and generates the optimal path.

[0032] In some embodiments, S3 involves constructing a dynamic feedback closed loop, specifically including: adjusting the fusion weights of the machine learning prediction layer and the deep learning temporal layer in real time based on the total model loss, where the total model loss comprehensively considers passenger volume prediction error, road segment speed prediction error, and decision effect loss; and stopping the weight adjustment when the total model loss does not decrease for a preset number of consecutive rounds, thus completing the closed loop optimization.

[0033] In some embodiments, when generating real-time scheduling decision instructions in S4, different decision types need to be triggered based on the passenger delay risk and congestion risk output by S3 for the next 15 minutes: when the passenger delay risk is high, the decision to shorten the departure interval or temporarily add vehicles is triggered; when the congestion risk is high, the decision to change the route is triggered; when the station is temporarily closed, the decision to adjust the station is triggered.

[0034] In some embodiments, S6 includes the following specific process for dynamic route optimization: evaluating the remaining travel time of the current route based on real-time traffic data, generating 3 to 5 alternative routes that meet the requirements of station overlap rate ≥ 80% and detour distance increase ≤ 10%; calculating the comprehensive score of each alternative route through the near-end strategy optimization model, and selecting the route with the highest score as the dynamic optimization route.

[0035] In some embodiments, in S7, the evaluation metrics include average passenger waiting time, vehicle punctuality rate, vehicle empty-running rate, route travel time saving rate, and passenger satisfaction. When any metric fails to meet the standard, model iteration is triggered. The iteration includes increasing the training sample size, adjusting the number of neurons in the hidden layer of the long short-term memory network model, or optimizing the reward function weights of the proximal strategy optimization model.

[0036] In some embodiments, in S5, the execution process data includes the actual departure time, the actual travel route, the actual number of passengers getting on and off at each station, the average vehicle speed, and passenger satisfaction. The execution process data is fed back to S2, S6, and S7 in real time.

[0037] In some embodiments, the termination condition for the dynamic feedback loop is: the MAE of passenger volume forecast < 5%, RMSE < 8%, and R 2 >0.90, the predicted speed of the road segment is MAE <10%, RMSE <15%, and R 2 >0.85, while the decision-making effect meets the requirements of average passenger waiting time ≤5 minutes, vehicle empty running rate ≤10%, and route punctuality rate ≥90%.

[0038] The technical concept of this invention is as follows: The solution is based on "multi-source data fusion" and centered on "three-level AI model collaboration," forming a closed loop through seven closely linked steps: Data Acquisition (S1): Integrating multi-source data such as vehicle GPS, station passenger flow, and real-time traffic conditions to construct a holographic database of the public transportation system; Data Preprocessing (S2): Transforming raw data into a structured dataset suitable for AI model input through cleaning, standardization, and integration; Model Building (S3): Creating a three-level fusion model of "prediction-temporal correction-decision"—machine learning models (random forest, XGBoost) generate basic predictions, and deep learning models (L... STM and GRU are used for time-series correction, and reinforcement learning models (DQN and PPO) generate optimization decisions. The models achieve collaboration through weight fusion and dynamic feedback. Real-time decision-making (S4): Based on pre-trained models and real-time data, dispatch instructions such as adjusting departure intervals and temporarily adding vehicles are generated. Execution feedback (S5): Vehicle terminal instructions are given and execution data is fed back in real time to form a decision-execution closed loop. Route optimization (S6): The route is dynamically adjusted in combination with real-time traffic conditions to ensure optimal traffic efficiency. Evaluation iteration (S7): The system effect is evaluated through quantitative indicators, triggering model iteration optimization and continuously improving performance.

[0039] The core value of this solution lies in enabling the public transportation system to adapt to complex traffic environments (such as sudden congestion and surges in passenger flow) through deep integration and dynamic feedback of AI models. This significantly improves the passenger travel experience while reducing operating costs, providing a feasible technical framework for the construction of smart public transportation systems.

[0040] S1. Multi-source data acquisition 1.1 Data Collection Objectives and Core Functions The core objective of this step is to construct a "holographic database of the public transportation system," providing comprehensive and real-time raw data support for subsequent model training (S3) and real-time scheduling (S4). All collected data must meet the requirements of "spatiotemporal consistency" (multi-source data with the same timestamp and spatial location can be correlated) and "high frequency" (ensuring the capture of dynamic changes), which directly affects the prediction accuracy of the machine learning model in S3 and the decision-making effectiveness of the reinforcement learning model.

[0041] 1.2 Content, Source and Frequency of Data Collection 1. Real-time status data of public transport vehicles Data collected includes: Vehicle unique identifier (ID), current latitude and longitude (accurate to 6 decimal places), real-time speed (km / h), remaining battery / fuel (%), remaining seats, vehicle fault code (e.g., engine fault code P0300), current route number (e.g., "Route 101"), driver ID, and continuous driving time (minutes). Data sources include: onboard GPS module (sampling frequency 1 time / 10 seconds), onboard CAN bus (vehicle status sensor, 1 time / 30 seconds), seat pressure sensor (1 time / 1 minute), and driver attendance terminal. Purpose: To provide the "vehicle state vector" for the reinforcement learning model in S3. Providing basic data is the key basis for generating decisions such as "adding more vehicles" and "adjusting departure intervals".

[0042] 2. Real-time traffic data Data collected includes: unique road segment identifiers (e.g., "R0123"), real-time traffic speed (km / h), congestion levels (1-4, corresponding to smooth to severe congestion), traffic accident information (location, type, estimated cleanup time), and road construction information (road segment scope, construction period). Data sources include: urban traffic monitoring platform API (updated once every 3 minutes), floating car data (GPS trajectories of private vehicles, once every 1 minute), and traffic police accident reporting system (real-time push). Purpose: To provide "road segment speed sequences" for the XGBoost and GRU models in S3. “” is the core input for route optimization (S6) and congestion detour decision-making.

[0043] 3. Passenger-related data Data collected includes: unique station identifiers (e.g., "S045"), number of passengers entering the station every 10 minutes, number of passengers boarding / alighting at each station, data from bus app reservations (number of reservations, boarding station, reservation time), and real-time passenger feedback (e.g., reports of "station congestion"). Data sources include: station gate card swipe records (real-time), onboard infrared counting sensors (1 time / station), and the bus app backend (real-time). Purpose: To provide the "passenger volume sequence" for the random forest and LSTM models in S3. "" is the core feature for predicting the "cumulative number of passengers in the next 15 minutes".

[0044] 4. Basic data on bus stops and routes Data collected includes: station latitude and longitude, name, route, distance between stations (meters), transfer route information (e.g., "S045 can transfer to Route 202"), first and last bus times, and peak / off-peak benchmark departure intervals. Data sources: Bus company GIS database, operations management system. Purpose: To constitute the "static features" of the model in S3 (e.g., segment length, time period identifiers), serving as the spatial benchmark for route planning.

[0045] 5. Constraint Data Data collected includes: maximum vehicle passenger capacity (e.g., 80 people), maximum continuous driving time for a single driver (4 hours), minimum departure interval (5 minutes), and maximum permissible increase in detour routes (10%). Data sources: Bus company dispatch management regulations and relevant clauses of the Road Traffic Safety Law. Purpose: To serve as "constraints" in the reinforcement learning model within S3 (e.g., in the reward function). , ), to ensure that decisions are legal and compliant.

[0046] 1.3 Data Output and Storage Generate a "raw multi-source public transport data set," store it in a distributed database (such as HBase) using "timestamp + spatial identifier (station / segment / vehicle ID)" as the key, and retain the data for 90 days (to meet the historical data requirements for S3 model training). This dataset will serve as input for S2 data preprocessing, where: historical data (within 90 days) is used for S3 model training; and real-time data (the latest 10 minutes) is used for S4 real-time scheduling.

[0047] S2. Data Preprocessing 2.1 Processing Objectives and Core Functions This step, through cleaning, integration, and standardization, transforms the "raw multi-source public transport data set" collected by S1 into a "structured dataset" suitable for input to the S3 model. This addresses issues such as data noise (e.g., GPS drift), inconsistent formats (e.g., differences in timestamp time zones), and feature redundancy (e.g., duplicated congestion information), which directly affect the training efficiency and prediction accuracy of the S3 model.

[0048] 2.2 Processing Flow and Methods 1. Data Cleaning Outlier Handling: Vehicle Speed: Remove values ​​>120km / h (bus speed limit) or <0, using the "3σ rule" to identify outliers (i.e., values ​​exceeding the mean ± 3 standard deviations); Passenger Volume: Remove negative values ​​or values ​​exceeding the station's maximum capacity (e.g., 300 people); Handling Method: Replace outliers with the mean of the preceding and following 10 minutes (e.g., ...). ).

[0049] Missing value handling: For high-frequency data such as GPS location and speed (missing rate <5%), linear interpolation is used to fill in the missing values ​​(e.g., For low-frequency data such as passenger volume (missing rate 5% to 20%), the "historical average of the same station at the same time" is used to fill in the missing data (e.g., missing values ​​of S045 during Wednesday morning rush hour are replaced by the average of Wednesday morning rush hours over the past 4 weeks).

[0050] Duplicate value handling: For duplicate reports of the same accident / construction, retain the record with "latest timestamp + most detailed description".

[0051] 2. Data Integration Using "timestamp + route number" as the association key, the cleaned multi-source data is integrated into a "Basic Bus Operation Data Record". Each record contains: ; Example: A complete record is: .

[0052] 3. Data Standardization For numerical features (such as speed, passenger volume, and remaining seats), Min-Max standardization is applied, mapping them to the [0,1] interval, as shown in the formula: (2-1); where x is the original value, , The historical minimum and maximum values ​​of this feature are calculated based on 90 days of historical data from S1. One-hot encoding is used for categorical features (such as congestion level and date type) (e.g., congestion level 2 → [0,1,0,0]).

[0053] 4. Data partitioning Divided by "time order" (to avoid data leakage): Model training dataset: standardized data from the first 70 days (approximately 700,000 records), used for S3 model parameter learning; Model validation dataset: standardized data from the last 20 days (approximately 200,000 records), used for S3 model hyperparameter optimization and performance evaluation; Real-time bus operation basic dataset: standardized data from the latest 10 minutes (approximately 1,000 records), used for S4 real-time scheduling decisions.

[0054] 2.3 Data Output and Transmission Three datasets are output: the “model training dataset” and the “model validation dataset” are transmitted to S3 as input for model training and validation; the “real-time bus operation basic dataset” is transmitted to S4 at a frequency of 1 minute / time to support real-time decision generation.

[0055] S3. Construction of Artificial Intelligence Scheduling Optimization Model 3.1 Overall Model Architecture and Fusion Logic To achieve accuracy and dynamic adaptability in real-time bus dispatching and route optimization, this solution designs a three-level fusion architecture of "prediction-temporal modeling-decision optimization". The core logic of this architecture is to transform multi-source data into executable dispatching decisions through the collaborative work of multiple models. The models at each level do not operate independently, but rather form a closed loop of "input-processing-output-feedback" through explicit mathematical relationships.

[0056] Specifically, the first layer is a machine learning prediction layer, which uses random forest and extreme gradient boosting (XGBoost) models to make basic predictions on the two core variables of "passenger volume" and "road speed" to solve the problem of correlation between historical data and the current state. The second layer is a deep learning temporal layer, which uses long short-term memory network (LSTM) and gated recurrent unit (GRU) models to capture the time-series features of the data (such as the periodicity of morning and evening rush hours and the persistence of congestion) to correct the basic prediction results and improve the temporal consistency of the predictions. The third layer is a reinforcement learning decision layer, which uses deep Q network (DQN) and proximal policy optimization (PPO) models to generate optimization decisions that meet the requirements of "shortest passenger waiting time, lowest vehicle empty running rate, and highest route punctuality rate" based on the corrected prediction results.

[0057] The outputs of each level of the model are integrated through a weighted fusion mechanism, and model parameters are adjusted through dynamic feedback to ensure continuous optimization of the overall system in complex traffic environments. For example, when a sudden traffic jam occurs on a road segment, the machine learning model first predicts the duration of the congestion, the deep learning model corrects this prediction to match the dissipation patterns of similar historical congestion, and the reinforcement learning model decides whether to adjust departure intervals or detours based on the correction results, forming a complete "prediction-correction-decision" chain. The AI ​​model fusion construction process is as follows: Figure 2 As shown.

[0058] 3.2 Machine Learning Prediction Sub-model The machine learning prediction sub-model is the foundation of the entire architecture, responsible for transforming the "model training dataset" output by S2 into predicted core parameters for the next 15 minutes. Random Forest and XGBoost models were chosen because both can effectively handle non-linear features (such as the impact of weather and time of day on passenger volume) and are robust to missing and outlier values, making them suitable for the complex characteristics of public transport data.

[0059] 3.2.1 Random Forest Passenger Volume Prediction Model The purpose of the model is to predict the cumulative number of passengers at each bus stop within the next 15 minutes, providing a basis for subsequent scheduling decisions.

[0060] Model Definition and Formula: The random forest passenger volume prediction model reduces prediction error by integrating the outputs of multiple decision trees, defined as follows: The calculation formula is: (3-1) K: Number of decision trees, experimentally verified to be 200 (too few will lead to underfitting, too many will increase computational cost). x: Output value of the k-th decision tree (i.e., the cumulative number of passengers predicted by this decision tree for the station); x: Input feature vector, containing: the sequence of passenger numbers for this station over the past 30 minutes. ( The following parameters are displayed: number of passengers at ti minutes; current time period identifier (1 indicates peak hours 7:00-9:00 / 17:00-19:00, 0 indicates off-peak hours); weather condition parameters (1 indicates rain / snow, 0 indicates sunny / cloudy); date type (1 indicates weekday, 0 indicates weekend / holiday).

[0061] Model training process: Data preparation: Extract the above input feature vector x and the corresponding cumulative number of actual passengers from the "model training dataset" of S2. (i.e., the actual value at t+15 minutes), construct the training sample set. , where N is the number of samples (approximately 100,000).

[0062] 2. Loss function definition: The mean squared error (MSE) is used to measure the deviation between the predicted and actual values. The formula is: (3-2) In the formula Let be the input feature vector of the i-th sample; Let be the cumulative number of actual passengers for the i-th sample.

[0063] 3. Hyperparameter optimization: The optimal parameters are determined through grid search. The search range and final values ​​are as follows: Maximum depth of decision tree Search range: 5–20, optimal value: 15 (balancing fitting ability and overfitting risk); minimum number of split samples per tree. Search range: 5–20, optimal value: 10; minimum number of leaf node samples for each tree. Search range: 2 to 10, with the optimal value being 5.

[0064] 4. Training stopping condition: Using 5-fold cross-validation, the training stops when the average value of the validation set reaches zero. Training is stopped when the prediction error is less than 5%.

[0065] Model application output: For any station s and the current time t, the model outputs a predicted cumulative number of passengers for the next 15 minutes. (3-3) The cumulative number of passengers at station s predicted by the random forest model at time t+15. : Input feature vector of station s at time t (extracted from the "Real-time Bus Operation Basic Dataset" based on S2).

[0066] 3.2.2 XGBoost segment speed prediction model The purpose of model construction is to predict the traffic speed of each road segment within the next 15 minutes, providing a basis for road condition analysis for route optimization. XGBoost was chosen because of its strong ability to fit structured data and its ability to control overfitting through regularization, making it suitable for variables such as road segment speed that are affected by multiple factors (such as the number of lanes and intersections).

[0067] The XGBoost road speed prediction model achieves prediction by accumulating the outputs of multiple regression trees, defined as follows: The calculation formula is: (3-4) M: Number of regression trees, experimentally verified to be 150; : The output value of the m-th regression tree (i.e., the road segment speed predicted by this tree); Input feature vector, containing: the speed sequence of this road segment over the past 30 minutes. ( The following parameters are displayed: (1 = smooth traffic, 2 = light congestion, 3 = moderate congestion, 4 = heavy congestion); (2 = road speed at ti minutes); (3 = road speed at ti minutes); (4 = road speed at ti minutes); (5 = road speed at ti minutes); (6 = road speed at ti minutes); (7 = road speed at ti minutes); (8 = road speed at ti minutes); (9 = road speed at ti minutes); (1 ...

[0068] Model training process: 1. Data Preparation: Extract the input feature vector y and the corresponding actual road segment speed from the "Model Training Dataset" in S2. (i.e., the actual speed at t+15 minutes), construct the training sample set.

[0069] (N approximately 80,000 entries).

[0070] 2. Loss function definition: A regularized squared loss is used to balance prediction accuracy and model complexity. (3-5) The squared loss function, i.e. ; T1 is the regularization term (to control overfitting); T1 is the number of leaf nodes in the m-th tree. The score of the j-th leaf node; (Value 0.1) and (Value 1) is the regularization parameter.

[0071] 3. Hyperparameter optimization: Determine the optimal parameters through grid search. Learning rate Search range: 0.01–0.3, optimal value: 0.1 (controlling the contribution of each tree); maximum tree depth. Search range: 3-10, optimal value: 8; Subsampling ratio The search range is 0.5 to 1.0, with the optimal value being 0.8 (80% of the data is randomly sampled for training in each iteration to enhance generalization ability).

[0072] 4. Training stopping condition: Training stops when the MSE of the validation set does not decrease for 5 consecutive rounds (final validation set MSE < 0.02).

[0073] Model application output: For any road segment r and the current time t, the model outputs the predicted traffic speed for the next 15 minutes. (3-6) The XGBoost model predicts the traffic speed of road segment r at time t+15. : Input feature vector of road segment r at time t (extracted from the "Real-time Bus Operation Basic Dataset" based on S2).

[0074] 3.3 Deep Learning Temporal Sub-model While machine learning models can capture non-linear relationships between features, they struggle to handle temporal dependencies in data (such as the continuous growth trend of passenger volume during morning rush hour and the spreading characteristics of congestion). Therefore, LSTM and GRU models are introduced as temporal correction layers, utilizing their gating mechanisms to capture long-term dependencies and optimize the prediction results of machine learning.

[0075] 3.3.1 LSTM Passenger Volume Time Series Correction Model The purpose of model construction is to further capture the time series characteristics of passenger volume (such as the rapid growth pattern of passenger volume during the morning rush hour on weekdays from 7:30 to 8:30) based on the passenger volume prediction results of random forest, and correct the prediction bias.

[0076] LSTM (Long Short-Term Memory) networks solve the "vanishing gradient" problem of traditional recurrent neural networks by controlling the transmission of information through input gates, forget gates, and output gates. Its core formula is as follows: 1. Input gate (controls the entry of new information into the cell state): (3-7) 2. Forget Gate (Controls the retention of historical information): (3-8) 3. Cell state update (storing long-term memory): (3-9) 4. Output gate (controls the current memory of the output): (3-10) 5. Hidden state (outputs the result at the current moment): (3-11) : These represent the input gate, forget gate, and output gate outputs at time t (value range [0,1], where 1 indicates that information is fully allowed to pass through); : Cell state at time t (stores long-term temporal information); The hidden state at time t (the output of the model, reflecting the current temporal characteristics); The input at time t is the passenger volume prediction sequence of the random forest. (Predicted values ​​over a continuous 30-minute period); Weight matrix (core parameters for model training); : Bias term; : sigmoid activation function ( ); : Hyperbolic tangent activation function (value range [-1, 1]); Element-wise multiplication (multiplying elements at corresponding positions).

[0077] Model training process: Data preparation: Arrange the prediction results of the random forest in the "model training dataset" of S2 according to the time series to construct the input sequence. (T is the time step), and the corresponding label is the actual passenger volume sequence. .

[0078] 2. Network structure: The network adopts a structure of 2 layers of LSTM (64 neurons per layer) + 1 fully connected layer (outputting 1 value). The output of the first layer of LSTM is used as the input of the second layer of LSTM. The last hidden state of the second layer of LSTM outputs the corrected passenger number through the fully connected layer.

[0079] 3. Loss function definition: The mean squared error is used to measure the deviation between the corrected result and the actual value. (3-12) In the formula Let be the output of the LSTM for the i-th sample at time t. This corresponds to the actual number of passengers.

[0080] 4. Training parameters: The Adam optimizer (learning rate) is used. Batch size The number of iterations is 50 rounds.

[0081] 5. Training termination condition: Training is stopped when the validation set loss does not decrease for 10 consecutive rounds (final validation set loss < 0.008).

[0082] Model application and fusion: The output of LSTM and the prediction results of Random Forest are weighted and fused to obtain the final passenger volume prediction: (3-13) : LSTM-corrected prediction of the cumulative number of passengers at station s at time t+15; : Fusion weights ( ), determined through validation set optimization ( =0.6, =0.4, because LSTM is better at capturing temporal features). : The output (correction value) of the LSTM model at time t+15.

[0083] For example, Random Forest predicts that the number of passengers at station A during the morning rush hour at 8:00 will be 50. However, LSTM finds from historical data that the number of passengers at this station usually increases by 20% from 8:00 to 8:15. Therefore, it outputs a correction value of 60 people. The final fusion result is 0.6×50+0.4×60=54 people, which is closer to the actual value.

[0084] 3.3.2 GRU Section Speed ​​Time Series Correction Model Model construction objective: Based on the road segment speed prediction results of XGBoost, to capture the temporal dependence of road segment speed (such as the pattern of congestion spreading from upstream to downstream) and correct prediction bias. GRU is a simplified version of LSTM, with higher computational efficiency, and is suitable for road segment speed prediction with high real-time requirements.

[0085] GRU transmits control information by updating and resetting gates, and its core formula is as follows: 1. Update gate (controls the ratio of retaining historical information to receiving new information): (3-14) 2. Reset Gate (Controls the impact of historical information on new information): (3-15) 3. Candidate hidden states (generated based on historical and new information from the reset gate process): (3-16) 4. Hidden state update (final output): (3-17) : The update gate output at time t (value range [0,1], the larger the value, the more dependent it is on new information); : Reset gate output at time t (value range [0,1], the smaller the value, the more historical information is ignored); The candidate hidden state at time t; The hidden state at time t (model output); The input at time t, i.e., the road segment speed prediction sequence of XGBoost. (Predicted values ​​over a continuous 30-minute period); Weight matrix; : Bias term; The definition is the same as that of the LSTM model.

[0086] Model training process: Data preparation: Arrange the XGBoost road speed prediction results by time series to construct the input sequence. The label is the actual road segment speed sequence. .

[0087] 2. Network structure: It adopts a structure of 1 GRU (128 neurons) + 1 fully connected layer. The last hidden state of the GRU outputs the corrected speed through the fully connected layer.

[0088] 3. Definition of loss function: (3-18) In the formula Let be the output of the GRU for the i-th sample at time t. This represents the actual speed on the road section.

[0089] Training parameters: Adam optimizer (learning rate) Batch size The number of iterations is 30 rounds.

[0090] 5. Training termination condition: Training is stopped when the validation set loss does not decrease for 10 consecutive rounds (final validation set loss < 0.015).

[0091] Model application and fusion: The output of GRU is weighted and fused with the prediction results of XGBoost to obtain the final road segment speed prediction value: (3-19) : The predicted traffic speed of road segment r at t+15 minutes after GRU correction; : Fusion weights ( ), determined through validation set optimization ( =0.5, =0.5, because XGBoost and GRU each have their own advantages in different road conditions). : The output (correction value) of the GRU model at time t+15.

[0092] For example, XGBoost predicts that the speed of road segment B at t+15 minutes is 30 km / h, but GRU finds from historical data that the speed of this road segment is usually 10% lower than the predicted value in rainy weather. Therefore, it outputs a correction value of 27 km / h, and the final fusion result is 0.5×30+0.5×27=28.5 km / h.

[0093] 3.4 Reinforcement Learning Decision Sub-model The reinforcement learning decision sub-model continuously learns the optimal scheduling strategy in a dynamically changing traffic environment based on the prediction results of the first two layers. Among them, DQN focuses on discrete scheduling decisions (such as departure interval adjustment), while PPO focuses on continuous path optimization. The two work together to generate a complete scheduling scheme.

[0094] 3.4.1 DQN Scheduling Decision Model The purpose of model construction is to generate discrete decisions such as adjusting departure intervals and temporarily adding vehicles based on the corrected passenger volume and road speed prediction results, so as to minimize passenger waiting time and ensure punctuality.

[0095] DQN (Deep Q-Network) estimates the value of a state-action pair using the Q-value function, defined as follows: That is, the expected cumulative reward for performing action a in state s, calculated using the following formula: (3-20) s: Current state vector, containing: Corrected passenger volume prediction: (k1 is the total number of stations); Corrected road segment speed prediction: (m1 represents the total number of road segments). Vehicle state vector (n is the total number of vehicles, (Indicates the position, remaining seats, and whether the i-th vehicle is faulty); Operational parameter vector : ( The times are for the first and last trains. This is the current departure interval. (For driver working hours); a: Actions (discrete decision-making), including: : Adjustment of departure interval (e.g., from 10 minutes to 8 minutes); : Temporarily add vehicles (e.g., dispatch one vehicle from the backup depot); : Site adjustments (e.g., skipping temporarily closed sites). r: Immediate reward after performing action a; : Discount factor (value 0.9), representing the current value weight of future rewards; s': The new state after performing action a; and : These are the parameters of the current Q-network and the target Q-network, respectively (the target network is updated periodically for stable training).

[0096] Reward Function Design: The reward function comprehensively measures the effectiveness of scheduling decisions. The formula is as follows: (3-21) : Average passenger waiting time at time t after the action is performed (unit: minutes); Maximum allowed waiting time (5 minutes, from S1's scheduling rules); : Vehicle empty driving rate at time t after the action is performed (empty driving mileage / total mileage). Maximum allowable empty run rate (10%, from S1 scheduling rules); On-time rate of the line at time t after the action is executed (number of on-time arrivals / total number of arrivals); : Target accuracy rate (90%, from S1 scheduling rules); Weighting coefficients ( =0.4, =0.3, =0.3), indicating that passenger waiting time has the highest priority.

[0097] Model training process: 1. Initialize the experience replay pool: Create an experience replay pool D with a capacity of 10000 to store the "state-action-reward-new state" samples (s,a,r,s').

[0098] 2. Network Initialization: Initialize the current Q network (parameters) ) and target Q network (parameters) All of them use a 3-layer fully connected network (input layer dimension = state dimension, hidden layer dimensions 256 and 128, output layer dimension = number of actions).

[0099] 3. Training loop: a. Extract initial state from the "model training dataset" of S2. b. For each time step t: i. with Greedy strategy selects actions ( (i.e., linearly decaying from 1.0 to 0.1, balancing exploration and exploitation); ii. Simulating the execution of actions. Calculate rewards And obtain the new state iii. Take the sample iv. Store the sample in the experience replay pool D; 32 samples are randomly sampled from D, and the target Q value is calculated: ;in Let Q be the target Q value for the i-th sample; γ: Discount factor (usually around 0.9), representing the immediate reward gained after performing the current action (such as reduced passenger waiting time), used to weigh the importance of immediate rewards and future rewards; Indicates the new state after the action is performed. Below, all possible actions The maximum Q-value that can be obtained; v. Calculate the loss function: vi. Update the current Q-network parameters using the Adam optimizer (learning rate 0.0001). viii. Update the target network parameters every 1000 steps. c. Stop training when the average reward no longer increases after 100 consecutive rounds.

[0100] Model Applications and Decision Generation: In real-time scheduling, DQN selects the action with the highest Q-value as the optimal decision. (3-22); Optimal scheduling decisions (e.g., "adjusting the departure interval from 10 minutes to 8 minutes"); : Parameters of the trained Q network; s: Current state (constructed based on the "real-time bus operation basic dataset" of S2 and the prediction results of the first two layers of the model).

[0101] 3.4.2 PPO Path Optimization Model Model construction objective: Based on DQN scheduling decisions and real-time traffic conditions, optimize bus routes (e.g., bypassing congested sections), minimize travel time, and reduce passenger travel duration. PPO (Proximal Policy Optimization) is more stable than other reinforcement learning algorithms and is suitable for path optimization in continuous action spaces.

[0102] PPO optimizes the policy function. Maximize the cumulative reward (the probability of performing action a in state s), with the core objective function being: (3-23) : Policy ratio (the probability ratio between the current policy and the old policy); Advantage function (action) The relative value, i.e., the reward of the action minus the average reward); : Trimming parameter (value 0.2), which limits the update range of the strategy to ensure stability; : Current policy network parameters; : Network parameters of the old strategy (used to calculate the baseline ratio).

[0103] Dominance function calculation: The generalized dominance estimation (GAE) is used to calculate the dominance function, taking into account both bias and variance. (3-24); (3-25); V(s): State value function (estimates the expected reward of state s); : GAE parameter (value 0.95), controls the bias-variance tradeoff in advantage estimation; Time-series difference error (the deviation between the current reward and the value function); Discount factor (same as DQN, value 0.9).

[0104] Model training process: 1. Strategy and Value Network Initialization: Policy Network: A 3-layer fully connected network (input layer = state dimension, hidden layers 256 and 128, output layer = path parameter dimension), outputting the probability distribution of the path; Value Network: Same structure as the policy network, outputting the state value V(s).

[0105] 2. Training loop: a. Construct initial state based on DQN decision results and real-time traffic conditions. b. Use the current strategy Collection Track (a represents path parameters, such as the coordinates of the turning point); c. Calculate the advantage function. and returns (Cumulative rewards); d. Save the current strategy parameters as e. Repeat the update 10 times: i. Sample batch data from the trajectory; ii. Calculate the clipping target. iii. Calculate the value loss ( For value network parameters, State at time t The actual cumulative return, i.e., from the state iv. Total Loss: (Initial, the sum of all rewards obtained in subsequent steps after discounts) (S is the entropy regularization term, which encourages exploration); v. Update the policy and value network parameters using the Adam optimizer; f. Stop training when the average path travel time no longer decreases.

[0106] Model application and path optimization: Optimized strategy Used to generate the optimal path: (3-26); (3-27); : The optimal strategy to maximize cumulative reward R; s': Path optimization state, including DQN decision results (such as whether detours are allowed), real-time traffic conditions, and corrected speed prediction; From a strategy The optimal path obtained from sampling (e.g., "original path → bypassing road segment r3 → restoring the original path").

[0107] 3.5 Model Fusion and Collaborative Working Mechanism Each sub-model collaborates through an "output fusion-feedback adjustment" mechanism to ensure the overall system's prediction accuracy and decision-making effectiveness.

[0108] 3.5.1 Multi-model output fusion The final passenger volume and road speed prediction results are integrated by weighted fusion of the outputs of various models to balance the advantages of different models: 1. Final Passenger Volume Forecast: (3-28) 2. Final speed prediction for the road segment: (3-29) Final fusion weights ( After optimization using the validation set, the weight values ​​are: =0.3 (Random Forest) =0.7 (LSTM, time series features are more important); =0.2 (XGBoost) =0.8 (GRU, with stronger speed and timing dependence).

[0109] 3.5.2 Inter-model feedback adjustment Establish a dynamic feedback mechanism to adjust the fusion weights based on real-time prediction errors, ensuring the model adapts to environmental changes: (3-30); (3-31); k2: Number of iterations; Learning rate (value 0.01); The total system loss (combining the prediction errors and decision performance of all models) is calculated using the following formula: ( (For losses in decision-making effectiveness, such as penalties for exceeding waiting time limits). These are the fusion weights for Random Forest and XGBoost (which need to be dynamically adjusted). For example, when a station experiences a sudden surge in passenger volume due to a temporary event, the prediction error of Random Forest increases. (Upward movement), the feedback mechanism will decrease through formula (3-30). (e.g., reduce from 0.6 to 0.4), while simultaneously increasing the weights of the LSTM. This improves prediction accuracy.

[0110] 3.6 Model Validation and Optimization Model validation evaluates prediction accuracy and decision-making effectiveness using the following metrics to ensure that it meets the needs of practical applications: 1. Prediction accuracy indicators: Mean Absolute Error (MAE): (3-32) Root Mean Square Error (RMSE): (3-33) Coefficient of determination ( ): (3-34) In the formula This is the actual value. For predicted values, is the average of the actual values, and N is the sample size.

[0111] 2. Decision-making effectiveness indicators: average passenger waiting time ≤ 5 minutes; vehicle empty running rate ≤ 10%; route punctuality rate ≥ 90%.

[0112] Verification criteria: Passenger volume forecast: MAE < 5%, RMSE < 8%. >0.90; Road segment speed prediction: MAE <10%, RMSE <15%, >0.85; All decision performance indicators meet the criteria. If the criteria are not met, return to S2 to adjust the data preprocessing workflow (e.g., supplement with abnormal scenario data) and retrain the model.

[0113] 3.7 Model Output Output a "pre-trained scheduling optimization model", which includes the parameters and fusion mechanism of all sub-models, specifically including: 1. Random forest passenger volume prediction model parameters and fusion weights. 2. XGBoost segment speed prediction model parameters and fusion weights 3. LSTM Passenger Volume Time Series Correction Model Parameters and Fusion Weights 4. Parameters and fusion weights of the GRU segment speed time-series correction model 5. Parameters of the DQN scheduling decision model ( ); 6. PPO path optimization model parameters; 7. Inter-model feedback adjustment mechanism parameters ( (Loss weights, etc.)

[0114] The model will be transmitted to S4 for real-time scheduling decision generation, and simultaneously transmitted to S6 for path dynamic optimization, becoming the core hub connecting prediction and decision-making.

[0115] S4. Real-time scheduling decision generation 4.1 Decision-making objectives and core functions Based on the "pre-trained scheduling optimization model" output by S3 and the "real-time bus operation basic dataset" of S2, real-time scheduling instructions that meet the requirements of "shortest passenger waiting time, highest vehicle utilization rate, and optimal route punctuality rate" are generated. This is the core link connecting model prediction and vehicle execution.

[0116] 4.2 Decision Generation Process 1. Input data integration Basic inputs: S2's "Real-time Bus Operation Basic Dataset" (latest 10 minutes of data), S3's "Pre-trained Scheduling Optimization Model" (including all sub-models and weights); Dynamic input: Real-time emergency data (such as vehicle malfunctions reported by drivers, temporary road closures pushed by traffic police) are accessed in real time via API interface (delay <30 seconds).

[0117] 2. Core Parameter Prediction Input real-time data into the S3 prediction model to generate: Passenger volume forecast for the next 15 minutes: (Based on formula 3-28, for example, the predicted value for station S045 at 8:45 is 54 people). Speed ​​forecast for the next 15 minutes: (Based on formula 3-29, for example, the predicted value for section R0123 at 8:45 is 28.5 km / h). Risk level assessment: "Passenger congestion risk" (high / medium / low) and "congestion risk" (high / medium / low) are generated based on predicted values. For example, "S045 station has a high congestion risk (due to...") Threshold).

[0118] 3. Scheduling decision calculation S3's DQN model (Equation 3-22) calculates the optimal decision based on the above prediction results and constraints. The specific types and triggering logic are as follows: Departure interval adjustment: Triggering condition: When Compared to the same period in previous years, the growth rate is ≥30% (e.g., a predicted growth rate of 50% for the S045 station during the morning rush hour), or A decrease of ≥20% from the base speed (e.g., a 30% decrease due to road congestion); Decision example: Original off-peak interval of 10 minutes → adjusted to 8 minutes (when passenger volume increases) or 12 minutes (when congestion occurs).

[0119] Path change: Triggering condition: When the congestion risk of a certain road segment is "high" ( And it is expected to last ≥20 minutes, or a traffic accident / construction may occur; Decision example: Original path "R0123→R0124" → adjusted to "R0123→R0125→R0124" (detour distance increased by 8% < 10% threshold).

[0120] Additional vehicles added temporarily: Triggering conditions: The risk of passengers being stranded on the route is "high" and the remaining seat rate of the currently operating vehicles is ≤20% (e.g., the current seat rate of Route 101 is 15%), and there are vehicles in the spare depot that meet the conditions (driver's continuous driving time <4 hours). Decision example: Dispatch vehicle V050 from the backup depot, departing from the origin station at 8:30, with the departure interval remaining the same as the current interval (8 minutes).

[0121] Site adjustments: Triggering conditions: Temporary closure of the station (such as road construction) or a sudden drop in passenger flow (less than 5 people entering the station within 10 minutes); Example of decision: All buses on Route 101 will temporarily skip the S045 stop, and a notification will be sent to the bus app simultaneously.

[0122] 4. Standardization of decision-making instructions The calculated optimal decision is converted into a "real-time scheduling decision instruction," in the following format: ; Example: .

[0123] 4.3 Decision Output and Transmission The "real-time dispatch decision command" is pushed to the S5 (vehicle in-vehicle terminal) via the 4G / 5G network to ensure that the driver receives it within 30 seconds; The data is synchronously transmitted to S6 (path optimization module) as a benchmark for dynamic path adjustment; Stored in the "Decision Instruction Log Library" for S7 performance evaluation.

[0124] S5. Vehicle Execution and Data Feedback 5.1 Implementation and Feedback Objectives To ensure that the "real-time scheduling decision instructions" generated by S4 are executed accurately, and to provide feedback on the execution effect through real-time data collection, this provides a basis for data updates in S2, path optimization in S6, and effect evaluation in S7, forming a closed loop of "decision-execution-feedback".

[0125] 5.2 Execution and Feedback Process 1. Command Reception and Confirmation After receiving the instruction, the vehicle's onboard terminal (with display screen and voice prompts) automatically parses and displays key information (such as "Detour via R0125 starting at 8:35"), and simultaneously provides voice reminders to the driver. The driver confirms receipt (by clicking the "Confirm" button on the terminal), and the confirmation information is sent back to the dispatch center in real time (ensuring that the instruction has been received).

[0126] 2. Instruction Execution and Process Monitoring Execute by instruction type: Departure interval adjustment: Drivers will depart at the new interval from the origin / destination station (terminal countdown reminder); Route Change: The in-car navigation system automatically updates to the new route and provides real-time turn point prompts; Temporary additional vehicles: The drivers of the standby vehicles will depart from the designated stations at the instructed times and perform normal station announcements; Station adjustment: The onboard station announcement system will automatically skip the target station and announce in voice, "This train will not stop at station S045 temporarily."

[0127] The dispatch center ensures compliance through real-time monitoring (vehicle GPS trajectory, video surveillance), and immediately alerts the operator via voice intercom if any deviation from the instructions is detected (such as failure to detour).

[0128] 3. Perform data collection and feedback The vehicle-mounted terminal collects the "execution process dataset" every minute, which includes: Operational data: actual departure time, actual travel route (latitude and longitude sequence), actual stops, and travel time of additional vehicles; Status data: average speed during execution, actual number of passengers getting on and off at each station, changes in remaining seats, and whether any new faults have been added; Passenger feedback: A satisfaction survey (1-5 points) pops up on the in-vehicle terminal, and the evaluation data of the bus APP is collected simultaneously.

[0129] Feedback path: Real-time speed, number of passengers getting on and off the bus, and other data are fed back to S2 to update the "real-time bus operation basic dataset" to support the next round of decision-making. Data such as actual path and execution time are fed back to S6 for evaluation of path optimization effectiveness; Passenger satisfaction, fault information, and other data are fed back to S7 as the basis for model iteration.

[0130] 5.3 Data Output The "execution process dataset" is uploaded to the bus dispatch system in real time and stored in the following locations: S2's "Real-time Data Update Library"; S6's "Path Execution Log Library"; S7's "Effect Evaluation Database".

[0131] S6. Path Dynamic Optimization 6.1 Optimization Objectives and Core Functions Based on the scheduling decisions of S4, the execution data of S5, and real-time traffic changes, the PPO model of S3 dynamically optimizes the route to ensure that vehicles always travel on the route with the shortest travel time and the least increase in passenger travel time during the execution process. This serves as a dynamic supplement to the static route decisions of S4. The real-time scheduling and route optimization process is as follows: Figure 3 As shown.

[0132] 6.2 Optimize the process 1. Input data integration Basic data: S4's "real-time scheduling decision instructions" (especially route change instructions), and S5's "execution process dataset" (actual driving path, average speed); Dynamic data: Traffic data updated every 3 minutes by the city traffic monitoring platform (newly added congested road sections, accident handling progress), and S3's PPO model (formulas 3-26 to 3-27).

[0133] 2. Route Evaluation and Alternative Route Generation Assess the current route: Based on the actual speed of S5 and real-time traffic conditions, calculate the "remaining travel time" of the current route (e.g., if the original plan was 20 minutes remaining, it may take 30 minutes due to new congestion). Generate alternative routes: Generate 3 to 5 alternative routes through the GIS system (which must meet the requirements of "station overlap rate ≥ 80%" and "detour distance increase ≤ 10%"). For example, the alternative routes for the current route are "R0123→R0126→R0124".

[0134] 3. Optimal path calculation Input the characteristics of the candidate routes (length, estimated speed, number of stops) into S3's PPO model to predict the "overall score" of each route: (6-1) In the formula: T2 is the path travel time. This represents the travel time for the current route. To increase passenger travel time Maximum allowable increase (5 minutes); S represents the number of stations that overlap with the original route. This represents the total number of stations on the original route.

[0135] The path with the highest overall score is selected as the "dynamic optimization path". For example, if the score of alternative path 2 is 0.92 (the current path is 0.75), then that path is selected.

[0136] 4. Optimize instruction generation and transmission Generate a "path optimization and adjustment command" in the following format: ; Example: .

[0137] Instructions transmitted to: S4: Update the real-time dispatch decision database to ensure that subsequent vehicles follow the new route; S5: The vehicle's onboard terminal receives and updates the navigation, and the driver travels along the new route.

[0138] 6.3 Output and Feedback The "path optimization adjustment command" is transmitted to S4 and S5; The "Dynamic Path Score Results" (Score values ​​for each alternative path) are fed back to S7 to evaluate the effectiveness of path optimization.

[0139] S7. Performance Evaluation and Model Iteration 7.1 Evaluation and Iteration Objectives The overall performance of the scheduling system is evaluated using quantitative indicators. When indicators fail to meet standards, iterative optimization of the S3 model is triggered to ensure continuous performance improvement in complex traffic environments, achieving "more accurate predictions and better decision-making." The performance evaluation and model iteration process is as follows: Figure 4 As shown.

[0140] 7.2 Evaluation and Iteration Process 1. Calculation of evaluation indicators Based on the "Execution Process Dataset" of S5 and the "Dynamic Path Scoring Results" of S6, the core metrics are calculated as follows: Passenger wait time indicators: Average waiting time: (7-1) In the formula Let be the waiting time for the i-th passenger at station s. Let be the total number of passengers at station s, and k3 be the number of stations.

[0141] Vehicle operation indicators: Punctuality rate: (7-2) Empty run rate: (7-3) In the formula To the number of times the train arrives on time, This represents the total number of arrivals. This refers to the empty mileage. This represents the total mileage traveled.

[0142] Path optimization metrics: Travel time savings rate: (7-4) In the formula The estimated time for the original route. This is the optimized actual time.

[0143] Passenger satisfaction: (7-5) 2. Comparison of evaluation results Compare the calculated value with the preset threshold: Standards for compliance: minute, , , , ; If all indicators meet the criteria, the system will maintain the current model. If any indicator fails to meet the standard (e.g.) (minutes), triggering the iteration process.

[0144] 3. Model Iterative Optimization Data Supplementation: Add the “Execution Process Dataset” (actual passenger volume, speed) from S5 and the “Path Rating Results” from S6 to the “Model Training Dataset” from S2, adding ≥10,000 new samples; Model retraining: Return to S3 and retrain the model using the supplemented dataset, focusing on the following adjustments: like Unsatisfactory: Increase the number of hidden layer neurons in the LSTM model (from 64 to 128) to improve passenger volume prediction accuracy; like If not met: Adjust the weights of the reward function in the PPO model (increase the weight of travel time savings). Model replacement: The retrained "iterative optimization scheduling model" replaces the original model in S3 and is used for subsequent decisions in S4 and S6.

[0145] 7.3 Output Results The "Dispatch Optimization Effect Evaluation Report" (including indicator calculations, comparison conclusions, and improvement suggestions) is stored in the "Evaluation Report Library" for reference by the bus company's management. The "iterative optimization scheduling model" is transmitted to S3, S4, and S6 as a new decision-making basis to complete the system iteration.

Claims

1. An AI-driven method for real-time scheduling and route optimization of public transport vehicles, characterized in that: Includes the following steps: S1. Collect real-time status data of buses, real-time traffic data, passenger-related data, basic data of bus stops and routes, and constraint data to generate a raw multi-source bus data set; S2. Clean, integrate, standardize, and divide the original multi-source bus data set to generate model training dataset, model validation dataset, and real-time bus operation basic dataset; S3. Based on the model training dataset and the model validation dataset, construct and train a pre-trained scheduling optimization model with a three-level fusion architecture, which includes: (1) Machine learning prediction layer: predict the cumulative number of passengers at each bus stop through the random forest model and predict the traffic speed of each road segment through the extreme gradient boosting model. (2) Deep learning temporal layer: The prediction results of the random forest model are input into the long short-term memory network model for temporal correction to obtain the corrected cumulative number of passengers; The prediction results of the extreme gradient boosting model are input into the gated recurrent unit model for temporal correction to obtain the corrected traffic speed of each road segment; (3) Reinforcement learning decision layer: Based on the corrected cumulative number of passengers and the passage speed of each road segment, the deep Q network model generates discrete scheduling decisions such as departure interval adjustment, temporary addition of vehicles, station adjustment, and replacement of faulty vehicles. The near-end strategy optimization model generates path optimization decisions. S4. Generate real-time dispatching decision instructions based on the pre-trained scheduling optimization model and the real-time bus operation basic dataset; S5. Public buses execute real-time dispatching decisions and collect data during the execution process; S6. Based on real-time scheduling decision instructions, execution process data, and real-time traffic changes, dynamically optimize the path through the near-end strategy optimization model and generate path optimization adjustment instructions.

2. The AI-driven real-time scheduling and route optimization method for public transportation according to claim 1, characterized in that, It also includes S7: Based on the execution process data and the execution results of the path optimization adjustment instructions, evaluate the scheduling effect. If the evaluation indicators do not meet the standards, the execution process data is added to the model training dataset, and the process is returned to S3 to retrain the model to complete the iteration.

3. The AI-driven real-time scheduling and route optimization method for public transportation as described in claim 1, characterized in that, In S3, the interaction process between the machine learning prediction layer and the deep learning temporal layer includes: using the passenger cumulative number prediction sequence output by the random forest model as the input of the long short-term memory network model, the long short-term memory network model captures temporal features through a gating mechanism and outputs a correction value, and then obtains the final passenger volume prediction result through weighted fusion; using the traffic speed prediction sequence of each road segment output by the extreme gradient boosting model as the input of the gated recurrent unit model, the gated recurrent unit model captures temporal features through update gates and reset gates and outputs a correction value, and then obtains the final road segment speed prediction result through weighted fusion.

4. The AI-driven real-time scheduling and route optimization method for public transportation according to claim 1, characterized in that, In S3, the interaction process between the deep learning temporal layer and the reinforcement learning decision layer includes: integrating the corrected cumulative number of passengers and the predicted traffic speed of each road segment into a state vector, and inputting it into the deep Q-network model and the near-end policy optimization model; the deep Q-network model calculates the Q value of each scheduling decision based on the state vector and selects the optimal decision; the near-end policy optimization model optimizes the path strategy based on the decision results of the state vector and the deep Q-network model and generates the optimal path.

5. The AI-driven real-time scheduling and route optimization method for public transportation according to claim 1, characterized in that, In S3, a dynamic feedback closed loop is constructed, which specifically includes: adjusting the fusion weights of the machine learning prediction layer and the deep learning temporal layer in real time based on the total model loss, and comprehensively considering the passenger volume prediction error, road segment speed prediction error and decision effect loss in the total model loss; when the total model loss does not decrease for a preset number of consecutive rounds, the weight adjustment is stopped, and the closed loop optimization is completed.

6. The AI-driven real-time scheduling and route optimization method for public transportation according to claim 1, characterized in that, In S4, when generating real-time scheduling decision instructions, different decision types need to be triggered based on the passenger delay risk and congestion risk output by S3 for the next 15 minutes: when the passenger delay risk is high, the decision to shorten the departure interval or temporarily add vehicles is triggered; when the congestion risk is high, the decision to change the route is triggered; when the station is temporarily closed, the decision to adjust the station is triggered.

7. The AI-driven real-time scheduling and route optimization method for public transportation according to claim 1, characterized in that, In S6, the specific process of dynamic route optimization includes: evaluating the remaining travel time of the current route based on real-time traffic data, generating 3 to 5 alternative routes that meet the requirements of station overlap rate ≥ 80% and detour distance increase ≤ 10%; calculating the comprehensive score of each alternative route through the near-end strategy optimization model, and selecting the route with the highest score as the dynamic optimization route.

8. The AI-driven real-time scheduling and route optimization method for public transportation according to claim 2, characterized in that, In S7, the evaluation indicators include average passenger waiting time, vehicle punctuality rate, vehicle empty running rate, route travel time saving rate, and passenger satisfaction. When any indicator fails to meet the standard, the model is triggered to iterate. The iteration includes increasing the training sample size, adjusting the number of neurons in the hidden layer of the long short-term memory network model, or optimizing the reward function weights of the proximal strategy model.

9. The AI-driven real-time scheduling and route optimization method for public transportation according to claim 1, characterized in that, In S5, the execution process data includes the actual departure time, actual travel route, actual number of passengers getting on and off at each station, average vehicle speed, and passenger satisfaction. The execution process data is fed back to S2, S6, and S7 in real time.

10. The AI-driven real-time scheduling and route optimization method for public transportation according to claim 5, characterized in that, The termination condition for the dynamic feedback loop is: the MAE of passenger volume forecast < 5%, RMSE < 8%, and R 2 >0.90, the predicted speed of the road segment is MAE <10%, RMSE <15%, and R 2 >0.85, while the decision-making effect meets the requirements of average passenger waiting time ≤5 minutes, vehicle empty running rate ≤10%, and route punctuality rate ≥90%.

Citation Information

Cited By

  • Passenger flow-energy consumption joint optimization AI scheduling method and system for electric bus fleet

    CN121809989A