Intelligent scheduling decision support method and system for community bus special lines
By collecting and integrating data, identifying travel destination patterns, and optimizing routes using a multi-agent collaborative decision-making framework, the problem of community bus dispatching systems being unable to accurately distinguish passenger needs has been solved. This has enabled intelligent on-demand allocation of transport capacity, improving the efficiency and satisfaction of key travel services.
Patent Information
- Application Number
- CN202512042801.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-12-31
AI Technical Summary
The existing community bus dispatch system cannot accurately distinguish the travel needs of passengers going to different destinations, which makes it impossible for dispatch decisions to intelligently determine which type of service should be prioritized, thus making it difficult to improve the efficiency and satisfaction of critical travel services.
By collecting and integrating historical passenger flow data, real-time travel booking request data, and static data, clustering algorithms are used to identify travel destination patterns. A multi-agent collaborative decision-making framework is used to generate dynamic scheduling schemes, optimize route sequences, and generate skip-station instructions to achieve on-demand intelligent allocation of transport capacity.
This has enabled a shift from uniform service to precise support, with intelligent priority given to high-priority needs, thereby improving the reliability of critical public services in the community and passenger satisfaction.
Smart Images

Figure CN121436610A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of intelligent transportation, and in particular to an intelligent dispatching decision support method and system for community bus lines. Background Technology
[0002] As an important public transportation service connecting residential communities with surrounding public facilities, the scheduling efficiency of community bus lines directly affects the convenience of residents' travel and the accessibility of public services. Traditionally, the operation and scheduling of such lines have largely relied on fixed timetables, static route planning, and the personal experience and judgment of dispatchers.
[0003] In existing technologies, common practices to improve the scientific nature of scheduling include using historical passenger flow data for statistical analysis to optimize fixed schedules, or using onboard GPS positioning data to achieve real-time vehicle monitoring and simple status adjustments. Some more advanced systems attempt to integrate real-time passenger reservation requests to fine-tune specific schedules. Furthermore, some research focuses on applying time series forecasting models to predict short-term passenger flow at stations or cross-sections, providing a reference for scheduling decisions.
[0004] However, these existing methods generally suffer from a core flaw: they typically process passenger flow data in a general way, failing to accurately differentiate between the travel needs of passengers heading to different destinations such as schools, hospitals, and markets. This forces scheduling decisions to be adjusted based solely on overall passenger flow levels. When multiple needs such as going to school or seeking medical care occur simultaneously, the system cannot intelligently determine which type of service should be prioritized, thus making it difficult to truly improve the efficiency and satisfaction of community public transportation in ensuring critical travel needs. Summary of the Invention
[0005] In order to achieve precise scheduling of community buses based on travel purpose identification and priority guarantee, and upgrade from capacity sharing to on-demand intelligent allocation, this application provides an intelligent scheduling decision support method and system for community bus lines.
[0006] Firstly, this application provides an intelligent dispatching decision support method for community bus lines, employing the following technical solution:
[0007] A smart dispatching decision support method for community bus routes includes:
[0008] Collect and integrate historical passenger flow card swiping data from the payment system, real-time travel reservation request data from a dedicated application APP for community members, and static data containing community population structure and public facility distribution, and construct a travel demand dataset through spatiotemporal index alignment;
[0009] Based on travel demand datasets and public facility distribution information, a clustering algorithm is used to identify travel purpose patterns with different spatiotemporal characteristics. Based on this, a subset of travel records corresponding to each pattern is divided to extract their spatiotemporal clustering features, time series evolution features, and spatial correlation features. These features are then input into a multi-head attention prediction model with integrated adaptive weights to generate a prediction report that includes time-segmented passenger flow heatmaps and spatiotemporal probability matrices for each pattern. Based on the spatiotemporal probability matrices of each pattern and the preset community service strategy, the priority values of the service time window for each pattern are calculated and generated.
[0010] Based on the prediction report and service time window priority values, a multi-agent collaborative decision-making framework is constructed. The route planning agent takes the passenger flow heat map and spatiotemporal probability matrix as input and optimizes the route sequence under the constraints of mandatory stops and vehicle capacity. The skip-stop decision agent generates skip-stop instructions based on the service time window priority values and the competition depth Q network. The two agents coordinate strategies through a shared critic network. The global reward function of the critic network assigns higher on-time rate weights to travel destination patterns with priority values higher than a set threshold, and jointly outputs a dynamic scheduling scheme.
[0011] The dynamic scheduling scheme is converted into instructions and sent to the vehicle and passenger service terminals to complete real-time scheduling.
[0012] By adopting the above technical solutions, this method identifies different travel purpose modes (such as commuting and medical treatment) and quantifies their service priorities, achieving a shift in scheduling from "uniform service" to "precise guarantee." Based on multi-agent collaborative decision-making, the system can intelligently prioritize high-priority needs (such as medical treatment) when capacity is tight, while optimizing overall route efficiency, thereby significantly improving the reliability of critical public services in the community and passenger satisfaction.
[0013] Secondly, this application provides an intelligent dispatching decision support system for community bus lines, which adopts the following technical solution:
[0014] A smart dispatching decision support system for community bus routes includes a memory, a processor, and a program stored in the memory and executable on the processor. When the program is loaded and executed by the processor, it implements the smart dispatching decision support method for community bus routes as described in the first aspect. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating an intelligent dispatching decision support method for community bus lines according to an embodiment of this application.
[0016] Figure 2 This is a flowchart illustrating another embodiment of the present application, which uses a clustering algorithm to identify travel destination patterns with different spatiotemporal characteristics based on a travel demand dataset and public facility distribution information. Detailed Implementation
[0017] The present application will be further described in detail below with reference to the accompanying drawings.
[0018] Reference Figure 1 This application discloses an intelligent dispatching decision support method for community bus routes, comprising:
[0019] Step S1: Collect and integrate historical passenger flow card swiping data from the payment system, real-time travel reservation request data from the dedicated application APP for community members, and static data containing community population structure and public facility distribution, and construct a travel demand dataset by aligning it with spatiotemporal indexes.
[0020] The data includes: Historical passenger card swipe data: Records passenger card swipe behavior, including card number, swipe time, and station information, obtained from the bus company's database. Real-time travel reservation request data: Travel requests submitted by community residents through the app, including origin and destination points, time windows, etc., pushed to the dispatch platform in real time via the app. Static data: Information on community population structure and public facility distribution, obtained from civil affairs and planning departments, stored in file format. Spatiotemporal index alignment: Data is unified to the same spatiotemporal benchmark for easier subsequent processing.
[0021] The necessary processes are described below: 1. Data Collection: Historical passenger flow card swiping data is obtained from the public transportation payment system, including card number, swiping time, station number, etc.; real-time travel reservation request data is collected through a community-specific APP. With the user's explicit authorization and agreement to the "Privacy Policy" and "Data Usage Agreement," travel demand information such as origin and destination latitude and longitude, and expected travel time is obtained. User IDs and other direct personal identifiers are anonymized and hashed after transmission; static data on community population structure and public facility distribution are obtained from civil affairs and planning departments and stored in file format. All data collection, storage, and processing processes comply with relevant laws and regulations to ensure data security and are used solely for the purpose of optimizing public transportation services. 2. Spatiotemporal Index Alignment and Data Fusion: Geographic coordinates are encoded using the GeoHash algorithm, dividing the community into a 500m × 500m spatial grid, and time is divided into 15-minute granularities to generate spatiotemporal index keys. Card swiping data, reservation request data, and static data are aligned using the spatiotemporal index, marking travel purposes such as medical treatment, schooling, etc. Simultaneously, the population density index of each grid is calculated to enrich the dataset features.
[0022] 3. Construction of Travel Demand Dataset: Construct a structured travel demand dataset. Each row contains features such as a spatiotemporal index key, passenger flow count, number of reservation users, a vector of surrounding facility types (e.g., [0,1,0,1] indicates the presence of schools and shopping malls nearby), and population density index. For example, a spatiotemporal unit data set might be "ws7j9e_202501150730,50,20,[0,1,0,1],0.8", indicating that this unit contains 50 card swipes, 20 reservation requests, schools and shopping malls nearby, and a population density index of 0.8.
[0023] Step S2: Based on the travel demand dataset and public facility distribution information, a clustering algorithm is used to identify travel destination patterns with different spatiotemporal characteristics. Based on this, a subset of travel records corresponding to each pattern is divided to extract its spatiotemporal clustering features, time series evolution features, and spatial correlation features. These features are then input into a multi-head attention prediction model with integrated adaptive weights to generate a prediction report containing time-segmented passenger flow heatmaps and spatiotemporal probability matrices for each pattern. Based on the spatiotemporal probability matrices of each pattern and the preset community service strategy, the service time window priority values for each pattern are calculated and generated.
[0024] The spatiotemporal probability matrix describes the probability of different travel modes occurring within each spatiotemporal unit, used to assess the distribution characteristics of each mode. The service time window priority value, calculated based on the spatiotemporal probability matrix and community service strategy, reflects the service importance of each travel mode in different time periods.
[0025] The process of identifying travel destination patterns with different spatiotemporal characteristics using clustering algorithms can be found in steps S21 to S25, and will not be elaborated here. The process of generating a prediction report including time-segmented passenger flow heatmaps and spatiotemporal probability matrices for each pattern can be found in steps S2a to S2e. The process of calculating and generating service time window priority values for each pattern can be found in steps S2A to S2D.
[0026] Step S3: Based on the prediction report and service time window priority values, a multi-agent collaborative decision-making framework is constructed. The route planning agent uses the passenger flow heat map and spatiotemporal probability matrix as input to optimize the route sequence under the constraints of mandatory stops and vehicle capacity. The skip-stop decision agent generates skip-stop instructions based on the service time window priority values and the competition depth Q network. The two agents coordinate strategies through a shared critic network. The global reward function of the critic network assigns higher on-time rate weights to travel destination patterns with priority values higher than a set threshold, and jointly outputs a dynamic scheduling scheme.
[0027] The multi-agent collaborative decision-making framework is a system composed of multiple agents that collaborate to complete complex tasks. This step includes a route planning agent and a stop-skipping decision agent. The route planning agent is responsible for optimizing bus route sequences, taking passenger flow heatmaps and spatiotemporal probability matrices as input, and outputting the optimized route sequences. The stop-skipping decision agent is responsible for generating stop-skipping instructions, taking service time window priority values as input, and generating decisions through a competitive deep Q-network (DQN). The critic network evaluates the agent's policies, assessing and adjusting the agent's decisions through a global reward function. The global reward function assigns different weights to different travel modes based on priority values, prioritizing the on-time performance of high-priority modes.
[0028] Among these steps, optimizing the route sequence under the constraints of mandatory stops and vehicle capacity can be referred to in steps S31 to S35; generating stop-skipping instructions based on the service time window priority value and the competition depth Q network can be referred to in steps S3a to S3c; and jointly outputting the dynamic scheduling scheme can be referred to in steps 1 to 8.
[0029] Step S4 involves converting the dynamic scheduling plan into instructions and sending them to the onboard and passenger service terminals to complete real-time scheduling. The onboard terminal is a device installed on the bus to receive scheduling instructions and adjust vehicle operating status in real time. The passenger service terminal is an app or other information terminal used by community residents to provide passengers with real-time bus information and scheduling change notifications.
[0030] The necessary processes are described below: 1. Command Conversion and Issuance: The dynamic scheduling plan is converted into a specific command format to adapt to the system requirements of the on-board terminal and passenger service terminal. After receiving the command, the on-board terminal automatically adjusts the vehicle's route and stops. Example: The dispatch system sends the command "Vehicle A123 will skip stop B in the current route and add a stop C" to the on-board terminal, and the driver adjusts the vehicle's operating status according to the command. 2. Real-time Information Push: Real-time dispatch information, including vehicle location, estimated arrival time, and stop changes, is pushed to passengers through the passenger service terminal (such as a community APP). Example: Passengers receive a notification through the APP: "Due to dynamic adjustments, the A123 bus you are taking will add a stop C, and the estimated arrival time will be 5 minutes earlier. Please check." 3. Dispatch Execution and Feedback: After the on-board terminal and passenger service terminal execute the dispatch command, they provide real-time feedback on the execution status. The dispatch system further optimizes the dispatch plan based on the feedback information to ensure the accuracy and efficiency of dispatch. Example: After confirming that the vehicle has adjusted its route as instructed, the driver reports the execution status through the onboard terminal; passengers provide feedback on their satisfaction with the dispatch change via the app, and the dispatch system optimizes subsequent dispatch strategies based on the feedback. 4. Real-time Dispatch: Through the collaborative work of the onboard terminal and passenger service terminal, the dynamic dispatch plan is successfully executed, achieving real-time optimization and efficient operation of public transportation services. Example: During the weekday morning rush hour, a certain route adjusts its stops according to the dynamic dispatch plan to ensure that students and passengers seeking medical treatment can arrive at their destinations on time. Simultaneously, passengers can monitor vehicle status in real time via the app, improving their travel experience.
[0031] Reference Figure 2 Based on travel demand datasets and public facility distribution information, clustering algorithms are used to identify travel destination patterns with different spatiotemporal characteristics, including:
[0032] Step S21: De-identify the historical passenger flow card swipe data and real-time reservation request data to generate an anonymous travel trajectory record containing only departure time, departure location and arrival time.
[0033] The de-identification process involves removing personally identifiable information (such as card numbers and user IDs) from the data while retaining travel-related spatiotemporal information to protect user privacy. The necessary steps are as follows: After extracting historical passenger flow card-swiping data and real-time reservation request data from the public transport payment system and community app, the card numbers and user IDs are encrypted using the SHA-256 hash algorithm to remove personally identifiable information. The data is then cleaned using the Pandas library, retaining travel information such as departure time, departure location, and arrival time, and the timestamps and latitude / longitude are formatted. Finally, anonymous travel trajectory records are generated and stored in HDFS or a relational database to provide data support for subsequent analysis.
[0034] Step S22: A density-based spatiotemporal clustering algorithm is used to cluster anonymous travel trajectory records by defining a spatiotemporally coupled neighborhood with a preset spatial neighborhood radius and time window, resulting in multiple travel behavior clusters. The density-based spatiotemporal clustering algorithm is a clustering algorithm that identifies clusters by calculating the density of data points within the spatiotemporal neighborhood. This algorithm can effectively handle noise and outliers in spatiotemporal data and is suitable for cluster analysis of travel trajectory data. The spatiotemporally coupled neighborhood is the region defined by the preset spatial neighborhood radius and time window, used to determine the spatiotemporal correlation between data points. The spatial neighborhood radius defines the distance range within the geographic space, and the time window defines the time range in the time dimension. Anonymous travel trajectory records are data that has undergone de-identification processing, containing only travel-related information such as departure time, departure location, and arrival time, used for subsequent cluster analysis. Travel behavior clusters are sets of travel behaviors with similar spatiotemporal characteristics obtained through the clustering algorithm; each cluster represents a specific travel pattern.
[0035] The specific process is as follows:
[0036] 1. Define the spatiotemporal coupling neighborhood: Preset the spatial neighborhood radius (e.g., 500 meters) and time window (e.g., 30 minutes). These two parameters together define the spatiotemporal coupling neighborhood. For each anonymous travel trajectory record, calculate its spatial and temporal distances to other records. Spatial distance is calculated using Euclidean distance, and temporal distance is calculated using the absolute value of the timestamp difference.
[0037] For example: Suppose two travel trajectories originate from latitude and longitude coordinates (114.0582, 22.5431) and (114.0592, 22.5441), respectively, and depart at times of 2025-01-15T07:45:00Z and 2025-01-15T07:50:00Z. The calculated spatial distance is 141.4 meters (Euclidean distance), and the temporal distance is 5 minutes. If the preset spatial neighborhood radius is 500 meters and the time window is 30 minutes, then these two trajectories are within a spatiotemporally coupled neighborhood.
[0038] 2. Density-Based Spatiotemporal Clustering: The DBSCAN algorithm is used to cluster anonymous travel trajectory records. The DBSCAN algorithm identifies clusters by calculating the density of each data point within its spatiotemporal neighborhood. Core points are those points with at least MinPts (e.g., 5) points in their neighborhood; these points form a cluster. Edge points are points with fewer than MinPts in their neighborhood but connected to a core point. Noise points are points that are neither core points nor edge points. For example, suppose there are 10 travel trajectories in a certain area within a certain time period. Eight of these trajectories have a spatial distance of less than 500 meters and a time distance of less than 30 minutes, satisfying the condition MinPts=5. These eight trajectories will be classified into one travel behavior cluster. The remaining two trajectories, if not spatiotemporally connected to this cluster, may be classified as noise points or form a new small cluster.
[0039] 3. Generating Travel Behavior Clusters: Using the DBSCAN algorithm, anonymous travel trajectory records are divided into multiple travel behavior clusters. Trajectories within each cluster are similar in time and space, representing a specific travel pattern. For example, cluster analysis reveals multiple travel behavior clusters in a community during weekday mornings from 7:00 to 9:00. One cluster contains multiple trajectories from the community to a nearby school; these trajectories have highly concentrated departure times and locations and are labeled as the "school-going pattern." Another cluster contains multiple trajectories going to the hospital and is labeled as the "medical-seeking pattern."
[0040] 4. Clustering Result Evaluation: The generated travel behavior clusters are evaluated to ensure the rationality and effectiveness of the clustering results. The separation and compactness of clusters can be assessed using indicators such as the silhouette coefficient. The closer the silhouette coefficient value is to 1, the higher the similarity within a cluster and the greater the difference between clusters. For example, calculating the silhouette coefficient of the clustering results: if the silhouette coefficient is 0.7, it indicates that the clustering result is relatively ideal, the travel trajectories within the cluster have high similarity in time and space, and the differences between different clusters are significant.
[0041] Step S23: Based on the public facility distribution information, spatially match the endpoint location of the trajectory within each travel behavior cluster with public facilities within a preset distance range. The specific process can be found in steps S231 to S234, and will not be elaborated here.
[0042] Step S24: Semantic annotation is performed based on the matching results. When the proportion of matching trajectories between a certain type of public facility and a certain travel behavior cluster exceeds a preset threshold, the travel behavior cluster is labeled as a pattern where the travel purpose is that type of public facility. Semantic annotation assigns a label with clear meaning to the travel behavior cluster, describing the main travel purpose, such as "going to school," "seeking medical treatment," or "shopping." Preset threshold: A proportion (e.g., 60%) used to determine whether a certain type of public facility is the main travel purpose of a certain travel behavior cluster. If the proportion of matching trajectories between this type of public facility and the total number of trajectories in the cluster exceeds this threshold, then the public facility is considered the main travel purpose of the cluster. Number of matching trajectories: The number of trajectories that have a spatial matching relationship with a certain type of public facility in step S23. Total number of trajectories in the cluster: The total number of trajectories contained in a certain travel behavior cluster.
[0043] The necessary process is as follows: 1. Count the number of matching trajectories: For each travel behavior cluster, count the number of trajectories that have a spatial matching relationship with each type of public facility. For example: In a travel behavior cluster, there are 100 trajectories, of which 60 trajectories have a spatial matching relationship with schools, 30 trajectories have a spatial matching relationship with hospitals, and 10 trajectories have a spatial matching relationship with shopping malls. 2. Calculate the matching ratio: Calculate the proportion of matching trajectories for each type of public facility to the total number of trajectories in the cluster. For example: For the above travel behavior cluster, the proportion of matching trajectories for schools is 60%, for hospitals it is 30%, and for shopping malls it is 10%. 3. Determine the main travel purpose: Based on a preset threshold (e.g., 60%), determine whether a certain type of public facility is the main travel purpose of the travel behavior cluster. If the matching ratio of a certain type of public facility exceeds the preset threshold, the travel behavior cluster is marked as a mode with that type of facility as the travel purpose. For example: The preset threshold is 60%. Since the proportion of matching trajectories for schools is 60%, reaching the preset threshold, the travel behavior cluster is marked as "going to school mode". 4. Label travel purpose patterns: Use the judgment results as semantic labels to assign clear travel purpose tags to travel behavior clusters. For example, labeling the above travel behavior cluster as "going to school pattern" indicates that the main travel purpose of this cluster is to go to school.
[0044] Step S25: Based on the annotation results, obtain each travel behavior cluster with semantic travel purpose labels and its spatiotemporal characteristics. The semantic travel purpose label refers to the main travel purpose of the travel behavior cluster annotated in step S24, such as "going to school," "seeking medical treatment," or "shopping," which has a clear semantic meaning.
[0045] The necessary process is as follows: 1. Integrate the annotation results with spatiotemporal features: Integrate the semantic travel purpose labels obtained in step S24 with the spatiotemporal features of the travel behavior clusters extracted in step S22. Each travel behavior cluster not only has a clear travel purpose label, but also retains its temporal and spatial feature information. For example, a travel behavior cluster is labeled as "going to school mode," and its spatiotemporal features include departure times concentrated between 7:00-8:00 am on weekdays, departure locations mainly concentrated around the community, and destination locations concentrated near schools. 2. Extract detailed spatiotemporal features: For each travel behavior cluster, further extract detailed spatiotemporal features, including but not limited to: 2.1. Temporal features: the distribution pattern of travel time, such as peak hours and off-peak hours. 2.2. Spatial features: the distribution of departure and destination locations, the density and concentration areas of the trajectory. 2.3. Trajectory features: the length, direction, and speed of the trajectory. For example, for the "going to school" travel behavior cluster, the temporal features show that travel is concentrated between 7:00 and 8:00 AM on weekdays, and the spatial features show that departure points are mainly concentrated in several residential areas around the community, and destination locations are concentrated near the school, with trajectory lengths mostly between 2 and 5 kilometers. 3. Generating semantically meaningful travel behavior clusters: After integrating the annotation results and spatiotemporal features, travel behavior clusters with semantically meaningful travel purpose labels are generated. These clusters not only clearly define the travel purpose but also describe the spatiotemporal patterns of the travel in detail. For example, the generated travel behavior cluster is described as: "Going to school mode, travel time is concentrated between 7:00 and 8:00 AM on weekdays, departure points are mainly concentrated in several residential areas around the community, destination locations are concentrated near the school, and trajectory lengths are mostly between 2 and 5 kilometers."
[0046] Based on public facility distribution information, spatial matching is performed between the endpoint location of each travel behavior cluster's trajectory and public facilities within a preset distance range, including:
[0047] Step S231: Based on the functional type and scale attributes of public facilities, differentiated spatial influence radii are set to construct a facility influence range model. The functional type and scale attributes of public facilities are as follows: Public facilities are classified and described according to their functions (e.g., schools, hospitals, shopping malls) and scale (e.g., number of students in a school, number of beds in a hospital, area of a shopping mall), and these attributes determine the service capacity and influence range of the facility. Spatial influence radius: The radius range set according to the functional type and scale attributes of public facilities is used to define the geographical area that the facility can effectively serve. Facilities with different functions and scales have different spatial influence radii. Facility influence range model: A model constructed based on the functional type and scale attributes of public facilities is used to describe the spatial influence range of each facility, providing a basis for subsequent spatial matching.
[0048] The necessary process is as follows: 1. Functional type and scale attribute analysis: First, conduct a detailed analysis of the functional type and scale attributes of the public facilities. Based on the functional type (e.g., school, hospital, shopping mall, etc.) and scale attributes (e.g., number of students in a school, number of beds in a hospital, area of a shopping mall, etc.), determine the service capacity and scope of influence of each facility. For example, for a large school (more than 3,000 students), its spatial radius of influence may be set at 2 kilometers; while for a small community hospital (less than 100 beds), its spatial radius of influence may be set at 1 kilometer. 2. Set differentiated spatial radius of influence: Based on the functional type and scale attributes of the public facilities, set differentiated spatial radii of influence. Large facilities usually have larger spatial radii of influence, while small facilities have relatively smaller spatial radius of influence. For example, the spatial radius of influence of a large shopping mall (area exceeding 10,000 square meters) is set at 3 kilometers, while the spatial radius of influence of a small convenience store (area less than 100 square meters) is set at 500 meters. 3. Construct a facility influence range model: Based on the set spatial radius of influence, construct a facility influence range model. This model uses Geographic Information System (GIS) technology to combine the geographic coordinates of each facility with its corresponding spatial radius of influence to generate the facility's geographic influence area. For example, using GIS software, the school's location coordinates (114.0600, 22.5450) and its 2-kilometer spatial radius of influence are combined to generate a circular influence area. This area is considered the geographic range that can be effectively served by the school.
[0049] Step S232: For each travel behavior cluster, perform a preliminary matching between its trajectory endpoint and the facility impact range model to generate a candidate set of destination facilities. Then, using this candidate set as input, calculate the actual path distance from each trajectory endpoint to the candidate facilities based on road network data, perform precise matching, and output a list of candidate facilities and their precise path distances for each trajectory. Wherein, road network data contains detailed information about the road network, such as road type, length, and connectivity, used to calculate the actual path distance. Candidate set: The set of possible destination facilities generated in the preliminary matching stage, used for further precise matching. Precise path distance: The actual path distance from the trajectory endpoint to the candidate facility calculated based on road network data, taking into account actual traffic conditions and the road network.
[0050] The necessary process is as follows: 1. Preliminary matching to generate a candidate set: For each travel behavior cluster, perform a preliminary matching between its trajectory endpoint and the facility influence range model. Specifically, check whether the endpoint of each trajectory is within the spatial influence range of a certain facility. If the trajectory endpoint is within the influence range of a facility, then add that facility to the candidate set. For example: A trajectory endpoint in a certain travel behavior cluster is located at latitude and longitude (114.0610, 22.5460). Through the facility influence range model, it is found that this point is within the influence range of a school (spatial influence radius of 2 km) and a hospital (spatial influence radius of 1 km). Therefore, both the school and the hospital are added to the candidate set. 2. Calculate the actual path distance based on road network data: Using the candidate set generated by the preliminary matching as input, calculate the actual path distance from each trajectory endpoint to the candidate facility based on the road network data. Use a path planning algorithm (such as Dijkstra's algorithm or A* algorithm) to calculate the shortest path on the road network data. For example: For the above trajectory endpoint (114.0610, 22.5460), calculate the actual path distance to the school and the hospital. Assume road network data indicates that the shortest path distance to the school is 1.5 km and the shortest path distance to the hospital is 0.8 km. 3. Perform exact matching: Based on the calculated actual path distances, perform exact matching. Select the facility with the shortest actual path distance as the primary destination of the trajectory. Example: In the above example, since the actual path distance to the hospital (0.8 km) is shorter than the distance to the school (1.5 km), the hospital is selected as the primary destination for this trajectory. 4. Output exact matching list: For each trajectory, output a list of its corresponding candidate facilities and their exact path distances. The list includes information such as the name, type, and actual path distance of each candidate facility. For example, the output list is as follows:
[0051] Trajectory endpoint: (114.0610, 22.5460);
[0052] Candidate Facility 1: School, actual path distance: 1.5 km;
[0053] Candidate Facility 2: Hospital, actual path distance: 0.8 km;
[0054] Primary destination: Hospital.
[0055] Step S233: For each trajectory, select the facility with the shortest actual path distance from the list of precisely matched trajectories as its primary destination. If the actual path distance is less than a preset threshold, the trajectory is considered successfully associated with the facility. The preset threshold is a set upper limit for distance used to determine the association between the trajectory's endpoint and the facility. If the actual path distance is less than this threshold, the trajectory is considered successfully associated with the facility.
[0056] For each trajectory, the facility with the shortest actual path distance is selected from its exact match list as the primary destination. If the shortest path distance is less than a preset threshold, the trajectory is considered successfully associated with the facility. The specific steps are as follows: 1. Select the shortest path facility: For each trajectory, select the facility with the shortest actual path distance from its exact match list as the primary destination. Example: The exact match list for a trajectory shows a distance of 1.5 km to the school and 0.8 km to the hospital; therefore, the hospital is selected as the primary destination. 2. Determine association: Check if the shortest path distance is less than a preset threshold. If it is less than the threshold, the trajectory is considered successfully associated with the facility; otherwise, it is considered unassociated. Example: The preset threshold is 1 km; the distance from the trajectory to the hospital is 0.8 km, which is less than the threshold; therefore, the trajectory is considered successfully associated with the hospital.
[0057] Step S234: For each travel behavior cluster, count the number of successfully associated trajectories and their corresponding public facilities of different types, forming a facility matching statistical matrix. Successfully associated trajectories are those whose actual path distance to a public facility is less than a preset threshold, as determined in step S233. The facility matching statistical matrix is a statistical matrix that records the number of successfully associated trajectories and their corresponding public facilities of different types within each travel behavior cluster, used to analyze the main travel purposes of each cluster.
[0058] The necessary process is as follows: 1. Count the number of successfully associated trajectories: For each travel behavior cluster, count the number of all successfully associated trajectories and their corresponding public facilities of different types. Specifically, iterate through all trajectories in each travel behavior cluster, check whether each trajectory is successfully associated with a public facility, and record the associated facility type. For example: In a travel behavior cluster with 100 trajectories, 60 are successfully associated with schools, 30 with hospitals, and 10 with shopping malls. 2. Construct a facility matching statistics matrix: Based on the statistical results, construct a facility matching statistics matrix. The matrix records the number of trajectories in each travel behavior cluster that are successfully associated with each type of public facility. For example: Assume there are two travel behavior clusters (cluster 1 and cluster 2), and the public facility types include schools, hospitals, and shopping malls. The statistical results are as follows:
[0059] Cluster 1: 60 items for schools, 30 items for hospitals, and 10 items for shopping malls;
[0060] Cluster 2: 20 items for schools, 40 items for hospitals, and 40 items for shopping malls.
[0061] The facility matching statistics matrix is recorded as follows:
[0062] Cluster 1: Schools 60, Hospitals 30, Shopping malls 10;
[0063] Cluster 2: Schools 20, Hospitals 40, Shopping malls 40.
[0064] The generated forecast report includes time-segmented passenger flow heatmaps and spatiotemporal probability matrices for each mode, and includes:
[0065] Step S2a: Based on the travel record subsets corresponding to each travel destination mode, multimodal feature extraction technology is used to acquire spatiotemporal clustering features, time series evolution features, and spatial correlation features in parallel. These features are then fused into a unified multimodal feature representation using an attention-weighted feature fusion algorithm. The multimodal feature extraction technology is a technique that integrates multiple data feature extraction methods to extract data features from different perspectives (such as space, time, and correlation) to obtain a more comprehensive data representation. Spatiotemporal clustering features describe the clustering characteristics of data in time and space, such as cluster centers and density distribution. Time series evolution features describe the trends and patterns of data changes over time, such as periodicity and trends. Spatial correlation features describe the spatial relationships between data, such as spatial autocorrelation and spatial clustering. The attention-weighted feature fusion algorithm is an algorithm that dynamically adjusts the weights of each feature through an attention mechanism to fuse features from different modalities into a unified feature representation.
[0066] The necessary processes are described below: 1. Spatiotemporal Clustering Feature Extraction: For each travel destination pattern's corresponding subset of travel records, a clustering algorithm (such as DBSCAN) is used to perform spatiotemporal clustering to extract spatiotemporal clustering features. These features include cluster centers, density distribution, etc., which can reflect the spatiotemporal aggregation characteristics of travel records. For example, for the "going to school" travel record subset, the DBSCAN algorithm discovers multiple cluster centers, each representing a high-density travel area, such as the area around a school. 2. Time Series Evolution Feature Extraction: Analyze the passenger flow change trends of each travel destination pattern in different time periods to extract time series evolution features. These features describe the changing patterns of passenger flow over time, such as peak hours and off-peak hours. For example, for the "commuting to work" pattern, analysis shows that 7:00-9:00 AM on weekdays is the peak period, with significantly higher passenger flow density than other times. 3. Spatial Association Feature Extraction: Spatial analysis methods (such as spatial autocorrelation analysis) are used to evaluate the spatial association between travel records to extract spatial association features. These features describe the spatial relationships between travel records, such as spatial clustering. For example, for the "shopping pattern," spatial autocorrelation analysis reveals a high spatial clustering of travel records around shopping malls, indicating that these areas are primary shopping destinations. 4. Attention-weighted feature fusion: An attention-weighted feature fusion algorithm integrates spatiotemporal clustering features, time-series evolution features, and spatial correlation features into a unified multimodal feature representation. This algorithm dynamically adjusts the weights of each feature through an attention mechanism to ensure that the fused features effectively reflect the spatiotemporal characteristics of the travel pattern. For example, for the "medical treatment pattern," the algorithm may assign higher weights to time-series evolution features because medical treatment behavior exhibits strong temporal regularity, while also considering spatial correlation features to reflect the travel clustering around hospitals.
[0067] Step S2b involves inputting the multimodal feature representation into the multi-head attention prediction model, combining prior knowledge of the spatiotemporal distribution of community passenger flow, and dynamically calculating the importance weights of each feature dimension through the adaptive weighting mechanism in the prediction model to generate a feature weight distribution matrix.
[0068] The model includes the following components: a multi-head attention prediction model (a deep learning model that simultaneously focuses on different feature dimensions through a multi-head attention mechanism, dynamically adjusting the weights of each feature dimension to improve prediction accuracy and robustness); prior knowledge of the spatiotemporal distribution of community passenger flow (based on historical data and empirical summaries of the distribution patterns of community passenger flow in time and space, used to assist the model in prediction); an adaptive weighting mechanism (an internal mechanism that dynamically adjusts the weights of each feature dimension based on input data to reflect the importance of different features in the prediction task); and a feature weight distribution matrix (recording the weight distribution of each feature dimension in different prediction tasks, reflecting the model's level of attention to different features).
[0069] The multi-head attention prediction model employs a Transformer encoder architecture with the following specific parameters: 3 encoder layers; 8 attention heads in each multi-head self-attention mechanism layer, designed to capture dependencies across multiple dimensions such as travel purpose, time period, and spatial region in parallel; 256 hidden layer dimensions; and 1024 internal dimensions within the feedforward neural network, using the ReLU activation function. The model is trained to minimize the mean squared error of passenger flow prediction, using the Adam optimizer with an initial learning rate of 0.0001, and adjusted using warm-up and cosine annealing strategies. The training data consists of spatiotemporal sequence samples constructed from historical community data, with a batch size of 64. The number of training epochs is dynamically determined based on the validation set loss no longer decreasing, typically ranging from 100 to 200 epochs.
[0070] The necessary process is as follows: 1. Input multimodal feature representation: Input the multimodal feature representation obtained in step S2a into the multi-head attention prediction model. These feature representations integrate spatiotemporal clustering features, time series evolution features, and spatial association features, providing a rich information foundation for the model. For example, the input multimodal feature representation includes multiple dimensions such as cluster center location, time series trend, and spatial association strength. 2. Combine prior knowledge: During model training, combine prior knowledge of the spatiotemporal distribution of community passenger flow to help the model better understand and predict passenger flow distribution. Prior knowledge can be used as a regularization term or auxiliary input to guide the model to learn feature weights that better reflect the actual situation. For example, if it is known that the community has a significant commuting peak from 7:00 to 9:00 am on weekdays, this prior knowledge can be used as an auxiliary input to help the model more accurately predict passenger flow distribution during peak hours. 3.
[0071] Adaptive Weighting Mechanism: The multi-head attention prediction model dynamically calculates the importance weights of each feature dimension through an adaptive weighting mechanism. The attention heads within the model focus on different feature dimensions and dynamically adjust their weights based on the input data to reflect the importance of different features in the current prediction task. For example, when predicting passenger flow during weekday morning rush hour, the model may assign higher weights to time-series evolution features because these features are more crucial in describing passenger flow changes during peak hours; while when predicting weekend passenger flow, spatial correlation features may receive higher weights because weekend passenger flow distribution may be more dependent on specific leisure areas. 4. Generating a Feature Weight Distribution Matrix: The model outputs a feature weight distribution matrix, recording the weight distribution of each feature dimension in different prediction tasks. This matrix not only reflects the model's attention to different features but can also be used for subsequent interpretation and optimization. For example, the feature weight distribution matrix shows that when predicting weekday morning rush hour, the weight of time series evolution features is 0.6, the weight of spatial correlation features is 0.3, and the weight of spatiotemporal clustering features is 0.1; while when predicting weekend passenger flow, the weight distribution may be 0.3 for time series evolution features, 0.6 for spatial correlation features, and 0.1 for spatiotemporal clustering features.
[0072] In step S2c, based on the feature weight distribution matrix, a spatiotemporal graph attention network is used to capture the spatiotemporal dependencies between different travel destination patterns. A deep neural network model is used to predict the passenger flow density distribution of each station at different times, generating a time-segmented passenger flow heat map.
[0073] Among them, the Spatiotemporal Graph Attention Network (ST-GAT) is a deep learning model that combines spatiotemporal information and graph neural networks (GNNs). It captures dependencies in spatiotemporal data through an attention mechanism and is suitable for processing data with spatiotemporal correlations. Deep Neural Network Models are models used to predict the passenger flow density distribution of each station at different times. They typically combine structures such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs) to handle the complexity of spatiotemporal data. Time-Segmented Passenger Flow Heatmaps are visualization tools that show the passenger flow density distribution of each station within different time periods, helping to intuitively understand the spatiotemporal changes in passenger flow.
[0074] The construction of the Spatiotemporal Graph Attention Network (ST-GAT) is closely dependent on the public transportation network: taking bus stops as nodes, if the actual road distance between two stops is within 2 kilometers, they are considered to have a potential passenger flow association, and an edge is established in the graph. This graph structure reflects the combination of the algorithm and traffic spatial features. The network structure contains two graph attention layers. The first layer has an input dimension of 256 and an output dimension of 128, using four attention heads to capture different aspects of station association features (such as distance and historical passenger flow direction), and the activation function is LeakyReLU. The output dimension of the second layer corresponds to the number of time periods to be predicted. This hierarchical design enables the model to learn and predict networked passenger flow propagation patterns from direct station associations.
[0075] The necessary process is as follows: 1. Input the feature weight distribution matrix: Input the feature weight distribution matrix generated in step S2b into the Spatiotemporal Graph Attention Network (ST-GAT). This matrix provides the importance weights of each feature dimension in different prediction tasks, helping the model better understand the role of different features. 2. Capture spatiotemporal dependencies: The Spatiotemporal Graph Attention Network captures the spatiotemporal dependencies between different travel destination patterns through a graph structure. Nodes in the network represent stations, and edges represent the spatiotemporal correlations between stations. The attention mechanism allows the model to dynamically adjust the degree of attention to different nodes and edges, thereby capturing spatiotemporal dependencies more accurately. For example, for the "going to school mode" and "going to work mode," the model discovers through the attention mechanism that there is a strong spatiotemporal correlation between stations around schools and stations in residential areas during weekday morning rush hours. 3. Deep neural network prediction: Based on the captured spatiotemporal dependencies, a deep neural network model is used to predict the passenger flow density distribution of each station at different times. The model usually combines convolutional neural networks (CNNs) to process spatial information and recurrent neural networks (RNNs) to process time series information to generate high-precision prediction results. For example: The model predicts that during the morning rush hour on weekdays, passenger flow density at stations near schools will increase significantly, while during the evening rush hour, passenger flow density at stations in commercial areas will be higher. 4. Generate time-segmented passenger flow heatmaps: Visualize the prediction results as time-segmented passenger flow heatmaps. The heatmaps use color variations to intuitively show the passenger flow density distribution at each station during different time periods, helping decision-makers quickly understand the spatiotemporal changes in passenger flow. For example: The generated heatmap shows that from 7:00 AM to 9:00 AM on weekdays, stations near schools are red (high passenger flow density), while at other times they gradually turn yellow or green (low passenger flow density).
[0076] Step S2d takes the passenger flow heat map as input, introduces a probability calculation framework based on Bayesian inference, combines the historical spatiotemporal distribution patterns of each travel destination mode, calculates the conditional occurrence probability of each mode at a specific station and time period, and constructs a complete spatiotemporal probability matrix.
[0077] The necessary process is as follows: 1. Input passenger flow heatmap and historical data: Use the time-segmented passenger flow heatmap generated in step S2c as input, combined with the historical spatiotemporal distribution patterns of various travel destination modes. Historical data is extracted from the database, containing the frequency of occurrence of each mode at different stations over a past period. For example: The heatmap shows that passenger flow density is higher at stations around schools from 7:00 to 9:00 am on weekdays. Historical data shows that the frequency of occurrence of the "going to school mode" at these stations is 0.75. 2. Bayesian inference framework: Introduce a probability calculation framework based on Bayesian inference, combining historical data and current heatmap information to calculate the conditional probability of occurrence of each mode at a specific station and time period. Bayes' theorem is used to update the prior probability, and the specific formula is: .
[0078] Where P(M|S,T): the conditional probability of pattern M occurring at station S and time period T. P(S,T|M): the likelihood probability of station S and time period T under pattern M. P(M): the prior probability of pattern M. P(S,T): the marginal probability of station S and time period T. For example: Suppose the historical probability P(M) of the "commuting pattern" occurring during weekday morning rush hour is 0.8, and the current heatmap shows high passenger density at stations in commercial areas. Combining this information, the conditional probability P(M|S,T) of the "commuting pattern" occurring at these stations is calculated to be 0.85.
[0079] 2. Calculate the probability of occurrence of conditions: For each travel destination pattern, calculate its probability of occurrence at specific stations and time periods. Using a Bayesian inference framework, combined with historical data and current heatmap information, dynamically update the probability of occurrence for each pattern. For example: For the "going to school pattern," historical data shows that the probability of occurrence P(M) during weekday morning rush hour is 0.75. The current heatmap shows that passenger flow density is high at stations around schools. Combining this information, the probability of occurrence of the "going to school pattern" at these stations is calculated to be 0.9.
[0080] 3. Constructing a Spatiotemporal Probability Matrix: Integrate the calculated probabilities of occurrence of each travel destination pattern at specific stations and time periods into a single matrix to form a complete spatiotemporal probability matrix. The rows of this matrix represent different stations, the columns represent different time periods, and the elements in the matrix represent the probability of occurrence of a certain pattern at a specific station and time period.
[0081] Step S2e involves integrating the generated time-segmented passenger flow heatmap with the spatiotemporal probability matrices of each mode and encapsulating them into a structured prediction report.
[0082] The necessary procedures are as follows:
[0083] 1. Integrate the time-segmented passenger flow heatmap and the spatiotemporal probability matrix: Integrate the time-segmented passenger flow heatmap generated in step S2c and the spatiotemporal probability matrix generated in step S2d. Specifically, combine the passenger flow density information from the heatmap with the conditional occurrence probability information from the probability matrix to form a comprehensive dataset. For example, for weekday mornings from 7:00 to 9:00, the passenger flow density around schools is high (shown in red on the heatmap), while the spatiotemporal probability matrix shows that the probability of "going to school mode" occurring at these stations is 0.9. Integrate this information into a single data structure.
[0084] 2. Packaged into a structured forecast report: The integrated data is packaged into a structured forecast report. The report includes the following:
[0085] Site information: The geographical location and name of each site.
[0086] Time period information: start and end times for different time periods.
[0087] Passenger flow density: Passenger flow density at each station at different time periods (extracted from the heat map).
[0088] Condition occurrence probability: The probability of each travel destination pattern occurring at a specific station and time period (extracted from the spatiotemporal probability matrix).
[0089] Visual charts: including time-segmented passenger flow heatmaps and probability matrices, to help intuitively understand the data.
[0090] The intelligent dispatching decision support method for community bus routes also includes the step of continuously optimizing the multi-head attention prediction model:
[0091] Step Sa involves reconstructing and generating a heat map of actual passenger flow distribution and an actual pattern distribution matrix based on vehicle GPS trajectory data and passenger flow data collected during actual operation.
[0092] The data includes: Vehicle GPS trajectory data: Real-time vehicle location information collected by GPS devices on vehicles, including timestamps and latitude / longitude coordinates, reflecting the actual operating trajectory of the vehicles. Station passenger flow data: Passenger flow data collected by station passenger flow monitoring equipment (such as infrared sensors, video surveillance, etc.), recording the number of passengers getting on and off at each station at different time periods. Actual passenger flow distribution heatmap: A visualization tool generated based on vehicle GPS trajectory data and station passenger flow data, showing the passenger flow density distribution of each station at different time periods during actual operation. Actual mode distribution matrix: A matrix generated based on vehicle GPS trajectory data and station passenger flow data, recording the actual probability of each travel destination mode occurring at specific stations and time periods.
[0093] The necessary procedures are as follows: 1. Data Collection: Collect actual operational data from vehicle GPS devices and station passenger flow monitoring devices. Vehicle GPS trajectory data includes timestamps and latitude / longitude coordinates, while station passenger flow data includes the number of passengers boarding and alighting at each station at different time periods. For example, vehicle GPS trajectory data is recorded as "2025-01-15T07:45:00Z, longitude 114.0600, latitude 22.5450", and station passenger flow data is recorded as "Station A, 2025-01-15T07:45:00Z, 10 passengers boarding, 5 passengers alighting". 2. Data Preprocessing: Preprocess the collected data, including data cleaning, formatting, and alignment. Ensure timestamp consistency, remove outlier data points, and convert the data to a uniform format. For example, align the timestamps of vehicle GPS trajectory data and station passenger flow data to ensure temporal consistency. 3. Generate an actual passenger flow distribution heatmap: Based on preprocessed vehicle GPS trajectory data and station passenger flow data, an actual passenger flow distribution heatmap is generated. The heatmap visually displays the passenger flow density distribution of each station within different time periods using color intensity. For example, the generated heatmap shows that from 7:00 AM to 9:00 AM on weekdays, stations near schools have higher passenger flow density (red), while stations in commercial areas have moderate passenger flow density (yellow). 4. Generate an actual travel pattern distribution matrix: Based on the preprocessed data, an actual travel pattern distribution matrix is generated. The matrix records the actual probability of each travel destination pattern occurring at specific stations and time periods. For example, the actual travel pattern distribution matrix shows that from 7:00 AM to 9:00 AM on weekdays, the actual probability of the "going to school" travel pattern at stations near schools is 0.9, while the actual probability of the "going to work" travel pattern at stations in commercial areas is 0.85.
[0094] Step Sb involves calculating the spatial feature difference between the passenger flow heatmap in the forecast report and the actual passenger flow distribution heatmap to obtain the heatmap difference degree; simultaneously, it involves calculating the probability distribution difference between the spatiotemporal probability matrix of each mode in the forecast report and the actual mode distribution matrix to obtain the probability matrix difference degree.
[0095] Among them, the heatmap difference: the spatial characteristic difference between the predicted passenger flow heatmap and the actual passenger flow distribution heatmap, used to evaluate the accuracy of the prediction. The probability matrix difference: the probability distribution difference between the predicted spatiotemporal probability matrices of each mode and the actual mode distribution matrix, used to evaluate the accuracy of the prediction.
[0096] The necessary procedures are as follows:
[0097] 1. Calculation of heat map differences:
[0098] By comparing the passenger flow heatmap in the forecast report with the actual passenger flow distribution heatmap, the difference in passenger flow density between the two at each station and time period is calculated. The Mean Absolute Error (MAE) is used as the index of difference, as shown in the following formula: .in, It is the predicted passenger flow density. This refers to the actual passenger flow density. This represents the total number of stations and time periods. For example, for station A in time period T1, the predicted passenger density is 80 people, while the actual passenger density is 75 people, resulting in a difference of 5 people. The overall heatmap difference is 0.05.
[0099] 2. Calculation of the dissimilarity of the probability matrix:
[0100] By comparing the spatiotemporal probability matrices of each model in the forecast report with the actual model distribution matrix, the difference in the probability of conditional occurrence between the two models at each site and time period is calculated. KL divergence is used as the dissimilarity index, and the formula is as follows: .in, It is the probability of the predicted condition occurring. It is the actual probability of the condition occurring. This represents the total number of sites and time periods.
[0101] For example, for station A in time period T1, the predicted probability of "going to school mode" is 0.9, the actual probability is 0.85, and the calculated KL divergence is 0.03.
[0102] Step Sc combines the heatmap difference and the probability matrix difference using a weighted fusion algorithm to generate a unified model prediction bias index.
[0103] The weighted fusion algorithm combines multiple dissimilarity indicators, assigning weights to each indicator to generate a comprehensive model prediction bias indicator. The model prediction bias indicator is a comprehensive indicator used to evaluate the overall bias of the prediction model, combining heatmap dissimilarity and probability matrix dissimilarity.
[0104] The necessary procedures are as follows:
[0105] 1. Determine weight allocation: Based on actual needs and experience, assign weights to the heatmap difference and probability matrix difference. The weight allocation should reflect the importance of each indicator in model evaluation. For example, assuming the weight of heatmap difference is 0.6 and the weight of probability matrix difference is 0.4, it indicates that heatmap difference is more important in model evaluation.
[0106] 2. Weighted fusion calculation:
[0107] A weighted fusion algorithm is used to combine the heatmap difference and the probability matrix difference to generate a unified model prediction bias index. The specific formula is as follows:
[0108] Model prediction bias index = α × heatmap difference + β × probability matrix difference.
[0109] Where α and β are the weights of the heatmap difference and the probability matrix difference, respectively, and α + β = 1. For example: assuming the heatmap difference is 0.05, the probability matrix difference is 0.03, and the weights are 0.6 and 0.4 respectively, then the model prediction bias index is:
[0110] Model prediction bias index = 0.6 × 0.05 + 0.4 × 0.03 = 0.042.
[0111] 3. Generate model prediction bias index: Output the calculated model prediction bias index in a structured data format for subsequent model optimization.
[0112] For example, the output may include the following:
[0113] Model prediction bias index: 0.042.
[0114] 4. Evaluation and Adjustment: Evaluate the model's predictive performance based on the generated model prediction bias index. If the bias index exceeds a preset threshold, the model needs optimization and adjustment. Additionally, based on the actual evaluation results, the weight allocation may need to be adjusted to more accurately reflect the importance of each index. For example, if the preset threshold is 0.05 and the current model prediction bias index is 0.042, the model performance is good and no optimization or adjustment is needed. If the bias index is 0.06, further model optimization is required.
[0115] In step Sd, when the model prediction bias exceeds a preset threshold, an incremental learning algorithm is used to optimize and adjust the parameters in the multi-head attention prediction model. Incremental learning uses the Adam optimizer, with hyperparameters β1 and β2 set to 0.9 and 0.999, respectively. A stepped decay strategy is adopted for the learning rate, meaning that the learning rate is multiplied by a decay factor of 0.95 every 10 mini-batches of training. The stopping condition for incremental learning is: evaluation using independent recent operational data as a validation set; if the model prediction bias does not decrease after three consecutive validations (each with an interval of 50 mini-batches), then the current round of incremental learning is terminated.
[0116] The necessary process is as follows: 1. Evaluate the deviation index: Compare the model prediction deviation index with a preset threshold. If the deviation index exceeds the threshold, it indicates a significant deviation between the model prediction and the actual operational data, requiring optimization and adjustment. For example, if the preset threshold is 0.05 and the current deviation index is 0.06, the model needs adjustment. 2. Select the incremental learning algorithm: Choose the mini-batch gradient descent algorithm as the incremental learning method. This algorithm updates model parameters through mini-batch data, maintaining model stability while quickly adapting to new data. Set the mini-batch size to 100 samples and the learning rate to 0.01 to ensure gradual optimization of model parameters. 3. Prepare incremental learning data: Extract vehicle GPS trajectory data and station passenger flow data from actual operational data. This data should be consistent with the model's input format. Perform necessary preprocessing, such as data cleaning and formatting, to ensure data quality. For example, extract data from the most recent week, clean outliers, and format it into the feature vectors required by the model. 4. Execute incremental learning: Optimize the model parameters using the mini-batch gradient descent algorithm. Divide the data into multiple mini-batches, each containing 100 samples. For each batch of data, calculate the model's loss function (such as mean squared error or cross-entropy loss), and update the model parameters based on the gradient of the loss function. The update formula is: Where θ is the model parameter, η is the learning rate, and ∇L is the gradient of the loss function. Through iterative updates, the model's prediction bias is gradually reduced. 5. Verify the optimization effect: Evaluate the performance of the optimized model using an independent validation dataset. If the optimized model's prediction bias drops to 0.04, the optimization effect is good; if it is still higher than the preset threshold, the learning rate can be adjusted or other incremental learning algorithms can be tried. For example, if the optimized bias is still 0.06, the learning rate can be adjusted to 0.005, or an online learning algorithm can be tried to further optimize the model.
[0117] Step Se involves updating the optimized model parameters to the online scheduling system for use in generating subsequent prediction reports.
[0118] The optimized model parameters are then updated in the online scheduling system. Specific operations include:
[0119] Downtime Update: During system maintenance, new model parameters are deployed to the online scheduling system to ensure that the update process does not affect the normal operation of the system.
[0120] Hot update: If the system supports hot updates, model parameters can be dynamically updated without interrupting service. This usually requires the system to have a parameter hot-loading mechanism.
[0121] Based on the spatiotemporal probability matrix of each mode and the preset community service strategy, the service time window priority values for each mode are calculated and generated, including:
[0122] Step S2A: Based on the basic priority of each travel destination mode defined in the community service strategy, and combined with the occurrence probability value of each mode in the spatiotemporal probability matrix, a preliminary priority score is calculated by a weighted fusion algorithm.
[0123] The community service strategy is a pre-defined strategy that defines the basic priorities of different travel destination modes. These priorities are based on the specific needs and service goals of the community, such as prioritizing students' schooling and residents' access to medical care. The spatiotemporal probability matrix, generated in step S2d, records the conditional occurrence probability of each travel destination mode at specific stations and time periods, used for prediction and decision support. The weighted fusion algorithm is an algorithm that merges multiple features into a comprehensive score by assigning weights to different features. In this step, it is used to calculate the preliminary priority score by combining the basic priorities and occurrence probability values. The preliminary priority score, calculated based on the community service strategy and the spatiotemporal probability matrix, is used to evaluate the priority of each travel destination mode.
[0124] The necessary process is as follows: 1. Obtain basic priorities: Extract the basic priorities of each travel destination mode from the community service strategy. These priorities are preset based on the specific needs and service goals of the community. For example, the basic priority of the school mode may be higher because students going to school is an important need of the community. For example, the basic priority of the school mode is defined as 0.8, the basic priority of the commuting mode is 0.7, and the basic priority of the medical treatment mode is 0.9 in the community service strategy. 2. Obtain occurrence probability values: Extract the conditional occurrence probability values of each travel destination mode at specific stations and time periods from the spatiotemporal probability matrix. These probability values reflect the frequency of occurrence of each mode in actual operation. For example, the spatiotemporal probability matrix shows that on weekday mornings from 7:00 to 9:00, the occurrence probability of the school mode at stations near schools is 0.9, and the occurrence probability of the commuting mode at stations in commercial areas is 0.85. 3. Calculate the preliminary priority score using weighted fusion: Calculate the preliminary priority score by combining the basic priorities and occurrence probability values using a weighted fusion algorithm. The specific formula is as follows: Preliminary priority score = α × basic priority + (1-α) × occurrence probability value. Here, α is the weight of the basic priority, which is usually set according to the importance of the community service strategy. For example: assuming α = 0.6, for the school attendance mode, the basic priority is 0.8, and the probability of occurrence is 0.9, then the initial priority score is:
[0125] Preliminary priority score = 0.6 × 0.8 + 0.4 × 0.9 = 0.84.
[0126] 4. Output preliminary priority score: Output the calculated preliminary priority score in a structured data format for subsequent dynamic correction and optimization.
[0127] Step S2B: Based on the real-time collected reservation request data, dynamically detect the changes in service demand intensity for each travel destination mode. When the demand intensity for a specific mode exceeds a set threshold within a preset time window, use a preset weight adjustment function to dynamically correct the initial priority score.
[0128] Service demand intensity: Within a preset time window, the number or frequency of booking requests for a specific travel destination mode reflects the service demand intensity for that mode. Preset time window: A defined time period used to assess the service demand intensity for a specific travel destination mode. For example, 7:00-9:00 AM on weekdays. Preset threshold: A preset value used to determine if the service demand intensity exceeds the normal range, thereby triggering dynamic adjustments to the priority score. Weight adjustment function: A preset function used to adjust the initial priority score based on changes in service demand intensity. It is typically an increasing function; the higher the demand intensity, the higher the adjusted priority score.
[0129] The necessary processes are as follows: 1. Real-time data collection and preprocessing: Collect reservation request data in real time from the community-dedicated APP, extracting information such as the timestamp, departure location, and destination for each request. Preprocess the data, including removing duplicate requests and filtering abnormal data, to ensure data accuracy and usability. 2. Service demand intensity detection: Within a preset time window, count the number of reservation requests for each travel destination mode and calculate the service demand intensity. For example, count the number of reservation requests for the "going to school" mode during weekday mornings from 7:00 to 9:00. Example: During weekday mornings from 7:00 to 9:00, the number of reservation requests for the "going to school" mode is 120, and the number of reservation requests for the "going to work" mode is 80. 3. Determine if the demand intensity exceeds the threshold: Compare the calculated service demand intensity with a preset threshold. If the demand intensity exceeds the threshold, it indicates that the service demand for this mode is high, and the initial priority score needs to be dynamically adjusted. Example: The preset threshold is 100, and the number of reservation requests for the "going to school" mode is 120, exceeding the threshold, triggering dynamic adjustment. 4. Dynamically Adjust Initial Priority Score: The initial priority score is dynamically adjusted using a preset weight adjustment function. The weight adjustment function is typically an increasing function; the higher the demand intensity, the higher the adjusted priority score. For example: Assume the weight adjustment function is f(x) = 1 + (x - threshold) ÷ 100, where x is the service demand intensity. For the school enrollment mode, the demand intensity is 120 times, and the threshold is 100 times. The adjusted weight is: f(120) = 1 + 100 / (120 - 100) = 1.2. If the initial priority score for the school enrollment mode is 0.84, the adjusted priority score is:
[0130] The corrected priority score is 0.84 × 1.2 = 1.008.
[0131] 5. Output the corrected priority score: Output the corrected priority score in a structured data format for subsequent resource constraint optimization.
[0132] Step S2C, based on the corrected priority score and combined with the current distribution of available transportation resources, uses a resource constraint optimization algorithm for normalization processing to generate executable service time window priority values. The calculation of service time window priority values is a crucial step in integrating the algorithm output with the domain strategy. Specifically, the spatiotemporal probability matrix (the probability of each mode occurring as output by the algorithm) and the community service strategy (human-preset basic priorities) are weighted and fused. The probability values provided by the algorithm reflect the dynamic demand intensity and are used to correct static strategies in real time, ensuring that priority calculation is both policy-oriented and responsive to demand fluctuations in actual operation. This enables subsequent scheduling decisions (such as route optimization and station skipping) to have data-driven adaptive capabilities.
[0133] The current available transportation capacity distribution includes real-time updated bus distribution information, such as vehicle location, status (idle or carrying passengers), and estimated arrival time, used to assess current transportation capacity resources. The resource constraint optimization algorithm is an algorithm used to normalize priority scores under limited resource conditions, ensuring that the generated priority values are executable in actual operation. The service time window priority value is the normalized priority value used to guide the bus dispatching system in scheduling decisions within a specific time window.
[0134] The necessary procedures are as follows:
[0135] 1. Obtain the revised priority score and capacity resource distribution:
[0136] Obtain the corrected priority score from step S2B, for example:
[0137] School attendance mode: P1=1.008;
[0138] Work mode: P2=0.79;
[0139] Medical treatment mode: P3=0.88;
[0140] At the same time, it can obtain the current distribution of transportation resources in real time. For example, if there are 10 vehicles available, 5 of them are in the school mode area, 3 are in the work mode area, and 2 are in the medical treatment mode area.
[0141] 2. Adjust and normalize priority scores:
[0142] Priority scores are adjusted based on the capacity ratio of each mode, calculated using the following formula: Among them, R i This is the capacity ratio for mode i. The calculation result is:
[0143] School attendance mode: P1′=1.008×0.5=0.504;
[0144] Work mode: P2′=0.79×0.3=0.237;
[0145] Medical treatment mode: P3′=0.88×0.2=0.176.
[0146] Then, normalization is performed to ensure that the priority value is between 0 and 1. The normalization formula is:
[0147] Where, min(P′) = 0.176, max(P′) = 0.504. The calculation results are:
[0148] School mode: .
[0149] Work mode: .
[0150] Medical treatment mode: .
[0151] 3. Generate service time window priority values: The normalized priority score is used as the final service time window priority value to guide the bus dispatching system in dispatching decisions within a specific time window.
[0152] Step S2D involves standardizing and encapsulating the final generated service time window priority values.
[0153] The necessary process is as follows: Obtain service time window priority values from step S2C, for example: school mode 1.0, work mode 0.28, medical treatment mode 0.0. Standardize and encapsulate these values, converting them into a system-recognizable format and adding metadata such as timestamps and mode identifiers to ensure data integrity and availability. Store the encapsulated data in the scheduling system database, ensuring it is accessible to the real-time scheduling module, thereby improving the accuracy and efficiency of scheduling decisions.
[0154] The route planning agent takes passenger flow heatmaps and spatiotemporal probability matrices as inputs and optimizes route sequences under constraints of mandatory stops and vehicle capacity, including:
[0155] Step S31: Extract the time-segmented service demand intensity of each station based on the passenger flow heat map, and construct a route optimization function by combining the travel destination pattern distribution law in the spatiotemporal probability matrix. The weight of each optimization objective is determined by preset strategy parameters.
[0156] The necessary process is described below:
[0157] 1. Extracting Service Demand Intensity: Extracting the service demand intensity of each station at different time periods from the passenger flow heat map. The passenger flow heat map shows the passenger flow density of each station at different time periods. By analyzing this data, the service demand intensity of each station at each time period can be determined. For example, the service demand intensity of station A is 80 people from 7:00 to 8:00 in the morning.
[0158] 2. Utilizing the distribution patterns of travel destination patterns in the spatiotemporal probability matrix: Further refine the service demand for each station by analyzing these patterns. The spatiotemporal probability matrix provides the probability of each travel destination pattern occurring at different stations and time periods. Combining this information allows for a more accurate assessment of service demand. For example, the probability of the "going to school mode" occurring at station A between 7:00 and 8:00 AM is 0.9.
[0159] 3. Constructing a Route Optimization Function: Based on the above data, a route optimization function is constructed. This function comprehensively considers the intensity of service demand and the distribution patterns of travel destinations to optimize the route sequence. Optimization objectives may include minimizing passenger waiting time and maximizing vehicle utilization, and the weights of each optimization objective are determined through preset strategy parameters.
[0160] 4. Determine the weights of the optimization objectives: Based on the preset strategy parameters, determine the weights of each optimization objective in the route optimization function. For example, if the community service strategy prioritizes ensuring students' commute to school, then the weight of the "school commute mode" might be higher. Assume the weight of minimizing passenger waiting time is 0.6, and the weight of maximizing vehicle utilization is 0.4.
[0161] 5. Generate route optimization function: Integrate service demand intensity, travel destination pattern distribution, and optimization objective weights into the route optimization function. For example, the route optimization function can be expressed as:
[0162] f(route) = α × passenger waiting time + β × vehicle utilization rate.
[0163] Here, α and β are the weights of the optimization objective, corresponding to minimizing passenger waiting time and maximizing vehicle utilization, respectively.
[0164] Step S32: The route optimization function is used as the fitness function, and an improved genetic algorithm is used to search for the route sequence. During the population initialization stage, the mandatory stopping stations are embedded into the chromosome encoding as fixed gene segments.
[0165] The route optimization function is a mathematical function used to comprehensively consider the intensity of service demand and the distribution patterns of travel destinations to optimize route sequences. Optimization objectives may include minimizing passenger waiting time and maximizing vehicle utilization. The improved genetic algorithm is an optimization algorithm that simulates the process of biological evolution, gradually approaching the optimal solution through selection, crossover, and mutation operations. In route planning, the genetic algorithm encodes possible paths as chromosomes, finding the optimal path through continuous evolution. Chromosome encoding: In the genetic algorithm, possible paths are encoded as chromosomes. Each gene in a chromosome represents a station on the path.
[0166] The necessary procedures are as follows:
[0167] 1. Setting the Fitness Function: The route optimization function is used as the fitness function to measure the merits of different route sequences. The design of the fitness function should be combined with the optimization objective, such as minimizing passenger waiting time (T) and maximizing vehicle utilization (U). The fitness function can be expressed as:
[0168] Where α and β are the weights of the optimization objective.
[0169] 2. Population Initialization: During the population initialization phase, mandatory stopping stations are embedded as fixed gene segments into the chromosome code. For example, if the mandatory stopping stations are station A and station B, the chromosome code might be "start point - station A - station B - end point". This encoding method ensures that mandatory stopping stations are included in all route sequences.
[0170] 3. Genetic Algorithm Iteration: An improved genetic algorithm is used for route sequence search. During the iteration process, the route sequence is gradually optimized through selection, crossover, and mutation operations. The selection operation selects individuals with high fitness based on a fitness function; the crossover operation generates new individuals by exchanging gene fragments; and the mutation operation introduces diversity by randomly changing gene fragments.
[0171] Step S33: In the process of genetic algorithm iteration, a Monte Carlo tree search strategy is introduced to dynamically adjust the genetic algorithm parameters based on the population diversity index and output the preliminary optimized route sequence.
[0172] Monte Carlo Tree Search (MCTS) is a sampling-based search algorithm that progressively constructs a search tree through four steps: selection, expansion, simulation, and backtracking, to find the optimal solution. Population diversity metrics are indicators used to measure the differences between individuals within a population in a genetic algorithm, such as the fitness distribution and gene diversity.
[0173] The necessary process is as follows: 1. Introduce the MCTS strategy: In the genetic algorithm iteration, each partial solution is used as a node in the MCTS search tree, and the route sequence is dynamically explored through selection, expansion, simulation, and backtracking steps. Nodes are selected using the UCB formula: .in, Let N be the average fitness of the nodes, N be the total number of simulations, n be the number of node visits, and c be the exploration parameters. This strategy enhances the ability to explore the high-quality solution space. 2. Dynamic parameter adjustment: The mutation probability of the genetic algorithm is dynamically adjusted based on population diversity indicators (such as fitness standard deviation σ). When σ is below the threshold, increase This can be achieved by introducing new gene combinations to avoid getting stuck in local optima.
[0174] 3. Output preliminary optimized route sequence: Combining the MCTS strategy and dynamically adjusted parameters, output a preliminary route sequence that meets the mandatory stop constraints and optimizes service quality, providing a foundation for subsequent fine-tuning.
[0175] Step S34: The preliminary optimized route sequence is taken as input, and the simulated annealing mechanism is used for fine-tuning. A new solution is generated through neighborhood search operation, and the locally optimized route sequence is output.
[0176] Among them, simulated annealing mechanism: an optimization algorithm based on the principle of solid-state annealing, which accepts inferior solutions with a certain probability during the search process by setting initial temperature, cooling rate and termination conditions, thus avoiding getting trapped in local optima. Neighborhood search operation: an operation that generates new solutions near the current solution, such as swapping the positions of two stations, reversing a certain path, inserting or deleting stations, etc. Locally optimized route sequence: a route sequence obtained after fine-tuning by simulated annealing, which further improves the service quality or efficiency compared to the initial optimized sequence.
[0177] The necessary procedures are as follows: 1. Initialize parameters: Set the initial temperature T0 and the termination temperature T min Cooling rate α and maximum number of iterations k max 1. Using the initially optimized route sequence as the initial solution X0, calculate its objective function value E(X0) as the initial energy. 2. Generate a new solution X within the neighborhood of the current solution X through perturbation. new Common operations include swapping the positions of two stations and reversing a path. The objective function value E(X) of the new solution is calculated. new and energy difference: 3. Acceptance Criterion: If ΔE < 0 (the new solution is better), then accept the new solution; otherwise, accept the inferior solution with probability. .
[0178] 4. Cooling and Iteration:
[0179] The temperature is gradually decreased according to the cooling rate α: .
[0180] 5. Output locally optimized circuit sequence: When the temperature drops to T min Or reach the maximum number of iterations k max Stop iterating when the time is right, and output the current optimal solution as the local optimization route sequence.
[0181] Step S35: Based on the locally optimized route sequence, verify the vehicle capacity constraint and service quality threshold, and output the optimal route sequence and operation indicators that meet the requirements.
[0182] The necessary process is as follows: 1. Verify vehicle capacity constraints: For each route in the locally optimized route sequence, check whether it meets the vehicle capacity constraints. Calculate the number of passengers boarding and alighting at each station on each route to ensure that the vehicle's passenger load at any given time does not exceed its maximum capacity. For example, if the maximum capacity of a vehicle on a certain route is 50 people, calculate the number of passengers boarding and alighting at each station to ensure that the vehicle's passenger load at any station does not exceed 50 people. 2. Verify service quality thresholds: Check whether the route sequence meets the preset service quality thresholds, such as average passenger waiting time and vehicle punctuality rate. For example, the preset average passenger waiting time is no more than 10 minutes. Through simulation, the actual average waiting time is calculated to be 8 minutes, which meets the service quality threshold. 3. Output optimal route sequence and operating indicators: For route sequences that meet the vehicle capacity constraints and service quality thresholds, output the optimal route sequence and provide corresponding operating indicators, such as total travel distance, total passenger waiting time, and vehicle utilization rate. For example, the final output optimal route sequence is "Start-Station A-Station B-Destination", and the operating indicators include a total travel distance of 10 kilometers, a total passenger waiting time of 50 minutes, and a vehicle utilization rate of 80%.
[0183] The station-hopping decision agent generates station-hopping instructions based on service time window priority values and a competition depth Q-network, including:
[0184] Step S3a: Based on the service time window priority value, real-time carriage occupancy rate, and number of passengers waiting at the station, construct the current state for skipping stations. Wherein, real-time carriage occupancy rate: the ratio of the current vehicle's actual passenger capacity to its maximum passenger capacity, reflecting the degree of congestion. Number of passengers waiting at the station: the number of passengers waiting to board at the current station, which can be obtained through the station's real-time monitoring equipment. Current state for skipping stations: a state vector constructed by comprehensively considering the service time window priority value, real-time carriage occupancy rate, and number of passengers waiting at the station for skipping station decisions.
[0185] The necessary process is as follows: 1. Obtain the service time window priority value: Obtain the service time window priority value from step S2C, for example: school mode 1.0, work mode 0.28, medical treatment mode 0.0.
[0186] 2. Obtain real-time carriage occupancy rate: The carriage occupancy rate is obtained in real-time through sensors on the vehicle. For example, if a vehicle currently carries 40 passengers and its maximum capacity is 50, then the carriage occupancy rate is 0.8. 3. Obtain the number of passengers waiting at stations: The number of passengers waiting at stations is obtained through real-time monitoring equipment at the stations. For example, there are currently 20 people waiting at a station. 4. Construct the current state for skipping stations: The service time window priority value, real-time carriage occupancy rate, and the number of passengers waiting at stations are integrated into a state vector S. For example:
[0187] S=[P 模式, [Carriage occupancy rate, number of waiting passengers]. Specific values are: S = [1.0, 0.8, 20]. Where P... 模式 This is the priority value for the service time window.
[0188] Step S3b: Input the current state into the pre-trained competitive deep Q network, and calculate the action value of each candidate jump station action through the value function and advantage function of the competitive deep Q network.
[0189] Among them, the competitive deep Q-network is a deep reinforcement learning algorithm that improves the estimation accuracy of action value by separating the value function and the advantage function. The value function represents the expected future reward in a given state. The advantage function represents the additional reward of taking a certain action relative to the average action in a given state. The action value represents the expected reward of taking a certain action in a given state.
[0190] The shared feature extraction module of the competitive deep Q-network consists of two fully connected layers: the first layer maps the state vector to 256 dimensions, and the second layer maps it to 128 dimensions, both using the ReLU activation function. The value stream branch is a fully connected layer with 128-dimensional input and 1-dimensional output. The dominance stream branch is a fully connected layer with 128-dimensional input and an output dimension equal to the number of candidate hop actions.
[0191] Training parameters and process: The network uses the mean squared error loss function and is trained using the Adam optimizer with an initial learning rate of 0.0005. Training employs an empirical replay mechanism with a buffer capacity of 10,000 records; the target network is used simultaneously, and its parameters are updated synchronously every 100 training iterations. Action selection uses an ε-greedy strategy with an initial exploration rate of 1.0, which linearly decays to 0.01 within the first 80% of training steps. The discount factor is set to 0.99. During training, random sampling is performed from the buffer, with a fixed batch size of 32.
[0192] The necessary process is described as follows: 1. Input the current state: Input the current state S constructed in step S3a into the pre-trained competitive deep Q network. For example, the current state S=[1.0,0.8,20], which includes the service time window priority value, real-time carriage occupancy rate, and number of people waiting at the station. 2. Calculate the value function and advantage function: The competitive deep Q network separates the value function V(S) and the advantage function A(S,a) through its network structure, where a represents the candidate station skipping action. The network outputs the estimated values of the value function and the advantage function:
[0193] V(S) = Value function value output by the network.
[0194] A(S,a) = the dominant function value output by the network.
[0195] 3. Calculate the motion value: Calculate the motion value Q(S,a) of each candidate jump based on the value function and the dominance function. The formula for calculating the motion value is:
[0196] Where N is the number of candidate actions.
[0197] Step S3c: Generate a station skipping instruction sequence based on the calculated action value according to the preset action selection strategy.
[0198] The necessary process is as follows: 1. Select an action selection strategy: Select an action selection method according to a preset strategy. For example, using an ε-greedy strategy, the action with the highest value is selected in most cases, but other actions are randomly selected with a certain probability ε to maintain exploratory nature. 2. Generate skip-station instructions based on action value: Generate skip-station instructions according to the preset action selection strategy based on the calculated action value Q(S,a). For example, if an ε-greedy strategy is used, the skip-station action with the highest value is selected as the instruction. 3. Generate a skip-station instruction sequence: Arrange the generated skip-station instructions in sequence to form a skip-station instruction sequence. For example, the generated skip-station instruction sequence is "No stop at station A, stop at station B, no stop at station C".
[0199] The two agents collaborate on strategies by sharing a commentator network. The global reward function of the commentator network assigns higher on-time performance weights to travel destination patterns with priority values above a set threshold. Together, they output a dynamic scheduling scheme that includes:
[0200] Step 1: The optimal route sequence operation index output by the route planning agent and the skip station instruction sequence output by the skip station decision agent are spatiotemporally aligned and fused, and a collaborative decision feature matrix is constructed by combining the service time window priority value.
[0201] The necessary processes are as follows: 1. Spatiotemporal Alignment and Fusion: The optimal route sequence operation indicators output by the route planning agent are spatiotemporally aligned with the skip-stop instruction sequence output by the skip-stop decision agent. For example, for a certain route, the optimal route sequence is "starting point - station A - station B - destination", and the corresponding operation indicators include a total driving distance of 10 kilometers and a total passenger waiting time of 50 minutes; the skip-stop instruction sequence is "stop - not stop - stop". This information is aligned in temporal and spatial order to form a unified data structure. 2. Combining Service Time Window Priority Values: The aligned data is combined with the service time window priority values to construct a collaborative decision feature matrix. For example, the service time window priority values are 1.0 for school mode, 0.28 for work mode, and 0.0 for medical treatment mode. These values are integrated with the operation indicators and skip-stop instructions into the feature matrix. 3. Constructing the Collaborative Decision Feature Matrix: The collaborative decision feature matrix contains the optimal route sequence operation indicators, the skip-stop instruction sequence, and the service time window priority values.
[0202] Step 2: Input the collaborative decision feature matrix into the multi-head attention mechanism to generate a dimensionally compressed state representation, wherein the number of attention heads and the compression ratio are configured by preset parameters.
[0203] The necessary process is as follows: 1. Input the collaborative decision-making feature matrix: Input the collaborative decision-making feature matrix constructed in step 1 into the multi-head attention mechanism. For example, the feature matrix includes line operation indicators, skip station instructions, and service time window priority values. 2. Multi-head attention processing: The multi-head attention mechanism processes the input data simultaneously through multiple attention heads, with each attention head learning different features of the data. The number of attention heads (e.g., 8) and compression ratio (e.g., 1 / 4) are preset to control the dimensionality of the output state representation. 3. Generate dimensionally compressed state representation: The multi-head attention mechanism outputs a dimensionally compressed state representation, retaining key information from the input data. For example, if the input feature matrix has a dimension of 100 and the compression ratio is 1 / 4, then the output state representation will have a dimension of 25.
[0204] Step 3: Input the state representation into the shared critic network and calculate the expected cumulative reward of the joint strategy through its value function module. The reward function includes three differentiable numerators: punctuality reward, efficiency reward, and comfort reward. In the punctuality reward sub-item, for travel destination patterns with service time window priority values higher than a set threshold, a higher punctuality rate weight coefficient is assigned through a preset weight enhancement function. The weight relationship of each sub-item is defined through a preset function.
[0205] The necessary steps are as follows: 1. Input State Representation: Input the state representation generated in step 2 into the shared critic network. The state representation is a low-dimensional feature vector output by the multi-head attention mechanism, preserving the key information of the input data. 2. Calculate Expected Cumulative Reward: Calculate the expected cumulative reward of the joint policy through the value function module of the critic network. The reward function contains three differentiable terms: timeliness reward, efficiency reward, and comfort reward. 3. Define Sub-terms of the Reward Function:
[0206] On-time performance bonus: For travel destinations with a service time window priority value higher than a set threshold, a higher on-time performance weight coefficient is assigned through a preset weight enhancement function. For example, if the priority value of the school travel mode is 1.0, which is higher than the set threshold of 0.5, then a higher weight is assigned.
[0207] Efficiency incentives: based on vehicle operating efficiency, such as total distance traveled and vehicle utilization.
[0208] Comfort bonus: based on passenger comfort, such as average waiting time and carriage occupancy rate.
[0209] 4. Definition of weighting relationship:
[0210] The weight relationships between each sub-item are defined by a preset function. For example, the preset weight function is: w 准时性 =λ × priority value. w 效率 =μ。 w 舒适度 =ν. Where λ, μ, and ν are preset weighting coefficients.
[0211] 5. Output Expected Cumulative Reward: The commentator network outputs the expected cumulative reward of the joint policy, used to evaluate the policy's performance. The formula for calculating the expected cumulative reward is:
[0212] R=w 准时性 ×R 准时性 +w 效率 ×R 效率 +w 舒适度 ×R 舒适度 Among them, R 准时性 R 效率 and R 舒适度 These are the values for punctuality reward, efficiency reward, and comfort reward, respectively.
[0213] Step 4: Based on the expected cumulative reward, update the policy network parameters using the multi-agent proximal policy optimization algorithm to generate the updated policy network.
[0214] The necessary steps are as follows: 1. Input the expected cumulative reward: Input the expected cumulative reward calculated in step 3 into the Multi-Agent Proximal Policy Optimization (MAPPO) algorithm. The expected cumulative reward is used to evaluate the performance of the current policy and guide the update of the policy network parameters. 2. Calculate the policy gradient: The MAPPO algorithm updates the policy network parameters by calculating the policy gradient. The policy gradient represents the sensitivity of the policy performance to the network parameters and is used to guide the direction of parameter updates. The formula for calculating the policy gradient is: .in, This is the current strategy. This is the Q-value of the state-action pair. 3. Update policy network parameters: Update the policy network parameters using the calculated policy gradient. The update formula is: Where α is the learning rate. 4. Generate an updated policy network: The updated policy network can generate better policies, improving the agent's performance. The updated policy network parameters are used in subsequent policy generation.
[0215] Step 5: Based on the updated policy network, generate a candidate policy set containing multiple candidate policies using the Monte Carlo sampling method.
[0216] The necessary steps are as follows: 1. Input the updated policy network: Take the updated policy network generated in step 4 as input. This network can generate the optimal policy based on the current state. 2. Monte Carlo sampling: Use the Monte Carlo sampling method to generate multiple candidate policies from the policy network. Monte Carlo sampling generates samples from the probability distribution through random sampling, ensuring the diversity of the generated candidate policies. For example, randomly select 10 candidate policies from the policy network. 3. Generate a candidate policy set: Combine the generated candidate policies into a candidate policy set. Each candidate policy contains a series of actions that indicate the vehicle's decision to stop or skip at each station.
[0217] Step 6: Based on the preset service quality assessment model, perform service quality quantification calculations for each strategy in the candidate strategy set, including calculating the expected on-time rate of the strategy based on historical on-time rate data, calculating the load factor based on vehicle capacity and passenger flow data, and calculating the average waiting time for passengers based on station spacing and operating speed.
[0218] The necessary process is as follows: 1. Input candidate strategy set: Input the candidate strategy set generated in step 5 into the preset service quality assessment model. Each candidate strategy contains a series of actions indicating whether the vehicle should stop or skip stations. 2. Calculate expected on-time rate: Calculate the expected on-time rate for each candidate strategy based on historical on-time rate data. For example, if historical data shows that the on-time rate of a certain route is 90%, then the expected on-time rate of this strategy is also 90%. 3. Calculate load factor: Calculate the load factor for each candidate strategy based on vehicle capacity and passenger flow data. For example, if a vehicle has a maximum capacity of 50 people and currently carries 40 passengers, then the load factor is 80%. 4. Calculate average passenger waiting time: Calculate the average passenger waiting time for each candidate strategy based on station spacing and operating speed. For example, if the station spacing is 2 kilometers and the vehicle operating speed is 30 kilometers per hour, then the average passenger waiting time is 4 minutes. 5. Generate service quality quantification results: Integrate the calculated expected on-time rate, load factor, and average passenger waiting time into a service quality quantification result.
[0219] Step 7: Compare and verify the calculated service quality indicators with the preset thresholds, and use the constraint satisfaction algorithm to select a set of feasible strategies from the candidate strategy set in which all indicators meet the standards.
[0220] The necessary process is as follows: 1. Compare with preset thresholds: Compare the service quality indicators (such as expected on-time rate, occupancy rate, and average passenger waiting time) of each candidate strategy calculated in step 6 with preset thresholds. For example, the preset thresholds are: expected on-time rate ≥ 90%, occupancy rate ≤ 80%, and average passenger waiting time ≤ 5 minutes. 2. Filter feasible strategies: Use a constraint satisfaction algorithm to check whether each candidate strategy meets all preset thresholds. If it does, it is added to the feasible strategy set. For example, if candidate strategy 1 has an expected on-time rate of 92%, an occupancy rate of 78%, and an average passenger waiting time of 4 minutes, then this strategy meets all preset thresholds and is added to the feasible strategy set.
[0221] Step 8: Select the Pareto optimal solution from the set of feasible strategies based on the multi-objective optimization algorithm, and output a collaborative scheduling scheme that meets the service quality requirements.
[0222] The necessary process is as follows: 1. Construct a multi-objective evaluation function. After inputting the feasible strategy set, construct an evaluation function containing three sub-objectives: punctuality objective f1 = 1 - punctuality rate, efficiency objective f2 = occupancy rate, and comfort objective f3 = average waiting time. Each sub-item is balanced using weight coefficients λ1, λ2, and λ3, and the weight relationships are determined by a preset function. Dynamic calculation, in which, 1. Parameters for the strategy. 2. Perform NSGA-II optimization: Initialize the population size N=100, encode the feasible strategy set, with each individual representing a scheduling scheme. Generate offspring by simulating binary crossover (SBX) and polynomial mutation, setting the crossover probability to 0.9 and the mutation probability to 0.1. Use fast non-dominated sorting to stratify the population, calculating the crowding distance for individuals in the same stratum. 3. Selecting Pareto Optimal Solutions: After 200 iterations, individuals with a non-dominant level of 1 are extracted from the final population to form the Pareto front. For example, the front may contain 5 solutions:
[0223] Solution A: (On-time rate 92%, load factor 78%, waiting time 4 minutes).
[0224] Solution B: (On-time rate 90%, load factor 75%, waiting time 3.5 minutes).
[0225] Solution C: (On-time rate 88%, load factor 72%, waiting time 3 minutes) These solutions are all Pareto optimal, and it is impossible to further optimize any of the indicators without compromising other indicators.
[0226] 4. Decision-making and output: The final solution is selected from the Pareto front using a weighted summation method, with weights dynamically adjusted based on the current service priority. If the school-going mode has the highest priority, then solution A, which has a higher on-time rate weight, is selected as the final coordinated scheduling solution. The output includes a complete scheduling instruction containing the line sequence, skip station instructions, and time window configuration.
[0227] Based on the same inventive concept, embodiments of the present invention provide an intelligent dispatching decision support system for community bus routes, including a memory and a processor, wherein the memory stores information that can run on the processor to implement the following... Figure 1 and Figure 2 The procedure for the method shown.
[0228] The embodiments described in this specific implementation are preferred embodiments of this application and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A community-oriented bus line intelligent scheduling decision support method, characterized in that, Comprise: Collect and integrate historical passenger flow card data from the payment system, real-time travel reservation request data from the community-oriented personnel dedicated application APP, and static data containing community population structure and public facility distribution, and construct a travel demand data set through spatio-temporal indexing alignment; Based on the travel demand data set and public facility distribution information, a clustering algorithm is used to identify travel purpose patterns with different spatio-temporal characteristics, and accordingly divide the travel record subsets corresponding to each mode to extract their spatio-temporal clustering features, time series evolution features and spatial correlation features, input into a multi-head attention prediction model with integrated adaptive weights, generate a prediction report containing sub-period passenger flow heat map and spatio-temporal probability matrix of each mode, and based on the spatio-temporal probability matrix of each mode and the preset community service strategy, calculate and generate the service time window priority value of each mode; Based on the prediction report and service time window priority value, a multi-agent collaborative decision-making framework is constructed, the route planning agent takes the passenger flow heat map and spatio-temporal probability matrix as input, optimizes the line sequence under the constraint of must-stop station and vehicle capacity, the skip-stop decision-making agent generates skip-stop instructions according to the service time window priority value combined with the competitive deep Q network, and the two agents cooperate through the sharing of critic network, the global reward function of the critic network gives higher on-time rate weight to the travel purpose mode with priority value higher than the set threshold, and outputs the dynamic scheduling scheme together; Convert the dynamic scheduling scheme into instructions and issue it to the vehicle-mounted and passenger service terminals to complete real-time scheduling.
2. The community bus route oriented intelligent scheduling decision support method according to claim 1, characterized in that, Based on the travel demand data set and public facility distribution information, a clustering algorithm is used to identify travel purpose patterns with different spatio-temporal characteristics, including: De-identify the historical passenger flow card data and real-time reservation request data to generate anonymous travel trajectory records containing only departure time, departure location and arrival time; Use a density-based spatio-temporal clustering algorithm to define the spatio-temporal coupling neighborhood with a preset spatial neighborhood radius and time window, and cluster the anonymous travel trajectory records to obtain multiple travel behavior clusters; Based on the public facility distribution information, spatially match the end point positions of the trajectories in each travel behavior cluster with the public facilities within a preset distance range; According to the matching results, perform semantic labeling: when the number of trajectories of a certain type of public facility matching a certain travel behavior cluster accounts for more than a preset threshold of the total number of trajectories of the travel behavior cluster, label the travel behavior cluster as a mode with the type of public facility as the travel purpose; Based on the labeling results, obtain each travel behavior cluster with a semantic travel purpose label and its spatio-temporal features.
3. The community bus route oriented intelligent scheduling decision support method according to claim 2, characterized in that, Based on the public facility distribution information, spatially match the end point positions of the trajectories in each travel behavior cluster with the public facilities within a preset distance range, including: According to the functional type and scale attribute of the public facilities, set different spatial influence radii to construct a facility influence range model; For each trip behavior cluster, the trajectory endpoint is preliminarily matched with the facility influence range model to generate a candidate set of destination facilities; then, based on the candidate set as input, the actual path distance of each trajectory endpoint to the candidate facilities is calculated based on the road network data, the precise matching is performed, and the list of the corresponding candidate facilities and the precise path distance of each trajectory is output; For each trajectory, the facility with the shortest actual path distance is selected as its main destination from the list obtained by precise matching, and if the actual path distance is less than a preset threshold, it is determined that the trajectory is successfully associated with the facility; For each trip behavior cluster, the corresponding number of different types of public facilities of all trajectories determined to be successfully associated is counted to form a facility matching statistical matrix.
4. The community bus route oriented intelligent scheduling decision support method according to claim 1, characterized in that, Generating a prediction report including a sub-period passenger flow heat map and a mode space-time probability matrix includes: Based on the corresponding trip record subset of each trip destination mode, the multi-modal feature extraction technology is used to obtain the space-time clustering feature, the time series evolution feature and the spatial correlation feature in parallel, and the feature fusion algorithm based on attention weight is used to fuse the above features into a unified multi-modal feature representation; The multi-modal feature representation is input into a multi-head attention prediction model, the community passenger flow space-time distribution prior knowledge is combined, the importance weight of each feature dimension is dynamically calculated through the adaptive weighting mechanism in the prediction model to generate a feature weight distribution matrix; Based on the feature weight distribution matrix, the space-time graph attention network is used to capture the space-time dependence relationship between different trip destination modes, the passenger flow density distribution of each station in different time periods is predicted through the deep neural network model to generate a sub-period passenger flow heat map; Taking the passenger flow heat map as input, introducing a probability calculation framework based on Bayesian inference, combining the historical space-time distribution law of each trip destination mode, calculating the conditional occurrence probability of each mode at a specific station and time period, and constructing a complete space-time probability matrix; The generated sub-period passenger flow heat map and the mode space-time probability matrix are integrated and packaged into a structured prediction report.
5. The community bus route oriented intelligent scheduling decision support method according to claim 4, characterized in that, It also includes the step of continuously optimizing the multi-head attention prediction model: Based on the vehicle GPS trajectory data and station passenger flow data collected in actual operation, the actual passenger flow distribution heat map and the actual mode distribution matrix corresponding to the actual operation situation are reconstructed and generated; The spatial feature difference between the passenger flow heat map in the prediction report and the actual passenger flow distribution heat map is calculated to obtain the heat map difference degree; at the same time, the probability distribution difference between each mode space-time probability matrix in the prediction report and the actual mode distribution matrix is calculated to obtain the probability matrix difference degree; The heat map difference degree and the probability matrix difference degree are combined through a weighted fusion algorithm to generate a unified model prediction deviation index; When the model prediction deviation index exceeds a preset threshold, the parameters in the multi-head attention prediction model are optimized and adjusted using an incremental learning algorithm; The optimized model parameters are updated to the online scheduling system for generating subsequent prediction reports.
6. The community bus route oriented intelligent scheduling decision support method according to claim 4, wherein, Based on the space-time probability matrix of each mode and the preset community service strategy, the service time window priority value of each mode is calculated and generated, including: Based on the basic priority of each travel purpose mode defined in the community service strategy, combined with the appearance probability value of each mode in the space-time probability matrix, the preliminary priority score is calculated through a weighted fusion algorithm; Based on the real-time collection of reservation request data, the service demand intensity change of each travel purpose mode is dynamically detected, and when the demand intensity of a specific mode exceeds the set threshold within a preset time window, the preliminary priority score is dynamically corrected using a preset weight adjustment function; Based on the corrected priority score, combined with the current available capacity resource distribution, the resource constraint optimization algorithm is used for normalization processing to generate an executable service time window priority value; The final generated service time window priority value is standardized and packaged.
7. The community bus route oriented intelligent scheduling decision support method according to claim 1, wherein, The route planning agent takes the passenger flow heat map and the space-time probability matrix as input, and optimizes the line sequence under the constraints of mandatory stop sites and vehicle capacity, including: Based on the passenger flow heat map, the time-period service demand intensity of each station is extracted, combined with the travel purpose mode distribution law in the space-time probability matrix, and a line optimization function is constructed, wherein the weight of each optimization objective is determined by a preset strategy parameter; The line optimization function is used as the fitness function, and the improved genetic algorithm is used for line sequence search. In the population initialization stage, the mandatory stop sites are embedded as fixed gene fragments into the chromosome coding; In the iteration process of genetic algorithm, the Monte Carlo tree search strategy is introduced, and the genetic algorithm parameters are dynamically adjusted based on the population diversity index, and the preliminary optimized line sequence is output; Taking the preliminary optimized line sequence as input, the simulated annealing mechanism is used for fine tuning, and the new solution is generated through neighborhood search operation, and the local optimized line sequence is output; Based on the local optimized line sequence, the vehicle capacity constraint and the service quality threshold are verified, and the optimal line sequence and operation index that meet the requirements are output.
8. The community bus route oriented intelligent scheduling decision support method according to claim 7, characterized in that, The skip-stop decision-making agent generates skip-stop instructions based on the service time window priority value and the competitive deep Q network, including: Based on the service time window priority value, the real-time car full load rate and the number of passengers waiting at the station, the current state of skip-stop decision-making is constructed; The current state is input into the pre-trained competitive deep Q network, and the action value of each candidate skip-stop action is calculated through the value function and advantage function of the competitive deep Q network; According to the preset action selection strategy, the skip-stop instruction sequence is generated based on the calculated action value.
9. A community-oriented bus line intelligent scheduling decision support system, characterized in that, A computer program product, comprising a memory, a processor and a program stored in the memory and executable on the processor, which can be loaded and executed by the processor to implement the intelligent scheduling decision support method for community bus special line according to any one of claims 1 to 8.
Citation Information
Patent Citations
Dynamic path planning method and system in intelligent traffic system
CN120252763A
DAS driving strategy optimization method driven by subway line real-time data
CN120363970A
Transfer connection optimization method in multi-mode traffic integrated planning
CN120373746A
Intelligent bus combination scheduling method and device and storage medium
CN120636190A
Bus automatic driving method and system
CN121191345A
Cited By
Convenient life service intelligent management method and system based on big data
CN122199242A