A cache-aware size model cloud-edge collaborative multi-task scheduling method

CN123011406APending Publication Date: 2026-10-30GUIZHOU UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611519912.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]为此,本发明提供一种缓存感知的大小模型云边协同多任务调度方法,用以克服现有技术中无法感知边缘服务器的缓存状态和云端大模型的可用资源,降低了云边协同系统的任务调度效率与资源利用率的问题

Benefits of technology

[0022]本方案中,通过设定最大轮次与时延收益双重达标条件,使训练在满足时延和收益目标时及时终止,避免过度迭代并保障任务调度满足性能需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011406A_ABST
    Figure CN123011406A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of cloud edge collaborative task scheduling, and particularly relates to a cache-aware size model cloud edge collaborative multi-task scheduling method, comprising: S1, constructing a cloud edge collaborative task scheduling system and initializing the cloud edge collaborative task scheduling system; S2, constructing a task-model-cache mapping relationship; S3, performing priority ranking analysis on a candidate execution path set; S4, inputting a system state vector into a task scheduling model for analysis; S5, performing constraint inspection on an initial task scheduling result to obtain an effective task-level scheduling result that satisfies a preset constraint condition; S6, analyzing a to-be-scheduled image generation task and judging whether execution feedback data satisfies a preset termination condition, if yes, stopping iteration, and if no, re-executing steps S2 to S6. The present application can perceive the cache state of an edge server and the available resources of a cloud-side large model, and improves the task scheduling efficiency and resource utilization rate of a cloud edge collaborative system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud-edge collaborative task scheduling technology, and in particular to a cache-aware size model cloud-edge collaborative multi-task scheduling method. Background Technology

[0002] With the widespread deployment of diffusion models in image generation, content creation, and real-time interaction, image generation services are rapidly evolving from traditional offline batch processing to online instant response. Unlike classic generation tasks based on feedforward networks, diffusion-based image generation relies on multi-step iterative denoising, significantly extending the inference chain and exponentially increasing computational resource consumption. Meanwhile, end-users have extremely low tolerance for response latency. While relying solely on a large-scale generation model in the central cloud to complete all inference steps can guarantee the semantic consistency and visual quality of the output image, long-distance data backhaul and frequent model calls introduce significant end-to-end latency and network bandwidth consumption. Conversely, if the entire iterative generation process is offloaded to edge nodes, the inherent bottlenecks in peak computing power, memory capacity, and storage space of edge devices make it difficult to support stable service under high concurrency scenarios. Therefore, a cloud-edge architecture based on collaborative inference between large cloud models and small edge models, by rationally splitting and cooperating generation tasks on both the cloud and edge sides, has become a commonly adopted deployment paradigm for diffusion-based image generation services in practical systems.

[0003] Existing cloud-edge collaborative scheduling technologies still have several shortcomings in meeting the actual operational needs of image generation scenarios. Cache management is often treated as an independent module, lacking effective linkage with model scheduling decisions. The usage of cached content is not considered an important reference factor in the scheduling process, resulting in the underutilization of the reuse potential of cached data. The iterative denoising process unique to diffusion models generates a large amount of intermediate state data, but current methods generally lack differentiated execution path designs for reusing these intermediate results, making it difficult to achieve a balance between generation quality and response speed. When edge node resources are limited, frequent loading and unloading of small-scale models introduces additional system overhead. The lack of reasonable online and offline state management and on-demand loading mechanisms will lead to a decline in overall operational efficiency. Furthermore, in real-world business scenarios, image generation tasks generally face multi-dimensional constraints of quality, latency, and resource costs. Existing scheduling technologies cannot comprehensively adapt to these multi-dimensional requirements under multi-task concurrent operation, resulting in wasted resources in the cloud-edge collaborative system and difficulty in effectively improving the overall task scheduling and operational efficiency.

[0004] Chinese Patent Publication No. CN115202879B discloses a cloud-edge collaborative scheduling method and its application based on multiple types of intelligent models. The method includes: constructing a prediction model, which comprises N inference models deployed on N edge nodes and N corresponding selection models; and scheduling the corresponding inference models to execute the target task based on the selection models in the prediction model. This approach only constructs prediction models based on training feature sets and schedules the corresponding inference models to execute the target task through selection models. It fails to consider the cache status of edge servers and the available resources of large cloud models, thus reducing the task scheduling efficiency and resource utilization of the cloud-edge collaborative system. Summary of the Invention

[0005] To address this, the present invention provides a cache-aware, large-scale model cloud-edge collaborative multi-task scheduling method to overcome the problem in existing technologies that fail to perceive the cache status of edge servers and the available resources of large cloud models, thereby reducing the task scheduling efficiency and resource utilization of cloud-edge collaborative systems.

[0006] To achieve the above objectives, this invention provides a cache-aware size-based cloud-edge collaborative multi-task scheduling method, comprising the following steps: S1. Construct a cloud-edge collaborative task scheduling system that includes multiple edge servers, a central cloud server, and multiple user terminals, and initialize the cloud-edge collaborative task scheduling system to obtain the initialized cloud-edge collaborative task scheduling system. The edge servers deploy small edge models, and the central cloud server deploys large cloud models. S2. Obtain user task request data from user terminals in the initialized cloud-edge collaborative task scheduling system, and construct a task-model-cache mapping relationship based on user task request data, edge small model model data, cloud large model model data and current cache status data. S3. Generate a set of candidate execution paths for each task to be scheduled by the task-model-cache mapping relationship, and perform priority sorting analysis on the set of candidate execution paths to obtain the sequence of tasks to be scheduled. S4. Based on the sequence of tasks to be scheduled, obtain the current system state vector of the cloud-edge collaborative task scheduling system after initialization, and input the system state vector into the task scheduling model for analysis to obtain the initial task scheduling result. Based on the initial task scheduling result, determine the target task execution path and target matching generation model of each task to be scheduled in the candidate execution path set in the sequence of tasks to be scheduled. S5. Based on the target task execution path and target matching generation model, the initial task scheduling results are constrained and checked to obtain effective task-level scheduling results that meet the preset constraints. Based on the effective task-level scheduling results, resource-level scheduling is performed on the target edge small models in each edge server to obtain resource-level scheduling results. S6. Analyze the image generation task to be scheduled based on the resource-level scheduling results, obtain execution feedback data, and determine whether the execution feedback data meets the preset termination condition. If yes, stop the iteration; otherwise, re-execute steps S2 to S6 based on the execution feedback data until the preset termination condition is met.

[0007] The technical principle of this application is as follows: By constructing and initializing a cloud-edge collaborative task scheduling system, a hierarchical architecture is defined, in which edge servers deploy small edge models and central cloud servers deploy large cloud models. After obtaining user task request data from user terminals, the user task request data, edge small model data, cloud large model data, and current cache status data are used as input to construct a task-model-cache ternary mapping relationship, enabling scheduling decisions to perceive the real-time usage of cache resources at each edge node. Based on this task-model-cache ternary mapping relationship, a set of candidate execution paths containing the execution possibilities of different edge nodes and central cloud nodes is generated for each task to be scheduled, and all candidate execution paths are prioritized. The system performs hierarchical sorting analysis to form a sequence of tasks to be scheduled. It then acquires the current system's state vector and inputs it into the task scheduling model for analysis, obtaining initial task scheduling results. From these results, it determines the target task execution path and target matching generation model for each task in the candidate execution path set. Preset constraints are applied to the initial scheduling results for verification, and valid task-level scheduling results that meet these constraints are selected. Based on these valid task-level scheduling results, resource-level scheduling is then performed on the target edge mini-models deployed on each edge server. After executing the tasks based on the resource-level scheduling results, execution feedback data is obtained to determine if preset termination conditions are met. If not, the above steps are iterated again based on the feedback data, forming a closed-loop optimization mechanism.

[0008] Compared with existing technologies, the beneficial effects of this application are as follows: By constructing a cloud-edge collaborative task scheduling system, the collaborative cooperation between edge small models and cloud large models is realized, providing a system foundation for differentiated scheduling of multiple tasks; by acquiring user task request data and combining it with user task request data, edge small model model data, cloud large model model data, and current cache status data to construct a task-model-cache ternary mapping relationship, the scheduling decision can perceive the cache resource usage status of each edge node, avoiding scheduling tasks to edge nodes with insufficient cache, effectively reducing the overhead of repeated loading caused by cache missing data; by generating a set of candidate execution paths for each task to be scheduled and performing priority sorting analysis to obtain a sequence of tasks to be scheduled, ordered scheduling in multi-task scenarios is realized, avoiding execution conflicts caused by resource competition between tasks; By acquiring the system state vector and inputting it into the task scheduling model for analysis, the initial task scheduling result is obtained. Then, the target task execution path and target matching generation model are determined, realizing the adaptive matching between the scheduling strategy and the real-time system state. By constraining and verifying the initial task scheduling result, an effective task-level scheduling result that meets the preset constraints is obtained. Based on the effective task-level scheduling result, resource-level scheduling is performed on the target edge small models in each edge server, ensuring the feasibility of the scheduling scheme and the rationality of resource allocation in actual deployment. By analyzing the image generation task to be scheduled based on the resource-level scheduling result, execution feedback data is obtained. When the preset termination condition is not met, the scheduling strategy is iterated again based on the execution feedback data, forming a continuous optimization closed loop of the scheduling strategy, thereby improving the task scheduling efficiency and resource utilization of the cloud-edge collaborative system.

[0009] Furthermore, S1 includes the following steps: S11. Configure the system networking of multiple edge servers, one central cloud server and multiple user terminals according to the preset system networking configuration parameters to obtain the cloud-edge collaborative task scheduling system. S12. According to the cloud-edge collaborative task scheduling system, deploy an edge mini-model on the edge server and configure a local cache space for the edge server to obtain the edge server configuration result with the edge mini-model and local cache space configured. S13. Based on the edge server configuration result, deploy the cloud-based large model on the central cloud server and configure the cloud-based cache space on the central cloud server to obtain the central cloud server configuration result with the cloud-based large model and cloud-based cache space configured. S14. Based on the configuration results of the central cloud server, initialize the status of the task queue to be scheduled, the local cache status, the online status of the edge mini-model, and the status of the available edge resources of the edge server to obtain the initialization status data of the cloud-edge collaborative task scheduling system. S15. Initialize the model parameters, target network parameters, and experience replay pool of the Dueling DQN network based on the initialization status data of the cloud-edge collaborative task scheduling system. Obtain the image generation request initiated by the user terminal through the edge server, and extract the text prompts, generation quality constraints, maximum tolerable latency, and cache reuse requirements from the image generation request to obtain the initialized cloud-edge collaborative task scheduling system.

[0010] In this solution, a cloud-edge collaborative task scheduling system is built to complete the collaborative deployment of small edge models and large cloud models, as well as the hierarchical configuration of local and cloud caches. The system initializes task queues and resource status data and extracts text prompts, quality constraints, and latency requirements for image generation requests, thereby enhancing the cloud-edge scheduling capability and resource utilization of image generation tasks.

[0011] Furthermore, S2 includes the following steps: S21. Based on the user task request data and current cache status data from the user terminal, analyze the original total number of denoising steps and the normalized cache matching degree for each task to be scheduled to obtain the actual number of denoising steps after cache reuse. The mathematical expression for the actual number of denoising steps is: In the formula, Indicates the first The actual number of denoising steps for each scheduled task after cache reuse. Indicates the first Normalized cache match degree of each pending task Indicates the first The total number of raw denoising steps for each task to be scheduled; S22. Calculate the latency fit between each scheduled task and each candidate model based on the actual number of denoising steps after cache reuse and the average inference latency per step of each candidate model, wherein the mathematical expression for the latency fit is: In the formula, Indicates the first The number of tasks to be scheduled and the first Latency fit between candidate models Indicates the first The maximum tolerable latency for each pending task. Indicates the first The task to be scheduled calls the first The average communication latency of the corresponding execution path for each candidate model. Indicates the first Average inference latency per step for each candidate model; S23. Based on the model data of the edge small model and the model data of the cloud large model, obtain the model generation accuracy and the maximum supported resolution of each candidate model. Then, based on the latency adaptation, the model generation accuracy, and the maximum supported resolution of each candidate model, calculate the joint matching degree between each scheduled task and each candidate model. Finally, construct a task-model-cachate mapping relationship based on the joint matching degree. The mathematical expression for the joint matching degree is: In the formula, Indicates the first The number of tasks to be scheduled and the first Joint matching degree among candidate models Indicates the first Model generation accuracy of each candidate model Indicates the first Quality constraints for the generation of each task to be scheduled. Indicates the first The maximum supported resolution of each candidate model. Indicates the first The target resolution requirement for each task to be scheduled. This represents the function that takes the minimum value.

[0012] In this solution, redundant inference overhead is reduced by calculating the actual number of denoising steps after cache reuse, models that meet the tolerance latency are selected based on latency adaptability, joint matching degree is generated by integrating model accuracy and resolution constraints, and task-model-cache mapping relationship is constructed to achieve collaborative optimization of computing resources and cache content, thereby enhancing the collaborative scheduling efficiency between edge and cloud.

[0013] Furthermore, S3 includes the following steps: S31. Based on the task-model-cached mapping relationship, obtain the current cache status data corresponding to each scheduled task. Determine whether the cache content corresponding to each scheduled task exists based on the current cache status data. If the cache content exists and is completely consistent with the task output requirements, generate a cache reuse path. If the cache content exists and the similarity of the feature vector with the task output requirements is greater than the preset similarity threshold, and the proportion of the remaining computing power of the edge small model is greater than the preset computing power threshold, generate a cache-assisted edge generation path. If the cache content does not exist and the proportion of the remaining computing power of the edge small model is greater than the preset computing power threshold, generate an edge generation path. If the task generation quality parameters exceed the upper limit of the edge small model's capabilities, generate a cloud generation path, forming a set of candidate execution paths for each scheduled task. S32. Calculate the scheduling priority of each scheduled task based on its task waiting time, normalized cache matching degree, and maximum tolerable latency in the candidate execution path set. The mathematical expression for the scheduling priority is: In the formula, Indicates the first The scheduling priority corresponding to each task to be scheduled. Indicates the first The waiting time for each pending task; S33. Sort the tasks to be scheduled in the candidate execution path set in descending order according to the scheduling priority of each task to be scheduled, and obtain the sequence of tasks to be scheduled.

[0014] In this solution, multiple candidate execution paths are generated by analyzing the mapping relationship between the tasks to be scheduled and the cache and model. The scheduling priority is calculated by combining the task waiting time with the cache matching degree and the maximum tolerable latency. The tasks to be scheduled in the candidate execution path set are sorted in descending order, which effectively improves the system resource utilization efficiency.

[0015] Furthermore, S4 includes the following steps: S41. Based on the sequence of tasks to be scheduled, collect the status of the task queue, cache status, online status of the edge mini-model, and status of available edge resources to obtain a set of resource statuses; S42. Collect data on the single load / unload overhead of edge small models, the cumulative access frequency of edge small models, and the availability status of cloud large models to obtain model status parameters. S43. Combine the resource state set, model state parameters, and normalized cache matching degree and task requirement parameters with each scheduled task to obtain the system state vector. S44. Construct a task scheduling model based on the Dueling DQN network, including a value network and a dominance network. Input the system state vector into the task scheduling model, analyze the system state vector through the value network to obtain the state value function value, analyze the system state vector through the dominance network to obtain the dominance function value corresponding to each candidate action, and calculate the state action value corresponding to each candidate action based on the state value function value and the dominance function value corresponding to each candidate action. The mathematical expression of the state action value is: In the formula, The time slot number representing the scheduling decision. Indicates the first The system state vector of the time slot, Indicates the first The time slot is the selected scheduling action for the current state. Indicates the first System state vector of time slot Execute scheduling actions The corresponding state action value, This represents the system state vector fitted by the value network. The value of the state value function under the given conditions is as follows: This represents the state vector of the system fitted by the dominant network. Execute scheduling actions The value of the advantage function at that time. Represents the set of candidate actions. Represents the set of candidate actions Any candidate action in, Represents the system state vector Next, execute candidate actions The value of the dominant function at that time; S45, Adopt - The greedy strategy selects a scheduling action from the candidate action set and generates a random number. It then determines whether the random number is less than the preset exploration probability value. If so, it randomly selects a candidate action from the candidate action set as the scheduling action. If not, it selects the candidate action with the largest dynamic state value from the candidate action set as the scheduling action. S46. Determine the target task execution path corresponding to the scheduling action from the candidate execution path set according to the scheduling action, and determine the target matching generation model that matches the target task execution path according to the scheduling action.

[0016] In this solution, a system state vector is constructed by collecting multi-dimensional resources and model states. The state action value is calculated using a task scheduling model based on value network and advantage network. The scheduling action is dynamically selected by combining a greedy strategy, thereby determining the optimal execution path and matching model, and improving the accuracy of task scheduling and resource utilization efficiency.

[0017] Furthermore, S5 includes the following steps: S51. Based on the initial task scheduling results, obtain the target task execution path and target matching generation model corresponding to each scheduled task. Check whether each scheduled task meets the preset generation quality constraints, preset latency constraints, and preset edge resource constraints. If there is a scheduled task that does not meet any of the constraints, reselect the suboptimal target task execution path and suboptimal target matching generation model from the candidate execution path set, and perform constraint checks again until all scheduled tasks meet the preset generation quality constraints, preset latency constraints, and preset edge resource constraints, and obtain an effective task-level scheduling result. S52. Based on the effective task-level scheduling results, obtain the current online status of the target edge small model and the current remaining memory capacity of the edge server where the target edge small model is located. When the current online status is offline and the current remaining memory capacity is greater than or equal to the memory capacity required to load the target edge small model, load the target edge small model into the online model pool. When the current online status is offline and the current remaining memory capacity is less than the memory capacity required to load, select the edge small model that is not currently called by a task and has the lowest loading and unloading overhead from the online model pool, perform the unloading operation, and then load the target edge small model into the online model pool. S53. Obtain the cumulative access frequency and loading / unloading overhead of the target edge mini-model, and calculate the retention value of the target edge mini-model. When the retention value of the target edge mini-model is lower than a preset retention threshold and the target edge mini-model is not called by the current time slot task, unload the target edge mini-model to the offline model pool. The mathematical expression for the retention value of the target edge mini-model is: In the formula, Indicates the first The retained values ​​of a small model of the target edge. Indicates the first The cumulative access frequency of each target edge mini-model Indicates the first Loading and unloading overhead of small target edge models; S54. Based on the online status of the target edge small model in the online model pool and the offline status of the target edge small model in the offline model pool, update the model status information corresponding to each effective task level in the effective task-level scheduling result to obtain the resource-level scheduling result.

