Task scheduling method and device based on adaptive time slice adjustment

By adopting the task scheduling method of adaptive time slice adjustment in a multi-access edge computing environment, the problem of insufficient processing capacity of edge servers under high load conditions is solved, and efficient task processing and improved service quality are achieved.

CN119336469APending Publication Date: 2025-01-21CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411468009.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In a multi-access edge computing environment, the processing power of edge servers is limited, resulting in insufficient performance of task scheduling policies under high load conditions, increasing service latency and reducing overall service quality.

Method used

A task scheduling method based on adaptive time slice adjustment is adopted to detect changes in data volume distribution in the task queue through a sliding window, dynamically adjust the time slice size in the buffer, and based on factors such as the task deadline, arrival rate, and network conditions, Dynamically develop scheduling strategies.

Benefits of technology

Improving the task processing capacity of the edge server under high load conditions, significantly improved throughput efficiency, ensured the timely processing of key tasks, and improved the average service quality of the task.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336469A_ABST
    Figure CN119336469A_ABST
Patent Text Reader

Abstract

The invention provides a task scheduling method and device based on adaptive time slice adjustment, and the method comprises an adaptive time slice adjustment mechanism and a task access scheduling mechanism, the adaptive time slice adjustment mechanism detects a change region of data volume distribution in a first priority buffer queue through a sliding window; and the size of each time slice in the buffer area is readjusted, so that the self-adaptive optimization of the time slices is realized. A task access scheduling mechanism comprehensively considers a plurality of factors such as the residual processing data volume required by the task, the deadline demand, the real-time network condition and the original position of the task, dynamically formulates different scheduling strategies, enhances the task processing capability of the edge server under the high load condition, remarkably improves the throughput efficiency of the edge server, and reduces the workload of the edge server. The key tasks are ensured to be processed in time, and the average service quality of the tasks is improved. The task scheduling method and device based on adaptive time slice adjustment provided by the invention can more effectively adapt to a complex real scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multi-access edge computing, and in particular to a task scheduling method and device based on adaptive time slice adjustment. Background Art

[0002] Multi-Access Edge Computing (MEC) is a distributed computing paradigm that deploys computing and storage resources at the edge of the network close to the data generation source, thereby reducing data transmission latency and bandwidth usage. With the widespread application of multi-access edge computing, the service latency problem caused by long-distance transmission between user devices and cloud servers has been effectively alleviated.

[0003] However, in task-intensive application scenarios where a large number of tasks need to be processed simultaneously, the limited processing capacity of edge servers often leads to congestion in the buffers of multiple servers, which in turn increases service delays and reduces the overall service quality. In addition, factors such as the deadline requirements of different tasks, changes in task arrival rates, and real-time fluctuations in network conditions make the traditional task scheduling strategies of edge servers inadequate in preventing and quickly alleviating congestion. This not only seriously affects the throughput efficiency of edge servers, but also has a negative impact on the average service quality of tasks.

[0004] Therefore, how to optimize the task access scheduling strategy to improve the task processing capability of the edge server under high load conditions has become a key issue to ensure efficient throughput of the edge server and improve the average service quality of the task. It is also a technical problem that technical personnel in this field need to solve urgently. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a task scheduling method and device based on adaptive time slice adjustment to solve the problems of service delay, slow processing speed and poor service quality.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] A first aspect of the present invention discloses a task scheduling method based on adaptive time slice adjustment, the method comprising:

[0008] When receiving an access request sent by the initiator, calculating the estimated response time of the task to be added in the access request, and feeding back to the initiator;

[0009] If a confirmation access request sent by the initiator based on the estimated response time is received, the task to be added is added to the tail of the first priority buffer queue;

[0010] When the total number of first tasks included in the first priority buffer queue is greater than the width of the sliding window in the first priority buffer queue, each first task in the first priority buffer queue is detected by moving the sliding window to adjust the first time slice of the first priority buffer queue; wherein the width of the sliding window is the number of consecutive tasks detected simultaneously; and the first time slice is the executable time period allocated to each first task in the first priority buffer queue;

[0011] Determine a second time slice of a second priority buffer queue and a third time slice of a third priority buffer queue according to the first time slice, and execute the first task based on the first time slice;

[0012] Using a task scheduler to update relevant information of a first timeout task and calculate a latest estimated response time of the first timeout task, and determining a priority buffer queue to which the first timeout task belongs based on the updated relevant information of the first timeout task and the latest estimated response time of the first timeout task; wherein the first timeout task is a first task in the first priority buffer queue that has not been completed within the first time slice;

[0013] When all first tasks in the first priority buffer queue are executed, the CPU's execution right is switched to the second priority buffer queue, and the second tasks in the second priority buffer queue are executed based on the second time slice;

[0014] Using a task scheduler to update relevant information of a second timeout task and calculate a latest estimated response time of the second timeout task, and determining a priority buffer queue to which the second timeout task belongs based on the updated relevant information of the second timeout task and the latest estimated response time of the second timeout task; wherein the second timeout task is a second task in the second priority buffer queue that has not been completed within the second time slice;

[0015] When all second tasks in the second priority buffer queue are executed, the execution right of the CPU is switched to the third priority buffer queue, and the third task in the third priority buffer queue is executed based on the third time slice;

[0016] Using the task scheduler to update the relevant information of the third timeout task and calculate the latest estimated response time of the third timeout task, and determine the priority buffer queue to which the third timeout task belongs based on the updated relevant information of the third timeout task and the latest estimated response time of the third timeout task; wherein the third timeout task is the third task in the third priority buffer queue that has not been completed within the third time slice;

[0017] When all the tasks in the first priority buffer queue, the second priority buffer queue and the third priority buffer queue are executed, the process ends.

[0018] Preferably, the calculating the estimated response time of the task to be added in the access request includes:

[0019] Obtaining the data volume of the task to be added in the access request and the current CPU real-time processing capability;

[0020] Calculate the request service time required for the task to be added based on the data volume and the current CPU real-time processing capability;

[0021] Determining whether the request service time is less than or equal to a first time slice of a first priority buffer queue;

[0022] If the request service time is less than or equal to the first time slice, then calculating the estimated response time of the task to be added according to the request service time, the total number of all first tasks in the first priority buffer queue and the data volume of each first task;

[0023] If the requested service time is greater than the first time slice, determining whether the requested service time is less than or equal to the sum of the first time slice and the second time slice of the second priority buffer queue;

[0024] If the request service time is less than or equal to the sum, then calculating the estimated response time of the task to be added according to the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each of the first tasks, and the total number of all second tasks in the second priority buffer queue, and the data volume of each of the second tasks;

[0025] If the request service time is greater than the sum, the estimated response time of the task to be added is calculated based on the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each of the first tasks, the total number of all second tasks in the second priority buffer queue, the data volume of each of the second tasks and the total number of all third tasks in the third priority buffer queue, as well as the data volume of each of the third tasks.

[0026] Preferably, the utilizing the sliding window to move and detect each first task of the first priority buffer queue to adjust the first time slice of the first priority buffer queue includes:

[0027] Utilizing the sliding window to move and detect each first task in the first priority buffer queue;

[0028] For each movement of the sliding window, detecting the task information of each first task in the current sliding window to obtain the number and total data volume of other first tasks arranged after the i-th first task in the current sliding window;

[0029] Calculate, according to the quantity, the total data volume and the current first time slice of the first priority buffer queue, the reduced waiting service time of other first tasks arranged after the i-th first task in the current sliding window after the i-th first task jumps in the sliding window;

[0030] Calculate the total waiting service time of other first tasks that can be reduced for all first tasks that generate jumps in the sliding window based on the reduced waiting service time of other first tasks;

[0031] The first time slice of the first priority buffer queue is adjusted according to the total waiting service time.

[0032] Preferably, if a confirmation access request sent by the initiator based on the estimated response time is received, then after the task to be added is added to the tail of the first priority buffer queue, the method further comprises:

[0033] Using the sliding window in the first priority buffer queue, searching for the first task in the first priority buffer queue that carries dependency information, and marking it as a dependent task;

[0034] A first task having an execution order dependency relationship with the dependent task is searched according to the dependency information, and the first task is logically bound to the dependent task.

[0035] Preferably, determining the priority buffer queue to which the first timed-out task belongs based on the updated relevant information of the first timed-out task and the latest estimated response time of the first timed-out task includes:

[0036] If the latest estimated response time of the first timed-out task is later than the deadline of the first timed-out task, adding the first timed-out task to the tail of the first priority buffer queue based on the updated relevant information of the first timed-out task;

[0037] If the latest estimated response time of the first timed-out task is not later than the deadline of the first timed-out task, the first timed-out task is added to the second priority buffer queue by the task scheduler based on the index scheduling method and the updated relevant information of the first timed-out task.

[0038] Preferably, determining the priority buffer queue to which the second timeout task belongs based on the updated relevant information of the second timeout task and the latest estimated response time of the second timeout task includes:

[0039] If the latest estimated response time of the second timeout task is later than the deadline of the second timeout task, adding the second timeout task to the tail of the first priority buffer queue by the task scheduler based on the updated relevant information of the second timeout task;

[0040] If the latest estimated response time of the second timeout task is not later than the deadline of the second timeout task, the task scheduler adds the second timeout task to the tail of the third priority buffer queue based on the updated relevant information of the second timeout task.

[0041] Preferably, determining the priority buffer queue to which the third timeout task belongs based on the updated relevant information of the third timeout task and the latest estimated response time of the third timeout task includes:

[0042] If the latest estimated response time of the third timeout task is later than the deadline of the third timeout task, adding the third timeout task to the tail of the first priority buffer queue by the task scheduler based on the updated relevant information of the third timeout task;

[0043] If the latest estimated response time of the third timeout task is not later than the deadline of the third timeout task, the task scheduler adds the third timeout task to the tail of the third priority buffer queue based on the updated relevant information of the third timeout task.

[0044] Preferably, if the latest estimated response time of the first timeout task is not later than the deadline of the first timeout task, adding the first timeout task to the second priority buffer queue by the task scheduler based on the index scheduling method and the updated relevant information of the first timeout task includes:

