Task queue scheduling method and device, electronic equipment and medium

By obtaining the actual and predicted throughput of the buffer, the buffers where tasks are suspended can be identified and the task queue can be rescheduled. This solves the problem of task suspension caused by the unclear correspondence between task queues and buffers, and improves task processing efficiency.

CN120892162AActive Publication Date: 2025-11-04MU XI LING ZHI KE JI (HANG ZHOU) YOU XIAN GONG SI
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202511406070.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2025-11-04
Estimated Expiration
2045-09-29

AI Technical Summary

Technical Problem

In existing technologies, the fixed correspondence between task queues and buffers leads to unclear task dependencies, causing tasks to be suspended and affecting task processing efficiency.

Method used

By obtaining the actual and predicted throughput of the buffer, the target buffer where task hangs may occur can be identified, and a free buffer can be requested in the task processing system. The task queue can then be rescheduled to eliminate hangs and improve task processing efficiency.

Benefits of technology

It improves the task processing efficiency of the task processing system, enhances the accuracy of task scheduling by predicting throughput accuracy, and eliminates task suspension.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892162A_ABST
    Figure CN120892162A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a task queue scheduling method and device, electronic equipment and a medium, and the method comprises the steps: obtaining a buffer queue actual throughput rate and a buffer queue predicted throughput rate corresponding to each buffer region in a current preset period in a first process; determining the buffer area with the buffer queue prediction throughput rate corresponding to the current preset period smaller than a preset throughput rate threshold value as a first target buffer area, determining the currently executed task in the first target buffer area as a target task, and determining the task queue corresponding to the target task as a first task queue, other task queues except the first task queue in the first target buffer area are determined as second task queues; and applying for an idle buffer zone in a preset alternative buffer zone to be arranged in the first process, reserving the first task queue in the first target buffer zone to be executed, and moving the second task queue to the idle buffer zone to be executed. The task processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a task queue scheduling method, apparatus, electronic device, and medium. Background Technology

[0002] The task processing system includes multiple buffers for receiving and caching tasks issued by the software. Tasks issued by the task processing system are first sent to a task queue, and then the task queue sends the tasks to their corresponding buffers. In existing technologies, a fixed correspondence is established between the task queues and buffers in the task system. The scheduling layer of the task system cannot know the task distribution on different task queues. If tasks with dependencies are distributed to the same buffer, and the dependent task executes before the dependent task, task suspension will occur. This will prevent other tasks in the corresponding buffer of the suspended task from executing, affecting the task processing efficiency of the task processing system. Therefore, how to eliminate task suspension and improve task processing efficiency has become an urgent technical problem to be solved. Summary of the Invention

[0003] The purpose of this invention is to provide a task queue scheduling method, apparatus, electronic device, and medium that can eliminate task suspension and improve task processing efficiency.

[0004] According to a first aspect of the present invention, a task queue scheduling method is provided, comprising: Get the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period. Each process corresponds to multiple buffers, and the buffers are used to receive the task queue. The predicted throughput of the buffer queue for each buffer in the first process in the current preset period is obtained based on the actual throughput of the buffer queue for each buffer in the current preset period, the predicted throughput of the buffer queue for each buffer in the previous preset period, and the preset adjustment coefficient. The buffer in the first process whose predicted throughput of the current preset period is less than the preset throughput threshold is determined as the first target buffer. The task currently being executed in the first target buffer is determined as the target task. The task queue corresponding to the target task is determined as the first task queue. The other task queues in the first target buffer besides the first task queue are determined as the second task queue. In the pre-selected buffer of the task processing system, a free buffer is requested and set in the first process. The first task queue is kept in the first target buffer for execution, and all second task queues are moved to the free buffer for execution.

[0005] Furthermore, the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period includes: Get the number of tasks actually processed and completed in each buffer of the first process of the task processing system within the current preset period; Get the number of tasks actually received by each buffer in the first process of the task processing system within the current preset period; The ratio of the number of tasks actually processed by each buffer within the current preset period to the number of tasks actually received by each buffer within the current preset period is determined as the actual throughput of the buffer queue corresponding to each buffer in the current preset period.

