A medical image multi-agent task scheduling method based on a priority-aware cross-attention mechanism

By explicitly modeling task priority semantics and competition relationships through a priority-aware cross-attention mechanism, the coordination problem of multi-priority task scheduling in heterogeneous GPU clusters is solved, which realizes the timeliness guarantee of emergency tasks and the waiting control of urgent tasks, and improves the overall scheduling quality of medical imaging tasks.

CN122507484APending Publication Date: 2026-08-04SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
Filing Date
2026-07-06
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Traditional scheduling algorithms struggle to dynamically coordinate tasks of different priorities in heterogeneous GPU clusters, leading to delays in emergency tasks, timeouts in urgent tasks, and long wait times for routine tasks. Existing multi-agent reinforcement learning methods lack explicit modeling of task priority information, making it difficult to meet the differentiated service quality requirements of medical image inference scenarios.

Method used

A multi-agent task scheduling method based on priority-aware cross-attention mechanism is adopted. By explicitly modeling the semantics of task priorities and competition relationships, and combining heterogeneous GPU resource constraints, dynamic task scheduling is achieved, thereby improving the overall scheduling efficiency and service quality of multi-priority tasks.

Benefits of technology

It improved the timeliness of emergency tasks, controlled waiting times for urgent tasks, and increased the completion rate of routine tasks, thereby enhancing the overall scheduling quality and resource utilization of medical imaging tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122507484A_ABST
    Figure CN122507484A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of medical image multi-agent task scheduling method based on priority perception cross attention mechanism, belong to computing resource management and task scheduling technical field, including: medical image inference task and heterogeneous GPU resource state modeling;Candidate task set screening and agent local observation construction;Candidate task priority perception representation construction;Based on cyclic state and candidate pointer scoring mechanism action value estimation;Multi-agent collaborative scheduling execution;Centralized training optimization.The present application is explicitly modeled by the competition relationship between the task priority semantics and different priority tasks, combined with heterogeneous GPU resource constraints and multi-agent collaborative decision-making, realizes the dynamic task scheduling for medical image inference scene, so as to improve the overall scheduling efficiency and service quality of multi-priority task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a multi-agent task scheduling method for medical imaging based on a priority-aware cross-attention mechanism, belonging to the field of computing resource management and task scheduling technology. Background Technology

[0002] With the widespread adoption of smart healthcare, medical imaging technologies such as X-ray, CT, MRI, and ultrasound are rapidly developing, generating a large amount of image data in hospitals every day that requires intelligent analysis and processing. To improve clinical diagnostic efficiency, hospitals typically deploy online medical imaging AI inference platforms, utilizing underlying heterogeneous GPU clusters to perform diverse inference tasks such as classification, detection, and segmentation on image data from clinical workflows.

[0003] In real-world medical scenarios, different GPU nodes vary in computing speed, memory capacity, and concurrent processing capabilities, and each GPU node is simultaneously constrained by both memory capacity and concurrent slot availability. Furthermore, medical image inference tasks have different priority categories and differentiated quality of service requirements. Tasks can typically be categorized into emergency tasks, urgent tasks, and routine tasks, each corresponding to different timeliness constraints: emergency tasks have the strictest timeliness requirements and need to be responded to first; urgent tasks have clear deadline constraints and need to ensure reasonable waiting times; routine tasks have relatively lower time sensitivity and can be appropriately delayed under high system load, but a certain task completion rate still needs to be guaranteed.

[0004] Traditional heuristic scheduling algorithms typically rely on pre-defined static rules and lack the ability to adaptively balance tasks under dynamic load environments. When faced with complex scenarios involving heterogeneous nodes with varying computing power, high-concurrency task arrivals, and the coexistence of multiple priority tasks, these methods struggle to achieve dynamic coordination between tasks of different priorities, easily leading to problems such as delays in emergency tasks, timeouts for urgent tasks, and long waiting times for routine tasks. While some existing scheduling methods based on multi-agent reinforcement learning can learn scheduling strategies in dynamic environments, their utilization of task priority information is relatively coarse. They typically lack explicit modeling of the distribution characteristics, competitive relationships, and priority semantics among tasks of different priorities, thus failing to fully meet the differentiated service quality requirements of multiple priority tasks in medical scenarios.

[0005] Therefore, there is a need for a multi-agent task scheduling method for medical imaging that can explicitly perceive task priority semantics, characterize the competitive relationship between tasks with different priorities, and is applicable to scenarios with heterogeneous GPU concurrent resource constraints, in order to improve task processing efficiency and service quality, and improve the overall scheduling effect of the system. Summary of the Invention

[0006] The purpose of this invention is to address the challenge of balancing the timeliness of emergency tasks, the control of waiting time for urgent tasks, and the completion rate of regular tasks in the scheduling of multi-priority inference tasks for medical images in heterogeneous GPU cluster environments. This invention proposes a multi-agent task scheduling method for medical images based on a priority-aware cross-attention mechanism. This method explicitly models the semantics of task priorities and the competitive relationships between tasks of different priorities. Combined with heterogeneous GPU resource constraints and multi-agent collaborative decision-making, it achieves dynamic task scheduling for medical image inference scenarios, thereby improving the overall scheduling efficiency and service quality of multi-priority tasks.

[0007] The present invention adopts the following technical solution:

[0008] A multi-agent task scheduling method for medical imaging based on a priority-aware cross-attention mechanism includes:

[0009] S1 models the medical image inference task and heterogeneous GPU nodes, and establishes a unified state description of task attributes, resource constraints and task execution timing indicators.

[0010] S2, select a set of candidate tasks from the waiting task queue, and construct local observations by combining the unified state description in step S1, so as to transform the dynamic environment input into a structured representation that can be processed by the neural network.

[0011] S3. Based on the local observations in step S2, priority semantic embedding and encoding are performed on the candidate tasks to construct priority context representations, and enhanced representations of the candidate tasks are generated through a priority-aware cross-attention mechanism.

[0012] S4. Based on step S3, the candidate pointer scoring mechanism is used to calculate the action value of idle actions and candidate task actions respectively, and the action value vector is output.

[0013] S5 generates joint actions based on the output actions of each intelligent agent, and completes task allocation and environmental state update through conflict resolution and resource constraint verification.

[0014] S6 constructs a joint value function under the framework of centralized training and decentralized execution, and performs closed-loop updates of policy network parameters through the temporal difference loss function to obtain a multi-agent scheduling policy for online execution.

[0015] Preferably, in step S1, the heterogeneous GPU node set is denoted as ,in, Indicates the number of GPU nodes. Indicates the first Each GPU node Corresponding to an intelligent agent ;No. GPU nodes At any moment The original resource state is represented as follows:

[0016]

[0017] in, Indicates at time Next GPU node Available video memory; Indicates at time Next GPU node The utilization rate of video memory; Indicates at time Next GPU node The number of concurrent slots already occupied; Indicates GPU node The computational speed; Indicates at time Next GPU node The remaining processing time statistics for the currently running tasks;

