A multi-task cooperative inspection optimization method and system based on a track inspection robot
By real-time evaluation of the status information of the track inspection robot and task clustering, combined with deep learning and obstacle avoidance path planning, the task allocation of the rail train maintenance system was optimized, solving the problem of low inspection efficiency in dynamic environments and realizing efficient and safe multi-task collaborative inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU GONGSHU DISTRICT EDGE INTELLIGENCE INNOVATION RESEARCH INSTITUTE
- Filing Date
- 2026-05-15
- Publication Date
- 2026-07-31
AI Technical Summary
When faced with a dynamically changing operating environment, the existing railcar maintenance system needs to frequently replan inspection tasks, which leads to robot waiting or inefficient operation and affects maintenance efficiency.
By collecting real-time status information of the track-following robot, constructing a set of capability vectors and calculating risk scores, performing scene classification and task clustering, adopting global or local task allocation strategies, and combining deep reinforcement learning and spatiotemporal graphs to construct obstacle avoidance paths, fine-grained task allocation is achieved.
It enables real-time monitoring and anomaly prediction of inspection tasks, improves system reliability and stability, reduces computational overhead, increases task execution efficiency and resource utilization, reduces path conflicts, and ensures system coordination and security.
Smart Images

Figure CN122195110B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail vehicle inspection technology, and more specifically, to a multi-task collaborative inspection optimization method and system based on a track-inspecting robot. Background Technology
[0002] Routine maintenance of railcars is a crucial aspect of ensuring their safe operation. Traditional manual inspection methods suffer from numerous problems, including high labor intensity, low inspection efficiency, high human error rates, and significant risks. With the rapid development of artificial intelligence, robotics, and sensor technologies, the use of inspection robots to replace manual labor in railcar maintenance has become an important trend in the industry.
[0003] Chinese patent CN117970932B discloses a task allocation method for collaborative inspection of rail trains using multiple robots. The method includes: an environment map creation step, constructing a 3D map according to the scene and scale; a task state initialization step, determining the initial track set and the inspection robot position information set; an allocation model construction step, summarizing track path information to reflect the path length between the inspection robot and the track where it needs to perform the next inspection task; and an inspection task allocation step, obtaining an inspection plan through an analytical function based on the task allocation model, calculating a score based on the inspection plan using a fitness function, and outputting the corresponding inspection plan based on the score. This technical solution dynamically and rationally allocates inspection tasks to different robots, optimizing robot collaboration and improving inspection speed and accuracy.
[0004] However, the railcar maintenance depot is a highly dynamic operating environment with numerous uncertainties: robots may malfunction unexpectedly, maintenance work orders may be changed temporarily, new trains may enter the depot unexpectedly, track occupancy status may change abruptly, and personnel or equipment may temporarily occupy passageways. While existing technologies provide anomaly feedback mechanisms, their strategy is to completely re-allocate inspection tasks if an anomaly occurs—essentially a complete replanning approach. This method requires rebuilding the model and re-running swarm intelligence algorithms for global optimization, typically taking tens of seconds or even minutes. During the replanning period, other normally functioning robots may be waiting or operating inefficiently, leading to extended overall inspection time and impacting maintenance efficiency. Summary of the Invention
[0005] The purpose of this invention is to provide a multi-task collaborative inspection optimization method and system based on a track-tracking robot in order to solve the above-mentioned problems.
[0006] This invention provides a multi-task collaborative inspection optimization method based on a track-following robot, comprising the following steps:
[0007] Collect real-time status and task status information of multiple track-following robots and construct a set of capability vectors. Calculate the risk score of each track-following robot based on the status information.
[0008] Based on the risk score, the scenario is classified to obtain the scenario type. Based on the scenario type and the task status information, the task to be assigned is spatially clustered to obtain the task cluster.
[0009] When the scenario type is a global replanning scenario, global task allocation is performed. The global task allocation constructs a capability requirement matching degree matrix based on the capability vector set and task cluster, and solves the matching scheme between the track-following robot and the task cluster. Based on the matching scheme, the tasks within the task cluster are allocated in a fine-grained manner to obtain the task allocation scheme.
[0010] When the scenario type is a local adjustment scenario, local task reassignment is performed. Local task reassignment includes identifying abnormal track-following robots and calculating their influence domain, and reassigning track-following robots and tasks within the influence domain to obtain a task allocation scheme.
[0011] Based on the task allocation scheme, a spatiotemporal graph is constructed and the conflict probability of each node is predicted. An active obstacle avoidance path is then generated based on the conflict probability.
[0012] Furthermore, calculating the risk score for each tracking robot based on the aforementioned state information includes:
[0013] The status information of multiple tracking robots is combined into a status set, which includes position coordinates, remaining battery percentage, current moving speed, currently executing task number, task completion progress, and health status score.
[0014] Collect task status information corresponding to all tracks to form a task status set;
[0015] Construct a set of capability vectors, which includes multiple capability vectors;
[0016] For each track-following robot, a historical state window is constructed, and the historical state window is input into a long short-term memory network to calculate the abnormal probability of the track-following robot in the future predicted time period. The abnormal probability includes the probability of low battery and the probability of timeout.
[0017] The risk score of the track-following robot is calculated based on the anomaly probability. The risk score is obtained by weighted summation of the low battery probability, timeout probability, and the complement of the track-following robot's health status score.
[0018] Furthermore, the task status information includes track number, task status, task priority, task complexity score, and task deadline;
[0019] The capability vector of the track-following robot includes sensing accuracy score, mobility score, endurance score, computing power score, and professional function vector, which represents the detection functions possessed by the track-following robot.
[0020] The historical state window includes a continuous sequence of state information from past time t to the current time, and the window length is the preset number of historical observation steps.
[0021] Furthermore, based on the risk score, scenario classification is performed to obtain scenario types. Then, based on the scenario types and task status information, spatial clustering is performed on the tasks to be assigned to obtain task clusters, including:
[0022] The maximum risk score among all the risk scores of the track-following robots is calculated as the maximum risk score. The scenario type is determined based on the maximum risk score. The scenario types include steady-state scenario, local adjustment scenario and global replanning scenario.
[0023] When a global replanning scenario is identified, all tasks in the pending assignment state are selected from the task state set to form a pending task set.
[0024] An improved K-means clustering algorithm is used to divide the set of tasks to be assigned into a preset number of task clusters. The optimization objective of the improved K-means clustering algorithm is to minimize the sum of the comprehensive biases within all task clusters.
[0025] For each task cluster, the overall deviation is the sum of the distance term and the priority term. The distance term is the sum of the squares of the Euclidean distances from each task position within the task cluster to the center position of the task cluster. The priority term is the sum of the absolute values of the differences between the task priorities of each task within the task cluster and the average task priority of the task cluster, multiplied by a preset spatial priority balance coefficient.
[0026] Multiple task clusters and their corresponding spatial center coordinates were obtained through iterative optimization.
[0027] Furthermore, determining the scenario type based on the maximum risk score includes:
[0028] When the maximum risk score is less than the preset steady-state threshold, the current scenario type is determined to be a steady-state scenario, and the currently assigned task continues to be executed;
[0029] When the maximum risk score is greater than or equal to the preset steady-state threshold and less than the preset global replanning threshold, the current scenario type is determined to be a local adjustment scenario, and local task reallocation is performed.
[0030] When the maximum risk score is greater than or equal to the preset global replanning threshold, the current scenario type is determined to be a global replanning scenario, and global task allocation is executed.
[0031] Furthermore, the task allocation scheme is obtained by performing fine-grained allocation of tasks within the task cluster based on the matching scheme, including:
[0032] For each task cluster, calculate its demand vector, the dimension of which is the same as the capability vector of the track-following robot;
[0033] Construct a capability requirement matching degree matrix, where each element in the capability requirement matching degree matrix represents the matching degree between the corresponding track-following robot and the corresponding task cluster;
[0034] The Hungarian algorithm is used to solve the matching scheme between the track-following robot and the task cluster based on the capability requirement matching degree matrix. The optimization objective is to maximize the sum of the matching degrees of all matching pairs. The matching scheme includes the task clusters that each track-following robot is responsible for.
[0035] Based on a deep Q-network and a matching scheme, the task allocation decision is repeatedly executed, and the allocation scheme with the highest expected cumulative reward function value in the current state is selected until all tasks in the task cluster have been allocated, thus obtaining the task allocation scheme.
[0036] Furthermore, the matching degree is the capability matching term plus the distance component term. The capability matching term is the capability matching component multiplied by a preset capability weight coefficient, and the distance component term is the distance component multiplied by a preset distance weight coefficient. The capability matching component is obtained by calculating the cosine similarity between the track-following robot's capability vector and the task cluster's requirement vector and linearly mapping it to the range of zero to one. The distance component is obtained by calculating the Euclidean distance from the track-following robot's current position to the center of the task cluster space, normalizing it, and then subtracting the normalized distance value from one.
[0037] The state space of a deep Q-network includes the current state set of the tracking robot, the set of unassigned tasks within the current task cluster, and the historical assignment history of completed tasks.
[0038] The action space of a deep Q-network includes all possible task assignment actions, each action representing assigning an unassigned task to the track-following robot;
[0039] The reward function of the deep Q network is the sum of the time term, the conflict risk term, the energy consumption term, and the matching term. The time term is the negative value of the total completion time increment caused by the execution of the assigned action multiplied by the preset time penalty weight coefficient. The conflict risk term is the negative value of the estimated conflict risk value multiplied by the preset conflict penalty weight coefficient. The energy consumption term is the negative value of the expected energy consumption of each traversing robot performing the task multiplied by the preset energy consumption penalty weight coefficient. The matching term is the matching degree multiplied by the preset matching reward weight coefficient.
[0040] Furthermore, the task allocation scheme for reallocating the orbit-following robots and tasks within the influence domain includes:
[0041] Iterate through the risk scores of all track-following robots and identify those with risk scores greater than or equal to a preset steady-state threshold as abnormal track-following robots.
[0042] For each abnormal track-following robot, its influence domain is calculated. The influence domain includes track-following robots whose spatial location is less than the preset influence radius, as well as track-following robots whose current task has a dependency relationship or resource conflict with the task of the abnormal track-following robot. The criterion for judging that the spatial location is closer to the abnormal track-following robot is that the Euclidean distance between the two track-following robots is less than the preset influence radius.
[0043] A rolling time-domain optimization method is used to redistribute the tracking robot and tasks within the influence domain. The goal of rolling time-domain optimization is to minimize the cumulative cost from the current time to the preset prediction time domain. The cumulative cost is the sum of the stage cost term and the decision smoothing term. The stage cost term is the sum of the stage costs at each time. The decision smoothing term is the sum of the norm of the decision change at adjacent time times multiplied by the preset smoothing weight coefficient. The stage cost is the sum of the expected time term, the expected energy consumption term, and the expected conflict term. The expected time term is the expected task completion time multiplied by the preset time weight coefficient. The expected energy consumption term is the expected energy consumption multiplied by the preset energy consumption weight coefficient. The expected conflict term is the expected conflict cost multiplied by the preset conflict weight coefficient.
[0044] The optimization process satisfies constraints, including system dynamic constraints, decision feasibility constraints, and security constraints.
[0045] Solving the optimization problem yields the optimal decision sequence from the current time to the preset prediction time domain. Executing the optimal decision at the current time completes the local task redistribution, resulting in a task allocation scheme.
[0046] Furthermore, generating an active obstacle avoidance path based on the conflict probability includes:
[0047] Construct a spatiotemporal graph, which consists of a set of nodes and a set of edges. Each node in the set of nodes represents a spatiotemporal location, and each edge in the set of edges represents a feasible spatiotemporal transition.
[0048] Set the initial feature vector for each node, including the spatial coordinates of the node, the time point of the node, the number of the track-following robot occupying the spatiotemporal position, the velocity vector of the track-following robot at that spatiotemporal position, and the encoding vector of the corresponding task information.
[0049] Based on the initial feature vectors of the nodes, a probabilistic prediction model is used to predict the conflict probability of each node.
[0050] Based on the conflict probability of each node, the multi-objective A* algorithm is used to generate an active obstacle avoidance path.
[0051] This invention provides a multi-task collaborative inspection optimization system based on a track-tracking robot, which is used to implement a multi-task collaborative inspection optimization method based on a track-tracking robot. The system includes:
[0052] The information fusion module collects real-time status and task status information of multiple track-tracing robots and constructs a set of capability vectors. Based on the status information, it calculates the risk score of each track-tracing robot.
[0053] The scenario classification module classifies scenarios based on the risk score to obtain scenario types, and performs spatial clustering of the tasks to be assigned based on the scenario types and task status information to obtain task clusters.
[0054] The global allocation module performs global task allocation when the scenario type is a global replanning scenario. The global task allocation constructs a capability requirement matching degree matrix based on the capability vector set and the task cluster, and solves the matching scheme between the track-following robot and the task cluster. Based on the matching scheme, the tasks within the task cluster are allocated in a fine-grained manner to obtain the task allocation scheme.
[0055] The local allocation module performs local task reassignment when the scenario type is a local adjustment scenario. Local task reassignment includes identifying abnormal track-following robots and calculating their influence domain, and reassigning track-following robots and tasks within the influence domain to obtain a task allocation scheme.
[0056] The conflict prediction module constructs a spatiotemporal graph based on the task allocation scheme and predicts the conflict probability of each node, and generates an active obstacle avoidance path based on the conflict probability.
[0057] The beneficial effects of this invention are as follows: Through multi-source information fusion and risk assessment mechanisms, this invention achieves real-time monitoring and anomaly prediction of the status of the track-following robot, proactively identifying potential risks before a failure occurs, effectively improving the system's reliability and stability. By employing scenario classification and hierarchical response strategies, it adaptively selects three processing modes—steady-state operation, local adjustment, or global replanning—based on the system's risk level, significantly reducing computational overhead while ensuring task allocation quality, thus achieving a balance between computational efficiency and allocation effectiveness.
[0058] This invention constructs a capability profile and task requirement vector for a track-following robot, uses a capability requirement matching matrix for precise matching between the robot and tasks, and combines deep reinforcement learning for fine-grained task allocation. This fully leverages the differentiated capabilities of heterogeneous track-following robots, improving task execution efficiency and resource utilization. For local anomalies, an influence domain analysis and rolling temporal optimization method are designed, performing local task reallocation only in the affected area, avoiding system oscillations caused by global replanning. Simultaneously, a distributed negotiation mechanism ensures consistency between local adjustments and global task allocation, guaranteeing the overall coordination of the system. By constructing a spatiotemporal graph and predicting path conflict probability using graph neural networks, a multi-objective pathfinding algorithm incorporating conflict probability penalties and path smoothness scoring is used to generate proactive obstacle avoidance paths. This achieves early avoidance of potential conflicts, effectively reducing path conflicts between track-following robots and improving the safety of multi-robot collaborative operations. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating a multi-task collaborative inspection optimization method based on a track-cruising robot according to the present invention.
[0060] Figure 2 This is an example diagram of the task cluster obtained by the multi-task collaborative inspection optimization method based on a track-cruising robot according to the present invention;
[0061] Figure 3 This is an example diagram illustrating the task allocation scheme obtained from a multi-task collaborative inspection optimization method based on a track-cruising robot according to the present invention.
[0062] Figure 4 This is a module example diagram of a multi-task collaborative inspection optimization system based on a track-cruising robot according to the present invention. Detailed Implementation
[0063] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.
[0064] Example 1:
[0065] A multi-task collaborative inspection optimization method based on a track-following robot, such as Figure 1 As shown, this embodiment is applied to a railcar maintenance depot environment, which includes several tracks and several heterogeneous track-inspecting robots. The steps include:
[0066] Step 100: Collect real-time status information and task status information of multiple track-following robots and construct a set of capability vectors. Calculate the risk score of each track-following robot based on the status information.
[0067] At the current moment, the status information of all the track-following robots is collected to form a track-following robot status set. This status set includes the status information of each track-following robot, including position coordinates, remaining battery percentage, current movement speed, currently executing task number, task completion progress, and health status score. Specifically, the position coordinates use two-dimensional plane coordinates to represent the specific location of the track-following robot in the maintenance depot; the remaining battery percentage reflects the energy reserves of the track-following robot; the current movement speed records the real-time movement status of the track-following robot; the task number identifies the specific task the track-following robot is currently performing; the task completion progress is represented by a value between 0 and 1, where 0 indicates the task has not yet started and 1 indicates the task has been completed; the health status score also uses a value between 0 and 1, with a higher value indicating a better track-following robot status.
[0068] Simultaneously, task status information for all tracks is collected to form a task status set. This task status set includes task status information for each track, including track number, task status, task priority, task complexity score, and task deadline. Task status includes three types: pending assignment, in progress, and completed. Task priority indicates the urgency and importance of the task; task complexity score reflects the difficulty of task execution; and task deadline specifies the latest time by which the task must be completed.
[0069] In addition, by integrating environmental sensor data, a dynamic obstacle list is updated. This list records the location coordinates and expected duration of temporary obstacles within the maintenance depot, providing environmental constraint information for subsequent path planning.
[0070] A capability vector set is constructed for each tracking robot. This set includes multiple capability vectors describing the comprehensive capability characteristics of each robot. Vector representation is used because it unifies multiple capability dimensions into a single mathematical object, facilitating numerical calculations and similarity comparisons. In subsequent task allocation, the robot's capabilities need to be matched with task requirements; the vector form allows for efficient matching using mathematical methods such as cosine similarity. Furthermore, vector representation offers good scalability; adding new capability dimensions simply requires expanding the vector dimensions without modifying the overall data structure and calculation methods. Each tracking robot's capability vector includes a sensing accuracy score, mobility score, endurance score, computing power score, and a specialized function vector.
[0071] The sensing accuracy score reflects the detection accuracy of the sensors on the tracking robot, and after normalization, its value ranges from 0 to 1. The mobility score comprehensively considers the tracking robot's maximum speed and acceleration, reflecting its motion performance. The battery life score is calculated based on the tracking robot's battery capacity, representing its continuous working capability. The computing power score is based on an assessment of the artificial intelligence inference speed of the tracking robot's edge computing unit, reflecting its data processing capability. Specialized function vectors use a multi-dimensional one-hot encoding method to represent the special detection functions possessed by the tracking robot, such as infrared detection and ultrasonic detection.
[0072] The capability vector is used in subsequent steps to calculate the matching between the tracking robot and the task, ensuring that the task is assigned to the tracking robot that is best suited to perform the task.
[0073] Based on the state set of a tracking robot, a Long Short-Term Memory (LSTM) network is used to predict the potential anomaly probability of each tracking robot within a future period. The reason for using an LSM network is that the state evolution of a tracking robot exhibits significant temporal dependencies, with a complex nonlinear relationship between its current state and historical state sequences. Traditional statistical prediction methods struggle to effectively capture this long-range dependency. Through its unique gating mechanism, the LSM network can selectively remember and forget historical information, effectively solving the gradient vanishing problem inherent in traditional recurrent neural networks when processing long sequences. This allows for accurate modeling of the temporal evolution of the tracking robot's state. Furthermore, the LSM network possesses strong generalization ability, adapting to the state change patterns of different tracking robots under various operating conditions, providing reliable probability estimates for anomaly prediction.
[0074] Specifically, for each tracking robot, a historical state window is constructed. This window comprises a continuous sequence of state information from a past moment to the present moment. The window length is a preset number of historical observation steps, with a default value of 20. This default value is determined based on the time scale of the tracking robot's state changes. By analyzing the autocorrelation characteristics of the historical state data, a window length that can adequately capture the state evolution patterns is selected. The historical state window is chosen as input because anomalies in tracking robots typically exhibit gradual characteristics. For example, battery depletion shows a continuous consumption trend, task execution progress shows a gradual advancement or stagnation pattern, and health status shows a slow deterioration process. By using state information over a continuous time period as input, the Long Short-Term Memory (LSTM) network can learn these gradual change patterns, thus providing early warnings before anomalies actually occur. A single-moment state snapshot cannot reflect the trend and rate of state changes, while the historical state window provides a complete state evolution trajectory, enabling the network to identify precursory features leading to anomalies.
[0075] The historical state window is input into the Long Short-Term Memory (LSTM) network to calculate the probability of an anomaly occurring for the tracking robot within a predicted future timeframe. The anomaly probability ranges from 0 to 1 and includes low battery probability and timeout probability. The low battery probability represents the probability that the tracking robot's battery level is below a preset minimum safety threshold, reflecting the risk of insufficient energy. The default value for this preset minimum safety threshold is 20%, determined based on the minimum battery level required for the tracking robot to return to the charging station, with a safety margin. The timeout probability represents the probability that the tracking robot's current task exceeds its deadline, reflecting the risk of task delay.
[0076] The training steps for the Long Short-Term Memory (LSTM) network include: First, collecting training samples from historical operational data of the maintenance depot. Each training sample includes a historical state window of a certain track-inspection robot at a specific moment and labels of actual anomalies that occurred after that moment. The anomaly labels use binary encoding to indicate whether an anomaly occurred. Next, the collected training samples are preprocessed, including normalizing the numerical features in the state information to map the values of each dimension to the same range, eliminating the impact of dimensional differences on network training. Then, the preprocessed training samples are divided into a training set and a validation set according to a preset ratio. In this embodiment, the preset ratio is 7:3. The training set is used for optimizing and updating network parameters, while the validation set is used to monitor the network's generalization performance and prevent overfitting. During training, the cross-entropy loss function is used to measure the difference between the network's predicted anomaly probability and the actual anomaly label. An adaptive moment estimation optimization algorithm is used to iteratively update the network's trainable parameters, gradually reducing the loss function value. The training process continues until the loss function value on the validation set no longer decreases significantly. At this point, the network parameters are saved as the final pre-trained model. Through the aforementioned offline training process, the Long Short-Term Memory network learns the mapping relationship from historical state sequences to anomaly probabilities, enabling it to accurately predict potential anomalies of the track-following robot during actual operation.
[0077] Based on the anomaly probability, a risk score is calculated for each tracking robot at the current moment. A weighted summation method is used to calculate the risk score because the risks faced by the tracking robots come from multiple aspects, including insufficient energy risk, task delay risk, and equipment failure risk. These risk factors have varying degrees of impact on system operation, requiring weighting coefficients to reflect their relative importance. The weighted summation method can integrate multiple risk factors into a single risk score, facilitating subsequent scenario classification and decision-making. The risk score is obtained by weighted summing the low battery probability, timeout probability, and the complement of the tracking robot's health status score. The complement of the tracking robot's health status score is calculated by subtracting the health status score from 1, reflecting the equipment failure risk. The probability of low battery, the probability of timeout, and the complement of the health status score of the track-inspection robot are multiplied by their respective preset risk weight coefficients and then added together to obtain the comprehensive risk score. The sum of the three preset risk weight coefficients equals 1, which is used to adjust the relative importance of different risk factors. Their default values are 0.4, 0.35, and 0.25, respectively. These default values are determined by the analytic hierarchy process based on the frequency and impact of various risk events in the historical fault statistics of the maintenance depot.
[0078] Step 200: Based on the risk score, classify the scenarios to obtain scenario types. Then, based on the scenario types and task status information, perform spatial clustering of the tasks to be assigned to obtain task clusters, specifically as follows: Figure 2 As shown.
[0079] First, the maximum risk score among all the track-following robots is calculated as the overall risk level indicator. The maximum risk score is chosen because in a multi-track-following robot collaborative inspection system, any anomaly in any robot can affect the overall task execution. Using the maximum value allows for timely detection of the most severe risk situations, ensuring that no high-risk robot anomalies are overlooked. Compared to using averages or medians, the maximum value is more sensitive to anomalies, triggering appropriate response mechanisms as soon as a risk emerges, preventing further escalation. Then, the scenario is categorized based on the comparison between the maximum risk score and a preset threshold, resulting in scenario types: steady-state scenarios, local adjustment scenarios, and global replanning scenarios. This three-level scenario classification is used because different risk levels require different response strategies. Over-response wastes computational resources and leads to frequent system adjustments, while under-response may result in increased risk and task failure. By setting three levels—steady-state, local adjustment, and global replanning scenarios—differentiated responses to different risk levels can be achieved, ensuring system safety while maintaining operational efficiency and stability.
[0080] When the maximum risk score is less than the preset steady-state threshold, the current scenario is determined to be a steady-state scenario, indicating that the operation is normal and no task adjustment is required. Each track-following robot continues to execute the currently assigned task.
[0081] When the maximum risk score is greater than or equal to the preset steady-state threshold and less than the preset global replanning threshold, the current scenario is determined to be a local adjustment scenario, indicating that there is a local risk and an incremental task adjustment process needs to be triggered to perform local task reallocation.
[0082] When the maximum risk score is greater than or equal to the preset global replanning threshold, the current scenario is determined to be a global replanning scenario, indicating that there is a significant risk, and global task allocation is triggered.
[0083] Both the preset steady-state threshold and the preset global replanning threshold are positive numbers, with the preset steady-state threshold being less than the preset global replanning threshold, and both being less than 1. The default value for the preset steady-state threshold is 0.3, and the default value for the preset global replanning threshold is 0.7. These default values are determined based on statistical analysis of the system response effects under different risk levels in the historical operating data of the maintenance depot. By conducting comparative experiments on multiple threshold combinations in a simulation environment, the threshold configuration that optimizes the overall system performance index is selected as the default value. By setting two levels of thresholds, differentiated responses to different risk levels are achieved.
[0084] When the scenario is determined to be a global replanning scenario, spatial clustering is performed on the set of tasks to be assigned, dividing the tasks into several relatively independent task clusters.
[0085] Based on the task status set obtained in step 100, all tasks in the "to be assigned" state are selected to form the task set to be assigned. An improved K-means clustering algorithm is used to divide the task set to be assigned into a preset number of task clusters. The default value of this preset number of task clusters is equal to the number of available track-following robots. This default value is determined based on the design principle of a one-to-one match between track-following robots and task clusters, ensuring that each track-following robot can be responsible for an independent task cluster. The partitioning result satisfies the following conditions: the union of all task clusters equals the task set to be assigned, and there is no intersection between any two different task clusters, meaning that each task to be assigned belongs to exactly one task cluster. The reason for using the K-means clustering algorithm is that it has the advantages of high computational efficiency, simple implementation, and strong scalability. It can complete the partitioning of large-scale task sets in a short time, meeting the response time requirements of real-time scheduling in the maintenance depot. Compared with hierarchical clustering and density clustering algorithms, the K-means clustering algorithm has lower time complexity, and the number of clusters in the clustering result can be specified in advance, facilitating matching with the number of track-following robots. In addition, the task clusters generated by the K-means clustering algorithm have good spatial compactness, which helps to reduce the travel distance of the tracking robot when performing tasks within the task cluster, thereby reducing energy consumption and improving execution efficiency.
[0086] The improved K-means clustering algorithm introduces a priority factor into the traditional algorithm. The reason for introducing the priority factor is that inspection tasks in the railcar maintenance depot have different levels of urgency and importance. If clustering is only based on spatial location, high-priority and low-priority tasks may be grouped into the same task cluster, making it difficult for the inspection robot to rationally arrange the execution order and affecting the timely completion of urgent tasks. By considering both spatial distance and priority differences during the clustering process, tasks within the same task cluster are not only spatially close but also similar in priority, facilitating the inspection robot to execute tasks sequentially according to priority, thus improving the rationality of task scheduling. The optimization objective of the algorithm is to minimize the sum of the comprehensive deviations within all task clusters. For each task cluster, the comprehensive deviation is the sum of the distance term and the priority term. The distance term is the sum of the squared Euclidean distances from each task location within the cluster to the cluster center, reflecting spatial compactness; the priority term is the sum of the absolute values of the differences between the task priorities of each task within the cluster and the average task priority of the cluster, multiplied by a preset spatial priority balance coefficient, reflecting priority consistency. The preset spatial priority balance coefficient is used to adjust the relative importance of spatial distance and priority difference in the clustering process. Its default value is 0.5. This default value is determined based on the distribution characteristics of maintenance depot tasks. Through cross-validation experiments on historical task datasets, the coefficient value that achieves the best balance between spatial compactness and priority consistency in the clustering results is selected.
[0087] By iteratively optimizing the above objectives, several task clusters and their corresponding spatial center coordinates are obtained. Each task cluster includes tasks that are spatially close and have similar priorities, which facilitates the subsequent allocation of the tracking robot.
[0088] Step 300: When the scenario type is a global replanning scenario, global task allocation is performed. Global task allocation constructs a capability requirement matching degree matrix based on the capability vector set and task clusters, and solves for the matching scheme between the tracking robot and the task clusters. Based on the matching scheme, tasks within the task clusters are allocated in a fine-grained manner to obtain a task allocation scheme, specifically as follows: Figure 3 As shown.
[0089] Global task allocation is based on the capability vector set of the track-crawling robot and the task cluster partitioning results. A capability requirement matching degree matrix is constructed and the optimal matching scheme is solved.
[0090] First, calculate the requirement vector for each task cluster. The dimensions of this requirement vector are the same as those of the tracking robot's capability vector, including requirements for sensing accuracy, mobility, endurance, computing power, and specialized functions, reflecting the comprehensive requirements of the task cluster for the tracking robot's various capabilities.
[0091] The requirement vector is obtained as follows: For each task within a task cluster, the single-task requirement vector is first determined based on the task attributes. Sensing accuracy requirement is determined based on the required detection accuracy level; the higher the detection accuracy level, the greater the sensing accuracy requirement value. After normalization, the value ranges from 0 to 1. Mobility requirement is determined based on the distance between the task location and the center of the task cluster, as well as the urgency of the task deadline; the greater the distance or the tighter the deadline, the greater the mobility requirement value. Endurance requirement is determined based on the expected execution time of the task and the distance between the task location and the charging station; the longer the execution time or the farther the distance to the charging station, the greater the endurance requirement value. Computational capability requirement is determined based on the task complexity score; the higher the task complexity score, the greater the computational capability requirement value. The specialized function requirement vector uses the same multi-dimensional one-hot encoding method as the specialized function vector in the track-following robot's capability vector. It is encoded according to the specific detection function type required by the task; when a task requires a specific detection function, the corresponding dimension is set to 1, otherwise it is set to 0.
[0092] After obtaining the individual task requirement vectors for all tasks within a task cluster, the cluster's overall requirement vector is calculated. Specifically, this is done by weighting the individual task requirement vectors of all tasks within the cluster, with the weights being the task priority of each task. For each dimension of the requirement vector, the requirement values of all tasks within the cluster in that dimension are multiplied by their respective task priorities, summed, and then divided by the sum of the task priorities of all tasks in the cluster to obtain the requirement vector value for that dimension. By using task priority as the weight for this weighted averaging, the requirement characteristics of high-priority tasks have a greater proportion in the cluster's requirement vector, ensuring that the capability requirements of urgent tasks are prioritized during task allocation.
[0093] Next, a capability requirement matching degree matrix is constructed. The number of rows in this matrix equals the number of tracking robots, and the number of columns equals the number of task clusters. Each element in the matrix represents the matching degree between the corresponding tracking robot and the corresponding task cluster. The reason for using matrix form to represent the matching degree is that the matrix structure can clearly describe the pairwise matching relationships between all tracking robots and all task clusters, which facilitates subsequent global optimal matching solutions using combinatorial optimization algorithms. The row and column structure of the matrix naturally corresponds to the set of tracking robots and the set of task clusters, allowing the matching problem to be transformed into a standard bipartite graph maximum weight matching problem, which can then be solved efficiently using mature optimization algorithms. The matching degree is calculated using a normalized weighted fusion method, which unifies the capability matching component and the distance component to the same dimension before fusion. The reason for using the normalized weighted fusion method is that the capability matching component and the distance component have different physical meanings and value ranges. Direct addition will lead to inconsistencies in dimensions, making it possible for one component to dominate the matching degree calculation result. By normalizing the two components to the same value range, and then adjusting their relative importance through weighting coefficients, a reasonable integration of capability matching and spatial distance can be achieved, resulting in a matching degree index that comprehensively reflects the matching quality.
[0094] Specifically, the capability matching component is calculated as follows: First, the cosine similarity between the robot's capability vector and the task cluster's requirement vector is calculated. This cosine similarity value ranges from -1 to 1. It is then linearly mapped to a value between 0 and 1 to obtain the normalized capability matching component. The reason for using cosine similarity as a capability matching metric is that it measures the similarity of two vectors in direction, rather than the difference in absolute values. In the scenario of matching robot capabilities with task requirements, the focus is more on the degree of matching between the capability structure and the requirement structure, rather than the absolute magnitude of the capability and requirement values. For example, a robot with high sensing accuracy but moderate mobility should be preferentially matched with task clusters that require high sensing accuracy but moderate mobility. Cosine similarity can accurately capture this structural matching relationship. Furthermore, cosine similarity is insensitive to the magnitude of the vectors, avoiding matching deviations caused by differences in the overall numerical values of the capability or requirement vectors.
[0095] The method for calculating the distance component includes: first, calculating the Euclidean distance from the current position of the track-following robot to the center of the task cluster space; then, normalizing the distance by dividing it by the maximum working distance of the maintenance depot to obtain a normalized distance value, which ranges from 0 to 1; and then subtracting the normalized distance value from 1 to obtain the distance component, with the closer the distance, the larger the distance component.
[0096] The matching degree equals the capability matching term plus the distance component term. The capability matching term is the capability matching component multiplied by a preset capability weight coefficient, and the distance component term is the distance component multiplied by a preset distance weight coefficient. The sum of the preset capability weight coefficient and the preset distance weight coefficient equals 1, used to adjust the relative importance of capability matching and spatial distance in the matching degree calculation. The default value of the preset capability weight coefficient is 0.6, and the default value of the preset distance weight coefficient is 0.4. These default values are determined based on the actual operational needs of the maintenance depot, obtained by analyzing the impact of capability matching degree and distance factors on task completion efficiency in historical task execution data. Through the above normalized weighted fusion method, both the capability matching component and the distance component are unified to a value range of 0 to 1, avoiding numerical instability caused by inconsistent dimensions. The final matching degree value range is also between 0 and 1.
[0097] Based on the capability requirement matching degree matrix, the Hungarian algorithm is used to find the optimal matching scheme between the tracking robot and the task cluster. The Hungarian algorithm is chosen because the matching problem between the tracking robot and the task cluster is essentially a maximum weight matching problem in a bipartite graph. The Hungarian algorithm is a classic algorithm for solving this type of problem, possessing polynomial time complexity and guaranteeing that a globally optimal solution is found within a finite time. Compared to heuristic methods such as greedy algorithms, the Hungarian algorithm avoids getting trapped in local optima and can fully utilize the global information in the capability requirement matching degree matrix to find the allocation scheme that maximizes the total matching degree. Furthermore, the computational complexity of the Hungarian algorithm is proportional to the product of the number of tracking robots and the number of task clusters, allowing for rapid computation within the actual scale of the maintenance depot, meeting the response time requirements of real-time scheduling. The optimization objective is to maximize the sum of the matching degrees of all matching pairs; that is, for each pair of matched tracking robots and task clusters, their matching degrees are summed, and the matching scheme that maximizes this sum is found.
[0098] The optimization process needs to meet matching constraints, which include that each tracking robot is assigned to at most one task cluster to ensure that tracking robot resources are not repeatedly allocated; and that each task cluster is handled by at least one tracking robot to ensure that all task clusters can be executed.
[0099] Solving the above optimization problem yields the optimal matching scheme between the track-following robot and the task cluster, which includes which task cluster each track-following robot is responsible for.
[0100] Based on the matching scheme between the tracking robot and task clusters, fine-grained task allocation is performed within each task cluster, and a pre-trained deep Q-network is used for decision-making. The reason for using a deep Q-network is that fine-grained task allocation within a task cluster is a sequential decision problem; each allocation decision affects subsequent allocation choices and the final execution effect. As a representative algorithm of deep reinforcement learning, the deep Q-network can learn the long-term value of taking different actions under different states, thus making optimal decisions that consider future impacts. Compared to traditional rule-based or greedy methods, the deep Q-network can automatically learn complex decision-making strategies from historical data, adapting to the variable task allocation scenarios in the maintenance depot. Furthermore, the deep Q-network uses a neural network as an approximator of the value function, enabling it to handle high-dimensional state spaces and large-scale action spaces, exhibiting strong generalization ability and scalability.
[0101] The state space of a deep Q-network includes the current state set of the following robots, the set of unassigned tasks within the current task cluster, and the historical task assignment records. These three types of information are chosen as inputs to the state space because the following robot state set provides the real-time capabilities and resource status of each robot, forming the basis for judging the feasibility of task assignment; the set of unassigned tasks describes the current task requirements and is the target of assignment decisions; and the historical task assignment records reflect previous assignment decisions and their results, helping the network learn the correlation and cumulative effect between assignment decisions. These three types of information collectively describe the complete environmental state required for task assignment decisions, enabling the deep Q-network to make reasonable assignment decisions based on sufficient information.
[0102] The action space of a deep Q-network includes all possible task assignment actions. Each action represents assigning a task that has not yet been assigned to a certain tracking robot. The size of the action space changes dynamically as task assignment proceeds, and assigned tasks no longer appear in the available actions.
[0103] The reward function of a deep Q-network is used to evaluate the merits of each assignment action. The reward function is the sum of a time term, a conflict risk term, an energy consumption term, and a matching term. The time term is the negative value of the total completion time increment caused by executing the assignment action multiplied by a preset time penalty weight coefficient; a larger time increment results in a lower reward. The conflict risk term is the negative value of the estimated conflict risk multiplied by a preset conflict penalty weight coefficient; a larger estimated conflict risk value results in a lower reward. The estimated conflict risk value is calculated based on the target task positions and expected execution time windows of each traversing robot after task assignment. When the target task positions of multiple traversing robots are spatially close and their expected execution time windows overlap, the estimated conflict risk value increases. This estimated conflict risk value reflects the degree of potential path conflict that the task assignment scheme may cause. The energy consumption term is the negative value of the estimated energy consumption of each traversing robot executing the task multiplied by a preset energy consumption penalty weight coefficient; higher energy consumption results in a lower reward. The matching term is the matching degree multiplied by a preset matching reward weight coefficient; higher matching quality results in a higher reward. The preset time penalty weight coefficient, preset conflict penalty weight coefficient, preset energy consumption penalty weight coefficient, and preset matching reward weight coefficient are used to adjust the relative importance of different factors. Their default values are 0.3, 0.3, 0.2, and 0.2, respectively. These default values are determined based on the priority ranking of the maintenance depot's operating objectives and are obtained through expert experience combined with sensitivity analysis of historical task execution data.
[0104] When making task allocation decisions, the action that maximizes the action's value is selected, i.e., the allocation scheme with the highest expected cumulative reward function value in the current state is chosen. The above decision-making process is repeated, assigning one task to a tracking robot each time, until all tasks in the task cluster have been allocated, resulting in a task allocation scheme.
[0105] The training steps for a deep Q-network are as follows. First, a simulation environment is constructed to simulate the task allocation scenario of a maintenance depot. The simulation environment can update the system state and calculate immediate rewards based on the assigned actions. Then, the parameters of the deep Q-network are initialized, and initial values are assigned to the weights of each layer using a random initialization method. Next, training is performed using an experience replay mechanism. In each training round, the agent starts from the initial state, selects an action based on the current network parameters, and interacts with the simulation environment. The state transition records generated by each interaction are stored in the experience replay buffer. The experience replay buffer is a fixed-capacity storage structure; when the buffer is full, an in-first-out (FIFO) strategy is used to replace the old records. During training, a batch of state transition records is randomly sampled from the experience replay buffer. The mean squared error between the target action value and the current network-predicted action value is calculated as the loss function, and the gradient descent algorithm is used to update the network parameters. The reason for using the experience replay mechanism is that it can break the temporal correlation between training samples, improve sample utilization efficiency, and make network training more stable. Furthermore, a target network technique is employed to further improve training stability. The target network is a delayed copy of the main network, and its parameters are periodically copied and updated from the main network to calculate the value of the target action, avoiding frequent fluctuations in the target value during training. The training process continues until the average cumulative reward of the network on the validation scenario converges. At this point, the network parameters are saved as a pre-trained model for actual task allocation decisions.
[0106] Step 400: When the scenario type is a local adjustment scenario, perform local task reassignment. Local task reassignment includes identifying abnormal track-following robots and calculating their influence domain, and reassigning track-following robots and tasks within the influence domain to obtain a task allocation scheme.
[0107] When the scenario type is a local adjustment scenario, local task reassignment is performed. Local task reassignment first identifies abnormal tracking robots and analyzes their influence domain to determine the tracking robots and task ranges that need to be reassigned.
[0108] The method for identifying abnormal tracking robots includes iterating through the risk scores of all tracking robots and identifying those with risk scores greater than or equal to a preset steady-state threshold as abnormal tracking robots. Since the trigger condition for a local adjustment scenario is a maximum risk score greater than or equal to the preset steady-state threshold, at least one abnormal tracking robot exists in this scenario. When multiple tracking robots have risk scores greater than or equal to the preset steady-state threshold, these robots are all identified as abnormal tracking robots, and subsequent local task reallocation will process all abnormal tracking robots and their affected regions.
[0109] For each abnormal track-following robot, its influence domain is calculated. The influence domain includes two categories of track-following robots. The first category consists of track-following robots whose spatial location is less than the abnormal track-following robot's preset influence radius. The criterion for this is that the Euclidean distance between the two track-following robots is less than the preset influence radius. The default value of the preset influence radius is 10 meters, which is determined based on the spacing between maintenance depot tracks and the operating range of the track-following robots, and is obtained by analyzing the spatial propagation range of historical abnormal events. The second category consists of track-following robots whose current task has a dependency relationship or resource conflict with the abnormal track-following robot's task.
[0110] The dependency relationship refers to the sequential constraint between two tasks, meaning that the start or completion of one task is conditional upon the completion of the other. In one embodiment of the present invention, the task dependencies in the railcar maintenance depot are mainly reflected in the following situations. The first situation is inspection process dependency, where some inspection tasks can only be performed after other inspection tasks are completed. For example, the precision inspection of the train bogie can only be carried out after the overall appearance inspection of the train is completed and the stability of the car body is confirmed, or the functional testing of the train braking system can only be performed after the appearance inspection of the braking components is completed. The second situation is data dependency, where the execution of a task requires the use of inspection data or analysis results generated by another task. For example, the comprehensive assessment of the wear degree of train wheels requires data collected by the dimensional inspection task at multiple measurement points. The third situation is process dependency, where, according to the maintenance process flow, certain inspection processes can only be performed after specific processes are completed. For example, the inspection of the train pantograph can only begin after the train has completed its depot positioning task. When the task being performed by the abnormal track inspection robot is a prerequisite for other tasks, the track inspection robots performing these subsequent tasks will be affected and thus included in the influence domain.
[0111] Resource conflict refers to two tasks requiring the same limited resources during execution, resulting in their inability to be performed simultaneously or mutual interference. In one embodiment of the present invention, resource conflicts in the railcar maintenance depot mainly manifest in the following situations: The first situation is spatial resource conflict, where the execution areas of two tasks overlap or are too close together, preventing multiple inspection robots from operating safely within the area simultaneously. For example, both tasks need to perform inspections at adjacent locations on the same track, or the work areas of the two tasks overlap spatially. The second situation is equipment resource conflict, where two tasks need to use the same auxiliary equipment or facilities within the maintenance depot. For example, multiple tasks need to use the same lifting platform or the same charging pile, but this equipment can only serve one inspection robot at a time. The third situation is passageway resource conflict, where the execution paths of two tasks need to pass through the same narrow passageway or intersection, but this passageway only allows one inspection robot to pass at a time, causing passageway conflicts between the inspection robots. The fourth scenario involves conflicting detection targets. Two tasks require different types of inspections on the same part of the same train, but these inspection operations can only be performed by one inspection robot at a time. For example, simultaneous visual and ultrasonic inspections of the bottom of the same carriage may cause mutual interference. When the task being performed by an abnormal inspection robot conflicts with other tasks as described above, the inspection robots performing these conflicting tasks will also be affected and thus included in the impact domain.
[0112] By analyzing the dependencies and resource conflicts between tasks, a set of tasks associated with the abnormal track-following robot tasks is identified, and the track-following robots performing these tasks are also included in the influence domain. When multiple abnormal track-following robots exist, their influence domains are merged to form a comprehensive influence domain.
[0113] Based on the influence domain, a rolling time-domain optimization method is used to redistribute the tracking robots and tasks within the influence domain. The reason for using the rolling time-domain optimization method is that in local adjustment scenarios, it is necessary to quickly respond to local anomalies while maintaining the overall stability of the system. The rolling time-domain optimization method can perform optimization calculations within a limited prediction time domain, considering both the system evolution over a future period and avoiding the high computational complexity of global optimization. Compared to static optimization methods, the rolling time-domain optimization method can continuously update optimization decisions based on real-time changes in the system state, exhibiting strong dynamic adaptability. Furthermore, the rolling time-domain optimization method constrains the magnitude of changes in decisions between adjacent time moments through a decision smoothing term, avoiding drastic adjustments to task allocation, reducing interference with normally operating tracking robots, and ensuring the stability of system operation. The goal of the rolling time-domain optimization is to minimize the cumulative cost from the current time moment to the preset prediction time domain. The cumulative cost is the sum of the stage cost term and the decision smoothing term. The stage cost term is the sum of the stage costs at each time moment, and the decision smoothing term is the sum of the norms of the decision changes between adjacent time moments multiplied by preset smoothing weight coefficients. The preset prediction time domain length represents the number of future time steps considered in the optimization. Its default value is 5, which is determined based on the task execution cycle of the maintenance depot and the limitations of computing resources. It was obtained through a trade-off analysis of optimization effect and computation time under different time domain lengths. The preset smoothing weight coefficient is used to control the importance of the decision smoothing term and avoid drastic adjustments to task allocation. Its default value is 0.1, which is determined based on system stability requirements. It was obtained through simulation experiments to observe the changes in task switching frequency and execution efficiency under different smoothing weights.
[0114] The stage cost function comprehensively considers task completion time, energy consumption, and conflicts. Specifically, the stage cost equals the sum of the expected time, expected energy consumption, and expected conflict terms. The expected time term is the product of the expected task completion time and a preset time weighting coefficient; the expected energy consumption term is the product of the expected energy consumption and a preset energy consumption weighting coefficient; and the expected conflict term is the product of the expected conflict cost and a preset conflict weighting coefficient. Three preset weighting coefficients are used to adjust the relative importance of different factors, with default values of 0.4, 0.3, and 0.3, respectively. These default values are determined based on a comprehensive consideration of the maintenance depot's operational efficiency and safety.
[0115] The optimization process needs to satisfy constraints, including system dynamic constraints, decision feasibility constraints, and safety constraints. System dynamic constraints describe how the system state evolves with decisions; the system state at the next moment is calculated from the current system state and the decision through a state transition function. Decision feasibility constraints ensure that the allocation decisions meet the capabilities and task requirements of the tracking robot. Safety constraints ensure that the tracking robot's power level, position, and other states remain within safe limits.
[0116] Solving the above optimization problem yields the optimal decision sequence from the current time to the preset prediction time domain. Executing the optimal decision at the current time completes the local task redistribution, resulting in a task allocation scheme.
[0117] For the tracking robots at the boundary of the influence domain, a distributed negotiation mechanism ensures consistency between local adjustments and global task allocation. The reason for using a distributed negotiation mechanism is that local task reassignment only optimizes tracking robots and tasks within the influence domain, while tracking robots at the boundary may have potential path intersections or resource competition with tracking robots outside the domain. Without coordination, the locally adjusted task allocation scheme may conflict with the original plans of tracking robots outside the domain, affecting the coordinated operation of the overall system. The distributed negotiation mechanism, through information exchange and conflict coordination among tracking robots, can resolve potential conflicts at the boundary without global replanning, ensuring consistency between local adjustments and global task allocation. Compared to centralized coordination methods, the distributed negotiation mechanism has better scalability and robustness; the failure of a single tracking robot will not affect the overall negotiation process.
[0118] Specifically, each tracking robot within the influence domain broadcasts its mission intent information to its neighboring tracking robots. This mission intent information includes the planned next mission number, the estimated arrival time at the mission location, and a preview of the planned path. The planned path preview information includes a sequence of coordinates for critical path points, describing the expected trajectory of the tracking robot.
[0119] After receiving the intention information from neighboring robots, the tracking robot calculates the probability of a conflict between them. The conflict probability is the probability that the distance between the two robots will be less than a preset safe distance threshold at a future time. The default value of this preset safe distance threshold is 2 meters, determined based on the physical dimensions and braking distance of the tracking robots, and obtained through kinematic analysis to calculate the minimum safe distance. This probability is calculated using a Monte Carlo simulation method based on path preview information and time estimation. The reason for using the Monte Carlo simulation method is that the actual trajectory of the tracking robot is affected by various uncertainties, including speed fluctuations, positioning errors, and obstacle interference, making it difficult to accurately calculate the conflict probability using analytical methods. The Monte Carlo simulation method approximates the probability distribution through a large number of random samples, effectively handling this uncertainty and obtaining a reliable conflict probability estimate. Specifically, the Monte Carlo simulation uses multiple random samples, adding random perturbations to the motion parameters of the tracking robots in each sample to simulate the uncertainty of actual motion. Then, it counts the frequency at which the distance between the two robots is less than the preset safe distance threshold at each future time, thereby estimating the conflict probability. As the number of samples increases, the estimation results gradually converge to the true conflict probability value.
[0120] When the probability of a conflict exceeds a preset conflict threshold, a conflict coordination mechanism is triggered. The default value of this preset conflict threshold is 0.3, which is determined based on the system's tolerance for conflict risk. By analyzing the probability distribution of historical conflict events, a threshold level that can effectively prevent the vast majority of actual conflicts is selected. The coordination rules include: if two tracking robots have different priorities, the tracking robot with lower priority adjusts its path or waiting time to allow the tracking robot with higher priority to pass first; if two tracking robots have the same priority, the priority order is determined according to the tracking robot number or remaining battery power, with the tracking robot with the smaller number or lower battery power passing first.
[0121] Through the aforementioned distributed negotiation, it is ensured that task adjustments at the boundary of the influence domain will not conflict with the orbital patrol robot outside the domain, thus guaranteeing the overall operational coordination.
[0122] Step 500: Construct a spatiotemporal graph based on the task allocation scheme and predict the conflict probability of each node, and generate an active obstacle avoidance path according to the conflict probability.
[0123] First, a spatiotemporal graph is constructed. The reason for using a spatiotemporal graph as the basic data structure for path planning is that path conflicts in multi-robot collaborative inspection scenarios are not only related to spatial location but also closely related to time factors. Two robots passing through the same spatial location but arriving at different times will not cause a conflict; however, arriving at similar locations at similar times may lead to a conflict. By unifying the time and spatial dimensions, the spatiotemporal graph can accurately describe the movement trajectory of the robots in spacetime, providing a complete information foundation for conflict prediction and path planning. Compared to traditional path planning methods that only consider spatial location, the spatiotemporal graph-based method can more accurately identify and avoid potential conflicts, improving the safety and efficiency of multi-robot collaborative operation. The spatiotemporal graph consists of a set of nodes and a set of edges. Each node in the node set represents a spatiotemporal location, i.e., the spatial location at a specific point in time, uniquely identified by a combination of spatial coordinates and a timestamp. Each edge in the edge set represents a feasible spatiotemporal transition, connecting reachable location nodes at adjacent time steps, indicating that the robot can move from one spatiotemporal location to another.
[0124] Each node is assigned an initial feature vector, including its spatial coordinates, the corresponding time point, the robot ID occupying that location, the robot's velocity vector at that location, and the encoded vector of relevant task information. These elements are chosen as node features because spatial coordinates and time point are fundamental attributes of spatiotemporal nodes, used to locate their position in the spatiotemporal graph; the robot ID identifies the specific robot occupying the location, providing crucial information for conflict assessment; the velocity vector reflects the robot's motion state, aiding in predicting its subsequent spatiotemporal trajectory; and the encoded vector describes the task the robot is performing, helping to understand its purpose and priority. These elements collectively describe the complete state information of that spatiotemporal location, providing sufficient input features for subsequent conflict probability prediction.
[0125] Based on the initial feature vectors of nodes, a probabilistic prediction model is used to predict the conflict probability of each node. This model relies on a graph neural network (Graph Neural Network) to predict the conflict probability of each node in a spatiotemporal graph. The reason for using a Graph Neural Network is that spatiotemporal graphs have complex topological structures, with nodes connected by edges to form a network. Traditional neural networks struggle to effectively handle this type of graph data. Graph Neural Networks, through message passing mechanisms, can aggregate feature information from neighboring nodes and learn the relationships between nodes, thereby capturing local and global patterns in the spatiotemporal graph. In the conflict probability prediction task, the conflict risk of a spatiotemporal node depends not only on its own features but also on the states of its neighboring nodes. Graph Neural Networks can effectively model this spatial dependency, improving the accuracy of conflict probability prediction.
[0126] The training steps of the graph neural network are as follows. First, a training dataset is constructed from the historical operation data of the maintenance depot. Each training sample includes a spatiotemporal graph at a certain moment and the actual conflict labels of each node. The conflict labels indicate whether an actual conflict occurred at that spatiotemporal node in a subsequent time. Then, the node features in the spatiotemporal graph are standardized, mapping each dimension of the features to the same value range. Next, the structure of the graph neural network is designed. The network includes multiple graph convolutional layers. Each graph convolutional layer updates the representation of the current node by aggregating the features of neighboring nodes. Finally, the predicted conflict probability value of each node is output through a fully connected layer. During training, the binary cross-entropy loss function is used to measure the difference between the predicted conflict probability and the actual conflict label, and the adaptive moment estimation optimization algorithm is used to iteratively update the network parameters. Since conflict events are relatively rare in actual operation, there is a class imbalance problem in the training data. Therefore, class weights are introduced into the loss function to give higher weights to conflict samples, making the network pay more attention to the prediction of conflict events. The training process continues until the prediction performance on the validation set converges. At this point, the network parameters are saved for actual conflict probability prediction.
[0127] Based on the conflict probabilities of each spatiotemporal node, path segments with high conflict probabilities are replanned, and the multi-objective A-square algorithm is used to generate active obstacle avoidance paths. The reason for using the A-square algorithm as the foundational algorithm for path planning is that it is a heuristic search algorithm that guides the search direction by combining actual path costs and heuristically estimated costs. This significantly reduces the search space and improves path planning efficiency while ensuring the optimal path is found. Compared to breadth-first search and Dijkstra's algorithm, the A-square algorithm has higher search efficiency; compared to greedy best-first search, the A-square algorithm guarantees finding the optimal solution. In the real-time path planning scenario of the maintenance depot, the A-square algorithm can generate high-quality path solutions in a short time, meeting the rapid response requirements of the track-inspection robot.
[0128] This step extends the traditional A* algorithm by introducing a conflict probability penalty term and a path smoothness score into the evaluation function. The conflict probability penalty term is introduced because the traditional A* algorithm only considers path length or time cost and cannot actively avoid potential conflict areas. By adding the conflict probability as a penalty term to the evaluation function, the algorithm automatically tends to select nodes with lower conflict probabilities during path search, thus generating paths that actively avoid high-conflict-risk areas. The path smoothness score is introduced because the motion performance of a tracking robot is physically limited; frequent sharp turns increase energy consumption, reduce motion stability, and may even lead to the accumulation of positioning errors. By penalizing sharp turns in the evaluation function, the algorithm tends to generate paths with gentler turns, which is beneficial for the smooth operation and accurate positioning of the tracking robot. The extended evaluation function is defined as the sum of the path cost term, the estimated cost term, the conflict probability penalty term, and the path smoothness score term. The path cost term is the actual path cost from the starting point to the current node, including the travel distance and time consumption. The estimated cost term is a heuristic estimate of the cost from the current node to the destination, calculated using Euclidean distance, used to guide the search direction towards the target. The conflict probability penalty term is the conflict probability of the current node multiplied by a preset conflict avoidance weight coefficient. The higher the conflict probability, the larger this component, causing the algorithm to tend to avoid high-conflict areas. The default value of this preset conflict avoidance weight coefficient is 10, which is determined based on the principle of prioritizing path safety. Through path planning experiments with different weights, a weight value that can effectively avoid high-conflict areas without excessively increasing the path length was selected. The path smoothness score term is the path smoothness score multiplied by a preset path smoothness weight coefficient, used to control the smoothness of the path. The default value of this preset path smoothness weight coefficient is 0.5, which is determined based on the motion performance constraints of the track-following robot, obtained by analyzing the turning ability and motion stability requirements of the track-following robot.
[0129] The path smoothness score is calculated by summing the absolute values of the differences between all adjacent direction angles along the path from the starting point to the current node. The direction angle represents the forward direction of the path at each node. A larger difference between adjacent direction angles indicates a more abrupt path turn, resulting in a higher smoothness score but also a higher cost. Introducing a smoothness score encourages the algorithm to generate paths with gentler turns, which is beneficial for the smooth operation of the tracking robot.
[0130] The multi-objective A* algorithm is executed to generate an active obstacle avoidance path, including the optimal path from the current position to the target task position generated by the tracking robot. This path actively avoids high-collision-probability areas and maintains path smoothness while ensuring arrival efficiency, achieving safe and efficient path planning.
[0131] By cyclically executing steps 100 to 500 above, this invention realizes dynamic task allocation optimization for collaborative inspection of multiple track-cruising robots in a railcar maintenance depot. It can quickly respond to environmental changes and abnormal events, and significantly reduce computation time while ensuring allocation quality.
[0132] Example 2
[0133] See Figure 4 As shown, a multi-task collaborative inspection optimization system based on a track-following robot is provided. This system stores computer-readable instructions, which, when read, can execute the aforementioned multi-task collaborative inspection optimization method based on a track-following robot. The system includes:
[0134] Information fusion module 101 collects real-time status information and task status information of multiple track-tracing robots and constructs a set of capability vectors, and calculates the risk score of each track-tracing robot based on the status information;
[0135] The scenario classification module 102 classifies scenarios based on the risk score to obtain scenario types, and performs spatial clustering of the tasks to be assigned based on the scenario types and task status information to obtain task clusters.
[0136] The global allocation module 103 performs global task allocation when the scenario type is a global replanning scenario. The global task allocation constructs a capability requirement matching degree matrix based on the capability vector set and the task cluster, and solves the matching scheme between the track-crawling robot and the task cluster. Based on the matching scheme, it performs fine-grained allocation of specific tasks within the task cluster to obtain a task allocation scheme.
[0137] The local allocation module 104 performs local task reassignment when the scenario type is a local adjustment scenario. The local task reassignment includes identifying abnormal track-following robots and calculating their influence domain, and reassigning track-following robots and tasks within the influence domain to obtain a task allocation scheme.
[0138] The conflict prediction module 105 constructs a spatiotemporal graph based on the task allocation scheme and predicts the conflict probability of each node, and generates an active obstacle avoidance path according to the conflict probability.
[0139] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A multi-task collaborative inspection optimization method based on a track-following robot, characterized in that, Includes the following steps: Collect real-time status and task status information of multiple track-following robots and construct a set of capability vectors. Calculate the risk score of each track-following robot based on the status information. Based on the risk score, scenario classification is performed to obtain scenario types. Then, based on the scenario types and task status information, spatial clustering is performed on the tasks to be assigned to obtain task clusters, including: The maximum risk score is calculated from the risk scores of all the tracking robots. The scenario type is then determined based on this maximum risk score. Scenario types include steady-state scenarios, local adjustment scenarios, and global replanning scenarios. When the maximum risk score is less than a preset steady-state threshold, the current scenario type is determined to be a steady-state scenario, and the currently assigned task continues to be executed. When the maximum risk score is greater than or equal to the preset steady-state threshold but less than the preset global replanning threshold, the current scenario type is determined to be a local adjustment scenario. When the maximum risk score is greater than or equal to the preset global replanning threshold, the current scenario type is determined to be a global replanning scenario. When the scenario type is a global replanning scenario, global task allocation is performed. The global task allocation constructs a capability requirement matching degree matrix based on the capability vector set and task cluster, and solves the matching scheme between the track-following robot and the task cluster. Based on the matching scheme, the tasks within the task cluster are allocated in a fine-grained manner to obtain the task allocation scheme. When the scenario type is a local adjustment scenario, local task reassignment is performed. Local task reassignment includes identifying abnormal track-following robots and calculating their influence domain, and reassigning track-following robots and tasks within the influence domain to obtain a task allocation scheme. Based on the task allocation scheme, a spatiotemporal graph is constructed and the conflict probability of each node is predicted. An active obstacle avoidance path is then generated based on the conflict probability.
2. The multi-task collaborative inspection optimization method based on a track-following robot according to claim 1, characterized in that, The risk score for each tracking robot is calculated based on the aforementioned status information, including: The status information of multiple tracking robots is combined into a status set, which includes position coordinates, remaining battery percentage, current moving speed, currently executing task number, task completion progress, and health status score. Collect task status information corresponding to all tracks to form a task status set; Construct a set of capability vectors, which includes multiple capability vectors; For each track-following robot, a historical state window is constructed, and the historical state window is input into a long short-term memory network to calculate the abnormal probability of the track-following robot in the future predicted time period. The abnormal probability includes the probability of low battery and the probability of timeout. The risk score of the track-following robot is calculated based on the anomaly probability. The risk score is obtained by weighted summation of the low battery probability, timeout probability, and the complement of the track-following robot's health status score.
3. The multi-task collaborative inspection optimization method based on a track-following robot according to claim 2, characterized in that, Task status information includes track number, task status, task priority, task complexity score, and task deadline; The capability vector of the track-following robot includes sensing accuracy score, mobility score, endurance score, computing power score, and professional function vector, which represents the detection functions possessed by the track-following robot. The historical state window includes a continuous sequence of state information from past time t to the current time, and the window length is the preset number of historical observation steps.
4. The multi-task collaborative inspection optimization method based on a track-following robot according to claim 1, characterized in that, Based on the risk score, scenario classification is performed to obtain scenario types. Then, based on the scenario types and task status information, spatial clustering is performed on the tasks to be assigned to obtain task clusters, including: When a global replanning scenario is identified, all tasks in the pending assignment state are selected from the task state set to form a pending task set. An improved K-means clustering algorithm is used to divide the set of tasks to be assigned into a preset number of task clusters. The optimization objective of the improved K-means clustering algorithm is to minimize the sum of the comprehensive biases within all task clusters. For each task cluster, the overall deviation is the sum of the distance term and the priority term. The distance term is the sum of the squares of the Euclidean distances from each task position within the task cluster to the center position of the task cluster. The priority term is the sum of the absolute values of the differences between the task priorities of each task within the task cluster and the average task priority of the task cluster, multiplied by a preset spatial priority balance coefficient. Multiple task clusters and their corresponding spatial center coordinates were obtained through iterative optimization.
5. The multi-task collaborative inspection optimization method based on a track-following robot according to claim 1, characterized in that, Based on the matching scheme, a fine-grained task allocation scheme is obtained by allocating tasks within a task cluster, including: For each task cluster, calculate its demand vector, the dimension of which is the same as the capability vector of the track-following robot; Construct a capability requirement matching degree matrix, where each element in the capability requirement matching degree matrix represents the matching degree between the corresponding track-following robot and the corresponding task cluster; The Hungarian algorithm is used to solve the matching scheme between the track-following robot and the task cluster based on the capability requirement matching degree matrix. The optimization objective is to maximize the sum of the matching degrees of all matching pairs. The matching scheme includes the task clusters that each track-following robot is responsible for. Based on a deep Q-network and a matching scheme, the task allocation decision is repeatedly executed, and the allocation scheme with the highest expected cumulative reward function value in the current state is selected until all tasks in the task cluster have been allocated, thus obtaining the task allocation scheme.
6. The multi-task collaborative inspection optimization method based on a track-following robot according to claim 5, characterized in that, The matching degree is the capability matching term plus the distance component term. The capability matching term is the capability matching component multiplied by a preset capability weight coefficient, and the distance component term is the distance component multiplied by a preset distance weight coefficient. The capability matching component is obtained by calculating the cosine similarity between the track-following robot's capability vector and the task cluster's requirement vector and linearly mapping it to the range of zero to one. The distance component is obtained by calculating the Euclidean distance from the track-following robot's current position to the center of the task cluster space, normalizing it, and then subtracting the normalized distance value from one. The state space of a deep Q-network includes the current state set of the tracking robot, the set of unassigned tasks within the current task cluster, and the historical assignment history of completed tasks. The action space of a deep Q-network includes all possible task assignment actions, each action representing assigning an unassigned task to the track-following robot; The reward function of the deep Q network is the sum of the time term, the conflict risk term, the energy consumption term, and the matching term. The time term is the negative value of the total completion time increment caused by the execution of the assigned action multiplied by the preset time penalty weight coefficient. The conflict risk term is the negative value of the estimated conflict risk value multiplied by the preset conflict penalty weight coefficient. The energy consumption term is the negative value of the expected energy consumption of each traversing robot performing the task multiplied by the preset energy consumption penalty weight coefficient. The matching term is the matching degree multiplied by the preset matching reward weight coefficient.
7. The multi-task collaborative inspection optimization method based on a track-following robot according to claim 1, characterized in that, The task allocation scheme for reallocating the orbit-following robots and tasks within the influence domain includes: Iterate through the risk scores of all track-following robots and identify those with risk scores greater than or equal to a preset steady-state threshold as abnormal track-following robots. For each abnormal track-following robot, its influence domain is calculated. The influence domain includes track-following robots whose spatial location is less than the preset influence radius, as well as track-following robots whose current task has a dependency relationship or resource conflict with the task of the abnormal track-following robot. The criterion for judging that the spatial location is closer to the abnormal track-following robot is that the Euclidean distance between the two track-following robots is less than the preset influence radius. A rolling time-domain optimization method is used to redistribute the tracking robot and tasks within the influence domain. The goal of rolling time-domain optimization is to minimize the cumulative cost from the current time to the preset prediction time domain. The cumulative cost is the sum of the stage cost term and the decision smoothing term. The stage cost term is the sum of the stage costs at each time. The decision smoothing term is the sum of the norm of the decision change at adjacent time times multiplied by the preset smoothing weight coefficient. The stage cost is the sum of the expected time term, the expected energy consumption term, and the expected conflict term. The expected time term is the expected task completion time multiplied by the preset time weight coefficient. The expected energy consumption term is the expected energy consumption multiplied by the preset energy consumption weight coefficient. The expected conflict term is the expected conflict cost multiplied by the preset conflict weight coefficient. The optimization process satisfies constraints, including system dynamic constraints, decision feasibility constraints, and security constraints. Solving the optimization problem yields the optimal decision sequence from the current time to the preset prediction time domain. Executing the optimal decision at the current time completes the local task redistribution, resulting in a task allocation scheme.
8. The multi-task collaborative inspection optimization method based on a track-following robot according to claim 1, characterized in that, Generating an active obstacle avoidance path based on the conflict probability includes: Construct a spatiotemporal graph, which consists of a set of nodes and a set of edges. Each node in the set of nodes represents a spatiotemporal location, and each edge in the set of edges represents a feasible spatiotemporal transition. Set the initial feature vector for each node, including the spatial coordinates of the node, the time point of the node, the number of the track-following robot occupying the spatiotemporal position, the velocity vector of the track-following robot at that spatiotemporal position, and the encoding vector of the corresponding task information. Based on the initial feature vectors of the nodes, a probabilistic prediction model is used to predict the conflict probability of each node. Based on the conflict probability of each node, an active obstacle avoidance path is generated.
9. A multi-task collaborative inspection optimization system based on a track-following robot, characterized in that, It is used to implement a multi-task collaborative inspection optimization method based on a track-following robot as described in any one of claims 1-8, the system comprising: The information fusion module collects real-time status and task status information of multiple track-tracing robots and constructs a set of capability vectors. Based on the status information, it calculates the risk score of each track-tracing robot. The scenario classification module classifies scenarios based on the risk score to obtain scenario types, and performs spatial clustering of the tasks to be assigned based on the scenario types and task status information to obtain task clusters. The global allocation module performs global task allocation when the scenario type is a global replanning scenario. The global task allocation constructs a capability requirement matching degree matrix based on the capability vector set and the task cluster, and solves the matching scheme between the track-following robot and the task cluster. Based on the matching scheme, the tasks within the task cluster are allocated in a fine-grained manner to obtain the task allocation scheme. The local allocation module performs local task reassignment when the scenario type is a local adjustment scenario. Local task reassignment includes identifying abnormal track-following robots and calculating their influence domain, and reassigning track-following robots and tasks within the influence domain to obtain a task allocation scheme. The conflict prediction module constructs a spatiotemporal graph based on the task allocation scheme and predicts the conflict probability of each node, and generates an active obstacle avoidance path based on the conflict probability.