[0018] In this scheme, the effectiveness of task scheduling is ensured through constraint checks and path reselection. Edge server memory resources are optimized by dynamically loading and unloading small edge models. Based on access frequency and loading / unloading overhead, retention values ​​are calculated and low-value models are unloaded. The model status information is updated to complete the resource-level scheduling results, thereby improving the efficiency of edge resource utilization and the quality of task scheduling.

[0019] Furthermore, S6 includes the following steps: S61. Based on the resource-level scheduling result, execute the scheduled image generation task in the current time slot, obtain the task completion delay, system execution overhead and cache reuse benefit, and use the task completion delay, system execution overhead and cache reuse benefit as execution feedback data; S62. Based on the system state at the next moment collected from the execution feedback data, the system state at the current moment, the scheduling action executed in the current time slot, the instant reward value, and the system state at the next moment are combined into a state transition tuple, and the state transition tuple is stored in the experience replay pool. The instant reward value is obtained by analyzing the task completion delay, system execution overhead, and cache reuse benefits. S63. Randomly sample state transition tuples from the experience replay pool, and calculate the target state action value based on the state transition tuples. The mathematical expression for the target state action value is: In the formula, Indicates the first The target state action value of the time slot. Indicates the first The immediate reward value obtained after executing a scheduling action in a time slot. Indicates the discount factor. Indicates the candidate action Find the maximum value operation The state-action value function represents the target network. Indicates the first The system state vector of the time slot, This indicates that the target network predicts the next state. Execute each candidate action. The action state value at that time, This indicates that the target network predicts the next state. Execute each candidate action. Select the largest state action value at that time; S64. Update the main network parameters of the task scheduling model according to the target state action value to obtain the updated main network parameters. Determine whether the current parameter update count of the task scheduling model has reached the preset synchronization step count. If yes, synchronize the updated main network parameters to the target network to obtain the synchronized target network parameters. If no, keep the current parameters of the target network unchanged, and use the updated main network parameters and the synchronized target network parameters or the current parameters of the target network as the updated model parameters. Use the execution feedback data, the updated model parameters, and the incremented iteration rounds as the current state data. S65. Based on the execution feedback data and iteration round in the current state data, determine whether the preset termination condition is met. If yes, stop the iteration. If no, update the system state based on the execution feedback data and re-execute steps S2 to S6.

[0020] In this scheme, execution feedback data is collected and state transition tuples are constructed and stored in the experience replay pool. Target state action values ​​are randomly sampled and calculated to update the main network parameters. When the preset synchronization step count is reached, the main network parameters are synchronized to the target network. Based on the execution feedback data and iteration rounds, the termination condition is determined, thereby achieving stable training and adaptive optimization of the task scheduling model. This effectively reduces task completion latency and system execution overhead, and enhances cache reuse benefits.

[0021] Furthermore, in S65, the preset termination condition is that the iteration round reaches a preset maximum round, or the task completion delay in the execution feedback data is less than a preset delay threshold and the cache reuse benefit is greater than a preset benefit threshold.

[0022] In this scheme, by setting dual criteria of maximum number of rounds and latency benefit, training is terminated in a timely manner when the latency and benefit targets are met, avoiding excessive iteration and ensuring that task scheduling meets performance requirements. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating a cache-aware size model cloud-edge collaborative multi-task scheduling method according to an embodiment of the present invention. Figure 2 This is a system model diagram of a cache-aware size model cloud-edge collaborative multi-task scheduling method according to an embodiment of the present invention. Detailed Implementation

[0024] The following detailed description illustrates the specific implementation method: like Figure 1 and Figure 2 As shown, a cache-aware size-based cloud-edge collaborative multi-task scheduling method includes the following steps: S1. Construct a cloud-edge collaborative task scheduling system that includes multiple edge servers, a central cloud server, and multiple user terminals, and initialize the cloud-edge collaborative task scheduling system to obtain the initialized cloud-edge collaborative task scheduling system. The edge servers deploy small edge models, and the central cloud server deploys large cloud models. S2. Obtain user task request data from user terminals in the initialized cloud-edge collaborative task scheduling system, and construct a task-model-cache mapping relationship based on user task request data, edge small model model data, cloud large model model data and current cache status data. S3. Generate a set of candidate execution paths for each task to be scheduled by the task-model-cache mapping relationship, and perform priority sorting analysis on the set of candidate execution paths to obtain the sequence of tasks to be scheduled. S4. Based on the sequence of tasks to be scheduled, obtain the current system state vector of the cloud-edge collaborative task scheduling system after initialization, and input the system state vector into the task scheduling model for analysis to obtain the initial task scheduling result. Based on the initial task scheduling result, determine the target task execution path and target matching generation model of each task to be scheduled in the candidate execution path set in the sequence of tasks to be scheduled. S5. Based on the target task execution path and target matching generation model, the initial task scheduling results are constrained and checked to obtain effective task-level scheduling results that meet the preset constraints. Based on the effective task-level scheduling results, resource-level scheduling is performed on the target edge small models in each edge server to obtain resource-level scheduling results. S6. Analyze the image generation task to be scheduled based on the resource-level scheduling results, obtain execution feedback data, and determine whether the execution feedback data meets the preset termination condition. If yes, stop the iteration; otherwise, re-execute steps S2 to S6 based on the execution feedback data until the preset termination condition is met.

[0025] Specifically, S1 includes the following steps: S11. Configure the system networking of multiple edge servers, one central cloud server and multiple user terminals according to the preset system networking configuration parameters to obtain the cloud-edge collaborative task scheduling system. S12. According to the cloud-edge collaborative task scheduling system, deploy an edge mini-model on the edge server and configure a local cache space for the edge server to obtain the edge server configuration result with the edge mini-model and local cache space configured. S13. Based on the edge server configuration result, deploy the cloud-based large model on the central cloud server and configure the cloud-based cache space on the central cloud server to obtain the central cloud server configuration result with the cloud-based large model and cloud-based cache space configured. S14. Based on the configuration results of the central cloud server, initialize the status of the task queue to be scheduled, the local cache status, the online status of the edge mini-model, and the status of the available edge resources of the edge server to obtain the initialization status data of the cloud-edge collaborative task scheduling system. S15. Initialize the model parameters, target network parameters, and experience replay pool of the Dueling DQN network based on the initialization status data of the cloud-edge collaborative task scheduling system. Obtain the image generation request initiated by the user terminal through the edge server, and extract the text prompts, generation quality constraints, maximum tolerable latency, and cache reuse requirements from the image generation request to obtain the initialized cloud-edge collaborative task scheduling system.

[0026] Further, in step S11, firstly, the preset system networking configuration parameters include the number of edge servers, the network address of the central cloud server, user terminal registration information, the communication protocol type between each device, a list of pre-allocated unique port numbers for the model inference service process on each edge server, and data transmission bandwidth allocation weights. The number of edge servers is determined based on the user density and computing load within the actual coverage area; for example, the number of edge servers is set to 5. The central cloud server network address uses a fixed IP address and port number, and the user terminal registration information includes a terminal identifier and an access authentication key. The communication protocol type is selected as an application layer protocol based on TCP / IP, and the data transmission bandwidth allocation weights are determined based on the historical task load ratio of each edge server; for example, the bandwidth allocation weights for edge servers 1 to 5 are set to 0.2, 0.2, 0.2, 0.2, and 0.2, respectively. Then, according to the preset system networking configuration parameters, multiple edge servers are connected to the central cloud server via wired or wireless networks, and multiple user terminals are connected to the nearest edge server. Simultaneously, routing tables and quality of service policies are configured for each device, ultimately forming a three-layer cloud-edge collaborative task scheduling system comprising the edge layer, cloud layer, and terminal layer. The port number list is generated by avoiding reserved system port ranges and commonly used service port ranges already occupied by the edge server's operating system, while ensuring that port conflicts do not occur between different service processes on the same edge server.