[0006] Furthermore, the step of obtaining the predicted throughput of the buffer queue for each buffer in the first process in the current preset period based on the actual throughput of the buffer queue for each buffer in the first process in the current preset period, the predicted throughput of the buffer queue for each buffer in the previous preset period, and a preset adjustment coefficient includes: The value of multiplying the actual throughput of the buffer queue corresponding to each buffer in the current preset period in the first process by the preset first coefficient is determined as the first part of the buffer queue predicted throughput of each buffer. The second part of the buffer queue predicted throughput of each buffer in the first process is determined by multiplying the predicted throughput of the buffer queue in the previous preset period by a preset second coefficient. The sum of the preset first coefficient and the preset second coefficient is 1. The sum of the first part of the buffer queue predicted throughput and the second part of the buffer queue predicted throughput for each buffer is determined as the buffer queue predicted throughput for each buffer in the current preset period.

[0007] Furthermore, the method also includes: When the target task completion instruction is received, the first task queue is moved to a buffer outside the first target buffer in the first process; The first target buffer is set as a free buffer in the pre-selected buffer, which is either a free buffer in the second process or a redundant buffer in the first process.

[0008] Furthermore, the step of moving the first task queue to a buffer outside the first target buffer in the first process when a target task completion instruction is received includes: When the target task completion instruction is received, the buffer with the highest predicted throughput of the current preset periodic buffer queue is determined as the second target buffer. Move the first task queue to the second target buffer.

[0009] According to a second aspect of the present invention, a task queue scheduling apparatus is provided, comprising: The first acquisition module is used to acquire the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period. Each process corresponds to multiple buffers, and the buffers are used to receive the task queue. The second acquisition module is used to acquire the buffer queue prediction throughput of each buffer in the first process in the current preset period based on the actual throughput of the buffer queue corresponding to each buffer in the current preset period, the predicted throughput of the buffer queue corresponding to each buffer in the previous preset period, and the preset adjustment coefficient. The determination module is used to determine the buffer in the first process whose predicted throughput of the buffer queue corresponding to the current preset period is less than the preset throughput threshold as the first target buffer, determine the currently executing task in the first target buffer as the target task, determine the task queue corresponding to the target task as the first task queue, and determine the other task queues in the first target buffer other than the first task queue as the second task queue. The first scheduling module is used to request a free buffer in the pre-selected buffer of the task processing system, set it in the first process, keep the first task queue in the first target buffer for execution, and move all the second task queues to the free buffer for execution.

[0010] Furthermore, the first acquisition module is specifically used for: Get the number of tasks actually processed and completed in each buffer of the first process of the task processing system within the current preset period; Get the number of tasks actually received by each buffer in the first process of the task processing system within the current preset period; The ratio of the number of tasks actually processed by each buffer within the current preset period to the number of tasks actually received by each buffer within the current preset period is determined as the actual throughput of the buffer queue corresponding to each buffer in the current preset period.

[0011] Furthermore, the second acquisition module is specifically used for: The value of multiplying the actual throughput of the buffer queue corresponding to each buffer in the current preset period in the first process by the preset first coefficient is determined as the first part of the buffer queue predicted throughput of each buffer. The second part of the buffer queue predicted throughput of each buffer in the first process is determined by multiplying the predicted throughput of the buffer queue in the previous preset period by a preset second coefficient. The sum of the preset first coefficient and the preset second coefficient is 1. The sum of the first part of the buffer queue predicted throughput and the second part of the buffer queue predicted throughput for each buffer is determined as the buffer queue predicted throughput for each buffer in the current preset period.

