Bus line scheduling optimization method, device and equipment

By employing a dual-depth Q-network algorithm within a defender-attacker Markov decision game framework, the problem of random disturbances in runtime in multi-route bus systems is addressed, enabling robust adaptive optimization of bus route scheduling and improving system efficiency and service quality.

CN123050778APending Publication Date: 2026-11-06GUANGZHOU TRANSPORTATION PLANNING & RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611150288.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing bus scheduling methods struggle to achieve robust and adaptive optimization when faced with random disturbances in runtime across multiple routes and complex real-world scenarios, leading to a decline in the efficiency and service quality of the bus system.

Method used

A dual-depth Q-network algorithm based on the defender-attacker Markov decision game theory framework is adopted. The preset scheduling agent is trained through a two-stage adversarial training method to generate the optimal departure interval and route allocation strategy, thereby optimizing bus route scheduling.

Benefits of technology

In a multi-route environment, robust adaptive bus scheduling was implemented to withstand random disturbances in running time, improving the efficiency and service quality of the bus system and reducing passenger waiting time and operating costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123050778A_ABST
    Figure CN123050778A_ABST
Patent Text Reader

Abstract

The application discloses a kind of bus line scheduling optimization method, device and equipment, the method includes according to the real-time operation data of bus system and operation constraint corresponding construction real-time system state vector and action mask matrix;According to real-time system state vector and preset scheduling agent, generate the original Q value corresponding to full action space;Wherein, preset scheduling agent is obtained by training to fight double deep Q network using two-stage confrontation training mode based on defender-attacker Markov decision game framework;All original Q values are filtered using action mask matrix and processed, select the action corresponding to the maximum value in filtered Q value as optimal scheduling action;To generate multi-line bus scheduling instruction, complete bus line scheduling optimization.Can be based on defender-attacker Markov decision game theory framework, utilize double deep Q network algorithm, in multi-line environment realizes the robust adaptive bus scheduling optimization of response to random disturbance of running time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of route scheduling technology, and in particular to a method, apparatus and equipment for optimizing bus route scheduling. Background Technology

[0002] Efficient and reliable public transportation services are the foundation of sustainable urban development. Public transportation scheduling is a core component of public transportation system operation. Its main purpose is to rationally determine the departure intervals and operating plans of buses while considering passenger demand and service levels, in order to minimize the total system cost (including passenger waiting costs and operator operating costs). However, in actual public transportation operations, vehicle travel time is significantly affected by various uncertainties such as traffic congestion, inclement weather, and unforeseen events, exhibiting considerable randomness. This uncertainty in travel time can lead to problems such as buses running in the same lane, delays, uneven passenger distribution, and increased waiting times, seriously impacting the efficiency and service quality of the public transportation system. Therefore, how to achieve robust and adaptive public transportation scheduling under uncertain operating environments is a critical issue that urgently needs to be addressed in the field of public transportation operation optimization.

[0003] Currently, domestic and international research and practical methods on public transport operation scheduling mainly fall into the following categories: deterministic scheduling methods cannot cope with the random fluctuations in running time during actual operation, and the performance of the resulting scheduling schemes often degrades severely under uncertain environments; stochastic optimization methods are mostly aimed at single-route scenarios with relatively fixed demand, and the range of random disturbances is relatively limited, making them difficult to apply to multi-route and complex real-world scenarios; robust optimization methods usually rely on a predefined set of deterministic uncertainties, making it difficult to adaptively cope with the complex and ever-changing disturbance patterns in actual operation; metaheuristic algorithms usually require long computation times, making it difficult to meet the real-time requirements of actual public transport scheduling, while offline heuristic methods lack adaptive adjustment capabilities when facing real-time changing operating environments and passenger demands; reinforcement learning scheduling methods mostly do not fully consider the uncertainty of running time, and their decision-making performance often declines significantly when facing unconventional disturbances.

[0004] Therefore, how to achieve robust adaptive bus scheduling optimization to cope with random disturbances in runtime in a multi-line environment is an urgent problem to be solved. Summary of the Invention

[0005] This invention provides a method, apparatus, and equipment for optimizing bus route scheduling. Based on the defender-attacker Markov decision game theory framework, it utilizes a dual-depth Q-network algorithm to achieve robust adaptive bus scheduling optimization in a multi-route environment to cope with random disturbances in running time.

[0006] To achieve the above objectives, embodiments of the present invention provide a method for optimizing bus route scheduling, comprising: Obtain real-time operation data and operational constraints of the public transportation system; construct a real-time system state vector of the public transportation system based on the real-time operation data; generate an action mask matrix of the public transportation system based on the operational constraints; Based on the real-time system state vector and the preset scheduling agent, the original Q value corresponding to the full action space of the bus system is generated; wherein, the preset scheduling agent is obtained by training a dual-deep Q network in a two-stage adversarial training method based on the defender-attacker Markov decision game framework. The action mask matrix is ​​used to filter all the original Q values, and the action corresponding to the maximum value is selected from the filtered valid Q values ​​as the optimal scheduling action. The departure interval and route allocation information corresponding to the optimal scheduling action are analyzed to generate multi-route bus scheduling instructions for the public transportation system, thereby completing the optimization of bus route scheduling.

[0007] As an improvement to the above scheme, the method for obtaining the preset scheduling agent includes: Based on the dynamic model of a multi-route bus system, the defender's Markov decision process, and the attacker's Markov decision process, a defender-attacker Markov decision game framework is constructed. Construct defender versus attacker versus dual-depth Q-networks and configure priority experience replay buffers, adaptive ε-greedy exploration mechanisms, and state-dependent action masking mechanisms for the two types of dual-depth Q-networks. Based on the defender-attacker Markov decision game framework, a two-stage adversarial training method is used to iteratively train the defender versus dual-depth Q network and the attacker versus dual-depth Q network until both converge. The converged defender versus dual-depth Q network is then used as the preset scheduling agent.