[0018] Let the set of medical image reasoning tasks be denoted as... Any task Functions based on task attributes: ;in, Indicates task priority; Indicates the task's video memory requirements; This indicates the estimated processing time of the task on the benchmark GPU node; Indicates the time when the task arrives; Indicates the relative deadline for the task;

[0019] When the task Assigned to GPU node At that time, the following resource constraints are satisfied: ,in, Indicates GPU node The maximum number of concurrent slots;

[0020] Task priority satisfied , This indicates the total number of task priority categories. They are categorized into emergency diagnostic tasks, urgent tasks, and routine tasks, respectively.

[0021] Task At any moment The remaining deadline is defined as follows: ;

[0022] Considering the difference in computing speed between heterogeneous GPU nodes, let For nodes Compared to the computing speed of a benchmark GPU node, the processing time is approximately inversely proportional to the speed factor, thus the task... Assigned to GPU nodes The estimated processing time is defined as follows: .

[0023] Preferably, in step S2, at each scheduling time First, a set of candidate tasks is selected from the current waiting task queue. Let time be... The waiting task queue below for:

[0024]

[0025] From the waiting task queue The middle selects the first according to the preset sorting rules. For each task, construct a candidate task set. :

[0026]

[0027] Among them, candidate tasks This corresponds to a specific task in the waiting task queue;

[0028] Set candidate tasks The corresponding original task is Then we have: , , ,in Priority category for the original task; For the original task at the scheduling time The remaining deadline; For the original task on the GPU node Estimated processing time;

[0029] Constructing candidate tasks Relative to GPU nodes candidate task feature vectors ,in Indicates the GPU node or agent number. Indicates the agent at time... The observed first One candidate position;

[0030] Candidate task feature vector This includes information such as normalized task priority, estimated processing time, task memory requirements, remaining deadline, time margin, and candidate ranking position, among which candidate tasks... Relative to GPU nodes time margin Defined as: In the formula, Indicate candidate tasks On GPU nodes Estimated processing time;

[0031] For GPU nodes Construct a normalized local resource state vector based on the original resource state. :

[0032]

[0033] in, , This represents the total video memory capacity of the node, calculated by dividing the currently available video memory by the total video memory capacity of the node. , Maximum video memory; , This represents the maximum concurrent slot limit for a node. , The computing speed of the fastest node in the cluster; : A binary representation of the node's current busy state Indicates free time. Indicates busy;

[0034] To provide each agent with an overview of global load and priority distribution, a shared statistical feature vector of the waiting queue is constructed. This includes statistical information such as the number of waiting tasks with different priorities and their time progress;

[0035] No. A smart agent At any moment Local observation Defined as candidate task feature vector Normalized local resource state vector Statistical feature vectors of waiting queues splicing:

[0036] .

[0037] Preferably, the sorting rule preset in step S2 is the earliest deadline priority sorting rule, and sorting is performed according to the task's relative deadline or the current remaining deadline.

[0038] This is the preset size of the candidate task set, i.e., the maximum number of candidate tasks that each agent can observe at each scheduling time. The specific value can be set according to the system scale and experimental configuration. For example, in this invention… That is, the first 8 candidate tasks are selected from the waiting queue to form a candidate task set. ;

[0039] If the current number of waiting tasks is less than If the candidate positions are insufficient, zero-filling is used to fill in the missing parts to ensure that the local observation dimension remains consistent.

[0040] For invalid candidate positions formed by zero-padding, a validity mask is used to identify them to avoid interference from invalid candidates in subsequent candidate aggregation and attention calculation; let the... The validity mask for each candidate position is: , This indicates that the candidate position is valid. This indicates that the candidate position is a fill position.

[0041] Preferably, in step S3, each GPU node intelligent agents A priority-aware candidate task decision network is constructed. This network first performs priority semantic embedding and candidate task encoding on the candidate task features, and performs context encoding on the local resource status and queue statistical features. Then, priority context representation is constructed according to the priority category of the candidate task, and enhanced candidate task representation is obtained through a priority-aware cross-attention mechanism.

[0042] For the A smart agent At any moment Candidate task feature vectors , , The dimension of the candidate task feature vector is represented. Represents the set of real numbers;

[0043] To enhance the model's ability to represent differences in tasks with multiple priorities, a learnable priority embedding matrix is ​​constructed. ,in, Indicates the priority embedding dimension;

[0044] For candidate tasks Priority of corresponding tasks The priority embedding vector is obtained by querying the priority embedding matrix: ;

[0045] Subsequently, the candidate task feature vectors With priority embedding vector The input representations of the candidate tasks are then fused to obtain the enhanced input representations: And will enhance the input representation of the input candidate task encoding network. Obtain the initial encoded representation of the candidate task: In the formula, , Indicates the hidden dimension of the candidate task;

[0046] Therefore, the initial encoding representation of all candidate tasks is as follows:

[0047]

[0048] in Indicates the first An intelligent agent at time Next, the The initial encoded representation obtained after encoding each candidate task by the candidate task encoding network Enc(·) is marked with a superscript "0" to distinguish it as an initial encoding without cross-attention enhancement, different from the enhanced representation obtained in step S3. ;

[0049] Meanwhile, the normalized local resource state vector in local observations and waiting queue statistical feature vector Perform context encoding to obtain the first A smart agent At any moment Local context representation: ,in Represents a context encoding network;

[0050] For the A smart agent At any moment Candidate task set The initial encoding representations of candidate tasks are grouped according to the priority category of the corresponding tasks; for any priority category... The corresponding set of candidate task indices is denoted as: ;

[0051] For priority categories The corresponding candidate task aggregation representation Defined as:

[0052]

[0053] Define priority categories The normalized value of the number in the current candidate set is:

[0054]

[0055] Priority aggregation representation Local context representation and quantity normalization value The network is constructed by splicing the components and using priority context. The mapping yields a priority context vector:

[0056]

[0057] To enhance the discriminability between context representations of different priorities, a learnable priority type embedding vector is introduced for each priority category. By querying the priority type embedding matrix Obtain the priority type embedding vector The priority type embedding matrix is ​​obtained through end-to-end training, with each row being a priority type embedding vector corresponding to the priority category. ;

[0058] The priority context representation can be obtained as follows:

[0059]

[0060] All priority context representations are combined into a priority context matrix: .

[0061] Furthermore, the query input of the priority-aware cross-attention mechanism is the initial encoded representation of the candidate task, and the key and value inputs are priority context representations constructed based on the priority categories of the candidate tasks. Based on the computation of the priority-aware cross-attention mechanism, the cross-attention output representation of the candidate task is obtained. :

[0062]

[0063] For the scaled dot product cross attention mechanism, where For query. For keys and values; This is the standard exponential normalization function, which is independently normalized for each row;

