CN112799793A - Scheduling method and device, electronic equipment and storage medium - Google Patents

Scheduling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112799793A
CN112799793A CN201911108865.9A CN201911108865A CN112799793A CN 112799793 A CN112799793 A CN 112799793A CN 201911108865 A CN201911108865 A CN 201911108865A CN 112799793 A CN112799793 A CN 112799793A
Authority
CN
China
Prior art keywords
image processing
virtual image
processing unit
scheduling period
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911108865.9A
Other languages
Chinese (zh)
Other versions
CN112799793B (en
Inventor
陈逊
吴保东
李鼎基
孙鹏
颜深根
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Sensetime Intelligent Technology Co Ltd
Original Assignee
Shanghai Sensetime Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Sensetime Intelligent Technology Co Ltd filed Critical Shanghai Sensetime Intelligent Technology Co Ltd
Priority to CN201911108865.9A priority Critical patent/CN112799793B/en
Priority to PCT/CN2020/081199 priority patent/WO2021093248A1/en
Priority to KR1020217020219A priority patent/KR20210095687A/en
Priority to SG11202107163PA priority patent/SG11202107163PA/en
Priority to JP2021536726A priority patent/JP2022515255A/en
Priority to TW109115358A priority patent/TW202119207A/en
Publication of CN112799793A publication Critical patent/CN112799793A/en
Application granted granted Critical
Publication of CN112799793B publication Critical patent/CN112799793B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4831Task transfer initiation or dispatching by interrupt, e.g. masked with variable priority
    • G06F9/4837Task transfer initiation or dispatching by interrupt, e.g. masked with variable priority time dependent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources

Abstract

The disclosure relates to a scheduling method and apparatus, an electronic device and a storage medium, wherein the method comprises: acquiring task processing time of a first virtual image processing unit in a current scheduling period; determining whether the first virtual image processing unit is overtime based on the task processing time and the length of a first time slice allocated to the first virtual image processing unit in the current scheduling period; and adjusting the time slice allocated to at least one second virtual image processing unit in a target scheduling period according to the determined result, wherein the target scheduling period comprises the current scheduling period or a next scheduling period of the current scheduling period. The disclosed embodiments may automatically adjust the length of the time slice allocated to the virtual image processing unit.

Description

Scheduling method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a scheduling method and apparatus, an electronic device, and a storage medium.
Background
With the rapid development of artificial intelligence technology, a large number of artificial intelligence enterprises such as bamboo shoots in spring after rain are generally built, and the computing task of a Graphics Processing Unit (GPU) gradually develops from small scale to large scale and high speed network interconnection. In order to meet the different requirements of different tasks on the GPU, academic and industrial industries have begun exploring GPU virtualization technologies. However, how to efficiently schedule the virtual GPU is a technical problem to be solved in the art.
Disclosure of Invention
The present disclosure proposes a scheduling scheme.
According to an aspect of the present disclosure, there is provided a scheduling method, including: acquiring task processing time of a first virtual image processing unit in a current scheduling period; determining whether the first virtual image processing unit is overtime based on the task processing time and a first time slice allocated to the first virtual image processing unit in the current scheduling period; and adjusting the time slice allocated to at least one second virtual image processing unit in a target scheduling period according to the determined result, wherein the target scheduling period comprises the current scheduling period or a next scheduling period of the current scheduling period.
In one or more optional embodiments, the determining whether the first virtual image processing unit times out based on the task processing time and a first time slice allocated for the first virtual image processing unit within the current scheduling period comprises: determining a first time difference value between an ending time of the task processing time and an ending time of the first time slice; determining that the first virtual image processing unit times out if the first time difference value is greater than a first time threshold.
In one or more optional embodiments, the first time threshold is derived based on a length of the first time slice.
In one or more optional embodiments, the adjusting, according to the determination result, the time slice allocated for the at least one second virtual image processing unit in the target scheduling period includes: adjusting the length of the current scheduling period if the first virtual image processing unit is determined to be overtime; and adjusting the time slice allocated to at least one second virtual image processing unit in the current scheduling period based on the adjusted length of the current scheduling period.
In one or more optional embodiments, the adjusting the time slice allocated for the at least one second virtual image processing unit in the current scheduling period based on the adjusted length of the current scheduling period includes: and adjusting the length of the time slice allocated to each second virtual image processing unit in the current scheduling period based on the adjusted length of the current scheduling period and the service quality parameter corresponding to each second virtual image processing unit, so that the service quality parameter of each second virtual image processing unit is kept as a corresponding preset value and/or the proportion of the time slice of each second virtual image processing unit in the current scheduling period is kept as a corresponding preset value.
In one or more optional embodiments, the adjusting the length of the current scheduling period in the case that it is determined that the first virtual image processing unit times out comprises: acquiring the overtime times of at least one third virtual image processing unit which is executed in the current scheduling period; determining an extension coefficient for extending the length of the current scheduling period according to the overtime times; wherein the elongation coefficient is positively correlated with the number of timeouts; and based on the extension coefficient, extending the length of the current scheduling period to obtain the adjusted length of the current scheduling period.
In one or more alternative embodiments, the extension factor is derived based on an exponential function with the number of timeouts as a variable.
In one or more optional embodiments, the method further comprises: acquiring task processing time of a third virtual image processing unit which is executed in the current scheduling period, wherein the at least one second virtual image processing unit comprises the third virtual image processing unit; and in response to the task processing time of the third virtual image processing unit being less than the adjusted time slice length of the third virtual image processing unit, performing time compensation on the third virtual image processing unit within the current scheduling period.
In one or more optional embodiments, the time compensating the third virtual image processing unit for the current scheduling period in response to the task processing time of the third virtual image processing unit being less than the adjusted time slice length of the third virtual image processing unit comprises: determining a compensation time of the third virtual image processing unit based on the task processing time of the third virtual image processing unit and the adjusted time slice length of the third virtual image processing unit; adding the third virtual image processing unit to a scheduling queue of the current scheduling cycle based on the backoff time.
In one or more optional embodiments, adding the third virtual image processing unit to the scheduling queue of the current scheduling cycle based on the backoff time comprises: and adding the third virtual image processing unit to the tail of the scheduling queue of the current scheduling period based on the compensation time.
In one or more optional embodiments, the adjusting, according to the determination result, the time slice allocated for the at least one second virtual image processing unit in the target scheduling period includes: under the condition that each virtual image processing unit in the current scheduling period is determined not to be overtime, adjusting the length of the next scheduling period of the current scheduling period; determining a time slice allocated for at least one second virtual image processing unit within the next scheduling period based on the adjusted length of the next scheduling period.
In one or more optional embodiments, the adjusting the length of the next scheduling period of the current scheduling period includes: and reducing the length of the next scheduling period by using a preset reduction coefficient.
In one or more optional embodiments, the determining, based on the adjusted length of the next scheduling period, a time slice allocated for at least one second virtual image processing unit in the next scheduling period includes: and determining the length of the time slice allocated to each second virtual image processing unit in the next scheduling period based on the adjusted length of the next scheduling period and the service quality parameter corresponding to each second virtual image processing unit, so that the service quality parameter of each second virtual image processing unit is kept as a corresponding preset value and/or the proportion of the time slice of each second virtual image processing unit in the next scheduling period is kept as a corresponding preset value.
In one or more optional embodiments, the method further comprises: acquiring historical task processing time of a plurality of virtual image processing units executing historical tasks within a preset time period; and determining the initial length of the current scheduling period according to the statistical information of the historical task processing time.
According to an aspect of the present disclosure, there is provided a scheduling apparatus, including: the acquisition module is used for acquiring the task processing time of the first virtual image processing unit in the current scheduling period; a determining module, configured to determine whether the first virtual image processing unit is overtime based on the task processing time and a first time slice allocated to the first virtual image processing unit in the current scheduling period; and the adjusting module is used for adjusting the time slice distributed to at least one second virtual image processing unit in a target scheduling period according to the determined result, wherein the target scheduling period comprises the current scheduling period or the next scheduling period of the current scheduling period.
In one or more optional embodiments, the determining module is specifically configured to determine a first time difference value between an end time of the task processing time and an end time of the first time slice; determining that the first virtual image processing unit times out if the first time difference value is greater than a first time threshold.
In one or more optional embodiments, the first time threshold is derived based on a length of the first time slice.
In one or more optional embodiments, the adjusting module is specifically configured to, when it is determined that the first virtual image processing unit is time-out, adjust the length of the current scheduling period; and adjusting the time slice allocated to at least one second virtual image processing unit in the current scheduling period based on the adjusted length of the current scheduling period.
In one or more optional embodiments, the adjusting module is specifically configured to adjust, based on the adjusted length of the current scheduling period and the qos parameter corresponding to each of the second virtual image processing units, the length of the time slice allocated to each of the second virtual image processing units in the current scheduling period, so that the qos parameter of each of the second virtual image processing units is kept at a corresponding preset value and/or a ratio of the time slice of each of the second virtual image processing units in the current scheduling period is kept at a corresponding preset value.
In one or more optional embodiments, the adjusting module is specifically configured to obtain the number of times of timeout of the at least one third virtual image processing unit that has been executed in the current scheduling period; determining an extension coefficient for extending the length of the current scheduling period according to the overtime times; wherein the elongation coefficient is positively correlated with the number of timeouts; and based on the extension coefficient, extending the length of the current scheduling period to obtain the adjusted length of the current scheduling period.
In one or more alternative embodiments, the extension factor is derived based on an exponential function with the number of timeouts as a variable.
In one or more optional embodiments, the adjusting module is further configured to obtain a task processing time of a third virtual image processing unit that has been executed in the current scheduling period, where the at least one second virtual image processing unit includes the third virtual image processing unit; and in response to the task processing time of the third virtual image processing unit being less than the adjusted time slice length of the third virtual image processing unit, performing time compensation on the third virtual image processing unit within the current scheduling period.
In one or more optional embodiments, the adjusting module is specifically configured to determine a compensation time of the third virtual image processing unit based on a task processing time of the third virtual image processing unit and an adjusted time slice length of the third virtual image processing unit; adding the third virtual image processing unit to a scheduling queue of the current scheduling cycle based on the backoff time.
In one or more optional embodiments, the adjusting module is specifically configured to add the third virtual image processing unit to the tail of the scheduling queue of the current scheduling period based on the compensation time.
In one or more optional embodiments, the adjusting module is specifically configured to, when it is determined that each virtual image processing unit in the current scheduling period is not overtime, adjust a length of a next scheduling period of the current scheduling period; determining a time slice allocated for at least one second virtual image processing unit within the next scheduling period based on the adjusted length of the next scheduling period.
In one or more optional embodiments, the adjusting module is specifically configured to reduce the length of the next scheduling period by using a preset reduction coefficient.
In one or more optional embodiments, the adjusting module is specifically configured to determine, based on the adjusted length of the next scheduling period and the qos parameter corresponding to each second virtual image processing unit, a length of a time slice allocated to each second virtual image processing unit in the next scheduling period, so that the qos parameter of each second virtual image processing unit is kept at a corresponding preset value and/or a ratio of the time slice of each second virtual image processing unit in the next scheduling period is kept at a corresponding preset value.
In one or more optional embodiments, the apparatus further comprises: the initial period determining module is used for acquiring historical task processing time of a plurality of virtual image processing units executing historical tasks within a preset time period; and determining the initial length of the current scheduling period according to the statistical information of the historical task processing time.
According to another aspect of the present disclosure, there is provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: the above scheduling method is performed.
According to another aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the scheduling method described above.
In the embodiment of the present disclosure, the task processing time of the first virtual image processing unit in the current scheduling period may be obtained, then, based on the task processing time and the first time slice allocated to the first virtual image processing unit in the current scheduling period, whether the first virtual image processing unit is overtime is determined, and then, according to a result of the determination, the time slice allocated to the at least one second virtual image processing unit in the target scheduling period is adjusted, where the target scheduling period includes the current scheduling period or a next scheduling period of the current scheduling period. Therefore, the time slices allocated to the second virtual image processing units in the target scheduling period can be automatically adjusted, so that the time slices allocated to each second virtual image processing unit in the target scheduling period meet the requirement of service quality, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flow chart of a scheduling method according to an embodiment of the present disclosure.
FIG. 2 illustrates a flow diagram of an example of extending a time slice of a virtual image unit according to an embodiment of the disclosure.
Fig. 3 shows a flowchart of an example of reducing the time slices allocated by a virtual scheduling unit according to an embodiment of the present disclosure.
FIG. 4 illustrates a graph of historical task processing time versus cumulative frequency according to an embodiment of the disclosure.
Fig. 5 shows a block diagram of a scheduling apparatus according to an embodiment of the present disclosure.
Fig. 6 shows a block diagram of an example of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
According to the scheduling scheme provided by the embodiment of the disclosure, the task processing time of the first virtual image processing unit in the current scheduling period can be acquired, and then whether the first virtual image processing unit is overtime is determined based on the task processing time of the first virtual image processing unit and the first time slice allocated to the first virtual image processing unit in the current scheduling period, so that the time slice allocated to at least one second virtual image processing unit in the target scheduling period can be adjusted according to the determined result. Therefore, under the condition that the first time slice allocated to the first virtual image processing unit is too long or too short, the time slice allocated to the second virtual image processing unit is automatically adjusted, so that the time slice of the second virtual image processing unit in the target scheduling period is reasonably configured, the GPU has higher performance and can be flexibly set, the resources of the GPU are effectively utilized, and the user experience is improved.
Here, the GPU may be virtually divided into smaller granularity units, and each Unit may be referred to as a virtual Graphics Processing Unit (vGPU). The virtual image processing unit may time-division multiplex the GPU to process tasks, each task may include a plurality of task units. When a virtual image processing unit executes a task unit, the task unit being executed cannot be suspended, and therefore, when the task processing time for a certain virtual image processing unit to execute the task unit is long, the task processing time of the virtual image processing unit exceeds the time slice allocated to the virtual image processing unit, thereby destroying the original service quality. The service quality can be an index for evaluating the service providing capability, and the scheduling scheme provided by the embodiment of the disclosure can enable the task processing time of the virtual image processing unit to be matched with the time slice allocated to the virtual image processing unit, so as to meet the requirement of the corresponding service quality. A task unit is understood herein to be a basic unit of task processing, which is not normally divisible and suspended from execution, e.g., a task unit may correspond to a kernel function.
The technical solution provided by the embodiment of the present disclosure may be applied to task processing of a GPU, scheduling of a virtual image processing unit, adaptive expansion of a time slice, and the like, and the embodiment of the present disclosure does not limit this.
Fig. 1 shows a flow chart of a scheduling method according to an embodiment of the present disclosure. The scheduling method may be performed by a terminal device, a server, or other types of electronic devices, where the terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like. In some possible implementations, the scheduling method may be implemented by a processor calling computer readable instructions stored in a memory. The scheduling method according to the embodiment of the present disclosure is described below by taking an electronic device as an execution subject.
S11, acquiring the task processing time of the first virtual image processing unit in the current scheduling period.
In the embodiment of the present disclosure, the electronic device may detect a task processing time of each virtual image processing unit within the current scheduling period, and the first virtual image processing unit may be a virtual image processing unit that processes a task at present. The current scheduling period may be a task scheduling period of the currently executed task, and a duration of executing all task units in the current task queue may be taken as one task scheduling period. Here, each of the virtual image processing units may process a task unit in the task queue by the time division multiplexing GPU, each of the virtual image processing units may process one task unit in the task queue, and accordingly, the virtual image processing units may form a scheduling queue, and the task units are processed by calling the virtual image processing units in the scheduling queue. The task unit herein may be a task unit of an image processing task, and the task processing time may be a time required for one or more processing task units per virtual image processing unit.
S12, determining whether the first virtual image processing unit is overtime based on the task processing time and the first time slice allocated to the first virtual image processing unit in the current scheduling period.
In the embodiment of the present disclosure, the task processing time of the first virtual image processing unit may be compared with the first time slice allocated to the first virtual image processing unit to obtain a comparison result, and whether the first virtual image unit is overtime is determined according to the comparison result. Here, the first time slice may be a time allocated for the first virtual image processing unit to time-division multiplex the CPU. The length of the time slice allocated to each virtual image processing unit may be the same or different.
For example, the length of the task processing time of the first virtual image processing unit may be compared with the length of the first time slice, it may be determined whether the length of the task processing time of the first virtual image processing unit is greater than the length of the first time slice, and if the length of the task processing time of the first virtual image processing unit is greater than the length of the first time slice, it may be determined that the first virtual image processing unit is overtime. If the length of the task processing time of the first virtual image processing unit is less than or equal to the length of the first time slice, it may be determined that the first virtual image processing unit has not timed out.
For another example, the expiration time of the task processing time of the first virtual image processing unit may be compared with the expiration time of the first time slice, and if the expiration time of the task processing time of the first virtual image processing unit is greater than the expiration time of the first time slice, it may be determined that the first virtual image processing unit is timed out. It may be determined that the first virtual image processing unit has not timed out if the cutoff time of the task processing time of the first virtual image processing unit is less than or equal to the cutoff time of the first time slice.
In one possible implementation, a first time difference value between an expiration time of a task processing time of the first virtual image processing unit and an expiration time of the first time slice may be determined, and then the first virtual image processing unit may be determined to timeout if the first time difference value is greater than a first time threshold.
In this implementation, a first time difference between an ending time of the task processing time of the first virtual image processing unit and an ending time of the first time slice may be calculated, and then the calculated first time difference may be compared with a preset first time threshold, and if the first time difference is greater than the first time threshold, it may be determined that the first virtual image processing unit is overtime. If the first time difference value is less than or equal to the first time threshold value, it may be determined that the first virtual image processing unit has not timed out.
Here, the first time threshold may be preset, and for example, the first time threshold may be set to a time length of 0.2s, 0.5s, or the like. By the first time threshold, the change of the first time difference value between the task processing time of the first virtual image processing unit and the first time slice can be allowed to be in a reasonable range, so that the process of adjusting the time slice allocated to the second virtual image processing unit can be converged, and the time slice allocated to the second virtual image processing unit is not repeatedly adjusted without limitation.
In one example of this implementation, the first time threshold is obtained based on the length of the first time slice, for example, the first time threshold may be set to 1% of the length of the first time slice, so that the first time threshold may be set within a reasonable range by setting the first time threshold according to the length of the first time slice. In some implementations, the first time threshold may also be derived based on the length of the current scheduling period, e.g., the first time threshold is set to 1% of the length of the current scheduling period.
S13, adjusting the time slice allocated to at least one second virtual image processing unit within a target scheduling period according to the determined result, wherein the target scheduling period includes the current scheduling period or a next scheduling period of the current scheduling period.
In the disclosed embodiment, the time slice allocated to the at least one second virtual image processing unit may be adjusted according to a result of determining whether the first virtual image processing unit times out. The second virtual image processing unit may be a virtual image processing unit in a current scheduling period, or may be a virtual image processing unit in a next scheduling period of the current scheduling period.
For example, if the first virtual image processing unit times out, the length of the time slice allocated to the second virtual image processing unit may be extended, resulting in the extended time slice allocated to the second virtual image processing unit. If the first virtual image processing unit does not time out, the time slice allocated to the second virtual image processing unit may be shortened, resulting in a shortened time slice allocated to the second virtual image processing unit. In this way, the time slice allocated for the second virtual image processing unit can be adjusted to a reasonable range.
By the scheduling scheme, the time slices allocated to the second virtual image processing unit can be automatically adjusted, so that the time slices allocated to the second virtual image processing unit in each scheduling period meet the requirement of service quality.
In one possible implementation, the length of the current scheduling period may be adjusted if it is determined that the first virtual image processing unit is time-out, and then the time slice allocated for the at least one second virtual image processing unit in the current scheduling period may be adjusted based on the adjusted length of the current scheduling period.
In this implementation, if it is determined that the first virtual image processing unit is time-out, the length of the current scheduling period may be adjusted first, for example, the length of the current scheduling period is extended by a fixed duration, or the length of the current scheduling period is extended by a multiple of the original length. Then, the time slices allocated to at least one second virtual image processing unit in the current scheduling period may be adjusted according to the adjusted length of the current scheduling period, for example, the time slices allocated to each second virtual image processing unit are extended by a fixed time length, or the time slices allocated to each second virtual image processing unit may be extended by a certain ratio. In this way, the length of the current scheduling period can be adjusted under the condition that the first virtual image processing unit is determined to be overtime, and the time slice of the second virtual image processing unit can be adjusted through the adjusted length of the current scheduling period.
In an example, the length of the time slice allocated to each of the second virtual image processing units in the current scheduling period may be adjusted based on the adjusted length of the current scheduling period and the qos parameter corresponding to each of the second virtual image processing units, so that the qos parameter of each of the second virtual image processing units is maintained at a corresponding preset value and/or the proportion of the time slice of each of the second virtual image processing units in the current scheduling period is maintained at a corresponding preset value.
In this example, the quality of service parameter may be a parameter characterizing quality of service, and the quality of service parameter may be a fraction of a time slice corresponding to any one virtual image processing unit in a scheduling period in the scheduling period. A plurality of virtual image processing units may be included in one scheduling period, and each virtual image processing unit may correspond to one quality of service parameter. After the length of the current scheduling period is adjusted, the length of the time slice allocated to each second virtual image processing unit can be determined according to the service quality parameter corresponding to each second virtual image processing unit in the current scheduling period and the adjusted length of the current scheduling period, and then the time slice allocated to each second virtual image processing unit is adjusted, so that the service quality parameter of each second virtual image processing unit is kept unchanged, and/or the proportion of the time slice of each second virtual image processing unit in the current scheduling period is kept unchanged, and therefore the requirement of service quality is met.
In an example, the timeout times of the at least one third virtual image processing unit that has been executed in the current scheduling period may be obtained, an extension coefficient for extending the length of the current scheduling period is determined according to the timeout times, and the length of the current scheduling period is extended based on the extension coefficient to obtain the adjusted length of the current scheduling period. Here, the elongation coefficient is positively correlated with the number of timeouts.
In this example, the number of times of timeout of the at least one third virtual image processing unit that has been executed within the current scheduling period may be counted. Every time a third virtual image processing unit is executed, if the third virtual image processing unit times out, the number of times out may be increased by 1. An extension coefficient for extending the length of the current scheduling period may be determined according to the timeout number, and the extension coefficient is in positive correlation with the timeout number, for example, the greater the timeout number, the greater the extension coefficient. Then, the determined extension coefficient may be used to extend the length of the current scheduling period, for example, the extended length of the current scheduling period may be obtained by multiplying the extension coefficient by the length of the current scheduling period. Here, the elongation coefficient may be greater than 1. Therefore, the length of the current scheduling period can be reasonably prolonged through the overtime times, so that the current scheduling period has a reasonable time length.
In one example, the extension coefficient is obtained based on an exponential function with the number of timeouts as a variable.
In this example, the extension coefficient may be obtained based on an exponential function with the number of times of timeout as a variable, so that the extended length of the current scheduling period may be obtained by extending the length of the current scheduling period by a multiple of the extension coefficient. Here, the length of the extended current scheduling period may be calculated according to the following formula (1):
Tnewtimeslice=Toldtimeslice*2countformula (1);
wherein, TnewtimesliceMay be the length, T, of the extended current scheduling periodoldtimesliceMay be the length of the current scheduling period not extended, and the count may be the number of statistical time-outs, 2countMay be an elongation factor.
Here, the extension coefficient adopts a 2-system exponential function, so that the condition that the length after the early scheduling period is extended is increased too fast can be avoided, and the condition that the length after the current scheduling period is extended is not converged due to too slow later-stage increase can also be avoided.
In a possible implementation manner, the task processing time of the third virtual image processing unit that has been executed in the current scheduling period may be acquired, and then, in response to that the task processing time of the third virtual image processing unit is smaller than the adjusted time slice length of the third virtual image processing unit, time compensation may be performed on the third virtual image processing unit in the current scheduling period. Wherein the at least one second virtual image processing unit comprises the third virtual image processing unit.
In this implementation, after the time slice of the at least one second virtual image processing unit in the current scheduling period is adjusted, if the task processing time of any one third virtual image processing unit included in the at least one second virtual image processing unit is less than the adjusted time slice length of the third virtual image processing unit, the third virtual image processing unit may be compensated in the current scheduling period. The third virtual image processing unit is a virtual image processing unit which is executed in the second virtual image processing unit.
Here, since the time slice of the executed third image processing unit cannot be extended, the qos parameter corresponding to each second image processing unit in the current scheduling period can be kept unchanged by performing time compensation on the third image processing unit. The time compensation for the third image processing unit may be understood as allocating a corresponding processing time to the third image processing unit.
In one example of this implementation, a compensation time of the third virtual image processing unit may be determined based on a task processing time of the third virtual image processing unit and an adjusted slice length of the third virtual image processing unit, and then the third virtual image processing unit may be added to the scheduling queue of the current scheduling cycle based on the compensation time.
In this example a way of time compensating the third virtual image processing unit is provided. In this example, the compensation time of the third virtual image processing unit may be determined according to the task processing time of the third virtual image processing unit and the adjusted time slice length of the third virtual image processing unit, and for example, a second time difference value between the adjusted time slice length of the third virtual image processing unit and the task processing time of the third virtual image processing unit may be calculated as the compensation time of the third virtual image processing unit. The third virtual image processing unit may then be added to the scheduling queue of the current scheduling cycle and assigned the calculated backoff time. Therefore, the time compensation of the executed third image processing unit can be realized, and the service quality parameter corresponding to the executed third image processing unit is kept unchanged.
In one example, a third virtual image processing unit may be added to the end of the scheduling queue for the current scheduling cycle based on the backoff time.
In this example, the time compensation for the third virtual image processing unit may be implemented by adding the third virtual image processing unit to the tail of the scheduling queue of the current scheduling cycle according to the compensation time of the third virtual image processing unit, allocating the determined compensation time to the third virtual image processing unit, and performing the time compensation for the third virtual image processing unit. And adding the third virtual image processing unit to the tail of the scheduling queue of the current scheduling period, so that the sequence of the virtual image processing units in the scheduling queue of the current scheduling period can be not disturbed, and the virtual image processing units in the scheduling queue can be scheduled according to the original sequence.
In one example, the compensation time of the third virtual image processing unit may be determined according to the service quality parameter of the executed third virtual image processing unit and the length before and after the adjustment of the current scheduling period.
In this example, a third time difference between the adjusted length of the current scheduling period and the length before the adjustment may be determined. Then, the compensation time of the third virtual image processing unit can be determined according to the third time difference and the service quality parameter corresponding to the third virtual image processing unit. For example, the compensation time of the third virtual image processing unit can be obtained by multiplying the third time difference by the service quality parameter corresponding to the executed third virtual image processing unit, and the time compensation of the third virtual image processing unit is further realized. Here, the compensation time may be calculated according to the following formula (2):
tcompensation=(Tnewtimeslice-Toldtimeslice)*SharevGPUformula (2);
wherein, tcompensationCan represent the compensation time, TnewtimesliceMay be the adjusted length of the current scheduling period, ToldtimesliceMay be the length of the current scheduling period before adjustment, SharevGPUMay be a quality of service parameter corresponding to the third virtual image processing unit. The compensation time of each third virtual image processing unit can be obtained by equation (2).
FIG. 2 shows a flowchart of an example of extending a time slice of a virtual image unit according to an embodiment of the present disclosure, which may include the steps of:
s201, judging whether the currently executed virtual image processing unit is overtime;
wherein, in case that the current virtual image processing unit times out, S202 to S205/S206 may be executed. Alternatively, S205/S206 may be executed in a case where the current virtual image processing unit does not time out.
S202, according to the overtime times of the executed virtual image processing unit in the current scheduling period, the length of the current scheduling period is prolonged;
optionally, the length of the current scheduling period may be adjusted according to the current accumulated timeout times of the current scheduling period, that is, the timeout times of the executed virtual image processing units in the current scheduling period.
S203, adjusting the time slice distributed to each virtual image processing unit in the current scheduling period according to the extended length of the current scheduling period;
s204, inserting the executed virtual image processing unit in the current scheduling period into the tail of the scheduling queue, and distributing corresponding compensation time to the executed virtual image processing unit;
by extending the time slices of the virtual image units, the time slices allocated to each virtual image processing unit in the current scheduling period can be extended under the condition that the currently executed virtual image processing unit is overtime, so that the extended time slices are adaptive to the corresponding service quality.
S205, judging whether the current scheduling cycle is finished, scheduling the next virtual image processing unit to execute the task under the condition that the current scheduling cycle is not finished, updating the currently executed image processing unit and returning to the step S201;
s206, terminating the current flow when the current scheduling period is over.
In one possible implementation manner, the length of the next scheduling period of the current scheduling period may be adjusted when it is determined that each virtual image processing unit in the current scheduling period has not timed out, and then the time slice allocated to at least one second virtual image processing unit in the next scheduling period is determined based on the adjusted length of the next scheduling period.
In this example, the length of the next scheduling period of the current scheduling period may be reduced to obtain the shortened length of the next scheduling period, in a case where each virtual image processing unit does not time out within the current scheduling period. For example, a certain duration may be reduced based on the length of the next scheduling period, or the length of the next scheduling period may be multiplied by a certain coefficient to obtain the shortened length of the next scheduling period. The length of the time slice allocated to each second virtual image processing unit in the next scheduling period may then be determined according to the adjusted length of the next scheduling period, for example, the length of the time slice allocated to each second virtual image processing unit in the next scheduling period may be reduced such that the sum of the reduced lengths of the time slices is equal to the adjusted length of the next scheduling period. According to the length of the time slice after each second virtual image processing unit is reduced, the time slice allocated to each second virtual image processing unit can be further determined, so that when the time slice allocated to the virtual image processing unit in the current scheduling period is too long, the reduction of the time slice of the second virtual image processing unit in the next scheduling period can be automatically realized, and the virtual image processing unit resources can be effectively utilized.
In one example, the length of the next scheduling period may be reduced by a preset reduction factor.
In this example, the reduction coefficient may be set according to an actual application scenario, and may be set to a real number smaller than 1, for example, the reduction coefficient is set to 1/2. When the length of the next scheduling period is reduced by the reduction coefficient, the length of the next scheduling period may be multiplied by the reduction coefficient, and the reduced length of the next scheduling period may be used. By reducing the length of the next scheduling period by using a proper reduction coefficient, the situation that the length of the next scheduling period is too small after the reduction of the next scheduling period due to too aggressive reduction can be avoided.
In an example, the length of the time slice allocated to each second virtual image processing unit in the next scheduling period may be determined based on the adjusted length of the next scheduling period and the qos parameter corresponding to each second virtual image processing unit, so that the qos parameter of each second virtual image processing unit is maintained at a corresponding preset value and/or the proportion of the time slice of each second virtual image processing unit in the next scheduling period is maintained at a corresponding preset value.
In this example, after adjusting the length of the next scheduling period, the length of the time slice allocated to each second virtual image processing unit can be determined according to the quality of service parameter corresponding to each second virtual image processing unit in the next scheduling period and the adjusted length of the next scheduling period, for example, the service quality parameter corresponding to each second virtual image processing unit is multiplied by the adjusted length of the next scheduling period to obtain the length of the time slice allocated by the second virtual image processing unit, and further determines the time slice allocated to each of the second virtual image processing units, so that the quality of service parameter of each of the second virtual image processing units can be kept constant, and/or the proportion of the time slice of each second virtual image processing unit in the current scheduling period is kept unchanged, so that the requirement of service quality is met.
Fig. 3 shows a flowchart of an example of reducing the time slice allocated by a virtual scheduling unit according to an embodiment of the present disclosure, which may include the following steps:
s301, judging whether each virtual image processing unit is overtime in the current scheduling period;
s302, under the condition that each virtual image processing unit is not overtime in the current scheduling period, reducing the length of the next scheduling period by using a reduction coefficient to obtain the reduced length of the next scheduling period;
s303, according to the length of the reduced next scheduling period, reducing the time slice distributed to each virtual image processing unit of the next scheduling period;
s304, executing the scheduling of the virtual image processing unit of the next scheduling period.
By reducing the time slices of the virtual image processing units, the time slices allocated to each virtual image processing unit in the next scheduling period can be automatically reduced under the condition that the virtual image processing units in the current scheduling period are not overtime, so that the reduced time slices are adaptive to the corresponding service quality.
In one possible implementation manner, historical task processing time for a plurality of virtual image processing units to execute historical tasks within a preset time period may be acquired, and then the initial length of the current scheduling cycle may be determined according to statistical information of the historical task processing time.
In this implementation, the initial length of the current scheduling period may be determined by the historical task processing time within a preset time period. The preset time period may be set according to an actual application scenario, and for example, a historical task processing time for a plurality of virtual image processing units to execute a historical task within the last 24 hours may be acquired. The statistical information of the historical task processing time may include information of the historical tasks, an accumulation frequency of the historical tasks, and the like, and then the initial length of the current scheduling period may be determined according to the statistical information of the historical task processing time. For example, a curve between a historical task processing time and an accumulated frequency of historical tasks may be determined based on historical task times executed by a plurality of virtual image processing units, and then an appropriate historical task processing time may be selected as an initial length of a current scheduling period based on the curve.
Fig. 4 illustrates a graph of historical task processing time versus cumulative frequency with the abscissa corresponding to historical task processing time and the middle coordinate corresponding to cumulative frequency according to an embodiment of the disclosure. The accumulated frequency corresponding to any historical task processing time can be understood as the proportion of the historical tasks processed within the historical task processing time to all the historical tasks. For example, the historical task processing time corresponding to the cumulative frequency of 70% may be determined as the initial length of the current scheduling period. Alternatively, the historical task processing time with the cumulative frequency of 70% may be multiplied by a multiple, for example, the historical task processing time with the cumulative frequency of 70% may be multiplied by 10, and the initial length of the current scheduling period may be obtained.
In one example of this implementation, the duration of the initial time slice allocated to each virtual image processing unit may be determined according to the initial length of the current scheduling period and the corresponding quality of service parameter of each virtual image processing unit in the current scheduling period.
In this example, the initial duration allocated to each virtual image processing unit can be calculated according to the quality of service parameter corresponding to each virtual image processing unit in the current scheduling period and the initial length of the current scheduling period, for example, the current scheduling cycle includes 3 virtual image processing units, a virtual image processing unit a, a virtual image processing unit B, and a virtual image processing unit C, wherein the time slice share corresponding to the virtual image processing unit A is 3, the time slice share corresponding to the virtual image processing unit B is 3, the time slice share corresponding to the virtual image processing unit C is 4, the initial time slice of the virtual image processing unit a may be 0.3 initial time durations, the initial time slice of the virtual image processing unit B may be 0.3 initial time durations, and the initial time slice of the virtual image processing unit C may be 0.4 initial time durations. Therefore, the initial time slice of each virtual image processing unit in one scheduling period can be distributed according to the corresponding service quality parameters, and the service quality requirement is met.
In one possible implementation manner, the initial length of the current scheduling period may also be set according to an actual application scenario, for example, the initial length is set to 100 ms. Then, the initial length of the current scheduling period and the corresponding service quality parameter of each virtual image processing unit in the current scheduling period can determine the initial time slice allocated to each virtual image processing unit in the current scheduling period.
The scheduling scheme provided by the embodiment of the disclosure can automatically adjust the time slices allocated to the virtual image processing unit under the condition that the length of the time slices allocated to the virtual image processing unit is too long or too short, thereby achieving the effect of reasonably configuring the time slices of the virtual image processing unit.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted.
In addition, the present disclosure also provides an apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any scheduling method provided by the present disclosure, and the corresponding technical solutions and descriptions and corresponding descriptions of the method portions are not repeated.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Fig. 5 shows a block diagram of a scheduling apparatus according to an embodiment of the present disclosure, as shown in fig. 5, the apparatus includes:
an obtaining module 51, configured to obtain a task processing time of a first virtual image processing unit in a current scheduling period;
a determining module 52, configured to determine whether the first virtual image processing unit is time-out based on the task processing time and a first time slice allocated to the first virtual image processing unit in the current scheduling period;
an adjusting module 53, configured to adjust, according to a determination result, a time slice allocated to at least one second virtual image processing unit in a target scheduling period, where the target scheduling period includes the current scheduling period or a next scheduling period of the current scheduling period.
In one or more optional embodiments, the determining module 52 is specifically configured to determine a first time difference value between an end time of the task processing time and an end time of the first time slice; determining that the first virtual image processing unit times out if the first time difference value is greater than a first time threshold.
In one or more optional embodiments, the first time threshold is derived based on a length of the first time slice.
In one or more optional embodiments, the adjusting module 53 is specifically configured to, in a case that it is determined that the first virtual image processing unit is time-out, adjust the length of the current scheduling period; and adjusting the time slice allocated to at least one second virtual image processing unit in the current scheduling period based on the adjusted length of the current scheduling period.
In one or more optional embodiments, the adjusting module 53 is specifically configured to adjust, based on the adjusted length of the current scheduling period and the qos parameter corresponding to each second virtual image processing unit, the length of the time slice allocated to each second virtual image processing unit in the current scheduling period, so that the qos parameter of each second virtual image processing unit is kept at a corresponding preset value and/or a ratio of the time slice of each second virtual image processing unit in the current scheduling period is kept at a corresponding preset value.
In one or more optional embodiments, the adjusting module 53 is specifically configured to obtain the timeout times of the at least one third virtual image processing unit that has been executed in the current scheduling period; determining an extension coefficient for extending the length of the current scheduling period according to the overtime times; wherein the elongation coefficient is positively correlated with the number of timeouts; and based on the extension coefficient, extending the length of the current scheduling period to obtain the adjusted length of the current scheduling period.
In one or more alternative embodiments, the extension factor is derived based on an exponential function with the number of timeouts as a variable.
In one or more optional embodiments, the adjusting module 53 is further configured to,
acquiring task processing time of a third virtual image processing unit which is executed in the current scheduling period, wherein the at least one second virtual image processing unit comprises the third virtual image processing unit;
and in response to the task processing time of the third virtual image processing unit being less than the adjusted time slice length of the third virtual image processing unit, performing time compensation on the third virtual image processing unit within the current scheduling period.
In one or more optional embodiments, the adjusting module 53 is specifically configured to determine a compensation time of the third virtual image processing unit based on the task processing time of the third virtual image processing unit and the adjusted time slice length of the third virtual image processing unit; adding the third virtual image processing unit to a scheduling queue of the current scheduling cycle based on the backoff time.
In one or more optional embodiments, the adjusting module 53 is specifically configured to add the third virtual image processing unit to the tail of the scheduling queue of the current scheduling period based on the compensation time.
In one or more optional embodiments, the adjusting module 53 is specifically configured to, when it is determined that each virtual image processing unit in the current scheduling period has not timed out, adjust a length of a next scheduling period of the current scheduling period; determining a time slice allocated for at least one second virtual image processing unit within the next scheduling period based on the adjusted length of the next scheduling period.
In one or more optional embodiments, the adjusting module 53 is specifically configured to reduce the length of the next scheduling period by using a preset reduction coefficient.
In one or more optional embodiments, the adjusting module 53 is specifically configured to determine, based on the adjusted length of the next scheduling period and the qos parameter corresponding to each second virtual image processing unit, a length of a time slice allocated to each second virtual image processing unit in the next scheduling period, so that the qos parameter of each second virtual image processing unit is kept at a corresponding preset value and/or a ratio of the time slice of each second virtual image processing unit in the next scheduling period is kept at a corresponding preset value.
In one or more optional embodiments, the apparatus further comprises:
the initial period determining module is used for acquiring historical task processing time of a plurality of virtual image processing units executing historical tasks within a preset time period; and determining the initial length of the current scheduling period according to the statistical information of the historical task processing time.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured as the above method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 6 is a block diagram illustrating an electronic device 1900 according to an example embodiment. For example, the electronic device 1900 may be provided as a server. Referring to fig. 6, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. A method of scheduling, comprising:
acquiring task processing time of a first virtual image processing unit in a current scheduling period;
determining whether the first virtual image processing unit is overtime based on the task processing time and a first time slice allocated to the first virtual image processing unit in the current scheduling period;
and adjusting the time slice allocated to at least one second virtual image processing unit in a target scheduling period according to the determined result, wherein the target scheduling period comprises the current scheduling period or a next scheduling period of the current scheduling period.
2. The method of claim 1, wherein determining whether the first virtual image processing unit has timed out based on the task processing time and a first time slice allocated for the first virtual image processing unit within the current scheduling period comprises:
determining a first time difference value between an ending time of the task processing time and an ending time of the first time slice;
determining that the first virtual image processing unit times out if the first time difference value is greater than a first time threshold.
3. The method of claim 2, wherein the first time threshold is derived based on a length of the first time slice.
4. The method according to any of claims 1 to 3, wherein the adjusting the time slice allocated for the at least one second virtual image processing unit within the target scheduling period according to the determination result comprises:
adjusting the length of the current scheduling period if the first virtual image processing unit is determined to be overtime;
and adjusting the time slice allocated to at least one second virtual image processing unit in the current scheduling period based on the adjusted length of the current scheduling period.
5. The method of claim 4, wherein adjusting the time slice allocated for the at least one second virtual image processing unit within the current scheduling period based on the adjusted length of the current scheduling period comprises:
and adjusting the length of the time slice allocated to each second virtual image processing unit in the current scheduling period based on the adjusted length of the current scheduling period and the service quality parameter corresponding to each second virtual image processing unit, so that the service quality parameter of each second virtual image processing unit is kept as a corresponding preset value and/or the proportion of the time slice of each second virtual image processing unit in the current scheduling period is kept as a corresponding preset value.
6. The method according to claim 4 or 5, wherein said adjusting the length of the current scheduling period in case that the first virtual image processing unit is determined to be timed out comprises:
acquiring the overtime times of at least one third virtual image processing unit which is executed in the current scheduling period;
determining an extension coefficient for extending the length of the current scheduling period according to the overtime times; wherein the elongation coefficient is positively correlated with the number of timeouts;
and based on the extension coefficient, extending the length of the current scheduling period to obtain the adjusted length of the current scheduling period.
7. The method of claim 6, wherein the extension factor is derived based on an exponential function with the number of timeouts as a variable.
8. A scheduling apparatus, comprising:
the acquisition module is used for acquiring the task processing time of the first virtual image processing unit in the current scheduling period;
a determining module, configured to determine whether the first virtual image processing unit is overtime based on the task processing time and a first time slice allocated to the first virtual image processing unit in the current scheduling period;
and the adjusting module is used for adjusting the time slice distributed to at least one second virtual image processing unit in a target scheduling period according to the determined result, wherein the target scheduling period comprises the current scheduling period or the next scheduling period of the current scheduling period.
9. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 7.
10. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 7.
CN201911108865.9A 2019-11-13 2019-11-13 Scheduling method and device, electronic equipment and storage medium Active CN112799793B (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
CN201911108865.9A CN112799793B (en) 2019-11-13 2019-11-13 Scheduling method and device, electronic equipment and storage medium
PCT/CN2020/081199 WO2021093248A1 (en) 2019-11-13 2020-03-25 Scheduling method and apparatus, electronic device, and storage medium
KR1020217020219A KR20210095687A (en) 2019-11-13 2020-03-25 Scheduling method and apparatus, electronic device and recording medium
SG11202107163PA SG11202107163PA (en) 2019-11-13 2020-03-25 Scheduling methods, apparatuses, electronic devices and storage media
JP2021536726A JP2022515255A (en) 2019-11-13 2020-03-25 Scheduling method and equipment, electronic devices and recording media
TW109115358A TW202119207A (en) 2019-11-13 2020-05-08 Scheduling method and apparatus, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911108865.9A CN112799793B (en) 2019-11-13 2019-11-13 Scheduling method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112799793A true CN112799793A (en) 2021-05-14
CN112799793B CN112799793B (en) 2022-03-15

Family

ID=75803534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911108865.9A Active CN112799793B (en) 2019-11-13 2019-11-13 Scheduling method and device, electronic equipment and storage medium

Country Status (6)

Country Link
JP (1) JP2022515255A (en)
KR (1) KR20210095687A (en)
CN (1) CN112799793B (en)
SG (1) SG11202107163PA (en)
TW (1) TW202119207A (en)
WO (1) WO2021093248A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116700135B (en) * 2023-08-09 2023-10-20 长江三峡集团实业发展(北京)有限公司 Method and device for testing task scheduling mode of programmable logic controller
CN117290113B (en) * 2023-11-22 2024-02-13 太平金融科技服务(上海)有限公司 Task processing method, device, system and storage medium
CN117421106B (en) * 2023-12-11 2024-03-08 湖南行必达网联科技有限公司 Task scheduling method, system and equipment for embedded software

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130298137A1 (en) * 2011-01-07 2013-11-07 Fujitsu Limited Multi-task scheduling method and multi-core processor system
CN103841208A (en) * 2014-03-18 2014-06-04 北京工业大学 Cloud computing task scheduling method based on response time optimization
CN103885825A (en) * 2014-03-05 2014-06-25 南京邮电大学 Real-time speed monotony scheduling method based on dynamic time slices
CN108984264A (en) * 2017-06-02 2018-12-11 阿里巴巴集团控股有限公司 The implementation method of virtual GPU, apparatus and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4025260B2 (en) * 2003-08-14 2007-12-19 株式会社東芝 Scheduling method and information processing system
US9378139B2 (en) * 2013-05-08 2016-06-28 Nvidia Corporation System, method, and computer program product for low latency scheduling and launch of memory defined tasks
US9632844B2 (en) * 2013-12-12 2017-04-25 International Business Machines Corporation Non-preemption of a group of interchangeable tasks in a computing device
CN110109745B (en) * 2019-05-15 2023-06-20 华南理工大学 Task collaborative online scheduling method for edge computing environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130298137A1 (en) * 2011-01-07 2013-11-07 Fujitsu Limited Multi-task scheduling method and multi-core processor system
CN103885825A (en) * 2014-03-05 2014-06-25 南京邮电大学 Real-time speed monotony scheduling method based on dynamic time slices
CN103841208A (en) * 2014-03-18 2014-06-04 北京工业大学 Cloud computing task scheduling method based on response time optimization
CN108984264A (en) * 2017-06-02 2018-12-11 阿里巴巴集团控股有限公司 The implementation method of virtual GPU, apparatus and system

Also Published As

Publication number Publication date
WO2021093248A1 (en) 2021-05-20
KR20210095687A (en) 2021-08-02
CN112799793B (en) 2022-03-15
SG11202107163PA (en) 2021-07-29
TW202119207A (en) 2021-05-16
JP2022515255A (en) 2022-02-17

Similar Documents

Publication Publication Date Title
CN112799793B (en) Scheduling method and device, electronic equipment and storage medium
CN110213620B (en) Bandwidth allocation method and device
US11150999B2 (en) Method, device, and computer program product for scheduling backup jobs
US11086668B2 (en) Method, electronic device and computer program product for processing task
CN112508768B (en) Single-operator multi-model pipeline reasoning method, system, electronic equipment and medium
US10531402B2 (en) Power allocation method and apparatus
CN111245732A (en) Flow control method, device and equipment
CN112506581A (en) Method and device for rendering small program, electronic equipment and readable storage medium
CN113986497B (en) Queue scheduling method, device and system based on multi-tenant technology
CN111355814A (en) Load balancing method and device and storage medium
US10860369B2 (en) Self-adjusting system for prioritizing computer applications
CN109905331B (en) Queue scheduling method and device, communication equipment and storage medium
CN114490048A (en) Task execution method and device, electronic equipment and computer storage medium
EP3460660A1 (en) Sleep management method and device, and computer storage medium
CN111338787B (en) Data processing method and device, storage medium and electronic device
KR102496115B1 (en) Apparatus and Method of Altruistic Scheduling based on Reinforcement Learning
CN111343719B (en) LTE physical resource block allocation method, device and storage medium
CN111294173A (en) Rate matching method and device
CN114265692A (en) Service scheduling method, device, equipment and storage medium
US11438920B2 (en) Downlink scheduling of terminal devices
CN113453285A (en) Resource adjusting method, device and storage medium
CN111158907B (en) Data processing method and device, electronic equipment and storage medium
CN116416115B (en) GPU control method, device, equipment, storage medium and program product
CN113395768B (en) Method and device for determining spatial information
CN110248413B (en) Method, device and storage medium for distributing communication transaction and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40044239

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant