CN116501487A - Task execution method and device on virtual machine, storage medium and electronic equipment - Google Patents

Task execution method and device on virtual machine, storage medium and electronic equipment Download PDF

Info

Publication number
CN116501487A
CN116501487A CN202310331308.3A CN202310331308A CN116501487A CN 116501487 A CN116501487 A CN 116501487A CN 202310331308 A CN202310331308 A CN 202310331308A CN 116501487 A CN116501487 A CN 116501487A
Authority
CN
China
Prior art keywords
target
task
physical node
physical
virtual machine
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
CN202310331308.3A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310331308.3A priority Critical patent/CN116501487A/en
Publication of CN116501487A publication Critical patent/CN116501487A/en
Pending legal-status Critical Current

Links

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/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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application provides a method and a device for executing tasks on a virtual machine, a storage medium and electronic equipment, wherein the method comprises the following steps: acquiring a target task to be executed on a target virtual machine deployed on a first physical node; searching a second physical node with idle processing resources from a physical node cluster, wherein the physical node cluster comprises a plurality of physical nodes which allow the first physical node to occupy the processing resources; distributing the target task to a target processing resource in the idle processing resources, wherein the target processing resource is used for executing the target task; and acquiring an execution result of the target task returned by the target processing resource. By the method and the device, the problem that the resource utilization efficiency is low when the virtual machine executes the task is solved, and the effect of improving the resource utilization efficiency when the virtual machine executes the task is achieved.

Description

