Multi-shuttle vehicle scheduling method and system based on track avoidance and intelligent scheduling
By constructing a track topology model and optimizing task allocation using a genetic algorithm, the problem of multi-vehicle collaborative scheduling in a logistics shuttle system is solved, achieving efficient obstacle avoidance and dynamic path scheduling, improving system throughput and efficiency. The fitness function integrates multiple factors and dynamically adjusts vehicle status, solving the problem of insufficient multi-vehicle collaborative scheduling in existing technologies.
Patent Information
- Application Number
- CN202511108509.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-11
AI Technical Summary
Existing logistics shuttle systems suffer from congestion due to inconsistent load speeds, insufficient autonomous obstacle avoidance capabilities, and a lack of multi-vehicle collaborative scheduling, resulting in low system throughput and efficiency.
A path model oriented towards the track topology is constructed, and a genetic algorithm is used to optimize task allocation to achieve multi-vehicle cooperation, efficient obstacle avoidance, and dynamic path scheduling. The Floyd-Warshall algorithm is used to pre-calculate the shortest path, and the path evaluation is optimized by combining the LRU caching mechanism. Vehicle speed and path are dynamically adjusted, a capacity limit mechanism is set to avoid excessive track congestion, and a fast and slow lane separation structure is introduced.
It achieves efficient scheduling of multi-vehicle collaborative operation, improves system throughput and efficiency, avoids waste of track resources, has strong dynamic response capability, and the fitness function fully considers vehicle load and system status, thus improving the feasibility and stability of the scheduling scheme.
Smart Images