[0008] As an improvement to the above scheme, the defender in the defender-attacker Markov decision game framework takes minimizing the weighted total cost of passenger waiting costs and operator operating costs as the optimization objective, and the corresponding actions include departure intervals and route allocation. In the defender-attacker Markov decision game framework, the attacker aims to maximize the weighted total cost, and the corresponding action is the disturbance rate of the running time of each bus route.

[0009] As an improvement to the above scheme, the step of iteratively training the defender-attacker dual-depth Q-network and the attacker-attacker dual-depth Q-network using a two-stage adversarial training method based on the defender-attacker Markov decision game framework until both converge, and then using the converged defender-attacker dual-depth Q-network as a preset scheduling agent, includes: The defender versus dual-depth Q network is trained using passenger flow and baseline driving data from the public transportation system until the loss function of the defender versus dual-depth Q network converges, thus obtaining the pre-trained defender versus dual-depth Q network. Based on the defender-attacker Markov decision game framework and the pre-trained defender versus dual-depth Q network, the defender versus dual-depth Q network and the attacker versus dual-depth Q network are subjected to alternating adversarial iterative training until both the defender versus dual-depth Q network and the attacker versus dual-depth Q network converge. The converged defender versus dual-depth Q network is then used as the preset scheduling agent.

[0010] As an improvement to the above scheme, each alternating adversarial iteration of training includes: The parameters of the pre-trained defender versus dual-depth Q network are fixed, while the parameters of the attacker versus dual-depth Q network are continuously updated. The attacker-versus-defender dual-depth Q network is fixed and updated. The defender-versus-defender dual-depth Q network is updated based on various random and extreme road condition disturbance samples output by the updated attacker-versus-defender dual-depth Q network, thereby optimizing the defender's vehicle dispatching strategy under disturbance scenarios.

[0011] As an improvement to the above scheme, the defender's Markov decision process and the attacker's Markov decision process include: The state vector of the defender Markov decision process includes the arrival and departure times of each vehicle station, the real-time number of passengers waiting at all stations, the current departure count and the operation termination flag. The actions include the global next departure interval and the allocation of departure routes. The optimization objective is to minimize the weighted sum of passenger waiting costs and operator operating costs. The state vector of the attacker's Markov decision process includes the total number of departures in each attack interval, the cumulative waiting passenger flow in the interval, and the number of passengers stranded at the end station of the interval. The action is the running time disturbance rate of each bus route, and the optimization objective is to maximize the weighted sum of passenger waiting costs and operator operating costs.

[0012] As an improvement to the above scheme, the construction of defender-versus-attacker dual-depth Q-networks and attacker-versus-attacker dual-depth Q-networks, and the configuration of a priority experience replay buffer, an adaptive ε-greedy exploration mechanism, and a state-dependent action masking mechanism for the two types of dual-depth Q-networks, includes: Construct a defender versus a attacker versus a dual-depth Q-network; Establish corresponding priority experience replay buffers for the defender versus dual-depth Q network and the attacker versus dual-depth Q network respectively, to store the temporal state, actions, and optimization goals; The defender versus attacker versus dual deep Q network is configured with corresponding adaptive ε-greedy exploration mechanisms, which are used to reduce the exploration probability from the maximum value to the preset minimum value by the cumulative decay factor exponentially during the training period. The decay coefficient is updated after each round of decision-making, and the exploration probability is reset in the alternating adversarial training rounds. For the defender versus attacker versus dual-depth Q network, a corresponding state-dependent action masking mechanism is designed. This mechanism assigns negative infinity to the original Q value of all illegal actions based on the departure interval and route feasibility constraints corresponding to the current system state, while retaining compliant actions to participate in the optimal action selection.

[0013] As an improvement to the above scheme, the construction of a defender-attacker Markov decision game framework based on the dynamic model of a multi-route bus system, the defender's Markov decision process, and the attacker's Markov decision process includes: Establish a unified discrete-time index timing coordination mechanism, define a globally unified time step as the benchmark for synchronous deduction by both the attacker and the defender, set a departure countdown counter and an attack interval counting indicator respectively, and distinguish the timing of the defender's departure decision and the timing of the attacker's disturbance application. A system state transition function is constructed based on the dynamic model of a multi-route bus system. The defender Markov decision process and the attacker Markov decision process are coupled with the system state transition function based on the unified discrete-time index timing coordination mechanism. Based on the defender's Markov decision process and the attacker's Markov decision process, a defender-attacker Markov decision game framework is constructed.

[0014] To achieve the above objectives, embodiments of the present invention provide a bus route scheduling optimization device, comprising: The relevant data acquisition module is used to acquire real-time operation data and operational constraints of the public transportation system; construct the real-time system state vector of the public transportation system based on the real-time operation data; and generate the action mask matrix of the public transportation system based on the operational constraints. The original action generation module is used to generate the original Q value corresponding to the full action space of the bus system based on the real-time system state vector and the preset scheduling agent; wherein, the preset scheduling agent is obtained by training a dual-deep Q network based on a defender-attacker Markov decision game framework using a two-stage adversarial training method. The scheduling action determination module is used to filter all the original Q values ​​using the action mask matrix, and select the action corresponding to the maximum value from the filtered valid Q values ​​as the optimal scheduling action. The dispatch instruction generation module is used to parse the departure interval and route allocation information corresponding to the optimal dispatch action, and generate multi-route bus dispatch instructions for the public transportation system to complete the bus route dispatch optimization.

[0015] To achieve the above objectives, this invention provides a bus route scheduling optimization device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the above-mentioned bus route scheduling optimization method.