[0012] Furthermore, the device also includes a second scheduling module, used to move the first task queue to a buffer outside the first target buffer in the first process when a target task completion instruction is obtained; and to set the first target buffer as an idle buffer in a pre-selected buffer, wherein the pre-selected buffer is an idle buffer in the second process or a redundant buffer in the first process.

[0013] Furthermore, the second scheduling module is specifically used to: when a target task completion instruction is obtained, determine the buffer with the highest predicted throughput of the current preset periodic buffer queue as the second target buffer; and move the first task queue to the second target buffer.

[0014] According to a third aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in the first aspect of the present invention.

[0015] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, storing computer-executable instructions for performing the method described in the first aspect of the present invention.

[0016] Compared with existing technologies, this invention has significant advantages and beneficial effects. Through the above technical solution, the task queue scheduling method, apparatus, electronic device, and medium provided by this invention achieve considerable technological advancement and practicality, and have broad industrial application value. It possesses at least the following beneficial effects: This invention first obtains the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period. Then, based on the actual throughput of the buffer queue corresponding to each buffer in the first process in the current preset period, the predicted throughput of the buffer queue corresponding to each buffer in the previous preset period, and a preset adjustment coefficient, it obtains the predicted throughput of the buffer queue corresponding to each buffer in the first process in the current preset period. By using the predicted throughput of the buffer queue and a preset throughput threshold, a first target buffer where task suspension may occur is determined. Predicting the first target buffer where task suspension may occur based on the predicted throughput of the buffer queue can improve prediction accuracy. Then, an idle buffer is requested from the pre-selected buffers of the task processing system and set in the first process. The first task queue is kept in the first target buffer for execution, and all second task queues are moved to the idle buffer for execution, thereby eliminating task suspension and improving the task processing efficiency of the task processing system. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of the task queue scheduling method provided in Embodiment 1 of the present invention; Figure 2 A detailed step diagram of step S1 of the task queue scheduling method provided in Embodiment 1 of the present invention; Figure 3 A detailed step diagram of step S2 of the task queue scheduling method provided in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of a task queue scheduling device provided in Embodiment 2 of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Example 1 This embodiment provides a task queue scheduling method, such as Figure 1 As shown, it includes: Step S1: Obtain the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period. Each process corresponds to multiple buffers, and the buffers are used to receive the task queue.

[0021] It's important to note that a task processing system can have multiple processes. The first process is one of the processes within the system. Each process includes multiple buffers. As an example, the task processing system can be implemented based on a Graphics Processing Unit (GPU), and the buffers can specifically be ring buffers set up on the GPU. In the task processing system, multiple task queues can be allocated to each process. Buffers are used to receive task queues, but a buffer can be in a state of not receiving any queues, or it can be in a state of receiving one or more task queues. Each task queue can contain multiple tasks, or it can be in an idle state for a period of time. Initially, the task processing system can use a polling method to establish the correspondence between task queues and buffers. Tasks in different task queues are executed in parallel, and tasks in the same task queue are executed sequentially. Only one task can be read from the same buffer for execution at any given time.

[0022] Step S2: Based on the actual throughput of the buffer queue corresponding to each buffer in the first process in the current preset period, the predicted throughput of the buffer queue corresponding to each buffer in the previous preset period, and the preset adjustment coefficient, obtain the predicted throughput of the buffer queue corresponding to each buffer in the first process in the current preset period.

[0023] It should be noted that the actual throughput of the buffer queue corresponding to the current preset period is the actual throughput of the buffer within the current preset period, while the predicted throughput of the buffer queue corresponding to the current preset period is the predicted throughput of the buffer within the current preset period. Since the task reception of each task queue usually follows a certain pattern, there may be periods of idle time, which could lead to the corresponding buffer receiving fewer tasks during those periods. If the judgment is directly based on the actual throughput of the buffer queue corresponding to the current preset period, it is prone to misjudgment. Therefore, this embodiment uses the predicted throughput of the buffer queue corresponding to the current preset period to determine whether task suspension is possible, improving the accuracy of the judgment. When calculating the actual throughput of the buffer queue corresponding to the first preset period, the predicted throughput of the buffer queue corresponding to the previous preset period is set to 0. The value of the preset adjustment coefficient is set according to the specific application scenario.