Task execution method and device on virtual machine, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the field of computers, in particular to a method and a device for executing tasks on a virtual machine, a storage medium and electronic equipment.
Background
Currently, virtualization has become a big trend of IT (Information Technology ), hardware configuration of a current physical computer is very high, a core number of a CPU (Central Processing Unit ) of a single physical computer can reach 100+, a few TBs (terabytes) of memory, a storage capacity of a single disk is tens of TBs, and a single physical computer can virtualize N virtual machines, so that resources of the physical machine are fully utilized, and IT cost of a user is greatly saved.
However, in the current stage, the CPU resources of 1 virtual machine can only be limited in 1 physical machine, and if the calculation power requirement of a single virtual machine when executing a task exceeds the configuration of a single physical machine, or when there are multiple virtual machines on a single physical machine, when the virtual machine has a capacity expansion requirement when executing a task, but the physical machines are fully configured and cannot meet, the resource utilization efficiency of the virtual machine when executing the task is limited. At present, a method of longitudinally expanding capacity on physical nodes is mainly adopted to improve the resource utilization efficiency of a virtual machine when executing tasks, namely, the physical machine is additionally configured, for example, the physical machine is changed into more cores and higher-frequency CPUs, so that CPU computing resources of a single physical machine are improved, but the limited capacity expansion is realized, the computing resources of the virtual machine are limited on the single physical machine, the capacity expansion is stopped after the physical machine configuration reaches the upper limit, and the resource utilization efficiency of the virtual machine when executing tasks is lower.
Aiming at the problem of low resource utilization efficiency when the virtual machine executes tasks in the related art, no effective solution has been proposed yet.
Disclosure of Invention
The embodiment of the application provides a method and a device for executing tasks on a virtual machine, a storage medium and electronic equipment, so as to at least solve the problem of low resource utilization efficiency when the virtual machine executes the tasks in the related technology.
According to one embodiment of the present application, there is provided a task execution method on a virtual machine, including:
acquiring a target task to be executed on a target virtual machine deployed on a first physical node;
searching a second physical node with idle processing resources from a physical node cluster, wherein the physical node cluster comprises a plurality of physical nodes which are allowed to occupy the processing resources by the first physical node;
distributing the target task to a target processing resource in the idle processing resources, wherein the target processing resource is used for executing the target task;
and acquiring an execution result of the target task returned by the target processing resource.
In an exemplary embodiment, the searching for the second physical node with idle processing resources from the physical node cluster includes:
Searching a target physical node, of which the resource quantity of the idle processing resources meets the task quantity of the target task, from the physical node cluster to serve as the second physical node;
and under the condition that the target physical node is not found, determining all physical nodes with the idle processing resources in the physical node cluster as the second physical node.
In an exemplary embodiment, the searching the target physical node, which is the physical node cluster and has the resource amount of the idle processing resource satisfying the task amount of the target task, as the second physical node includes:
and searching the target physical nodes with the minimum resource quantity meeting the task quantity from the physical node cluster to serve as the second physical nodes.
In an exemplary embodiment, said searching for, as said second physical node, said target physical node of said minimum number of said resource quantity satisfying said task quantity from said physical node cluster comprises:
arranging and combining physical nodes in the physical node cluster to obtain one or more groups of physical node combinations with the resource quantity meeting the task quantity;
Determining a group of the physical node combinations as the target physical node under the condition that the group of the physical node combinations is obtained;
and under the condition that a plurality of groups of physical node combinations are obtained, determining the physical node combination with the minimum physical node number and the maximum resource amount in the plurality of groups of physical node combinations as the target physical node.
In an exemplary embodiment, the allocating the target task to a target processing resource of the idle processing resources includes:
acquiring the target processing resource from the idle processing resource;
marking a target identifier corresponding to the target virtual machine for the target processing resource, wherein the target identifier is used for indicating that the target processing resource is set to be only allowed to be called by the target virtual machine;
and distributing the target task to the target processing resource marked with the target identifier.
In an exemplary embodiment, after the obtaining the execution result of the target task returned by the target processing resource, the method further includes:
withdrawing the target identifier marked on the target processing resource;
and adding the target processing resource of which the target identification is revoked to the idle processing resource.
In an exemplary embodiment, the allocating the target task to a target processing resource of the idle processing resources includes:
transmitting task data of the target task to the target processing resource;
and sending an execution instruction of the target task to the target processing resource, wherein the target processing resource is used for executing the target task by using the task data in response to the execution instruction.
In one exemplary embodiment of the present invention,
the transmitting task data of the target task to the target processing resource includes: storing the task data into a storage space on the second physical node, and obtaining a first storage address of the task data;
the sending the execution instruction of the target task to the target processing resource comprises the following steps: and sending the execution instruction carrying the first storage address to the target processing resource, wherein the target processing resource is used for responding to the execution instruction to read the task data from the first storage address to execute the target task.
In an exemplary embodiment, the obtaining the execution result of the target task returned by the target processing resource includes:
Receiving response information returned by the target processing resource in response to the target task, wherein the response information carries a second storage address, and the second storage address is used for indicating the target processing resource to store the execution result to a storage position in a storage space on the first physical node;
reading the execution result from the second memory address.
In an exemplary embodiment, the acquiring the target task to be performed on the target virtual machine deployed on the first physical node includes one of the following:
acquiring all tasks to be executed on the target virtual machine as target tasks;
acquiring candidate tasks in all tasks to be executed on the target virtual machine as the target tasks, wherein the candidate tasks are other tasks except the tasks which are distributed to a first processing resource for executing on the target virtual machine, and the first processing resource is the processing resource distributed to the target virtual machine on the first physical node;
acquiring a first reference task in all tasks to be executed on the target virtual machine as the target task, wherein the first reference task is other tasks except for tasks which are distributed to a second processing resource to be executed in all tasks, and the second processing resource is an idle processing resource except for the processing resource distributed to the target virtual machine on the first physical node;
And acquiring a second reference task from candidate tasks in all tasks to be executed on the target virtual machine as the target task, wherein the candidate tasks are other tasks except the tasks which are distributed to the first processing resources and executed on the target virtual machine, the second reference task is the other tasks except the tasks which are distributed to the second processing resources and executed on the candidate tasks, the first processing resources are the processing resources distributed to the target virtual machine on the first physical node, and the second processing resources are idle processing resources except the first processing resources on the first physical node.
According to another embodiment of the present application, there is provided a task execution device on a virtual machine, including:
the first acquisition module is used for acquiring a target task to be executed on a target virtual machine deployed on a first physical node;
a searching module, configured to search for a second physical node with idle processing resources from a physical node cluster, where the physical node cluster includes a plurality of physical nodes allowed to occupy processing resources by the first physical node;
the allocation module is used for allocating the target task to a target processing resource in the idle processing resources, wherein the target processing resource is used for executing the target task;
And the second acquisition module is used for acquiring an execution result of the target task returned by the target processing resource.
According to a further embodiment of the present application, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the present application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the method and the device, the target task to be executed on the target virtual machine deployed on the first physical node is firstly obtained, then the second physical node with idle processing resources is searched from the physical node cluster comprising a plurality of physical nodes allowing the first physical node to occupy the processing resources, so that the target task to be executed is distributed to the target processing resources used for executing the target task in the idle processing resources, and finally the execution result of the target task returned by the target processing resources is obtained. That is, by searching the second physical node which has idle processing resources and allows the first physical node to occupy the processing resources in the physical node cluster, and then distributing the target task to be executed to the target processing resources for processing, the task is executed by the virtual machine across the physical nodes, the idle processing resources of other physical nodes in the physical node cluster are fully utilized, and the resource utilization efficiency of the virtual machine when executing the task is maximized. Therefore, the problem of low resource utilization efficiency when the virtual machine executes the task is solved, and the effect of improving the resource utilization efficiency when the virtual machine executes the task is achieved.
Drawings
Fig. 1 is a hardware block diagram of a mobile terminal of a task execution method on a virtual machine according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of task execution on a virtual machine according to an embodiment of the present application;
FIG. 3 is a flow chart of a method of task execution for a virtual machine according to an alternative embodiment of the present application;
FIG. 4 is a block diagram of a method of task execution on a virtual machine according to an alternative embodiment of the present application;
fig. 5 is a block diagram of a task execution device on a virtual machine according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal of a task execution method on a virtual machine according to an embodiment of the present application. As shown in fig. 1, a mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU (MicroController Unit, micro control unit), programmable logic device FPGA (Field Prog ram mable Gate Array), etc. processing means) and a memory 104 for storing data, where the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store computer programs, such as software programs and modules of application software, such as computer programs corresponding to the task execution methods on the virtual machine in the embodiments of the present application, and the processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, that is, implement the methods described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for executing a task on a virtual machine of the mobile terminal is provided, and fig. 2 is a flowchart of the method for executing a task on a virtual machine according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
step S202, a target task to be executed on a target virtual machine deployed on a first physical node is obtained;
step S204, searching a second physical node with idle processing resources from a physical node cluster, wherein the physical node cluster comprises a plurality of physical nodes which are allowed to occupy the processing resources by the first physical node;
step S206, the target task is distributed to target processing resources in the idle processing resources, wherein the target processing resources are used for executing the target task;
step S208, obtaining an execution result of the target task returned by the target processing resource.
Through the steps, the target task to be executed on the target virtual machine deployed on the first physical node is firstly obtained, then the second physical node with idle processing resources is searched from the physical node cluster comprising a plurality of physical nodes allowing the first physical node to occupy the processing resources, so that the target task to be executed is distributed to the target processing resources used for executing the target task in the idle processing resources, and finally the execution result of the target task returned by the target processing resources is obtained. That is, by searching the second physical node which has idle processing resources and allows the first physical node to occupy the processing resources in the physical node cluster, and then distributing the target task to be executed to the target processing resources for processing, the task is executed by the virtual machine across the physical nodes, the idle processing resources of other physical nodes in the physical node cluster are fully utilized, and the resource utilization efficiency of the virtual machine when executing the task is maximized. Therefore, the problem of low resource utilization efficiency when the virtual machine executes the task is solved, and the effect of improving the resource utilization efficiency when the virtual machine executes the task is achieved.
The main execution body of the above steps may be a server, a terminal, or the like, but is not limited thereto.
In the solution provided in step S202, the first physical node may be, but is not limited to, an entity device in the network, such as a physical computer, a router, a switch, or other network devices.
Alternatively, in the present embodiment, the target task to be executed may be, but is not limited to, a task that can be executed on a physical machine such as a test product, a creation server, or the like; the target task to be performed may be, but is not limited to, one or more tasks.
Alternatively, in this embodiment, the CPU resources of the virtual machine a (i.e., the target virtual machine) may be, but are not limited to, initially allocated on the physical machine a (i.e., the first physical node), and assuming that the CPU cores using the physical machine a are CPU1, CPU2, …, CPU ux, and X total cores may be marked as exclusive identifiers, and other virtual machines deployed on the physical machine a cannot use these CPU core resources.
Alternatively, in this embodiment, the number of CPU cores that need to be used to obtain the target task to be executed on the virtual machine a deployed on the physical node a may be, but is not limited to, M.
In one exemplary embodiment, the target task to be performed on the target virtual machine deployed on the first physical node may be obtained, but is not limited to, in one of the following ways: acquiring all tasks to be executed on the target virtual machine as target tasks; acquiring candidate tasks in all tasks to be executed on the target virtual machine as the target tasks, wherein the candidate tasks are other tasks except the tasks which are distributed to a first processing resource for executing on the target virtual machine, and the first processing resource is the processing resource distributed to the target virtual machine on the first physical node; acquiring a first reference task in all tasks to be executed on the target virtual machine as the target task, wherein the first reference task is other tasks except for tasks which are distributed to a second processing resource to be executed in all tasks, and the second processing resource is an idle processing resource except for the processing resource distributed to the target virtual machine on the first physical node; and acquiring a second reference task from candidate tasks in all tasks to be executed on the target virtual machine as the target task, wherein the candidate tasks are other tasks except the tasks which are distributed to the first processing resources and executed on the target virtual machine, the second reference task is the other tasks except the tasks which are distributed to the second processing resources and executed on the candidate tasks, the first processing resources are the processing resources distributed to the target virtual machine on the first physical node, and the second processing resources are idle processing resources except the first processing resources on the first physical node.
Alternatively, in the present embodiment, without executing the tasks using the CPU resources on the physical machine a, all the tasks to be executed on the virtual machine a may be acquired as target tasks, but are not limited to.
Alternatively, in the present embodiment, in the case where the idle CPU resource allocated to the virtual machine a on the physical machine a is used to execute the tasks other than the candidate task among all the tasks, the candidate task among all the tasks to be executed on the virtual machine a may be acquired as the target task, but is not limited to.
Alternatively, in the present embodiment, in the case where the idle CPU resources allocated to the other virtual machines except the virtual machine a on the physical machine a are used to execute the other tasks except the first reference task among all the tasks, the first reference task among all the tasks to be executed on the virtual machine a may be acquired as the target task, but is not limited to.
Alternatively, in the present embodiment, in the case where not only the other tasks than the task candidate among all the tasks to be executed by using the idle CPU resources allocated to the virtual machine a on the physical machine a but also the other tasks than the second reference task among the task candidate to be executed by using the idle CPU resources allocated to the virtual machine other than the virtual machine a on the physical machine a, the second reference task may be acquired as the target task, but is not limited to, from among the task candidate among all the tasks to be executed on the target virtual machine.
In the technical solution provided in step S204, the physical node cluster may be, but is not limited to, a cluster formed by a plurality of physical nodes such as physical machines or switches that allow the first physical node to occupy processing resources, which may be, but is not limited to, deploying virtualization software, and providing virtual machines for users.
Alternatively, in the present embodiment, the second physical node may be, but is not limited to, an entity device in the network, such as a physical computer, router, switch, or other network device. The second physical node may be, but is not limited to being, one or more physical nodes that allow processing resources to be occupied by the first physical node.
Alternatively, in the present embodiment, the idle processing resources may be, but are not limited to, CPU resources that do not perform tasks.
In one exemplary embodiment, a second physical node with idle processing resources may be found from a cluster of physical nodes, but is not limited to, in the following manner: searching a target physical node, of which the resource quantity of the idle processing resources meets the task quantity of the target task, from the physical node cluster to serve as the second physical node; and under the condition that the target physical node is not found, determining all physical nodes with the idle processing resources in the physical node cluster as the second physical node.
Alternatively, in the present embodiment, the amount of resources of the idle processing resources may be, but is not limited to, the number of cores of CPU resources that do not perform tasks.
Alternatively, in the present embodiment, the task amount of the target task may be, but is not limited to, the number of cores of the CPU resource that are required to be used to execute the target task.
Alternatively, in this embodiment, the second physical node having the idle processing resource may be searched by, but not limited to, scanning the physical nodes having the idle CPU resource and the resource amounts of the idle CPU resources thereof in the physical node cluster, thereby determining whether the resource amounts of the idle CPU resources of the physical nodes having the idle CPU resources satisfy the task amounts of the target task.
Optionally, in this embodiment, the situation that the target physical node is not found may be, but is not limited to, that the sum of the resource amounts of all physical nodes with idle CPU resources in the physical node cluster does not satisfy the task amount of the target task, which indicates that the CPU computing resources in the physical node cluster cannot completely satisfy the target task, and the corresponding task number may be allocated to all idle CPU resources according to the maximum usage principle, and the remaining tasks that are not allocated yet wait, and when the CPU resources of the tasks are to be completed, the remaining tasks are preferentially allocated, and then calculated until all the target tasks are completed.
In an exemplary embodiment, a target physical node whose resource amount of the idle processing resource satisfies the task amount of the target task may be searched from the physical node cluster as the second physical node in the following manner, but is not limited to: and searching the target physical nodes with the minimum resource quantity meeting the task quantity from the physical node cluster to serve as the second physical nodes.
Optionally, in this embodiment, the number of CPU cores that needs to be used by the target task may be set to be M, the number of idle CPU cores of the virtual machine a may be set to be N, the number of idle CPU cores that belong to the physical machine a but not to the virtual machine a may be set to be L, and the number of idle CPU cores of any other single physical node in the physical nodes may be set to be S.
Alternatively, in this embodiment, in the case where n+l < M, it indicates that physical machine a does not have enough CPU resources for virtual machine a to use. At this time, the physical node which is idle and does not allocate CPU resources in the cluster is scanned, if N+L+S is more than or equal to M, the scanning is stopped, the physical node is confirmed to meet the capacity expansion requirement, and the physical node is assumed to be B, and at this time, the second physical node is assumed to be physical node B; if n+l+s < M, it indicates that there is no other single physical machine in the physical node cluster that can meet the task amount of the target task, and at this time, the number of idle CPUs of each physical machine is recorded, for example, sb for physical machine B, sc for physical machine C. The resource amounts of the physical machines B and C are the minimum number of target physical nodes satisfying the task amounts of the target tasks, and the second physical nodes are the physical machines B and C at this time.
In one exemplary embodiment, the target physical node whose resource amount satisfies the minimum number of task amounts may be searched from the physical node cluster as the second physical node in the following manner, but is not limited to: arranging and combining physical nodes in the physical node cluster to obtain one or more groups of physical node combinations with the resource quantity meeting the task quantity; determining a group of the physical node combinations as the target physical node under the condition that the group of the physical node combinations is obtained; and under the condition that a plurality of groups of physical node combinations are obtained, determining the physical node combination with the minimum physical node number and the maximum resource amount in the plurality of groups of physical node combinations as the target physical node.
Alternatively, in the present embodiment, it is possible, but not limited to, using a permutation and combination algorithm, to find the minimum number of physical nodes whose resource amount satisfies the task amount in all permutation and combinations, and to obtain one or more groups of physical node combinations that satisfy the minimum number of physical nodes; under the condition that a group of physical node combinations are obtained, the group of physical node combinations are used as target physical nodes; under the condition that a plurality of groups of physical node combinations are obtained, if the combinations with the same number of nodes exist, selecting the node array with the largest CPU free sum as a target physical node, and if the CPU free sum is still the same, randomly selecting one group of physical node combinations from the combinations as the target physical node.
In an alternative embodiment, a flow chart of a task execution method of a virtual machine is provided, and fig. 3 is a flow chart of a task execution method of a virtual machine according to an alternative embodiment of the present application, as shown in fig. 3, firstly, whether idle CPU resources of a virtual machine a (i.e. a target virtual machine) are enough to execute a target task is judged, if the idle CPU resources of the virtual machine a are enough to execute the target task, it indicates that CPU computing resources are sufficient, the virtual machine a does not need to perform expansion of CPU resources, and the target task is allocated to M idle CPU cores of the virtual machine a and is normally completed; if the idle CPU resource of the virtual machine A is insufficient to execute the target task, judging whether the idle CPU resource of the physical machine A (namely the local physical node) is sufficient to execute the target task, if the idle CPU resource of the physical machine A is sufficient to execute the target task, indicating that the CPU computing resource of the physical machine A is sufficient, expanding the capacity in the physical machine A, and distributing the target task to idle CPU cores on the physical machine A and normally completing the task; if the idle CPU resources of the physical machine A are insufficient to execute the target task, judging whether the idle CPU resources of other physical nodes in the physical node cluster are sufficient to execute the target task, if the idle CPU resources of other physical nodes in the physical node cluster are sufficient to execute the target task, judging whether the idle CPU resources of a single physical node in the other physical nodes are sufficient to execute the target task, if the idle CPU resources of the single physical node in the other physical nodes are sufficient to execute the target task, expanding capacity on the single physical node and the physical machine A which meet the condition, and distributing the target task to the single physical node and the idle CPU core on the physical machine A which meet the condition; if the idle CPU resources of other physical nodes in the physical node cluster are insufficient to execute the target task or if the idle CPU resources of a single physical node are not sufficient to execute the target task in other physical nodes, judging whether the minimum physical node number resources are sufficient to execute the target task, if the minimum physical node number resources are sufficient to execute the target task, expanding capacity on the physical machine A and the physical node combination of the minimum physical node number meeting the condition, and completing the idle CPU cores on the physical machine A allocated to the physical node combination of the minimum physical node number meeting the condition by the target task; if the minimum physical node number resource is insufficient to execute the target task, the capacity of the target task is expanded on all other physical nodes and the physical machine A, and the target task is distributed to all other physical nodes and idle CPU cores on the physical machine A to finish.
In the solution provided in step S206, the target processing resource may include, but is not limited to, one or more CPU resources.
In one exemplary embodiment, the target task may be allocated to a target processing resource of the idle processing resources, but is not limited to, in the following manner: acquiring the target processing resource from the idle processing resource; marking a target identifier corresponding to the target virtual machine for the target processing resource, wherein the target identifier is used for indicating that the target processing resource is set to be only allowed to be called by the target virtual machine; and distributing the target task to the target processing resource marked with the target identifier.
Optionally, in this embodiment, if the local physical node a (i.e. the first physical node) CPU has sufficient processing resources, the M CPU cores are locked by using the capacity expansion process, N idle CPU cores of the virtual machine a are marked as use identifiers, the virtual machine CPU resources are expanded at the same time, M-N idle CPU cores on the physical machine a are marked as capacity expansion identifiers, the virtual machine a is marked as temporary capacity expansion of the CPU resources, and tasks are allocated to the M CPU resources. Before starting the calculation, the capacity expansion process is stopped, the task process is started, and the CPU resources are used for calculation.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of the single physical node B are scanned to be sufficient, the M CPU cores are locked by using the capacity expansion process, at this time, the N idle CPU cores of the virtual machine a are marked as use identifiers, the virtual machine CPU resources are expanded, the L idle CPU cores on the physical machine a are marked as capacity expansion identifiers, the M-N-L idle cores on the physical machine B are marked as capacity expansion identifiers, the virtual machine a is marked as temporary capacity expansion of the CPU resources, and tasks are allocated to the M idle CPU resources. Because CPU resources are distributed across the physical machines A and B, computing tasks are distributed across the physical machines, N tasks are distributed to N idle CPU cores of the virtual machine A for computing, L tasks are distributed to L idle CPU cores of the physical machine A for computing.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of other individual physical nodes are also insufficient, it is assumed that a group of physical nodes whose found resource quantity satisfies the minimum number of physical nodes of the task quantity is combined into a physical machine Sb, a physical machine Sc, …, a physical machine Sx, and the M CPU cores are locked by using a capacity expansion process, where the N idle CPU cores of the virtual machine a are marked as usage identifiers, and the virtual machine CPU resources are expanded, the L idle CPU cores on the physical machine a are marked as capacity expansion identifiers, the (M-N-L) idle CPU cores on the physical machine B are marked as capacity expansion identifiers, identifying the (M-N-L) idle cores on the physical machine C as capacity expansion identifiers, wherein Sc/(Sb+Sc+ … +Sx) idle cores on the physical machine C are identified as capacity expansion identifiers, identifying the (M-N-L) idle cores on the physical machine X as capacity expansion identifiers, marking the virtual machine A as CPU resource temporary capacity expansion, distributing tasks to the N idle CPU resources, distributing the task number of N+L to the local physical machine A for calculation, distributing the task number of M-N-L to the physical machines B, C, … and Sx, wherein the task number distribution principle is that the task number of the physical machine B is (M-N-L) Sb/(Sb+Sc+ … +Sx), the task number of the physical machine C is (M-N-L) Sc/(Sb+Sc+ … +Sx), …, the task number of the physical machine X is (M-N-L) Sx/(Sb+Sc+ … +Sx), before starting calculation, the capacity expansion process is stopped, the task process is started, and M CPU resources are used for calculation.
In an exemplary embodiment, after the obtaining the execution result of the target task returned by the target processing resource, the following manner may be adopted, but is not limited to: withdrawing the target identifier marked on the target processing resource; and adding the target processing resource of which the target identification is revoked to the idle processing resource.
Optionally, in this embodiment, if the local physical node a (i.e. the first physical node) has sufficient CPU processing resources, after all the target tasks are executed, the N CPU cores of the virtual machine a (i.e. the target virtual machine) may be marked as unused identifiers, the M-N CPU cores on the physical node a are marked as unallocated identifiers, the expanded CPU resources are released, and the virtual machine a is marked as CPU expanded resources are recovered.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of the single physical node B are scanned to be sufficient, after the target task is completely executed, the N CPU cores of the virtual machine a may be marked as unused identifiers, the L CPU cores on the physical machine a and the M-N-L CPU cores on the physical machine B may be marked as unallocated identifiers, the expanded CPU resources may be released, and the virtual machine a may be marked as CPU expanded resources recovered.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of other single physical nodes are also insufficient, if a group of physical nodes whose found resource quantity satisfies the minimum physical node quantity of the task quantity is combined into the physical machine Sb, the physical machine Sc, …, and the physical machine Sx, after the target task is completely executed, the N CPU cores of the virtual machine a may be marked as unused identifiers, the L CPU cores on the marker mechanism a, the physical machines B, C, …, and the M-N-L CPU cores on the X are unallocated identifiers, the expanded CPU resources are released, and the virtual machine a is marked as the CPU expanded resources being recovered.
In one exemplary embodiment, the target task may be allocated to a target processing resource of the idle processing resources, but is not limited to, in the following manner: transmitting task data of the target task to the target processing resource; and sending an execution instruction of the target task to the target processing resource, wherein the target processing resource is used for executing the target task by using the task data in response to the execution instruction.
Alternatively, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of the single physical node B are scanned sufficiently, task data corresponding to M-N-L computing tasks may be, but not limited to, transferred to the disk storage of the physical machine B; and sending an execution instruction of the target task to the physical machine B.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of other single physical nodes are also insufficient, it is assumed that a group of physical nodes with the minimum number of physical nodes whose found resource quantity satisfies the task quantity are combined into a physical machine Sb, a physical machine Sc, …, and a physical machine Sx, and the data of the corresponding task may be, but not limited to, transmitted to the disk storage of the corresponding physical machines B, C, …, and X, respectively; the execution instruction of the target task is sent to each of the physical machines B, C, …, and X.
In one exemplary embodiment, task data for the target task may be transferred to the target processing resource in a manner that includes, but is not limited to: and storing the task data into a storage space on the second physical node, and obtaining a first storage address of the task data.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of the single physical node B are scanned sufficiently, task data corresponding to M-N-L computing tasks may be copied to the disk storage of the physical machine B, physical address information of the data information in the disk storage is recorded, and meanwhile, the M-N-L computing tasks are allocated to the CPU identified as the capacity expansion identifier on the physical machine B, where the M-N-L CPU resources find relevant data according to the physical address information of the acquired data in the disk, and perform calculation.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of other individual physical nodes are also insufficient, it is assumed that a group of physical nodes with the minimum number of physical nodes whose found resource quantity satisfies the task quantity are combined into a physical machine Sb, a physical machine Sc, …, and a physical machine Sx, and the data corresponding to the task may be copied into the disk storage corresponding to the physical machines B, C, …, and X, and the physical address information of the corresponding data is recorded, and the physical machines B, C, …, and X find the relevant data according to the physical address information of the acquired data in the disk, and calculate.
In one exemplary embodiment, the execution instructions of the target task may be sent to the target processing resource in the following manner, including: and sending the execution instruction carrying the first storage address to the target processing resource, wherein the target processing resource is used for responding to the execution instruction to read the task data from the first storage address to execute the target task.
Alternatively, in the present embodiment, if the CPU processing resources of the local physical node a are insufficient and the CPU resources of the single physical node B are scanned, the execution instruction of the first memory address carrying M-N-L computing tasks may be, but not limited to, sent to the physical node B.
Alternatively, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of other individual physical nodes are also insufficient, it is assumed that a group of physical nodes whose found resource amount satisfies the minimum number of physical nodes of the task amount are combined into the physical machine Sb, the physical machine Sc, …, and the physical machine Sx, and the execution instruction of the first storage address carrying (M-N-L) Sb/(sb+sc+ … +sx) computing tasks may be sent to the physical machine Sb, the execution instruction of the first storage address carrying (M-N-L) Sc/(sb+sc+ … +sx) computing tasks may be sent to the physical machine Sc.
In the technical solution provided in step S208, the execution result of the target task may be, but is not limited to, task data returned by the target processing resource.
In one exemplary embodiment, the execution result of the target task returned by the target processing resource may be obtained by, but is not limited to, the following manner: receiving response information returned by the target processing resource in response to the target task, wherein the response information carries a second storage address, and the second storage address is used for indicating the target processing resource to store the execution result to a storage position in a storage space on the first physical node; reading the execution result from the second memory address.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of the single physical node B are scanned enough, the method may, but is not limited to, copy the corresponding result data on the physical machine B to the disk storage on the physical machine a, record the storage address information of the result data on the physical machine a, synchronize the information to the CPU resources of N, L, and after N, L all completes the corresponding calculation task, find and read the corresponding data according to the physical address of the result data by the CPU resources of n+l, and combine and output the corresponding data.
Optionally, in this embodiment, if the CPU processing resources of the local physical node a are insufficient, and the CPU resources of other single physical nodes are also insufficient, it is assumed that a group of physical nodes with the minimum number of physical nodes whose found resource quantity satisfies the task quantity are combined into the physical machines Sb, sc, …, sx, which may, but is not limited to, copy the result data of the physical machines B, C, …, X into the disk storage on the physical machine a, record the storage address information of the result data on the physical machine a, synchronize the information into the CPU resources of N, L, and after all the N, L completes the corresponding calculation tasks, the n+l CPU resources find and read the corresponding data according to the physical addresses of the result data transferred by the physical machines B, C, …, X, and combine and output the corresponding data.
In an alternative embodiment, an architecture of a task execution method of a virtual machine is provided, fig. 4 is an architecture diagram of a task execution method on a virtual machine according to an alternative embodiment of the present application, as shown in fig. 4, a physical node cluster includes a host a, a host B, and a host C, a first physical node is the host a, a second physical node is the host B and the host C, a target virtual machine is the virtual machine a, target processing resources are a CPU0 in the host a, a CPU1, a CPU0 in the host B, and a CPU0 in the host C, and target tasks include a task 1, a task 2, a task 3, and a task 4. Obtaining a target task to be executed on a virtual machine A deployed on a host A: task 1, task 2, task 3, task 4; searching a host B and a host C with idle processing resources from a physical node cluster to serve as a second physical node; task 1 is assigned to CPU0 on host A, task 2 is assigned to CPU1 on host A, task 3 is assigned to CPU0 on host B, and task 4 is assigned to CPU0 on host C; the method comprises the steps of acquiring an execution result 1 of a task 1 returned by a CPU0 on a host A, an execution result 2 of a task 2 returned by the CPU1 on the host A, an execution result 3 of a task 3 returned by the CPU0 on a host B and an execution result 4 of a task 4 returned by the CPU0 on a host C.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
The embodiment also provides a task execution device on a virtual machine, which is used for implementing the above embodiment and the preferred implementation manner, and the description is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 5 is a block diagram of a task execution device on a virtual machine according to an embodiment of the present application, as shown in FIG. 5, the device includes:
the first obtaining module 52 is configured to obtain a target task to be executed on a target virtual machine deployed on a first physical node;
a searching module 54, configured to search for a second physical node with idle processing resources from a physical node cluster, where the physical node cluster includes a plurality of physical nodes that allow the first physical node to occupy processing resources;
an allocation module 56, configured to allocate the target task to a target processing resource in the idle processing resources, where the target processing resource is used to execute the target task;
and a second obtaining module 58, configured to obtain an execution result of the target task returned by the target processing resource.
Through the device, the target task to be executed on the target virtual machine deployed on the first physical node is firstly obtained, then the second physical node with idle processing resources is searched from the physical node cluster comprising a plurality of physical nodes allowing the first physical node to occupy the processing resources, so that the target task to be executed is distributed to the target processing resources used for executing the target task in the idle processing resources, and finally the execution result of the target task returned by the target processing resources is obtained. That is, by searching the second physical node which has idle processing resources and allows the first physical node to occupy the processing resources in the physical node cluster, and then distributing the target task to be executed to the target processing resources for processing, the task is executed by the virtual machine across the physical nodes, the idle processing resources of other physical nodes in the physical node cluster are fully utilized, and the resource utilization efficiency of the virtual machine when executing the task is maximized. Therefore, the problem of low resource utilization efficiency when the virtual machine executes the task is solved, and the effect of improving the resource utilization efficiency when the virtual machine executes the task is achieved.
In an exemplary embodiment, the first acquisition module includes one of:
the first acquisition unit is used for acquiring all tasks to be executed on the target virtual machine as target tasks;
a second obtaining unit, configured to obtain, as the target task, a candidate task of all tasks to be executed on the target virtual machine, where the candidate task is another task of the all tasks except a task allocated to be executed on a first processing resource, and the first processing resource is a processing resource allocated to the target virtual machine on the first physical node;
a third obtaining unit, configured to obtain, as the target task, a first reference task of all tasks to be executed on the target virtual machine, where the first reference task is another task of the all tasks except a task allocated to a second processing resource to be executed on the target virtual machine, and the second processing resource is an idle processing resource on the first physical node except a processing resource allocated to the target virtual machine;
a fourth obtaining unit, configured to obtain, as the target task, a second reference task from candidate tasks in all tasks to be executed on the target virtual machine, where the candidate tasks are other tasks in the all tasks except tasks allocated to be executed on a first processing resource, the second reference task is another task in the candidate tasks except tasks allocated to be executed on a second processing resource, the first processing resource is a processing resource allocated to the target virtual machine on the first physical node, and the second processing resource is an idle processing resource on the first physical node except the first processing resource.
In an exemplary embodiment, the search module includes:
a searching unit, configured to search, from the physical node cluster, a target physical node, where a resource amount of the idle processing resource meets a task amount of the target task, as the second physical node;
and the determining unit is used for determining all physical nodes with the idle processing resources in the physical node cluster as the second physical node under the condition that the target physical node is not found.
In an exemplary embodiment, the search unit is configured to: and searching the target physical nodes with the minimum resource quantity meeting the task quantity from the physical node cluster to serve as the second physical nodes.
In an exemplary embodiment, the search unit is further configured to: arranging and combining physical nodes in the physical node cluster to obtain one or more groups of physical node combinations with the resource quantity meeting the task quantity; determining a group of the physical node combinations as the target physical node under the condition that the group of the physical node combinations is obtained; and under the condition that a plurality of groups of physical node combinations are obtained, determining the physical node combination with the minimum physical node number and the maximum resource amount in the plurality of groups of physical node combinations as the target physical node.
In one exemplary embodiment, the allocation module includes:
a fifth obtaining unit, configured to obtain the target processing resource from the idle processing resource;
the marking unit is used for marking the target identifier corresponding to the target virtual machine for the target processing resource, wherein the target identifier is used for indicating that the target processing resource is set to be only allowed to be called by the target virtual machine;
and the allocation unit is used for allocating the target task to the target processing resource marked with the target identifier.
In an exemplary embodiment, the apparatus further comprises:
the revocation module is used for revokeing the target identifier marked on the target processing resource after the execution result of the target task returned by the target processing resource is obtained;
and the adding module is used for adding the target processing resource of which the target identifier is cancelled to the idle processing resource after the execution result of the target task returned by the target processing resource is acquired.
In an exemplary embodiment, the allocation module further comprises:
the transmission unit is used for transmitting the task data of the target task to the target processing resource;
And the sending unit is used for sending the execution instruction of the target task to the target processing resource, wherein the target processing resource is used for responding to the execution instruction and executing the target task by using the task data.
In one exemplary embodiment of the present invention,
the transmission unit is used for: storing the task data into a storage space on the second physical node, and obtaining a first storage address of the task data;
the sending unit is configured to: and sending the execution instruction carrying the first storage address to the target processing resource, wherein the target processing resource is used for responding to the execution instruction to read the task data from the first storage address to execute the target task.
In an exemplary embodiment, the second acquisition module includes:
the receiving unit is used for receiving response information returned by the target processing resource in response to the target task, wherein the response information carries a second storage address, and the second storage address is used for indicating the target processing resource to store the execution result to a storage position in a storage space on the first physical node;
And the reading unit is used for reading the execution result from the second storage address.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Embodiments of the present application also provide an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application should be included in the protection scope of the present application.