[0016] Compared with existing technologies, the present invention discloses a bus route scheduling optimization method, apparatus, and equipment. This method acquires real-time operational data and operational constraints of the bus system; constructs a real-time system state vector based on the real-time operational data; generates an action mask matrix for the bus system based on the operational constraints; and generates the original Q-values ​​corresponding to the full action space of the bus system based on the real-time system state vector and a preset scheduling agent. The preset scheduling agent is obtained by training a dual-depth Q-network using a two-stage adversarial training method based on a defender-attacker Markov decision game framework. The action mask matrix is ​​used to filter all the original Q-values, and the action corresponding to the maximum value from the filtered effective Q-values ​​is selected as the optimal scheduling action. The departure interval and route allocation information corresponding to the optimal scheduling action are analyzed to generate multi-route bus scheduling instructions for the bus system, thereby completing the bus route scheduling optimization. Based on the defender-attacker Markov decision game theory framework and utilizing a dual-depth Q-network algorithm, robust adaptive bus scheduling optimization capable of handling random disturbances in runtime is achieved in a multi-route environment. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a bus route scheduling optimization method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a multi-line bus system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a unified time indexing framework provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of a defender-attacker Markov decision game framework provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of a Dueling ANN architecture with a masking mechanism provided in an embodiment of the present invention; Figure 6 This is a flowchart of a two-stage adversarial training framework provided by an embodiment of the present invention; Figure 7 This is a diagram illustrating a passenger queuing process and service process provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of passenger queuing under an attacker's cost function, provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of the structure of a bus route scheduling optimization device provided in an embodiment of the present invention; Figure 10 This is a structural block diagram of a bus route scheduling optimization device provided in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] It should be noted that the terms "comprising" and "specific" in this invention, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.

[0020] Please see Figure 1 , Figure 1 This is a flowchart illustrating a bus route scheduling optimization method provided in an embodiment of the present invention. The bus route scheduling optimization method includes: S1, Obtain real-time operation data and operational constraints of the public transportation system; Construct a real-time system state vector of the public transportation system based on the real-time operation data; Generate an action mask matrix of the public transportation system based on the operational constraints; S2, Based on the real-time system state vector and the preset scheduling agent, generate the original Q value corresponding to the full action space of the bus system; wherein, the preset scheduling agent is obtained by training a dual-deep Q network in a two-stage adversarial training method based on the defender-attacker Markov decision game framework. S3, use the action mask matrix to filter all the original Q values, and select the action corresponding to the maximum value from the filtered valid Q values ​​as the optimal scheduling action; S4. Analyze the departure interval and route allocation information corresponding to the optimal scheduling action to generate multi-route bus scheduling instructions for the public transportation system, so as to complete the optimization of bus route scheduling.

[0021] For example, real-time operational data includes departure time, arrival time, and the number of remaining passengers upon departure from each station; operational constraints include upper / lower bounds for departure intervals, departure routes, and travel time disturbances. , (1) (2) (3) (4) in, and These are the minimum and maximum values ​​set from a system-level perspective for service departure intervals to ensure a specific global service level. Each departure... Distribution lines It should be from the set of feasible routes Select from the set. Refers to the set of positive integers; and Each line represents a different line. of The lower and upper bounds, of which, , This is to ensure the proper functioning of the countermeasures control system. Furthermore, it is required... .

[0022] No. The selected route for the next departure is The system-level constraint on departure intervals in equation (1) is extended to each specific line in the system. In order to maintain local service levels on each line: (5) in and These represent the minimum and maximum departure intervals for each individual line, respectively. Furthermore, to resolve potential conflicts between Equation (1) (system level) and Equation (5) (line level) regarding departure intervals, the following constraints are considered to derive the departure intervals. The feasible precise range of departure intervals.

[0023] If the above constraints are satisfied, then the number of available lines in the system is... At that time, a departure interval satisfying equations (1) and (5) only exists when the following constraints are met. The constraints are as follows: (6) It is worth noting that when there is only one available line in the system, the system will dispatch trains. The feasible range for departure intervals is as follows: (7) In addition, at the system level, constraints related to vehicle availability are imposed, taking into account the limited number of vehicles in the fleet and the rules of recycling.

[0024] Specifically, the method for obtaining the preset scheduling agent includes: Based on the dynamic model of a multi-route bus system, the defender's Markov decision process, and the attacker's Markov decision process, a defender-attacker Markov decision game framework is constructed. Construct defender-versus-attacker dual-depth Q-networks and attacker-versus-attacker dual-depth Q-networks, and configure priority experience replay buffers and adaptive features for both types of dual-depth Q-networks. ε- Greedy exploration mechanism and state-dependent action masking mechanism; Based on the defender-attacker Markov decision game framework, a two-stage adversarial training method is used to iteratively train the defender versus dual-depth Q network and the attacker versus dual-depth Q network until both converge. The converged defender versus dual-depth Q network is then used as the preset scheduling agent.