[0027] In step S12, firstly, for each edge server, a pre-trained edge mini-model file is obtained from the central cloud server. The edge mini-model adopts a lightweight convolutional neural network structure, which includes 3 convolutional layers, 2 pooling layers, and 2 fully connected layers. The model parameters of the edge mini-model are less than 10 megabytes. The edge mini-model file is loaded into the graphics processor memory of the edge server. When the edge server starts the model inference service process, the specified port number allocated to the current edge mini-model inference service process is read from the port number list. For example, the port number is set to 8501, which is within the user port range and does not occupy the Hypertext Transfer Protocol standard port 80 and the Hypertext Transfer Security Protocol standard port 443. Then, a local cache space is configured for each edge server. The capacity of the local cache space is determined based on the remaining capacity of the edge server's solid-state drive and the expected cache hit rate. For example, the local cache space capacity is set to 200 gigabytes. The local cache space uses a key-value storage structure. The keys in this structure are the hash values ​​of the text prompts, and the values ​​are the generated image data and their timestamps. During configuration, the edge server operating system creates a directory to store cached data, sets the cache eviction policy to the Least Recently Used algorithm, and initializes the cache index table, completing the edge server configuration.

[0028] In step S13, the central cloud server reads the edge small model type and local cache space capacity information from the configuration results of all edge servers. Then, it loads the cloud-based large model from the central cloud server's model repository. The cloud-based large model adopts a deep Transformer decoder structure, which includes 24 decoding layers, 16 attention heads, and an embedding dimension of 1024. The model parameters of the cloud-based large model exceed 1 billion bytes. The cloud-based large model is deployed to multiple graphics processors on the central cloud server for distributed inference, and a model service interface is created. Simultaneously, a cloud cache space is configured for the central cloud server. The capacity of the cloud cache space is determined based on the total storage resources of the central cloud server and the total capacity of the local cache spaces of all edge servers; for example, the cloud cache space capacity is set to 2 terabytes. The cloud cache space uses a distributed file system, indexed by the semantic feature vector of the text prompt, to store high-quality generated images and their metadata, and sets the cache update cycle to 24 hours. Finally, the central cloud server configuration result is completed.

[0029] In step S14, the central cloud server sends an initialization command to each edge server based on the network topology and service interface information in the central cloud server configuration result. Upon receiving the initialization command, each edge server initializes its task queue to an empty queue. The task queue adopts a first-in-first-out (FIFO) queue structure, and the maximum queue length is determined based on the edge server's memory size; for example, the maximum queue length is set to 100 tasks. The local cache state is initialized by scanning existing files in the local cache space and constructing a cache index table. The cache index table records the key, size, access time, and hit count of each cache item, with the initial hit count set to 0. The edge mini-model online state is initialized by detecting whether the edge mini-model inference process is running normally. If the process is running normally, the online state is set to 1; otherwise, it is set to 0. Initially, the online state of all edge mini-models is set to 1. The edge available resource state is initialized by reading the edge server's CPU idle rate, GPU idle rate, memory free capacity, and network bandwidth free value, forming a resource state vector. The resource state vectors of all edge servers are aggregated and sent to the central cloud server, which integrates all initialization data into initialization state data.

[0030] In step S15, the number of edge servers, task queue length, and resource dimensions are first extracted from the initialization state data to determine the input state dimension and output action dimension of the Dueling DQN network. The Dueling DQN network employs a fully connected neural network structure, which includes an input layer, two hidden layers, and an output layer. The hidden layer has 256 and 128 neurons, respectively, and the output layer is divided into two branches: a value network and a dominance network. The model parameters of the Dueling DQN network are randomly initialized using the Xavier uniform distribution initialization method. The target network parameters directly copy the initial values ​​of the current model parameters, ensuring the target network has the same structure as the current network. The experience replay pool uses a circular buffer structure, with the buffer capacity determined based on available memory; for example, the experience replay pool capacity is set to 10,000 experience records. Then, the edge servers open request listening ports to receive image generation requests initiated by user terminals. Each image generation request includes a text prompt field, a generation quality constraint field, a maximum tolerable latency field, and a cache reuse requirement field. The edge server parses the request message, extracts the specific string of the text prompt according to the protocol format, generates the resolution value and fidelity level of the quality constraint, the maximum tolerable latency value in milliseconds, and the boolean flag of cache reuse requirements, and together with the initialized network parameters, target network parameters, and experience replay pool, constitutes the initialized cloud-edge collaborative task scheduling system.

[0031] Specifically, S2 includes the following steps: S21. Based on the user task request data and current cache status data from the user terminal, analyze the original total number of denoising steps and the normalized cache matching degree for each task to be scheduled to obtain the actual number of denoising steps after cache reuse. The mathematical expression for the actual number of denoising steps is: In the formula, Indicates the first The actual number of denoising steps for each scheduled task after cache reuse. Indicates the first Normalized cache match degree of each pending task Indicates the first The total number of raw denoising steps for each task to be scheduled; S22. Calculate the latency fit between each scheduled task and each candidate model based on the actual number of denoising steps after cache reuse and the average inference latency per step of each candidate model, wherein the mathematical expression for the latency fit is: In the formula, Indicates the first The number of tasks to be scheduled and the first Latency fit between candidate models Indicates the first The maximum tolerable latency for each pending task. Indicates the first The task to be scheduled calls the first The average communication latency of the corresponding execution path for each candidate model. Indicates the first Average inference latency per step for each candidate model; S23. Based on the model data of the edge small model and the model data of the cloud large model, obtain the model generation accuracy and the maximum supported resolution of each candidate model. Then, based on the latency adaptation, the model generation accuracy, and the maximum supported resolution of each candidate model, calculate the joint matching degree between each scheduled task and each candidate model. Finally, construct a task-model-cachate mapping relationship based on the joint matching degree. The mathematical expression for the joint matching degree is: In the formula, Indicates the first The number of tasks to be scheduled and the first Joint matching degree among candidate models Indicates the first Model generation accuracy of each candidate model Indicates the first Quality constraints for the generation of each task to be scheduled. Indicates the first The maximum supported resolution of each candidate model. Indicates the first The target resolution requirement for each task to be scheduled. This represents the function that takes the minimum value.

[0032] Further, in step S21, the user task request data from the user terminal is parsed, and the original total number of denoising steps for each task to be scheduled is directly read from the user task request data. Simultaneously, the edge server obtains the current cache status data, which is provided by the cache index table maintained by the edge server. The cache index table records the hash values ​​of the text prompts corresponding to the cached images. The edge server calculates the semantic similarity score between the text prompt of the task to be scheduled and the text prompts of each cached item in the cache index table, and normalizes the semantic similarity score to obtain the normalized cache matching degree. The value range of the normalized cache matching degree is determined based on the maximum and minimum similarity scores of all cached items in the current cache index table. For example, the normalized cache matching degree corresponding to the maximum similarity score is set to 1.0, and the normalized cache matching degree corresponding to the minimum similarity score is set to 0.0. The edge server subtracts the normalized cache matching degree from the value 1 to obtain the cache discount factor, and multiplies the original total number of denoising steps by the cache discount factor to obtain the actual number of denoising steps after cache reuse.

[0033] In step S22, the actual number of denoising steps after cache reuse is read from the task control block corresponding to the task to be scheduled. The maximum tolerable latency for each pending task is determined based on the user-submitted requirements. For example, the first task to be scheduled... The maximum tolerable latency for each scheduled task is set to 3000 milliseconds. For each candidate model, the edge server obtains the pre-determined average single-step inference latency. The average single-step inference latency is determined by calculating the arithmetic mean of the inference time taken when performing multiple inference operations on the candidate model with a fixed input size. For example, the average single-step inference latency for a small edge model is set to 40 milliseconds, and the average single-step inference latency for a large cloud model is set to 500 milliseconds. The edge server also obtains the average communication latency of the execution path corresponding to the scheduled task calling the candidate model. This average communication latency is determined based on the moving average of the real-time network round-trip latency between the candidate model's deployment location and the edge server. For example, the average communication latency for the edge server calling a locally deployed small edge model is set to 2 milliseconds, and the average communication latency for the edge server calling a large cloud model deployed on the central cloud server is set to 85 milliseconds.

[0034] In step S23, the model data of the edge small model and the model data of the cloud large model are read. The model generation accuracy and maximum supported resolution of the edge small model are extracted from the metadata fields of the edge small model data, and the model generation accuracy and maximum supported resolution of the cloud large model are also extracted from the metadata fields of the cloud large model data. The edge server extracts the generation quality constraints and target resolution requirements from the request data of the tasks to be scheduled. Based on the latency adaptability, the model generation accuracy of each candidate model, and the maximum supported resolution of each candidate model, the edge server calculates the joint matching degree between each task to be scheduled and each candidate model. When calculating the joint matching degree, the edge server calculates a first ratio of model generation accuracy to generation quality constraints and a second ratio of maximum supported resolution to target resolution requirements. The minimum value among the latency adaptability, the first ratio, and the second ratio is then taken as the joint matching degree. The baseline values ​​for model generation accuracy and maximum supported resolution are determined based on the actual test metrics of candidate models on the standard validation set. For example, the model generation accuracy for small edge models is set to 0.75, and the model generation accuracy for large cloud models is set to 0.91. The maximum supported resolution for small edge models is set to 512 pixels, and the maximum supported resolution for large cloud models is set to 1024 pixels. The edge server iterates through all candidate models for each scheduled task, obtaining a joint matching degree list between the task and each candidate model. The edge server selects the candidate model with the highest joint matching degree value from this list as the scheduling target for the task. It then associates the task identifier of the task, the model identifier of the selected candidate model, and the cache storage location corresponding to the selected candidate model, constructing a task-model-cache mapping relationship.