[0045] If the latest estimated response time of the first timeout task is not later than the deadline of the first timeout task, determining by the task scheduler whether the remaining request service time in the relevant information of the first timeout task is greater than the second time slice;

[0046] If it is greater, adding the first timed-out task to the tail of the second priority buffer queue;

[0047] If not, searching for the last second task in the second priority buffer queue that can be completed within the second time slice and marking it as an index task;

[0048] The first timeout task is added to the second priority buffer queue, at a middle position between the index task and the next second task, where the next second task is the second task arranged after the index task in the second priority buffer queue.

[0049] Preferably, the method further comprises:

[0050] For each task in the first priority buffer queue, the second priority buffer queue, and the third priority buffer queue, obtaining a deadline of a previous execution of the task;

[0051] Calculate the time difference between the last execution deadline of the task and the current time to obtain the waiting time of the task;

[0052] If the waiting time of the task is greater than the expected response time of the task, determining whether the task is in the first priority buffer queue;

[0053] If the task is in the first priority buffer queue, when the task is executed, the deadline of the last execution of the task is refreshed;

[0054] If the task is not in the first priority buffer queue, the task is added to the tail of the first priority buffer queue, and the deadline of the last execution of the task is refreshed.

[0055] A second aspect of the present invention discloses a task scheduling device based on adaptive time slice adjustment, the device comprising:

[0056] A first calculation unit, configured to calculate, when receiving an access request sent by an initiator, an estimated response time of a task to be added in the access request, and feed back the estimated response time to the initiator;

[0057] an adding unit, configured to add the task to be added to the tail of the first priority buffer queue if a confirmation access request sent by the initiator based on the estimated response time is received;

[0058] a mobile detection unit, configured to, when the total number of first tasks included in the first priority buffer queue is greater than the width of the sliding window in the first priority buffer queue, use the sliding window to move and detect each first task in the first priority buffer queue to adjust the first time slice of the first priority buffer queue; wherein the width of the sliding window is the number of consecutive tasks detected simultaneously; and the first time slice is an executable time period allocated to each first task in the first priority buffer queue;

[0059] a determining and executing unit, configured to determine a second time slice of a second priority buffer queue and a third time slice of a third priority buffer queue according to the first time slice, and execute the first task based on the first time slice;

[0060] A first determining unit is used to update the relevant information of the first timeout task and calculate the latest estimated response time of the first timeout task by using the task scheduler, and determine the priority buffer queue to which the first timeout task belongs based on the updated relevant information of the first timeout task and the latest estimated response time of the first timeout task; wherein the first timeout task is the first task in the first priority buffer queue that has not been completed within the first time slice;

[0061] A first execution unit, configured to switch the execution right of the CPU to the second priority buffer queue when all first tasks in the first priority buffer queue are executed, and execute the second task in the second priority buffer queue based on the second time slice;

[0062] A second determining unit is used to update the relevant information of the second timeout task and calculate the latest estimated response time of the second timeout task by using the task scheduler, and determine the priority buffer queue to which the second timeout task belongs based on the updated relevant information of the second timeout task and the latest estimated response time of the second timeout task; wherein the second timeout task is the second task in the second priority buffer queue that has not been completed within the second time slice;

[0063] A second execution unit, configured to switch the execution right of the CPU to the third priority buffer queue when all the second tasks in the second priority buffer queue are executed, and execute the third task in the third priority buffer queue based on the third time slice;

[0064] A third determining unit is used to update the relevant information of the third timeout task and calculate the latest estimated response time of the third timeout task by using the task scheduler, and determine the priority buffer queue to which the third timeout task belongs based on the updated relevant information of the third timeout task and the latest estimated response time of the third timeout task; wherein the third timeout task is the third task in the third priority buffer queue that has not been completed within the third time slice;

[0065] The terminating unit is used to terminate the process when all the tasks in the first priority buffer queue, the second priority buffer queue and the third priority buffer queue are executed.

[0066] Based on the above-mentioned embodiment of the present invention, a task scheduling method and device based on adaptive time slice adjustment are provided, including an adaptive time slice adjustment mechanism and a task access scheduling mechanism. The adaptive time slice adjustment mechanism detects the change area of ​​the data volume distribution in the first priority buffer queue through a sliding window, and readjusts the size of each time slice in the buffer accordingly, thereby realizing adaptive optimization of the time slice. The task access scheduling mechanism comprehensively considers multiple factors such as the remaining amount of data required for processing the task, the deadline requirements, the real-time network conditions and the original location of the task, dynamically formulates different scheduling strategies, enhances the task processing capability of the edge server itself under high load conditions, significantly improves the throughput efficiency of the edge server, ensures that key tasks are processed in a timely manner, and improves the average service quality of the task. The task scheduling method and device based on adaptive time slice adjustment proposed by the present invention can more effectively adapt to complex real-life scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0068] Figure 1 A schematic diagram of congestion phenomenon in a task-intensive scenario provided by an embodiment of the present invention;

[0069] Figure 2 A flowchart of a task scheduling method based on adaptive time slice adjustment provided by an embodiment of the present invention;

[0070] Figure 3 A flowchart of calculating the estimated response time of a task to be added provided by an embodiment of the present invention;

[0071] Figure 4 A schematic diagram of a task scheduling method based on adaptive time slice adjustment provided by an embodiment of the present invention;

[0072] Figure 5 A schematic diagram of a first task of sliding window motion detection provided by an embodiment of the present invention;

[0073] Figure 6 A flowchart of adjusting a first time slice of a first priority buffer queue provided by an embodiment of the present invention;

[0074] Figure 7 A pseudo code diagram of an adaptive time slice adjustment algorithm provided by an embodiment of the present invention;

[0075] Figure 8A pseudo code diagram of a task access scheduling algorithm provided by an embodiment of the present invention;

[0076] Fig. 9 A flowchart of an index scheduling method provided by an embodiment of the present invention;

[0077] Fig.10 A flowchart of scheduling tasks according to a retimer provided in an embodiment of the present invention;

[0078] Fig.11 A structural block diagram of a task scheduling device based on adaptive time slice adjustment provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0079] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0080] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0081] Combining background technology and Figure 1 As can be seen from the shown content, the edge server is responsible for receiving various computing tasks. These tasks are huge, including tasks offloaded from mobile user devices within the coverage of the edge server, as well as computing tasks migrated from other edge servers. Due to the distributed nature of multi-access edge computing, task scheduling needs to consider factors such as task priority, allocation of computing resources, and network status. Traditional task access scheduling strategies are mainly to schedule tasks to idle computing nodes, or to migrate tasks to nearby idle edge servers for processing. However, in task-intensive areas, almost all edge servers are in a high-load or congested state, resulting in the surrounding edge servers or computing nodes being unable to receive new task requests due to resource constraints. Even in a few cases where there are relatively idle edge servers, due to the defects of traditional task access scheduling strategies, they will soon fall into a congested state, resulting in a large backlog of tasks in the system and unable to be processed in a timely manner. Combined with Figure 1As shown, when there is a migration demand, the neighboring edge servers may refuse to access the task due to their own congestion, resulting in a significant decrease in the overall service quality.

[0082] Therefore, an embodiment of the present invention provides a task scheduling method and device based on adaptive time slice adjustment, including an adaptive time slice adjustment mechanism and a task access scheduling mechanism. The adaptive time slice adjustment mechanism detects the change area of ​​the data volume distribution in the first priority buffer queue through a sliding window, and readjusts the size of each time slice in the buffer accordingly, thereby realizing adaptive optimization of the time slice. The task access scheduling mechanism comprehensively considers multiple factors such as the remaining amount of data required for processing the task, deadline requirements, real-time network conditions, and the original location of the task, dynamically formulates different scheduling strategies, enhances the edge server's own task processing capabilities under high load conditions, significantly improves the throughput efficiency of the edge server, ensures that key tasks are processed in a timely manner, and improves the average service quality of the task. The task scheduling method and device based on adaptive time slice adjustment proposed by the present invention can more effectively adapt to complex real-life scenarios.

[0083] See also Figure 2 , shows a flowchart of a task scheduling method based on adaptive time slice adjustment provided by an embodiment of the present invention, which is applied to a task-intensive multi-access edge computing environment.

[0084] It should be noted that a time slice is a basic unit of task scheduling. A time slice refers to the processing time period that the CPU allocates to each task in a multi-tasking operating system to avoid tasks that occupy computing resources for a long time, which causes buffer congestion and affects the timely processing of other tasks. At the end of the time slice, the scheduler will switch to execute the next task, thereby realizing concurrent processing of multiple tasks. In the following content, the time slice of the first priority buffer queue is recorded as the first time slice, and each task in the first priority buffer queue is recorded as the first task. The first time slice is the maximum time that the first priority buffer queue allows a first task to execute at one time.

[0085] The task scheduling method includes:

[0086] Step S201: when an access request sent by an initiator is received, the estimated response time of the task to be added in the access request is calculated and fed back to the initiator.

[0087] It should be noted that the access request at least includes the data volume of the task to be added and the deadline of the task to be added.

[0088] It is understandable that when a task is connected to the edge server system, the access controller will first conduct a comprehensive analysis of the characteristics of each task to be added, including the deadline of the task to be added, the amount of execution data required for the task to be added (i.e., the amount of data of the task to be added), etc. Based on this information and the current state of the buffer, the estimated response time of the task to be added is calculated and returned by the access controller to the initiator, which decides whether to connect to the edge server.

[0089] In some specific embodiments, the access controller may also delay or reject the access of the task to be added to prevent the edge server system from being overloaded and unable to guarantee the service quality of the task.

[0090] It should be noted that calculating the estimated response time of the task to be added in the access request can help to perform preliminary screening when the task is accessed to the edge server, thereby avoiding problems such as resource waste and service quality degradation caused by unreasonable task access.