[0024] Step S3: Determine the buffer in the first process whose predicted throughput of the buffer queue corresponding to the current preset period is less than the preset throughput threshold as the first target buffer, determine the currently executing task in the first target buffer as the target task, determine the task queue corresponding to the target task as the first task queue, and determine the other task queues in the first target buffer other than the first task queue as the second task queue.

[0025] It should be noted that if the predicted throughput of the buffer queue corresponding to the current preset period in the first process is less than the preset throughput threshold, then a task suspension may occur or has already occurred. In this case, task scheduling needs to be started to eliminate the possible or already occurred task suspension.

[0026] Step S4: In the pre-selected buffer of the task processing system, request a free buffer and set it in the first process. Keep the first task queue in the first target buffer for execution, and move all the second task queues to the free buffer for execution.

[0027] It should be noted that if a task is suspended, it is usually because the task the target task depends on has not been executed in the second task queue, causing the target task to be suspended. Step S4 uses a free buffer in the pre-selection buffer to process the second task queue in the first target buffer. When the task the target task depends on is completed, the target task suspension will be eliminated. The pre-selection buffer can be a free buffer in the second process or a redundant buffer in the first process, where the first process and the second process are different processes.

[0028] As an example, step S1, such as Figure 2 As shown, it includes: Step S11: Obtain the number of tasks actually completed in each buffer of the first process of the task processing system within the current preset period.

[0029] Step S12: Obtain the number of tasks actually received by each buffer in the first process of the task processing system within the current preset period.

[0030] Step S13: Determine the ratio of the number of tasks actually processed by each buffer in the current preset period to the number of tasks actually received by each buffer in the current preset period as the actual throughput of the buffer queue corresponding to each buffer in the current preset period.

[0031] It should be noted that the preset period is a preset time interval, and the size of the preset time interval is set according to the specific application requirements.

[0032] As an example, step S2 includes, for instance, Figure 3As shown, it includes: Step S21: Multiply the actual throughput of the buffer queue corresponding to each buffer in the current preset period in the first process by the preset first coefficient to determine the first part of the buffer queue predicted throughput of each buffer.

[0033] Step S22: Multiply the predicted throughput of the buffer queue corresponding to each buffer in the first process in the previous preset period by the value of the preset second coefficient to determine the second part of the predicted throughput of the buffer queue for each buffer. The sum of the preset first coefficient and the preset second coefficient is 1.

[0034] Step S23: The sum of the first part of the buffer queue predicted throughput and the second part of the buffer queue predicted throughput of each buffer is determined as the buffer queue predicted throughput of each buffer in the current preset period.

[0035] It should be noted that the processing steps S21-S23 can prevent data jitter from affecting task scheduling and improve the accuracy of task scheduling. The preset first coefficient and preset second coefficient are set based on the specific application scenario. Specifically, the preset first coefficient is set to 0.3 and the preset second coefficient is set to 0.7.

[0036] As an example, the method also includes: Step S5: When the target task completion instruction is obtained, the first task queue is moved to a buffer outside the first target buffer in the first process.

[0037] Step S6: Set the first target buffer as an empty buffer in the pre-selected buffers.

[0038] It should be noted that when the target task is completed, a target task completion instruction will be generated. When the target task completion instruction is received, it means that the task suspension has been eliminated. At this time, the free buffer borrowed from the pre-device selection buffer can be returned to the pre-device selection buffer.

[0039] As an example, step S5 includes: Step S51: When the target task completion instruction is obtained, the buffer with the highest predicted throughput of the current preset periodic buffer queue is determined as the second target buffer.

[0040] It is understandable that the current preset periodic buffer queue predicted throughput is obtained based on steps S1 and S2, which will not be elaborated here.