[0025] For example, such as Figure 2 As shown, Figure 2 This is a schematic diagram of a multi-route bus system provided by an embodiment of the present invention; the process of constructing the dynamic model of the multi-route bus system is as follows: the system has a total of There are [number] buses, each with a passenger capacity of [number]. Serving a collection of routes (common (Number of lines). Each line In the outbound direction ( ) and return direction ( There are a series of sites on each. Vehicles from the station Issued. If two consecutive departures have already occurred in the system. and Departure intervals were set Then the first Departure time of the next departure This can be deduced as: (8) For each line The bus service starts from the station in the outbound direction. Depart, and pass through in sequence Arrival and termination at station The time spent turning around at that location Then, following the return route via , Finally arrived .

[0026] To clarify the departure status on different routes within the system, each departure in the entire service system will be recorded. This is denoted as: if it is on the line If it runs on, then it is the first on that line. The next departure, among which... binary variables Indicates the first The next departure was assigned to the route , This indicates that the line has been assigned to another line.

[0027] For those assigned to the line (by (For example) departure The train departs on the route. On each station Arrival time and departure time The following can be derived: (9) (10) in, For this departure on the route Site Stop time; For the line adjacent station pairs The runtime between [the two periods].

[0028] Passenger demand is related to the vehicle operation process. It consists of time periods A series of origin-destination (OD) matrices characterize the interior, among which, Indicates at time From the site Go to the station (All on the line) The arrival rate (above). Passengers queue according to a first-come, first-served rule. Let... For the purpose of the first Next departure (route) (Up) From the site Get on the bus and head to The number of passengers can be determined based on the given OD (Origin-Destination) demand matrix as follows: (11) The above formula applies to all sites (line The above is true. In the formula, The specific demand rate given for the OD matrix; the first term of the expression represents the demand rate in the first... Next and first Between the next departures The number of arriving passengers; the second term indicates the number of passengers arriving in the first quarter. After the train departs, it remains at the station. Waiting to go The number of passengers.

[0029] Given the number of waiting passengers and vehicle passenger capacity To truly reach the top Number of passengers on each departure It can be derived from equation (11) Sure: (12) in, For the first The next departure station At that time, the car was heading to its destination. The number of passengers, and its state evolution equation is: (13) The initial condition is: for all lines In the garage There are .

[0030] Combined on the site The number of passengers waiting for the train and the number of passengers actually boarding the train, the first After the train departs from the station The remaining number of passengers can be expressed as: (14) To coordinate asynchronous decisions made by defender and attacker agents, a unified time indexing framework is introduced. ,like Figure 3 As shown, Figure 3 This is a schematic diagram of a unified time index framework provided in an embodiment of the present invention. Figure 3 The black square in the image represents the moment when the defender's AI sends out the bus. Index for deadline Service trip numbers that have been dispatched. The gray squares associated with departure times represent the routes assigned to each departing bus. (Marks) and They represent the times at time 1 and 2 respectively. Send the first to the system The departure sequence number assigned to each route during each service session. For example, in At that time, the first departure ( ) was assigned to the line (Right now ), then in The second departure was assigned to the route (Right now , The departure process continues throughout the entire operating period, covering all available service routes. The black circles in the diagram represent specific time steps. That is, the attack range for each attack The starting point, the disturbance The attack is applied within this range, with each attack lasting a predefined duration. (For example ). The value reflects the current time step The attack zone number (e.g., when) hour, ).

[0031] Specifically, in the defender-attacker Markov decision game framework, the defender aims to minimize the weighted total cost of passenger waiting costs and operator operating costs, and the corresponding actions include departure intervals and route allocation. In the defender-attacker Markov decision game framework, the attacker aims to maximize the weighted total cost, and the corresponding action is the disturbance rate of the running time of each bus route.

[0032] For example, in the defender-attacker Markov decision game framework, the goal of the defender agent is to determine the departure interval and the corresponding route allocation; the goal of the attacker agent is to determine the departure interval and the corresponding route allocation for each route in equation (9). runtime Apply perturbation To disrupt system service performance: (15) in, The runtime baseline value is designed to incorporate Gaussian noise to reflect randomness.

[0033] More specifically, according to the defender-attacker Markov decision game framework, the two-stage adversarial training method is used to iteratively train the defender-versus-attacker dual-depth Q-network and the attacker-versus-attacker dual-depth Q-network until both converge. The converged defender-versus-attacker dual-depth Q-network is then used as a preset scheduling agent, including: The defender versus dual-depth Q network is trained using passenger flow and baseline driving data from the public transportation system until the loss function of the defender versus dual-depth Q network converges, thus obtaining the pre-trained defender versus dual-depth Q network. Based on the defender-attacker Markov decision game framework and the pre-trained defender versus dual-depth Q network, the defender versus dual-depth Q network and the attacker versus dual-depth Q network are subjected to alternating adversarial iterative training until both the defender versus dual-depth Q network and the attacker versus dual-depth Q network converge. The converged defender versus dual-depth Q network is then used as the preset scheduling agent.

[0034] For example, such as Figure 4 As shown, Figure 4 This is a schematic diagram of a defender-attacker Markov decision game framework provided in an embodiment of the present invention. The function is an approximate state-action value function, using an artificial neural network with a Dueling architecture as a proxy function approximator. The network corresponding to the defender agent is denoted as... The network corresponding to the attacker's intelligent agent is denoted as , respectively by parameters and Parameterization. For example... Figure 5 As shown, Figure 5 This is a schematic diagram of a Dueling ANN architecture with a masking mechanism provided by an embodiment of the present invention. The Dueling neural network architecture employs a series of fully connected layers, coupled with element-wise nonlinear activation units (e.g., the ReLU function). It is based on embedded decision variables. Approximate state value functions respectively and dominance function The two are then combined to obtain the state-action value. This structure achieves more robust and efficient learning in complex stochastic environments by improving the stability of value estimation.

[0035] To avoid potentially infeasible decisions that violate constraints (5)-(7), a state-dependent masking scheme is implemented. The details are as follows: (16) in, , and They are respectively and Size of the feasible set under boundary constraints (1)-(3). State-action pair when constraints (5)-(7) are violated. The Q value is assigned as The corresponding actions They will not be selected. This masking scheme is very effective in deep reinforcement learning methods, even in scenarios with large decision spaces.

[0036] Embedded decision and elements in , and Encoded in integer form, corresponding to respectively The original decision and ,as well as In The conversion function is defined as follows: (17) , (18).

[0037] More specifically, each alternating adversarial training iteration includes: The parameters of the pre-trained defender versus dual-depth Q network are fixed, while the parameters of the attacker versus dual-depth Q network are continuously updated. The attacker-versus-defender dual-depth Q network is fixed and updated. The defender-versus-defender dual-depth Q network is updated based on various random and extreme road condition disturbance samples output by the updated attacker-versus-defender dual-depth Q network, thereby optimizing the defender's vehicle dispatching strategy under disturbance scenarios.

[0038] For example, such as Figure 6 As shown, Figure 6 This is a flowchart of a two-stage adversarial training framework provided by an embodiment of the present invention. The training process begins with optimizing the defender's strategy in a non-adversarial environment. At this time, the defender learns the optimal departure strategy driven by dynamic passenger demand, without considering runtime perturbations caused by the attacker. The training objective is to obtain a set of ANN (Artificial Neural Network) proxy parameters. Furthermore, the attacker has not yet intervened at this point. The defender-only scenario obtained in this stage serves as a benchmark for subsequent scenarios involving the attacker. An alternating adversarial training process is then conducted: the attacker agent learns the defender's strategy and attempts to achieve maximum disruption by imposing runtime perturbations on the network. This is achieved by progressively updating the attacker's ANN parameters within a reinforcement learning computation framework. To achieve this, in this process, the defender's ANN parameters The ANN parameter settings remain fixed during the attack phase. During the subsequent defensive phase of training, the defender will update their ANN parameter settings. This is to mitigate the impact of the attacker's actions in the previous attack phase. This defense-attack alternation process is repeated. Through this process, defenders will gradually be trained to resist external disturbances in runtime.

[0039] The training process first establishes an experience replay buffer. Used to store observed transferred samples, denoted as At each time step ,like Based on the current state and masking scheme Decision-making embedded decision : (19) Otherwise, if The decision is set to zero. The actual actions are executed according to equations (17)-(18), and the resulting transfer experience is recorded in the replay buffer.

[0040] Adaptive - Greedy exploration scheme, where the exploration probability From initial value Decays exponentially to the lower bound. : (20) ,(twenty one) in, For time step During the training cycle The cumulative decay factor within, This is the nominal decay rate. Only Updated in real time. It is worth noting that at the start of each alternating training cycle, the exploration rates of the defender and attacker agents... and All were reset to their initial values. This is to facilitate exploration and prevent premature convergence.

[0041] After new transfer experiences are stored in the replay buffer, they are retrieved from the experience replay buffer. Extract a containing A mini-batch of transition samples is used to update the parameters of the Dueling neural network. Unlike uniform sampling, the priority experience replay technique assigns different sampling priorities to the stored transition samples based on their importance during training. Transition samples priority Due to its time difference error Confirm, and add a small positive number. To ensure that the priority is non-zero: ,(twenty two) ,(twenty three) Then, sample transfer The probability is determined by the parameter. calculate: ,(twenty four) Subsequently, importance sampling weights were introduced. Used for correction Deviation in value update: (25) Using the transferred samples obtained from sampling, the target Q value for each transfer is calculated through single-step time difference updates: (26) A weighted loss function can be defined: (27) parameter By minimizing Update: (28) The target network parameters are updated using a smoothed moving average: (29) in, This is the smoothing coefficient.

[0042] The training process is in The process iterates within a cycle until the dynamic system simulation terminates.

[0043] Specifically, attackers maintain their own target networks. Priority replay buffer and utilize the stored Transfer samples in Update its parameters The attacker's loss function and parameter update rules are formally the same as those in equations (27)-(29), only requiring the following changes: Replace with .

[0044] More specifically, the defender's Markov decision process and the attacker's Markov decision process include: The state vector of the defender Markov decision process includes the arrival and departure times of each vehicle station, the real-time number of passengers waiting at all stations, the current departure count and the operation termination flag. The actions include the global next departure interval and the allocation of departure routes. The optimization objective is to minimize the weighted sum of passenger waiting costs and operator operating costs. The state vector of the attacker's Markov decision process includes the total number of departures in each attack interval, the cumulative waiting passenger flow in the interval, and the number of passengers stranded at the end station of the interval. The action is the running time disturbance rate of each bus route, and the optimization objective is to maximize the weighted sum of passenger waiting costs and operator operating costs.

[0045] For example, the defender's Markov decision process is as follows: the defender's MDP at each time step state vector Defined as ,in, Indicates the first Before the next departure, each route On each station The departure time of the last train; Indicates the corresponding arrival time; Indicates each line The last train departs from each station The number of remaining passengers at that time; Indicates the first The arrival times of each departure at each station on its assigned route; This indicates the corresponding departure time. At each time step... The defender makes the decision. ,in, Indicates the previous departure Then, for the next departure in the system The allocated departure intervals; This indicates the route to which the train was assigned for this departure.

[0046] At each time step Given the defender's state-decision pair and attacker decision The system proceeds to the next time step according to the transfer function. status evolution: (30) Among them, the transfer operator It integrates the dynamic processes defined in equations (8) to (14) and the distribution of passenger demand. Variables Used as a countdown indicator to track progress from the current time step The remaining time steps until the next dispatch to the operations system can be adjusted according to time steps. The update is as follows: (31) in, The initial value is in Time set ,exist hour .for and In this situation, The value in the th The value is immediately assigned after the vehicle enters the system upon departure. Then, decrease the time step by one every time interval until... When the number drops to zero, the next departure will be scheduled. .when When equal to zero, the corresponding Update according to equation (30).

[0047] Specific routes The termination of bus service is indicated by a binary indicator. Specify: If a predefined time range is reached And the entire line At time step If there are no passengers in the queue, then ;otherwise When all lines All meet At that time, the public transportation service operation system will be terminated.

[0048] After each state transition, the defender will receive a cost function. The cost signal is determined as follows: (32) in, and They respectively represent the first The corresponding passenger waiting time cost and operator operating cost for each departure; parameters This is used to weigh these two indicators.

[0049] To determine the passenger cost in equation (32) , Figure 7 With a specific route Visit specific sites The example illustrates the passenger queuing process. Figure 7 This is a diagram illustrating a passenger queuing process and service process provided in an embodiment of the present invention. Figure 7The solid line represents the change in cumulative passenger arrivals over time, while the dashed step function represents the change in cumulative station service (departures and departures) over time. The vertical difference between the two curves... That is, at the site The number of passengers waiting for the train. The shaded area in the graph represents the area between two consecutive departures. and Between, site Total waiting time for all passengers present . No. Next departure (route) (above) monetized passenger waiting costs It can be determined as follows: (33) in, This refers to the unit monetary cost related to passenger waiting time.

[0050] From an operational perspective, total system cost It consists of three parts: (1) Fixed costs Related to the driving distance, among which Cost per unit distance; (2) Variable costs Related to operating hours, among which Cost per unit of time; (3) Energy-related costs Corresponding to the total force The energy consumption generated includes aerodynamic drag. Acceleration force and rolling resistance . The expression is as follows: (34) (35) (36) (37) in, The unit currency price of energy; For the line adjacent stations The distance between them; air density, This is the aerodynamic drag coefficient. This refers to the front surface area of ​​the bus. Average speed; and These are the bus's own weight and the total weight of the passengers, respectively. For the first The next departure will be at an adjacent station. The number of passengers on the vehicle while traveling between locations; It is the average acceleration; It is the acceleration due to gravity. This is the rolling resistance coefficient.

[0051] The defender's objective can be stated as: determining the optimal departure intervals and route allocation schemes for all departures in the public transportation system. , set the initial time step To an infinite range Total cost between Minimize: (38) Among them, discount factor The termination condition indicator is related to future costs. The objective function in equation (38) is given in the form of an infinite range, but in actual implementation, when the termination condition is met (i.e., all lines satisfy the condition), the objective function is actually limited to an infinite range. The simulation terminates when no passengers remain in the system. Discount factor This ensures that future costs beyond the effective range have a negligible impact on the objective function, thus aligning the infinite range form with the actual finite-cycle execution. The same logic applies to the attacker's objective function in equation (47), a standard practice in reinforcement learning for dynamic optimization problems.

[0052] The attacker's Markov decision process is as follows: the attacker's MDP state vector is in each Recorded as ,in .here In order to be in The line is assigned within the attack range Number of departures; In order to be in Within the attack range, on the line On each station Waiting for the train, waiting for the first The next departure (assigned to the route) The number of passengers. (Mark) and They represent The start and end time steps of the attack range. Finally, Indicates in Timetable On various sites The number of waiting passengers. The attacker's actions over time. The regulations are as follows ,in, Specify in attack range against the line The rate of perturbation applied during runtime.

[0053] The corresponding random transfer process can be described as follows, which includes: : (39) in, As a counter indicator, tracking from the current Up to now The number of time steps remaining until the end of the attack interval. This counter indicator is defined as follows: (40) when exist The attack range ends and is set to Subsequently, with the current The value gradually decreases to 1 as the time period nears its end. It is worth noting that this decrease occurs when the system-level termination condition is met (i.e., for all lines). All ), Also set as .

[0054] Transition Operator The calculations are performed using equations (8)-(15) and subsequently equations (41)-(43). Within the attack range... Inside, assigned to the line And subject to runtime disturbances The number of departures affected can be determined as follows: (41) Among them, binary variables In the The next departure was assigned to the route It equals 1 if it is true, otherwise it is zero.

[0055] Given passenger demand And the number of passengers served, derived from equation (12), within the attack interval Departure from within, on the route Site Waiting for the train and waiting for the first Number of passengers on each departure It can be determined as follows: (42) The first item on the right is the number The next departure station The cumulative number of passengers arriving at that time, the second item being those previously assigned to routes. The number of passengers served by the bus.

[0056] attack range At the end (i.e.) ),line Upstairs Number of passengers in queue The derivation is as follows: (43) The first and second items on the right represent the cumulative number of passenger arrivals and the cumulative number of services provided, respectively.

[0057] The attacker will satisfy each time Receive cost signals (See equation (44)). The cost function in equation (44) and These represent the attacker's position within the attack range. Internally perceived monetized passenger waiting costs and operator costs. Parameters The parameter represents the trade-off between the two cost components, and its value is related to the cost function of the defender agent (Equation (32)). The same. Both agents use the same trade-off parameters in their cost functions. This is to maintain a zero-sum game framework and ensure that both parties evaluate system performance under the same metrics.

[0058] (44) Figure 8 This is a schematic diagram of passenger queuing under an attacker's cost function, provided in an embodiment of the present invention. Figure 8 The area of ​​the shaded region represents the area in the middle. Within the attack range, the line Upstairs Total passenger waiting time It is through the interval Vertical gap within Points earned. System-level total waiting cost. Through monetization conversion factor Quantification: (45) In terms of operations, all lines are Total operator cost Available at each departure Operating costs and binary variables Regulation: (46) Unlike the defender, the attacker's goal is to, based on the defender's decisions, achieve victory within an infinite range. Applying runtime perturbations internally will increase the overall cost. maximize: (47) Among them, discount factor Here, in equation (38) Take the same value.

[0059] Although the defender and attacker agents calculate passenger waiting costs and operating costs from different perspectives (departure level and attack zone level), both are consistent across the entire simulation range. The cumulative costs within are essentially the same, as shown below: (48) in, and They represent The total number of departures and the total number of attack zones within the area.

[0060] This consistency stems from the fact that the two agents operate within the same unified time reference frame. They operate internally and share the same underlying dynamics (including passenger demand distribution and service route configuration). Therefore, while pursuing opposing goals, both the defender and attacker agents ultimately observe the same overall system performance in terms of passenger waiting time and operational efficiency, making this adversarial game a zero-sum game.

[0061] More specifically, the construction of defender-versus-attacker dual-depth Q-networks and attacker-versus-attacker dual-depth Q-networks is described, and priority experience replay buffers and adaptive features are configured for both types of dual-depth Q-networks. Greedy exploration mechanism and state-dependent action masking mechanism, including: Construct a defender versus a attacker versus a dual-depth Q-network; Establish corresponding priority experience replay buffers for the defender versus dual-depth Q network and the attacker versus dual-depth Q network respectively, to store the temporal state, actions, and optimization goals; The defender versus attacker versus dual deep Q network is configured with corresponding adaptive ε-greedy exploration mechanisms, which are used to reduce the exploration probability from the maximum value to the preset minimum value by the cumulative decay factor exponentially during the training period. The decay coefficient is updated after each round of decision-making, and the exploration probability is reset in the alternating adversarial training rounds. For the defender versus attacker versus dual-depth Q network, a corresponding state-dependent action masking mechanism is designed. This mechanism assigns negative infinity to the original Q value of all illegal actions based on the departure interval and route feasibility constraints corresponding to the current system state, while retaining compliant actions to participate in the optimal action selection.

[0062] More specifically, the construction of a defender-attacker Markov decision game framework based on the dynamic model of a multi-route bus system, the defender's Markov decision process, and the attacker's Markov decision process includes: Establish a unified discrete-time index timing coordination mechanism, define a globally unified time step as the benchmark for synchronous deduction by both the attacker and the defender, set a departure countdown counter and an attack interval counting indicator respectively, and distinguish the timing of the defender's departure decision and the timing of the attacker's disturbance application. A system state transition function is constructed based on the dynamic model of a multi-route bus system. The defender Markov decision process and the attacker Markov decision process are coupled with the system state transition function based on the unified discrete-time index timing coordination mechanism. Based on the defender's Markov decision process and the attacker's Markov decision process, a defender-attacker Markov decision game framework is constructed.

[0063] This invention discloses a method for optimizing bus route scheduling. The method involves acquiring real-time operational data and constraints of the bus system; constructing a real-time system state vector based on the real-time operational data; generating an action mask matrix for the bus system based on the operational constraints; and generating the original Q-values ​​corresponding to the full action space of the bus system based on the real-time system state vector and a preset scheduling agent. The preset scheduling agent is obtained by training a dual-depth Q-network using a two-stage adversarial training method based on a defender-attacker Markov decision game framework. The action mask matrix is ​​used to filter all the original Q-values, and the action corresponding to the maximum value from the filtered effective Q-values ​​is selected as the optimal scheduling action. The departure interval and route allocation information corresponding to the optimal scheduling action are analyzed to generate multi-route bus scheduling instructions for the bus system, thereby completing the bus route scheduling optimization. This method, based on the defender-attacker Markov decision game theory framework and utilizing a dual-depth Q-network algorithm, enables robust adaptive bus scheduling optimization in a multi-route environment to cope with random disturbances in runtime.

[0064] See Figure 9 , Figure 9 This is a schematic diagram of a bus route scheduling optimization device 10 provided in an embodiment of the present invention. The bus route scheduling optimization device 10 includes: The relevant data acquisition module 11 is used to acquire real-time operation data and operational constraints of the public transportation system; construct the real-time system state vector of the public transportation system based on the real-time operation data; and generate the action mask matrix of the public transportation system based on the operational constraints. The original action generation module 12 is used to generate the original Q value corresponding to the full action space of the bus system based on the real-time system state vector and the preset scheduling agent; wherein, the preset scheduling agent is obtained by training a dual-deep Q network based on a defender-attacker Markov decision game framework using a two-stage adversarial training method. The scheduling action determination module 13 is used to filter all the original Q values ​​using the action mask matrix, and select the action corresponding to the maximum value from the filtered valid Q values ​​as the optimal scheduling action. The dispatch instruction generation module 14 is used to parse the departure interval and route allocation information corresponding to the optimal dispatch action, and generate multi-route bus dispatch instructions for the bus system to complete the bus route dispatch optimization.

[0065] The bus route scheduling optimization device 10 provided in this embodiment of the invention can realize all the processes of the bus route scheduling optimization method of the above embodiments. The functions and technical effects of each module in the device are the same as the functions and technical effects of the bus route scheduling optimization method of the above embodiments, and will not be repeated here.

[0066] See Figure 10 , Figure 10 This is a schematic diagram of the structure of a bus route scheduling optimization device 20 provided in an embodiment of the present invention. The bus route scheduling optimization device 20 of this embodiment includes: a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the above-described bus route scheduling optimization method embodiment. Alternatively, when the processor 21 executes the computer program, it implements the functions of each module in the above-described bus route scheduling optimization device embodiment.

[0067] For example, the computer program may be divided into one or more modules, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the bus route scheduling optimization device 20.

[0068] The bus route scheduling optimization device 20 can be a desktop computer, laptop, handheld computer, or cloud server, etc. The bus route scheduling optimization device 20 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of the bus route scheduling optimization device 20 and does not constitute a limitation on the device. It may include more or fewer components than shown in the diagram, or combine certain components, or use different components. For example, the bus route scheduling optimization device 20 may also include input / output devices, network access devices, buses, etc.

[0069] The processor 21 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The processor 21 is the control center of the bus route scheduling optimization equipment 20, connecting all parts of the equipment through various interfaces and lines.

[0070] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the bus route scheduling optimization device 20 by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0071] The modules integrated into the bus route scheduling optimization equipment 20, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium may be appropriately added to or subtracted from the content as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium may not include electrical carrier signals and telecommunication signals.

[0072] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0073] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the bus route scheduling optimization method as described in the above embodiments.

