WO2022247698A1 - 资源配置方法和装置、电子设备及计算机可读存储介质 - Google Patents

资源配置方法和装置、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2022247698A1
WO2022247698A1 PCT/CN2022/093506 CN2022093506W WO2022247698A1 WO 2022247698 A1 WO2022247698 A1 WO 2022247698A1 CN 2022093506 W CN2022093506 W CN 2022093506W WO 2022247698 A1 WO2022247698 A1 WO 2022247698A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
thread
computing
resource
running
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.)
Ceased
Application number
PCT/CN2022/093506
Other languages
English (en)
French (fr)
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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Publication of WO2022247698A1 publication Critical patent/WO2022247698A1/zh
Priority to US18/518,277 priority Critical patent/US20240086228A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Definitions

  • the present application relates to the technical field of virtualization, and in particular to a resource configuration method and device, electronic equipment, and a computer-readable storage medium.
  • each virtual machine exists in the form of a process in the Linux system.
  • Each vCPU of the virtual machine corresponds to a thread in the virtual machine process. Called a vCPU thread.
  • the vCPU thread in the user mode When the vCPU thread in the user mode is running, it enters the non-root mode of the processor to run the virtual machine code.
  • the virtual machine executes the privileged instruction, it will exit the non-root mode for processing or simulation.
  • each vCPU thread will exclusively run on a dedicated computing core.
  • the divided vCPUs (that is, vCPU-x threads and vCPU-y threads) share and run on the same computing core as the vCPU threads of virtual machine B, and use side-channel attacks to spy on virtual machines. Machine B's privacy.
  • Embodiments of the present application provide a resource configuration method and device, electronic equipment, and a computer-readable storage medium, so as to solve the defect in the prior art that switching resources between two virtual machines needs to create a new thread.
  • an embodiment of the present application provides a resource configuration method, including:
  • the first computing resource includes at least one computing core currently used by the first virtual machine and a first thread running on the computing core;
  • the embodiment of the present application also provides a resource configuration device, including:
  • An acquisition module configured to acquire a first computing resource of the first virtual machine, wherein the first computing resource includes at least one computing core currently used by the first virtual machine and a first thread running on the computing core;
  • a receiving module configured to receive a computing resource switching instruction, wherein the computing resource switching instruction instructs to switch at least one computing core of the first virtual machine to a second virtual machine;
  • a determining module configured to determine a computing core to be switched and a corresponding first thread in the first computing resource according to the computing resource switching instruction and the first computing resource;
  • a switching module configured to switch the first thread to run the second virtual machine.
  • the embodiment of the present application also provides an electronic device, including:
  • the processor is configured to run the program stored in the memory, and execute the resource configuration method provided by the embodiment of the present application when the program runs.
  • the embodiment of the present application also provides a computer-readable storage medium, on which a computer program executable by a processor is stored, wherein, when the program is executed by the processor, the resource configuration method provided in the embodiment of the present application is implemented.
  • the computing cores to be switched to the second virtual machine According to the resource configuration method and device, electronic device, and computer-readable storage medium provided in the embodiments of the present application, according to the computing resource switching instruction and the computing resources of the first virtual machine, the computing cores to be switched to the second virtual machine
  • the thread running on it is switched to run the second virtual machine, so that when the computing resource is switched between the first virtual machine and the second virtual machine, the binding relationship between the computing core and the thread is preserved, which solves the problem in the prior art.
  • Fig. 1a is a schematic diagram according to the principle of a resource allocation solution in the prior art
  • FIG. 1b is a schematic diagram of an application scenario of a resource allocation solution provided by an embodiment of the present application
  • FIG. 2 is a flowchart of an embodiment of a resource allocation method provided by the present application
  • FIG. 3 is a flow chart of another embodiment of the resource allocation method provided by the present application.
  • FIG. 4 is a schematic structural diagram of an embodiment of a resource configuration device provided by the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of an electronic device provided by the present application.
  • Fig. 1b is a schematic diagram of an application scenario of the resource configuration solution provided by the embodiment of the present application, and the scenario shown in Fig. 1b is only one example of the principle of the technical solution of the present application.
  • the user mode is responsible for creating and managing virtual machines.
  • Each virtual machine exists in the form of a process in the Linux system.
  • the virtual machine can have multiple vCPUs (virtual central processing unit, Virtual central processing unit), each vCPU can run on a thread in a virtual machine process, called a vCPU thread.
  • vCPU thread in the user mode When the vCPU thread in the user mode is running, it enters the non-root mode of the processor to run the virtual machine code.
  • the virtual machine executes the privileged instruction, it will exit the non-root mode for processing or simulation.
  • each vCPU thread will exclusively run on a dedicated computing core.
  • FIG. Machine A is previously created based on the execution of one or more computing requirements. It can have four vCPUs and each vCPU can run on a vCPU thread, and each vCPU thread is related to the actual physical computing resources.
  • the computing cores shown in FIG. 1a are bound, so that virtual machine A, or its four vCPUs, can run on the four computing cores through their respective vCPU threads.
  • the specifications of the currently created virtual machine A will appear, that is, the utilization rate of the four vCPUs is not saturated.
  • computing resources can be divided from the existing virtual machine A, that is, a part of The CPU computing resources are used by other systems (such as building a new virtual machine). In this case, a part of the CPU is usually offlined by the virtual machine A to release physical computing core resources for the target system to run.
  • the two vCPUs running on the two threads vCPU-x and vCPU-y of virtual machine A temporarily have no computing tasks, so they can be temporarily removed from virtual machine A to create a new virtual machine B, in order to improve the utilization rate of calculation core x and y.
  • the two threads of the vCPU-y thread enter the sleep state, thereby unbinding the two threads from the physical computing cores x and y.
  • the computing cores originally running the computing tasks on vCPU-x and vCPU-y of virtual machine A are separated from the management of virtual machine A and become freely assignable computing resources, for example, can be used to create new virtual machines b.
  • virtual machine B can create its own thread to use the spare computing cores x and y.
  • the virtual machine usually needs to set the binding relationship between the thread and the corresponding computing core.
  • virtual machine B is the offline computing core of virtual machine A, for example, virtual machine B can directly reuse the vCPU-x thread and vCPU-y thread of virtual machine A with the corresponding computing core x and computing core The binding settings for core y to set the vCPU-x' threads and vCPU-y' threads created for it.
  • this embodiment of the present application proposes a resource configuration method. For example, as shown in FIG.
  • virtual machine A can still take the two virtual processors vCPU-x and vCPU-y offline, for example, mark them as unavailable, and then, different from the prior art,
  • virtual machine A does not put the two threads of vCPU-x thread and vCPU-y thread into the sleep state, but directly assigns these two threads to virtual machine B for use, while maintaining the same relationship with the physical computing core x The binding relationship with y.
  • the computing cores originally running the computing tasks on vCPU-x and vCPU-y of virtual machine A are separated from the management of virtual machine A and become used by virtual machine B, for example, by the two virtual processors of virtual machine B use. Therefore, in this case, since the vCPU-x thread (corresponding to the computing core x) and the vCPU-y thread (corresponding to the computing core y) of the virtual machine A are directly switched to the virtual machine B, therefore, it is completely omitted Multiplexing of binding settings between threads and computing cores after switching in the prior art.
  • an additional running flag can be configured for each thread to identify the thread Which virtual machine is currently running. For example, as shown in FIG. 1b, after the switch, running flags can be set respectively on the two threads of vCPU-x thread and vCPU-y thread that have been switched to use by virtual machine B to identify these two threads
  • the currently running virtual machine is virtual machine B.
  • virtual machine B can first check the running flag on each thread to determine which virtual machine should run, for example, after switching to virtual machine B, vCPU-x thread and vCPU-x thread and vCPU-x y thread
  • the running identifier on each thread of these two threads can be set to B to identify that virtual machine B is currently running, and after virtual machine B executes the current calculation cycle, it can be executed before the next calculation cycle First, for example, enter the user mode to check the running identifier, and if the running identifier still identifies virtual machine B, then virtual machine B can continue to use the two threads of vCPU-x thread and vCPU-y thread to perform the next calculation cycle .
  • the running identifiers of the two threads can be modified accordingly according to the use request of the virtual machine A. For example, as shown in Figure 1b, when virtual machine A needs to recycle these two threads, the running identifiers of these two threads can be modified to identify virtual machine A during the execution of the current calculation cycle of virtual machine B, so that when After virtual machine B executes the current calculation cycle, it confirms that these two threads need to be returned to virtual machine A by checking the running flags on these two threads, then it can terminate the next calculation cycle of virtual machine B and stop here. Virtual machine B runs on two threads.
  • virtual machine B can confirm that these two threads are used by itself by checking the running flags on these two threads, so this can be used in the next calculation cycle. The two threads are switched to virtual machine B.
  • the thread running on the computing core to be switched to the second virtual machine is switched to run the second virtual machine according to the computing resource switching instruction and the computing resources of the first virtual machine. machine, so that when computing resources are switched between the first virtual machine and the second virtual machine, the binding relationship between the computing core and the thread is retained, which solves the problem of adjusting the binding core settings of the original virtual machine in the prior art
  • the problem of synchronizing the settings of the two virtual machines greatly reduces the complexity of management and control, and since no new thread is created during the resource switching process of the two virtual machines, it is realized that the two virtual machines occupy the same Mutually exclusive operation is implemented in the thread, thereby realizing privacy isolation.
  • the resource allocation scheme according to the embodiment of the present application can not only reduce the complexity of management and control but also realize privacy isolation during virtual machine switching, so it can be applied to, for example, an e-commerce platform to improve management efficiency and avoid customer information leakage.
  • the resource configuration solution of the present application can be applied to a virtual machine system for building an e-commerce platform.
  • virtual machine A in the virtual machine system can be used to run the e-commerce platform of tenant A, and when tenant B also uses the virtual machine system to perform its own tasks, the management module of the virtual machine system The operating status found that tenant A did not have many tasks at the time, and the four computing cores occupied by its virtual machine A were still free, that is, the computing core x was idle.
  • the virtual machine system using the resource allocation scheme is As mentioned above, the virtual machine A can be offline from the thread x corresponding to the computing core x, and the thread x of the computing core x can be assigned to the tenant B for use, for example, create a virtual machine for the tenant B to use the thread x or set the Thread x joins tenant B's original virtual machine resources to run tenant B's tasks.
  • the resource allocation scheme according to the embodiment of the present application switches threads to different virtual machines in a mutually exclusive manner, that is, when switching the thread x of the computing core x to the tenant B, the tenant A’s original The e-commerce platform running on the thread x of the computing core x is offline, so the data of the e-commerce platform of the tenant A will no longer exist on the thread x, therefore, the tenant B will also use the thread x The data of tenant A's e-commerce platform will not be seen due to the residual data.
  • the resource configuration solution can help the virtual machine system running the e-commerce platform to realize flexible management and control of resources, and can also ensure the security of data on the e-commerce platform switching between virtual machine resources.
  • the resource allocation scheme according to the embodiment of the present application can not only reduce the complexity of management and control but also realize privacy isolation during virtual machine switching, so it can be applied to, for example, telecommunication transactions to improve management efficiency and avoid customer information leakage.
  • the resource configuration solution of the present application can be applied to a virtual machine system executing telecommunication transactions.
  • virtual machine A in the virtual machine system can be used to run the telecommunications business of tenant A, and when tenant B also uses the virtual machine system to perform its own tasks, the management module of the virtual machine system The situation found that tenant A did not have many tasks at that time, and the four computing cores occupied by its virtual machine A were still free, that is, the computing core x was idle.
  • the virtual machine system using the resource allocation scheme can be As mentioned above, the virtual machine A is offline from the thread x corresponding to the computing core x, and the thread x of the computing core x is assigned to the tenant B for use, for example, creating a virtual machine for the tenant B to use the thread x or the thread x is added to the original virtual machine resources of tenant B.
  • the resource allocation scheme according to the embodiment of the present application switches threads to different virtual machines in a mutually exclusive manner, that is, when switching the thread x of the computing core x to the tenant B, the tenant A’s original The telecommunication transaction running on the thread x of the computing core x is offline, so the telecommunication transaction previously run by the tenant A will no longer exist on the thread x, especially the user's data. Therefore, the tenant B is using the Thread x will not see the data of tenant A's telecommunications transaction due to the residual data.
  • the resource configuration solution can help the virtual machine system running the telecommunication transaction to realize flexible management and control of resources, and can also ensure the security of the data related to the telecommunication transaction in the resource switching of the virtual machine.
  • the resource configuration solution according to the embodiment of the present application can be applied to, for example, audio and video processing to improve processing efficiency because it can reduce management and control complexity.
  • the resource configuration solution of the present application can be applied to a virtual machine system that performs audio and video processing.
  • virtual machine A in the virtual machine system can be used to process audio and video files for tenant A, such as on-demand or streaming media, and when tenant B also uses the virtual machine system to perform its own tasks, the virtual machine system's
  • the management module finds that tenant A currently needs to process not much audio and video data, and the four computing cores occupied by its virtual machine A are still vacant, such as computing core x is idle.
  • the virtual machine system of the resource allocation scheme of the example can take the virtual machine A offline from the thread x corresponding to the computing core x as described above, and assign the thread x of the computing core x to the tenant B for use, for example, for the tenant B to use
  • the thread x creates a virtual machine or adds the thread x to tenant B's original virtual machine resources. Therefore, tenant A actually only uses three computing cores of the virtual machine system from the moment of switching, so when tenant A is billed, the resource usage fee of tenant A can be reduced accordingly, and even tenant A and tenant B When an agreement is reached, tenant A rents out its computing core x to tenant B for temporary use.
  • the resource configuration solution according to the embodiment of the present application can be applied to, for example, artificial intelligence computing to improve processing efficiency because it can reduce management and control complexity.
  • Artificial intelligence computing usually requires a large amount of computing resources. Therefore, the resource allocation solution of the present application can be applied to a virtual machine system that executes artificial intelligence processing.
  • virtual machine A in the virtual machine system can be used to perform artificial intelligence tasks for tenant A, such as model training, and when tenant B also uses the virtual machine system to perform its own tasks, the management module of the virtual machine system According to the running status of the virtual machine A, it is found that the current artificial intelligence computing tasks of the tenant A are not many, and the four computing cores occupied by the virtual machine A are still vacant, for example, the computing core x is idle.
  • the virtual machine system of the configuration scheme can take the virtual machine A offline from the thread x corresponding to the computing core x as described above, and assign the thread x of the computing core x to the tenant B for use, for example, use the thread x for the tenant B Create a virtual machine or add the thread x to the original virtual machine resource of tenant B. Therefore, tenant A actually only uses three computing cores of the virtual machine system from the moment of switching, so when tenant A is billed, the resource usage fee of tenant A can be reduced accordingly, and even tenant A and tenant B When an agreement is reached, tenant A rents out its computing core x to tenant B for temporary use.
  • the resource allocation solution according to the embodiment of the present application can be applied to, for example, an online ticketing platform to improve processing efficiency because it can reduce management and control complexity.
  • the busyness of online ticket sales largely depends on the performances or timings corresponding to the tickets to be sold, such as holidays and the like. Therefore, the resource allocation scheme of the present application can be applied to a virtual machine system running an online ticketing platform.
  • virtual machine A in the virtual machine system can be used to run an online ticketing platform for tenant A, and when tenant B also uses the virtual machine system to perform its own tasks, the day is the day when the ticket sales start for a holiday or the day of sale
  • tenant B also uses the virtual machine system to perform its own tasks
  • the day is the day when the ticket sales start for a holiday or the day of sale
  • the management module of the virtual machine system can allocate one or more computing cores from the virtual machine B for the virtual machine A to use for the virtual machine A according to the request of the virtual machine A.
  • the virtual machine system using the resource allocation scheme can temporarily assign virtual machine B to thread x and thread y corresponding to computing core x and computing core y used by virtual machine A as described above. Go offline, and assign the thread x of the computing core x and the thread y of the computing core y to the tenant A for use, that is, the thread x and the thread y are directly added to the original virtual machine resources of the tenant B.
  • Fig. 2 is a flow chart of an embodiment of the resource configuration method provided by the present application.
  • the execution subject of the method may be various terminals or server devices capable of resource configuration, or devices or chips integrated on these devices.
  • the resource configuration method includes the following steps:
  • computing resources of the virtual machine may be obtained during the running of the first virtual machine that is currently running.
  • the present application relates to the configuration of computing resources used by virtual machines between two or more virtual machines.
  • the first computing resource of the first virtual machine may be acquired first, and the first computing resource may include a computing core currently used by the first virtual machine and a first thread running on the computing core.
  • the currently running first virtual machine may be virtual machine A, and the first computing resource may be four threads of four CPUs running virtual machine A and four threads bound to the threads one by one.
  • Four physical computing cores are examples.
  • step S202 a computing resource switching instruction for the assigned resources of the current virtual machine A may be received.
  • the computing resource switching instruction received in step S202 may indicate to switch at least one computing core of the first virtual machine such as virtual machine A shown in FIG. 1b to be used by the second virtual machine such as virtual machine B.
  • S203 Determine a computing core to be switched and a corresponding first thread in the first computing resource according to the computing resource switching instruction and the first computing resource.
  • step S203 After receiving the computing resource switching instruction in step S202, in step S203, it may be determined in step S203 according to the computing resource switching instruction and the first computing resource obtained in step S201, in the first virtual machine such as virtual machine A. Computing resources need to be switched to computing cores of the second virtual machine.
  • the computing resource switching instruction received in step S202 may be to switch two of the four threads used by virtual machine A and their corresponding four computing cores to virtual machine B, and according to the It is determined that the vCPU-x thread and the vCPU-y thread are currently in an idle state according to the state of the threads and the computing cores in the first computing resource, which belong to the assignable computing resources. Therefore, in step S203, it can be confirmed that the vCPU-x thread and the vCPU-y thread are switched to the virtual machine B for use.
  • step S204 the first thread determined in step S203, for example, the vCPU-x thread and vCPU- The y thread is released from the first virtual machine, and runs a second virtual machine, such as virtual machine B, on these two threads.
  • the thread running on the computing core to be switched to the second virtual machine is switched to run the second virtual machine according to the computing resource switching instruction and the computing resources of the first virtual machine. machine, so that when computing resources are switched between the first virtual machine and the second virtual machine, the binding relationship between the computing core and the thread is retained, which solves the problem of adjusting the binding core settings of the original virtual machine in the prior art
  • the problem of synchronizing the settings of the two virtual machines greatly reduces the complexity of management and control, and since no new thread is created during the resource switching process of the two virtual machines, it is realized that the two virtual machines occupy the same Mutually exclusive operation is implemented in the thread, thereby realizing privacy isolation.
  • Fig. 3 is a flow chart of another embodiment of the resource configuration method provided by the present application.
  • the execution subject of the method may be various terminals or server devices capable of resource configuration, or devices or chips integrated on these devices.
  • the resource allocation method includes the following steps:
  • computing resources of the virtual machine may be obtained during the running of the first virtual machine that is currently running.
  • the present application relates to the configuration of computing resources used by virtual machines between two or more virtual machines.
  • the first computing resource of the first virtual machine may be acquired first, and the first computing resource may include a computing core currently used by the first virtual machine and a first thread running on the computing core.
  • the currently running first virtual machine may be virtual machine A, and the first computing resource may be four threads of four CPUs running virtual machine A and four threads bound to the threads one by one.
  • Four physical computing cores are examples.
  • step S302 a computing resource switching instruction for the assigned resources of the current virtual machine A may be received.
  • the computing resource switching instruction received in step S302 may indicate to switch at least one computing core of the first virtual machine such as virtual machine A shown in FIG. 1b to be used by the second virtual machine such as virtual machine B.
  • S303 Determine a computing core to be switched and a corresponding first thread in the first computing resource according to the computing resource switching instruction and the first computing resource.
  • the first computing resource of the first virtual machine such as virtual machine A can be determined according to the computing resource switching instruction and the first computing resource obtained in step S301.
  • Computing resources need to be switched to computing cores of the second virtual machine.
  • the computing resource switching instruction received in step S302 may be to switch two of the four threads used by virtual machine A and their corresponding four computing cores to virtual machine B, and according to the It is determined that the vCPU-x thread and the vCPU-y thread are currently in an idle state according to the state of the threads and the computing cores in the first computing resource, which belong to the assignable computing resources. Therefore, in step S303, it can be confirmed that the vCPU-x thread and the vCPU-y thread are switched to the virtual machine B for use.
  • step S304 the first thread determined in step S203, for example, the vCPU-x thread and vCPU- Thread y is disconnected from the first virtual machine, and a second virtual machine, such as virtual machine B, is run on these two threads, and the relationship between these vCPU-x threads and vCPU-y and the corresponding computing cores x and y is maintained at the same time.
  • the binding relationship among them so that the second virtual machine B can directly run its computing tasks, such as its vCPU-x' and vCPU-y', without performing any binding settings between threads and computing cores.
  • step S304 when the two threads of vCPU-x thread and vCPU-y thread of the first virtual machine A are switched to the second virtual machine B for use, in order to identify the virtual machine running by the current thread in the loop, further A running flag is configured for each of the two threads switched to identify which virtual machine the thread is currently running on. Therefore, the resource configuration method in the embodiment of the present application may further include:
  • each thread is provided with a running identifier to indicate the virtual machine the thread is currently running on
  • the thread set The running identifier is changed from A to B to indicate that the two threads have been switched to the second virtual machine B for use. Therefore, before starting the next calculation cycle after virtual machine A or B executes the current calculation cycle, the running identifier can be checked to determine which virtual machine the thread should be used by, or more specifically, which virtual machine the thread should be used by. Which virtual processor of the machine to use.
  • step S304 vCPU-x thread and vCPU-y thread are switched to virtual machine B for use and in step S305, the running identifier is modified to indicate that virtual machine B is currently running, then after virtual machine B executes the current computing cycle , before executing the next computing cycle, you can first enter the user mode to check the running flag, and if the running flag still identifies virtual machine B, it means that during the execution of the previous computing cycle of virtual machine B, there is no additional instruction
  • These two threads are required to be used by other virtual machines, so virtual machine B can continue to use the two threads vCPU-x thread and vCPU-y thread to execute the next calculation cycle.
  • the resource configuration method in the embodiment of the present application may further include:
  • step S304 virtual machine A switches the vCPU-x thread and vCPU-y thread to virtual machine B for use, so that virtual machine B can receive information from the first virtual machine in step S306 while using these two threads to perform its computing tasks.
  • A's instructions in order to add a response to virtual machine A's instructions during the use of threads switched from virtual machine A.
  • virtual machine A may send a first exit instruction to virtual machine B, and the first exit instruction may indicate that the first virtual machine A temporarily occupies the first thread. That is, virtual machine A needs to temporarily occupy the two threads switched to use by virtual machine B.
  • the virtual machine B finishes executing the current computing loop, it can exit the two threads according to the exit instruction received in step S306, and switch to the first virtual machine A for use in step S3061, especially because Virtual machine A is temporarily occupied. Therefore, in this case, the running identifiers on the two threads do not need to be modified, for example, to indicate virtual machine A, but can still be kept as indicating virtual machine B, so that After the virtual machine A finishes executing the temporarily occupied computing task, the two threads can be switched to run the second virtual machine B again in step S3062.
  • virtual machine A when virtual machine A needs to recycle the two threads, it can send a second exit instruction to virtual machine B, and thus can receive the second exit instruction in step S307, the second exit instruction can indicate, for example, the first The virtual machine recycles the first thread.
  • the virtual machine B can return the thread to the virtual machine A for use according to the instruction of the virtual machine A instructing thread recycling during the running period.
  • the run flag is set on the thread
  • Step S308 may further include:
  • the running identifiers of these two threads can be modified to identify virtual machine A during the execution of the current computing cycle by virtual machine B, so that when virtual machine B finishes executing the current computing After the cycle, confirm that these two threads need to be returned to virtual machine A by checking the running flags on these two threads, then you can terminate the next computing cycle of virtual machine B and stop running the virtual machine on these two threads b.
  • the thread running on the computing core to be switched to the second virtual machine is switched to run the second virtual machine according to the computing resource switching instruction and the computing resources of the first virtual machine. machine, so that when computing resources are switched between the first virtual machine and the second virtual machine, the binding relationship between the computing core and the thread is retained, which solves the problem of adjusting the binding core settings of the original virtual machine in the prior art
  • the problem of synchronizing the settings of the two virtual machines greatly reduces the complexity of management and control, and since no new thread is created during the resource switching process of the two virtual machines, it is realized that the two virtual machines occupy the same Mutually exclusive operation is implemented in the thread, thereby realizing privacy isolation.
  • FIG. 4 is a schematic structural diagram of an embodiment of a resource configuration device provided by the present application, which can be used to execute the method steps shown in FIG. 2 and FIG. 3 .
  • the resource configuration device may include: an acquiring module 41 , a receiving module 42 , a determining module 43 and a switching module 44 .
  • the obtaining module 41 may be used to obtain the first computing resource of the first virtual machine.
  • computing resources of the virtual machine may be obtained during the running of the first virtual machine that is currently running.
  • the present application relates to the configuration of computing resources used by virtual machines between two or more virtual machines.
  • the obtaining module 41 may first obtain the first computing resource of the first virtual machine, where the first computing resource may include a computing core currently being used by the first virtual machine and a first thread running on the computing core.
  • the currently running first virtual machine may be virtual machine A
  • the first computing resource may be four threads of four CPUs running virtual machine A and four threads bound to the threads one by one.
  • Four physical computing cores are examples.
  • the receiving module 42 may be configured to receive a computing resource switching instruction.
  • the receiving module 42 may receive a computing resource switching instruction for the assigned resources of the current virtual machine A.
  • the computing resource switching instruction received by the receiving module 42 may indicate to switch at least one computing core of the first virtual machine such as virtual machine A shown in FIG. 1b to be used by the second virtual machine such as virtual machine B.
  • the determining module 43 may be configured to determine the computing core to be switched and the corresponding first thread in the first computing resource according to the computing resource switching instruction and the first computing resource.
  • the determining module 43 can determine the first computing resource of the first virtual machine such as virtual machine A according to the computing resource switching instruction and the first computing resource acquired by the obtaining module 41. Need to switch to the computing core of the second virtual machine.
  • the computing resource switching instruction received by the receiving module 42 may be to switch two of the four threads used by the virtual machine A and the corresponding four computing cores to the virtual machine B, and according to the It is determined that the vCPU-x thread and the vCPU-y thread are currently in an idle state based on the state of the thread and the computing core in the first computing resource, which belongs to the computing resource that can be assigned. Therefore, the determining module 43 can confirm that the vCPU-x thread and the vCPU-y thread are switched to the virtual machine B for use.
  • the switching module 44 can be used to switch the first thread to run the second virtual machine.
  • the switching module 44 may use the first thread determined by the determining module 43, for example, the vCPU-x thread and the vCPU-y thread Release the usage relationship with the first virtual machine, and run the second virtual machine on these two threads, such as virtual machine B, and maintain the connection between these vCPU-x threads and vCPU-y and the corresponding computing cores x and y at the same time Binding relationship, so that the second virtual machine B can directly run its computing tasks, such as its vCPU-x' and vCPU-y', without performing any binding settings between threads and computing cores.
  • the resource configuration apparatus in the embodiment of the present application may further include: a modifying module 45, which may be configured to modify the running identifier to identify the second virtual machine.
  • each thread is provided with a running identifier to indicate the virtual machine that the thread is currently running
  • the modification module 45 can use the thread
  • the running designator set above is changed from A to B to indicate that the two threads have been switched to the second virtual machine B for use. Therefore, before starting the next calculation cycle after virtual machine A or B executes the current calculation cycle, the running identifier can be checked to determine which virtual machine the thread should be used by, or more specifically, which virtual machine the thread should be used by. Which virtual processor of the machine to use.
  • the switching module 44 switches the vCPU-x thread and the vCPU-y thread to the virtual machine B and the modification module 45 modifies the running identifier to indicate that the virtual machine B is currently running, then when the virtual machine B has executed the current computing cycle , before executing the next computing cycle, you can first enter the user mode to check the running flag, and if the running flag still identifies virtual machine B, it means that during the execution of the previous computing cycle of virtual machine B, there is no additional instruction
  • These two threads are required to be used by other virtual machines, so virtual machine B can continue to use the two threads vCPU-x thread and vCPU-y thread to execute the next calculation cycle.
  • the receiving module 42 in this embodiment of the present application may be further configured to: detect the first exit instruction from the first virtual machine.
  • the switching module 44 virtual machine A switches the vCPU-x thread and the vCPU-y thread to the virtual machine B for use, so that during the virtual machine B uses these two threads to perform its computing tasks, the receiving module 42 can receive information from the first virtual machine A. to add a response to the instruction of virtual machine A during the use of the thread switched from virtual machine A.
  • virtual machine A may send a first exit instruction to virtual machine B, and the first exit instruction may indicate that the first virtual machine A temporarily occupies the first thread. That is, virtual machine A needs to temporarily occupy the two threads switched to use by virtual machine B.
  • the switching module 44 may be further configured to: switch the first thread to run the first virtual machine, and switch the first thread to run the second virtual machine when the temporary occupation ends.
  • the switching module 44 can switch the two threads to the first virtual machine A according to the exit instruction received by the receiving module 42.
  • the virtual machine A is temporary occupation, therefore, in this case, it is not necessary to modify the running identifiers on these two threads by the modification module 45, such as modifying to indicate virtual machine A, but can still remain as indicating virtual machine B, so that After the virtual machine A finishes executing the temporarily occupied computing task, the two threads can be switched to run the second virtual machine B again through the switching module 44 .
  • the receiving module 42 may be further configured to receive a second exit instruction from the first virtual machine.
  • virtual machine A when virtual machine A needs to reclaim the two threads, it can send a second exit instruction to virtual machine B, and thus the receiving module 42 can receive the second exit instruction, which can indicate, for example, that the first virtual machine machine for recycling of the first thread.
  • the switching module 44 may be further configured to switch the first thread to run the first virtual machine.
  • the virtual machine B can return the thread to the virtual machine A for use according to the instruction of the virtual machine A instructing thread recycling during the running period.
  • the run flag is set on the thread
  • the modification module 45 may be further configured to: modify the running identifier of the first thread to identify the first virtual machine.
  • the switching module 44 may be further configured to: determine whether the current cycle of the computing core corresponding to the first thread ends.
  • the first thread is switched to run the first virtual machine according to the running identifier.
  • the modification module 45 can modify the running identifiers of the two threads to identify the virtual machine A during the execution of the current calculation cycle of the virtual machine B, so that when the virtual machine B After executing the current calculation cycle, by checking the running flags on these two threads to confirm that the two threads need to be returned to virtual machine A, then the next calculation cycle of virtual machine B can be terminated and stopped on these two threads. Run virtual machine B on it.
  • the resource configuration device switches the thread running on the computing core to be switched to the second virtual machine to run the second virtual machine according to the computing resource switching instruction and the computing resources of the first virtual machine. machine, so that when computing resources are switched between the first virtual machine and the second virtual machine, the binding relationship between the computing core and the thread is retained, which solves the problem of adjusting the binding core settings of the original virtual machine in the prior art
  • the problem of synchronizing the settings of the two virtual machines greatly reduces the complexity of management and control, and since no new thread is created during the resource switching process of the two virtual machines, it is realized that the two virtual machines occupy the same Mutually exclusive operation is implemented in the thread, thereby realizing privacy isolation.
  • FIG. 5 is a schematic structural diagram of an embodiment of an electronic device provided by the present application. As shown in FIG. 5 , the electronic device includes a memory 51 and a processor 52 .
  • the memory 51 is used to store programs. In addition to the above-mentioned programs, the memory 51 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 51 can be realized by any type of volatile or nonvolatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk any type of volatile or nonvolatile storage device or their combination
  • the processor 52 is not limited to a central processing unit (CPU), but may also be a graphics processing unit (GPU), a field-programmable gate array (FPGA), an embedded neural network processor (NPU) or an artificial intelligence (AI) chip Wait for the processing chip.
  • the processor 52 is coupled with the memory 51, and executes the program stored in the memory 51. When the program is running, the resource configuration methods of the second and third embodiments above are executed.
  • the electronic device may further include: a communication component 53 , a power supply component 54 , an audio component 55 , a display 56 and other components.
  • FIG. 5 only schematically shows some components, which does not mean that the electronic device only includes the components shown in FIG. 5 .
  • the communication component 53 is configured to facilitate wired or wireless communication between the electronic device and other devices. Electronic devices can access wireless networks based on communication standards, such as WiFi, 3G, 4G or 5G, or a combination thereof.
  • the communication component 53 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 53 also includes a near field communication (NFC) module to facilitate short-range communication.
  • NFC near field communication
  • the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wide Band
  • Bluetooth Bluetooth
  • the power supply component 54 provides power for various components of the electronic device.
  • Power supply components 54 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic devices.
  • the audio component 55 is configured to output and/or input audio signals.
  • the audio component 55 includes a microphone (MIC), which is configured to receive an external audio signal when the electronic device is in an operation mode, such as a calling mode, a recording mode and a voice recognition mode.
  • the received audio signal may be further stored in the memory 51 or sent via the communication component 53 .
  • the audio component 55 also includes a speaker for outputting audio signals.
  • the display 56 includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action.
  • the aforementioned program can be stored in a computer-readable storage medium.
  • the program executes the steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本申请公开了一种资源配置方法和装置、电子设备及计算机可读存储介质。该方法包括:获取第一虚拟机的第一计算资源;接收计算资源切换指令,其中,所述计算资源切换指令指示将所述第一虚拟机的至少一个计算核切换给第二虚拟机使用;根据所述计算资源切换指令以及所述第一计算资源确定所述第一计算资源中待切换的计算核以及对应的第一线程;将所述第一线程切换为运行所述第二虚拟机。本申请实施例在第一虚拟机和第二虚拟机之间切换计算资源时,保留了计算核与线程之间的绑定关系,解决了现有技术中由于原虚拟机的绑定核设置的调整带来的两个虚拟机的设置同步的问题,大大降低了管控的复杂度,实现了隐私隔离。