[0064] Cross-attention output representation for:

[0065]

[0066] for The OK;

[0067] Based on local context representation Constructing gate vectors : In the formula, This represents the Sigmoid function. and For learnable parameters, , ,in Embed dimensions for local contexts. The hidden representation dimension for the candidate task. Both parameters are learnable and obtained through end-to-end optimization via backpropagation;

[0068] The gated cross-attention output is residually fused and normalized with the initial encoded representation of the candidate task to obtain the enhanced representation of the candidate task. All candidate task enhancement representations are combined as .

[0069] Preferred candidate task coding network It is a two-layer fully connected feedforward neural network (MLP), with the following structure:

[0070]

[0071] Among them, input This involves concatenating the candidate task feature vector with the priority embedding vector; the first layer of the feedforward neural network maps the input to the hidden dimension. ,through After activation, the output dimension of the second-layer feedforward neural network is also [missing value]. The initial encoding representation of the candidate task is obtained. ; , , , All of these represent learnable parameters. , ,in The dimension of the candidate task feature vector is... Priority embedding dimension; Learnable parameters , , , All of these were obtained through automatic optimization via backpropagation.

[0072] The context encoding network also uses a two-layer fully connected feedforward neural network structure:

[0073]

[0074] The input is a normalized local resource state vector. and queue statistical feature vector The concatenation outputs a local context embedding. ; , , , All of these represent learnable parameters. , ,in The input dimension is the concatenation of the normalized local resource state vector and the waiting queue statistical feature vector. Embed dimensions for local contexts; Learnable parameters , , , It is obtained through automatic optimization via backpropagation.

[0075] Priority context construction network A two-layer fully connected feedforward neural network structure is adopted:

[0076]

[0077] The input is the aggregated representation of candidate task priorities. Local context representation and quantity normalization value The concatenation of these elements outputs a priority context vector. The two-layer fully connected structure of this network is a common existing technology; the specific design of its input features and their application as key-value inputs in the cross-attention mechanism are the innovative components of this invention. , , , The priority context vector dimension; learnable parameters , , , It is obtained through automatic optimization via backpropagation.

[0078] Preferably, the implementation process of step S4 is as follows:

[0079] First, regarding the first A smart agent At any moment All candidate task enhancement representation combination Aggregate the candidate sets to form a summary vector. :

[0080]

[0081] in, Indicates the first A validity mask for each candidate position; Indicates the number of valid candidate tasks;

[0082] Then, the candidate set summary vector With local context representation By concatenating the inputs, we obtain the cyclic state update input. Update the input to change the loop state. Feed into the recurrent neural network; let the first... An intelligent agent at time The hidden state is Then the updated time is obtained through the recurrent neural network. The hidden state is represented as: , This represents a gated loop unit, used to update the current hidden state based on the current input and the hidden state at the previous time step;

[0083] Based on the updated hidden state Calculate the action value of idle actions and candidate task actions respectively;

[0084] For idle actions Its action value is expressed as: ,in, The idle action value mapping function is a single-level linear transformation:

[0085]

[0086] in, For learnable parameters, Hidden state Mapped to a scalar idle action value, belonging to the linear layer in the prior art, the design choice of this invention makes the idle action value correlated with the system load state (implied in...). Adaptive association;

[0087] For candidate task actions First, the hidden state Mapping to the same latent space as the candidate task representation yields the candidate query vector: ,in, The learnable parameter matrix is ​​obtained through backpropagation optimization during end-to-end training.

[0088] The candidate pointer scoring mechanism is used to calculate the first Action value of each candidate task action: ;

[0089] Therefore, the first An intelligent agent at time The action value vector is represented as: ;

[0090] During the execution phase, the first Each agent determines the scheduling action based on the action value vector and the set of available actions. ,in, Indicates the first An intelligent agent at time The set of possible actions.