[0074] Furthermore, this embodiment of the invention also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the steps of the bus route scheduling optimization method described above.

[0075] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for optimizing bus route scheduling, characterized in that, include: Obtain real-time operation data and operational constraints of the public transportation system; construct a real-time system state vector of the public transportation system based on the real-time operation data; generate an action mask matrix of the public transportation system based on the operational constraints; Based on the real-time system state vector and the preset scheduling agent, the original Q value corresponding to the full action space of the bus system is generated; wherein, the preset scheduling agent is obtained by training a dual-deep Q network in a two-stage adversarial training method based on the defender-attacker Markov decision game framework. The action mask matrix is ​​used to filter all the original Q values, and the action corresponding to the maximum value is selected from the filtered valid Q values ​​as the optimal scheduling action. The departure interval and route allocation information corresponding to the optimal scheduling action are analyzed to generate multi-route bus scheduling instructions for the public transportation system, thereby completing the optimization of bus route scheduling.

2. The bus route scheduling optimization method as described in claim 1, characterized in that, The method for obtaining the preset scheduling agent includes: Based on the dynamic model of a multi-route bus system, the defender's Markov decision process, and the attacker's Markov decision process, a defender-attacker Markov decision game framework is constructed. Construct defender versus attacker versus dual-depth Q-networks and configure priority experience replay buffers, adaptive ε-greedy exploration mechanisms, and state-dependent action masking mechanisms for the two types of dual-depth Q-networks. Based on the defender-attacker Markov decision game framework, a two-stage adversarial training method is used to iteratively train the defender versus dual-depth Q network and the attacker versus dual-depth Q network until both converge. The converged defender versus dual-depth Q network is then used as the preset scheduling agent.