Figure CN120931019A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent logistics and automated warehousing technology, specifically to a multi-shuttle scheduling method and system based on track avoidance and intelligent scheduling. Background Technology
[0002] Existing logistics shuttle systems generally employ a single main track closed-loop structure, and shuttle scheduling often faces challenges such as load speed, autonomous obstacle avoidance, and congestion deadlock. When a vehicle performs pickup or unloading operations at a work station, it needs to stop on the main track, occupying track resources and causing subsequent vehicles to queue, resulting in congestion, which is particularly severe in scenarios where multiple vehicles are operating simultaneously and the work area is dense. In addition, there are speed differences among vehicles during operation, and faster vehicles are limited by slower vehicles ahead and cannot overtake, further reducing system throughput and efficiency.
[0003] Although some systems have introduced multi-vehicle scheduling logic, they are mostly limited to single-vehicle path planning and avoidance, lacking multi-vehicle collaborative scheduling, dynamic load-speed mapping, global deadlock coordination mechanism, and insufficient dynamic response capability to shuttle vehicle operating speed. Therefore, this invention proposes a multi-shuttle vehicle scheduling method and system based on track avoidance and intelligent scheduling. Summary of the Invention
[0004] The purpose of this invention is to provide a multi-shuttle scheduling method and system based on track avoidance and intelligent scheduling. By constructing a path model oriented to the track topology and combining it with a genetic algorithm to optimize task allocation, the invention achieves system-level control for multi-shuttle cooperation, efficient avoidance, dynamic path scheduling and task completion.
[0005] According to a first aspect of the present invention, in order to achieve the above-mentioned objective, the present invention provides the following technical solution: a multi-shuttle scheduling method based on track avoidance and intelligent scheduling, comprising the following steps:
[0006] S1. Track Network Construction and Path Calculation: Construct a closed-loop or multi-branch topology consisting of multiple track segments. Each track segment is assigned a unique name, length, maximum capacity, and speed limit attribute. The topology is formed by chain connections. After the track is constructed, the system uses the Floyd-Warshall algorithm to pre-calculate the shortest path between any track segments and caches it as the all_pair_dist distance matrix.
[0007] S2. Task Reading and Station Number Mapping: Accepts the task file, reads the original task data containing the start number, end number and load information according to the task file, converts the number into the actual station name through the station mapping function, and generates a unique task ID to form a task allocation scheme list as scheduling input. Each task is accompanied by a status identifier for subsequent task scheduling tracking.
[0008] S3. Task allocation scheme optimization: The task allocation scheme in step S2 is globally optimized using a genetic algorithm module to obtain the optimized task allocation scheme;
[0009] S4. Shuttle dynamic control and path avoidance: Multiple shuttles execute tasks sequentially according to the optimized task allocation scheme in step S3. During the shuttle's movement, based on the shuttle's current position, loading status, target station, track traffic status, and current speed information, the shuttle performs path planning, loading and unloading action control, and avoidance control.
[0010] S5. Deadlock Detection and Recovery Mechanism: During the operation of multiple shuttles in step S4, the system detects whether the number of completed tasks increases within a certain time window. If there is no progress, the deadlock handling mechanism is triggered, and a layered recovery strategy is adopted to gradually release the congestion.
[0011] Furthermore, in step S1, the track network construction and path calculation are as follows:
[0012] S11. During the simulation initialization phase, the system constructs a track topology using the Track class. The track includes straight sections, curved sections, and track-changing sections. Each track segment has a name, length, speed limit, and capacity limit. Track segments are connected through the next_segments field to form a directed graph structure.
[0013] Each track segment in the track network has a capacity limit to restrict the number of shuttles entering that segment simultaneously, preventing overcrowding that could lead to operational conflicts and deadlocks. This capacity limit is set based on the physical length of the track segment, and its calculation formula is as follows:
[0014] m = max(1, floor(track segment length / 3))
[0015] Track segment length: The physical length of the current track segment (unit: meters).
[0016] floor(): is a function for rounding down.
[0017] max(2, floor(track segment length / 3)): Ensures a minimum capacity of 2 shuttles. This configuration mechanism is executed during track network initialization and dynamically sets the maximum number of shuttles that each track segment can accommodate based on its actual length.
[0018] The system adopts a linear proportional relationship for dynamic configuration. For every 3 meters increase in track length, the maximum capacity increases by 2 cars, thereby achieving a capacity adjustment mechanism that better fits the physical space utilization. The system makes real-time judgments through the can_enter() interface provided by the track segment. When a track segment is full of current capacity, other shuttle cars will be prevented from entering by the control unit and will automatically wait or reselect a route to ensure the orderly use of track resources and the smoothness and safety of multi-car operation.
[0019] S12. In the track segment definition, the system sets up a station. Each station is attached to a certain track segment and its offset position is marked for the identification of the start and end points of the shuttle mission.
[0020] S13. After the track is constructed, the system uses the Floyd-Warshall algorithm to pre-calculate the shortest path between any track segments and caches it as the all_pair_dist distance matrix. The distance matrix is cached through the @lru_cache decorator to improve the efficiency of path evaluation during task scheduling, as follows:
[0021] (S131) The Floyd-Warshall full-source shortest path algorithm is used to construct the track segment distance matrix:
[0022] Input: Set of track segments: S = {s0, s1, ..., s} N-1};
[0023] Initialize distance matrix D (0) ∈R N×N :
[0024]
[0025] Iterative computation
[0026]
[0027] D (k+1) [i][j]=min(D k [i][j],D k [i][k]+D k [k][j])
[0028] Where N is the total number of track segments, the global optimal distance matrix D is finally obtained. final ;
[0029] For the second-highest frequency query optimization layer:
[0030] (S132) Establish a track segment distance caching mechanism based on the least recent use principle, and define the caching function:
[0031] Construct a collection of track segment objects:
[0032] In the track system, multiple track segments are predefined. Each track segment contains its name, length, speed limit, and subsequent segment attributes, and is stored in the track structure.
[0033] Establish the track segment index and distance matrix:
[0034] A numbered index is constructed for all track segments, and the shortest path distance between any two segments is pre-calculated based on the connection relationship of the track segments to form a global distance matrix;
[0035] Define the distance caching function:
[0036] In the orbital system, a function get_segment_distance_cached(from_seg_name, to_seg_name) is defined to query the shortest distance between any two orbital segments;
[0037] Introduce a Least Recently Used (LRU) caching mechanism:
[0038] Use the lru_cache decorator to cache the historical call results of the distance function, limiting the retention to a maximum of 10,000 most recently used track segment distance information;
[0039] Calling cache functions during track scheduling:
[0040] During the scheduling process, whenever it is necessary to evaluate the route of the shuttle to a certain station, get_segment_distance_cached() is called first. If the cache is hit, the distance value is returned directly. If the cache is not hit, a query is triggered and the value is automatically added to the cache.
[0041] Automatic elimination mechanism:
[0042] When the cache reaches its maximum capacity, the system automatically evicts the least used distance data to maintain a balance between cache hit rate and memory efficiency.
[0043] (S133) Finally, based on the real-time path decision layer:
[0044] When the shuttle needs to select the next track segment, the following decision-making process is executed:
[0045] Obtain the set of candidate orbital segments:
[0046] C={s cand |s cand ∈s current .next_segments}
[0047] Calculate the navigation cost from each candidate segment to the target station:
[0048] Cost(s cand ) = Cache(s cand ,s target )+o target
[0049] Where: s target For the track segment where the target station is located, o target This means the target site is in s target Based on the above offset, the scheduling system selects the path with the least cost and assigns it to the shuttle.
[0050] Furthermore, in step S11, the upper limit of capacity is set based on the physical length of the track segment, and its calculation formula is expressed as follows:
[0051] m = max(1, floor(track segment length / 3))
[0052] Track segment length: m is the physical length of the current track segment;
[0053] floor(): is a function to round down;
[0054] max(2, floor(track segment length / 3)): ensures a minimum capacity of 2 cars;
[0055] The maximum number of shuttle cars that can be accommodated is dynamically set according to the actual length of each track segment. The dynamic configuration is carried out using a linear proportional relationship, that is, for every 3 meters increase in the length of the track segment, the upper limit of its capacity increases by 2 cars.
[0056] Furthermore, in step S2, the task reading and site number mapping are as follows:
[0057] The system receives and reads external task files using the `read_tasks_from_excel()` method. Each task line contains a start number (`from`), a destination number (`to`), and a payload weight (`weight`) field, which are matched to the track station names.
[0058] Task reading: read_tasks_from_excel(filename:str) function
[0059] This function is used to read task data row by row from an Excel file. The main fields include:
[0060] • from: Task start number
[0061] • to: Mission objective number
[0062] • weight: Task workload weight
[0063] The task number is mapped to a station character using the map_station_id() function.
[0064] Number mapping: map_station_id(raw_id:int)->str function
[0065] This function maps task numbers to predefined station names in the orbital system, and the mapping rules are as follows:
[0066]
[0067] If the input number exceeds the above range, a ValueError exception will be thrown;
[0068] Each task is automatically assigned a unique task number (task_id) and marked with an initial status of "unassigned". This is used for subsequent allocation, execution, and status updates. The system supports remarking the task as "retry" if it fails midway, thus implementing a task rescheduling mechanism.
[0069] Furthermore, in step S3, the genetic algorithm module is used to globally optimize the task allocation scheme in step S2, as follows:
[0070] S31. The system generates multiple candidate individuals through population initialization, each individual representing a mapping vector from task number to shuttle number:
[0071] Individual = [a1, a2, ..., a N ],a i ∈{0,1,...,M-1}
[0072] Where N is the total number of tasks, M is the number of shuttles, and a i This indicates that task i is assigned to the number a. i The shuttle bus;
[0073] S32. For each task, design a fitness function. The fitness function needs to comprehensively consider the following factors and perform the following cost assessment for each individual:
[0074] For each task, the shuttle needs to travel from its current location to the starting station. This distance is denoted as:
[0075] D start =d(current_seg,current_offset,pickup_seg,pickup_offset)
[0076] The complete distance, calculated using _calc_distance(), is:
[0077]
[0078] Where: L seg : Current track segment length; o curr ,o tgt Current / target segment offset;
[0079] The total length of the middle section is obtained by find_shortest_path();
[0080] The speed v will be dynamically adjusted according to the weight of the task, using the following formula:
[0081]
[0082] Where: v empty This is the maximum speed of an empty vehicle; v loaded : Minimum speed under full load; M max : This refers to the rated maximum load capacity;
[0083] The actual running speed is taken as min(max(m,0),M) max () represents the current speed limit value for the track segment;
[0084] The time cost for the shuttle to travel from its current location to the starting station is:
[0085]
[0086] Add path length penalty:
[0087] P dist =0.1·(D start +D task )
[0088] If the access frequency of a certain segment in the track traversed by the task exceeds 70% of the maximum access frequency of the entire segment, a penalty item will be added to that segment:
[0089]
[0090] in:
[0091] u i : Number of visits to track segment i;
[0092] u max The maximum number of accesses in the system;
[0093] The more tasks a vehicle already has, the more the system scheduling should avoid it taking on new tasks. Penalty function:
[0094] P queue =q·C
[0095] in:
[0096] q: Number of tasks already assigned to the vehicle;
[0097] C: Fixed penalty for each queued task (e.g., 100);
[0098] Ultimately, the fitness of each individual is:
[0099]
[0100] In the formula, T start T represents the path completion time to the origin station. task T represents the path time from the start point to the end point of the task. station P represents the total waiting time for loading and unloading at the station. congestion A penalty factor is applied to a segment of the track traversed by the task whose access frequency exceeds 70% of the maximum access frequency of the entire segment; P dist P is the path length penalty factor; queue The penalty factor for the number of vehicle tasks;
[0101] S33. The selection mechanism adopts an improved tournament selection + elite retention strategy:
[0102] □ Elite Preservation: The top 5% of the most fit individuals in the current population are retained and directly enter the next generation;
[0103] □ Tournament Selection: Randomly select several candidate individuals from the population, and retain the one with the lowest fitness.
[0104] Its scale tournament S is:
[0105] max(3, 0.1·pop_size)
[0106] The selection mechanism preserves excellent solutions while maintaining population diversity and preventing early convergence.
[0107] The crossover operator selects the crossover point c∈[1,N-1] for parent generations A and B.
[0108] C1 = [A1, A2, ..., A c B c +1,...,B N ]
[0109] C2 = [B1, B2, ..., B c A c +1,...,A N ]
[0110] Its crossover probability p c =0.8;
[0111] The mutation operator applies to individual x with probability p.m Randomly change the vehicle number assigned to a certain task;
[0112] The mutation rate is adjusted adaptively:
[0113]
[0114] Local perturbation search, for local perturbations when non-elite individuals perform "task exchange":
[0115] Randomly select two positions i and j in the task vector and swap their assigned values.
[0116] If the fitness decreases after perturbation, the perturbation solution is retained;
[0117] If the optimal fitness does not improve for 20 consecutive generations (T=20), then the iteration is terminated.
[0118]
[0119] In the formula, g represents the current algebra, and T is the tolerance algebra, which is the maximum number of consecutive algebras that can be left uncorrected, which is 20. This represents the optimal fitness in generation t. This represents the optimal fitness of the most recent generation T.
[0120] Furthermore, in step S4, the shuttle's dynamic control and path avoidance are as follows:
[0121] S41. The shuttle's operating status is divided into three types:
[0122] "idle": Idle state, waiting for tasks;
[0123] "picking": Head to the starting point of the mission;
[0124] "delivering": transporting cargo to the mission's destination;
[0125] When the system is idle, if an available task is available, it will retrieve one task from the task queue and assign it to the idle shuttle.
[0126]
[0127] At this point, the vehicle status is set to "picking", and the target is the starting station of the mission;
[0128] S42. Upon arrival at the starting station, the shuttle automatically performs the loading operation and switches to "delivering" mode:
[0129]
[0130] Where d stationThis indicates the Euclidean distance between the vehicle's current location and the target station. When the Euclidean distance value is less than 1 meter, it is considered that the vehicle has "arrived at the station".
[0131] Upon arrival at the final destination, the system automatically unloads the goods and clears the task, switching the status back to "idle".
[0132]
[0133] Ensure that each shuttle can continuously perform multiple tasks and switch states appropriately, forming a closed-loop process for cyclical task execution;
[0134] S43. The shuttle calculates its forward distance based on its current speed v and time step Δt:
[0135] Δx=v·Δt
[0136] If the remaining track length is insufficient to accommodate the forward distance Δx, the vehicle will automatically switch to the next track segment. The system determines which path is suitable for the vehicle based on its current speed.
[0137]
[0138] S44. Safety Avoidance Control Mechanism
[0139] The real-time calculation of the distance to the vehicle ahead on the same track segment is performed using the following formula:
[0140] d front =V front .offset-(V self .offset+L vehicle )
[0141] L vehicle V is the length of the vehicle itself. front V self These are the speeds of the vehicle in front and the vehicle itself, respectively, with offset representing the shortest time.
[0142] Dynamically calculate safe braking distance:
[0143]
[0144] Where a decel For deceleration, δ buffer To maintain a safe buffer distance, a tiered avoidance strategy is adopted:
[0145] When d front <d safe At that time, the shuttle speed will change to min(v) target ,v front )
[0146] When d front <0.6×dsafe Time: Reduce the shuttle speed to min(v) target 0.5×v front )
[0147] When d front ≤0.5m and v current >v front At that time, the shuttle will immediately activate emergency braking.
[0148] Furthermore, in step S5, the deadlock detection and recovery mechanism is as follows:
[0149] S51. Count the number of tasks completed within a fixed time window. A deadlock is determined when the following conditions are met simultaneously:
[0150] For more than the preset duration T thres No task completion event was detected;
[0151] The task completion counters for all shuttles have not increased:
[0152] ΔC done =C current -C last =0
[0153] In the formula C current C represents the number of tasks that have been completed so far. last This represents the number of tasks completed during the last test.
[0154] S52. When congestion occurs, the system iterates through all track segments, counts the number of shuttles in the "moving" state on each track segment, and selects the track segment with the most shuttles as the most congested segment S. congestion :
[0155]
[0156] In S congestion The shuttle with the largest offset is selected as the priority vehicle V. prior Clear S congestion above V prior All vehicle occupancy records outside of V will be displayed. prior Remove from the current orbital segment and advance to the next orbital segment, then calculate the next orbital S. next =V prior .choose_next_segment(peek=True), if S next If access is possible, then set V. prior The orbital segment is S. next The offset is min(0.1, S). next .length), let V priorContinue forward on the mission, targeting S. congestion Apply a random duration pause to the remaining shuttles;
[0157] S53. The system resumes operation and resets the deadlock detection timer:
[0158] t last_progress ←t current
[0159] C last ←C current
[0160] Record the number of times the connection is blocked.
[0161] According to a second aspect of the present invention, the present invention provides a multi-shuttle scheduling system based on track avoidance and intelligent scheduling, for implementing a multi-shuttle scheduling method based on track avoidance and intelligent scheduling described in the first aspect, comprising:
[0162] Multiple shuttle vehicles with autonomous operation capabilities, each shuttle vehicle is equipped with:
[0163] A load detector is used to detect the weight of the cargo currently being carried.
[0164] Accelerometers and braking devices are used to precisely control driving status and respond to dynamic avoidance requirements;
[0165] The vehicle-mounted control unit is used to receive dispatch instructions and execute tasks.
[0166] A track network consists of multiple track segments;
[0167] Each track segment has a capacity limit, and the capacity is proportional to the length of the track segment;
[0168] The track segments are connected by nodes to form a closed loop or multi-branch topology, allowing the shuttle to run continuously.
[0169] Each track section is equipped with an "accessible" detection interface to restrict the conditions under which shuttle vehicles can enter;
[0170] At least one side loading and unloading track is set on one side of the work site, which is laid parallel to the main track and connected to the main track through a connecting section;
[0171] When the shuttle arrives at the target work station, it enters the side track to carry out loading and unloading operations according to the instructions of the dispatching system, thereby avoiding traffic congestion caused by long-term occupation on the main track;
[0172] A set of fast and slow flow separation track structures located at the exit of the work area includes:
[0173] One fast lane and one slow lane form a parallel dual-channel structure;
[0174] The shuttle car will be guided into the fast lane by the control unit if its speed is greater than 2.0 m / s, and into the slow lane if its speed is lower than the threshold.
[0175] The fast and slow lanes merge back into the main track before the next work area to achieve traffic diversion and merging;
[0176] A central scheduling and control unit supports a task allocation strategy based on genetic algorithms and has the following functions:
[0177] Receive material handling tasks to be completed and generate a scheduling plan;
[0178] Intelligent path allocation is performed based on dynamic information such as the shuttle's current location, loading status, target station, track status, and current speed.
[0179] The path selection process calls the preset Floyd-Warshall shortest path algorithm and uses the LRU caching mechanism to optimize high-frequency track segment queries, thereby improving path calculation efficiency.
[0180] Furthermore, the side loading and unloading track is arranged parallel to the main track and located on one side of the work station, for the shuttle car to temporarily enter during loading and unloading operations, so as not to occupy the main track channel resources;
[0181] Before the shuttle approaches the target work station, the dispatch control unit issues an instruction to guide it to switch from the main track to the corresponding side track, and smoothly merge through the set connecting section, so that the vehicle can complete the picking up or unloading operation without interrupting the main line traffic.
[0182] After loading and unloading operations are completed, the shuttle car safely returns to the main track via another connecting section to continue its subsequent operation.
[0183] Furthermore, the fast lane and the slow lane are two parallel physical tracks that form a fork at the exit of work area 1, and are used to guide shuttles in different operating states into different paths.
[0184] Under the command of the dispatch control unit, the shuttle car makes a diversion judgment based on its real-time running speed: if its current speed is greater than the preset threshold, it enters the fast lane and maintains high-speed passage; otherwise, if the vehicle is heavily loaded or the running speed is too low, it is guided into the slow lane to reduce interference with high-speed vehicles.
[0185] The two lanes merge back into the main track at the entrance of Operation Zone 2 via the track merging section, achieving a closed-loop path and continuous scheduling.
[0186] This invention has at least the following beneficial effects:
[0187] 1. This invention constructs a path model oriented to track topology and combines it with a genetic algorithm to optimize task allocation, thereby achieving system-level control for multi-vehicle collaboration, efficient obstacle avoidance, dynamic path scheduling, and task completion. It can be widely applied to multi-shuttle collaborative operation scenarios such as high-density warehousing, unmanned delivery, and automatic sorting, and has the advantages of simple structure, intelligent obstacle avoidance, efficient scheduling, and strong scalability.
[0188] 2. The present invention adopts a dynamic capacity mechanism in the construction of track segments. Each track segment is set with a maximum number of shuttle cars that can be accommodated according to its length, thereby avoiding local bottlenecks caused by fixed capacity. The graph structure is constructed by connecting multiple paths, which supports multi-path selection and avoidance simulation.
[0189] 3. The task scheduling of this invention is not only based on static distance calculation, but also introduces a function that affects the speed of the vehicle’s current load weight, so as to achieve a time-efficiency estimation that is closer to the physical system; the fitness function fully integrates factors such as running time, path distance, vehicle load and system congestion, so as to improve the feasibility and stability of the scheduling scheme in simulation.
[0190] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0191] Figure 1 This is a flowchart of the scheduling method described in this invention;
[0192] Figure 2 This is a schematic diagram of the track improvement plan for the circular shuttle train at some stations in Operation Zone 1;
[0193] Figure 3 This is an example track design for a circular shuttle train when speed diversion is performed.
[0194] Figure 4 This is a trend chart of the average fitness change using the genetic algorithm in this invention;
[0195] Figure 5 This is a trend chart of the optimal fitness changes using the genetic algorithm in this invention;
[0196] Figure 6 This is a graph showing the rate of change of fitness in each generation using the genetic algorithm in this invention. Detailed Implementation
[0197] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0198] Please see Figures 1-6 This invention provides a technical solution: a multi-shuttle scheduling method based on track avoidance and intelligent scheduling, comprising the following steps:
[0199] S1. Track Modeling and Path Calculation: In the simulation initialization phase, the system constructs the track topology through the Track class. The track consists of several TrackSegments, each with a name, length, speed limit (optional), and maximum number of vehicles. Track segments are connected through the next_segments field to form a directed graph structure.
[0200] In the track segment definition, the system sets up a station. Each station is attached to a certain track segment and its offset position is marked, which is used to identify the start and end points of the shuttle mission.
[0201] The system supports multiple track segments forming a closed loop (e.g., straight line 1 → straight line 2 → curve 1 / curve 1.1 → ... → straight line 14 → straight line 1) to achieve multi-path cyclical passage;
[0202] After the track is constructed, the system uses the Floyd-Warshall algorithm to pre-calculate the shortest path between any track segments and caches it as the all_pair_dist distance matrix. This matrix is cached through the @lru_cache decorator to improve the efficiency of path evaluation during task scheduling, as detailed below:
[0203] The track segment distance matrix is constructed using the Floyd-Warshall full-source shortest path algorithm:
[0204] Input: Set of track segments: S = {s0, s1, ..., s} N-1};
[0205] Initialize distance matrix D (0) ∈R N×N :
[0206]
[0207] Iterative computation
[0208]
[0209] D (k+1) [i][j]=min(D k [i][j],D k [i][k]+D k [k][j])
[0210] Where N is the total number of track segments, the global optimal distance matrix D is finally obtained. final ;
[0211] For the second-highest frequency query optimization layer:
[0212] A track segment distance caching mechanism is established based on the Least Recently Used (LRU) principle, and a caching function is defined as follows:
[0213] The system constructs a collection of track segment objects during the track initialization phase:
[0214] The system predefines several track segments. Each track segment object contains the following attribute information: segment name, segment length, speed limit value, and connected successor track segments. All track segments are stored in a track structure for path calculation and status query.
[0215] Subsequently, based on the connection relationship between each track segment, the system establishes a track segment number index and uses algorithms such as Floyd-Warshall to pre-calculate the shortest path distance between any two track segments, constructing a global track segment distance matrix. This matrix provides basic data support for the shuttle's path selection, obstacle avoidance judgment, and scheduling strategy.
[0216] Based on the above, the system defines a track segment distance query function get_segment_distance_cached(from_seg_name, to_seg_name), which is to query and return the shortest path distance between two input track segment names. The function first obtains the corresponding track segment object through name index mapping, and then calls the pre-calculated distance matrix to obtain the distance value.
[0217] To improve call efficiency, the system uses the functools.lru_cache decorator in Python to cache the get_segment_distance_cached function, limiting the maximum cache capacity to 10,000 track segment pairs. This LRU caching mechanism has automatic invalidation and replacement capabilities. When the cache capacity reaches the limit, the least accessed record will be automatically evicted, thereby controlling memory consumption while ensuring a high hit rate.
[0218] During multi-shuttle track scheduling, whenever the scheduler or vehicle route selection module needs to evaluate the route to a certain station, the system first calls `get_segment_distance_cached` to query the distance between track segments. If the cache is hit, the distance value is returned directly to avoid duplicate calculations; if the cache is not hit, a query is automatically triggered and the result is added to the cache.
[0219] This LRU distance caching mechanism can significantly reduce the computational overhead of repeated queries in path planning, thereby improving the response speed and simulation performance of the entire scheduling system.
[0220] Finally, based on the real-time path decision layer:
[0221] When the shuttle needs to select the next track segment, the following decision-making process is executed:
[0222] Obtain the set of candidate orbital segments:
[0223] C={s cand |s cand ∈s current .next_segments}
[0224] Calculate the navigation cost from each candidate segment to the target station:
[0225] Cost(s cand ) = Cache(s cand ,s target )+o target
[0226] Where: s target For the track segment where the target station is located, o target This means the target site is in s target Based on the above offset, the scheduling system selects the minimum cost path and assigns it to the shuttle.
[0227] S2. Task Reading and Mapping: The system reads external task files (Excel format) using the `read_tasks_from_excel()` method. Each task row contains a start number (`from`), a destination number (`to`), and a payload weight (`weight`) field. To match the track station names, the task number is mapped to a station string (e.g., "1.1", "4.2") using the `map_station_id()` function.
[0228] Each task is automatically assigned a unique task number (task_id) and marked with an initial status of "unassigned", which is used for subsequent allocation, execution, and status updates.
[0229] The system supports remarking a failed task as "retry" to implement a task rescheduling mechanism.
[0230] S3. Task allocation scheme optimization: The genetic algorithm GAScheduler is used to optimize the scheduling of multi-vehicle tasks;
[0231] S31. The system generates multiple candidate individuals through population initialization, each individual representing a mapping vector from task number to shuttle number:
[0232] Individual = [a1, a2, ..., a N ],a i ∈{0,1,...,M-1}
[0233] Where N is the total number of tasks, M is the number of shuttles, and a i This indicates that task i is assigned to the number a. i The shuttle bus;
[0234] S32. For each task, design a fitness function. The fitness function needs to comprehensively consider the following factors and perform the following cost assessment for each individual:
[0235] For each task, the shuttle needs to travel from its current location to the starting station. This distance is denoted as:
[0236] D start =d(current_seg,current_offset,pickup_seg,pickup_offset)
[0237] The complete distance, calculated using _calc_distance(), is:
[0238]
[0239] Where: L seg : Current track segment length; o curr ,o tgt Current / target segment offset;
[0240] The total length of the middle section is obtained by find_shortest_path();
[0241] The speed v will be dynamically adjusted according to the weight of the task, using the following formula:
[0242]
[0243] Where: v empty This is the maximum speed of an empty vehicle; v loaded : Minimum speed under full load; M max : This refers to the rated maximum load capacity;
[0244] The actual running speed is taken as min(max(m,0),M) max () represents the current speed limit value for the track segment;
[0245] The time cost for the shuttle to travel from its current location to the starting station is:
[0246]
[0247] Add path length penalty:
[0248] P dist =0.1·(D start +D task )
[0249] If the access frequency of a certain segment in the track traversed by the task exceeds 70% of the maximum access frequency of the entire segment, a penalty item will be added to that segment:
[0250]
[0251] in:
[0252] u i : Number of visits to track segment i;
[0253] u max The maximum number of accesses in the system;
[0254] The more tasks a vehicle already has, the more the system scheduling should avoid it taking on new tasks. Penalty function:
[0255] P queue =q·C
[0256] in:
[0257] q: Number of tasks already assigned to the vehicle;
[0258] C: Fixed penalty for each queued task (e.g., 100);
[0259] Ultimately, the fitness of each individual is:
[0260]
[0261] In the formula, T start T represents the path completion time to the origin station. task T represents the path time from the start point to the end point of the task. station P represents the total waiting time for loading and unloading at the station. congestion A penalty factor is applied to a segment of the track traversed by the task whose access frequency exceeds 70% of the maximum access frequency of the entire segment; P dist P is the path length penalty factor; queue The penalty factor for the number of vehicle tasks;
[0262] S33. The selection mechanism adopts an improved tournament selection + elite retention strategy:
[0263] □ Elite Preservation: The top 5% of the most fit individuals in the current population are retained and directly enter the next generation;
[0264] □ Tournament Selection: Randomly select several candidate individuals from the population, and retain the one with the lowest fitness.
[0265] Its scale tournament S is:
[0266] max(3, 0.1·pop_size)
[0267] The selection mechanism preserves excellent solutions while maintaining population diversity and preventing early convergence.
[0268] The crossover operator selects the crossover point c∈[1,N-1] for parent generations A and B.
[0269] C1 = [A1, A2, ..., A c B c +1,...,B N ]
[0270] C2 = [B1, B2, ..., B c A c +1,...,A N ]
[0271] Its crossover probability p c =0.8;
[0272] The mutation operator applies to individual x with probability p. m Randomly change the vehicle number assigned to a certain task;
[0273] The mutation rate is adjusted adaptively:
[0274]
[0275] Local perturbation search, for local perturbations when non-elite individuals perform "task exchange":
[0276] Randomly select two positions i and j in the task vector and swap their assigned values.
[0277] If the fitness decreases after perturbation, the perturbation solution is retained;
[0278] If the optimal fitness does not improve for 20 consecutive generations (T=20), then the iteration is terminated.
[0279]
[0280] In the formula, g represents the current algebra, and T is the tolerance algebra, which is the maximum number of consecutive algebras that can be left uncorrected, which is 20. This represents the optimal fitness in generation t. The optimal fitness of the most recent generation T;
[0281] S4. Shuttle vehicle status control and path avoidance
[0282] Each shuttle is controlled by a Shuttle class object. When initialized, the vehicle is set at the starting station "1.1" on the track and is in an empty, idle state by default, waiting for the system to schedule and assign tasks.
[0283] During the simulation, each shuttle follows a complete finite state machine logic to perform tasks such as task reception, path planning, loading and unloading, and obstacle avoidance control. Its state changes are as follows:
[0284] The shuttle operates in three different states:
[0285] "idle": Idle state, waiting for tasks;
[0286] "picking": Head to the starting point of the mission;
[0287] "delivering": transporting cargo to the mission's destination;
[0288] When the vehicle is in an idle state, if an available task is available, the system will retrieve one from the task queue and assign it to the vehicle.
[0289]
[0290] At this point, the vehicle status is set to "picking", and the target is the starting station of the mission;
[0291] Upon arrival at the starting station, the shuttle automatically performs the loading operation and switches to "delivering" mode.
[0292]
[0293] Where d station This indicates the Euclidean distance between the vehicle's current location and the target station. When this value is less than 1 meter, it is considered that the vehicle has "arrived at the station".
[0294] Upon arrival at the final destination, the system automatically unloads the goods and clears the task, switching the status back to "idle".
[0295]
[0296] This ensures that each shuttle can continuously perform multiple tasks and switch states appropriately, forming a closed-loop process of task cyclical execution;
[0297] In each frame of the simulation update, the shuttle calculates its forward distance based on its current speed v and time step Δt:
[0298] Δx=v·Δt
[0299] If the remaining track length is insufficient to accommodate the required travel distance, the vehicle will automatically switch to the next track segment. Specifically, on track segment "Straight Line 2," the system determines which path is suitable for the vehicle based on its current speed.
[0300]
[0301] This path switching mechanism simulates the "branching" behavior in real traffic: high-speed vehicles take priority to enter the main line, while low-speed vehicles enter the secondary channel, thereby achieving a more realistic dynamic diversion effect in the system simulation.
[0302] As the shuttle moves forward, the system executes a "look-ahead detection" mechanism every frame to predict whether there are other vehicles in the next five track segments.
[0303] If there is a vehicle ahead, the system will predict the relative distance between them.
[0304]
[0305] in:
[0306] offset front : This refers to the offset of the preceding vehicle on the track segment;
[0307] offset self : This indicates the current vehicle position;
[0308] l represents the vehicle length;
[0309] L rem : Remaining length of the current track;
[0310] D(.): Represents the path length between the two track segments (pre-calculated using the Floyd-Warshall algorithm);
[0311] Then, the system estimates the braking distance using the current speed v and deceleration a:
[0312]
[0313] And set a safe distance based on this:
[0314] s safe =s brake +1.0
[0315] The safe distance represents the minimum physical interval required to come to a complete stop from the current state, plus a 1-meter redundant buffer zone to prevent rear-end collisions due to speed errors;
[0316] If the predicted distance is insufficient, the system will immediately adopt a deceleration or forced stop strategy:
[0317]
[0318] This mechanism ensures that when the preceding vehicle slows down or the track is obstructed, the following vehicle can respond quickly and dynamically adjust its speed to avoid collisions.
[0319] Each track section is configured with a capacity C to control the number of vehicles that can be accommodated simultaneously.
[0320]
[0321] If a track segment is full, the vehicle will wait in place, and the congestion status will be recorded. This status is accumulated using the `blocked_count` attribute, and the congestion start time is recorded as `block_start_time`, which facilitates deadlock identification and subsequent coordination by the system.
[0322] This control section ensures that when multiple trains are running in close proximity, the system can perform distributed regulation of access to track resources, reducing the risk of resource contention and cyclical congestion.
[0323] S5. Deadlock Detection and Recovery Mechanism: During shuttle operation, if multiple vehicles wait for each other due to path conflicts or track segment occupancy, the system may enter a deadlock state. The system uses the DeadlockCoordinator to detect whether the number of completed tasks increases within a certain time window. If there is no progress, the deadlock handling mechanism is triggered. The deadlock handling strategy is as follows:
[0324] The system counts the number of tasks completed within a fixed time window (default 300 seconds). A deadlock is identified when the following conditions are met simultaneously:
[0325] For more than the preset duration T thres (Default 300 seconds) No task completion event detected.
[0326] All shuttle mission completion counters have not increased: ΔC done =C current -C last =0
[0327] Where C current C represents the number of tasks that have been completed so far. last This represents the number of tasks completed during the last check (the program terminates when the task counter equals the number of tasks).
[0328] When deadlock detection is triggered, the system executes the following tiered recovery strategy to gradually release the congestion:
[0329] The system identifies the most congested track segment. It iterates through all track segments occupied by shuttle vehicles and counts the number of vehicles currently operating within each segment. Let:
[0330] □c i: The number of vehicles on the i-th track segment;
[0331] □s*: The segment with the highest congestion, i.e.:
[0332]
[0333] In track segment s*, the vehicle with the largest offset is selected and defined as the "priority vehicle," i.e.:
[0334] □
[0335] This indicates that the vehicle at the front will be forcibly moved forward to clear the obstruction in that section first.
[0336] The system forces the vehicle to immediately advance to the next track segment of its target and performs speed recovery:
[0337] Remove all vehicles except this one from the currently occupied_by list;
[0338] □ If the next segment is accessible, switch segments directly and set the offset to:
[0339] V prior Remove from the current orbital segment and advance to the next orbital segment, then calculate the next orbit:
[0340] S next =V prior .choose_next_segment(peek=True)
[0341] If S next If access is possible, then set V. prior The orbital segment is S. next The offset is min(0.1, S). next .length), let V prior Continue forward on the mission, targeting S. congestion Apply a random duration pause (0.5-2.0 seconds) to the remaining shuttles;
[0342] The system then resumes operation and resets the deadlock detection timer:
[0343] t last_progress ←t current
[0344] C last ←C current
[0345] This mechanism ensures that system liquidity can be restored when multiple vehicles are operating intensively, preventing shuttles from getting stuck in an indefinite waiting state.
[0346] S6. Program Execution and Result Analysis: The main loop executes vehicle motion updates at fixed time steps (e.g., 0.1 seconds). At each step, the step() method is called to determine the current state, update speed, path progress, and whether the target station has been reached.
[0347] After the simulation is complete, the system will save the following data to an Excel file, including
[0348] The cumulative distance traveled by each vehicle;
[0349] Number of blockages;
[0350] Completed task ID sequence;
[0351] Fitness and convergence data for each generation of the genetic algorithm;
[0352] The above data can be used for later system optimization, model evaluation, and sensitivity analysis of scheduling parameters. The table below summarizes the simulation results for different numbers of shuttle cars:
[0353]
[0354]
[0355] Highly efficient congestion control capabilities
[0356] Data Comparison:
[0357] With 4 shuttle buses: Total number of traffic jams: 17 (6+3+5+3)
[0358] With 8 shuttle buses: Total number of traffic jams: 82 (8+12+8+12+9+13+10+10)
[0359] Although the number of vehicles doubled (from 4 to 8), the average number of traffic jams per vehicle only increased from 4.25 to 10.25 (far below linear growth). This indicates that the algorithm can effectively alleviate the congestion problem caused by the increase in the number of vehicles.
[0360] Load balancing optimization
[0361] Data Comparison:
[0362] The four shuttles completed the following tasks: 132, 125, 125, and 118 (standard deviation 6.3).
[0363] The 8 shuttles completed the following tasks: 56, 66, 66, 66, 54, 69, 66, 57 (standard deviation 5.8).
[0364] With more vehicles, task allocation becomes more balanced (standard deviation decreases), avoiding overloading of individual vehicles and improving the overall efficiency of the system.
[0365] Running distance optimization
[0366] Key data:
[0367] Total distance traveled by the 4 shuttles: 78,985 meters
[0368] Total distance traveled by the 8 shuttles: 90,588 meters
[0369] The total running distance only increased by 15% after the number of vehicles doubled, which is far lower than the linear growth (theoretically it should be +100%), proving that the algorithm can effectively optimize global path planning.
[0370] Large-scale task processing capabilities
[0371] Data verification:
[0372] All configurations completed 500 tasks.
[0373] Among the 8 shuttle buses, the maximum number of tasks per bus is 69 (ID6), and the minimum number of tasks per bus is 54 (ID5).
[0374] Even in high-density vehicle (8 vehicles) scenarios, the system can still guarantee that all tasks are completed and no vehicles are idle (minimum task completion rate of 10.8%).
[0375] Dynamic Adaptability
[0376] Data Representation:
[0377] The lowest congestion occurred when there were 7 shuttle buses (ID4 only experienced one congestion).
[0378] The distance per vehicle fluctuates little depending on the number of vehicles (11,980-14,267 meters with 7 vehicles).
[0379] The algorithm can automatically adjust parameters based on real-time convergence, maintaining stable optimization performance even when the number of vehicles changes.
[0380] according to Figures 4 to 6 As shown, under the "fine-tuned optimization" parameter combination (population 150, generation 200, crossover rate 0.95, mutation rate 0.05):
[0381] The optimal fitness level converged stably from an initial value of approximately 70,000 to 66,460 (a decrease of 4.8%).
[0382] Average fitness decreased from 78,000 to 66,500 (a decrease of 14.7%).
[0383] By dynamically adjusting the mutation rate, the improvement remains >500 per generation after 50 iterations, and stable convergence occurs after 150 iterations.
[0384] By optimizing task allocation using genetic algorithms, implementing dynamic traffic control, and employing a deadlock coordination mechanism, the following was achieved:
[0385] When vehicle density increases by 200%, the number of congestion events only increases by 382% (better than linear growth).
[0386] Task allocation balance improved by 8% (standard deviation 4.25 → 3.89).
[0387] The increase in total operating distance should be controlled within 15%.
[0388] Supporting 8-vehicle collaboration while maintaining a 100% task completion rate
[0389] These effects have significant application value in scenarios such as logistics warehousing and automated factories, and can significantly improve system throughput through algorithm optimization without increasing infrastructure.
[0390] In summary, this invention constructs a path model oriented towards track topology and combines it with a genetic algorithm to optimize task allocation, thereby achieving system-level control for multi-vehicle collaboration, efficient obstacle avoidance, dynamic path scheduling, and task completion.
[0391] Example 2:
[0392] This embodiment provides a multi-shuttle scheduling system based on track avoidance and intelligent scheduling, used to implement the multi-shuttle scheduling method based on track avoidance and intelligent scheduling described in Embodiment 1, including:
[0393] Multiple shuttle vehicles with autonomous operation capabilities, each shuttle vehicle is equipped with:
[0394] A load detector is used to detect the weight of the cargo currently being carried.
[0395] Accelerometers and braking devices are used to precisely control driving status and respond to dynamic avoidance requirements;
[0396] The vehicle-mounted control unit is used to receive dispatch instructions and execute tasks.
[0397] A track network consists of multiple track segments;
[0398] Each track segment has a capacity limit, and the capacity is proportional to the length of the track segment;
[0399] The track segments are connected by nodes to form a closed loop or multi-branch topology, allowing the shuttle to run continuously.
[0400] Each track section is equipped with an "accessible" detection interface to restrict the conditions under which shuttle vehicles can enter;
[0401] At least one side loading and unloading track is set on one side of the work site, which is laid parallel to the main track and connected to the main track through a connecting section;
[0402] When the shuttle arrives at the target work station, it enters the side track to carry out loading and unloading operations according to the instructions of the dispatching system, thereby avoiding traffic congestion caused by long-term occupation on the main track;
[0403] A set of fast and slow flow separation track structures located at the exit of the work area includes:
[0404] One fast lane and one slow lane form a parallel dual-channel structure;
[0405] The shuttle car will be guided into the fast lane by the control unit if its speed is greater than 2.0 m / s, and into the slow lane if its speed is lower than the threshold.
[0406] The fast and slow lanes merge back into the main track before the next work area to achieve traffic diversion and merging;
[0407] A central scheduling and control unit supports a task allocation strategy based on genetic algorithms and has the following functions:
[0408] Receive material handling tasks to be completed and generate a scheduling plan;
[0409] Intelligent path allocation is performed based on dynamic information such as the shuttle's current location, loading status, target station, track status, and current speed.
[0410] The path selection process calls the preset Floyd-Warshall shortest path algorithm and uses the LRU caching mechanism to optimize high-frequency track segment queries, thereby improving path calculation efficiency.
[0411] The lateral loading / unloading track is laid out parallel to the main track and located on one side of the work station. It allows shuttle cars to temporarily enter during loading and unloading operations, thus not occupying main track space. Before approaching the target work station, the dispatch control unit issues a command to guide the shuttle car from the main track to the corresponding lateral track, smoothly merging through a designated connecting section. This allows the vehicle to complete picking or unloading operations without interrupting mainline traffic. After loading and unloading, the shuttle car safely returns to the main track via another connecting section to continue its subsequent tasks. This structure significantly improves the throughput of the work area, avoids track congestion caused by vehicle loading and unloading, and is particularly suitable for multi-vehicle concurrent dispatching in high-frequency operation scenarios.
[0412] The fast lane and slow lane are two parallel physical tracks that branch off at the exit of Operation Zone 1, guiding shuttles in different operating states onto different paths. Under the command of the dispatch control unit, the current shuttle is diverted based on its real-time speed: if its current speed is greater than a preset threshold (e.g., 2.0 m / s), it enters the fast lane to maintain high-speed passage; conversely, if the vehicle is heavily loaded or its speed is too low, it is guided into the slow lane to reduce interference with high-speed vehicles. The two lanes merge back into the main track before the entrance to Operation Zone 2 via a track merging section, achieving path closure and scheduling continuity. This structure, combining physical-layer diversion with algorithm-layer decision-making, effectively alleviates rear-end collisions, waiting, and congestion caused by mixed fast and slow traffic, significantly improving the overall system scheduling efficiency and track resource utilization.
[0413] In summary, this system avoids shuttle vehicles blocking the main track during loading and unloading operations by adding side loading and unloading tracks in the work area. At the same time, a fast and slow lane separation mechanism is set up at the exit. Through speed perception and path allocation algorithms, vehicles with different speeds can travel in separate lanes, thereby avoiding congestion and efficiency reduction caused by speed differences. In conjunction with the intelligent scheduling system for task allocation, path planning, speed adjustment and avoidance control, the system significantly improves the efficiency of multi-vehicle collaboration and reduces system deadlock and waiting time.
[0414] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0415] For those skilled in the art, the specific meaning of the above terms in this invention can be understood according to the specific circumstances. When an element is referred to as being "assembled on," "mounted on," "fixed to," or "set on" another element, it may be directly on the other element or there may be an intermediate element present. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be an intermediate element present. The terms "vertical," "horizontal," "upper," "lower," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible embodiments.
[0416] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
[0417] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
Claims
1. A multi-shuttle scheduling method based on track avoidance and intelligent scheduling, characterized in that, Includes the following steps: S1. Track Network Construction and Path Calculation: Construct a closed-loop or multi-branch topology consisting of multiple track segments. Each track segment is assigned a unique name, length, maximum capacity, and speed limit attribute. The topology is formed by chain connections. After the track is constructed, the system uses the Floyd-Warshall algorithm to pre-calculate the shortest path between any track segments and caches it as the all_pair_dist distance matrix. S2. Task Reading and Station Number Mapping: Accepts the task file, reads the original task data containing the start number, end number and load information according to the task file, converts the number into the actual station name through the station mapping function, and generates a unique task ID to form a task allocation scheme list as scheduling input. Each task is accompanied by a status identifier for subsequent task scheduling tracking. S3. Task allocation scheme optimization: The task allocation scheme in step S2 is globally optimized using a genetic algorithm module to obtain the optimized task allocation scheme; S4. Shuttle dynamic control and path avoidance: Multiple shuttles execute tasks sequentially according to the optimized task allocation scheme in step S3. During the shuttle's movement, based on the shuttle's current position, loading status, target station, track traffic status, and current speed information, the shuttle performs path planning, loading and unloading action control, and avoidance control. S5. Deadlock Detection and Recovery Mechanism: During the operation of multiple shuttles in step S4, the system detects whether the number of completed tasks increases within a certain time window. If there is no progress, the deadlock handling mechanism is triggered, and a layered recovery strategy is adopted to gradually release the congestion.
2. The multi-shuttle scheduling method based on track avoidance and intelligent scheduling according to claim 1, characterized in that: In step S1, the track network construction and path calculation are as follows: S11. During the simulation initialization phase, the system constructs a track topology using the Track class. The track includes straight sections, curved sections, and track-changing sections. Each track segment has a name, length, speed limit, and capacity limit. Track segments are connected through the next_segments field to form a directed graph structure. S12. In the track segment definition, the system sets up a station. Each station is attached to a certain track segment and its offset position is marked for the identification of the start and end points of the shuttle mission. S13. After the track is constructed, the system uses the Floyd-Warshall algorithm to pre-calculate the shortest path between any track segments and caches it as the all_pair_dist distance matrix. The distance matrix is cached through the @lru_cache decorator to improve the efficiency of path evaluation during task scheduling, as follows: (S131) The Floyd-Warshall full-source shortest path algorithm is used to construct the track segment distance matrix: Input: Set of track segments: S = {s0, s1, ..., s} N-1 }; Initialize distance matrix D (0) ∈R N×N : Iterative computation D (k+1) [i][j]=min(D k [i][j],D k [i][k]+D k [k][j]) Where N is the total number of track segments, the global optimal distance matrix D is finally obtained. final ; For the second-highest frequency query optimization layer: (S132) Establish a track segment distance caching mechanism based on the least recent use principle, and define the caching function: Construct a collection of track segment objects: In the track system, multiple track segments are predefined. Each track segment contains its name, length, speed limit, and subsequent segment attributes, and is stored in the track structure. Establish the track segment index and distance matrix: A numbered index is constructed for all track segments, and the shortest path distance between any two segments is pre-calculated based on the connection relationship of the track segments to form a global distance matrix; Define the distance caching function: In the orbital system, a function get_segment_distance_cached(from_seg_name, to_seg_name) is defined to query the shortest distance between any two orbital segments; Introduce a Least Recently Used (LRU) caching mechanism: Use the lru_cache decorator to cache the historical call results of the distance function, limiting the retention to a maximum of 10,000 most recently used track segment distance information; Calling cache functions during track scheduling: During the scheduling process, whenever it is necessary to evaluate the route of the shuttle to a certain station, get_segment_distance_cached() is called first. If the cache is hit, the distance value is returned directly. If the cache is not hit, a query is triggered and the value is automatically added to the cache. Automatic elimination mechanism: When the cache reaches its maximum capacity, the system automatically evicts the least used distance data to maintain a balance between cache hit rate and memory efficiency. (S133) Finally, based on the real-time path decision layer: When the shuttle needs to select the next track segment, the following decision-making process is executed: Obtain the set of candidate orbital segments: C={s cand ∣s cand ∈s current .next_segments} Calculate the navigation cost from each candidate segment to the target station: Cost(s cand )=Cache(s cand ,s target )+o target Where: s target For the track segment where the target station is located, o target This means the target site is in s target Based on the above offset, the scheduling system selects the path with the least cost and assigns it to the shuttle.
3. The multi-shuttle scheduling method based on track avoidance and intelligent scheduling according to claim 2, characterized in that: In step S11, the upper limit of capacity is set based on the physical length of the track segment, and its calculation formula is expressed as follows: m = max(1, floor(track segment length / 3)) Track segment length: m is the physical length of the current track segment; floor(): is a function to round down; max(2, floor(track segment length / 3)): ensures a minimum capacity of 2 cars; The maximum number of shuttle cars that can be accommodated is dynamically set according to the actual length of each track segment. The dynamic configuration is carried out using a linear proportional relationship, that is, for every 3 meters increase in the length of the track segment, the upper limit of its capacity increases by 2 cars.
4. The multi-shuttle scheduling method based on track avoidance and intelligent scheduling according to claim 3, characterized in that: In step S2, the task reading and site number mapping are as follows: The system receives and reads external task files using the `read_tasks_from_excel()` method. Each task line contains a start number (`from`), a destination number (`to`), and a payload weight (`weight`) field, which are matched to the track station names. Task reading: read_tasks_from_excel(filename:str) function This function is used to read task data row by row from an Excel file. The main fields include: • from: Task start number • to: Mission objective number • weight: Task workload weight The task number is mapped to a station character using the map_station_id() function. Number mapping: map_station_id(raw_id:int)->str function This function maps task numbers to predefined station names in the orbital system, and the mapping rules are as follows: If the input number exceeds the above range, a ValueError exception will be thrown; Each task is automatically assigned a unique task number (task_id) and marked with an initial status of "unassigned". This is used for subsequent allocation, execution, and status updates. The system supports remarking the task as "retry" if it fails midway, thus implementing a task rescheduling mechanism.
5. The multi-shuttle scheduling method based on track avoidance and intelligent scheduling according to claim 4, characterized in that: In step S3, the genetic algorithm module is used to globally optimize the task allocation scheme in step S2, as follows: S31. The system generates multiple candidate individuals through population initialization, each individual representing a mapping vector from task number to shuttle number: Individual=[a1,a2,...,a N ],a i ∈{0,1,...,M-1} Where N is the total number of tasks, M is the number of shuttles, and a i This indicates that task i is assigned to the number a. i The shuttle bus; S32. For each task, design a fitness function. The fitness function needs to comprehensively consider the following factors and perform the following cost assessment for each individual: For each task, the shuttle needs to travel from its current location to the starting station. This distance is denoted as: D start =d(current_seg,current_offset,pickup_seg,pickup_offset) The complete distance, calculated using _calc_distance(), is: Where: L seg : Current track segment length; o curr ,o tgt Current / target segment offset; The total length of the middle section is obtained by find_shortest_path(); The speed v will be dynamically adjusted according to the weight of the task, using the following formula: Where: v empty This is the maximum speed of an empty vehicle; v loaded : Minimum speed under full load; M max : This refers to the rated maximum load capacity; The actual running speed is taken as min(max(m,0),M) max () represents the current speed limit value for the track segment; The time cost for the shuttle to travel from its current location to the starting station is: Add path length penalty: P dist =0.1·(D start +D task ) If the access frequency of a certain segment in the track traversed by the task exceeds 70% of the maximum access frequency of the entire segment, a penalty item will be added to that segment: in: u i : Number of visits to track segment i; u max The maximum number of accesses in the system; The more tasks a vehicle already has, the more the system scheduling should avoid it taking on new tasks. Penalty function: P queue =q·C in: q: Number of tasks already assigned to the vehicle; C: Fixed penalty for each queued task (e.g., 100); Ultimately, the fitness of each individual is: In the formula, T start T represents the path completion time to the origin station. task T represents the path time from the start point to the end point of the task. station P represents the total waiting time for loading and unloading at the station. congestion A penalty factor is applied to a segment of the track traversed by the task whose access frequency exceeds 70% of the maximum access frequency of the entire segment; P dist P is the path length penalty factor; queue The penalty factor for the number of vehicle tasks; S33. The selection mechanism adopts an improved tournament selection + elite retention strategy: Elite retention: The top 5% of the most fit individuals in the current population are retained and directly enter the next generation; Tournament selection: Randomly select several candidate individuals from the population, and retain the one with the lowest fitness. Its scale tournament S is: max(3, 0.1·pop_size) The selection mechanism preserves excellent solutions while maintaining population diversity and preventing early convergence. The crossover operator selects the crossover point c∈[1,N-1] for parent generations A and B. C1=[A1,A2,...,A c ,B c +1,...,B N ] C2=[B1,B2,...,B c ,A c +1,...,A N ] Its crossover probability p c =0.8; The mutation operator applies to individual x with probability p. m Randomly change the vehicle number assigned to a certain task; The mutation rate is adjusted adaptively: Local perturbation search, for local perturbations when non-elite individuals perform "task exchange": Randomly select two positions i and j in the task vector and swap their assigned values. If the fitness decreases after perturbation, the perturbation solution is retained; If the optimal fitness does not improve for 20 consecutive generations (T=20), then the iteration is terminated. In the formula, g represents the current algebra, T is the tolerance algebra, which is the maximum number of consecutive algebras that can be left unimproved, which is 20, and f t best This represents the optimal fitness in generation t. This represents the optimal fitness of the most recent generation T.
6. The multi-shuttle scheduling method based on track avoidance and intelligent scheduling according to claim 5, characterized in that: In step S4, the shuttle's dynamic control and path avoidance are as follows: S41. The shuttle's operating status is divided into three types: "idle": Idle state, waiting for tasks; "picking": Head to the starting point of the mission; "delivering": transporting cargo to the mission's destination; When the system is idle, if an available task is available, it will retrieve one task from the task queue and assign it to the idle shuttle. At this point, the vehicle status is set to "picking", and the target is the starting station of the mission; S42. Upon arrival at the starting station, the shuttle automatically performs the loading operation and switches to "delivering" mode: Where d station This indicates the Euclidean distance between the vehicle's current location and the target station. When the Euclidean distance value is less than 1 meter, it is considered "arrived at the station". Upon arrival at the final destination, the system automatically unloads the goods and clears the task, switching the status back to "idle". Ensure that each shuttle can continuously perform multiple tasks and switch states appropriately, forming a closed-loop process for cyclical task execution; S43. The shuttle calculates its forward distance based on its current speed v and time step Δt: Δx=v·Δt If the remaining track length is insufficient to accommodate the forward distance Δx, the vehicle will automatically switch to the next track segment. The system determines which path is suitable for the vehicle based on its current speed. S44. Safety Avoidance Control Mechanism The real-time calculation of the distance to the vehicle ahead on the same track segment is performed using the following formula: d front =V front .offset-(V self .offset+L vehicle ) L vehicle V is the length of the vehicle itself. front V self These are the speeds of the vehicle in front and the vehicle itself, respectively, with offset representing the shortest time. Dynamically calculate safe braking distance: Where a decel For deceleration, δ buffer To maintain a safe buffer distance, a tiered avoidance strategy is adopted: When d front <d safe At that time, the shuttle speed will change to min(v) target ,v front ) When d front <0.6×d safe Time: Reduce the shuttle speed to min(v) target 0.5×v front ) When d front ≤0.5m and v current >v front At that time, the shuttle will immediately activate emergency braking.
7. The multi-shuttle scheduling method based on track avoidance and intelligent scheduling according to claim 1, characterized in that: In step S5, the deadlock detection and recovery mechanism is as follows: S51. Count the number of tasks completed within a fixed time window. A deadlock is determined when the following conditions are met simultaneously: For more than the preset duration T thres No task completion event was detected; The task completion counters for all shuttles have not increased: ΔC done =C current -C last =0 In the formula C current C represents the number of tasks that have been completed so far. last This represents the number of tasks completed during the last test. S52. When congestion occurs, the system iterates through all track segments, counts the number of shuttles in the "moving" state on each track segment, and selects the track segment with the most shuttles as the most congested segment S. congestion : In S congestion The shuttle with the largest offset is selected as the priority vehicle V. prior Clear S congestion above V prior All vehicle occupancy records outside of V will be displayed. prior Remove from the current orbital segment and advance to the next orbital segment, then calculate the next orbital S. next =V prior .choose_next_segment(peek=True), if S next If access is possible, then set V. prior The orbital segment is S. next The offset is min(0.1, S). next .length), let V prior Continue forward on the mission, targeting S. congestion Apply a random duration pause to the remaining shuttles; S53. The system resumes operation and resets the deadlock detection timer: t last_progress ←t current C last ←C current Record the number of times the connection is blocked.
8. A multi-shuttle scheduling system based on track avoidance and intelligent scheduling, used to implement the multi-shuttle scheduling method based on track avoidance and intelligent scheduling as described in any one of claims 1 to 7, characterized in that, include: Multiple shuttle vehicles with autonomous operation capabilities, each shuttle vehicle is equipped with: A load detector is used to detect the weight of the cargo currently being carried. Accelerometers and braking devices are used to precisely control driving status and respond to dynamic avoidance requirements; The vehicle-mounted control unit is used to receive dispatch instructions and execute tasks. A track network consists of multiple track segments; Each track segment has a capacity limit, and the capacity is proportional to the length of the track segment; The track segments are connected by nodes to form a closed loop or multi-branch topology, allowing the shuttle to run continuously. Each track section is equipped with an "accessible" detection interface to restrict the conditions under which shuttle vehicles can enter; At least one side loading and unloading track is set on one side of the work site, which is laid parallel to the main track and connected to the main track through a connecting section; When the shuttle arrives at the target work station, it enters the side track to carry out loading and unloading operations according to the instructions of the dispatching system, thereby avoiding traffic congestion caused by long-term occupation on the main track; A set of fast and slow flow separation track structures located at the exit of the work area includes: One fast lane and one slow lane form a parallel dual-channel structure; The shuttle car will be guided into the fast lane by the control unit if its speed is greater than 2.0 m / s, and into the slow lane if its speed is lower than the threshold. The fast and slow lanes merge back into the main track before the next work area to achieve traffic diversion and merging; A central scheduling and control unit supports a task allocation strategy based on genetic algorithms and has the following functions: Receive material handling tasks to be completed and generate a scheduling plan; Intelligent path allocation is performed based on dynamic information such as the shuttle's current location, loading status, target station, track status, and current speed. The path selection process calls the preset Floyd-Warshall shortest path algorithm and uses the LRU caching mechanism to optimize high-frequency track segment queries, thereby improving path calculation efficiency.
9. The multi-shuttle dispatching system based on track avoidance and intelligent scheduling according to claim 8, characterized in that: The side loading and unloading track is laid out parallel to the main track and is located on one side of the work station. It is used for shuttle cars to temporarily enter during loading and unloading operations, so as not to occupy the main track channel resources. Before the shuttle approaches the target work station, the dispatch control unit issues an instruction to guide it to switch from the main track to the corresponding side track, and smoothly merge through the set connecting section, so that the vehicle can complete the picking up or unloading operation without interrupting the main line traffic. After loading and unloading operations are completed, the shuttle car safely returns to the main track via another connecting section to continue its subsequent operation.
10. The multi-shuttle scheduling system based on track avoidance and intelligent scheduling according to claim 8, characterized in that: The fast lane and the slow lane are two parallel physical tracks that branch off at the exit of work area 1, and are used to guide shuttles in different operating states into different paths. Under the command of the dispatch control unit, the shuttle car makes a diversion judgment based on its real-time running speed: if its current speed is greater than the preset threshold, it enters the fast lane and maintains high-speed passage; otherwise, if the vehicle is heavily loaded or the running speed is too low, it is guided into the slow lane to reduce interference with high-speed vehicles. The two lanes merge back into the main track at the entrance of Operation Zone 2 via the track merging section, achieving a closed-loop path and continuous scheduling.