[0035] Specifically, S3 includes the following steps: S31. Based on the task-model-cached mapping relationship, obtain the current cache status data corresponding to each scheduled task. Determine whether the cache content corresponding to each scheduled task exists based on the current cache status data. If the cache content exists and is completely consistent with the task output requirements, generate a cache reuse path. If the cache content exists and the similarity of the feature vector with the task output requirements is greater than the preset similarity threshold, and the proportion of the remaining computing power of the edge small model is greater than the preset computing power threshold, generate a cache-assisted edge generation path. If the cache content does not exist and the proportion of the remaining computing power of the edge small model is greater than the preset computing power threshold, generate an edge generation path. If the task generation quality parameters exceed the upper limit of the edge small model's capabilities, generate a cloud generation path, forming a set of candidate execution paths for each scheduled task. S32. Calculate the scheduling priority of each scheduled task based on its task waiting time, normalized cache matching degree, and maximum tolerable latency in the candidate execution path set. The mathematical expression for the scheduling priority is: In the formula, Indicates the first The scheduling priority corresponding to each task to be scheduled. Indicates the first The waiting time for each pending task; S33. Sort the tasks to be scheduled in the candidate execution path set in descending order according to the scheduling priority of each task to be scheduled, and obtain the sequence of tasks to be scheduled.

[0036] Further, in step S31, by querying a pre-established mapping table of task identifiers, model identifiers, and cache addresses, the cache content metadata stored in the cache server is read, including content hash values, feature vectors, and output format tags. The existence of cache content corresponding to each task is determined based on the content existence tags in the current cache status data. If the existence tag is true, the output format tags of the cache content are compared to see if they are completely consistent with the format tags in the task output requirements. Simultaneously, the data dimensions, data types, and numerical ranges of the cache content are compared to see if they completely match the task output requirements. If all are consistent, a cache reuse path is generated, which records the cache address and direct reference operations. If cached content exists but its format or dimensions are not entirely consistent, the cosine similarity between the feature vector of the cached content and the feature vector required for the task output is calculated. The preset similarity threshold is determined based on the lowest acceptable reconstruction quality in historical tasks; for example, the preset similarity threshold is set to 0.85. Simultaneously, the remaining computing power percentage of the edge mini-model is obtained. This percentage is calculated by dividing the current idle computing resources monitored in real-time by the total computing resources of the edge device. The preset computing power threshold is determined based on the minimum idle resource requirement for the edge device to process auxiliary generation tasks; for example, the preset computing power threshold is set to 0.3. If the similarity is greater than the preset similarity threshold and the remaining computing power percentage of the edge mini-model is greater than the preset computing power threshold, a cache-assisted edge generation path is generated. This path includes the cached content as initial feature input and execution instructions for fine-tuning the edge mini-model. If the cached content does not exist and the remaining computing power percentage of the edge mini-model is greater than the preset computing power threshold, an edge generation path is generated, specifying that the edge mini-model should start generating inference from scratch. If the task-generated quality parameters exceed the capability limit of the edge small model, a cloud-based generation path is generated. This cloud-based generation path includes a transmission channel for uploading task data to the cloud-based large model. The task-generated quality parameters are the maximum value among the required output resolution, signal-to-noise ratio, or accuracy, and the edge small model capability limit is the highest quality metric achieved by the edge small model in the training set. Finally, the set of one or more paths generated for each task is combined to form a candidate execution path set.

[0037] In step S32, for each scheduled task in the candidate execution path set, the task waiting time, normalized cache matching degree, and maximum tolerable latency of the scheduled task are read from the task control block. The task waiting time is determined by the difference between the task arrival timestamp on the edge server and the current system clock, and this task waiting time is in milliseconds; for example, the task waiting time is set to 120 milliseconds. A higher scheduling priority value indicates a higher urgency of the scheduled task and a higher cache reuse benefit. The edge server stores this scheduling priority value in the task control block.

[0038] In step S33, the scheduling priority value of each task to be scheduled is bound to its task identifier, forming a key-value pair set. The quicksort algorithm is used to sort this key-value pair set in descending order of priority value. During the sorting process, the priority values ​​of two tasks are compared; if the former is greater than the latter, their positions are swapped; otherwise, the original order is maintained. For tasks with equal priority values, their original relative order is maintained according to their arrival times. After sorting, task identifiers are retrieved sequentially in descending order of priority, forming an ordered list of task identifiers. This ordered list of task identifiers is the sequence of tasks to be scheduled. The sorting operation is performed once within each scheduling decision cycle. The execution cycle is dynamically adjusted based on the task arrival rate, typically set between 100 milliseconds and 500 milliseconds. This scheduling decision cycle is determined based on the average task arrival interval; for example, a scheduling decision cycle of 200 milliseconds can be set.

[0039] Specifically, S4 includes the following steps: S41. Based on the sequence of tasks to be scheduled, collect the status of the task queue, cache status, online status of the edge mini-model, and status of available edge resources to obtain a set of resource statuses; S42. Collect data on the single load / unload overhead of edge small models, the cumulative access frequency of edge small models, and the availability status of cloud large models to obtain model status parameters. S43. Combine the resource state set, model state parameters, and normalized cache matching degree and task requirement parameters with each scheduled task to obtain the system state vector. S44. Construct a task scheduling model based on the Dueling DQN network, including a value network and a dominance network. Input the system state vector into the task scheduling model, analyze the system state vector through the value network to obtain the state value function value, analyze the system state vector through the dominance network to obtain the dominance function value corresponding to each candidate action, and calculate the state action value corresponding to each candidate action based on the state value function value and the dominance function value corresponding to each candidate action. The mathematical expression of the state action value is: In the formula, The time slot number representing the scheduling decision. Indicates the first The system state vector of the time slot, Indicates the first The time slot is the selected scheduling action for the current state. Indicates the first System state vector of time slot Execute scheduling actions The corresponding state action value, This represents the system state vector fitted by the value network. The value of the state value function under the given conditions is as follows: This represents the state vector of the system fitted by the dominant network. Execute scheduling actions The value of the advantage function at that time. Represents the set of candidate actions. Represents the set of candidate actions Any candidate action in, Represents the system state vector Next, execute candidate actions The value of the dominant function at that time; S45, Adopt - The greedy strategy selects a scheduling action from the candidate action set and generates a random number. It then determines whether the random number is less than the preset exploration probability value. If so, it randomly selects a candidate action from the candidate action set as the scheduling action. If not, it selects the candidate action with the largest dynamic state value from the candidate action set as the scheduling action. S46. Determine the target task execution path corresponding to the scheduling action from the candidate execution path set according to the scheduling action, and determine the target matching generation model that matches the target task execution path according to the scheduling action.

[0040] Further, in step S41, the task identifier of each task to be scheduled is read sequentially from the sequence of tasks to be scheduled, and the task queue status is queried from the operating system kernel of the edge server based on the task identifier. The task queue status includes the total number of tasks currently queued in the sequence of tasks to be scheduled and the waiting time of each task. The edge server accesses the cache index table of its local cache space and reads the cache status, which includes the number of cache hits, the total cache capacity, and the used cache capacity. The edge server detects the running status of the edge mini-model inference process to obtain the online status of the edge mini-model. The edge server calls to read the CPU utilization, GPU utilization, available memory capacity, and remaining network bandwidth of the edge server, combines them into the edge available resource status, and forms a resource status set. This resource status set is a structured data group containing multi-dimensional status information.

[0041] In step S42, the timestamp records of each time the edge mini-model is loaded into and unloaded from the graphics processor memory are read from the local log file. The average of the single load cost and single unload cost is calculated to obtain the single load / unload cost of the edge mini-model. For example, the single load cost of the edge mini-model is set to 120 milliseconds, and the single unload cost is set to 80 milliseconds. The edge server reads the cumulative number of times the edge mini-model is called within the current time window from the local access counter to obtain the cumulative access frequency of the edge mini-model. For example, the cumulative access frequency of the edge mini-model is set to 45 times. The edge server sends an availability probe message to the central cloud server. After receiving the probe message, the central cloud server returns an acknowledgment response. The edge server determines the availability status of the cloud-based large model based on whether it receives the acknowledgment response and the content of the response. The availability status of the cloud-based large model includes two states: available and unavailable. The edge server summarizes the single load / unload cost of the edge mini-model, the cumulative access frequency of the edge mini-model, and the availability status of the cloud-based large model into model status parameters.

[0042] In step S43, specific values ​​for the task queue status, cache status, online status of the edge mini-model, and edge available resource status of each task to be scheduled are extracted from the resource status set. The normalized cache matching degree of each task to be scheduled is read from the normalized cache matching degree data. Simultaneously, task requirement parameters are extracted from the image generation request of the user terminal. These task requirement parameters include generation quality constraints, target resolution requirements, and maximum tolerable latency. The edge server arranges all the above values ​​in a fixed-dimensional order to form a one-dimensional system state vector. The values ​​of each dimension of this system state vector are normalized so that the value of each dimension is between 0 and 1.