[0091] In the specific implementation of step S201, when the access controller receives the access request sent by the initiator, it calculates the estimated response time of the task to be added according to the data volume of the task to be added and the current CPU real-time processing capability, and feeds back the estimated response time of the task to be added to the initiator.

[0092] It is understood that the specific process of calculating the expected response time of the task to be added based on the data volume of the task to be added and the current CPU real-time processing capability is shown in Figure 3 shown. Figure 3 Included:

[0093] Step S301: Obtain the data volume of the task to be added in the access request and the current CPU real-time processing capability.

[0094] It should be noted that the estimated response time of the task to be added is associated with the real-time processing capability of the current CPU and the data volume of the task to be added.

[0095] Therefore, in the specific process of implementing step S301, the access controller obtains the data volume of the task to be added in the access request (specifically, the remaining data volume of the task to be added that needs to be processed) and the current CPU real-time processing capability.

[0096] Step S302: Calculate the request service time required for the task to be added based on the data volume and the current CPU real-time processing capability.

[0097] In the specific implementation of step S302, based on the data volume of the task to be added (specifically, the remaining data volume to be processed by the task to be added) and the current CPU real-time processing capability, the request service time required for the task to be added is calculated in combination with formula (1).

[0098] First, the current CPU real-time processing capability is expressed as C(N c ,N t ,N), where N c Indicates the number of CPU cores, N t Represents the number of CPU threads, and N is an abstract parameter representing the network status.

[0099] Secondly, the amount of data to be added is represented by |T i |.

[0100]

[0101] in, Represents task T i Execute i The time required to service the request after that. Represents task T i The amount of data completed in the jth execution, r i Represents task T i The number of times it was executed.

[0102] It should be noted that if task T i During one execution, it is due to the assignment to task T i The time slice is exhausted and the execution ends. Then the amount of data completed in this execution It can be expressed as:

[0103]

[0104] Among them, q(k) represents the buffer queue Q k The time slice size is k = {1, 2, 3}. If task T i The execution of this time ends because a higher priority task deprives the CPU of execution rights. Then the amount of data completed in this execution is It can be expressed as:

[0105]

[0106] Among them, t i,j Represents task T i The time when the jth execution is performed, and t i,j <=q(k).

[0107] It is understandable that the buffer queues have different priorities, for example, the priority of the first priority buffer queue is higher than that of the second priority buffer queue, and the priority of the second priority buffer queue is higher than that of the third priority buffer queue. When the CPU is executing a task in the second priority buffer queue or the third priority buffer queue, if a new task is connected to the high priority buffer queue, the CPU's execution right will be preempted, and the CPU will switch to executing the task in the higher priority buffer queue.

[0108] Step S303: Determine whether the requested service time is less than or equal to the first time slice of the first priority buffer queue.

[0109] In the specific implementation of step S303, after the request service time required for the task to be added is calculated, it is determined whether the request service time required for the task to be added is less than or equal to the first time slice of the first priority buffer queue. If the request service time required for the task to be added is less than or equal to the first time slice of the first priority buffer queue, step S304 is executed; if the request service time required for the task to be added is greater than the first time slice of the first priority buffer queue, step S305 is executed.

[0110] It is understandable that if task T i Request service time satisfy Then the value of the estimated response time of the task to be added is only related to the first priority buffer queue, otherwise the value of the estimated response time of the task to be added is also related to the other two buffer queues (ie, the second priority buffer queue or the third priority buffer queue).

[0111] Determine the expected response time Tm of the task to be added according to formula (4) i :

[0112]

[0113] Among them, N(Q k ) represents the buffer queue Q k The number of existing tasks in the buffer queue Q k In the nth task, task T is given i Increased waiting time. When task T i When in the second priority buffer queue or the third priority buffer queue, if a new task enters the high priority buffer queue, the CPU execution right is preempted. i It means that task T i Increased waiting time due to CPU execution preemption.

[0114] It should be noted that w iThe value of ep(k,n) is affected by the specific data set. In addition, the value of ep(k,n) is affected by the scheduling algorithm. This is because the unfinished task T i After being scheduled to a new position by the scheduler, the index value of the new position will directly affect the value of ep(k,n). However, since the time slice of the buffer queue will limit the time for a single task to execute, ep(k,n) needs to satisfy: 0≤ep(k,n)≤q(k).

[0115] Step S304: If the request service time is less than or equal to the first time slice, the estimated response time of the task to be added is calculated according to the request service time, the total number of all first tasks in the first priority buffer queue and the data volume of each first task.

[0116] In the specific implementation of step S304, if the request service time required for the task to be added is less than or equal to the first time slice of the first priority buffer queue (i.e. ), then the expected response time of the task to be added is calculated according to the request service time, the total number of all first tasks in the first priority buffer queue and the data volume of each first task (as shown in formula (4)).

[0117] Step S305: If the requested service time is greater than the first time slice, determine whether the requested service time is less than or equal to the sum of the first time slice and the second time slice of the second priority buffer queue.

[0118] In the process of implementing step S305, if the request service time required for the task to be added is greater than the first time slice of the first priority buffer queue, it is determined whether the request service time is less than or equal to the sum of the first time slice of the first priority buffer queue and the second time slice of the second priority buffer queue (i.e., q(1)+q(2)).

[0119] It should be noted that if the requested service time is less than or equal to the sum of the first time slice of the first priority buffer queue and the second time slice of the second priority buffer queue, step S306 is executed; if the requested service time is greater than the sum of the first time slice of the first priority buffer queue and the second time slice of the second priority buffer queue, step S307 is executed.

[0120] Step S306: If the request service time is less than or equal to the sum, the estimated response time of the task to be added is calculated based on the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each first task and the total number of all second tasks in the second priority buffer queue, and the data volume of each second task.

[0121] In the process of implementing step S306, if the request service time required for the task to be added is greater than the first time slice of the first priority buffer queue, and the request service time is less than or equal to the sum of the first time slice of the first priority buffer queue and the second time slice of the second priority buffer queue, then the estimated response time of the task to be added is calculated based on the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each first task and the total number of all second tasks in the second priority buffer queue, as well as the data volume of each second task (as shown in formula (4)).

[0122] Step S307: If the request service time is greater than the sum, then the estimated response time of the task to be added is calculated based on the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each first task, the total number of all second tasks in the second priority buffer queue, the data volume of each second task and the total number of all third tasks in the third priority buffer queue, and the data volume of each third task.

[0123] In the process of implementing step S307, if the request service time is greater than the sum of the first time slice of the first priority buffer queue and the second time slice of the second priority buffer queue, the estimated response time of the task to be added is calculated based on the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each first task, the total number of all second tasks in the second priority buffer queue, the data volume of each second task and the total number of all third tasks in the third priority buffer queue, as shown in formula (4).