[0041] Step S52: Move the first task queue to the second target buffer.

[0042] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. A process can be terminated when its operation is complete, but it may also have additional steps not included in the figures. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.

[0043] In Example 1, the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period is first obtained. Then, based on the actual throughput of the buffer queue corresponding to each buffer in the first process in the current preset period, the predicted throughput of the buffer queue corresponding to each buffer in the previous preset period, and a preset adjustment coefficient, the predicted throughput of the buffer queue corresponding to each buffer in the first process in the current preset period is obtained. The first target buffer where task suspension may occur is determined by using the predicted throughput of the buffer queue and a preset throughput threshold. Predicting the first target buffer where task suspension may occur based on the predicted throughput of the buffer queue can improve the prediction accuracy. Then, an idle buffer is requested from the pre-selected buffers of the task processing system and set in the first process. The first task queue is kept in the first target buffer for execution, and all second task queues are moved to the idle buffer for execution, thereby eliminating task suspension and improving the task processing efficiency of the task processing system.

[0044] Example 2 This invention provides a task queue scheduling device, such as... Figure 4 As shown, it includes: The first acquisition module is used to acquire the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period. Each process corresponds to multiple buffers, and the buffers are used to receive the task queue.

[0045] It's important to note that a task processing system can have multiple processes. The first process is one of the processes within the system. Each process includes multiple buffers. As an example, the task processing system can be implemented based on a Graphics Processing Unit (GPU), and the buffers can specifically be ring buffers set up on the GPU. Multiple task queues can be allocated to each process within the task processing system. Buffers are used to receive task queues, but a buffer can be in a state of receiving no queues, or it can be in a state of receiving one or more task queues. Each task queue can contain multiple tasks, or it can be in an idle state for a period of time. The task processing system can initially establish the correspondence between task queues and buffers using a polling method. Tasks in different task queues are executed in parallel, while tasks in the same task queue are executed sequentially. Only one task can be read from the same buffer for execution at any given time.

[0046] The second acquisition module is used to acquire the predicted throughput of the buffer queue for each buffer in the first process in the current preset period based on the actual throughput of the buffer queue for each buffer in the first process in the current preset period, the predicted throughput of the buffer queue for each buffer in the previous preset period, and the preset adjustment coefficient.

[0047] It should be noted that the actual throughput of the buffer queue corresponding to the current preset period is the actual throughput of the buffer within the current preset period, while the predicted throughput of the buffer queue corresponding to the current preset period is the predicted throughput of the buffer within the current preset period. Since the task reception of each task queue usually follows a certain pattern, there may be periods of idle time, which could lead to the corresponding buffer receiving fewer tasks during those periods. If the judgment is directly based on the actual throughput of the buffer queue corresponding to the current preset period, it is prone to misjudgment. Therefore, this embodiment uses the predicted throughput of the buffer queue corresponding to the current preset period to determine whether task suspension is possible, improving the accuracy of the judgment. When calculating the actual throughput of the buffer queue corresponding to the first preset period, the predicted throughput of the buffer queue corresponding to the previous preset period is set to 0. The preset adjustment coefficient is set according to the specific application scenario.

[0048] The determination module is used to determine the buffer in the first process whose predicted throughput of the buffer queue corresponding to the current preset period is less than the preset throughput threshold as the first target buffer, determine the currently executing task in the first target buffer as the target task, determine the task queue corresponding to the target task as the first task queue, and determine the other task queues in the first target buffer other than the first task queue as the second task queue.

[0049] It should be noted that if the predicted throughput of the buffer queue corresponding to the current preset period in the first process is less than the preset throughput threshold, then a task suspension may occur or has already occurred. In this case, task scheduling needs to be started to eliminate the possible or already occurred task suspension.

[0050] The first scheduling module is used to request a free buffer in the pre-selected buffer of the task processing system, set it in the first process, keep the first task queue in the first target buffer for execution, and move all the second task queues to the free buffer for execution.