[0091] Preferably, the set of possible actions includes two types of actions: idle actions ( ) and candidate task actions ( (Idle actions are always selectable); candidate task actions must simultaneously satisfy: ① Validity mask ② The free video memory of the GPU node satisfies ③ Concurrent slots satisfy .

[0092] Preferably, the implementation process of step S5 is as follows:

[0093] At each scheduling time Each agent is based on its own local observations. Output scheduling action Thus forming a joint action ;like , indicating the first An agent chooses an idle action at this moment; if , indicating the first Each agent selects a set of candidate tasks. The first in Candidate tasks ;

[0094] When multiple agents select the same candidate task, conflict resolution is performed; let the candidate task be... Selected agent index set for:

[0095]

[0096] when At that time, conflict resolution rules based on action value are adopted from the set The agent with the highest action value is selected as the sole winning agent, and the selection of the other agents in this instance is recorded as unsuccessful.

[0097] Set candidate tasks The corresponding original task is After the conflict is resolved, the intelligent agent Successfully selected candidate task Further verification is needed to determine if the GPU node requirement is met. Resource constraints: ;

[0098] If resource constraints are met, then candidate tasks will be... The corresponding task is submitted to the GPU node. Execute and update the GPU node's memory usage status, slot usage status, and task running status; if resource constraints are not met, record the action as invalid allocation;

[0099] During task execution, the environment generates reward signals based on task completion status, waiting status, constraint satisfaction status, and service quality indicators at termination. .

[0100] Preferably, the implementation process of step S6 is as follows:

[0101] During the training phase, each agent shares the policy network parameters and optimizes the multi-agent cooperative scheduling behavior through a joint value function, which is expressed as:

[0102]

[0103] in, Indicates time The global state is composed of the resource status of each GPU node, task queue statistics, and system running status. Indicates a global coordinated action; Indicates the first The action value of an agent for a selected action; Represents the joint value mixing function;

[0104] The joint value function satisfies the monotonicity constraint relative to the individual action value functions of each agent:

[0105]

[0106] in, Indicates the value of joint actions; Indicates the first The value of an individual action of an intelligent agent;

[0107] The training objective is constructed using temporal difference learning based on the target network, and the temporal difference error is used as the optimization signal to improve training stability. The training objective of the policy network is to minimize the temporal difference loss function. :

[0108]

[0109] in, The target value is represented as , This indicates the network parameters to be optimized; Represents the mathematical expectation; Indicates the discount factor; This represents the joint value function corresponding to the target network, which is used to provide a relatively stable evaluation benchmark when calculating the target value, thereby reducing training oscillations and improving convergence;

[0110] During the execution phase, each agent only needs to base its observations on its own local observations. It can output actions independently without needing to obtain local observation information from other agents, thus meeting the real-time decision-making requirements in real-world heterogeneous GPU distributed scheduling scenarios.

[0111] For any details not covered in this invention, please refer to the prior art.

[0112] The beneficial effects of this invention are as follows:

[0113] 1. By introducing a priority embedding and priority context construction mechanism, this invention can explicitly model the semantic differences, distribution states and competition relationships of tasks with different priorities, thereby improving the ability to distinguish and coordinate the scheduling of multi-priority tasks.

[0114] 2. This invention achieves adaptive interaction between candidate task representation and priority context information through a priority-aware cross-attention mechanism, enabling each candidate task to perceive the distribution characteristics and competitive relationships of different priority tasks in the current candidate set, thereby improving the pertinence and stability of task scheduling decisions.

[0115] 3. By introducing information such as the expected processing time, time margin, and memory requirements related to GPU nodes into the candidate task features, and combining the candidate task screening and candidate pointer scoring mechanism, this invention can improve the adaptability of the scheduling strategy to heterogeneous GPU resource environments and dynamic candidate action spaces.

[0116] 4. This invention uses a recurrent neural network to model the temporal state and optimizes it under a multi-agent reinforcement learning framework with centralized training and decentralized execution. It can ensure the timeliness of emergency priority tasks while taking into account the waiting control of emergency tasks and the processing efficiency of routine tasks, thereby improving the overall scheduling quality and resource utilization of medical imaging tasks. Attached Figure Description

[0117] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.

[0118] Figure 1 This is an overall flowchart of the medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism in this invention;

[0119] Figure 2 This is a schematic diagram of the priority-aware candidate task decision network structure in this invention;

[0120] Figure 3 This is a diagram of the multi-agent reinforcement learning framework in this invention. Detailed Implementation

[0121] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. However, this is not the only description; all aspects not described in detail herein are based on conventional techniques in the art.

[0122] Example 1

[0123] like Figure 1 As shown, this embodiment provides a medical image multi-agent task scheduling method based on a priority-aware cross-attention mechanism, including:

[0124] S1, Medical Imaging Tasks and Heterogeneous GPU Resource State Modeling:

[0125] To map the key attributes of heterogeneous GPU resources and medical image multi-priority inference tasks into a unified state that can be processed by a schedulable policy network, we first model the medical image inference task and heterogeneous GPU nodes, and establish a unified state description of task attributes, resource constraints and task execution timing indicators, providing an environmental foundation for subsequent candidate task selection and agent local observation construction.

[0126] In this embodiment, the heterogeneous GPU node set is denoted as ,in, Indicates the number of GPU nodes. Indicates the first Each GPU node Corresponding to an intelligent agent ;No. GPU nodes At any moment The original resource state is represented as follows:

[0127]

[0128] in, Indicates at time Next GPU node Available video memory; Indicates at time Next GPU node The utilization rate of video memory; Indicates at time Next GPU node The number of concurrent slots already occupied; Indicates GPU node The computational speed; Indicates at time Next GPU node The remaining processing time statistics for the currently running tasks;

[0129] Let the set of medical image reasoning tasks be denoted as... Any task Functions based on task attributes: ;in, Indicates task priority; Indicates the task's video memory requirements; This indicates the estimated processing time of the task on the benchmark GPU node; Indicates the time when the task arrives; Indicates the relative deadline for the task;

[0130] When the task Assigned to GPU node At that time, the following resource constraints are satisfied: ,in, Indicates GPU node The maximum number of concurrent slots;

[0131] Task priority satisfied , This indicates the total number of task priority categories. They are categorized into emergency diagnostic tasks, urgent tasks, and routine tasks, respectively.

[0132] Task At any moment The remaining deadline is defined as follows: ;

[0133] Considering the difference in computing speed between heterogeneous GPU nodes, let For nodes Compared to the computing speed of a benchmark GPU node, the processing time is approximately inversely proportional to the speed factor, thus the task... Assigned to GPU nodes The estimated processing time is defined as follows: .

[0134] Through the above modeling, a unified state description of medical imaging multi-priority task attributes, heterogeneous GPU resource constraints, and task execution timing indicators is formed, providing a foundation for subsequent candidate task selection, local observation construction, and agent scheduling decisions.

[0135] S2, Candidate Task Selection and Agent Local Observation Construction:

[0136] To avoid the waiting queue being too long and causing the action space to be too large, thus affecting the real-time performance and stability of multi-agent scheduling decisions, a set of candidate tasks is selected from the waiting task queue based on preset rules, and local observations are constructed in conjunction with the unified state description in step S1, transforming the dynamic environment input into a structured representation that can be processed by the neural network.

[0137] At each scheduling time First, a set of candidate tasks is selected from the current waiting task queue. Let time be... The waiting task queue below for:

[0138]

[0139] From the waiting task queue The middle selects the first according to the preset sorting rules. For each task, construct a candidate task set. :

[0140]

[0141] Among them, candidate tasks This corresponds to a specific task in the waiting task queue;

[0142] Set candidate tasks The corresponding original task is Then we have: , , ,in Priority category for the original task; , , All three are candidate tasks. The corresponding original task is Attributes, subscript Indicates the first The candidate positions correspond to the indices of the original task: For the original task at the scheduling time The remaining deadline; For the original task on the GPU node Estimated processing time;

[0143] Constructing candidate tasks Relative to GPU nodes candidate task feature vectors ,in Indicates the GPU node or agent number. Indicates the agent at time... The observed first One candidate position;

[0144] Candidate task feature vector This includes information such as normalized task priority, estimated processing time, task memory requirements, remaining deadline, time margin, and candidate ranking position, among which candidate tasks... Relative to GPU nodes time margin Defined as: In the formula, Indicate candidate tasks On GPU nodes Estimated processing time;

[0145] For GPU nodes Construct a normalized local resource state vector based on the original resource state. :

[0146]

[0147] in, , The total video memory capacity of a node is calculated by dividing the currently available video memory by the total video memory capacity of that node, and then normalizing to [0, 1]. , Maximum video memory; , This represents the maximum concurrent slot limit for a node. : The normalized value of a node's computation speed relative to the fastest node in the cluster, normalized to (0, 1]. The computing speed of the fastest node in the cluster; : A binary representation of the node's current busy state Indicates free time. Indicates busy;

[0148] To provide each agent with an overview of global load and priority distribution, a shared statistical feature vector of the waiting queue is constructed. This includes statistical information such as the number of waiting tasks with different priorities and their time progress;

[0149] No. A smart agent At any moment Local observation Defined as candidate task feature vector Normalized local resource state vector Statistical feature vectors of waiting queues splicing:

[0150] .

[0151] The preset sorting rule in step S2 is the earliest deadline priority sorting rule, and sorting is performed according to the task's relative deadline or the current remaining deadline.

[0152] In this embodiment That is, the first 8 candidate tasks are selected from the waiting queue to form a candidate task set. ;

[0153] If the current number of waiting tasks is less than If the candidate positions are insufficient, zero-filling is used to fill in the missing parts to ensure that the local observation dimension remains consistent.

[0154] For invalid candidate positions formed by zero-padding, a validity mask is used to identify them to avoid interference from invalid candidates in subsequent candidate aggregation and attention calculation; let the... The validity mask for each candidate position is: , This indicates that the candidate position is valid. This indicates that the candidate position is a fill position.

[0155] Through the above steps, the dynamically changing waiting task queue and heterogeneous GPU resource status are transformed into fixed-length structured local observations suitable for neural network input, providing an input basis for subsequent candidate task priority semantic modeling and scheduling decisions.

[0156] S3, Construction of candidate task priority-aware representation:

[0157] To enable the scheduling strategy to perceive the distribution status and urgency among multiple priority tasks, based on the local observation in step S2, priority semantic embedding and encoding are performed on candidate tasks to construct priority context representations. Furthermore, enhanced representations of candidate tasks are generated through a priority-aware cross-attention mechanism, providing an expressive basis for subsequent action value calculation.

[0158] like Figure 2 As shown, each GPU node intelligent agents A priority-aware candidate task decision network is constructed. This network first performs priority semantic embedding and candidate task encoding on the candidate task features, and performs context encoding on the local resource status and queue statistical features. Then, priority context representation is constructed according to the priority category of the candidate task, and enhanced candidate task representation is obtained through a priority-aware cross-attention mechanism.

[0159] For the A smart agent At any moment Candidate task feature vectors , , The dimension of the candidate task feature vector is represented. Represents the set of real numbers;

[0160] To enhance the model's ability to represent differences in tasks with multiple priorities, a learnable priority embedding matrix is ​​constructed. ,in, Indicates the priority embedding dimension. =3;

[0161] For candidate tasks Priority of corresponding tasks The priority embedding vector is obtained by querying the priority embedding matrix: ;

[0162] Subsequently, the candidate task feature vectors With priority embedding vector The input representations of the candidate tasks are then fused to obtain the enhanced input representations: And will enhance the input representation of the input candidate task encoding network. Obtain the initial encoded representation of the candidate task: In the formula, , Indicates the hidden dimension of the candidate task;

[0163] Therefore, the initial encoding representation of all candidate tasks is as follows:

[0164]

[0165] in Indicates the first An intelligent agent at time Next, the The initial encoded representation obtained after encoding each candidate task by the candidate task encoding network Enc(·) is marked with a superscript "0" to distinguish it as an initial encoding without cross-attention enhancement, different from the enhanced representation obtained in step S3. ;

[0166] Meanwhile, the normalized local resource state vector in local observations and waiting queue statistical feature vector Perform context encoding to obtain the first A smart agent At any moment Local context representation: ,in Represents a context encoding network;

[0167] For the A smart agent At any moment Candidate task set The initial encoding representations of candidate tasks are grouped according to the priority category of the corresponding tasks; for any priority category... The corresponding set of candidate task indices is denoted as: ;

[0168] For priority categories The corresponding candidate task aggregation representation Defined as:

[0169]

[0170] Define priority categories The normalized value of the number in the current candidate set is:

[0171]

[0172] Priority aggregation representation Local context representation and quantity normalization value The network is constructed by splicing the components and using priority context. The mapping yields a priority context vector:

[0173]

[0174] To enhance the discriminability between context representations of different priorities, a learnable priority type embedding vector is introduced for each priority category. By querying the priority type embedding matrix Obtain the priority type embedding vector The priority type embedding matrix is ​​obtained through end-to-end training, with each row being a priority type embedding vector corresponding to the priority category. ;

[0175] The priority context representation can be obtained as follows:

[0176]

[0177] All priority context representations are combined into a priority context matrix: .

[0178] Furthermore, the query input of the priority-aware cross-attention mechanism is the initial encoded representation of the candidate task, and the key input and value input are priority context representations constructed based on the priority categories of the candidate tasks. The adaptive interaction between the candidate task representation and the priority context information is realized through attention weight calculation, so that the candidate task representation can perceive the distribution characteristics and competitive relationships of different priority tasks in the current candidate set.

[0179] The cross-attention output representation of the candidate task is obtained based on the priority-aware cross-attention mechanism. :

[0180]

[0181] For the scaled dot product cross attention mechanism, where For query. For keys and values; This is the standard exponential normalization function, which is independently normalized for each row;

[0182] Cross-attention output representation for:

[0183]

[0184] for The OK;

[0185] To suppress excessive perturbation of the original candidate task representation by cross-attention output during the early stages of training, this embodiment is based on local context representation. Constructing gate vectors : In the formula, This represents the Sigmoid function. and For learnable parameters, , ,in Embed dimensions for local contexts. The hidden representation dimension for the candidate task. Both parameters are learnable and obtained through end-to-end optimization via backpropagation;

[0186] The gated cross-attention output is residually fused and normalized with the initial encoded representation of the candidate task to obtain the enhanced representation of the candidate task. All candidate task enhancement representations are combined as .

[0187] This step involves interactively fusing the local candidate task representation with the priority distribution context, so that each candidate task not only contains its own attribute information, but also the aggregation distribution and competition relationship information of each priority task in the current candidate set, thereby enhancing the model's ability to structurally model multi-priority scheduling scenarios.

[0188] Furthermore, candidate task coding network It is a two-layer fully connected feedforward neural network (MLP), with the following structure:

[0189]

[0190] Among them, input This involves concatenating the candidate task feature vector with the priority embedding vector; the first layer of the feedforward neural network maps the input to the hidden dimension. ,through After activation, the output dimension of the second-layer feedforward neural network is also [missing value]. The initial encoding representation of the candidate task is obtained. ; , , , All of these represent learnable parameters. , ,in The dimension of the candidate task feature vector is... Priority embedding dimension; Learnable parameters , , , All of these were obtained through automatic optimization via backpropagation.

[0191] The context encoding network also uses a two-layer fully connected feedforward neural network structure:

[0192]

[0193] The input is a normalized local resource state vector. and queue statistical feature vector The concatenation outputs a local context embedding. ; , , , All of these represent learnable parameters. , ,in The input dimension is the concatenation of the normalized local resource state vector and the waiting queue statistical feature vector. Embed dimensions for local contexts; Learnable parameters , , , It is obtained through automatic optimization via backpropagation.

[0194] Priority context construction network A two-layer fully connected feedforward neural network structure is adopted:

[0195]

[0196] The input is the aggregated representation of candidate task priorities. Local context representation and quantity normalization value The concatenation of these elements outputs a priority context vector. The two-layer fully connected structure of this network is a common existing technology; the specific design of its input features and their application as key-value inputs in the cross-attention mechanism are the innovative components of this invention. , , , The priority context vector dimension; learnable parameters , , , It is obtained through automatic optimization via backpropagation.

[0197] S4, Action value estimation based on loop state and candidate pointer scores:

[0198] To characterize the temporal dependency between resource occupancy and task processing status during continuous scheduling, and to calculate the action value of the dynamic candidate task set output in step S3, this step introduces a recurrent neural network to extract temporal decision information, and uses a candidate pointer scoring mechanism to calculate the action value of idle actions and candidate task actions respectively, outputting an action value vector for subsequent collaborative allocation and execution.

[0199] First, regarding the first A smart agent At any moment All candidate task enhancement representation combination Aggregate the candidate sets to form a summary vector. The results are obtained by mean pooling of effective candidate tasks:

[0200]

[0201] in, Indicates the first A validity mask for each candidate position; Indicates the number of valid candidate tasks;

[0202] Then, the candidate set summary vector With local context representation By concatenating the inputs, we obtain the cyclic state update input. Update the input to change the loop state. Feed into the recurrent neural network; let the first... An intelligent agent at time The hidden state is Then the updated time is obtained through the recurrent neural network. The hidden state is represented as: , This represents a gated recurrent unit, a commonly used recurrent neural network unit used to update the current hidden state based on the current input and the hidden state of the previous time step.

[0203] Based on the updated hidden state Calculate the action value of idle actions and candidate task actions respectively;

[0204] For idle actions Its action value is expressed as: ,in, The idle action value mapping function is a single-level linear transformation:

[0205]

[0206] in, For learnable parameters, Hidden state Mapped to a scalar idle action value, belonging to the linear layer in the prior art, the design choice of this invention makes the idle action value correlated with the system load state (implied in...). Adaptive association;

[0207] For candidate task actions First, the hidden state Mapping to the same latent space as the candidate task representation yields the candidate query vector: ,in, The learnable parameter matrix is ​​obtained through backpropagation optimization during end-to-end training.

[0208] The candidate pointer scoring mechanism is used to calculate the first Action value of each candidate task action: ;

[0209] Therefore, the first An intelligent agent at time The action value vector is represented as: ;

[0210] During the execution phase, the first Each agent determines the scheduling action based on the action value vector and the set of available actions. ,in, Indicates the first An intelligent agent at time The set of possible actions.

[0211] The set of available actions includes two types of actions: idle actions ( ) and candidate task actions ( (Idle actions are always selectable); candidate task actions must simultaneously satisfy: ① Validity mask ② The free video memory of the GPU node satisfies ③ Concurrent slots satisfy In the implementation, a large negative value mask is applied to the scores of candidate positions that do not meet the conditions, which is equivalent to implementing action constraints.

[0212] This step utilizes a recurrent neural network to model the temporal dependencies between resource consumption and task processing status during continuous scheduling. A candidate pointer scoring mechanism is then used to score each item in the dynamic candidate set, thus adapting to the dynamic nature of the action space in medical imaging task scheduling, which changes dynamically with the candidate tasks. The resulting action value vector... This will serve as a quantitative basis for the next step of generating joint actions by multiple agents, resolving execution conflicts, and verifying resource constraints.

[0213] S5, multi-agent cooperative scheduling and execution:

[0214] To allocate tasks based on the action value calculation results obtained by each agent based on local observation in step S4, a joint action is generated based on the output action of each agent, and task allocation and environmental state update are completed through conflict resolution and resource constraint verification, thereby forming an online scheduling closed loop.

[0215] In this step, multi-GPU collaborative task allocation is performed based on the action value output by each agent. At each scheduling time... Each agent is based on its own local observations. Output scheduling action Thus forming a joint action ;like , indicating the first An agent chooses an idle action at this moment; if , indicating the first Each agent selects a set of candidate tasks. The first in Candidate tasks ;

[0216] When multiple agents choose the same candidate task, such as Figure 3 Agents 1, 2, and N are used to resolve conflicts; candidate tasks are defined. Selected agent index set for:

[0217]

[0218] when At that time, conflict resolution rules based on action value are adopted from the set The agent with the highest action value is selected as the sole winning agent, and the selections of the other agents are recorded as unsuccessful. For example, suppose the agents... Candidate tasks were selected at the same scheduling time. The action values ​​calculated by the three for this task are respectively Then the action with the highest value The winner will be responsible for carrying out the candidate task. , and This round is marked as unsuccessful allocation. The current resource status remains unchanged, and the system will wait for the next scheduling moment to participate in the selection again.

[0219] Set candidate tasks The corresponding original task is After the conflict is resolved, the intelligent agent Successfully selected candidate task Further verification is needed to determine if the GPU node requirement is met. Resource constraints: ;

[0220] If resource constraints are met, then candidate tasks will be... The corresponding task is submitted to the GPU node. Execute and update the GPU node's memory usage status, slot usage status, and task running status; if resource constraints are not met, the action is recorded as invalid allocation; for agents that fail to allocate tasks after conflict resolution, and agents that fail resource constraint verification, they are considered not to have performed valid task allocation at the current scheduling time, and their current resource status remains unchanged, waiting to participate in candidate task selection again at the next scheduling time.

[0221] During task execution, the environment generates reward signals based on task completion status, waiting status, constraint satisfaction status, and service quality indicators at termination. The service quality indicators at the end of the task are calculated differently according to the task priority category. For emergency tasks, the main indicator is whether the task is completed within the deadline; for urgent tasks, the main indicator is the waiting time; and for routine tasks, the main indicator is the completion rate.

[0222] In the reward function, differentiated reward weights are designed for tasks of different priorities to ensure that the weight of emergency tasks is greater than that of urgent tasks and regular tasks, thereby guiding the agent to prioritize the service quality of high-priority tasks.

[0223] S6, intensive training optimization:

[0224] To enable the aforementioned multi-agent scheduling strategy to continuously optimize based on historical experience and adapt to dynamic load environments, this step constructs a joint value function within a centralized training and distributed execution framework. The strategy network parameters are then updated in a closed loop using a temporal difference loss function to obtain a multi-agent scheduling strategy for online execution.

[0225] like Figure 3 As shown, this invention employs a multi-agent reinforcement learning framework with centralized training and distributed execution. During the training phase, each agent shares policy network parameters (the policy network parameters are the set of training parameters for all learnable neural networks in this invention, specifically including all weight parameters such as priority embedding matrix, candidate task encoding network, context encoding network, cross-attention module, gating network, GRU recurrent network, and candidate pointer scoring), and optimizes the multi-agent cooperative scheduling behavior through a joint value function, expressed as:

[0226]

[0227] in, Indicates time The global state is composed of the resource status of each GPU node, task queue statistics, and system running status. Indicates a global coordinated action; Indicates the first The action value of an agent for a selected action; Represents the joint value mixing function;

[0228] The joint value function satisfies the monotonicity constraint relative to the individual action value functions of each agent:

[0229]

[0230] in, Indicates the value of joint actions; Indicates the first The value of an individual action of an intelligent agent;

[0231] Therefore, the global maximization of the value of joint actions can be equivalently decomposed into the independent maximization of the value of each agent's individual actions, thereby ensuring policy consistency between centralized training and decentralized execution.

[0232] To enable the joint value function to gradually approximate the Bellman optimality equation using environmental interaction samples, thereby learning a better scheduling strategy in the long-term reward context, this embodiment employs temporal difference learning based on the target network to construct the training objective, and uses the temporal difference error as an optimization signal to improve training stability. The training objective of the policy network is to minimize the temporal difference loss function. :

[0233]

[0234] in, The target value is represented as , This indicates the network parameters to be optimized; It represents the expected value of the random variable within the parentheses under its probability distribution; Indicates the discount factor; This represents the joint value function corresponding to the target network, which is used to provide a relatively stable evaluation benchmark when calculating the target value, thereby reducing training oscillations and improving convergence;

[0235] During the execution phase, each agent only needs to base its observations on its own local observations. It can output actions independently without needing to obtain local observation information from other agents, thus meeting the real-time decision-making requirements in real-world heterogeneous GPU distributed scheduling scenarios.

[0236] In summary, this invention first performs a unified modeling of the heterogeneous GPU resource state and task temporal attributes, and constructs local observations by selecting a fixed-length candidate set at each scheduling moment. Then, through priority semantic embedding and priority context construction, a cross-attention mechanism is introduced to fuse priority distribution and competition relationships, resulting in enhanced representations of candidate tasks. Furthermore, a recurrent neural network and candidate pointer scoring mechanism are combined to output dynamic action values. Finally, multi-agent collaborative allocation and centralized training are used to iteratively update the strategy parameters. Through these steps, a scheduling strategy suitable for multi-priority task scheduling scenarios in medical imaging is proposed, which can improve the adaptability of the scheduling strategy to the differentiated service quality requirements of multi-priority tasks under the constraint of heterogeneous GPU resources.

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

Claims

1. A multi-agent task scheduling method for medical imaging based on a priority-aware cross-attention mechanism, characterized in that, include: S1 models the medical image inference task and heterogeneous GPU nodes, and establishes a unified state description of task attributes, resource constraints and task execution timing indicators. S2, select a set of candidate tasks from the waiting task queue, and construct local observations by combining the unified state description in step S1, so as to transform the dynamic environment input into a structured representation that can be processed by the neural network. S3. Based on the local observations in step S2, priority semantic embedding and encoding are performed on the candidate tasks to construct priority context representations, and enhanced representations of the candidate tasks are generated through a priority-aware cross-attention mechanism. S4. Based on step S3, the candidate pointer scoring mechanism is used to calculate the action value of idle actions and candidate task actions respectively, and the action value vector is output. S5 generates joint actions based on the output actions of each intelligent agent, and completes task allocation and environmental state update through conflict resolution and resource constraint verification. S6 constructs a joint value function under the framework of centralized training and decentralized execution, and performs closed-loop updates of policy network parameters through the temporal difference loss function to obtain a multi-agent scheduling policy for online execution.

2. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 1, characterized in that, In step S1, the heterogeneous GPU node set is denoted as ,in, Indicates the number of GPU nodes. Indicates the first Each GPU node Corresponding to an intelligent agent ;No. GPU nodes At any moment The original resource state is represented as follows: in, Indicates at time Next GPU node Available video memory; Indicates at time Next GPU node The utilization rate of video memory; Indicates at time Next GPU node The number of concurrent slots already occupied; Indicates GPU node The computational speed; Indicates at time Next GPU node The remaining processing time statistics for the currently running tasks; Let the set of medical image reasoning tasks be denoted as... Any task Functions based on task attributes: ;in, Indicates task priority; Indicates the task's video memory requirements; This indicates the estimated processing time of the task on the benchmark GPU node; Indicates the time when the task arrives; Indicates the relative deadline for the task; When the task Assigned to GPU node At that time, the following resource constraints are satisfied: ,in, Indicates GPU node The maximum number of concurrent slots; Task priority satisfied , This indicates the total number of task priority categories. They are categorized into emergency diagnostic tasks, urgent tasks, and routine tasks, respectively. Task At any moment The remaining deadline is defined as follows: ; Task Assigned to GPU nodes The estimated processing time is defined as follows: .

3. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 2, characterized in that, In step S2, at each scheduling time First, a set of candidate tasks is selected from the current waiting task queue. Let time be... The waiting task queue below for: From the waiting task queue The middle selects the first according to the preset sorting rules. For each task, construct a candidate task set. : Among them, candidate tasks This corresponds to a specific task in the waiting task queue; Set candidate tasks The corresponding original task is Then we have: , , ,in Priority category for the original task; For the original task at the scheduling time The remaining deadline; For the original task on the GPU node The estimated processing time; Constructing candidate tasks Relative to GPU nodes candidate task feature vectors ,in Indicates the GPU node or agent number. Indicates the agent at time... The observed first One candidate position; Candidate task feature vector This includes normalized task priority, estimated processing time, task memory requirements, remaining deadline, time margin, and candidate ranking information, where candidate tasks... Relative to GPU nodes time margin Defined as: In the formula, Indicate candidate tasks On GPU nodes The estimated processing time; For GPU nodes Construct a normalized local resource state vector based on the original resource state. : in, , This represents the total video memory capacity of the node. , Maximum video memory; , This represents the maximum concurrent slot limit for a node. , The computing speed of the fastest node in the cluster; : A binary representation of the node's current busy state Indicates free time. Indicates busy; To provide each agent with an overview of global load and priority distribution, a shared statistical feature vector of the waiting queue is constructed. This includes the number of waiting tasks with different priorities and their time progress; No. A smart agent At any moment Local observation Defined as candidate task feature vector Normalized local resource state vector Statistical feature vectors of waiting queues splicing: 。 4. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 3, characterized in that, The preset sorting rule in step S2 is the earliest deadline priority sorting rule, and sorting is performed according to the task's relative deadline or the current remaining deadline. That is, the first 8 candidate tasks are selected from the waiting queue to form a candidate task set. ; If the current number of waiting tasks is less than If the candidate positions are insufficient, zero-filling is used to fill in the missing parts to ensure that the local observation dimension remains consistent. Invalid candidate positions formed by zero padding are identified using a validity mask; let the first... The validity mask for each candidate position is: , This indicates that the candidate position is valid. This indicates that the candidate position is a fill position.

5. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 4, characterized in that, In step S3, each GPU node intelligent agents A priority-aware candidate task decision network is correspondingly constructed. This network first performs priority semantic embedding and candidate task encoding on the candidate task features, and at the same time performs context encoding on the local resource status and queue statistical features. Subsequently, a priority context representation is constructed based on the priority category of the candidate task, and an enhanced representation of the candidate task is obtained through a priority-aware cross-attention mechanism. For the A smart agent At any moment Candidate task feature vectors , , The dimension of the candidate task feature vector is represented. Represents the set of real numbers; To enhance the model's ability to represent differences in tasks with multiple priorities, a learnable priority embedding matrix is ​​constructed. ,in, Indicates the priority embedding dimension; For candidate tasks Priority of corresponding tasks The priority embedding vector is obtained by querying the priority embedding matrix: ; Subsequently, the candidate task feature vectors With priority embedding vector The input representations of the candidate tasks are then fused to obtain the enhanced input representations: And will enhance the input representation of the input candidate task encoding network. Obtain the initial encoded representation of the candidate task: In the formula, , Indicates the hidden dimension of the candidate task; Therefore, the initial encoding representation of all candidate tasks is as follows: in Indicates the first An intelligent agent at time Next, the The initial encoded representation obtained by encoding each candidate task by the candidate task encoding network Enc(·); Meanwhile, the normalized local resource state vector in local observations and waiting queue statistical feature vector Perform context encoding to obtain the first A smart agent At any moment Local context representation: ,in Represents a context encoding network; For the A smart agent At any moment Candidate task set The initial encoding representations of candidate tasks are grouped according to the priority category of the corresponding task; for any priority category... The corresponding set of candidate task indices is denoted as: ; For priority categories The corresponding candidate task aggregation representation Defined as: Define priority categories The normalized value of the number in the current candidate set is: Priority aggregation representation Local context representation and quantity normalization value The network is constructed by splicing the components and using priority context. The mapping yields a priority context vector: Embedded matrix by query priority type Obtain the priority type embedding vector The priority context representation is obtained as follows: All priority context representations are combined into a priority context matrix: ; The query input of the priority-aware cross-attention mechanism is the initial encoded representation of the candidate task, and the key and value inputs are priority context representations constructed based on the priority categories of the candidate tasks. Based on the computation of the priority-aware cross-attention mechanism, the cross-attention output representation of the candidate task is obtained. : For the scaled dot product cross attention mechanism, where For query, For keys and values; This is the standard exponential normalization function, which is independently normalized for each row. Cross-attention output representation for: for The OK; Based on local context representation Constructing gate vectors : In the formula, This represents the Sigmoid function. and These are learnable parameters; The gated cross-attention output is residually fused and normalized with the initial encoded representation of the candidate task to obtain the enhanced representation of the candidate task. All candidate task enhancement representations are combined as .

6. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 5, characterized in that, Candidate Task Encoding Network It is a two-layer fully connected feedforward neural network with the following structure: Among them, input This involves concatenating the candidate task feature vector with the priority embedding vector; the first layer of the feedforward neural network maps the input to the hidden dimension. ,through After activation, the output dimension of the second-layer feedforward neural network is also [missing value]. The initial encoding representation of the candidate task is obtained. ; , , , All represent learnable parameters; The context encoding network also uses a two-layer fully connected feedforward neural network structure: The input is a normalized local resource state vector. and queue statistical feature vector The concatenation outputs a local context embedding. ; , , , All represent learnable parameters; Priority context construction network A two-layer fully connected feedforward neural network structure is adopted: The input is the aggregated representation of candidate task priorities. Local context representation and quantity normalization value The concatenation of these elements outputs a priority context vector. ; , , , These are learnable parameters.

7. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 6, characterized in that, The implementation process of step S4 is as follows: First, regarding the first A smart agent At any moment All candidate task enhancement representation combination Aggregate the candidate sets to form a summary vector. : in, Indicates the first A validity mask for each candidate position; Indicates the number of valid candidate tasks; Then, the candidate set summary vector With local context representation By concatenating the inputs, we obtain the cyclic state update input. Update the input to change the loop state. Feed into the recurrent neural network; let the first... An intelligent agent at time The hidden state is Then the updated time is obtained through the recurrent neural network. The hidden state is represented as: , This represents a gated loop unit, used to update the current hidden state based on the current input and the hidden state at the previous time step; Based on the updated hidden state Calculate the action value of idle actions and candidate task actions respectively; For idle actions Its action value is expressed as: ,in, The idle action value mapping function is a single-level linear transformation: in, For learnable parameters, Hidden state Mapped to scalar idle action value; For candidate task actions First, the hidden state Mapping to the same latent space as the candidate task representation yields the candidate query vector: ,in, The learnable parameter matrix; The candidate pointer scoring mechanism is used to calculate the first Action value of each candidate task action: ; Therefore, the first An intelligent agent at time The action value vector is represented as: ; During the execution phase, the first Each agent determines the scheduling action based on the action value vector and the set of available actions. ,in, Indicates the first An intelligent agent at time The set of possible actions.

8. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 7, characterized in that, The set of available actions contains two types of actions: idle actions and candidate task actions, where idle actions are always available. Candidate task actions must simultaneously satisfy: ① Validity mask ② The free video memory of the GPU node satisfies ③ Concurrent slots satisfy .

9. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 8, characterized in that, The implementation process of step S5 is as follows: At each scheduling time Each agent is based on its own local observations. Output scheduling action Thus forming a joint action ;like , indicating the first An agent chooses an idle action at this moment; if , indicating the first Each agent selects a set of candidate tasks. The first in Candidate tasks ; When multiple agents select the same candidate task, conflict resolution is performed; let the candidate task be... Selected agent index set for: when At that time, conflict resolution rules based on action value are adopted from the set The agent with the highest action value is selected as the sole winning agent, and the selection of the other agents in this instance is recorded as unsuccessful. Set candidate tasks The corresponding original task is After the conflict is resolved, the intelligent agent Successfully selected candidate task Further verification is needed to determine if the GPU node requirement is met. Resource constraints: ; If resource constraints are met, then candidate tasks will be... The corresponding task is submitted to the GPU node. Execute and update the GPU node's memory usage status, slot usage status, and task running status; if resource constraints are not met, record the action as invalid allocation; During task execution, the environment generates reward signals based on task completion status, waiting status, constraint satisfaction status, and service quality indicators at termination. .

10. The medical image multi-agent task scheduling method based on priority-aware cross-attention mechanism according to claim 9, characterized in that, The implementation process of step S6 is as follows: During the training phase, each agent shares the policy network parameters and optimizes the multi-agent cooperative scheduling behavior through a joint value function, which is expressed as: in, Indicates time The global state is composed of the resource status of each GPU node, task queue statistics, and system running status. Indicates a global coordinated action; Indicates the first The action value of an agent for a selected action; Represents the joint value mixing function; The joint value function satisfies the monotonicity constraint relative to the individual action value functions of each agent: in, Indicates the value of joint actions; Indicates the first The value of an individual action of a smart agent; The training objective of the policy network is to minimize the temporal difference loss function. : in, The target value is represented as , This indicates the network parameters to be optimized; Represents the mathematical expectation; Indicates the discount factor; This represents the joint value function corresponding to the target network, which is used to provide a relatively stable evaluation benchmark when calculating the target value, thereby reducing training oscillations and improving convergence; During the execution phase, each agent only needs to base its observations on its own local observations. It can output actions independently without needing to obtain local observation information from other agents, thus meeting the real-time decision-making requirements in real-world heterogeneous GPU distributed scheduling scenarios.