[0043] In step S44, a task scheduling model comprising a value network and a dominance network is constructed. This model employs a Dueling DQN network structure. The value network and the dominance network share the first two hidden layers, with 256 and 128 neurons respectively. After the shared layer, the value network is connected to a fully connected value output layer, which outputs a scalar as the state value function value. After the shared layer, the dominance network is connected to another fully connected dominance output layer, whose output dimension is a vector equal to the size of the candidate action set. Each element of this vector corresponds to the dominance function value of a candidate action. After the edge server inputs the system state vector into the task scheduling model, the value network analyzes the system state vector to obtain the state value function value, and the dominance network analyzes the system state vector to obtain the dominance function value corresponding to each candidate action.

[0044] In step S45, the following is adopted: - A greedy strategy selects a scheduling action from the candidate action set. The edge server first calls a random number generation function to generate a random number uniformly distributed between 0 and 1. The preset exploration probability value is determined based on the balance requirements of the training and utilization phases. In the early stages of training, the preset exploration probability value is higher to fully explore the action space, and in the later stages of training, the preset exploration probability value is gradually reduced to utilize existing experience. For example, the preset exploration probability value can be set to 0.1. The edge server determines whether the random number is less than the preset exploration probability value. If the random number is less than the preset exploration probability value, the edge server randomly selects a candidate action from the candidate action set as the scheduling action; if the random number is greater than or equal to the preset exploration probability value, the edge server selects the candidate action with the largest state action value from the candidate action set as the scheduling action, that is, it utilizes the optimal decision of the current task scheduling model.

[0045] In step S46, the selected scheduling action is obtained. This scheduling action includes an action code. The edge server searches for a match from the candidate execution path set based on the action code to determine the target task execution path corresponding to the scheduling action. This target task execution path is a specific path among cache reuse paths, cache-assisted edge generation paths, edge generation paths, or cloud generation paths. Simultaneously, the edge server determines the target matching generation model that matches the target task execution path based on the model identifier field in the action code of the scheduling action. This target matching generation model is a specific model among edge small models or cloud large models. The edge server writes the identifier information of the target task execution path and the target matching generation model into the task control block.

[0046] Specifically, S5 includes the following steps: S51. Based on the initial task scheduling results, obtain the target task execution path and target matching generation model corresponding to each scheduled task. Check whether each scheduled task meets the preset generation quality constraints, preset latency constraints, and preset edge resource constraints. If there is a scheduled task that does not meet any of the constraints, reselect the suboptimal target task execution path and suboptimal target matching generation model from the candidate execution path set, and perform constraint checks again until all scheduled tasks meet the preset generation quality constraints, preset latency constraints, and preset edge resource constraints, and obtain an effective task-level scheduling result. S52. Based on the effective task-level scheduling results, obtain the current online status of the target edge small model and the current remaining memory capacity of the edge server where the target edge small model is located. When the current online status is offline and the current remaining memory capacity is greater than or equal to the memory capacity required to load the target edge small model, load the target edge small model into the online model pool. When the current online status is offline and the current remaining memory capacity is less than the memory capacity required to load, select the edge small model that is not currently called by a task and has the lowest loading and unloading overhead from the online model pool, perform the unloading operation, and then load the target edge small model into the online model pool. S53. Obtain the cumulative access frequency and loading / unloading overhead of the target edge mini-model, and calculate the retention value of the target edge mini-model. When the retention value of the target edge mini-model is lower than a preset retention threshold and the target edge mini-model is not called by the current time slot task, unload the target edge mini-model to the offline model pool. The mathematical expression for the retention value of the target edge mini-model is: In the formula, Indicates the first The retained values ​​of a small model of the target edge. Indicates the first The cumulative access frequency of each target edge mini-model Indicates the first Loading and unloading overhead of small target edge models; S54. Based on the online status of the target edge small model in the online model pool and the offline status of the target edge small model in the offline model pool, update the model status information corresponding to each effective task level in the effective task-level scheduling result to obtain the resource-level scheduling result.

[0047] Further, in step S51, the target task execution path and target matching generation model corresponding to each scheduled task are read from the initial task scheduling results. Then, each scheduled task is checked to see if it meets the preset generation quality constraints, preset latency constraints, and preset edge resource constraints. The preset generation quality constraints are determined based on whether the model generation accuracy of the target matching generation model is greater than or equal to the generation quality constraints of the scheduled task. For example, the preset generation quality constraints are set to a model generation accuracy of not less than 0.8. The preset latency constraints are determined based on whether the total execution latency of the target task execution path is less than or equal to the maximum tolerable latency of the scheduled task. For example, the preset latency constraints are set to a total execution latency of not more than 2000 milliseconds. The preset edge resource constraints are determined based on whether the current remaining memory capacity of the edge server is greater than or equal to the memory capacity required to load the edge small model when the target matching generation model is an edge small model. For example, the preset edge resource constraints are set to a remaining memory capacity of not less than 1.2 times the file size of the edge small model. If a task to be scheduled does not meet any of the constraints, the edge server selects the next untested candidate execution path from the set of candidate execution paths, in descending order of joint matching degree value, as the suboptimal target task execution path. Simultaneously, it selects the suboptimal target matching generation model corresponding to this suboptimal target task execution path and re-tests the aforementioned three constraints on the task to be scheduled. This reselection and testing process is repeated until all tasks to be scheduled meet the preset generation quality constraints, preset latency constraints, and preset edge resource constraints. At this point, the target task execution paths and target matching generation models corresponding to all tasks to be scheduled are summarized to obtain the effective task-level scheduling result.

[0048] In step S52, the model identifier of the target edge mini-model is read based on the effective task-level scheduling result. The edge server queries the list of model running processes in the online model pool according to the model identifier to obtain the current online status of the target edge mini-model. Simultaneously, the edge server obtains the current remaining memory capacity of the edge server where the target edge mini-model resides through the operating system memory management interface; this current remaining memory capacity is in megabytes. When the current online status is offline and the current remaining memory capacity is greater than or equal to the memory capacity required to load the target edge mini-model, the edge server loads the target edge mini-model from disk into the online model pool. The loading process includes allocating GPU memory space, copying model weight data, and starting the inference service process. When the current online status is offline and the current remaining memory capacity is less than the memory capacity required for loading, the edge server selects an edge mini-model from the online model pool that is not currently being called by a task and has the lowest loading / unloading overhead, and performs an unloading operation. The unloading operation includes stopping the inference service process of the edge mini-model and releasing the GPU memory space it occupies. The edge server then loads the target edge mini-model back into the online model pool.

[0049] In step S53, the cumulative access frequency of the target edge mini-model is obtained from the model status parameters, and the loading and unloading cost value corresponding to the target edge mini-model is read from the single loading and unloading cost of the edge mini-model. The preset retention threshold is determined based on the total capacity of the online model pool and the maximum number of models that the edge server can support. For example, the preset retention threshold is set to 0.15. It is determined whether the retention value of the target edge mini-model is lower than the preset retention threshold, and at the same time, it is determined whether the target edge mini-model has not been called by the current time slot task. If both of the above conditions are met, the target edge mini-model is unloaded from the online model pool. The unloaded target edge mini-model is moved to the offline model pool, which stores the model file but does not load it into the graphics processor memory.

[0050] In step S54, each scheduled task in the valid task-level scheduling results is traversed, and the target edge small model identifier corresponding to the scheduled task is read. Then, the model record tables of the online model pool and the offline model pool are queried. If the target edge small model is in the online model pool, the model status information of the scheduled task is marked as online available; if the target edge small model is in the offline model pool, the model status information of the scheduled task is marked as offline available, and the required memory capacity for loading is recorded. All updated task scheduling information, including the target task execution path, target matching generation model, model status information, and resource allocation records, are summarized into a resource-level scheduling result.

[0051] Specifically, S6 includes the following steps: S61. Based on the resource-level scheduling result, execute the scheduled image generation task in the current time slot, obtain the task completion delay, system execution overhead and cache reuse benefit, and use the task completion delay, system execution overhead and cache reuse benefit as execution feedback data; S62. Based on the system state at the next moment collected from the execution feedback data, the system state at the current moment, the scheduling action executed in the current time slot, the instant reward value, and the system state at the next moment are combined into a state transition tuple, and the state transition tuple is stored in the experience replay pool. The instant reward value is obtained by analyzing the task completion delay, system execution overhead, and cache reuse benefits. S63. Randomly sample state transition tuples from the experience replay pool, and calculate the target state action value based on the state transition tuples. The mathematical expression for the target state action value is: In the formula, Indicates the first The target state action value of the time slot. Indicates the first The immediate reward value obtained after executing a scheduling action in a time slot. Indicates the discount factor. Indicates the candidate action Find the maximum value operation The state-action value function represents the target network. Indicates the first The system state vector of the time slot, This indicates that the target network predicts the next state. Execute each candidate action. The action state value at that time, This indicates that the target network predicts the next state. Execute each candidate action. Select the largest state action value at that time; S64. Update the main network parameters of the task scheduling model according to the target state action value to obtain the updated main network parameters. Determine whether the current parameter update count of the task scheduling model has reached the preset synchronization step count. If yes, synchronize the updated main network parameters to the target network to obtain the synchronized target network parameters. If no, keep the current parameters of the target network unchanged, and use the updated main network parameters and the synchronized target network parameters or the current parameters of the target network as the updated model parameters. Use the execution feedback data, the updated model parameters, and the incremented iteration rounds as the current state data. S65. Based on the execution feedback data and iteration round in the current state data, determine whether the preset termination condition is met. If yes, stop the iteration. If no, update the system state based on the execution feedback data and re-execute steps S2 to S6.