3. The bus route scheduling optimization method as described in claim 1, characterized in that, In the defender-attacker Markov decision game framework, the defender aims to minimize the weighted total cost of passenger waiting costs and operator operating costs, and the corresponding actions include departure intervals and route allocation. In the defender-attacker Markov decision game framework, the attacker aims to maximize the weighted total cost, and the corresponding action is the disturbance rate of the running time of each bus route.

4. The bus route scheduling optimization method as described in claim 2, characterized in that, The step involves iteratively training the defender-attacker dual-depth Q-network and the attacker-attacker dual-depth Q-network using a two-stage adversarial training method, based on the defender-attacker Markov decision game framework, until both networks converge. The converged defender-attacker dual-depth Q-network is then used as a preset scheduling agent. This includes: The defender versus dual-depth Q network is trained using passenger flow and baseline driving data from the public transportation system until the loss function of the defender versus dual-depth Q network converges, thus obtaining the pre-trained defender versus dual-depth Q network. Based on the defender-attacker Markov decision game framework and the pre-trained defender versus dual-depth Q network, the defender versus dual-depth Q network and the attacker versus dual-depth Q network are subjected to alternating adversarial iterative training until both the defender versus dual-depth Q network and the attacker versus dual-depth Q network converge. The converged defender versus dual-depth Q network is then used as the preset scheduling agent.