[0124] It is understandable that, combined with Figure 3 As shown in the content, when the task to be added is connected to the edge server system, calculating the expected response time of the task to be added is the first step of task access (i.e. Figure 4 The schematic diagram of the task scheduling method based on adaptive time slice adjustment shown in FIG. 1 includes “(1) request access (2) return expected response time”), and task access is a task access scheduling strategy based on adaptive time slice adjustment (i.e., Figure 4 The main purpose of the first step in ASTA-Ⅱ (shown in the dotted box) is to reasonably manage and control the tasks when they enter the system to ensure the stability and efficiency of the system.

[0125] It is further understood that when calculating the expected response time of the task to be added, multiple factors need to be considered, including: (1) The current real-time network status significantly affects the speed at which the server processes task data, because different network conditions may lead to differences in data transmission and processing capabilities, which directly affect the processing efficiency and response time of the task. (2) The state of the buffer queue. Since the amount of tasks in the buffer affects the server load, the number of tasks is directly related to the queue waiting time and processing efficiency, which in turn affects the overall response time. (3) The amount of data in the task. The larger the amount of data, the more times it needs to be executed in the buffer, resulting in a longer waiting time; while tasks with less data require fewer executions and have a relatively shorter waiting time. These factors work together to determine the processing efficiency and response time of the task in the buffer.

[0126] The core of the task access scheduling strategy is to dynamically adjust the task admission criteria based on the current system load and resource usage. Specifically, when the system load is low, that is, when there are fewer tasks in the buffer, the system's response time to adding tasks is faster, allowing more tasks to enter the system at the same time to fully utilize available resources. When the system load is high, that is, when there are more tasks in the buffer, the system's response time to adding tasks is slower.

[0127] Step S202: If a confirmation access request sent by the initiator based on the estimated response time is received, the task to be added is added to the tail of the first priority buffer queue.

[0128] It is understandable that after the access controller feeds back the estimated response time of the task to be added to the initiator, the initiator will decide whether to access the edge server based on the estimated response time and the deadline of the task to be added. The deadline of the task to be added is the task's requirement for the response deadline. If the initiator confirms that it has accessed the edge server, it sends a confirmation access request to the access controller.

[0129] In the specific implementation of step S202, when the access controller receives the access confirmation request sent by the initiator based on the estimated response time, the task to be added is added to the tail of the first priority buffer queue.

[0130] For example Figure 4 As shown, the new task (i.e., the task to be added) is connected to the queue buffer, specifically, it will be added to the first priority buffer queue (such as Figure 4 The tail of Queue Q1).

[0131] Step S203: When the total number of first tasks contained in the first priority buffer queue is greater than the width of the sliding window in the first priority buffer queue, each first task in the first priority buffer queue is detected by moving the sliding window to adjust the first time slice of the first priority buffer queue.

[0132] In the process of implementing step S203, when the total number of first tasks contained in the first priority buffer queue is greater than the width of the sliding window in the first priority buffer queue, the access controller uses the sliding window to move from the head of the queue to the tail of the queue to detect each first task of the first priority buffer queue to adjust the first time slice of the first priority buffer queue.

[0133] Understandably, see Figure 5 The schematic diagram shown is of a sliding window moving to detect a first task, wherein the sliding window moves one task unit each time.

[0134] It should be noted that the sliding window is only applied to the first priority buffer queue. The width of the sliding window is the number of consecutive tasks that the sliding window can detect at the same time (that is, W l Represents the width of the sliding window, so the number of the first tasks for each detection is also W l ); The first time slice is an executable time period allocated to each first task in the first priority buffer queue.

[0135] That is to say, Figure 5 As shown, W l represents the width of the sliding window. The total number of first tasks contained in the first priority buffer queue is N(Q k ), k={1,2,3}, then when N(Q1)≥W l When the access controller detects each first task of the first priority buffer queue by using the sliding window movement, the first time slice of the first priority buffer queue is adjusted.

[0136] It should be noted that since the size of the time slice directly affects the frequency of task switching and the overall response speed of the system, by dynamically adjusting the size of the time slice, the efficiency of task execution and the system load can be balanced. Especially in task-intensive scenarios, this adjustment helps to improve the throughput and responsiveness of the overall system. Based on this, the specific implementation process of using the sliding window to move and detect each first task in the first priority buffer queue to adjust the first time slice of the first priority buffer queue can be found in Figure 6 , Figure 6 Included:

[0137] Step S601: Utilize a sliding window to move and detect each first task in a first priority buffer queue.

[0138] In the specific implementation of step S601 , a sliding window is used to detect each first task in the first priority buffer queue in a direction from the head to the tail.

[0139] It should be noted that, combined with Figure 7 The pseudo code diagram of the adaptive time slice adjustment algorithm is shown as follows: Figure 7 From line 13 to line 14 in the figure, during the moving detection process of the sliding window, if a new task is added to the tail of the first priority buffer queue, the sliding window will continue to move toward the tail from the current stop position instead of restarting the detection from the head of the first priority buffer queue.

[0140] It is understandable that the sliding window will continue to move until the sliding window detects the last first task in the first priority buffer queue.

[0141] Step S602: for each movement of the sliding window, detect the task information of each first task in the current sliding window to obtain the number and total data volume of other first tasks arranged after the i-th first task in the current sliding window.

[0142] In the process of implementing step S602, for each movement of the sliding window in the first priority buffer queue, the task information of each first task in the current sliding window is detected to obtain the number of other first tasks after the i-th first task in the current sliding window and the total data volume of the other first tasks from the task information.

[0143] Step S603: Calculate the reduced waiting service time of other first tasks after the i-th first task in the current sliding window after the i-th first task jumps in the sliding window according to the quantity, the total data volume and the current first time slice of the first priority buffer queue.

[0144] In the process of implementing step S603, based on the number of other first tasks, the total data volume of other first tasks and the current first time slice of the first priority buffer queue, the reduced waiting service time of other first tasks that are arranged after the i-th first task in the sliding window is calculated after the i-th first task jumps in the sliding window.

[0145] It should be noted that the specific calculation formula is shown in formula (5):

[0146]

[0147] in, It indicates that after the i-th first task jumps in the sliding window, the waiting service time of other first tasks in the sliding window that are arranged after the i-th first task in the current sliding window is reduced; Represents the i-th first task in the current sliding window; Indicates that in the first priority buffer queue, the task the number of other first tasks that followed; Indicates that in the first priority buffer queue, the task The total amount of data for the other first tasks afterwards; C(N c ,N t ,N) represents the current CPU real-time processing capability, N c Indicates the number of CPU cores, N t Represents the number of CPU threads, and N is an abstract parameter representing the network status.

[0148] It is understandable that, since the access controller may access a new first task to the first priority buffer queue at any time, and The value represented can vary.

[0149] It should be noted that, since the first task in the first priority buffer queue will only be jumped if it fails to be completed within the first time slice, the constraint (as shown in formula (6)) needs to be satisfied:

[0150]

[0151] Wherein, q(1) represents the first time slice size of the first priority buffer queue.

[0152] Step S604: Calculate the total waiting service time of other first tasks that can be reduced by all first tasks that generate jumps in the sliding window based on the reduced waiting service time of other first tasks.

[0153] In the specific implementation of step S604, based on the reduced waiting service time of other first tasks The total waiting service time of other first tasks that can be reduced by all first tasks that generate jumps in the sliding window is calculated.

[0154] It should be noted that the specific calculation formula is shown in formula (7):

[0155]

[0156] Among them, red total Represents the total waiting service time of other first tasks that can be reduced by all first tasks that generate jumps in the sliding window.

[0157] Step S605: adjusting the first time slice of the first priority buffer queue according to the total waiting service time.

[0158] In the specific implementation of step S605, the first time slice of the first priority buffer queue can be adjusted based on the total waiting service time of other first tasks that generate jumps in the sliding window.

[0159] It is understandable that when the sliding window detection finds that the amount of task data in the area within the current sliding window has changed significantly, and / or when the real-time network conditions (reflected in the current CPU real-time processing capability) have changed significantly, it can be determined that the first time slice is no longer adapted. At this time, the area within the current sliding window will be marked as a "time slice adjustment area" and the first time slice of the first priority buffer queue will be readjusted. Specifically, when the CPU executes to this area, the first time slice will be adjusted according to the "time slice adjustment area" marked before the sliding window. In addition, the sliding window will continue to move until it reaches the end of the first priority buffer queue.

[0160] It should be noted that Figure 6 The content shown corresponds to Figure 4 The content of ASTA-Ⅰ in the dashed box. Figure 4 The content in the dashed box ASTA-Ⅰ in the middle represents the first time slice of the first priority buffer queue adjusted based on the sliding window, corresponding to the adaptive time slice adjustment algorithm; Figure 4 The content in the dashed box ASTA-Ⅱ corresponds to the task access scheduling algorithm. Figure 4 The contents of ASTA-Ⅰ in the dashed box and Figure 4 The contents in the dashed box ASTA-Ⅱ are not included in the relationship, but run simultaneously. That is to say, the adaptive time slice adjustment algorithm is used to dynamically adjust the time slice to assist the implementation of the task access scheduling algorithm.

[0161] Combination Figure 6 As shown in the figure, the dynamic adjustment of time slices effectively avoids the time slice mismatch problem caused by changes in task data volume distribution and network fluctuations, and can better adapt to network changes and differences in task characteristics, thereby improving the efficiency of task access and scheduling. Too large a time slice will lead to insufficient scheduling of large data volume tasks, which will cause buffer congestion; while too small a time slice will lead to frequent task switching, increasing system overhead and delay. Therefore, the adaptive time slice adjustment mechanism optimizes the size of the time slice, improves resource utilization and task execution efficiency, and achieves a balance between scheduling efficiency and system burden.

[0162] In some specific embodiments, when the sliding window moves from the head of the queue to the tail of the queue, it not only evaluates the adaptability of the first time slice, but also needs to detect multiple first tasks with execution order dependencies in the first priority buffer queue and logically bind them, for example Figure 7 The pseudo code for lines 1 to 6 is shown.

[0163] Specifically, a sliding window in the first priority buffer queue is used to search for the first task in the first priority buffer queue that carries dependency information and is marked as a dependent task; the first task that has an execution order dependency relationship with the dependent task is searched based on the dependency information and is logically bound to the dependent task.

[0164] It can be understood that the dependency information of the first task at least includes the ID of the first task with which it has a dependency relationship. For example, the dependency information of the first task a includes the ID of the first task b. Then, the position of the first task b in the first priority buffer queue is detected based on the ID of the first task b, and the first task a and the first task b are logically bound.

[0165] It should be noted that logically binding these first tasks with execution order dependencies does not mean merging multiple first tasks into a task with a larger data volume, but rather establishing a logical binding, and using this binding relationship as one of the important factors in formulating a scheduling strategy. In this way, during the task scheduling process, it can be ensured that the execution order and dependency relationship between tasks are maintained and will not be destroyed.

[0166] For example, in Figure 5 In the example, there is an execution order dependency between a first task (Task2) that requires more service time and a first task (Task5) that requires less service time, requiring Task2 to be completed before Task5. From the position in the first priority buffer queue, Task2 will be executed by the CPU first. Therefore, during the scheduling process, if Task2 and Task5 are not bound through a sliding window, then Task2, which requires more service time, may be scheduled to a position in another buffer (that is, a position in the second priority buffer queue or the end of the queue in the first priority buffer queue) after completing its time slice, while Task5, which requires less service time, may be completed within the time slice and exit the buffer, causing Task5 to be completed before Task2, which will destroy the execution order dependency between the two.

[0167] Therefore, a key role of the sliding window is to bind multiple first tasks that have execution order dependencies to ensure that the correct execution order of the tasks is maintained.

[0168] It is understandable that, combined with Figure 6The content shown and Figure 7 The pseudo code shown in the figure shows the contents (specifically Figure 7 ), such a mechanism is used to dynamically adjust the time slice size and intelligently manage the task order dependency, improve the task scheduling efficiency and overall system performance of the edge server, and is especially suitable for high-load, task-intensive computing environments. It adapts to task loads and real-time network conditions, thereby optimizing resource utilization, improving system throughput, reducing task delays, and ensuring that the execution order dependency between tasks is not destroyed. Ultimately, it improves the overall performance and stability of the system.

[0169] Step S204: Determine a second time slice of the second priority buffer queue and a third time slice of the third priority buffer queue according to the first time slice, and execute the first task based on the first time slice.

[0170] In the specific implementation of step S204, the second time slice of the second priority buffer queue and the third time slice of the third priority buffer queue are determined according to the first time slice, for example, the second time slice of the second priority buffer queue is set to twice the size of the first time slice; the third time slice of the third priority buffer queue is set to twice the size of the second time slice. Then, each first task in the first priority buffer queue is executed based on the first time slice.

[0171] It is understandable that, combined with Figure 8 The pseudo code diagram of the task access scheduling algorithm is shown in FIG. Figure 8 From the pseudocodes in lines 1, 2, and 6, we can see that the CPU will execute the tasks in the queue in order according to the priority of the buffer queue, so the CPU will first execute the first task in the first priority buffer queue. Figure 8 From the pseudo code of lines 6 to 10 in FIG. 1 , it can be seen that if the first task can be completed within the first time slice allocated by the first priority buffer queue, the CPU continues to execute the next first task. The first task that cannot be completed within the first time slice will be marked as a first timeout task, and the position of these first timeout tasks in the buffer will be adjusted by the task scheduler, as shown in step S205.

[0172] Step S205: Use the task scheduler to update the relevant information of the first timeout task and calculate the latest estimated response time of the first timeout task, and determine the priority buffer queue to which the first timeout task belongs based on the updated relevant information of the first timeout task and the latest estimated response time of the first timeout task.

[0173] The first timed-out task is the first task in the first priority buffer queue that has not been completed within the first time slice.

[0174] It should be noted that the relevant information of the first timeout task includes but is not limited to the remaining amount of data to be processed, the remaining request service time, and the current CPU real-time processing capability of the first timeout task.

[0175] In the process of implementing step S205, when any first task fails to be completed within the first time slice, it is marked as a first timeout task. At this time, the task scheduler needs to update the relevant information of the first timeout task and calculate the latest estimated response time of the first timeout task. Then, based on the updated relevant information of the first timeout task and the latest estimated response time of the first timeout task, the priority buffer queue to which the first timeout task belongs is determined.

[0176] That is, according to the relevant information of the first timed-out task and the latest estimated response time of the first timed-out task, it is determined whether the first timed-out task jumps to the tail of the first priority buffer queue or the second priority buffer queue.

[0177] For example: Combine Figure 5 The first time slice size allocated by the first priority buffer queue to Task2 is 5ms, which means that Task2 can only be executed for a maximum of 5ms in the first priority buffer queue. After executing these 5ms, that is, after completing this first time slice, if Task2 still has data that has not been processed, then Task2 will enter the task scheduler. At this time, Task2 is marked as the first timed-out task and is scheduled to a new position.

[0178] Specifically, the specific calculation process of calculating the latest estimated response time of the first timed-out task using the task scheduler is consistent with the specific calculation process of calculating the estimated response time of the task to be added, and will not be repeated here.

[0179] It is understandable that it is necessary to recalculate the latest estimated response time of the first timed-out task, because this time is estimated based on the current CPU real-time processing capability and the queue status of the buffer, and may differ from the actual response time. Recalculating the estimated response time before each scheduling can provide a more accurate estimate than the last time, so that the task scheduler can formulate a more reasonable scheduling strategy and reduce the risk of tasks failing to meet deadlines. It can be understood that the estimated response time of each task needs to be recalculated at each stage to improve the accuracy of task scheduling.

[0180] It can be understood that the priority buffer queue and the specific index position to which the first timeout task belongs are determined based on the latest estimated response time of the first timeout task. The specific process is as follows (process A1-process A3):

[0181] Process A1: Determine whether the latest estimated response time of the first timeout task is later than the deadline of the first timeout task. If it is later, execute process A2; if it is not later, execute process A3.

[0182] Process A2: If the latest estimated response time of the first timed-out task is later than the deadline of the first timed-out task, the first timed-out task is added to the tail of the first priority buffer queue based on the updated relevant information of the first timed-out task.

[0183] It is understandable that, combined with Figure 8 From the pseudocodes from lines 11 to 13, it can be seen that if the latest estimated response time of the first timeout task is later than the deadline of the first timeout task, it indicates that the priority of the first timeout task needs to be increased. Therefore, the first timeout task is rescheduled to the end of the first priority buffer queue.

[0184] It should be noted that rescheduling the first timed-out task to the end of the first priority buffer queue can reduce the waiting time of the first timed-out task, thereby increasing the probability that the first timed-out task will be responded to before its deadline.

[0185] Process A3: If the latest estimated response time of the first timeout task is not later than the deadline of the first timeout task, the task scheduler adds the first timeout task to the second priority buffer queue based on the index scheduling method and the updated relevant information of the first timeout task.

[0186] It is understandable that, combined with Figure 8 From the pseudocodes from lines 14 to 21, it can be seen that if the latest estimated response time of the first timeout task is not later than the deadline of the first timeout task, it indicates that there is no need to increase the priority of the first timeout task. Therefore, the first timeout task is added to the second priority buffer queue based on the index scheduling method.

[0187] It should be noted that the specific content of the index scheduling method can be found in Fig. 9 The flowchart of the index scheduling method shown includes:

[0188] Step S901: If the latest estimated response time of the first timeout task is not later than the deadline of the first timeout task, the task scheduler determines whether the remaining request service time in the relevant information of the first timeout task is greater than the second time slice. If the remaining request service time in the relevant information of the first timeout task is greater than the second time slice, step S902 is executed; if the remaining request service time in the relevant information of the first timeout task is not greater than the second time slice, step S903 is executed.

[0189] It should be noted that the remaining request service time in the relevant information of the first timeout task is specifically determined based on the real-time processing capability of the CPU under current network conditions and the remaining amount of data required to be processed by the first timeout task.

[0190] Step S902: If it is greater, then the first timed-out task is added to the tail of the second priority buffer queue.

[0191] In the process of implementing step S902, if the remaining request service time in the relevant information of the first timeout task is greater than the second time slice, it indicates that the first timeout task cannot be completed within the second time slice, and the first timeout task is directly added to the end of the second priority buffer queue.

[0192] Step S903: If not, search the second priority buffer queue for the last second task that can be completed within the second time slice, mark it as the index task, and execute step S904.

[0193] In the process of implementing step S903, if the remaining request service time in the relevant information of the first timeout task is not greater than the second time slice, it indicates that the first timeout task can be completed within the second time slice. At this time, it is necessary to search the index task in the second priority buffer queue, that is, the last second task in the second priority buffer queue that can be completed within the second time slice; then execute step S904.

[0194] That is to say, the second tasks in the second priority buffer queue are divided into two parts: the second tasks arranged behind the index task in the second priority buffer queue are all tasks that cannot be completed within the second time slice. The second tasks arranged before the index task in the second priority buffer queue are all tasks that can be completed within the second time slice, and the index task is also a task that can be completed within the second time slice.

[0195] Step S904: adding the first timed-out task to the second priority buffer queue, at a position between the index task and the next second task, where the next second task is the second task after the index task in the second priority buffer queue.

[0196] In the process of implementing step S904, the first timeout task is added to the second priority buffer queue, at the middle position between the index task and the next second task; wherein the next second task is the second task after the index task in the second priority buffer queue, that is, the first task in the second priority buffer queue that cannot be completed within the second time slice.

[0197] For example, the index task is at position n in the second priority buffer queue, and the first timeout task is added to position n+1.

[0198] Another example: In the second priority buffer queue (the second time slice size is 5ms), there are the following tasks A (3ms), B (2ms), C (7ms), and D (6ms) in order. The ms in the brackets after the letters indicates how much service time the task requires. It can be seen that the service time required by A and B is less than the time slice size of 5ms, so both can be completed in the second time slice, but starting from the next task C, it is not possible because the service time required by C is 7ms> the second time slice size of 5ms. Therefore, the last task that can be completed in its time slice is B. If the index position of task B is n, then the index position n+1 is the position where the first timeout task will be inserted. Therefore, the new task will be scheduled between B and C. After that, the tasks in the queue will be arranged like this: A (3ms), B (2ms), the first timeout task, C (7ms), and D (6ms).

[0199] For another example: In the second priority buffer queue, there are the following tasks A(3ms), B(2ms), C(4ms), and D(6ms) in order. Then the last task that can be completed within its time slice is C, because the service time of A, B, and C is less than the time slice size of 5ms. However, the service time of 6ms required by D is greater than the second time slice size of 5ms. Therefore, after insertion, the task arrangement in the queue becomes A(3ms), B(2ms), C(4ms), the first timeout task, and D(6ms).

[0200] It can be understood that by adding the first timeout task to the second priority buffer queue through the index scheduling method, the throughput efficiency of the edge server can be significantly improved.

[0201] Step S206: When all first tasks in the first priority buffer queue are executed, the execution right of the CPU is switched to the second priority buffer queue, and the second task in the second priority buffer queue is executed based on the second time slice.

[0202] In the specific implementation of step S206, when and only when all first tasks in the first priority buffer queue are executed, the CPU execution right will be switched to the second priority buffer queue, and each second task in the second priority buffer queue will be executed based on the second time slice.

[0203] It can be understood that the buffer queues have different priorities, the first priority buffer queue has a higher priority than the second priority buffer queue, and the second priority buffer queue has a higher priority than the third priority buffer queue. Figure 8From the pseudo code of lines 3 to 5 in the program, it can be seen that if a new task is added to the high-priority buffer queue, the CPU's execution right will be preempted, that is, the CPU will switch to executing the task in the higher-priority buffer queue. Therefore, the second task in the second-priority buffer queue will be executed only when all the first tasks in the first-priority buffer queue are completed.

[0204] It should be noted that the CPU preemption mechanism helps ensure that the CPU responds first to high-priority tasks.

[0205] Step S207: Use the task scheduler to update the relevant information of the second timeout task and calculate the latest estimated response time of the second timeout task, and determine the priority buffer queue to which the second timeout task belongs based on the updated relevant information of the second timeout task and the latest estimated response time of the second timeout task.

[0206] The second timeout task is a second task in the second priority buffer queue that has not been completed within the second time slice.

[0207] In the process of implementing step S207, when any second task fails to be completed within the second time slice, it will be marked as a second timeout task. At this time, the task scheduler needs to be used to update the relevant information of the second timeout task and calculate the latest estimated response time of the second timeout task. Then, based on the latest estimated response time of the second timeout task and the updated relevant information of the second timeout task, the priority buffer queue to which the second timeout task belongs is determined.

[0208] Specifically, the specific calculation process of calculating the latest estimated response time of the second timed-out task using the task scheduler is consistent with the specific calculation process of calculating the estimated response time of the task to be added, and will not be repeated here.

[0209] It should be noted that the relevant information of the second timeout task includes but is not limited to the remaining amount of data required to be processed by the second timeout task, the remaining request service time and the current CPU real-time processing capability.

[0210] It can be understood that the priority buffer queue and the specific index position to which the second timeout task belongs are determined based on the latest estimated response time of the second timeout task. The specific process is as follows (process B1-process B3):

[0211] Process B1: Determine whether the latest estimated response time of the second timeout task is later than the deadline of the second timeout task. If it is later, execute process B2; if it is not later, execute process B3.

[0212] Process B2: If the latest estimated response time of the second timeout task is later than the deadline of the second timeout task, the task scheduler adds the second timeout task to the tail of the first priority buffer queue based on the updated relevant information of the second timeout task.

[0213] It is understandable that if the latest estimated response time of the second timeout task is later than the deadline of the second timeout task, the priority of the second timeout task needs to be increased, so the second timeout task is rescheduled to the end of the first priority buffer queue.

[0214] Process B3: If the latest estimated response time of the second timeout task is not later than the deadline of the second timeout task, the task scheduler adds the second timeout task to the tail of the third priority buffer queue based on the updated relevant information of the second timeout task.

[0215] It is understandable that, combined with Figure 8 From the pseudocodes from lines 20 to 21, it can be seen that if the latest estimated response time of the second timeout task is not later than the deadline of the second timeout task, it indicates that there is no need to increase the priority of the second timeout task. Therefore, the second timeout task is added to the end of the third priority buffer queue through the task scheduler.

[0216] It should be noted that, since the third priority buffer queue is the last buffer queue in the buffer zone, in order to ensure the fairness of execution, the tasks that cannot be completed within the second time slice will be rescheduled to the end of the third priority buffer queue. This practice will cause the tasks in the third priority buffer queue to be staggered according to whether they can be completed within the time slice. Therefore, the "index scheduling method" cannot be performed in the third priority buffer queue because the execution order of tasks in this queue has been affected by fairness considerations and cannot be accurately inserted like in the second priority buffer queue. This is also the reason why the second timed-out task from the second priority buffer queue could not perform the "index value insertion method" when it entered the third priority buffer queue.

[0217] Step S208: When all the second tasks in the second priority buffer queue are executed, the execution right of the CPU is switched to the third priority buffer queue, and the third task in the third priority buffer queue is executed based on the third time slice.

[0218] In the specific implementation of step S208, when all second tasks in the second priority buffer queue are executed, the execution right of the CPU will be switched to the third priority buffer queue, and each third task in the third priority buffer queue will be executed based on the third time slice.

[0219] It is understandable that when executing the third task in the third priority buffer queue, CPU preemption detection will also be performed, and the task processing flow in the third priority buffer queue is the same as that of the second priority buffer queue, that is, those tasks that cannot be completed within the third time slice will enter the task scheduler.

[0220] Step S209: Use the task scheduler to update the relevant information of the third timeout task and calculate the latest estimated response time of the third timeout task, and determine the priority buffer queue to which the third timeout task belongs based on the updated relevant information of the third timeout task and the latest estimated response time of the third timeout task.

[0221] The third timeout task is a third task in the third priority buffer queue that has not been completed within the third time slice.

[0222] In the process of implementing step S209, when any third task fails to be completed within the third time slice, it will be marked as a third timeout task. At this time, the task scheduler needs to be used to update the relevant information of the third timeout task and calculate the latest estimated response time of the third timeout task. Then, based on the latest estimated response time of the third timeout task and the updated relevant information of the third timeout task, the priority buffer queue to which the third timeout task belongs is determined.

[0223] It can be understood that the priority buffer queue and the specific index position to which the third timeout task belongs are determined based on the latest estimated response time of the third timeout task. The specific process is as follows (process C1-process C3):

[0224] Process C1: Determine whether the latest estimated response time of the third timeout task is later than the deadline of the third timeout task. If it is later, execute process C2; if it is not later, execute process C3.

[0225] Process C2: If the latest estimated response time of the third timeout task is later than the deadline of the third timeout task, the task scheduler adds the third timeout task to the tail of the first priority buffer queue based on the updated relevant information of the third timeout task.

[0226] It is understandable that if the latest estimated response time of the third timeout task is later than the deadline of the third timeout task, the priority of the third timeout task needs to be increased, so the third timeout task is rescheduled to the end of the first priority buffer queue.

[0227] Process C3: If the latest estimated response time of the third timeout task is not later than the deadline of the third timeout task, the task scheduler adds the third timeout task to the tail of the third priority buffer queue based on the updated relevant information of the third timeout task.

[0228] It can be understood that if the latest estimated response time of the third timeout task is not later than the deadline of the third timeout task, it indicates that there is no need to increase the priority of the third timeout task, so the third timeout task is added to the end of the third priority buffer queue.

[0229] Step S210: When all tasks in the first priority buffer queue, the second priority buffer queue and the third priority buffer queue are executed, the process ends.

[0230] In the specific implementation of step S210, when all first tasks in the first priority buffer queue are executed, all second tasks in the second priority buffer queue are executed, and all third tasks in the third priority buffer queue are executed, the process ends.

[0231] In some specific embodiments, see Figure 8 In the pseudo code shown in lines 22 to 24 of the , each task in the buffer is set with a retimer to record the time from the last time the task was executed to the current time, in order to deal with some extreme situations. For example, in some application scenarios, the arrival of tasks may be dense and uninterrupted, which may cause tasks in the lower priority buffer queue to be unable to obtain processing resources for a long time, thus causing task starvation. This phenomenon will not only reduce the fairness of the system, but may also cause some tasks to fail to complete before their deadlines, thus affecting the overall service quality.

[0232] It should be noted that when the duration recorded by the retimer exceeds the expected response time of the task, the task scheduler is used to reschedule the task to the end of the first priority buffer queue to reduce the waiting time of the task. This effectively prevents task starvation and reduces the probability that a task cannot be completed before its deadline. Specifically, the process of scheduling tasks according to the retimer is as follows: Fig.10 shown.

[0233] Step S1001: For each task in the first priority buffer queue, the second priority buffer queue and the third priority buffer queue, the deadline of the last execution of the task is obtained.

[0234] It should be noted that all first tasks in the first priority buffer queue, all second tasks in the second priority buffer queue, and all third tasks in the third priority buffer queue are referred to herein as task T. i .

[0235] In the specific implementation of step S1001, for each task T in the first priority buffer queue, the second priority buffer queue, and the third priority buffer queue, i, get task T i The deadline of the last execution, that is, the last execution of task T i Deadline.

[0236] Step S1002: Calculate the time difference between the last execution deadline of the task and the current time to obtain the waiting time of the task.

[0237] In the specific implementation of step S1002, the current time is obtained, and the current time and task T are calculated. i The time difference between the last execution deadline and the waiting time T of the task is obtained. i,wait .

[0238] For example, if the last execution of a task ended at time 5 and the current time is 10, then the waiting time of the task is 10-5=5, which is the waiting time of the task since the last execution ended.

[0239] It should be noted that it is determined whether the waiting time of the task is greater than the expected response time of the task. If so, step S1003 is executed; if not, the current process is terminated.

[0240] Step S1003: If the waiting time of the task is greater than the estimated response time of the task, it is determined whether the task is in the first priority buffer queue.

[0241] It should be noted that the expected response time of the task is Tm i .

[0242] In the specific implementation of step S1003, if the waiting time of the task is greater than the expected response time (T i,wait >Tm i ), then the task T i Is it in the first priority buffer queue? i In the first priority buffer queue, step S1004 is executed; if task T i If the data packet is not in the first priority buffer queue, execute step S1005.

[0243] Step S1004: If the task is in the first priority buffer queue, when the task is executed, the deadline of the last execution of the task is refreshed.

[0244] In the specific implementation of step S1004, if task T i In the first priority buffer queue, the waiting task T i In task T i When executed, refresh task T i The deadline of the last execution of task Ti The deadline of the last execution is reset to zero and the timing is restarted.

[0245] Step S1005: If the task is not in the first priority buffer queue, the task is added to the end of the first priority buffer queue, and the last execution deadline of the task is refreshed.

[0246] In the specific implementation of step S1005, if task T i If task T is not in the first priority buffer queue, i Reschedule to the end of the first priority buffer queue to reduce task T i waiting time, and the task T i Refresh based on the deadline of the last execution.

[0247] It should be noted that task T i After being rescheduled to the end of the first priority buffer queue, it does not mean that task T i can be completed within the first time slice of the next allocation, so task T i After being scheduled to the first priority queue and executed, the retimer will restart timing.

[0248] Combination Fig.10 As shown, the present invention takes into account the extreme situation of continuous arrival of tasks in task-intensive scenarios, and utilizes a retimer to avoid the occurrence of task starvation, thereby reducing the probability that a task cannot meet the deadline requirement.

[0249] In an embodiment of the present invention, an adaptive time slice adjustment mechanism (or sliding window mechanism) and a task access scheduling mechanism are described in detail. The adaptive time slice adjustment mechanism detects the change area of ​​the data volume distribution in the first priority buffer queue through a sliding window, and readjusts the size of each time slice in the buffer accordingly, thereby realizing adaptive optimization of the time slice. The present invention comprehensively considers various factors such as the amount of data required to be processed by the remaining tasks, deadline requirements, real-time network conditions and the original location of the tasks, as well as the execution order dependency between tasks, dynamically formulates different scheduling strategies, enhances the task processing capability of the edge server itself under high load conditions, significantly improves the throughput efficiency of the edge server, ensures that key tasks are processed in a timely manner, and improves the average service quality of the tasks. This enables the proposed task access scheduling strategy based on adaptive time slice adjustment to more effectively adapt to complex real-life scenarios.

[0250] Corresponding to the task scheduling method based on adaptive time slice adjustment provided by the above embodiment of the present invention, see Fig.11, showing a structural block diagram of a task scheduling device based on adaptive time slice adjustment provided by an embodiment of the present invention, the scheduling device includes: a first calculation unit 1101, an adding unit 1102, a motion detection unit 1103, a determination and execution unit 1104, a first determination unit 1105, a first execution unit 1106, a second determination unit 1107, a second execution unit 1108, a third determination unit 1109 and an end unit 1110.

[0251] The first calculation unit 1101 is used to calculate the estimated response time of the task to be added in the access request when receiving the access request sent by the initiator, and feed back the estimated response time to the initiator.

[0252] The adding unit 1102 is configured to add the task to be added to the tail of the first priority buffer queue if a confirmation access request sent by the initiator based on the estimated response time is received.

[0253] The mobile detection unit 1103 is used to use the sliding window to move and detect each first task in the first priority buffer queue when the total number of first tasks contained in the first priority buffer queue is greater than the width of the sliding window in the first priority buffer queue, so as to adjust the first time slice of the first priority buffer queue; wherein the width of the sliding window is the number of consecutive tasks detected simultaneously; and the first time slice is the executable time period allocated to each first task in the first priority buffer queue.

[0254] The determining and executing unit 1104 is configured to determine a second time slice of the second priority buffer queue and a third time slice of the third priority buffer queue according to the first time slice, and execute the first task based on the first time slice.

[0255] The first determination unit 1105 is used to use the task scheduler to update the relevant information of the first timeout task and calculate the latest estimated response time of the first timeout task, and determine the priority buffer queue to which the first timeout task belongs based on the updated relevant information of the first timeout task and the latest estimated response time of the first timeout task; wherein the first timeout task is the first task in the first priority buffer queue that has not been executed within the first time slice.

[0256] The first determination unit 1105 is specifically used for: if the latest estimated response time of the first timeout task is later than the deadline of the first timeout task, then adding the first timeout task to the end of the first priority buffer queue based on the updated relevant information of the first timeout task; if the latest estimated response time of the first timeout task is not later than the deadline of the first timeout task, then adding the first timeout task to the second priority buffer queue through the task scheduler based on the index scheduling method and the updated relevant information of the first timeout task.

[0257] The first execution unit 1106 is configured to switch the execution right of the CPU to the second priority buffer queue when all first tasks in the first priority buffer queue are executed, and execute the second task in the second priority buffer queue based on the second time slice.

[0258] The second determination unit 1107 is used to use the task scheduler to update the relevant information of the second timeout task and calculate the latest estimated response time of the second timeout task, and determine the priority buffer queue to which the second timeout task belongs based on the updated relevant information of the second timeout task and the latest estimated response time of the second timeout task; wherein the second timeout task is the second task in the second priority buffer queue that has not been executed within the second time slice.

[0259] The second determination unit 1107 is specifically used for: if the latest estimated response time of the second timeout task is later than the deadline of the second timeout task, then the task scheduler adds the second timeout task to the end of the first priority buffer queue based on the updated relevant information of the second timeout task; if the latest estimated response time of the second timeout task is not later than the deadline of the second timeout task, then the task scheduler adds the second timeout task to the end of the third priority buffer queue based on the updated relevant information of the second timeout task.

[0260] The second execution unit 1108 is configured to switch the execution right of the CPU to the third priority buffer queue when all the second tasks in the second priority buffer queue are executed, and execute the third task in the third priority buffer queue based on the third time slice.

[0261] The third determination unit 1109 is used to use the task scheduler to update the relevant information of the third timeout task and calculate the latest estimated response time of the third timeout task, and determine the priority buffer queue to which the third timeout task belongs based on the updated relevant information of the third timeout task and the latest estimated response time of the third timeout task; wherein the third timeout task is the third task in the third priority buffer queue that has not been executed within the third time slice.

[0262] The third determination unit 1109 is specifically used for: if the latest estimated response time of the third timeout task is later than the deadline of the third timeout task, then the task scheduler adds the third timeout task to the end of the first priority buffer queue based on the updated relevant information of the third timeout task; if the latest estimated response time of the third timeout task is not later than the deadline of the third timeout task, then the task scheduler adds the third timeout task to the end of the third priority buffer queue based on the updated relevant information of the third timeout task.

[0263] The ending unit 1110 is used to end the process when all the tasks in the first priority buffer queue, the second priority buffer queue and the third priority buffer queue are executed.

[0264] In an embodiment of the present invention, an adaptive time slice adjustment mechanism and a task access scheduling mechanism are described in detail. The adaptive time slice adjustment mechanism detects the change area of ​​the data volume distribution in the first priority buffer queue through a sliding window, and readjusts the size of each time slice in the buffer accordingly, thereby realizing adaptive optimization of the time slice. The present invention comprehensively considers various factors such as the amount of data required to be processed by the remaining tasks, deadline requirements, real-time network conditions and the original location of the tasks, as well as the execution order dependency between tasks, dynamically formulates different scheduling strategies, enhances the task processing capability of the edge server itself under high load conditions, significantly improves the throughput efficiency of the edge server, ensures that key tasks are processed in a timely manner, and improves the average service quality of the tasks. This enables the proposed task access scheduling strategy based on adaptive time slice adjustment to more effectively adapt to complex real-life scenarios.

[0265] Combination Fig.11 As shown in the content, the first calculation unit 1101 includes: a first acquisition module, a first calculation module, a first judgment module, a second calculation module, a second judgment module, a third calculation module and a fourth calculation module.

[0266] The first acquisition module is used to acquire the data volume of the task to be added in the access request and the current CPU real-time processing capability.

[0267] The first calculation module is used to calculate the request service time required for the task to be added based on the data volume and the current CPU real-time processing capability.

[0268] The first judgment module is used to judge whether the request service time is less than or equal to the first time slice of the first priority buffer queue.

[0269] The second calculation module is used to calculate the estimated response time of the task to be added based on the request service time, the total number of all first tasks in the first priority buffer queue and the data volume of each first task if the request service time is less than or equal to the first time slice.

[0270] The second judgment module is used to judge whether the requested service time is less than or equal to the sum of the first time slice and the second time slice of the second priority buffer queue if the requested service time is greater than the first time slice.

[0271] The third calculation module is used to calculate the estimated response time of the task to be added based on the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each first task and the total number of all second tasks in the second priority buffer queue, and the data volume of each second task if the request service time is less than or equal to the sum.

[0272] The fourth calculation module is used to calculate the expected response time of the task to be added based on the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each first task, the total number of all second tasks in the second priority buffer queue, the data volume of each second task and the total number of all third tasks in the third priority buffer queue, as well as the data volume of each third task, if the request service time is greater than the sum.

[0273] Combination Fig.11 The content shown, the mobile detection unit 1103, includes: a detection module, a second acquisition module, a fifth calculation module, a sixth calculation module and an adjustment module.

[0274] The detection module is used to detect each first task in the first priority buffer queue by using a sliding window.

[0275] The second acquisition module is used to detect the task information of each first task in the current sliding window for each movement of the sliding window, so as to obtain the number and total data volume of other first tasks arranged after the i-th first task in the current sliding window.

[0276] The fifth calculation module is used to calculate the reduced waiting service time of other first tasks following the i-th first task in the current sliding window after the i-th first task jumps in the sliding window based on the quantity, total data volume and the current first time slice of the first priority buffer queue.

[0277] The sixth calculation module is used to calculate the total waiting service time of other first tasks that can be reduced by all the first tasks that generate jumps in the sliding window based on the reduced waiting service time of other first tasks.

[0278] The adjustment module is used to adjust the first time slice of the first priority buffer queue according to the total waiting service time.

[0279] Combination Fig.11 As shown in the content, the device also includes: a searching unit and a binding unit.

[0280] The searching unit is used to use the sliding window in the first priority buffer queue to search for the first task carrying the dependency information in the first priority buffer queue, and mark it as a dependent task.

[0281] The binding unit is used to search for the first task that has an execution order dependency relationship with the dependent task according to the dependency information, and logically bind the first task with the dependent task.

[0282] Combination Fig.11 As shown in the content, the first determining unit 1105 specifically further includes: a third judging module, a first adding module, a second adding module and a third adding module.

[0283] The third judgment module is used to judge whether the remaining request service time in the relevant information of the first timeout task is greater than the second time slice through the task scheduler if the first estimated response time is not later than the deadline of the first timeout task.

[0284] The first adding module is used to add the first timed-out task to the tail of the second priority buffer queue if it is greater than.

[0285] The second adding module is used for searching the second task in the second priority buffer queue which can be completed within the second time slice if the second task is not greater than the second priority buffer queue, and marking it as the index task.

[0286] The third adding module is used to add the first timeout task to the second priority buffer queue, the middle position between the index task and the next second task, and the next second task is the second task after the index task in the second priority buffer queue.

[0287] Combination Fig.11 As shown in the content, the device also includes: an acquisition unit, a second calculation unit, a judgment unit, a first refresh unit and a second refresh unit.

[0288] The acquisition unit is used to acquire the last execution deadline of each task in the first priority buffer queue, the second priority buffer queue and the third priority buffer queue.

[0289] The second calculation unit is used to calculate the time difference between the last execution deadline of the task and the current time to obtain the waiting time of the task.

[0290] The judging unit is used to judge whether the task is in the first priority buffer queue if the waiting time of the task is greater than the expected response time of the task.

[0291] The first refreshing unit is used to refresh the deadline of the last execution of the task when the task is executed if the task is in the first priority buffer queue.

[0292] The second refreshing unit is used to add the task to the tail of the first priority buffer queue if the task is not in the first priority buffer queue, and to refresh the deadline of the last execution of the task.

[0293] It should be noted that the above Figures 1 to 11 A specific implementation method of a task scheduling method based on adaptive time slice adjustment is described in detail. The task scheduling method based on adaptive time slice adjustment can also adopt an AI-based intelligent scheduling strategy to use artificial intelligence (AI) and machine learning algorithms to predict the execution time and resource requirements of tasks. Based on these prediction results, the scheduling strategy can be dynamically adjusted. This intelligent scheduling strategy can adapt to the ever-changing network and task conditions, thereby achieving more flexible task scheduling and resource management.

[0294] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0295] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0296] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A task scheduling method based on adaptive time slice adjustment, characterized in that: The method comprises: When receiving an access request sent by the initiator, calculating the estimated response time of the task to be added in the access request, and feeding back to the initiator; If a confirmation access request sent by the initiator based on the estimated response time is received, the task to be added is added to the tail of the first priority buffer queue; When the total number of first tasks included in the first priority buffer queue is greater than the width of the sliding window in the first priority buffer queue, each first task in the first priority buffer queue is detected by moving the sliding window to adjust the first time slice of the first priority buffer queue; wherein the width of the sliding window is the number of consecutive tasks detected simultaneously; and the first time slice is the executable time period allocated to each first task in the first priority buffer queue; Determine a second time slice of a second priority buffer queue and a third time slice of a third priority buffer queue according to the first time slice, and execute the first task based on the first time slice; Using a task scheduler to update relevant information of a first timeout task and calculate a latest estimated response time of the first timeout task, and determining a priority buffer queue to which the first timeout task belongs based on the updated relevant information of the first timeout task and the latest estimated response time of the first timeout task; wherein the first timeout task is a first task in the first priority buffer queue that has not been completed within the first time slice; When all first tasks in the first priority buffer queue are executed, the CPU's execution right is switched to the second priority buffer queue, and the second tasks in the second priority buffer queue are executed based on the second time slice; Using a task scheduler to update relevant information of a second timeout task and calculate a latest estimated response time of the second timeout task, and determining a priority buffer queue to which the second timeout task belongs based on the updated relevant information of the second timeout task and the latest estimated response time of the second timeout task; wherein the second timeout task is a second task in the second priority buffer queue that has not been completed within the second time slice; When all second tasks in the second priority buffer queue are executed, the execution right of the CPU is switched to the third priority buffer queue, and the third task in the third priority buffer queue is executed based on the third time slice; Using the task scheduler to update the relevant information of the third timeout task and calculate the latest estimated response time of the third timeout task, and determine the priority buffer queue to which the third timeout task belongs based on the updated relevant information of the third timeout task and the latest estimated response time of the third timeout task; wherein the third timeout task is the third task in the third priority buffer queue that has not been completed within the third time slice; When all the tasks in the first priority buffer queue, the second priority buffer queue and the third priority buffer queue are executed, the process ends.

