CN112527445A - Task scheduling method, device, equipment and storage medium - Google Patents

Task scheduling method, device, equipment and storage medium Download PDF

Info

Publication number
CN112527445A
CN112527445A CN201910883129.4A CN201910883129A CN112527445A CN 112527445 A CN112527445 A CN 112527445A CN 201910883129 A CN201910883129 A CN 201910883129A CN 112527445 A CN112527445 A CN 112527445A
Authority
CN
China
Prior art keywords
task
virtual machine
computational complexity
complexity
executed
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.)
Pending
Application number
CN201910883129.4A
Other languages
Chinese (zh)
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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201910883129.4A priority Critical patent/CN112527445A/en
Publication of CN112527445A publication Critical patent/CN112527445A/en
Pending legal-status Critical Current

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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a task scheduling method, a device, equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps of obtaining the computational complexity of each task to be executed by a virtual machine, wherein the computational complexity of one task is used for representing resources occupied by the running of the task; and scheduling the tasks according to the computational complexity of each task to be executed and the resources of the virtual machine. The method and the device are used for optimizing the resource use of the virtual machine and improving the reasonability of task allocation.

Description

Task scheduling method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for task scheduling.
Background
The B-family of virtual machines provides a cost-effective type of virtual machine suitable for tasks where a performance surge may occur, but where the overall CPU (central processing unit) performance is not continuously occupied. When the B-series virtual machine is running at a low score and the baseline performance of the CPU is not fully utilized, the virtual machine continues to accumulate credits. After sufficient integration is accumulated, the performance of the virtual machine can be suddenly increased to be higher than a baseline in a time period that a task needs higher CPU performance, and the utilization rate of the CPU of the virtual machine is rapidly increased to 100%.
At present, the resource occupation is calculated according to the number of tasks in the virtual machine and is used as a basis for resource scheduling, but the resource scheduling is simply performed according to the number of tasks, and the performance of the virtual machine is poor due to the fact that the difference of actual execution of the tasks with the same number is ignored. For example, when the same number of tasks are run, some hot spots may be caused sometimes, and the CPU is overloaded, so that resources are insufficient, and the virtual machine is halted or restarted; sometimes, the situations of partial idle and low CPU utilization rate occur, which causes resource waste.
In view of this, how to optimize the resource usage of the virtual machine and improve the rationality of task scheduling is a problem to be solved.
Disclosure of Invention
The application provides a task scheduling method, a task scheduling device and a task scheduling storage medium, which are used for optimizing resource use of a virtual machine and improving task allocation reasonability.
In a first aspect, the present application provides a task scheduling method, including: the method comprises the steps of obtaining the computational complexity of each task to be executed by a virtual machine, wherein the computational complexity of one task is used for representing resources occupied by the running of the task; and scheduling the tasks according to the computational complexity of each task to be executed and the resources of the virtual machine.
Optionally, obtaining the computational complexity of each task to be executed by the virtual machine includes: determining the task category to which each task to be executed belongs; and acquiring the computational complexity of each task to be executed according to the corresponding relation between the task category and the computational complexity.
Optionally, before the obtaining the computational complexity of each task to be executed according to the corresponding relationship between the task category and the computational complexity, the method further includes: and calculating to obtain the calculation complexity of each task category in the last time period, and storing the corresponding relation between the task categories and the calculation complexity of the task categories obtained by calculation.
Optionally, the calculating to obtain the computational complexity of each task category in the last time period includes: the following processing is performed for each task category respectively: acquiring sampling time of the task category in the last time period and the total number of tasks of the task category running in the sampling time, wherein the virtual machine is specially used for running the tasks of the task category in the sampling time; dividing the sampling duration by the total number of the tasks, and determining the average complexity of the task categories according to the obtained result; and calculating the sum of the average complexity of the task categories and a preset statistical error, and taking the obtained sum as the calculation complexity of the task categories.
Optionally, the computational complexity is equal to: the ratio of the resources occupied by running the task to the resources occupied by running the unit task.
Optionally, performing task scheduling according to the computational complexity of each task to be executed and the resource of the virtual machine, including: when the resources of the virtual machine are higher than a baseline value and the integral value of the virtual machine is reduced to be lower than a first threshold value, changing a task of allocating a first computational complexity to the virtual machine into a task of allocating a second computational complexity, wherein the first computational complexity is higher than the second computational complexity; when the resources of the virtual machine are lower than the baseline value and the integral value of the virtual machine is increased to be higher than a second threshold value, changing a task of allocating a fourth computational complexity from a task of allocating a third computational complexity to the virtual machine, wherein the third computational complexity is lower than the fourth computational complexity; and the virtual machine is a type B virtual machine.
Optionally, performing task scheduling according to the computational complexity of each task to be executed and the resource of the virtual machine, including: determining a numerical value interval to which the resource of the virtual machine belongs; acquiring the determined calculation complexity corresponding to the numerical value interval according to the corresponding relation between the numerical value interval and the calculation complexity; and according to the obtained computation complexity and the computation complexity of each task to be executed, selecting a task matched with the obtained computation complexity from each task to be executed, and distributing the selected task to the virtual machine.
In a second aspect, the present application provides a task scheduling apparatus, including: the virtual machine comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring the computational complexity of each task to be executed by a virtual machine, and the computational complexity of one task is used for representing the resources occupied by the task operation; and the scheduling unit is used for scheduling the tasks according to the computational complexity of each task to be executed and the resources of the virtual machine.
In a third aspect, the present application provides an electronic device, comprising: at least one processor, and at least one memory, bus connected with the processor; the processor and the memory complete mutual communication through a bus; the processor is used for calling the program instructions in the memory to execute the task scheduling method.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program which, when executed by data processing apparatus, implements the task scheduling method.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method provided by the embodiment of the application, the computational complexity of the task is defined as the resource occupied for representing the task operation, so that after the computational complexity of each task to be executed is obtained, the resource of the virtual machine can be combined to schedule the task with the computational complexity matched with the resource for the virtual machine, the resource use of the virtual machine is optimized, the task scheduling rationality is improved, and the problem that the resource is insufficient or the resource is wasted due to the fact that the task scheduling mode is simply carried out according to the number of the tasks is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic flow chart illustrating task scheduling in an embodiment of the present application;
FIG. 2 is a diagram illustrating a statistical process of calculating complexity in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a task scheduling device in an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the embodiment of the application, in order to optimize a task scheduling mechanism, concepts of unit tasks and the computation complexity of the tasks are provided.
Wherein, the unit task is defined to correspond to the fixed resource.
In one embodiment, the unit task may be defined as a task occupying 1 second of the CPU processing time, and is marked as 1, that is, 1 unit task occupies 1 second of the CPU processing time, and assuming that the CPU processing time of one time period is 100 seconds, the unit task occupies 1% of the CPU processing time of one period. Of course, the unit task may be defined as a task occupying the processing time of the CPU for 5 seconds or 10 seconds, or the like, according to the design requirement.
In addition, the computational complexity of the task is defined as the resources occupied by the task operation, and the unit task is used as a measurement standard, namely the computational complexity of one task is equal to the computational complexity of N unit tasks. That is, the ratio of the resource occupied by the running task to the resource occupied by the running unit task is equal to the computational complexity of the task, wherein once the resource occupied by the running unit task is set, the subsequent operation is performed according to the set value until the resource is reset.
For example, assume that the computational complexity of a task is 15, i.e., the CPU processing time required for the task to run is equivalent to the CPU processing time required for 15 unit tasks to run.
It should be noted that, in a task scheduling mechanism, resources occupied by a unit task are fixed after setting, and the computational complexity of each task is based on the set unit task.
In addition, it should be noted that, in the above definition of the unit task and the computational complexity of the task, only one resource, which is the processing time of the CPU, is taken as an example for description, and actually, the resources mentioned in the description of the computational complexity of the unit task and the task may be obtained by computing the occupied memory resources, or may be obtained by considering all the resources of the working node as a whole to compute the occupied whole resources of the working node. The working node may refer to a virtual machine or an entity device.
Based on the above definitions, the present application provides a method for task scheduling, where the method may be applied to any device installed with a virtual machine, and as shown in fig. 1, a main process of task scheduling includes:
step 101, obtaining the computational complexity of each task to be executed by the virtual machine, wherein the computational complexity is used for representing resources required to be occupied by task operation.
In a specific embodiment, considering that the calculation complexity of each task is very complicated, resources are wasted, and processing efficiency is reduced, various tasks are divided according to task categories, and a corresponding relationship between the task categories and the calculation complexity is established. Specifically, the process of obtaining the computational complexity of each task to be executed by the virtual machine includes: and determining the task category to which each task to be executed belongs, and acquiring the computational complexity of each task to be executed according to the corresponding relation between the task category and the computational complexity.
In the embodiment of the present application, the task categories are mainly divided according to a Resource occupying manner, for example, the tasks mainly occupying memory resources are divided into a class, the tasks mainly occupying CPU resources are divided into a class, and the tasks are classified according to a domain name of a crawler task URL (Uniform Resource Locator).
In a specific embodiment, the computation complexity of each task category is counted according to a fixed time period, and the computation complexity of the task category counted in the previous time period is used as the computation complexity of each task category in the time period. Similarly, after the time period is finished, the calculation complexity of the task category counted in the time period is used as the calculation complexity of each task category in the next time period. And so on. By the method, the task complexity can be dynamically updated. The calculation complexity of the task category used in the first fixed time period is a preset initial value, and the initial value can be an empirical value, a manually input value or a preset default value.
In a specific embodiment, as shown in fig. 2, taking a task category as an example, a statistical process of the computation complexity of the task category in the last time period is described as follows:
step 201, obtaining a sampling time length of a certain task category in a last time period and a total number of tasks of the task category running in the sampling time length, wherein a virtual machine is only used for running the tasks of the task category in the sampling time length;
step 202, dividing the sampling duration by the total number of the tasks, and determining the average complexity of the task category according to the obtained result;
step 203, calculating the sum of the average complexity of the task category and a preset statistical error, and taking the obtained sum as the calculation complexity of the task category.
The virtual machine for calculating the computational complexity of the task category and the virtual machine for performing task scheduling may be two different virtual machines or may be the same virtual machine, as long as the virtual machine is dedicated to running the task of a certain task category within the sampling duration of calculating the computational complexity, which is not limited herein.
And dividing the sampling time length by the total number of the tasks, and dividing the obtained result by the CPU processing time length occupied by the unit task to obtain the average complexity of the task category.
For example, assuming that a time period is 1 hour, a sampling time for a certain task category is 10 minutes, within the 10 minutes, the virtual machine only runs the crawler task, and the number of the run crawler tasks is 60, the average complexity of the crawler task is 600 seconds divided by 60, which is equal to 10 seconds, and assuming that a CPU processing time occupied by a unit task is defined to be 1 second, the average complexity of the crawler task counted in the previous period is 10 unit tasks.
The statistical error is a preset value, and the preset value can be obtained by a designer according to experience statistics.
And 102, scheduling the tasks according to the computational complexity of each task to be executed and the resources of the virtual machine.
In the embodiment of the application, the task scheduling process is different according to different types of virtual machines. The following describes the scheduling process of the type B virtual machine and the generic type virtual machine, respectively:
for a type B virtual machine, when the resources of the virtual machine are higher than a baseline value and the integral (Credit) value of the virtual machine is reduced to be lower than a first threshold value (or a value called a moving line), modifying the task of allocating a first computational complexity to the virtual machine and allocating a second computational complexity to the virtual machine, wherein the first computational complexity is higher than the second computational complexity; when the resources of the virtual machine are below the baseline value and the integral value of the virtual machine increases above a second threshold value (alternatively referred to as a value of the recovery line), the task of assigning a fourth computational complexity is modified from the task of assigning the virtual machine a third computational complexity, the third computational complexity being lower than the fourth computational complexity. The first threshold and the second threshold may be the same or different.
For a common type virtual machine, determining a numerical value interval to which resources of the virtual machine belong; acquiring the calculation complexity corresponding to the determined numerical value interval according to the corresponding relation between the numerical value interval and the calculation complexity; and according to the acquired computational complexity and the computational complexity of each task to be executed, selecting a task matched with the acquired computational complexity from each task to be executed, and distributing the selected task to the virtual machine.
Further, for the common type virtual machine, the computational complexity corresponding to the resources of the current virtual machine is determined according to the corresponding relationship between the numerical value interval to which the resources of the virtual machine belong and the computational complexity, a matched task is selected from each task to be executed according to the computational complexity, the selected task is allocated to the virtual machine, and the resources of the virtual machine can be dynamically kept unchanged within a certain range.
In the embodiment of the application, the computational complexity of the task is defined as the resource required to be occupied for representing the task operation, so that after the computational complexity of each task to be executed is obtained, the resource of the virtual machine can be combined, the task with the computational complexity matched with the resource is scheduled for the virtual machine, the resource use of the virtual machine is optimized, the task scheduling rationality is improved, and the problem of insufficient resources or resource waste caused by the fact that the task scheduling mode is simply carried out according to the number of the tasks is avoided.
According to the embodiment of the application, the concept of calculating complexity, which can reflect the actual execution difference of the tasks, is introduced, so that the actual execution difference of the tasks can be reflected when the tasks are scheduled, and the calculating complexity of the tasks is measured and calculated on the basis of unit tasks, so that the amount of resources actually occupied by the tasks can be predicted in a finer granularity, the tasks can be scheduled more reasonably, and the overall operation efficiency is improved.
Based on the same concept, the embodiment of the present application provides a task scheduling device, and specific implementation of the task scheduling device can be referred to the description of the method embodiment section, and repeated parts are not repeated. As shown in fig. 3, the apparatus mainly includes:
an obtaining unit 301, configured to obtain a computational complexity of each task to be executed by a virtual machine, where the computational complexity of one task is used to represent resources required to be occupied by the task;
a scheduling unit 302, configured to perform task scheduling according to the computational complexity of each task to be executed and the resource of the virtual machine.
In a specific embodiment, the obtaining unit 301 is specifically configured to: determining the task category to which each task to be executed belongs; and acquiring the computational complexity of each task to be executed according to the corresponding relation between the task category and the computational complexity.
In a specific embodiment, the apparatus further includes a calculating unit 303, configured to calculate the computational complexity of each task category in the last time period before the obtaining unit 301 obtains the computational complexity of each task to be executed according to the corresponding relationship between the task category and the computational complexity, and store the corresponding relationship between the task category and the computational complexity of the task category obtained by calculation.
In a specific embodiment, the calculating unit 303 is specifically configured to: the following processing is performed for each task category respectively: acquiring sampling time of the task category in the last time period and the total number of tasks of the task category running in the sampling time, wherein the virtual machine is specially used for running the tasks of the task category in the sampling time; dividing the sampling duration by the total number of the tasks, and determining the average complexity of the task categories according to the obtained result; and calculating the sum of the average complexity of the task categories and a preset statistical error, and taking the obtained sum as the calculation complexity of the task categories.
In a specific embodiment, the computational complexity is equal to: the ratio of the resources occupied by running the task to the resources occupied by running the unit task.
In a specific embodiment, the scheduling unit 302 is specifically configured to: when the resources of the virtual machine are higher than a baseline value and the integral value of the virtual machine is reduced to be lower than a first threshold value, changing a task of allocating a first computational complexity to the virtual machine into a task of allocating a second computational complexity, wherein the first computational complexity is higher than the second computational complexity; when the resources of the virtual machine are lower than the baseline value and the integral value of the virtual machine is increased to be higher than a second threshold value, changing a task of allocating a fourth computational complexity from a task of allocating a third computational complexity to the virtual machine, wherein the third computational complexity is lower than the fourth computational complexity; and the virtual machine is a type B virtual machine.
In a specific embodiment, the scheduling unit 302 is specifically configured to: according to the computational complexity of each task to be executed and the resources of the virtual machine, task scheduling is carried out, and the task scheduling method comprises the following steps: determining a numerical value interval to which the resource of the virtual machine belongs; acquiring the determined calculation complexity corresponding to the numerical value interval according to the corresponding relation between the numerical value interval and the calculation complexity; and according to the obtained computation complexity and the computation complexity of each task to be executed, selecting a task matched with the obtained computation complexity from each task to be executed, and distributing the selected task to the virtual machine.
The device for scheduling tasks comprises a processor and a memory, the acquiring unit 301, the scheduling unit 302, the calculating unit 303 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, the obtaining unit, the scheduling unit and the calculating unit are executed by adjusting kernel parameters, so that after the obtaining unit obtains the computational complexity of each task to be executed, the scheduling unit can combine the resources of the virtual machine to schedule the tasks with the computational complexity matched with the resources for the virtual machine, the resource use of the virtual machine is optimized, the task scheduling rationality is improved, and the problem that the resources are insufficient or the resources are wasted due to the fact that the task scheduling mode is simply carried out according to the number of the tasks is solved.
An embodiment of the present application provides a storage medium, on which a program is stored, which when executed by a processor implements the task scheduling method.
The embodiment of the application provides a processor, wherein the processor is used for running a program, and the task scheduling method is executed when the program runs.
An embodiment of the present application provides an electronic device, as shown in fig. 4, the electronic device 40 includes at least one processor 401, and at least one memory 402 and a bus 403 connected to the processor 401; the processor 401 and the memory 402 complete communication with each other through the bus 403; the processor 401 is arranged to call program instructions in the memory 402 to perform the task scheduling method described above. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
Embodiments of the present application further provide a computer program product, which, when executed on a data processing apparatus, is adapted to perform a procedure for initializing: the method comprises the steps of obtaining the computational complexity of each task to be executed by a virtual machine, wherein the computational complexity of one task is used for representing resources occupied by the running of the task; and scheduling the tasks according to the computational complexity of each task to be executed and the resources of the virtual machine.
Specifically, obtaining the computational complexity of each task to be executed by the virtual machine includes: determining the task category to which each task to be executed belongs; and acquiring the computational complexity of each task to be executed according to the corresponding relation between the task category and the computational complexity.
Specifically, before the computation complexity of each task to be executed is obtained according to the corresponding relationship between the task category and the computation complexity, the method further includes: and calculating to obtain the calculation complexity of each task category in the last time period, and storing the corresponding relation between the task categories and the calculation complexity of the task categories obtained by calculation.
Specifically, the calculating to obtain the computational complexity of each task category in the last time period includes: the following processing is performed for each task category respectively: acquiring sampling time of the task category in the last time period and the total number of tasks of the task category running in the sampling time, wherein the virtual machine is specially used for running the tasks of the task category in the sampling time; dividing the sampling duration by the total number of the tasks, and determining the average complexity of the task categories according to the obtained result; and calculating the sum of the average complexity of the task categories and a preset statistical error, and taking the obtained sum as the calculation complexity of the task categories.
In particular, the computational complexity is equal to: the ratio of the resources occupied by running the task to the resources occupied by running the unit task.
Specifically, the task scheduling according to the computational complexity of each task to be executed and the resource of the virtual machine includes: when the resources of the virtual machine are higher than a baseline value and the integral value of the virtual machine is reduced to be lower than a first threshold value, changing a task of allocating a first computational complexity to the virtual machine into a task of allocating a second computational complexity, wherein the first computational complexity is higher than the second computational complexity; when the resources of the virtual machine are lower than the baseline value and the integral value of the virtual machine is increased to be higher than a second threshold value, changing a task of allocating a fourth computational complexity from a task of allocating a third computational complexity to the virtual machine, wherein the third computational complexity is lower than the fourth computational complexity; and the virtual machine is a type B virtual machine.
Specifically, the task scheduling according to the computational complexity of each task to be executed and the resource of the virtual machine includes: determining a numerical value interval to which the resource of the virtual machine belongs; acquiring the determined calculation complexity corresponding to the numerical value interval according to the corresponding relation between the numerical value interval and the calculation complexity; and according to the obtained computation complexity and the computation complexity of each task to be executed, selecting a task matched with the obtained computation complexity from each task to be executed, and distributing the selected task to the virtual machine.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, 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 specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for task scheduling, comprising:
the method comprises the steps of obtaining the computational complexity of each task to be executed by a virtual machine, wherein the computational complexity of one task is used for representing resources occupied by the running of the task;
and scheduling the tasks according to the computational complexity of each task to be executed and the resources of the virtual machine.
2. The task scheduling method according to claim 1, wherein obtaining the computational complexity of each task to be executed by the virtual machine comprises:
determining the task category to which each task to be executed belongs;
and acquiring the computational complexity of each task to be executed according to the corresponding relation between the task category and the computational complexity.
3. The task scheduling method according to claim 2, wherein before the computation complexity of each task to be executed is obtained according to a corresponding relationship between a task category and the computation complexity, the method further comprises:
and calculating to obtain the calculation complexity of each task category in the last time period, and storing the corresponding relation between the task categories and the calculation complexity of the task categories obtained by calculation.
4. The task scheduling method according to claim 3, wherein the calculating to obtain the computational complexity of each task category in the last time period comprises:
the following processing is performed for each task category respectively:
acquiring sampling time of the task category in the last time period and the total number of tasks of the task category running in the sampling time, wherein the virtual machine is specially used for running the tasks of the task category in the sampling time;
dividing the sampling duration by the total number of the tasks, and determining the average complexity of the task categories according to the obtained result;
and calculating the sum of the average complexity of the task categories and a preset statistical error, and taking the obtained sum as the calculation complexity of the task categories.
5. A task scheduling method according to any one of claims 1 to 4, wherein said computational complexity is equal to: the ratio of the resources occupied by running the task to the resources occupied by running the unit task.
6. The task scheduling method according to claim 5, wherein performing task scheduling according to the computational complexity of each task to be executed and the resources of the virtual machine comprises:
when the resources of the virtual machine are higher than a baseline value and the integral value of the virtual machine is reduced to a first threshold value, changing a task of allocating a second computational complexity from a task of allocating the first computational complexity to the virtual machine, wherein the first computational complexity is higher than the second computational complexity;
when the resources of the virtual machine are lower than the baseline value and the integral value of the virtual machine is increased to a second threshold value, changing a task of allocating a fourth computational complexity from a task of allocating a third computational complexity to the virtual machine, wherein the third computational complexity is lower than the fourth computational complexity;
and the virtual machine is a type B virtual machine.
7. The task scheduling method according to claim 5, wherein performing task scheduling according to the computational complexity of each task to be executed and the resources of the virtual machine comprises:
determining a numerical value interval to which the resource of the virtual machine belongs;
acquiring the determined calculation complexity corresponding to the numerical value interval according to the corresponding relation between the numerical value interval and the calculation complexity;
and according to the obtained computation complexity and the computation complexity of each task to be executed, selecting a task matched with the obtained computation complexity from each task to be executed, and distributing the selected task to the virtual machine.
8. A task scheduling apparatus, comprising:
the virtual machine comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring the computational complexity of each task to be executed by a virtual machine, and the computational complexity of one task is used for representing the resources occupied by the task operation;
and the scheduling unit is used for scheduling the tasks according to the computational complexity of each task to be executed and the resources of the virtual machine.
9. An electronic device, comprising: at least one processor, and at least one memory, bus connected with the processor;
the processor and the memory complete mutual communication through a bus; a processor is arranged to call program instructions in a memory to perform the task scheduling method of any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a data processing device, carries out a task scheduling method according to any one of claims 1 to 7.
CN201910883129.4A 2019-09-18 2019-09-18 Task scheduling method, device, equipment and storage medium Pending CN112527445A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910883129.4A CN112527445A (en) 2019-09-18 2019-09-18 Task scheduling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910883129.4A CN112527445A (en) 2019-09-18 2019-09-18 Task scheduling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112527445A true CN112527445A (en) 2021-03-19

Family

ID=74975204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910883129.4A Pending CN112527445A (en) 2019-09-18 2019-09-18 Task scheduling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112527445A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110154353A1 (en) * 2009-12-22 2011-06-23 Bmc Software, Inc. Demand-Driven Workload Scheduling Optimization on Shared Computing Resources
CN102866920A (en) * 2012-08-02 2013-01-09 杭州海康威视***技术有限公司 Master-slave structure distributed video processing system and scheduling method thereof
CN103019855A (en) * 2012-11-21 2013-04-03 北京航空航天大学 Method for forecasting executive time of Map Reduce operation
CN103399800A (en) * 2013-08-07 2013-11-20 山东大学 Dynamic load balancing method based on Linux parallel computing platform
CN105900064A (en) * 2014-11-19 2016-08-24 华为技术有限公司 Method and apparatus for scheduling data flow task
CN108205469A (en) * 2016-12-20 2018-06-26 华为技术有限公司 A kind of resource allocation methods and server based on MapReduce
CN110018903A (en) * 2018-01-10 2019-07-16 广东欧珀移动通信有限公司 Method for managing resource, device, mobile terminal and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110154353A1 (en) * 2009-12-22 2011-06-23 Bmc Software, Inc. Demand-Driven Workload Scheduling Optimization on Shared Computing Resources
CN102866920A (en) * 2012-08-02 2013-01-09 杭州海康威视***技术有限公司 Master-slave structure distributed video processing system and scheduling method thereof
CN103019855A (en) * 2012-11-21 2013-04-03 北京航空航天大学 Method for forecasting executive time of Map Reduce operation
CN103399800A (en) * 2013-08-07 2013-11-20 山东大学 Dynamic load balancing method based on Linux parallel computing platform
CN105900064A (en) * 2014-11-19 2016-08-24 华为技术有限公司 Method and apparatus for scheduling data flow task
CN108205469A (en) * 2016-12-20 2018-06-26 华为技术有限公司 A kind of resource allocation methods and server based on MapReduce
CN110018903A (en) * 2018-01-10 2019-07-16 广东欧珀移动通信有限公司 Method for managing resource, device, mobile terminal and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN107968810B (en) Resource scheduling method, device and system for server cluster
CN110138883B (en) Hybrid cloud resource allocation method and device
CN103699445A (en) Task scheduling method, device and system
US10680975B2 (en) Method of dynamic resource allocation for public clouds
CN110659137B (en) Processing resource allocation method and system for offline tasks
CN108306874B (en) Service interface access current limiting method and device
CN112540841B (en) Task scheduling method and device, processor and electronic equipment
CN109739627B (en) Task scheduling method, electronic device and medium
CN109189572B (en) Resource estimation method and system, electronic equipment and storage medium
CN107578338B (en) Service publishing method, device and equipment
CN112748993A (en) Task execution method and device, storage medium and electronic equipment
CN110599148A (en) Cluster data processing method and device, computer cluster and readable storage medium
CN106293890B (en) A kind of method and device for business processing based on complexity
CN113742036B (en) Index processing method and device and electronic equipment
CN116820729A (en) Offline task scheduling method and device and electronic equipment
CN112416534A (en) Agent-based task management method and device
CN109992470A (en) A kind of threshold adjustment methods and device
CN112527445A (en) Task scheduling method, device, equipment and storage medium
CN113468442A (en) Resource bit flow distribution method, computing device and computer storage medium
CN112579305A (en) Task processing method and device, nonvolatile storage medium and equipment
CN112509164A (en) Attendance card-punching method, attendance card-punching device, attendance card-punching equipment and storage medium
CN112346849A (en) Method and device for configuring CPU
CN110012053B (en) System calling method, device and equipment under SOA system architecture and SOA system architecture
CN112988399B (en) Processor scheduling method and processor scheduling device based on virtualization technology
CN112882821A (en) Method, device and equipment for allocating processor resources

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