5. The bus route scheduling optimization method as described in claim 4, characterized in that, Each alternating adversarial training iteration includes: The parameters of the pre-trained defender versus dual-depth Q network are fixed, while the parameters of the attacker versus dual-depth Q network are continuously updated. The attacker-versus-defender dual-depth Q network is fixed and updated. The defender-versus-defender dual-depth Q network is updated based on various random and extreme road condition disturbance samples output by the updated attacker-versus-defender dual-depth Q network, thereby optimizing the defender's vehicle dispatching strategy under disturbance scenarios.

6. The bus route scheduling optimization method as described in claim 2, characterized in that, The defender's Markov decision process and the attacker's Markov decision process include: The state vector of the defender Markov decision process includes the arrival and departure times of each vehicle station, the real-time number of passengers waiting at all stations, the current departure count and the operation termination flag. The actions include the global next departure interval and the allocation of departure routes. The optimization objective is to minimize the weighted sum of passenger waiting costs and operator operating costs. The state vector of the attacker's Markov decision process includes the total number of departures in each attack interval, the cumulative waiting passenger flow in the interval, and the number of passengers stranded at the end station of the interval. The action is the running time disturbance rate of each bus route, and the optimization objective is to maximize the weighted sum of passenger waiting costs and operator operating costs.

7. The bus route scheduling optimization method as described in claim 2, characterized in that, The construction of defender-versus-attacker dual-depth Q-networks and attacker-versus-attacker dual-depth Q-networks, and the configuration of priority experience replay buffers, adaptive ε-greedy exploration mechanisms, and state-dependent action masking mechanisms for the two types of dual-depth Q-networks, includes: Construct a defender versus a attacker versus a dual-depth Q-network; Establish corresponding priority experience replay buffers for the defender versus dual-depth Q network and the attacker versus dual-depth Q network respectively, to store the temporal state, actions, and optimization goals; The defender versus attacker versus dual deep Q network is configured with corresponding adaptive ε-greedy exploration mechanisms, which are used to reduce the exploration probability from the maximum value to the preset minimum value by the cumulative decay factor exponentially during the training period. The decay coefficient is updated after each round of decision-making, and the exploration probability is reset in the alternating adversarial training rounds. For the defender versus attacker versus dual-depth Q network, a corresponding state-dependent action masking mechanism is designed. This mechanism assigns negative infinity to the original Q value of all illegal actions based on the departure interval and route feasibility constraints corresponding to the current system state, while retaining compliant actions to participate in the optimal action selection.