2. The method according to claim 1, characterized in that The calculating the estimated response time of the task to be added in the access request includes: Obtaining the data volume of the task to be added in the access request and the current CPU real-time processing capability; Calculate the request service time required for the task to be added based on the data volume and the current CPU real-time processing capability; Determining whether the request service time is less than or equal to a first time slice of a first priority buffer queue; If the request service time is less than or equal to the first time slice, then calculating the estimated response time of the task to be added according to the request service time, the total number of all first tasks in the first priority buffer queue and the data volume of each first task; If the requested service time is greater than the first time slice, determining whether the requested service time is less than or equal to the sum of the first time slice and the second time slice of the second priority buffer queue; If the request service time is less than or equal to the sum, then calculating the estimated response time of the task to be added according to the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each of the first tasks, and the total number of all second tasks in the second priority buffer queue, and the data volume of each of the second tasks; If the request service time is greater than the sum, the estimated response time of the task to be added is calculated based on the request service time, the total number of all first tasks in the first priority buffer queue, the data volume of each of the first tasks, the total number of all second tasks in the second priority buffer queue, the data volume of each of the second tasks and the total number of all third tasks in the third priority buffer queue, as well as the data volume of each of the third tasks.

3. The method according to claim 1, characterized in that The step of utilizing the sliding window to move and detect each first task in the first priority buffer queue to adjust the first time slice of the first priority buffer queue includes: Utilizing the sliding window to move and detect each first task in the first priority buffer queue; For each movement of the sliding window, detecting the task information of each first task in the current sliding window to obtain the number and total data volume of other first tasks arranged after the i-th first task in the current sliding window; Calculate, according to the number, the total data volume and the current first time slice of the first priority buffer queue, the reduced waiting service time of other first tasks arranged after the i-th first task in the current sliding window after the i-th first task jumps in the sliding window; Calculate the total waiting service time of other first tasks that can be reduced for all first tasks that generate jumps in the sliding window based on the reduced waiting service time of other first tasks; The first time slice of the first priority buffer queue is adjusted according to the total waiting service time.