Description

资源配置方法和装置、电子设备及计算机可读存储介质
本申请要求2021年05月25日递交的申请号为202110574518.6、发明名称为“资源配置方法和装置、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及虚拟化技术领域,尤其涉及一种资源配置方法和装置、电子设备及计算机可读存储介质。
背景技术
在主流虚拟化场景(如KVM)下,用户态负责创建并管理虚拟机,每个虚拟机在Linux系统中以进程的形式存在,该虚拟机的每个vCPU对应虚拟机进程中的一个线程,称为vCPU线程。用户态的vCPU线程在运行时,进入处理器非根模式运行虚拟机代码,当虚拟机执行特权指令时,会退出非根模式进行处理或模拟。对于广泛使用的独享型虚拟机实例来说,每个vCPU线程会独占一个专用的计算核去运行。
当需要从已有的虚拟机实例中切分一部分CPU计算资源以供其他系统(比如构建一个新的机密虚拟机)使用时,一般是由虚拟机内部下线一部分CPU,让出物理计算核资源以供目标系统运行使用。
在现有技术中,首先,由于引入了新的vCPU线程,增加了资源开销。其次,由于在创建新的vCPU线程时复用了原虚拟机的已下线vCPU线程与相应计算核的绑定设置,即这两个计算核x和y仍然复用了虚拟机A对于核心和线程的设置,因此使得后期调整原虚拟机A的绑定设置时,这两个已经借给虚拟机B使用的核心x和y也需要由虚拟机B负责进行同步调整以适应虚拟机A的新的设置,因此增加了管控的复杂度。最后,如果虚拟机A遭受恶意攻击,可能强制上线已切分vCPU(即vCPU-x线程和vCPU-y线程),与虚拟机B的vCPU线程共享运行于相同计算核,利用侧信道攻击窥探虚拟机B的隐私。
发明内容
本申请实施例提供一种资源配置方法和装置、电子设备及计算机可读存储介质,以解决现有技术中在两个虚拟机之间切换资源需要创建新线程的缺陷。
为达到上述目的,本申请实施例提供了一种资源配置方法,包括:
获取第一虚拟机的第一计算资源,其中,所述第一计算资源包括所述第一虚拟机当前使用的至少一个计算核以及在该计算核上运行的第一线程;
接收计算资源切换指令,其中,所述计算资源切换指令指示将所述第一虚拟机的至少一个计算核切换给第二虚拟机使用;
根据所述计算资源切换指令以及所述第一计算资源确定所述第一计算资源中待切换的计算核以及对应的第一线程;
将所述第一线程切换为运行所述第二虚拟机。
本申请实施例还提供了一种资源配置装置,包括:
获取模块,用于获取第一虚拟机的第一计算资源,其中,所述第一计算资源包括所述第一虚拟机当前使用的至少一个计算核以及在该计算核上运行的第一线程;
接收模块,用于接收计算资源切换指令,其中,所述计算资源切换指令指示将所述第一虚拟机的至少一个计算核切换给第二虚拟机使用;
确定模块,用于根据所述计算资源切换指令以及所述第一计算资源确定所述第一计算资源中待切换的计算核以及对应的第一线程;
切换模块,用于将所述第一线程切换为运行所述第二虚拟机。
本申请实施例还提供了一种电子设备,包括:
存储器,用于存储程序;
处理器,用于运行所述存储器中存储的所述程序,所述程序运行时执行本申请实施例提供的资源配置方法。
本申请实施例还提供了一种计算机可读存储介质,其上存储有可被处理器执行的计算机程序,其中,该程序被处理器执行时实现如本申请实施例提供的资源配置方法。
本申请实施例提供的资源配置方法和装置、电子设备及计算机可读存储介质,通过根据计算资源切换指令和第一虚拟机的计算资源来将在待切换给第二虚拟机使用的计算核的其上运行的线程切换为运行第二虚拟机,从而在第一虚拟机和第二虚拟机之间切换计算资源时,保留了计算核与线程之间的绑定关系,解决了现有技术中由于原虚拟机的绑定核设置的调整带来的两个虚拟机的设置同步的问题,大大降低了管控的复杂度,并且由于在两个虚拟机的资源切换过程中没有创建新的线程,这样实现了两个虚拟机分别占用同一个线程中实现互斥运行,从而实现了隐私隔离。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1a是根据现有技术中的资源配置方案的原理示意图;
图1b为本申请实施例提供的资源配置方案的应用场景示意图;
图2为本申请提供的资源配置方法一个实施例的流程图;
图3为本申请提供的资源配置方法另一个实施例的流程图;
图4为本申请提供的资源配置装置实施例的结构示意图;
图5为本申请提供的电子设备实施例的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
实施例一
本申请实施例提供的方案可应用于任何具有资源配置能力的系统,例如包括有多个虚拟机的计算系统等等。图1b为本申请实施例提供的资源配置方案的应用场景示意图,图1b所示的场景仅仅是本申请的技术方案的原理的示例之一。
随着虚拟化计算技术发展,使得人们能够使用有限的物理计算资源执行更加灵活的各种计算任务。例如,在主流虚拟化场景(如KVM)下,用户态负责创建并管理虚拟机,每个虚拟机在Linux系统中以进程的形式存在,该虚拟机可以具有多个vCPU(virtual central processing unit,虚拟中央处理单元),每一个vCPU可以在虚拟机进程中的一个线程上运行,称为vCPU线程。用户态的vCPU线程在运行时,进入处理器非根模式运行虚拟机代码,当虚拟机执行特权指令时,会退出非根模式进行处理或模拟。对于广泛使用的独享型虚拟机实例来说,每个vCPU线程会独占一个专用的计算核去运行。
在该情况下,通常会根据当前计算任务的需要或者虚拟机规划的需要而创建虚拟机,例如,如图1a中所示,图1a是根据现有技术中的资源配置方案的原理示意图,虚拟机A是之前根据某个或多个计算需求的执行而创建的,其可以具有四个vCPU并且每个vCPU都可以分别运行在一个vCPU线程上,并且每个vCPU线程都与实际的物理计算资源,例如,图1a中所示的计算核进行绑定,从而虚拟机A,或者说其四个vCPU看就可以通过各自的vCPU线程而运行在四个计算核上。之后,随着计算任务的执行,会出现当前已经创建的虚拟机A的规格,即四个vCPU的使用率不饱和,因此,就可以从已有的虚拟机A中切分计算资源,即一部分CPU计算资源以供其他系统(比如构建一个新的虚拟机)使用,在该情况下,通常是由虚拟机A内部下线一部分CPU,以让出物理计算核资源以供目标系统运行使用。
例如,在如图1a中所示的现有技术的原理示意图中,当需要虚拟机A让出在vCPU-x和vCPU-y这两个线程对应的计算核x和y时,也就是说,在该情况下,虚拟机A的运行在vCPU-x和vCPU-y这两个线程上的两个vCPU暂时没有计算任务,因此,可以将其临时从虚拟机A卸下来创建一个新的虚拟机B,以便于提高计算核x和y的利用率。为此,在如图1a中所示的现有技术中,虚拟机A可以先将vCPU-x和vCPU-y这两个虚拟机下线,例如标记为不可用,同时使得vCPU-x线程和vCPU-y线程这两个线程进入睡眠状态,从而将这两个线程与物理计算核x和y解绑。这样,原本运行虚拟机A的vCPU-x和vCPU-y上的计算任务的计算核就脱离了虚拟机A的管理,变为可自由分配的计算资 源,例如,可以用于创建新的虚拟机B。
这时,虚拟机B就可以创建自己的线程来使用空余出来的计算核x和y。在创建线程时,通常需要虚拟机为该线程与对应的计算核之间的绑定关系进行设置。但是由于虚拟机B是直接使用的虚拟机A下线的计算核,因此,例如,虚拟机B可以直接复用虚拟机A的vCPU-x线程和vCPU-y线程与对应的计算核x和计算核y的绑定设置来设置为其创建的vCPU-x’线程和vCPU-y’线程。
但是在该情况下,由于在创建虚拟机B的上述过程中,为虚拟机B创建了新的vCPU-x’线程和vCPU-y’线程,而增加了资源开销。其次,由于在创建新的vCPU-x’线程和vCPU-y’线程时复用了原虚拟机A的已下线vCPU线程与相应计算核的绑定设置,即这两个计算核x和y仍然复用了虚拟机A对于核心和线程的设置,因此使得后期调整原虚拟机A的绑定设置时,这两个已经借给虚拟机B使用的核心x和y也需要由虚拟机B负责进行同步调整以适应虚拟机A的新的设置,即,虚拟机A需要将调整后的设置转发给虚拟机B,并且虚拟机B需要根据其vCPU-x’线程和vCPU-y’线程当前执行的计算任务而例如等待当前循环结束之后才能够更改其线程与核心的绑定设置,因此增加了管控的复杂度。此外,在如图1a中所示的现有技术中,由于虚拟机A的在将计算资源转移给虚拟机B时,仅将vCPU-x线程和vCPU-y线程进入睡眠状态而不是彻底杀掉,因此,例如在虚拟机A遭受恶意攻击而直接将这两个已进入休眠状态的vCPU-x线程和vCPU-y线程强制上线,即,在没有B将计算核x和y完成归还操作的情况下,甚至是在虚拟机B仍然在使用计算核x和y时就直接让虚拟机A的vCPU-x线程和vCPU-y线程上线,即又绑定到了计算核x和计算核y上,因此,在该情况下,计算核x和y上同时绑定了虚拟机A和虚拟机B的线程,即,虚拟机A和虚拟机B的vCPU线程共享运行于相同计算核,从而恶意攻击虚拟机A的攻击方就可以利用侧信道攻击来窥探虚拟机B的隐私。
为此,本申请实施例提出了一种资源配置方法,例如,如图1b中所示,在本申请实施例的资源配置方案中,当虚拟机A需要释放出计算核x和计算核y以将其切换给虚拟机B使用时,虚拟机A仍然是可以将vCPU-x和vCPU-y这两个虚拟处理器下线,例如标记为不可用,之后,与现有技术中不同的是,根据本申请实施例,虚拟机A没有使vCPU-x线程和vCPU-y线程这两个线程进入睡眠状态,而是将这两个线程直接分配给虚拟机B使用,同时保持与物理计算核x和y的绑定关系。因此,原本运行虚拟机A的vCPU-x和vCPU-y上的计算任务的计算核就脱离了虚拟机A的管理,变为由虚拟机B使用,例如由虚拟机B的两个虚拟处理器使用。因此,在该情况下,由于直接将虚拟机A的vCPU-x线程(对应于计算核x)和vCPU-y线程(对应于计算核y)切换给虚拟机B使用,因此,完全省去了现有技术中切换之后的线程和计算核之间的绑定设置的复用。
此外,根据本申请实施例,在将虚拟机A的vCPU-x线程和vCPU-y线程这两个线 程切换给虚拟机B使用之后,可以额外为每个线程配置运行标志符,以标识该线程当前正在运行哪个虚拟机。例如,在如图1b中所示,在切换之后,可以在当前已经切换给虚拟机B使用的vCPU-x线程和vCPU-y线程这两个线程上分别设置运行标志符来标识这两个线程当前运行的虚拟机是虚拟机B。因此,在虚拟机B在每个计算循环结束之后可以先检查每个线程上的该运行标志符以确定应该运行哪个虚拟机,例如,在切换给虚拟机B之后,vCPU-x线程和vCPU-y线程这两个线程的每个线程上的运行标志符可以设置为B,以标识当前正在运行虚拟机B,并且当虚拟机B执行完当前的计算循环之后,在执行下一次计算循环之前可以先例如进入用户态以检查该运行标志符,并且如果该运行标志符还是标识虚拟机B,则虚拟机B可以继续使用vCPU-x线程和vCPU-y线程这两个线程来执行下一次计算循环。但是,如果在虚拟机B执行当前计算循环时虚拟机A需要使用这两个线程,则可以根据虚拟机A的使用请求来相应地修改这两个线程的运行标志符。例如,如图1b中所示,当虚拟机A需要回收这两个线程时,可以在虚拟机B执行当前计算循环期间就将这两个线程的运行标志符修改为标识虚拟机A,从而当虚拟机B执行完当前计算循环之后,通过检查这两个线程上的运行标志符而确认需要将这两个线程归还给虚拟机A,则可以终止虚拟机B的下一次计算循环而停止在这两个线程上运行虚拟机B。此外,当虚拟机A只是需要暂时使用这两个线程,例如,需要进行同步操作等等,则可以仅将虚拟机B所使用的的这两个线程停止运行虚拟机B,并且将这两个线程重新与虚拟机A匹配,从而虚拟机A可以使用这两个线程进行所需操作,并且在执行完所需操作之后可以将这两个线程在重新归还给虚拟机B。但是在该过程中,由于虚拟机A只是临时使用这两个线程,因此vCPU-x线程和vCPU-y线程这两个线程上的运行标志符保持不变,因此,在虚拟机A使用完这两个线程而将这两个线程释放出来之后,虚拟机B可以通过检查这两个线程上的运行标志符而再次确定这两个线程是由自己使用,因此就可以在下一次计算循环中将这两个线程切换给虚拟机B使用。
本申请实施例提供的资源配置方案,通过根据计算资源切换指令和第一虚拟机的计算资源来将在待切换给第二虚拟机使用的计算核的其上运行的线程切换为运行第二虚拟机,从而在第一虚拟机和第二虚拟机之间切换计算资源时,保留了计算核与线程之间的绑定关系,解决了现有技术中由于原虚拟机的绑定核设置的调整带来的两个虚拟机的设置同步的问题,大大降低了管控的复杂度,并且由于在两个虚拟机的资源切换过程中没有创建新的线程,这样实现了两个虚拟机分别占用同一个线程中实现互斥运行,从而实现了隐私隔离。
根据本申请实施例的资源配置方案由于其不仅能够降低管控复杂度而且还能够实现虚拟机切换过程中的隐私隔离,因此可以应用于例如电商平台来提高管理效率同时避免客户信息泄露。例如,本申请的资源配置方案可以应用于搭建电商平台的虚拟机系统中。例如,在虚拟机系统的虚拟机A可以用于运行租户A的电商平台,并且当租户B也使用 该虚拟机系统来执行其自己的任务时,虚拟机系统的管理模块根据虚拟机A的运行状况发现租户A当时的任务量不多,其虚拟机A所占用的四个计算核还有空余,即计算核x闲置,因此,使用根据本申请实施例的资源配置方案的虚拟机系统就可以如上所述地将虚拟机A从计算核x对应的线程x下线,并且将该计算核x的线程x分配给租户B使用,例如为租户B使用该线程x创建一个虚拟机或者将该线程x加入到租户B的原有虚拟机资源中来运行租户B的任务。因此,由于根据本申请实施例的资源配置方案在切换线程给不同虚拟机时是以互斥的方式进行的,即,在将计算核x的线程x切换给租户B使用时已经将租户A原本运行在该计算核x的线程x上的电商平台下线了,因此在该线程x上也不会再存在该租户A的电商平台的数据,因此,租户B在使用该线程x时也不会由于数据的残留而看到租户A的电商平台的数据。特别地,在本申请实施例中,如果租户A由于其运营的电商平台的任务量剧增而需要要回该线程x时,由于本申请实施例的资源配置方案只允许线程以互斥的方式运行虚拟机,因此,当租户A需要要回线程x时,虚拟机系统的管理模块可以中断租户B的执行任务,并且将租户B的任务从线程x下线,从而租户B的数据也从线程x中消失,因此当线程x再次运行租户A的电商平台时,租户A的电商平台也无法获取到线程x中之前运行的租户B的数据。因此,根据本申请实施例的资源配置方案能够帮助运行电商平台的虚拟机系统实现资源的灵活管控,而且还能够确保电商平台上的数据在虚拟机资源切换的安全性。
根据本申请实施例的资源配置方案由于其不仅能够降低管控复杂度而且还能够实现虚拟机切换过程中的隐私隔离,因此可以应用于例如电信事务来提高管理效率同时避免客户信息泄露。例如,本申请的资源配置方案可以应用于执行电信事务的虚拟机系统中。例如,在虚拟机系统的虚拟机A可以用于运行租户A的电信事务,并且当租户B也使用该虚拟机系统来执行其自己的任务时,虚拟机系统的管理模块根据虚拟机A的运行状况发现租户A当时的任务量不多,其虚拟机A所占用的四个计算核还有空余,即计算核x闲置,因此,使用根据本申请实施例的资源配置方案的虚拟机系统就可以如上所述地将虚拟机A从计算核x对应的线程x下线,并且将该计算核x的线程x分配给租户B使用,例如为租户B使用该线程x创建一个虚拟机或者将该线程x加入到租户B的原有虚拟机资源中。因此,由于根据本申请实施例的资源配置方案在切换线程给不同虚拟机时是以互斥的方式进行的,即,在将计算核x的线程x切换给租户B使用时已经将租户A原本运行在该计算核x的线程x上的电信事务下线了,因此在该线程x上也不会再存在该租户A之前运行的电信事务,特别是用户的数据,因此,租户B在使用该线程x时也不会由于数据的残留而看到租户A的电信事务的数据。特别地,在本申请实施例中,如果租户A由于其运营的电信事务的任务量剧增而需要要回该线程x时,由于本申请实施例的资源配置方案只允许线程以互斥的方式运行虚拟机,因此,当租户A需要要回线程x时,虚拟机系统的管理模块可以中断租户B的执行任务,并且将租户B的任务从线程x下线, 从而租户B的数据也从线程x中消失,因此当线程x再次运行租户A的电信事务时,租户A也无法获取到线程x中之前运行的租户B的数据。因此,根据本申请实施例的资源配置方案能够帮助运行电信事务的虚拟机系统实现资源的灵活管控,而且还能够确保电信事务相关的数据在虚拟机资源切换的安全性。
根据本申请实施例的资源配置方案由于其能够降低管控复杂度,因此可以应用于例如音视频处理来提高处理效率。例如,本申请的资源配置方案可以应用于执行音视频处理的虚拟机系统中。例如,在虚拟机系统的虚拟机A可以用于为租户A处理音视频文件,例如点播或流媒体等,并且当租户B也使用该虚拟机系统来执行其自己的任务时,虚拟机系统的管理模块根据虚拟机A的运行状况发现租户A当前需要处理的音视频数据不多,其虚拟机A所占用的四个计算核还有空余,例如计算核x闲置,因此,使用根据本申请实施例的资源配置方案的虚拟机系统就可以如上所述地将虚拟机A从计算核x对应的线程x下线,并且将该计算核x的线程x分配给租户B使用,例如为租户B使用该线程x创建一个虚拟机或者将该线程x加入到租户B的原有虚拟机资源中。因此,租户A从切换时刻开始实际上仅使用了虚拟机系统的三个计算核,因此在为租户A计费时可以相应地减少租户A的资源使用费用,并且甚至可以在租户A与租户B达成协议的情况下,租户A将自己的计算核x出租给租户B临时使用。这样不仅提高了虚拟机系统中计算资源的利用率,而且由于根据本申请实施例的资源配置方案在切换线程给不同虚拟机时保持了计算核与线程之间的绑定关系,因此对于租户A来说,释放线程给租户B以及在自己任务量增加的情况下要回该线程继续使用都是极为方便的,无需进行特别的设置和管理,因此提高了计算资源在租户之间,即虚拟机之间转换的管理效率。
根据本申请实施例的资源配置方案由于其能够降低管控复杂度,因此可以应用于例如人工智能计算来提高处理效率。人工智能计算通常需要大量的计算资源,因此,本申请的资源配置方案可以应用于执行人工智能处理的虚拟机系统中。例如,在虚拟机系统的虚拟机A可以用于为租户A执行人工智能任务,例如模型训练等,并且当租户B也使用该虚拟机系统来执行其自己的任务时,虚拟机系统的管理模块根据虚拟机A的运行状况发现租户A当前的人工智能计算任务不多,其虚拟机A所占用的四个计算核还有空余,例如计算核x闲置,因此,使用根据本申请实施例的资源配置方案的虚拟机系统就可以如上所述地将虚拟机A从计算核x对应的线程x下线,并且将该计算核x的线程x分配给租户B使用,例如为租户B使用该线程x创建一个虚拟机或者将该线程x加入到租户B的原有虚拟机资源中。因此,租户A从切换时刻开始实际上仅使用了虚拟机系统的三个计算核,因此在为租户A计费时可以相应地减少租户A的资源使用费用,并且甚至可以在租户A与租户B达成协议的情况下,租户A将自己的计算核x出租给租户B临时使用。这样不仅提高了虚拟机系统中计算资源的利用率,而且由于根据本申请实施例的资源配置方案在切换线程给不同虚拟机时保持了计算核与线程之间的绑定关系,因此对 于租户A来说,释放线程给租户B以及在自己任务量增加的情况下要回该线程继续使用都是极为方便的,无需进行特别的设置和管理,因此提高了计算资源在租户之间,即虚拟机之间转换的管理效率。
根据本申请实施例的资源配置方案由于其能够降低管控复杂度,因此可以应用于例如在线售票平台来提高处理效率。特别地,在线售票的任务繁忙程度在很大程度上依赖于要出售的票对应的演出或时机,例如节假日等等。因此本申请的资源配置方案可以应用于运行在线售票平台的虚拟机系统中。例如,在虚拟机系统的虚拟机A可以用于为租户A运行在线售票平台等,并且当租户B也使用该虚拟机系统来执行其自己的任务,当当天为节假日的售票开始日或者当天出售的票是热门节目的票时,虚拟机A发现当前的计算资源不足以处理剧增的用户购票请求。因此,虚拟机系统的管理模块可以根据虚拟机A的请求,为虚拟机A从虚拟机B划拨一个或多个计算核来给虚拟机A使用。例如,使用根据本申请实施例的资源配置方案的虚拟机系统就可以如上所述地将虚拟机B从要临时分配给虚拟机A使用的计算核x和计算核y对应的线程x和线程y下线,并且将该计算核x的线程x和计算核y的线程y分配给租户A使用,即将该线程x和线程y直接加入到租户B的原有虚拟机资源中。因此,通过本申请的资源配置方案,由于在虚拟机A需要临时线程时,仅需要将对应的虚拟机从该线程下线,并下线之后将线程直接运行虚拟机A,这样不仅提高了虚拟机系统中计算资源的利用率,而且由于根据本申请实施例的资源配置方案在切换线程给不同虚拟机时保持了计算核与线程之间的绑定关系,因此提高了切换效率,能够很好地处理在线售票平台的任务突然剧增需要大量的临时计算资源的问题。
上述实施例是对本申请实施例的技术原理和示例性的应用框架的说明,下面通过多个实施例来进一步对本申请实施例具体技术方案进行详细描述。
实施例二
图2为本申请提供的资源配置方法一个实施例的流程图,该方法的执行主体可以为具有资源配置能力的各种终端或服务器设备,也可以为集成在这些设备上的装置或芯片。如图2所示,该资源配置方法包括如下步骤:
S201,获取第一虚拟机的第一计算资源。
在本申请实施例中,可以在当前正在运行的第一虚拟机运行期间获取该虚拟机的计算资源。特别地,本申请涉及对于虚拟机所使用的计算资源在两个或多个虚拟机之间的配置,例如,如图1b中所示,在当前已经正在运行的虚拟机A与新创建的虚拟机B之间进行资源配置。为此,在步骤S201可以先获取第一虚拟机的第一计算资源,该第一计算资源可以包括第一虚拟机当前正在使用的计算核和计算核上运行的第一线程。例如,如图1b中所示,当前运行的第一虚拟机可以是虚拟机A,并且该第一计算资源可以是运行虚拟机A的四个CPU的四个线程以及与线程一一绑定的四个物理计算核。这些计算 资源就可以构成将来在虚拟机A与虚拟机B之间的资源配置的配置基础。
S202,接收计算资源切换指令。
当在虚拟机A运行期间,由于例如虚拟机A的计算任务的变化使得虚拟机A的计算资源的一部分可出让给其他的虚拟机,例如如图1b中所示的虚拟机B。为此,在步骤S202中可以接收针对当前虚拟机A的出让资源的计算资源切换指令。例如,在步骤S202中接收到的计算资源切换指令可以指示将例如图1b中所示的虚拟机A的第一虚拟机的至少一个计算核切换给例如虚拟机B的第二虚拟机使用。
S203,根据计算资源切换指令以及第一计算资源确定第一计算资源中待切换的计算核以及对应的第一线程。
当在步骤S202中接收到计算资源切换指令之后,可以在步骤S203中根据该计算资源切换指令和步骤S201中获取到的第一计算资源来确定在例如虚拟机A的第一虚拟机的第一计算资源中需要切换给第二虚拟机的计算核。例如,在步骤S202中接收到的计算资源切换指令可以是将虚拟机A所使用的的四个线程及其对应的四个计算核中的两个切换给虚拟机B,并且根据步骤S201中获取的第一计算资源中的线程以及计算核的状态而确定vCPU-x线程和vCPU-y线程目前处于空闲状态是属于可出让的计算资源。因此,在步骤S203中可以确认将vCPU-x线程和vCPU-y线程切换给虚拟机B使用。
S204,将第一线程切换为运行第二虚拟机。
在步骤S203中确定了将vCPU-x线程和vCPU-y线程切换给虚拟机B使用之后,在步骤S204中可以将步骤S203中所述确定的第一线程,例如,vCPU-x线程和vCPU-y线程与第一虚拟机解除使用关系,并且在这两个线程上运行第二虚拟机,例如虚拟机B。
本申请实施例提供的资源配置方法,通过根据计算资源切换指令和第一虚拟机的计算资源来将在待切换给第二虚拟机使用的计算核的其上运行的线程切换为运行第二虚拟机,从而在第一虚拟机和第二虚拟机之间切换计算资源时,保留了计算核与线程之间的绑定关系,解决了现有技术中由于原虚拟机的绑定核设置的调整带来的两个虚拟机的设置同步的问题,大大降低了管控的复杂度,并且由于在两个虚拟机的资源切换过程中没有创建新的线程,这样实现了两个虚拟机分别占用同一个线程中实现互斥运行,从而实现了隐私隔离。
实施例三
图3为本申请提供的资源配置方法另一个实施例的流程图,该方法的执行主体可以为具有资源配置能力的各种终端或服务器设备,也可以为集成在这些设备上的装置或芯片。如图3所示,该资源配置法包括如下步骤:
S301,获取第一虚拟机的第一计算资源。
在本申请实施例中,可以在当前正在运行的第一虚拟机运行期间获取该虚拟机的计算资源。特别地,本申请涉及对于虚拟机所使用的计算资源在两个或多个虚拟机之间的 配置,例如,如图1b中所示,在当前已经正在运行的虚拟机A与新创建的虚拟机B之间进行资源配置。为此,在步骤S301可以先获取第一虚拟机的第一计算资源,该第一计算资源可以包括第一虚拟机当前正在使用的计算核和计算核上运行的第一线程。例如,如图1b中所示,当前运行的第一虚拟机可以是虚拟机A,并且该第一计算资源可以是运行虚拟机A的四个CPU的四个线程以及与线程一一绑定的四个物理计算核。这些计算资源就可以构成将来在虚拟机A与虚拟机B之间的资源配置的配置基础。
S302,接收计算资源切换指令。
当在虚拟机A运行期间,由于例如虚拟机A的计算任务的变化使得虚拟机A的计算资源的一部分可出让给其他的虚拟机,例如如图1b中所示的虚拟机B。为此,在步骤S302中可以接收针对当前虚拟机A的出让资源的计算资源切换指令。例如,在步骤S302中接收到的计算资源切换指令可以指示将例如图1b中所示的虚拟机A的第一虚拟机的至少一个计算核切换给例如虚拟机B的第二虚拟机使用。
S303,根据计算资源切换指令以及第一计算资源确定第一计算资源中待切换的计算核以及对应的第一线程。
当在步骤S302中接收到计算资源切换指令之后,可以在步骤S303中根据该计算资源切换指令和步骤S301中获取到的第一计算资源来确定在例如虚拟机A的第一虚拟机的第一计算资源中需要切换给第二虚拟机的计算核。例如,在步骤S302中接收到的计算资源切换指令可以是将虚拟机A所使用的的四个线程及其对应的四个计算核中的两个切换给虚拟机B,并且根据步骤S301中获取的第一计算资源中的线程以及计算核的状态而确定vCPU-x线程和vCPU-y线程目前处于空闲状态是属于可出让的计算资源。因此,在步骤S303中可以确认将vCPU-x线程和vCPU-y线程切换给虚拟机B使用。
S304,将第一线程切换为运行第二虚拟机并且保持第一线程与计算核的绑定关系不变。
在步骤S303中确定了将vCPU-x线程和vCPU-y线程切换给虚拟机B使用之后,在步骤S304中可以将步骤S203中所述确定的第一线程,例如,vCPU-x线程和vCPU-y线程与第一虚拟机解除使用关系,并且在这两个线程上运行第二虚拟机,例如虚拟机B,并且同时保持这些vCPU-x线程和vCPU-y与对应的计算核x和y之间的绑定关系,从而第二虚拟机B可以在无需进行任何线程与计算核的绑定设置的情况下直接运行其计算任务,例如其vCPU-x’和vCPU-y’。
在步骤S304将第一虚拟机A的vCPU-x线程和vCPU-y线程这两个线程切换给第二虚拟机B使用的情况下,为了在循环中识别当前线程所运行的虚拟机,可以进一步为切换的这两个线程中的每个线程配置运行标志符,以标识该线程当前正在运行哪个虚拟机。因此,本申请实施例的资源配置方法可以进一步包括:
S305,将运行标志符修改为标识第二虚拟机。
在每个线程设置有运行标志符来指示线程当前运行的虚拟机的情况下,在上述虚拟机A将vCPU-x线程和vCPU-y线程配置给虚拟机B使用时,可以将线程上设置的运行标志符从A修改为B,以指示该两个线程已经被切换给第二虚拟机B使用了。从而,在虚拟机A或B执行完当前计算循环之后开始下一个计算循环之前可以先检查该运行标志符,以确定线程应由哪个虚拟机使用,或者更具体地,可以确定线程应该由哪个虚拟机的哪个虚拟处理器使用。
例如,在步骤S304将vCPU-x线程和vCPU-y线程切换给虚拟机B使用并且在步骤S305将运行标志符修改为指示当前运行虚拟机B,则当虚拟机B执行完当前的计算循环之后,在执行下一次计算循环之前可以先例如进入用户态以检查该运行标志符,并且如果该运行标志符还是标识虚拟机B,则表示在虚拟机B执行上一个计算循环期间,没有额外的指令要求这两个线程由其他虚拟机使用,因此虚拟机B可以继续使用vCPU-x线程和vCPU-y线程这两个线程来执行下一次计算循环。但是,如果在虚拟机B执行当前计算循环时虚拟机A需要使用这两个线程,则可以根据虚拟机A的使用请求来相应地修改这两个线程的运行标志符。例如,本申请实施例的资源配置方法可以进一步包括:
S306,接收来自第一虚拟机的第一退出指令。
在步骤S304中虚拟机A将vCPU-x线程和vCPU-y线程切换给虚拟机B使用,从而虚拟机B在使用这两个线程执行其计算任务期间,可以在步骤S306接收来自第一虚拟机A的指令,以便于在使用从虚拟机A切换来的线程期间添加对虚拟机A的指令的响应。例如,虚拟机A可以向虚拟机B发送第一退出指令,该第一退出指令可以指示第一虚拟机A对于第一线程的临时占用。即,虚拟机A需要临时占用这两个切换给虚拟机B使用的线程。
S3061,将第一线程切换为运行第一虚拟机。
S3062,在临时占用结束时将第一线程切换为运行第二虚拟机。
因此,虚拟机B在执行完当前的计算循环之后,可以根据步骤S306中接收到的该退出指令而退出这两个线程,并且在步骤S3061中切换给第一虚拟机A使用,特别地,由于虚拟机A是临时占用,因此,在该情况下,不需要将这两个线程上的运行标志符进行修改,例如修改为指示虚拟机A,而是可以仍然保持为指示虚拟机B,从而在虚拟机A执行完该临时占用的计算任务之后,可以再次在步骤S3062中将这两个线程切换为运行第二虚拟机B。
S307,接收来自第一虚拟机的第二退出指令。
此外,当虚拟机A需要回收这两个线程时,就可以向虚拟机B发送第二退出指令,并且从而可以在步骤S307中接收该第二退出指令,该第二退出指令例如可以指示第一虚拟机对于第一线程的回收。
S308,将第一线程切换为运行第一虚拟机。
因此,虚拟机B就可以在运行期间根据虚拟机A的指示线程回收的指令而将线程归还给虚拟机A来使用。特别地,在线程上设置有运行标志符的情况下,
步骤S308可以进一步包括:
S3081,将第一线程的运行标志符修改为标识第一虚拟机。
S3082,判断第一线程对应的计算核的当前循环是否结束。
S3083,当当前循环结束时,根据运行标志符将第一线程切换为运行第一虚拟机。
例如,在虚拟机A需要回收这两个线程时,可以在虚拟机B执行当前计算循环期间就将这两个线程的运行标志符修改为标识虚拟机A,从而当虚拟机B执行完当前计算循环之后,通过检查这两个线程上的运行标志符而确认需要将这两个线程归还给虚拟机A,则可以终止虚拟机B的下一次计算循环而停止在这两个线程上运行虚拟机B。
本申请实施例提供的资源配置方法,通过根据计算资源切换指令和第一虚拟机的计算资源来将在待切换给第二虚拟机使用的计算核的其上运行的线程切换为运行第二虚拟机,从而在第一虚拟机和第二虚拟机之间切换计算资源时,保留了计算核与线程之间的绑定关系,解决了现有技术中由于原虚拟机的绑定核设置的调整带来的两个虚拟机的设置同步的问题,大大降低了管控的复杂度,并且由于在两个虚拟机的资源切换过程中没有创建新的线程,这样实现了两个虚拟机分别占用同一个线程中实现互斥运行,从而实现了隐私隔离。
实施例四
图4为本申请提供的资源配置装置实施例的结构示意图,可用于执行如图2和图3所示的方法步骤。如图4所示,该资源配置装置可以包括:获取模块41、接收模块42、确定模块43和切换模块44。
获取模块41可以用于获取第一虚拟机的第一计算资源。
在本申请实施例中,可以在当前正在运行的第一虚拟机运行期间获取该虚拟机的计算资源。特别地,本申请涉及对于虚拟机所使用的计算资源在两个或多个虚拟机之间的配置,例如,如图1b中所示,在当前已经正在运行的虚拟机A与新创建的虚拟机B之间进行资源配置。为此,获取模块41可以先获取第一虚拟机的第一计算资源,该第一计算资源可以包括第一虚拟机当前正在使用的计算核和计算核上运行的第一线程。例如,如图1b中所示,当前运行的第一虚拟机可以是虚拟机A,并且该第一计算资源可以是运行虚拟机A的四个CPU的四个线程以及与线程一一绑定的四个物理计算核。这些计算资源就可以构成将来在虚拟机A与虚拟机B之间的资源配置的配置基础。
接收模块42可以用于接收计算资源切换指令。
当在虚拟机A运行期间,由于例如虚拟机A的计算任务的变化使得虚拟机A的计算资源的一部分可出让给其他的虚拟机,例如如图1b中所示的虚拟机B。为此,接收模块42可以接收针对当前虚拟机A的出让资源的计算资源切换指令。例如,接收模块42 接收到的计算资源切换指令可以指示将例如图1b中所示的虚拟机A的第一虚拟机的至少一个计算核切换给例如虚拟机B的第二虚拟机使用。
确定模块43可以用于根据计算资源切换指令以及第一计算资源确定第一计算资源中待切换的计算核以及对应的第一线程。
当接收模块42接收到计算资源切换指令之后,确定模块43可以根据该计算资源切换指令和获取模块41获取到的第一计算资源来确定在例如虚拟机A的第一虚拟机的第一计算资源中需要切换给第二虚拟机的计算核。例如,接收模块42接收到的计算资源切换指令可以是将虚拟机A所使用的的四个线程及其对应的四个计算核中的两个切换给虚拟机B,并且根据获取模块41获取的第一计算资源中的线程以及计算核的状态而确定vCPU-x线程和vCPU-y线程目前处于空闲状态是属于可出让的计算资源。因此,确定模块43可以确认将vCPU-x线程和vCPU-y线程切换给虚拟机B使用。
切换模块44可以用于将第一线程切换为运行第二虚拟机。
确定模块43确定了将vCPU-x线程和vCPU-y线程切换给虚拟机B使用之后,切换模块44可以将确定模块43所述确定的第一线程,例如,vCPU-x线程和vCPU-y线程与第一虚拟机解除使用关系,并且在这两个线程上运行第二虚拟机,例如虚拟机B,并且同时保持这些vCPU-x线程和vCPU-y与对应的计算核x和y之间的绑定关系,从而第二虚拟机B可以在无需进行任何线程与计算核的绑定设置的情况下直接运行其计算任务,例如其vCPU-x’和vCPU-y’。
切换模块44将第一虚拟机A的vCPU-x线程和vCPU-y线程这两个线程切换给第二虚拟机B使用的情况下,为了在循环中识别当前线程所运行的虚拟机,可以进一步为切换的这两个线程中的每个线程配置运行标志符,以标识该线程当前正在运行哪个虚拟机。因此,本申请实施例的资源配置装置可以进一步包括:修改模块45,其可以用于将运行标志符修改为标识第二虚拟机。
在每个线程设置有运行标志符来指示线程当前运行的虚拟机的情况下,在上述虚拟机A将vCPU-x线程和vCPU-y线程配置给虚拟机B使用时,修改模块45可以将线程上设置的运行标志符从A修改为B,以指示该两个线程已经被切换给第二虚拟机B使用了。从而,在虚拟机A或B执行完当前计算循环之后开始下一个计算循环之前可以先检查该运行标志符,以确定线程应由哪个虚拟机使用,或者更具体地,可以确定线程应该由哪个虚拟机的哪个虚拟处理器使用。
例如,切换模块44将vCPU-x线程和vCPU-y线程切换给虚拟机B使用并且修改模块45将运行标志符修改为指示当前运行虚拟机B,则当虚拟机B执行完当前的计算循环之后,在执行下一次计算循环之前可以先例如进入用户态以检查该运行标志符,并且如果该运行标志符还是标识虚拟机B,则表示在虚拟机B执行上一个计算循环期间,没有额外的指令要求这两个线程由其他虚拟机使用,因此虚拟机B可以继续使用vCPU-x线 程和vCPU-y线程这两个线程来执行下一次计算循环。但是,如果在虚拟机B执行当前计算循环时虚拟机A需要使用这两个线程,则可以根据虚拟机A的使用请求来相应地修改这两个线程的运行标志符。例如,本申请实施例的接收模块42可以进一步用于:检测来自第一虚拟机的第一退出指令。
切换模块44虚拟机A将vCPU-x线程和vCPU-y线程切换给虚拟机B使用,从而虚拟机B在使用这两个线程执行其计算任务期间,接收模块42可以接收来自第一虚拟机A的指令,以便于在使用从虚拟机A切换来的线程期间添加对虚拟机A的指令的响应。例如,虚拟机A可以向虚拟机B发送第一退出指令,该第一退出指令可以指示第一虚拟机A对于第一线程的临时占用。即,虚拟机A需要临时占用这两个切换给虚拟机B使用的线程。
因此,切换模块44可以进一步用于:将第一线程切换为运行第一虚拟机,并且在临时占用结束时将第一线程切换为运行第二虚拟机。
因此,虚拟机B在执行完当前的计算循环之后,切换模块44可以根据接收模块42接收到的该退出指令而将这两个线程切换给第一虚拟机A使用,特别地,由于虚拟机A是临时占用,因此,在该情况下,不需要修改模块45将这两个线程上的运行标志符进行修改,例如修改为指示虚拟机A,而是可以仍然保持为指示虚拟机B,从而在虚拟机A执行完该临时占用的计算任务之后,可以再次通过切换模块44将这两个线程切换为运行第二虚拟机B。
接收模块42可以进一步用于接收来自第一虚拟机的第二退出指令。
此外,当虚拟机A需要回收这两个线程时,就可以向虚拟机B发送第二退出指令,并且从而接收模块42可以接收该第二退出指令,该第二退出指令例如可以指示第一虚拟机对于第一线程的回收。
切换模块44可以进一步用于将第一线程切换为运行第一虚拟机。
因此,虚拟机B就可以在运行期间根据虚拟机A的指示线程回收的指令而将线程归还给虚拟机A来使用。特别地,在线程上设置有运行标志符的情况下,
修改模块45可以进一步用于:将第一线程的运行标志符修改为标识第一虚拟机。
切换模块44可以进一步用于:判断第一线程对应的计算核的当前循环是否结束。
当当前循环结束时,根据运行标志符将第一线程切换为运行第一虚拟机。
例如,在虚拟机A需要回收这两个线程时,可以在虚拟机B执行当前计算循环期间就由修改模块45将这两个线程的运行标志符修改为标识虚拟机A,从而当虚拟机B执行完当前计算循环之后,通过检查这两个线程上的运行标志符而确认需要将这两个线程归还给虚拟机A,则可以终止虚拟机B的下一次计算循环而停止在这两个线程上运行虚拟机B。
本申请实施例提供的资源配置装置,通过根据计算资源切换指令和第一虚拟机的计 算资源来将在待切换给第二虚拟机使用的计算核的其上运行的线程切换为运行第二虚拟机,从而在第一虚拟机和第二虚拟机之间切换计算资源时,保留了计算核与线程之间的绑定关系,解决了现有技术中由于原虚拟机的绑定核设置的调整带来的两个虚拟机的设置同步的问题,大大降低了管控的复杂度,并且由于在两个虚拟机的资源切换过程中没有创建新的线程,这样实现了两个虚拟机分别占用同一个线程中实现互斥运行,从而实现了隐私隔离。
实施例五
以上描述了资源配置装置的内部功能和结构,该装置可实现为一种电子设备。图5为本申请提供的电子设备实施例的结构示意图。如图5所示,该电子设备包括存储器51和处理器52。
存储器51,用于存储程序。除上述程序之外,存储器51还可被配置为存储其它各种数据以支持在电子设备上的操作。这些数据的示例包括用于在电子设备上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。
存储器51可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
处理器52,不仅仅局限于中央处理器(CPU),还可能为图形处理器(GPU)、现场可编辑门阵列(FPGA)、嵌入式神经网络处理器(NPU)或人工智能(AI)芯片等处理芯片。处理器52,与存储器51耦合,执行存储器51所存储的程序,该程序运行时执行上述实施例二和三的资源配置方法。
进一步,如图5所示,电子设备还可以包括:通信组件53、电源组件54、音频组件55、显示器56等其它组件。图5中仅示意性给出部分组件,并不意味着电子设备只包括图5所示组件。
通信组件53被配置为便于电子设备和其他设备之间有线或无线方式的通信。电子设备可以接入基于通信标准的无线网络,如WiFi,3G、4G或5G,或它们的组合。在一个示例性实施例中,通信组件53经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件53还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
电源组件54,为电子设备的各种组件提供电力。电源组件54可以包括电源管理系统,一个或多个电源,及其他与为电子设备生成、管理和分配电力相关联的组件。
音频组件55被配置为输出和/或输入音频信号。例如,音频组件55包括一个麦克风(MIC),当电子设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克 风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器51或经由通信组件53发送。在一些实施例中,音频组件55还包括一个扬声器,用于输出音频信号。
显示器56包括屏幕,其屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (10)

  1. 一种资源配置方法,包括:
    获取第一虚拟机的第一计算资源,其中,所述第一计算资源包括所述第一虚拟机当前使用的至少一个计算核以及在该计算核上运行的第一线程;
    接收计算资源切换指令,其中,所述计算资源切换指令指示将所述第一虚拟机的至少一个计算核切换给第二虚拟机使用;
    根据所述计算资源切换指令以及所述第一计算资源确定所述第一计算资源中待切换的计算核以及对应的第一线程;
    将所述第一线程切换为运行所述第二虚拟机。
  2. 根据权利要求1所述的资源配置方法,其中,所述计算核和与其对应的第一线程具有绑定关系,并且,所述将所述第一线程切换为运行所述第二虚拟机包括:
    将所述第一线程切换为运行所述第二虚拟机并且保持所述第一线程与所述计算核的绑定关系不变。
  3. 根据权利要求1所述的资源配置方法,其中,所述第一线程设置有运行标志符,其中,所述运行标志符标识所述第一线程当前运行的虚拟机,并且在所述将所述第一线程切换为运行所述第二虚拟机之后,所述资源配置方法进一步包括:
    将所述运行标志符修改为标识所述第二虚拟机。
  4. 根据权利要求3所述的资源配置方法,其中,所述资源配置方法进一步包括:
    接收来自所述第一虚拟机的第一退出指令,其中所述第一退出指令指示所述第一虚拟机对于所述第一线程的临时占用;
    将所述第一线程切换为运行所述第一虚拟机;
    在所述临时占用结束时将所述第一线程切换为运行所述第二虚拟机。
  5. 根据权利要求3所述的资源配置方法,其中,所述资源配置方法进一步包括:
    接收来自所述第一虚拟机的第二退出指令,其中所述第二退出指令指示所述第一虚拟机对于所述第一线程的回收;
    将所述第一线程切换为运行所述第一虚拟机。
  6. 根据权利要求5所述的资源配置方法,其中,所述将所述第一线程切换为运行所述第一虚拟机包括:
    将所述第一线程的运行标志符修改为标识所述第一虚拟机;
    判断所述第一线程对应的计算核的当前循环是否结束;
    当所述当前循环结束时,根据所述运行标志符将所述第一线程切换为运行所述第一虚拟机。
  7. 一种资源配置装置,包括:
    获取模块,用于获取第一虚拟机的第一计算资源,其中,所述第一计算资源包括所述第一虚拟机当前使用的至少一个计算核以及在该计算核上运行的第一线程;
    接收模块,用于接收计算资源切换指令,其中,所述计算资源切换指令指示将所述第一虚拟机的至少一个计算核切换给第二虚拟机使用;
    确定模块,用于根据所述计算资源切换指令以及所述第一计算资源确定所述第一计算资源中待切换的计算核以及对应的第一线程;
    切换模块,用于将所述第一线程切换为运行所述第二虚拟机。
  8. 根据权利要求7所述的资源配置装置,其中,所述第一线程设置有运行标志符,其中,所述运行标志符标识所述第一线程当前运行的虚拟机,并且所述资源配置装置进一步包括:
    修改模块,用于将所述运行标志符修改为标识所述第二虚拟机。
  9. 一种电子设备,包括:
    存储器,用于存储程序;
    处理器,用于运行所述存储器中存储的所述程序,以执行如权利要求1至6中任一所述的资源配置方法。
  10. 一种计算机可读存储介质,其上存储有可被处理器执行的计算机程序,其中,该程序被处理器执行时实现如权利要求1至6中任一所述的资源配置方法。