8. The bus route scheduling optimization method as described in claim 2, characterized in that, The framework for a defender-attacker Markov decision game is constructed based on the dynamic model of a multi-route bus system, the defender's Markov decision process, and the attacker's Markov decision process. This framework includes: Establish a unified discrete-time index timing coordination mechanism, define a globally unified time step as the benchmark for synchronous deduction by both the attacker and the defender, set a departure countdown counter and an attack interval counting indicator respectively, and distinguish the timing of the defender's departure decision and the timing of the attacker's disturbance application. A system state transition function is constructed based on the dynamic model of a multi-route bus system. The defender Markov decision process and the attacker Markov decision process are coupled with the system state transition function based on the unified discrete-time index timing coordination mechanism. Based on the defender's Markov decision process and the attacker's Markov decision process, a defender-attacker Markov decision game framework is constructed.

9. A bus route scheduling optimization device, characterized in that, include: The relevant data acquisition module is used to acquire real-time operation data and operational constraints of the public transportation system; construct the real-time system state vector of the public transportation system based on the real-time operation data; and generate the action mask matrix of the public transportation system based on the operational constraints. The original action generation module is used to generate the original Q value corresponding to the full action space of the bus system based on the real-time system state vector and the preset scheduling agent; wherein, the preset scheduling agent is obtained by training a dual-deep Q network based on a defender-attacker Markov decision game framework using a two-stage adversarial training method. The scheduling action determination module is used to filter all the original Q values ​​using the action mask matrix, and select the action corresponding to the maximum value from the filtered valid Q values ​​as the optimal scheduling action. The dispatch instruction generation module is used to parse the departure interval and route allocation information corresponding to the optimal dispatch action, and generate multi-route bus dispatch instructions for the public transportation system to complete the bus route dispatch optimization.

10. A bus route scheduling optimization device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the bus route scheduling optimization method as described in any one of claims 1-8.