Claims (13)

1. A method for executing tasks on a virtual machine, comprising:
acquiring a target task to be executed on a target virtual machine deployed on a first physical node;
searching a second physical node with idle processing resources from a physical node cluster, wherein the physical node cluster comprises a plurality of physical nodes which are allowed to occupy the processing resources by the first physical node;
distributing the target task to a target processing resource in the idle processing resources, wherein the target processing resource is used for executing the target task;
and acquiring an execution result of the target task returned by the target processing resource.
2. The method of claim 1, wherein the locating a second physical node from the cluster of physical nodes that has free processing resources comprises:
searching a target physical node, of which the resource quantity of the idle processing resources meets the task quantity of the target task, from the physical node cluster to serve as the second physical node;
And under the condition that the target physical node is not found, determining all physical nodes with the idle processing resources in the physical node cluster as the second physical node.
3. The method according to claim 2, wherein said searching for a target physical node from the physical node cluster, for which the resource amount of the idle processing resource satisfies the task amount of the target task, as the second physical node, comprises:
and searching the target physical nodes with the minimum resource quantity meeting the task quantity from the physical node cluster to serve as the second physical nodes.
4. A method according to claim 3, wherein said finding, from said cluster of physical nodes, a minimum number of said target physical nodes for which said resource quantity meets said task quantity, as said second physical node, comprises:
arranging and combining physical nodes in the physical node cluster to obtain one or more groups of physical node combinations with the resource quantity meeting the task quantity;
determining a group of the physical node combinations as the target physical node under the condition that the group of the physical node combinations is obtained;
And under the condition that a plurality of groups of physical node combinations are obtained, determining the physical node combination with the minimum physical node number and the maximum resource amount in the plurality of groups of physical node combinations as the target physical node.
5. The method of claim 1, wherein said assigning the target task to a target one of the idle processing resources comprises:
acquiring the target processing resource from the idle processing resource;
marking a target identifier corresponding to the target virtual machine for the target processing resource, wherein the target identifier is used for indicating that the target processing resource is set to be only allowed to be called by the target virtual machine;
and distributing the target task to the target processing resource marked with the target identifier.
6. The method of claim 5, wherein after the obtaining the execution result of the target task returned by the target processing resource, the method further comprises:
withdrawing the target identifier marked on the target processing resource;
and adding the target processing resource of which the target identification is revoked to the idle processing resource.
7. The method of claim 1, wherein said assigning the target task to a target one of the idle processing resources comprises:
transmitting task data of the target task to the target processing resource;
and sending an execution instruction of the target task to the target processing resource, wherein the target processing resource is used for executing the target task by using the task data in response to the execution instruction.
8. The method of claim 7, wherein the step of determining the position of the probe is performed,
the transmitting task data of the target task to the target processing resource includes: storing the task data into a storage space on the second physical node, and obtaining a first storage address of the task data;
the sending the execution instruction of the target task to the target processing resource comprises the following steps: and sending the execution instruction carrying the first storage address to the target processing resource, wherein the target processing resource is used for responding to the execution instruction to read the task data from the first storage address to execute the target task.
9. The method according to claim 1, wherein the obtaining the execution result of the target task returned by the target processing resource includes:
Receiving response information returned by the target processing resource in response to the target task, wherein the response information carries a second storage address, and the second storage address is used for indicating the target processing resource to store the execution result to a storage position in a storage space on the first physical node;
reading the execution result from the second memory address.
10. The method of claim 1, wherein the obtaining the target task to be performed on the target virtual machine deployed on the first physical node comprises one of:
acquiring all tasks to be executed on the target virtual machine as target tasks;
acquiring candidate tasks in all tasks to be executed on the target virtual machine as the target tasks, wherein the candidate tasks are other tasks except the tasks which are distributed to a first processing resource for executing on the target virtual machine, and the first processing resource is the processing resource distributed to the target virtual machine on the first physical node;
acquiring a first reference task in all tasks to be executed on the target virtual machine as the target task, wherein the first reference task is other tasks except for tasks which are distributed to a second processing resource to be executed in all tasks, and the second processing resource is an idle processing resource except for the processing resource distributed to the target virtual machine on the first physical node;
And acquiring a second reference task from candidate tasks in all tasks to be executed on the target virtual machine as the target task, wherein the candidate tasks are other tasks except the tasks which are distributed to the first processing resources and executed on the target virtual machine, the second reference task is the other tasks except the tasks which are distributed to the second processing resources and executed on the candidate tasks, the first processing resources are the processing resources distributed to the target virtual machine on the first physical node, and the second processing resources are idle processing resources except the first processing resources on the first physical node.
11. A task execution device on a virtual machine, comprising:
the first acquisition module is used for acquiring a target task to be executed on a target virtual machine deployed on a first physical node;
a searching module, configured to search for a second physical node with idle processing resources from a physical node cluster, where the physical node cluster includes a plurality of physical nodes allowed to occupy processing resources by the first physical node;
the allocation module is used for allocating the target task to a target processing resource in the idle processing resources, wherein the target processing resource is used for executing the target task;
And the second acquisition module is used for acquiring an execution result of the target task returned by the target processing resource.
12. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program, when being executed by a processor, implements the steps of the method according to any of the claims 1 to 10.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method as claimed in any one of claims 1 to 10 when the computer program is executed.
CN202310331308.3A 2023-03-30 2023-03-30 Task execution method and device on virtual machine, storage medium and electronic equipment Pending CN116501487A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310331308.3A CN116501487A (en) 2023-03-30 2023-03-30 Task execution method and device on virtual machine, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310331308.3A CN116501487A (en) 2023-03-30 2023-03-30 Task execution method and device on virtual machine, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116501487A true CN116501487A (en) 2023-07-28