4. The method according to claim 1, characterized in that: If a confirmation access request sent by the initiator based on the estimated response time is received, then after adding the task to be added to the tail of the first priority buffer queue, the method further includes: Using the sliding window in the first priority buffer queue, searching for the first task in the first priority buffer queue that carries dependency information, and marking it as a dependent task; A first task having an execution order dependency relationship with the dependent task is searched according to the dependency information, and the first task is logically bound to the dependent task.

5. The method according to claim 1, characterized in that: The determining the priority buffer queue to which the first timed-out task belongs based on the updated relevant information of the first timed-out task and the latest estimated response time of the first timed-out task includes: If the latest estimated response time of the first timed-out task is later than the deadline of the first timed-out task, adding the first timed-out task to the tail of the first priority buffer queue based on the updated relevant information of the first timed-out task; If the latest estimated response time of the first timed-out task is not later than the deadline of the first timed-out task, the first timed-out task is added to the second priority buffer queue by the task scheduler based on the index scheduling method and the updated relevant information of the first timed-out task.

6. The method according to claim 1, characterized in that The determining the priority buffer queue to which the second timeout task belongs based on the updated relevant information of the second timeout task and the latest estimated response time of the second timeout task includes: If the latest estimated response time of the second timeout task is later than the deadline of the second timeout task, adding the second timeout task to the tail of the first priority buffer queue by the task scheduler based on the updated relevant information of the second timeout task; If the latest estimated response time of the second timeout task is not later than the deadline of the second timeout task, the task scheduler adds the second timeout task to the tail of the third priority buffer queue based on the updated relevant information of the second timeout task.