PCT/CN2022/093506 2021-05-25 2022-05-18 资源配置方法和装置、电子设备及计算机可读存储介质 Ceased WO2022247698A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/518,277 US20240086228A1 (en) 2021-05-25 2023-11-22 Resource Configuration Method and Apparatus, Electronic Device, and Computer-Readable Storage Medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110574518.6A CN113467884B (zh) 2021-05-25 2021-05-25 资源配置方法和装置、电子设备及计算机可读存储介质
CN202110574518.6 2021-05-25

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/518,277 Continuation US20240086228A1 (en) 2021-05-25 2023-11-22 Resource Configuration Method and Apparatus, Electronic Device, and Computer-Readable Storage Medium

Publications (1)

Publication Number Publication Date
WO2022247698A1 true WO2022247698A1 (zh) 2022-12-01

Family

ID=77871569

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/093506 Ceased WO2022247698A1 (zh) 2021-05-25 2022-05-18 资源配置方法和装置、电子设备及计算机可读存储介质

Country Status (3)

Country Link
US (1) US20240086228A1 (zh)
CN (1) CN113467884B (zh)
WO (1) WO2022247698A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467884B (zh) * 2021-05-25 2024-08-02 阿里巴巴创新公司 资源配置方法和装置、电子设备及计算机可读存储介质
CN114579302A (zh) * 2022-02-23 2022-06-03 阿里巴巴(中国)有限公司 资源调度方法以及装置
CN115118508B (zh) * 2022-06-28 2023-09-19 平安银行股份有限公司 数据管理方法、装置、电子设备及存储介质
US20240211288A1 (en) * 2022-12-21 2024-06-27 Microsoft Technology Licensing, Llc Hierarchical virtualization

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060020701A1 (en) * 2004-07-21 2006-01-26 Parekh Harshadrai G Thread transfer between processors
US20080104593A1 (en) * 2006-10-31 2008-05-01 Hewlett-Packard Development Company, L.P. Thread hand off
US20090178036A1 (en) * 2008-01-04 2009-07-09 Frank Eliot Levine Method and Apparatus for Call Stack Sampling Using a Virtual Machine
US20110307640A1 (en) * 2010-06-11 2011-12-15 International Business Machines Corporation Call stack sampling with lightweight thread migration prevention
US20150227192A1 (en) * 2013-09-17 2015-08-13 Empire Technology Development Llc Virtual machine switching based on processor power states
CN106796530A (zh) * 2016-12-22 2017-05-31 深圳前海达闼云端智能科技有限公司 一种虚拟化方法、装置、及电子设备、计算机程序产品
CN108804211A (zh) * 2018-04-27 2018-11-13 西安华为技术有限公司 线程调度方法、装置、电子设备及存储介质
CN113467884A (zh) * 2021-05-25 2021-10-01 阿里巴巴新加坡控股有限公司 资源配置方法和装置、电子设备及计算机可读存储介质

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050132363A1 (en) * 2003-12-16 2005-06-16 Vijay Tewari Method, apparatus and system for optimizing context switching between virtual machines
US20110113426A1 (en) * 2009-11-09 2011-05-12 Hsiang-Tsung Kung Apparatuses for switching the running of a virtual machine between multiple computer devices belonging to the same computer platform and the associated switching methods
CN103095834B (zh) * 2013-01-16 2015-09-16 中国科学院计算技术研究所 一种跨虚拟化数据中心的虚拟机在线迁移方法
US9727356B2 (en) * 2015-08-24 2017-08-08 International Business Machines Corporation Scaling past the java virtual machine thread limit
CN106959889A (zh) * 2016-01-11 2017-07-18 阿里巴巴集团控股有限公司 一种服务器资源调整的方法和装置
CN106095576A (zh) * 2016-06-14 2016-11-09 上海交通大学 虚拟化多核环境下非一致性i/o访问虚拟机资源迁移方法
CN106775927A (zh) * 2016-11-25 2017-05-31 郑州云海信息技术有限公司 一种基于kvm虚拟化技术的处理器隔离方法及装置
CN108255572B (zh) * 2016-12-29 2025-12-30 华为技术有限公司 一种vcpu切换方法和物理主机
CN108459906B (zh) * 2017-02-20 2021-06-29 华为技术有限公司 一种vcpu线程的调度方法及装置
CN108469986B (zh) * 2017-02-23 2021-04-09 华为技术有限公司 一种数据迁移方法及装置
JP6943030B2 (ja) * 2017-06-16 2021-09-29 富士通株式会社 情報処理装置、情報処理方法およびプログラム
CN107704314B (zh) * 2017-11-09 2023-09-12 北京百度网讯科技有限公司 用于迁移虚拟机的方法和装置
US10375700B1 (en) * 2018-04-19 2019-08-06 Verizon Patent And Licensing Inc. Resource allocation for virtual devices
US10996972B2 (en) * 2018-09-25 2021-05-04 Microsoft Technology Licensing, Llc Multi-tenant support on virtual machines in cloud computing networks
CN109871262A (zh) * 2019-02-28 2019-06-11 北京隆普智能科技有限公司 一种虚拟机创建的方法及其创建装置
CN110673928B (zh) * 2019-09-29 2021-12-14 天津卓朗科技发展有限公司 线程绑定方法、装置、存储介质及服务器
US20220206869A1 (en) * 2020-12-28 2022-06-30 Advanced Micro Devices, Inc. Virtualizing resources of a memory-based execution device
CA3146521C (en) * 2021-02-02 2026-01-20 The Boeing Company System and method of timekeeping for a virtual machine having multiple virtual processing cores
US11755512B2 (en) * 2021-08-17 2023-09-12 Red Hat, Inc. Managing inter-processor interrupts in virtualized computer systems

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060020701A1 (en) * 2004-07-21 2006-01-26 Parekh Harshadrai G Thread transfer between processors
US20080104593A1 (en) * 2006-10-31 2008-05-01 Hewlett-Packard Development Company, L.P. Thread hand off
US20090178036A1 (en) * 2008-01-04 2009-07-09 Frank Eliot Levine Method and Apparatus for Call Stack Sampling Using a Virtual Machine
US20110307640A1 (en) * 2010-06-11 2011-12-15 International Business Machines Corporation Call stack sampling with lightweight thread migration prevention
US20150227192A1 (en) * 2013-09-17 2015-08-13 Empire Technology Development Llc Virtual machine switching based on processor power states
CN106796530A (zh) * 2016-12-22 2017-05-31 深圳前海达闼云端智能科技有限公司 一种虚拟化方法、装置、及电子设备、计算机程序产品
CN108804211A (zh) * 2018-04-27 2018-11-13 西安华为技术有限公司 线程调度方法、装置、电子设备及存储介质
CN113467884A (zh) * 2021-05-25 2021-10-01 阿里巴巴新加坡控股有限公司 资源配置方法和装置、电子设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN113467884A (zh) 2021-10-01
US20240086228A1 (en) 2024-03-14
CN113467884B (zh) 2024-08-02

