Asynchronous full-speed task scheduling method based on cloud rendering platform
Through the introduction of multi -level task status management, dynamic resource allocation, intelligent review mechanism and concurrent control on the cloud rendering platform, the problems of task discarding, rough scheduling strategies, incomplete review mechanisms, and insufficient control of concurrency control in existing technologies have been solved. It has significantly improved the implementation efficiency and reliability of asynchronous full -speed tasks, and improved the user experience.
Patent Information
- Application Number
- CN202411394861.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-24
AI Technical Summary
The asynchronous task scheduling methods of existing cloud rendering platforms have problems such as task discarding, rough scheduling strategies, imperfect retry mechanisms and insufficient concurrency control, resulting in low task execution efficiency, poor reliability and poor user experience.
The asynchronous full -speed task scheduling method based on the cloud rendering platform is adopted to ensure the efficient, reliable and stable execution of the task by introducing multi -level task status management, dynamic resource allocation, intelligent retry mechanism, and concurrent control and abnormal processing mechanism.
Improve the implementation efficiency, reliability and user experience of asynchronous full -speed tasks, ensure the final completion of the task, and provide real -time feedback to enhance the user's confidence in the cloud rendering platform.
Smart Images

Figure CN119356812A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rendering technology, and in particular to an asynchronous full-speed task scheduling method based on a cloud rendering platform. Background Art
[0002] Cloud rendering technology has developed rapidly in recent years and has been widely used in film and television animation, architectural design, games and other fields. Cloud rendering platforms usually need to handle a large number of asynchronous tasks, such as scene preprocessing, video rendering, image synthesis, etc. In order to improve efficiency, these platforms generally use thread pools to manage asynchronous tasks and assign tasks to multiple threads for parallel execution.
[0003] Existing solutions
[0004] 1. Asynchronous task scheduling based on thread pool
[0005] This is the most common way to process asynchronous tasks. It uses thread pools such as ThreadPoolExecutor to manage thread resources and submit tasks to the thread pool for asynchronous execution. It has the following shortcomings: When the number of tasks increases sharply and thread pool resources are exhausted, tasks may be discarded, resulting in task execution failure and affecting user experience. It lacks a refined scheduling strategy and is difficult to dynamically adjust based on factors such as task priority and resource usage.
[0006] 2. Asynchronous task scheduling based on message queue
[0007] Use message queues such as Kafka and RabbitMQ to cache tasks and process them asynchronously through consumer processes. There are the following shortcomings: The introduction of message queues increases system complexity and requires additional maintenance costs. The task scheduling strategy is relatively simple and lacks refined management of task execution status.
[0008] 3. Some cloud rendering platforms use a simple task retry mechanism
[0009] When a task fails, a limited number of retries are performed. There are the following deficiencies: Lack of in-depth research on retry strategies, making it difficult to optimize based on task types and failure causes. There is no effective concurrency control mechanism, which may lead to task conflicts or repeated executions.
[0010] Existing technologies include:
[0011] Amazon Web Services (AWS): provides services such as Amazon Elastic Compute Cloud (EC2) and AWS Batch for scheduling and executing cloud rendering tasks.
[0012] Microsoft Azure: Provides services such as Azure Batch and Azure Kubernetes Service (AKS) for scheduling and orchestration of cloud rendering tasks.
[0013] Google Cloud Platform (GCP): Provides services such as Google Compute Engine and Google Kubernetes Engine (GKE) for scheduling and management of cloud rendering tasks.
[0014] Alibaba Cloud: Provides services such as Elastic Compute Service (ECS) and Container Service for Kubernetes for scheduling and deployment of cloud rendering tasks.
[0015] Tencent Cloud: Provides services such as cloud servers (CVM) and Tencent Kubernetes Engine (TKE) for scheduling and management of cloud rendering tasks.
[0016] Insufficient existing technology
[0017] 1. Task abandonment problem: The existing solutions lack an effective monitoring and processing mechanism for task abandonment, which leads to task execution failure and affects user experience.
[0018] 2. Rough scheduling strategy: The scheduling strategy of the existing solution is relatively simple, lacking detailed consideration of factors such as task priority and resource occupancy, making it difficult to achieve efficient task scheduling.
[0019] 3. Imperfect retry mechanism: The retry mechanism of the existing solution is not smart enough, lacks in-depth research on the retry strategy, and is difficult to perform targeted optimization based on the task type and failure cause.
[0020] 4. Insufficient concurrency control: Existing solutions lack an effective concurrency control mechanism, which may lead to task conflicts or repeated executions, reducing task execution efficiency.
[0021] Therefore, the prior art has defects and needs to be improved. Summary of the invention
[0022] The technical problem to be solved by the present invention is: to provide an asynchronous full-speed task scheduling method based on a cloud rendering platform, by introducing multi-level task state management, dynamic resource allocation, intelligent retry mechanism, and concurrency control and exception handling mechanism, so as to improve the execution efficiency, reliability and user experience of asynchronous full-speed tasks on the cloud rendering platform.
[0023] The technical solution of the present invention is as follows: an asynchronous full-speed task scheduling method based on a cloud rendering platform is provided, comprising the following steps.
[0024] S1: Task submission and status management; When a user submits a full-speed task request, the system first checks the thread pool load status to determine whether the task can be executed immediately; If the thread pool load is low, the task is marked as "processing" and submitted to the thread pool for execution; If the thread pool load is high, the task is marked as "pending" and added to the retry queue; Multi-level task status management is adopted, including "pending", "processing", and "completed" status, to clearly track the progress of task execution and avoid repeated processing.
[0025] S2: The scheduling system periodically queries the retry queue and selects qualified pending tasks; the screening conditions include: the task status is "pending"; the queue entry time does not exceed the current time; the number of retries does not exceed the maximum number of retries.
[0026] The number of tasks processed at each scheduling is limited to avoid overloading the thread pool.
[0027] The scheduling system updates the status of eligible tasks to "processing" to ensure that tasks are not processed repeatedly.
[0028] The scheduling system uses a pre-configured thread pool ThreadPoolExecutor to execute tasks in parallel.
[0029] The scheduling system checks the load status of the thread pool again. If it is overloaded, the task is rescheduled to the queue for subsequent processing.
[0030] If the thread pool load is normal, an asynchronous thread instance is created and submitted to the thread pool for execution; the asynchronous thread instance carries full-speed task related information.
[0031] S3: Asynchronous thread processing tasks.
[0032] When each asynchronous thread instance is initialized, a unique tracking ID is set for log tracking.
[0033] The asynchronous thread first checks the task status. If the task has been completed or is already in full speed, it returns directly without executing subsequent operations.
[0034] Asynchronous threads use a concurrency control mechanism based on task IDs to ensure that the same task is not processed repeatedly.
[0035] The asynchronous thread records the timestamp when the task starts processing, obtains task information, and performs full-speed task operations.
[0036] After the task is executed, the asynchronous thread checks the task completion status. If the task is successfully completed, the task in the queue is deleted, the full-speed task identifier cache is cleared, and the task completion event is published; if the task is not completed, the task creation time and processing times are updated, and the task is rescheduled.
[0037] The asynchronous thread releases the concurrency control mechanism and records the total time consumed in task processing.
[0038] If the task processing reaches the maximum number of retries, the asynchronous thread deletes the task in the queue, cleans up the full-speed task identifier cache, and records the task processing end information.
[0039] S4: Dynamic resource allocation.
[0040] Dynamically adjust the task scheduling strategy according to the thread pool load status.
[0041] When the thread pool load is high, high-priority tasks are processed first to ensure that critical tasks are executed in a timely manner.
[0042] Low priority tasks will be delayed or re-added to the retry queue.
[0043] S5: Intelligent retry mechanism.
[0044] Develop a flexible retry strategy based on task priority, number of retries, and time interval.
[0045] High-priority tasks will get more retry opportunities and shorter retry intervals.
[0046] Record the cause of task failure and adjust the retry strategy based on the cause of failure.
[0047] S6: Concurrency control and exception handling.
[0048] A concurrency control mechanism is used to avoid task conflicts and ensure that only one thread processes a specific task at a time.
[0049] Set up a complete exception handling mechanism to capture and record exceptions during task execution to ensure stability.
[0050] Different handling strategies are adopted according to the exception type, such as retrying the task, recording logs, and notifying administrators.
[0051] The concurrency control mechanism is one of: distributed lock, optimistic lock, and semaphore.
[0052] The queue is one of a first-in-first-out queue, a priority queue, and a delay queue, so as to achieve more sophisticated task scheduling.
[0053] Dynamic resource allocation and intelligent retry mechanism are implemented through the following strategies: priority queue: the retry queue adopts priority queue to give priority to high priority tasks; dynamic adjustment of retry times: dynamically adjust the task retry times according to task priority and failure reason; for example, high priority tasks can get more retry opportunities.
[0054] The retry strategy adopts at least one of: exponential backoff algorithm, fixed time interval, randomized backoff, fixed number limit, and fuse mechanism. For example, exponential backoff algorithm: for tasks that fail continuously, the exponential backoff algorithm is used to extend the retry time interval to avoid frequent retries causing resource waste.
[0055] Aiming at the problems existing in the asynchronous task scheduling method of the existing cloud rendering platform, such as lack of monitoring of task abandonment, insufficiently refined scheduling strategy, insufficient concurrency control, and lack of flexible retry mechanism, the present invention provides an asynchronous full-speed task scheduling method based on the cloud rendering platform, which achieves the following goals by introducing multi-level task state management, dynamic resource allocation, intelligent retry mechanism, and concurrency control and exception handling mechanism:
[0056] 1. Improve task execution efficiency: Ensure timely completion of tasks through dynamic resource allocation and intelligent retry mechanism, pay special attention to high-priority tasks, and avoid delayed execution of critical tasks.
[0057] 2. Enhanced reliability: Through multi-level task status management and concurrency control, task loss and conflict can be effectively avoided, ensuring that each task is executed reliably and guaranteeing data consistency.
[0058] 3. Improve user experience: By ensuring the final completion of full-speed tasks and providing a real-time feedback mechanism for task execution status, users' confidence in the cloud rendering platform can be enhanced, allowing them to perceive the reliability and stability of the platform.
[0059] By adopting the above scheme, the present invention provides an asynchronous full-speed task scheduling method based on a cloud rendering platform, which effectively solves the shortcomings of the prior art through multi-level task state management, dynamic resource allocation, intelligent retry mechanism, concurrency control and exception handling mechanism, and significantly improves the execution efficiency, reliability and user experience of asynchronous full-speed tasks on the cloud rendering platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a logical architecture diagram of the present invention;
[0061] Figure 2 It is a part of the flow chart of the method of the present invention;
[0062] Figure 3 It is another part of the method flow chart of the present invention. DETAILED DESCRIPTION
[0063] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0064] Scene Setting
[0065] Assume that a cloud rendering platform needs to handle three types of full-speed tasks:
[0066] 1. High priority tasks: Video rendering tasks, which need to be completed as soon as possible to meet user needs.
[0067] 2. Medium priority tasks: scene preprocessing tasks, which have relatively loose completion time requirements.
[0068] 3. Low priority tasks: image synthesis tasks, which can be processed later.
[0069] The logical architecture of the present invention is as follows Figure 1 See Figure 2 and Figure 3 , the specific implementation steps are as follows.
[0070] 1. User submits full-speed task: The user submits a full-speed task request through the cloud rendering platform API gateway. The request contains information such as task type, priority, and parameters.
[0071] 2. API gateway calls task service: After receiving the task request, API gateway calls the task service to process the request.
[0072] 3. Task service checks thread pool load: After receiving the request, the task service first checks the thread pool load status. In this embodiment, the thread pool load status is measured by the following indicators:
[0073] Number of active threads: The number of threads currently executing tasks.
[0074] Queue length: The number of tasks waiting to be executed.
[0075] 4. Create an asynchronous task or join a retry queue:
[0076] If the thread pool load is low (for example, the number of active threads is less than 80% and the queue length is less than 100), an asynchronous task is created and the task status is set to "processing".
[0077] If the thread pool load is high, the task is added to the retry queue and the task status is set to "pending".
[0078] 5. Submit the task to the thread pool: After creating the asynchronous task, submit it to the thread pool for execution.
[0079] 6. The scheduling system periodically queries the retry queue: The scheduling system queries the retry queue at regular intervals (for example, 1 minute) to filter out qualified pending tasks. The filtering conditions include:
[0080] The task status is Pending.
[0081] The queue entry time does not exceed the current time.
[0082] The number of retries does not exceed the maximum number of retries (for example, 5 times).
[0083] 7. Update task status and submit to thread pool: For eligible pending tasks, the scheduling system updates their status to "processing" and submits them to the thread pool for execution.
[0084] 8. Asynchronous thread processing tasks: The asynchronous threads in the thread pool execute tasks. The specific steps are as follows:
[0085] Initialize tracking ID: Set a unique tracking ID for log tracking.
[0086] Check task status: Check whether the full-speed queue and task are already at full speed. If so, return directly without performing subsequent operations.
[0087] Get lock: Generate a random request ID, get a lock cache based on the task ID (cached for 15 minutes), and secondly ensure that the same full-speed task will not be acquired and processed repeatedly.
[0088] Record start time: Record the current time as the timestamp when the task starts processing.
[0089] Obtain and submit task information, which is used as the pre-data information for full-speed task operation.
[0090] Execute full-speed task operations: Execute corresponding operations according to the task type and parameters, such as video rendering, scene preprocessing, image synthesis, etc.
[0091] Check task completion status: Check whether the task is completed. If the task is completed, delete the full-speed task in the queue, clean up the full-speed identification cache, and publish the task full-speed completion event. If the task is not completed, update the creation time and processing times of the task, and then reschedule the task.
[0092] Release lock: Release the previously acquired lock and record the result of releasing the lock and the total time taken to process the task.
[0093] Processing timeout or retry count: If the task processing reaches the maximum number of retries, delete the full-speed task in the queue and clean up the full-speed identification cache. Finally, record the information that the task processing is completed.
[0094] 9. Task status management: The asynchronous thread updates the task status during task execution, for example, updating the task status from "processing" to "completed".
[0095] 10. Distributed lock: A distributed lock mechanism is used to avoid task conflicts and ensure that only one thread processes a specific task at the same time. In this embodiment, Redis is used to implement distributed locks.
[0096] Dynamic resource allocation and intelligent retry mechanism
[0097] In this embodiment, dynamic resource allocation and intelligent retry mechanism are implemented through the following strategies:
[0098] Priority queue: The retry queue uses a priority queue to give priority to high-priority tasks.
[0099] Dynamically adjust the number of retries: Dynamically adjust the number of task retries based on task priority and failure reason. For example, high-priority tasks can get more retry opportunities.
[0100] Exponential backoff algorithm: For tasks that fail continuously, an exponential backoff algorithm is used to extend the retry interval to avoid wasting resources caused by frequent retries.
[0101] This embodiment describes in detail the specific implementation process of the asynchronous full-speed task scheduling method proposed in the present invention. By combining scenario settings and system architecture, it explains the links such as user submitting tasks, task service processing requests, scheduling system scheduling tasks, and asynchronous thread execution tasks. It also explains in detail the implementation strategies of key technologies such as dynamic resource allocation, intelligent retry mechanism, and concurrency control.
[0102] Compared with the prior art, the asynchronous full-speed task scheduling method based on the cloud rendering platform proposed in the present invention has the following significant technical effects:
[0103] 1. Higher task execution efficiency:
[0104] Through dynamic resource allocation, the task scheduling strategy is flexibly adjusted according to the thread pool load status, high-priority tasks are given priority, and critical tasks are avoided from being delayed, thereby shortening the overall task completion time.
[0105] The intelligent retry mechanism can formulate flexible retry strategies based on factors such as task priority, number of retries, and time interval to improve the task success rate and avoid unnecessary waiting and waste of resources.
[0106] According to actual test results, compared with the traditional FIFO queue scheduling method, the method proposed by the present invention can shorten the average completion time of high-priority tasks by more than 20%.
[0107] 2. Stronger reliability:
[0108] Multi-level task status management can clearly track the progress of task execution, avoid duplicate processing, and effectively prevent task loss.
[0109] A distributed lock mechanism is used to avoid task conflicts, ensuring that only one thread processes a specific task at the same time, ensuring data consistency, and avoiding data errors or corruption.
[0110] The perfect exception handling mechanism can capture and record exceptions during task execution, and adopt different handling strategies according to the exception type, such as retrying tasks, recording logs, notifying administrators, etc., to ensure stable operation of the system.
[0111] 3. Better User Experience:
[0112] Ensure the final completion of full-speed tasks, enhance users' confidence in the cloud rendering platform, and make users perceive the reliability and stability of the platform.
[0113] Provide a real-time feedback mechanism for task execution status, so that users can understand the task progress in a timely manner and enhance user experience.
[0114] According to user survey feedback, compared with the traditional method, the user satisfaction with the cloud rendering platform using the method of the present invention has increased by more than 15%.
[0115] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An asynchronous full-speed task scheduling method based on a cloud rendering platform, characterized in that: The following steps are involved: S1: Task submission and status management; When a user submits a full-speed task request, the system first checks the thread pool load status to determine whether the task can be executed immediately; If the thread pool load is low, the task is marked as "processing" and submitted to the thread pool for execution; if the thread pool load is high, the task is marked as "pending" and added to the retry queue; Adopt multi-level task status management, including "pending", "processing", and "completed" status, to clearly track the progress of task execution and avoid repeated processing; S2: The scheduling system periodically queries the retry queue to filter out eligible pending tasks; the filtering conditions include: The task status is "pending"; the queue entry time does not exceed the current time; the number of retries does not exceed the maximum number of retries; The number of tasks processed at each scheduling is limited to avoid thread pool overload; The scheduling system updates the status of eligible tasks to "processing" to ensure that tasks are not repeatedly acquired and processed; The scheduling system uses a pre-configured thread pool ThreadPoolExecutor to execute tasks in parallel; The scheduling system checks the load status of the thread pool again. If it is overloaded, it will reschedule the task to the queue for subsequent processing; If the thread pool load is normal, an asynchronous thread instance is created and submitted to the thread pool for execution; the asynchronous thread instance carries full-speed task related information; S3: asynchronous thread processing tasks; When each asynchronous thread instance is initialized, a unique tracking ID is set for log tracking; The asynchronous thread first checks the task status. If the task has been completed or is already in full speed, it returns directly without executing subsequent operations. Asynchronous threads use a concurrency control mechanism based on task ID to ensure that the same task is not processed repeatedly; The asynchronous thread records the timestamp of when the task starts processing, obtains task information, and executes full-speed task operations; After the task is completed, the asynchronous thread checks the task completion status. If the task is successfully completed, the task in the queue is deleted, the full-speed task identifier cache is cleared, and the task completion event is published; if the task is not completed, the task creation time and processing times are updated, and the task is rescheduled; Asynchronous threads release the concurrency control mechanism and record the total time consumed in task processing; If the task processing reaches the maximum number of retries, the asynchronous thread will delete the task in the queue, clean up the full-speed task identifier cache, and record the task processing end information; S4: Dynamic resource allocation; Dynamically adjust task scheduling strategy according to thread pool load status; When the thread pool load is high, high-priority tasks are processed first to ensure that critical tasks are executed in a timely manner; Low priority tasks will be delayed or re-added to the retry queue. S5: Intelligent retry mechanism; Develop a flexible retry strategy based on task priority, number of retries, and time interval; High-priority tasks will get more retry opportunities and have shorter retry intervals; Record the reasons for task failure and adjust the retry strategy based on the reasons for failure; S6: Concurrency control and exception handling; Use concurrency control mechanisms to avoid task conflicts and ensure that only one thread processes a specific task at a time; Set up a complete exception handling mechanism to capture and record exceptions during task execution to ensure stability; Different handling strategies are adopted according to the exception type, such as retrying the task, recording logs, and notifying administrators.
2. The asynchronous full-speed task scheduling method based on the cloud rendering platform according to claim 1, characterized in that: The concurrency control mechanism is one of: distributed lock, optimistic lock, and semaphore.
3. The asynchronous full-speed task scheduling method based on the cloud rendering platform according to claim 1, characterized in that: The queue is one of a first-in-first-out queue, a priority queue, and a delay queue, so as to achieve more sophisticated task scheduling.
4. The asynchronous full-speed task scheduling method based on the cloud rendering platform according to claim 1, characterized in that: Dynamic resource allocation and intelligent retry mechanism are implemented through the following strategies: Priority queue: The retry queue uses a priority queue to give priority to high-priority tasks; Dynamically adjust the number of retries: Dynamically adjust the number of task retries based on task priority and failure reason.
5. The asynchronous full-speed task scheduling method based on the cloud rendering platform according to claim 1, characterized in that: The retry strategy adopts at least one of: exponential backoff algorithm, fixed time interval, randomized backoff, fixed number limit, and fuse mechanism.
Citation Information
Cited By
AI-driven cloud rendering service fault rapid positioning method
CN120599045A
Micro-thread management system and method based on Java
CN120743540A
Java-based microthread management system and method
CN120743540B
Video stream concurrent access front-end dynamic scheduling control system and method based on digital twinborn scene
CN120786117A