[0052] Specifically, in S65, the preset termination condition is that the iteration round reaches a preset maximum round, or the task completion delay in the execution feedback data is less than a preset delay threshold and the cache reuse benefit is greater than a preset benefit threshold.

[0053] Further, in step S61, according to the target task execution path and target matching generation model specified for each scheduled task in the resource-level scheduling result, the corresponding edge small model or cloud large model is called to perform image generation operation. After each task is completed, the time difference from the arrival time to the completion time of the task is recorded as the task completion delay. The weighted sum of the edge server graphics processor usage time and the amount of network data transmitted during the execution of the task is recorded as the system execution overhead. The inference calculation time saved if the task hits the cache is converted into cache reuse benefit. The task completion delay, system execution overhead and cache reuse benefit are used as execution feedback data.

[0054] In step S62, after all tasks in the current time slot have been executed, the task queue state, cache state, edge mini-model online state, and edge available resource state for the next time moment are collected and combined into the system state vector for the next time moment. The system state vector of the current time moment, the scheduling action executed in the current time slot, the immediate reward value, and the system state vector of the next time moment are combined into a state transition tuple. The immediate reward value is obtained based on the analysis of task completion latency, system execution overhead, and cache reuse benefits. Specifically, the edge server adds the negative value of the latency penalty factor to the cache reuse benefit value, and then adds the negative value of the overhead penalty factor. The latency penalty factor is the sum of the amounts by which the completion latency of all tasks exceeds their respective maximum tolerable latency, and the overhead penalty factor is the amount by which the system execution overhead exceeds the preset overhead limit. The immediate reward value is ultimately a scalar value. This state transition tuple is stored in the circular buffer of the experience replay pool.

[0055] In step S63, a state transition tuple is randomly sampled from the experience replay pool. This tuple contains the current system state vector, scheduling action, immediate reward value, and the system state vector for the next time step. A target network is obtained, which is a neural network with the same structure as the main network. The system state vector for the next time step is input into the target network, and the target network outputs a vector of state action values ​​corresponding to all candidate actions under the system state vector at that next time step. The maximum value among these is selected as the maximum target state action value. The discount factor is determined based on the task scheduling system's emphasis on future rewards. For example, setting the discount factor to 0.95 indicates that the discount rate for future rewards is 95%.

[0056] In step S64, the main network parameters of the task scheduling model are updated according to the target state action value. Specifically, the edge server extracts the current system state vector and scheduling action from the state transition tuple, inputs the current system state vector into the main network to obtain the predicted current state action value under the given scheduling action, calculates the mean squared error between the current state action value and the target state action value as the loss function value, and uses the adaptive moment estimation optimization algorithm to update all trainable parameters of the main network using this loss function value through gradient backpropagation to obtain the updated main network parameters. The preset synchronization step count is determined based on training stability and convergence speed; for example, it is set to 200 steps. The edge server determines whether the number of current parameter updates of the task scheduling model has reached the preset synchronization step count. If it has, the updated main network parameters are completely copied and synchronized to the target network to obtain the synchronized target network parameters; otherwise, the current parameters of the target network remain unchanged. The edge server uses the updated main network parameters and the synchronized target network parameters or the current parameters of the target network as the updated model parameters, and uses the execution feedback data, the updated model parameters, and the incremented iteration rounds as the current state data.

[0057] In step S65, the preset termination condition specifically includes two sub-conditions: the first sub-condition is that the number of iteration rounds reaches a preset maximum number of rounds, which is determined based on the total training time requirement and model convergence experience. For example, the preset maximum number of rounds is set to 10,000 rounds. The second sub-condition is that the task completion latency in the execution feedback data is less than a preset latency threshold and the cache reuse benefit is greater than a preset benefit threshold. The preset latency threshold is determined based on the minimum user service quality requirements. For example, the preset latency threshold is set to 1500 milliseconds. The preset benefit threshold is determined based on the scale of reusable resources for image generation task cache, business latency constraints, and system execution overhead benchmarks. For example, the preset benefit threshold is set to 80% of the theoretical upper limit of single-slot cache reuse benefit. The theoretical upper limit of single-slot cache reuse benefit is the total amount of computation saved corresponding to all reusable historical image feature caches in that slot. For example, the theoretical upper limit of single-slot cache reuse benefit is set to 120 GFLOPs (billions of floating-point operations per second). The edge server determines whether any of the above sub-conditions are met. If they are met, the iteration stops and the entire scheduling process ends. If not, the edge server recalculates the normalized cache matching degree, latency adaptation degree, and joint matching degree of all tasks to be scheduled based on the task completion latency, system execution overhead, and cache reuse benefits in the execution feedback data, in accordance with steps S21 to S23, and re-executes steps S2 to S6 to enter the scheduling loop of the next time slot.

Claims

1. A cache-aware size-based cloud-edge collaborative multi-task scheduling method, characterized in that: Includes the following steps: S1. Construct a cloud-edge collaborative task scheduling system that includes multiple edge servers, a central cloud server, and multiple user terminals, and initialize the cloud-edge collaborative task scheduling system to obtain the initialized cloud-edge collaborative task scheduling system. The edge servers deploy small edge models, and the central cloud server deploys large cloud models. S2. Obtain user task request data from user terminals in the initialized cloud-edge collaborative task scheduling system, and construct a task-model-cache mapping relationship based on user task request data, edge small model model data, cloud large model model data and current cache status data. S3. Generate a set of candidate execution paths for each task to be scheduled by the task-model-cache mapping relationship, and perform priority sorting analysis on the set of candidate execution paths to obtain the sequence of tasks to be scheduled. S4. Based on the sequence of tasks to be scheduled, obtain the current system state vector of the cloud-edge collaborative task scheduling system after initialization, and input the system state vector into the task scheduling model for analysis to obtain the initial task scheduling result. Based on the initial task scheduling result, determine the target task execution path and target matching generation model of each task to be scheduled in the candidate execution path set. S5. Based on the target task execution path and target matching generation model, the initial task scheduling results are constrained and checked to obtain effective task-level scheduling results that meet the preset constraints. Based on the effective task-level scheduling results, resource-level scheduling is performed on the target edge small models in each edge server to obtain resource-level scheduling results. S6. Analyze the image generation task to be scheduled based on the resource-level scheduling results, obtain execution feedback data, and determine whether the execution feedback data meets the preset termination condition. If yes, stop the iteration; otherwise, re-execute steps S2 to S6 based on the execution feedback data until the preset termination condition is met.

2. The cache-aware size model cloud-edge collaborative multi-task scheduling method according to claim 1, characterized in that: S1 includes the following steps: S11. Configure the system networking of multiple edge servers, one central cloud server and multiple user terminals according to the preset system networking configuration parameters to obtain the cloud-edge collaborative task scheduling system. S12. According to the cloud-edge collaborative task scheduling system, deploy an edge mini-model on the edge server and configure a local cache space for the edge server to obtain the edge server configuration result with the edge mini-model and local cache space configured. S13. Based on the edge server configuration result, deploy the cloud-based large model on the central cloud server and configure the cloud-based cache space on the central cloud server to obtain the central cloud server configuration result with the cloud-based large model and cloud-based cache space configured. S14. Based on the configuration results of the central cloud server, initialize the status of the task queue to be scheduled, the local cache status, the online status of the edge mini-model, and the status of the available edge resources of the edge server to obtain the initialization status data of the cloud-edge collaborative task scheduling system. S15. Initialize the model parameters, target network parameters, and experience replay pool of the Dueling DQN network based on the initialization status data of the cloud-edge collaborative task scheduling system. Obtain the image generation request initiated by the user terminal through the edge server, and extract the text prompts, generation quality constraints, maximum tolerable latency, and cache reuse requirements from the image generation request to obtain the initialized cloud-edge collaborative task scheduling system.