7. The method according to claim 1, characterized in that The determining the priority buffer queue to which the third timeout task belongs based on the updated relevant information of the third timeout task and the latest estimated response time of the third timeout task includes: If the latest estimated response time of the third timeout task is later than the deadline of the third timeout task, adding the third timeout task to the tail of the first priority buffer queue by the task scheduler based on the updated relevant information of the third timeout task; If the latest estimated response time of the third timeout task is not later than the deadline of the third timeout task, the task scheduler adds the third timeout task to the tail of the third priority buffer queue based on the updated relevant information of the third timeout task.

8. The method according to claim 5, characterized in that If the latest estimated response time of the first timeout task is not later than the deadline of the first timeout task, adding the first timeout task to the second priority buffer queue by the task scheduler based on the index scheduling method and the updated relevant information of the first timeout task, comprises: If the latest estimated response time of the first timeout task is not later than the deadline of the first timeout task, determining by the task scheduler whether the remaining request service time in the relevant information of the first timeout task is greater than the second time slice; If it is greater, adding the first timed-out task to the tail of the second priority buffer queue; If not, searching for the last second task in the second priority buffer queue that can be completed within the second time slice and marking it as an index task; The first timeout task is added to the second priority buffer queue, at a middle position between the index task and the next second task, where the next second task is the second task arranged after the index task in the second priority buffer queue.