Family

ID=87322217

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310331308.3A Pending CN116501487A (en) 2023-03-30 2023-03-30 Task execution method and device on virtual machine, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116501487A (en)

Similar Documents

Publication Publication Date Title
US11704144B2 (en) Creating virtual machine groups based on request
CN110096336B (en) Data monitoring method, device, equipment and medium
KR101090651B1 (en) Virtual machine monitor and multi-processor system
CN107368426B (en) Test method and test device
CN107969153B (en) Resource allocation method and device and NUMA system
CN110427386B (en) Data processing method, device and computer storage medium
CN110635944A (en) Cluster network configuration method and device, electronic equipment and storage medium
CN109597903B (en) Image file processing apparatus and method, file storage system, and storage medium
CN116244229B (en) Access method and device of hardware controller, storage medium and electronic equipment
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
CN113849260A (en) Instance processing core allocation method and device
CN114556309A (en) Memory space allocation method and device and storage medium
CN114153549A (en) Virtual machine creation method and related equipment
CN112631994A (en) Data migration method and system
CN116501487A (en) Task execution method and device on virtual machine, storage medium and electronic equipment
CN109976881B (en) Transaction identification method and apparatus, storage medium, and electronic apparatus
CN114490083A (en) CPU resource binding method and device, storage medium and electronic device
CN115150268A (en) Network configuration method and device of Kubernetes cluster and electronic equipment
CN110362575B (en) Method and device for generating global index of data
CN113905252A (en) Data storage method and device for live broadcast room, electronic equipment and storage medium
CN114281516A (en) Resource allocation method and device based on NUMA attribute
CN113301087A (en) Resource scheduling method, device, computing equipment and medium
JP6339978B2 (en) Resource allocation management device and resource allocation management method
CN117692322B (en) Network card configuration method and device, electronic equipment and storage medium
CN116483740B (en) Memory data migration method and device, storage medium and electronic device

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