[0051] It should be noted that if a task is suspended, it is usually because the task the target task depends on has not been executed in the second task queue, causing the target task to be suspended. Step S4 uses a free buffer in the pre-selection buffer to process the second task queue in the first target buffer. When the task the target task depends on is completed, the target task suspension will be eliminated. The pre-selection buffer can be a free buffer in the second process or a redundant buffer in the first process, where the first process and the second process are different processes.

[0052] As an example, the first acquisition module is specifically used to: acquire the number of tasks actually processed by each buffer in the first process of the task processing system within the current preset period; acquire the number of tasks actually received by each buffer in the first process of the task processing system within the current preset period; and determine the ratio of the number of tasks actually processed by each buffer within the current preset period to the number of tasks actually received by each buffer within the current preset period as the actual throughput of the buffer queue corresponding to each buffer in the current preset period. It should be noted that the preset period is a preset time interval, and the size of the preset time interval is set according to specific application requirements.

[0053] As an example, the second acquisition module is specifically used to: determine the first part of the buffer queue predicted throughput of each buffer in the first process by multiplying the actual throughput of the buffer queue corresponding to the current preset period by a preset first coefficient; determine the second part of the buffer queue predicted throughput of each buffer by multiplying the predicted throughput of the buffer queue corresponding to the previous preset period by a preset second coefficient, where the sum of the preset first coefficient and the preset second coefficient is 1; and determine the sum of the first part of the buffer queue predicted throughput and the second part of the buffer queue predicted throughput of each buffer as the buffer queue predicted throughput of each buffer in the current preset period. It should be noted that the specific processing of the second acquisition module can avoid data jitter affecting task scheduling and improve the accuracy of task scheduling. The preset first coefficient and the preset second coefficient are set based on specific application scenarios; specifically, the preset first coefficient is set to 0.3, and the preset second coefficient is set to 0.7.

[0054] As an example, the device further includes a second scheduling module, used to move the first task queue to a buffer outside the first target buffer in the first process when a target task completion instruction is received; and to set the first target buffer as an idle buffer in the pre-selected buffer. It should be noted that when the target task is completed, a target task completion instruction is generated. When the target task completion instruction is received, it indicates that the task suspension has been resolved, and at this time, the idle buffer borrowed from the pre-selected buffer can be returned to the pre-selected buffer.

[0055] As an example, the second scheduling module is specifically used to: when a target task completion instruction is received, determine the buffer with the highest predicted throughput of the current preset periodic buffer queue as the second target buffer; and move the first task queue to the second target buffer. It is understood that the predicted throughput of the current preset periodic buffer queue is obtained based on the first and second acquisition modules, and will not be elaborated further here.

[0056] In Example 2, the first acquisition module first obtains the actual throughput of the buffer queue corresponding to the current preset period for each buffer in the first process of the task processing system. Then, the second acquisition module obtains the predicted throughput of the buffer queue corresponding to the current preset period for each buffer in the first process based on the actual throughput of the buffer queue corresponding to the current preset period for each buffer in the first process, the predicted throughput of the buffer queue corresponding to the previous preset period for each buffer, and a preset adjustment coefficient. The determination module determines the first target buffer where task suspension may occur by using the predicted throughput of the buffer queue and a preset throughput threshold. Predicting the first target buffer where task suspension may occur based on the predicted throughput of the buffer queue can improve the prediction accuracy. Then, the first scheduling module requests an idle buffer from the pre-selected buffers of the task processing system and sets it in the first process. The first task queue is kept in the first target buffer for execution, and all second task queues are moved to the idle buffer for execution, thereby eliminating task suspension and improving the task processing efficiency of the task processing system.

[0057] Example 3 Embodiment 3 provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the following steps: The actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period is obtained. Each process corresponds to multiple buffers, which are used to receive the task queue.