9. The method according to claim 1, characterized in that: The method further comprises: For each task in the first priority buffer queue, the second priority buffer queue, and the third priority buffer queue, obtaining a deadline of a previous execution of the task; Calculate the time difference between the last execution deadline of the task and the current time to obtain the waiting time of the task; If the waiting time of the task is greater than the expected response time of the task, determining whether the task is in the first priority buffer queue; If the task is in the first priority buffer queue, when the task is executed, the deadline of the last execution of the task is refreshed; If the task is not in the first priority buffer queue, the task is added to the tail of the first priority buffer queue, and the deadline of the last execution of the task is refreshed.

10. A task scheduling device based on adaptive time slice adjustment, characterized in that: The device comprises: A first calculation unit, configured to calculate, when receiving an access request sent by an initiator, an estimated response time of a task to be added in the access request, and feed back the estimated response time to the initiator; an adding unit, configured to add the task to be added to the tail of the first priority buffer queue if a confirmation access request sent by the initiator based on the estimated response time is received; a mobile detection unit, configured to, when the total number of first tasks included in the first priority buffer queue is greater than the width of the sliding window in the first priority buffer queue, use the sliding window to move and detect each first task in the first priority buffer queue to adjust the first time slice of the first priority buffer queue; wherein the width of the sliding window is the number of consecutive tasks detected simultaneously; and the first time slice is an executable time period allocated to each first task in the first priority buffer queue; a determining and executing unit, configured to determine a second time slice of a second priority buffer queue and a third time slice of a third priority buffer queue according to the first time slice, and execute the first task based on the first time slice; A first determining unit is used to update the relevant information of the first timeout task and calculate the latest estimated response time of the first timeout task by using the task scheduler, and determine the priority buffer queue to which the first timeout task belongs based on the updated relevant information of the first timeout task and the latest estimated response time of the first timeout task; wherein the first timeout task is the first task in the first priority buffer queue that has not been completed within the first time slice; A first execution unit, configured to switch the execution right of the CPU to the second priority buffer queue when all first tasks in the first priority buffer queue are executed, and execute the second task in the second priority buffer queue based on the second time slice; A second determining unit is used to update the relevant information of the second timeout task and calculate the latest estimated response time of the second timeout task by using the task scheduler, and determine the priority buffer queue to which the second timeout task belongs based on the updated relevant information of the second timeout task and the latest estimated response time of the second timeout task; wherein the second timeout task is the second task in the second priority buffer queue that has not been completed within the second time slice; A second execution unit, configured to switch the execution right of the CPU to the third priority buffer queue when all the second tasks in the second priority buffer queue are executed, and execute the third task in the third priority buffer queue based on the third time slice; A third determining unit is used to update the relevant information of the third timeout task and calculate the latest estimated response time of the third timeout task by using the task scheduler, and determine the priority buffer queue to which the third timeout task belongs based on the updated relevant information of the third timeout task and the latest estimated response time of the third timeout task; wherein the third timeout task is the third task in the third priority buffer queue that has not been completed within the third time slice; The terminating unit is used to terminate the process when all the tasks in the first priority buffer queue, the second priority buffer queue and the third priority buffer queue are executed.