3. The cache-aware size model cloud-edge collaborative multi-task scheduling method according to claim 1, characterized in that: S2 includes the following steps: S21. Based on the user task request data and current cache status data from the user terminal, analyze the original total number of denoising steps and the normalized cache matching degree for each task to be scheduled to obtain the actual number of denoising steps after cache reuse. The mathematical expression for the actual number of denoising steps is: In the formula, Indicates the first The actual number of denoising steps for each scheduled task after cache reuse. Indicates the first Normalized cache match degree of each pending task Indicates the first The total number of raw denoising steps for each task to be scheduled; S22. Calculate the latency fit between each scheduled task and each candidate model based on the actual number of denoising steps after cache reuse and the average inference latency per step of each candidate model, wherein the mathematical expression for the latency fit is: In the formula, Indicates the first The number of tasks to be scheduled and the first Latency fit between candidate models Indicates the first The maximum tolerable latency for each pending task. Indicates the first The task to be scheduled calls the first The average communication latency of the corresponding execution path for each candidate model. Indicates the first Average inference latency per step for each candidate model; S23. Based on the model data of the edge small model and the model data of the cloud large model, obtain the model generation accuracy and the maximum supported resolution of each candidate model. Then, based on the latency adaptation, the model generation accuracy, and the maximum supported resolution of each candidate model, calculate the joint matching degree between each scheduled task and each candidate model. Finally, construct a task-model-cachate mapping relationship based on the joint matching degree. The mathematical expression for the joint matching degree is: In the formula, Indicates the first The number of tasks to be scheduled and the first Joint matching degree among candidate models Indicates the first Model generation accuracy of each candidate model Indicates the first Quality constraints for the generation of each task to be scheduled. Indicates the first The maximum supported resolution of each candidate model. Indicates the first The target resolution requirement for each task to be scheduled. This represents the function that takes the minimum value.

4. The cache-aware size model cloud-edge collaborative multi-task scheduling method according to claim 3, characterized in that: S3 includes the following steps: S31. Based on the task-model-cached mapping relationship, obtain the current cache status data corresponding to each scheduled task. Determine whether the cache content corresponding to each scheduled task exists based on the current cache status data. If the cache content exists and is completely consistent with the task output requirements, generate a cache reuse path. If the cache content exists and the similarity of the feature vector with the task output requirements is greater than the preset similarity threshold, and the proportion of the remaining computing power of the edge small model is greater than the preset computing power threshold, generate a cache-assisted edge generation path. If the cache content does not exist and the proportion of the remaining computing power of the edge small model is greater than the preset computing power threshold, generate an edge generation path. If the task generation quality parameters exceed the upper limit of the edge small model's capabilities, generate a cloud generation path, forming a set of candidate execution paths for each scheduled task. S32. Calculate the scheduling priority of each scheduled task based on its task waiting time, normalized cache matching degree, and maximum tolerable latency in the candidate execution path set. The mathematical expression for the scheduling priority is: In the formula, Indicates the first The scheduling priority corresponding to each task to be scheduled. Indicates the first The waiting time for each pending task; S33. Sort the tasks to be scheduled in the candidate execution path set in descending order according to the scheduling priority of each task to be scheduled, and obtain the sequence of tasks to be scheduled.

5. The cache-aware size model cloud-edge collaborative multi-task scheduling method according to claim 1, characterized in that: S4 includes the following steps: S41. Based on the sequence of tasks to be scheduled, collect the status of the task queue, cache status, online status of the edge mini-model, and status of available edge resources to obtain a set of resource statuses; S42. Collect data on the single load / unload overhead of edge small models, the cumulative access frequency of edge small models, and the availability status of cloud large models to obtain model status parameters. S43. Combine the resource state set, model state parameters, and normalized cache matching degree and task requirement parameters with each scheduled task to obtain the system state vector. S44. Construct a task scheduling model based on the Dueling DQN network, including a value network and a dominance network. Input the system state vector into the task scheduling model, analyze the system state vector through the value network to obtain the state value function value, analyze the system state vector through the dominance network to obtain the dominance function value corresponding to each candidate action, and calculate the state action value corresponding to each candidate action based on the state value function value and the dominance function value corresponding to each candidate action. The mathematical expression of the state action value is: In the formula, The time slot number representing the scheduling decision. Indicates the first The system state vector of the time slot, Indicates the first The time slot is the selected scheduling action for the current state. Indicates the first System state vector of time slot Execute scheduling actions The corresponding state action value, This represents the system state vector fitted by the value network. The value of the state value function under the given conditions is as follows: This represents the state vector of the system fitted by the dominant network. Execute scheduling actions The value of the advantage function at that time. Represents the set of candidate actions. Represents the set of candidate actions Any candidate action in, Represents the system state vector Next, execute candidate actions The value of the dominant function at that time; S45, Adopt - The greedy strategy selects a scheduling action from the candidate action set and generates a random number. It then determines whether the random number is less than the preset exploration probability value. If so, it randomly selects a candidate action from the candidate action set as the scheduling action. If not, it selects the candidate action with the largest dynamic state value from the candidate action set as the scheduling action. S46. Determine the target task execution path corresponding to the scheduling action from the candidate execution path set according to the scheduling action, and determine the target matching generation model that matches the target task execution path according to the scheduling action.

6. The cache-aware size model cloud-edge collaborative multi-task scheduling method according to claim 1, characterized in that: S5 includes the following steps: S51. Based on the initial task scheduling results, obtain the target task execution path and target matching generation model corresponding to each scheduled task. Check whether each scheduled task meets the preset generation quality constraints, preset latency constraints, and preset edge resource constraints. If there is a scheduled task that does not meet any of the constraints, reselect the suboptimal target task execution path and suboptimal target matching generation model from the candidate execution path set, and perform constraint checks again until all scheduled tasks meet the preset generation quality constraints, preset latency constraints, and preset edge resource constraints, and obtain an effective task-level scheduling result. S52. Based on the effective task-level scheduling results, obtain the current online status of the target edge small model and the current remaining memory capacity of the edge server where the target edge small model is located. When the current online status is offline and the current remaining memory capacity is greater than or equal to the memory capacity required to load the target edge small model, load the target edge small model into the online model pool. When the current online status is offline and the current remaining memory capacity is less than the memory capacity required to load, select the edge small model that is not currently called by a task and has the lowest loading and unloading overhead from the online model pool, perform the unloading operation, and then load the target edge small model into the online model pool. S53. Obtain the cumulative access frequency and loading / unloading overhead of the target edge mini-model, and calculate the retention value of the target edge mini-model. When the retention value of the target edge mini-model is lower than a preset retention threshold and the target edge mini-model is not called by the current time slot task, unload the target edge mini-model to the offline model pool. The mathematical expression for the retention value of the target edge mini-model is: In the formula, Indicates the first The retained values ​​of a small model of the target edge. Indicates the first The cumulative access frequency of each target edge mini-model Indicates the first Loading and unloading overhead of small target edge models; S54. Based on the online status of the target edge small model in the online model pool and the offline status of the target edge small model in the offline model pool, update the model status information corresponding to each effective task level in the effective task-level scheduling result to obtain the resource-level scheduling result.

7. The cache-aware size model cloud-edge collaborative multi-task scheduling method according to claim 5, characterized in that: S6 includes the following steps: S61. Based on the resource-level scheduling result, execute the scheduled image generation task in the current time slot, obtain the task completion delay, system execution overhead and cache reuse benefit, and use the task completion delay, system execution overhead and cache reuse benefit as execution feedback data; S62. Based on the system state at the next moment collected from the execution feedback data, the system state at the current moment, the scheduling action executed in the current time slot, the instant reward value, and the system state at the next moment are combined into a state transition tuple, and the state transition tuple is stored in the experience replay pool. The instant reward value is obtained by analyzing the task completion delay, system execution overhead, and cache reuse benefits. S63. Randomly sample state transition tuples from the experience replay pool, and calculate the target state action value based on the state transition tuples. The mathematical expression for the target state action value is: In the formula, Indicates the first The target state action value of the time slot. Indicates the first The immediate reward value obtained after executing a scheduling action in a time slot. Indicates the discount factor. Indicates the candidate action Find the maximum value operation The state-action value function represents the target network. Indicates the first The system state vector of the time slot, This indicates that the target network predicts the next state. Execute each candidate action. The action state value at that time, This indicates that the target network predicts the next state. Execute each candidate action. Select the largest state action value at that time; S64. Update the main network parameters of the task scheduling model according to the target state action value to obtain the updated main network parameters. Determine whether the current parameter update count of the task scheduling model has reached the preset synchronization step count. If yes, synchronize the updated main network parameters to the target network to obtain the synchronized target network parameters. If no, keep the current parameters of the target network unchanged, and use the updated main network parameters and the synchronized target network parameters or the current parameters of the target network as the updated model parameters. Use the execution feedback data, the updated model parameters, and the incremented iteration rounds as the current state data. S65. Based on the execution feedback data and iteration round in the current state data, determine whether the preset termination condition is met. If yes, stop the iteration. If no, update the system state based on the execution feedback data and re-execute steps S2 to S6.

8. The cache-aware size model cloud-edge collaborative multi-task scheduling method according to claim 7, characterized in that: In S65, the preset termination condition is that the iteration round reaches a preset maximum round, or the task completion delay in the execution feedback data is less than a preset delay threshold and the cache reuse benefit is greater than a preset benefit threshold.

Citation Information

Patent Citations

  • Cloud-edge collaborative scheduling method and application based on multi-type intelligent models

    CN115202879B