[0058] The predicted throughput of the buffer queue for each buffer in the first process in the current preset period is obtained based on the actual throughput of the buffer queue for each buffer in the current preset period, the predicted throughput of the buffer queue for each buffer in the previous preset period, and the preset adjustment coefficient.

[0059] The buffer in the first process whose predicted throughput of the buffer queue corresponding to the current preset period is less than the preset throughput threshold is determined as the first target buffer. The task currently being executed in the first target buffer is determined as the target task. The task queue corresponding to the target task is determined as the first task queue. The other task queues in the first target buffer other than the first task queue are determined as the second task queue.

[0060] In the pre-selected buffer of the task processing system, a free buffer is requested and set in the first process. The first task queue is kept in the first target buffer for execution, and all second task queues are moved to the free buffer for execution.

[0061] Example 4 Embodiment 4 provides a computer-readable storage medium storing computer-executable instructions for performing the following steps: The actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period is obtained. Each process corresponds to multiple buffers, which are used to receive the task queue.

[0062] The predicted throughput of the buffer queue for each buffer in the first process in the current preset period is obtained based on the actual throughput of the buffer queue for each buffer in the current preset period, the predicted throughput of the buffer queue for each buffer in the previous preset period, and the preset adjustment coefficient.

[0063] The buffer in the first process whose predicted throughput of the buffer queue corresponding to the current preset period is less than the preset throughput threshold is determined as the first target buffer. The task currently being executed in the first target buffer is determined as the target task. The task queue corresponding to the target task is determined as the first task queue. The other task queues in the first target buffer other than the first task queue are determined as the second task queue.

[0064] In the pre-selected buffer of the task processing system, a free buffer is requested and set in the first process. The first task queue is kept in the first target buffer for execution, and all second task queues are moved to the free buffer for execution.

[0065] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0066] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0067] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A task queue scheduling method, characterized in that, include: Get the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period. Each process corresponds to multiple buffers, and the buffers are used to receive the task queue. The predicted throughput of the buffer queue for each buffer in the first process in the current preset period is obtained based on the actual throughput of the buffer queue for each buffer in the current preset period, the predicted throughput of the buffer queue for each buffer in the previous preset period, and the preset adjustment coefficient. The buffer in the first process whose predicted throughput of the current preset period is less than the preset throughput threshold is determined as the first target buffer. The task currently being executed in the first target buffer is determined as the target task. The task queue corresponding to the target task is determined as the first task queue. The other task queues in the first target buffer besides the first task queue are determined as the second task queue. In the pre-selected buffer of the task processing system, a free buffer is requested and set in the first process. The first task queue is kept in the first target buffer for execution, and all second task queues are moved to the free buffer for execution.

2. The method according to claim 1, characterized in that, The actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period includes: Get the number of tasks actually processed and completed in each buffer of the first process of the task processing system within the current preset period; Get the number of tasks actually received by each buffer in the first process of the task processing system within the current preset period; The ratio of the number of tasks actually processed by each buffer within the current preset period to the number of tasks actually received by each buffer within the current preset period is determined as the actual throughput of the buffer queue corresponding to each buffer in the current preset period.

3. The method according to claim 1, characterized in that, The method of obtaining the predicted throughput of the buffer queue for each buffer in the first process in the current preset period based on the actual throughput of the buffer queue for each buffer in the first process in the current preset period, the predicted throughput of the buffer queue for each buffer in the previous preset period, and a preset adjustment coefficient includes: The value of multiplying the actual throughput of the buffer queue corresponding to each buffer in the current preset period in the first process by the preset first coefficient is determined as the first part of the buffer queue predicted throughput of each buffer. The second part of the buffer queue predicted throughput of each buffer in the first process is determined by multiplying the predicted throughput of the buffer queue in the previous preset period by a preset second coefficient. The sum of the preset first coefficient and the preset second coefficient is 1. The sum of the first part of the buffer queue predicted throughput and the second part of the buffer queue predicted throughput for each buffer is determined as the buffer queue predicted throughput for each buffer in the current preset period.