Similar Documents

Publication Publication Date Title
WO2022247698A1 (zh) 资源配置方法和装置、电子设备及计算机可读存储介质
AU2021229220B2 (en) Image processing method and device
CN111450524B (zh) 云游戏中的信息处理方法、装置、云游戏服务器及介质
US10768960B2 (en) Method for affinity binding of interrupt of virtual network interface card, and computer device
CN110837407B (zh) 无服务器云服务系统及其资源管理方法以及电子设备
CN110300328B (zh) 一种视频播放控制方法、装置及可读存储介质
CN110955499B (zh) 处理器核心配置方法、装置、终端及存储介质
US20220230271A1 (en) Full screen processing in multi-application environments
JP7100154B6 (ja) プロセッサコアのスケジューリング方法、装置、端末及び記憶媒体
US9191417B2 (en) Cross-process media handling in a voice-over-internet protocol (VOIP) application platform
CN116320469B (zh) 一种虚拟化视频编解码系统及方法、电子设备和存储介质
US10318343B2 (en) Migration methods and apparatuses for migrating virtual machine including locally stored and shared data
CN116578422A (zh) 资源分配方法和电子设备
CN114265742B (zh) 虚拟终端的管控方法及装置、系统、电子设备、存储介质
CN116820527B (zh) 程序升级方法、装置、计算机设备和存储介质
US20150381766A1 (en) Application transfer system, application transfer method, terminal, and program
CN116627644B (zh) 计算资源调度方法、装置、设备及存储介质
CN105677481B (zh) 一种数据处理方法、系统及电子设备
CN105100180A (zh) 集群节点动态加载的方法、装置及系统
US9569241B2 (en) Sharing devices assigned to virtual machines using runtime exclusion
WO2022199335A1 (zh) 服务器部件固件升级的控制方法、装置、设备及存储介质
WO2015184902A1 (zh) 一种智能分屏的并发处理方法及相应的智能终端
HK40069612A (zh) 资源配置方法和装置、电子设备及计算机可读存储介质
CN115344352A (zh) 一种虚拟化系统运行方法、装置、设备和介质
CN118733196B (zh) 基于数据处理单元的虚拟机启动控制方法及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22810425

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22810425

Country of ref document: EP

Kind code of ref document: A1