4. The method according to claim 1, characterized in that, The method further includes: When the target task completion instruction is received, the first task queue is moved to a buffer outside the first target buffer in the first process; The first target buffer is set as a free buffer in the pre-selected buffer, which is either a free buffer in the second process or a redundant buffer in the first process.

5. The method according to claim 4, characterized in that, When a target task completion instruction is received, moving the first task queue to a buffer outside the first target buffer in the first process includes: When the target task completion instruction is received, the buffer with the highest predicted throughput of the current preset periodic buffer queue is determined as the second target buffer. Move the first task queue to the second target buffer.

6. A task queue scheduling device, characterized in that, include: The first acquisition module is used to acquire the actual throughput of the buffer queue corresponding to each buffer in the first process of the task processing system in the current preset period. Each process corresponds to multiple buffers, and the buffers are used to receive the task queue. The second acquisition module is used to acquire the buffer queue prediction throughput of each buffer in the first process in the current preset period based on the actual throughput of the buffer queue corresponding to each buffer in the current preset period, the predicted throughput of the buffer queue corresponding to each buffer in the previous preset period, and the preset adjustment coefficient. The determination module is used to determine the buffer in the first process whose predicted throughput of the buffer queue corresponding to the current preset period is less than the preset throughput threshold as the first target buffer, determine the currently executing task in the first target buffer as the target task, determine the task queue corresponding to the target task as the first task queue, and determine the other task queues in the first target buffer other than the first task queue as the second task queue. The first scheduling module is used to request a free buffer in the pre-selected buffer of the task processing system, set it in the first process, keep the first task queue in the first target buffer for execution, and move all the second task queues to the free buffer for execution.

7. The apparatus according to claim 6, characterized in that, The first acquisition module is specifically used for: Get the number of tasks actually processed and completed in each buffer of the first process of the task processing system within the current preset period; Get the number of tasks actually received by each buffer in the first process of the task processing system within the current preset period; The ratio of the number of tasks actually processed by each buffer within the current preset period to the number of tasks actually received by each buffer within the current preset period is determined as the actual throughput of the buffer queue corresponding to each buffer in the current preset period.

8. The apparatus according to claim 6, characterized in that, The second acquisition module is specifically used for: The value of multiplying the actual throughput of the buffer queue corresponding to each buffer in the current preset period in the first process by the preset first coefficient is determined as the first part of the buffer queue predicted throughput of each buffer. The second part of the buffer queue predicted throughput of each buffer in the first process is determined by multiplying the predicted throughput of the buffer queue in the previous preset period by a preset second coefficient. The sum of the preset first coefficient and the preset second coefficient is 1. The sum of the first part of the buffer queue predicted throughput and the second part of the buffer queue predicted throughput for each buffer is determined as the buffer queue predicted throughput for each buffer in the current preset period.

9. The apparatus according to claim 6, characterized in that, The device further includes a second scheduling module, which, when a target task completion instruction is received, moves the first task queue to a buffer outside the first target buffer in the first process; and sets the first target buffer as an idle buffer in a pre-selected buffer, wherein the pre-selected buffer is an idle buffer in the second process or a redundant buffer in the first process.

10. The apparatus according to claim 9, characterized in that, The second scheduling module is specifically used to: when a target task completion instruction is obtained, determine the buffer with the highest predicted throughput of the current preset periodic buffer queue as the second target buffer; and move the first task queue to the second target buffer.

11. An electronic device, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that are executed by the at least one processor, the instructions being configured to perform the method of any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, The device stores computer-executable instructions for performing the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Task scheduling method and task scheduling device

    CN105718317A

  • Task scheduling method and device in heterogeneous cluster and electronic equipment

    CN110489223A

  • Cloud fusion task migration method and system based on check point description file

    CN112799818A

  • Load processing method and related device

    CN114968546A

  • Multi-core system load balancing method and device, electronic equipment and storage medium

    CN116627651A