A method and device for hot migration of cloud host, cloud platform, and processor-readable storage medium

By obtaining the remaining resources of the physical host and the occupancy and value of the cloud host, the hot migration of the cloud host is realized, which solves the problem of resource waste in the cloud platform and improves resource utilization and the dynamic adjustment ability of cloud host distribution.

CN115421903BActive Publication Date: 2024-10-18CHINA TELECOM CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210968321.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-12
Publication Date
2024-10-18
Estimated Expiration
2042-08-12

AI Technical Summary

Technical Problem

In the existing technology, it is difficult to efficiently solve the problem of wasting physical host resources on cloud platforms with normal loads. Especially in private cloud platforms such as government clouds, due to load limitations, live migration cannot be performed and it is difficult to fully utilize resources.

Method used

By obtaining the remaining number of processor cores and memory of the physical host, selecting the target host, and based on the occupancy and value of the cloud host, determining the combined operating resource occupancy and usage value of the cloud host to achieve live migration of the cloud host. To optimize resource allocation and utilization.

Benefits of technology

It effectively improves the resource utilization of the physical host, reduces the waste of processor cores or memory, and ensures that the cloud platform can dynamically adjust the distribution of cloud hosts while maintaining normal operation, and maintain the operating status of the platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115421903B_ABST
    Figure CN115421903B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for hot migration of a cloud host, a cloud platform, and a processor-readable storage medium, which are applied to a cloud platform. The cloud platform runs multiple cloud hosts based on multiple physical host machines. The method includes: respectively obtaining the remaining number of processor cores and the remaining amount of memory of the physical host machines; based on the remaining number of processor cores and the remaining amount of memory of the physical host machines, selecting at least two physical host machines as target host machines; based on the number of processor cores and the amount of memory occupied by the cloud host, and a preset cloud host value, determining the resource occupation and use value of different cloud hosts running in combination on the target host machine; based on the resource occupation and use value of different cloud hosts running in combination on the target host machine, determining at least one target cloud host to be run on the target host machine; and hot migrating the target cloud host to the target host machine to improve the resource utilization of the physical host machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a cloud host hot migration method and device, a cloud platform, and a processor-readable storage medium. Background Art

[0002] A cloud platform is a platform that provides computing, network and storage capabilities based on hardware and software resources. Generally speaking, a cloud platform can have multiple cloud hosts running on multiple physical hosts. A physical host can be a hardware device that supports the operation of a cloud host in a cloud platform. A cloud host can be an independent host virtualized on the basis of a physical host. A cloud platform can provide users with cloud hosts with different CPU performance and memory performance according to user needs.

[0003] In the prior art, since users have many personalized demands for cloud hosts, the specifications of cloud hosts are often not uniform, which easily leads to a large number of surplus resources in the physical host. In general, cloud hosts can be migrated from physical hosts with higher loads to cloud hosts with lower loads to ensure the normal operation of the cloud platform as a whole. At the same time, the resources of the physical host can be more fully utilized to reduce resource waste. However, for private cloud platforms such as government clouds, in order to ensure the stable operation of the cloud platform, the load of the physical host is usually restricted to ensure that hot migration will not occur due to high load. Then in this case, the cloud platform cannot migrate cloud hosts based on load, which makes it difficult to efficiently solve the problem of waste of physical host resources of the cloud platform for cloud platforms with normal loads. Summary of the invention

[0004] The embodiments of the present invention provide a cloud host hot migration method and device, a cloud platform, and a processor-readable storage medium to solve the problem in the prior art that it is difficult to efficiently solve the waste of physical host machine resources of a cloud platform with normal load.

[0005] In a first aspect, an embodiment of the present invention provides a method for hot migration of a cloud host, which is applied to a cloud platform, wherein the cloud platform runs multiple cloud hosts based on multiple physical hosts, and the method includes:

[0006] Respectively obtain the number of remaining processor cores and the amount of remaining memory of the physical host machine;

[0007] Based on the remaining number of processor cores and the remaining amount of memory of the physical host machine, at least two physical host machines are selected as target host machines;

[0008] Based on the number of processor cores and memory occupied by the cloud host, and the preset cloud host value, determine the resource occupation and usage value of the combination of different cloud hosts running on the target host machine;

[0009] Determine at least one target cloud host to be run on the target host based on resource usage and usage value of the combination of the different cloud hosts running on the target host;

[0010] Hot migrate the target cloud host to the target host machine.

[0011] Optionally, the step of selecting at least one physical host machine as the target host machine based on the number of remaining processor cores and the amount of remaining memory of the physical host machine includes:

[0012] Obtain the number of processor cores and memory capacity of the entire cloud platform;

[0013] Determine the ratio of the number of processor cores and the amount of memory of the entire cloud platform to obtain an overall processor-memory ratio;

[0014] Calculating theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores and the remaining memory of the physical host machine;

[0015] Based on the theoretical remaining resources of the physical host machines, at least two physical host machines are selected as target host machines.

[0016] Optionally, the step of calculating the theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory includes:

[0017] Determine the average number of processor cores and the average amount of memory of cloud hosts in the cloud platform;

[0018] Determine whether the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of a preset core multiple, and whether the remaining amount of memory of the physical host machine is greater than the average amount of memory of a preset memory multiple;

[0019] If the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of the preset core multiples, and the remaining memory of the physical host machine is greater than the average memory of the preset memory multiples, the overall processor-memory ratio is used as the target processor-memory ratio;

[0020] If the number of remaining processor cores of the physical host machine is not greater than the average number of processor cores of the preset core multiples, or the remaining amount of memory of the physical host machine is not greater than the average amount of memory of the preset memory multiples, determine the target processor-memory ratio corresponding to the physical host machine according to the remaining asset value of the physical host machine;

[0021] The theoretical remaining resources of the physical host machine are calculated using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory amount.

[0022] Optionally, the step of determining a target processor memory ratio corresponding to the physical host machine according to the remaining asset value of the physical host machine includes:

[0023] Obtaining the average purchase price per core of the processor corresponding to the physical host machine for building the cloud platform, and the average purchase price per storage unit of the memory;

[0024] Obtaining at least one common processor-memory ratio of a cloud host in the cloud platform;

[0025] using the common processor memory ratio and the overall processor memory ratio as candidate processor memory ratios;

[0026] Based on the candidate processor-to-memory ratio, the average purchase price per core, the average purchase price per storage unit, the remaining number of processor cores and the remaining memory of the physical host machine, respectively calculate the remaining asset value of the physical host machine under different candidate processor-to-memory ratios;

[0027] The candidate processor memory ratio corresponding to the remaining asset value that meets the value condition is used as the target processor memory ratio.

[0028] Optionally, the step of obtaining at least one common processor memory ratio of a cloud host in the cloud platform includes:

[0029] Obtaining configuration specifications of the cloud host in the cloud platform; the configuration specifications include the number of processor cores and the amount of memory;

[0030] Sort the configuration specifications according to the usage quantity of the configuration specifications from large to small, and select the configuration specifications whose sorting position is before the preset sequence as the commonly used specifications;

[0031] The ratio of the number of processor cores and the amount of memory corresponding to common specifications is taken as the common processor-memory ratio.

[0032] Optionally, the step of calculating the theoretical remaining resources of the physical host machine by using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory includes:

[0033] Calculate the theoretical number of remaining processor cores using the target processor-to-memory ratio and the remaining memory of the physical host machine;

[0034] Selecting a first target value between the theoretical remaining number of processor cores and the remaining number of processor cores, and calculating a difference between the remaining number of processor cores and the first target value as the remaining resource of the number of processor cores;

[0035] Calculate theoretical remaining memory using the target processor-to-memory ratio and the number of remaining processor cores of the physical host machine;

[0036] Selecting a second target value between the theoretical remaining memory amount and the remaining memory amount, and calculating a difference between the remaining memory amount and the second target value as the remaining memory resource;

[0037] The remaining resources of the number of processor cores and the remaining resources of the memory are taken as theoretical remaining resources of the physical host machine.

[0038] Optionally, the theoretical remaining resources include processor core number remaining resources and memory remaining resources;

[0039] The step of selecting at least two physical hosts as target hosts based on the theoretical remaining resources of the physical hosts includes:

[0040] Select at least two physical hosts as hosts to be grouped;

[0041] Calculating the sum of the remaining resources of the processor cores of the host machines to be grouped to obtain the comprehensive remaining resources of the processor cores;

[0042] Calculating the sum of the remaining memory resources of the host machines to be grouped to obtain the comprehensive remaining memory resources;

[0043] If the ratio of the comprehensive processor core number remaining resources to the comprehensive memory remaining resources is close to the overall processor memory ratio, the host machines to be grouped are taken as target host machines and form a target host machine group.

[0044] Optionally, the step of determining the resource usage and usage value of the cloud host running on the target host machine based on the number of processor cores, the amount of memory occupied by the cloud host, and the value of the cloud host includes:

[0045] Obtaining a cloud host running on the target host as the cloud host to be allocated;

[0046] Obtaining the number of processor cores, memory volume, and cloud host value occupied by the cloud host to be allocated;

[0047] Based on the preset processor over-commitment ratio, the preset memory over-commitment ratio, the number of processor cores occupied by the cloud host to be allocated, the amount of memory, and the cloud host value, determine the resource occupancy and usage value of the combination of different cloud hosts to be allocated running on the target host machine.

[0048] Optionally, the step of determining at least one target cloud host to be run on the target host based on resource usage and usage value of the combination of the different cloud hosts running on the target host includes:

[0049] Based on the serial number sequence of the target host machines, selecting a target host machine as the current host machine;

[0050] Determine at least one target cloud host to be run on the current host based on the resource occupation and usage value of the cloud host to be allocated running on the target host;

[0051] Deleting the target cloud host from the cloud hosts to be allocated;

[0052] Execute the steps of selecting a target host as the current host based on the numbering sequence of the target host machines; determining at least one target cloud host to be run on the current host machine based on the resource occupancy and usage value of the cloud host to be allocated running on the target host machine; and deleting the target cloud host from the cloud host to be allocated until the allocation of target cloud hosts corresponding to all the target hosts is completed.

[0053] Optionally, the step of hot migrating the target cloud host to the target host machine includes:

[0054] Generate a migration task table based on the correspondence between the target host machine and the target cloud host;

[0055] Based on the migration task table, a hot migration task is executed through a preset hot migration interface; the hot migration task is used to migrate a target cloud host to a corresponding target host machine;

[0056] Determine whether the hot migration task is completed through a preset task query interface;

[0057] If the hot migration task is completed, a new hot migration task is issued through a preset hot migration interface based on the migration task table until the migration of the target cloud host is completed.

[0058] In a second aspect, an embodiment of the present invention provides a hot migration device for a cloud host, which is applied to a cloud platform, wherein the cloud platform runs multiple cloud hosts based on multiple physical hosts, and the method includes:

[0059] An acquisition module, used to respectively acquire the number of remaining processor cores and the amount of remaining memory of the physical host machine;

[0060] A selection module, configured to select at least two physical host machines as target host machines based on the number of remaining processor cores and the amount of remaining memory of the physical host machines;

[0061] An operation occupancy determination module is used to determine the resource occupancy and usage value of a combination of different cloud hosts running on the target host machine based on the number of processor cores and memory occupied by the cloud host and a preset cloud host value;

[0062] A target cloud host determination module, configured to determine at least one target cloud host to be run on the target host based on resource occupation and usage value of the combination of the different cloud hosts running on the target host;

[0063] The hot migration module is used to hot migrate the target cloud host to the target host machine.

[0064] Optionally, the selection module includes:

[0065] The overall resource acquisition submodule is used to obtain the number of processor cores and memory capacity of the entire cloud platform;

[0066] The overall processor-memory ratio determination submodule is used to determine the ratio of the number of processor cores and the amount of memory of the entire cloud platform to obtain the overall processor-memory ratio;

[0067] Theoretical remaining resource calculation submodule, used to calculate the theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores and the remaining memory of the physical host machine;

[0068] The target host determination submodule is used to select at least two physical hosts as target hosts based on the theoretical remaining resources of the physical hosts.

[0069] Optionally, the theoretical remaining resource calculation submodule includes:

[0070] An average resource acquisition unit, used to determine the average number of processor cores and average memory of cloud hosts in the cloud platform;

[0071] A comparison unit, configured to determine whether the number of remaining processor cores of the physical host machine is greater than an average number of processor cores of a preset core multiple, and whether the amount of remaining memory of the physical host machine is greater than an average amount of memory of a preset memory multiple;

[0072] a first target processor-memory ratio determining unit, configured to use the overall processor-memory ratio as the target processor-memory ratio if the number of remaining processor cores of the physical host machine is greater than an average number of processor cores of a preset core multiple and the amount of remaining memory of the physical host machine is greater than an average amount of memory of a preset memory multiple;

[0073] a second target processor-memory ratio determining unit, configured to determine a target processor-memory ratio corresponding to the physical host machine according to a remaining asset value of the physical host machine if the number of remaining processor cores of the physical host machine is not greater than an average number of processor cores of a preset core multiple, or the remaining amount of memory of the physical host machine is not greater than an average amount of memory of a preset memory multiple;

[0074] The theoretical remaining resource calculation unit is used to calculate the theoretical remaining resources of the physical host machine by using the target processor-memory ratio, the remaining number of processor cores of the physical host machine, and the remaining memory amount.

[0075] Optionally, the second target processor memory ratio determining unit includes:

[0076] The average price acquisition subunit is used to obtain the average purchase price per core of the processor corresponding to the physical host machine for building the cloud platform, and the average purchase price per storage unit of the memory;

[0077] A common processor-memory ratio acquisition subunit, used to acquire at least one common processor-memory ratio of a cloud host in the cloud platform;

[0078] a candidate memory ratio determination subunit, configured to use the commonly used processor memory ratio and the overall processor memory ratio as candidate processor memory ratios;

[0079] a remaining asset value calculation subunit, configured to calculate the remaining asset value of the physical host machine under different candidate processor-memory ratios based on the candidate processor-memory ratio, the average purchase price per core number, the average purchase price per storage unit, the remaining number of processor cores and the remaining memory of the physical host machine;

[0080] The target processor memory ratio determination subunit is used to use the candidate processor memory ratio corresponding to the remaining asset value that meets the value condition as the target processor memory ratio.

[0081] Optionally, the commonly used processor-memory ratio acquisition subunit is specifically used to obtain configuration specifications of the cloud host in the cloud platform; the configuration specifications include the number of processor cores and the amount of memory; the configuration specifications are sorted from large to small according to the number of configuration specifications used, and the configuration specifications whose sorting position is before a preset order are selected as commonly used specifications; the ratio of the number of processor cores and the amount of memory corresponding to the commonly used specifications is used as the commonly used processor-memory ratio.

[0082] Optionally, the theoretical remaining resource calculation unit includes:

[0083] A theoretical remaining processor core number calculation subunit, used to calculate the theoretical remaining processor core number by using the target processor memory ratio and the remaining memory amount of the physical host machine;

[0084] A processor core number remaining resource determination subunit is used to select a first target value from the theoretical remaining processor core number and the remaining processor core number, and calculate the difference between the remaining processor core number and the first target value as the processor core number remaining resource;

[0085] A theoretical remaining memory amount calculation subunit, used to calculate the theoretical remaining memory amount by using the target processor memory ratio and the number of remaining processor cores of the physical host machine;

[0086] The memory remaining resource determination subunit is used to select a second target value from the theoretical remaining memory amount and the remaining memory amount, and calculate the difference between the remaining memory amount and the second target value as the memory remaining resource;

[0087] The theoretical remaining resource calculation subunit is used to use the processor core number remaining resource and the memory remaining resource as the theoretical remaining resource of the physical host machine.

[0088] Optionally, the theoretical remaining resources include processor core number remaining resources and memory remaining resources;

[0089] The target host determination submodule includes:

[0090] A host machine selection unit to be grouped is used to select at least two physical host machines as host machines to be grouped;

[0091] A comprehensive processor core number remaining resource calculation unit, used to calculate the sum of the processor core number remaining resources of the host machines to be grouped to obtain the comprehensive processor core number remaining resources;

[0092] A comprehensive memory remaining resource calculation unit, used for calculating the sum of the memory remaining resources of the host machines to be grouped to obtain the comprehensive memory remaining resources;

[0093] The target host machine determination unit is used to take the host machines to be grouped as target host machines and form a target host machine group if the ratio of the comprehensive processor core number remaining resources to the comprehensive memory remaining resources is similar to the overall processor memory ratio.

[0094] Optionally, the operation occupancy determination module includes:

[0095] A submodule for determining a cloud host to be allocated, used for obtaining a cloud host running on the target host as the cloud host to be allocated;

[0096] A cloud host information acquisition submodule is used to obtain the number of processor cores, memory amount, and cloud host value occupied by the cloud host to be allocated;

[0097] The operation occupancy determination submodule is used to determine the resource occupancy and usage value of the combination of different cloud hosts to be allocated running on the target host machine based on the preset processor over-opening ratio, the preset memory over-opening ratio, the number of processor cores occupied by the cloud hosts to be allocated, the amount of memory, and the value of the cloud hosts.

[0098] Optionally, the target cloud host determination module includes:

[0099] A current host determination submodule, configured to select a target host as the current host based on the serial number sequence of the target host;

[0100] Determine at least one target cloud host to be run on the current host based on the resource occupation and usage value of the cloud host to be allocated running on the target host;

[0101] The target cloud host determination submodule deletes the target cloud host from the cloud hosts to be allocated;

[0102] The submodule is repeatedly executed to select a target host as the current host based on the numbering sequence of the target host; determine at least one target cloud host to be run on the current host based on the resource occupancy and usage value of the cloud host to be allocated running on the target host; and delete the target cloud host from the cloud host to be allocated until the allocation of target cloud hosts corresponding to all the target hosts is completed.

[0103] Optionally, the thermal migration module includes:

[0104] A task table generation submodule, used to generate a migration task table based on the corresponding relationship between the target host machine and the target cloud host;

[0105] A first task issuing submodule is used to issue a hot migration task through a preset hot migration interface based on the migration task table; the hot migration task is used to migrate a target cloud host to a corresponding target host machine;

[0106] The task query submodule is used to determine whether the hot migration task is completed through a preset task query interface;

[0107] The second task issuing submodule is used to issue a new hot migration task through a preset hot migration interface based on the migration task table if the hot migration task is completed, until the migration of the target cloud host is completed.

[0108] In a third aspect, an embodiment of the present invention provides a cloud platform, characterized in that it includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;

[0109] The memory is used to store computer programs;

[0110] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0111] In a fourth aspect, an embodiment of the present invention provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, wherein the computer program is used to enable the processor to execute the communication method described in the first aspect above, or to execute the communication method described in the second aspect above.

[0112] In an embodiment of the present invention, the remaining number of processor cores and the remaining amount of memory of the physical host are obtained respectively; based on the remaining number of processor cores and the remaining amount of memory of the physical host, at least two physical hosts are selected as target hosts; based on the number of processor cores, the amount of memory, and the value of the cloud host occupied by the cloud host, the resource occupation and use value of the combination of different cloud hosts running on the target host are determined; based on the resource occupation and use value of the combination of different cloud hosts running on the target host, at least one target cloud host to be run on the target host is determined; and the target cloud host is hot migrated to the target host. The present invention quickly selects a physical host that may have remaining resources as the physical host that currently needs to be adjusted through the remaining number of processor cores and the remaining amount of memory of the physical host, and determines the preferred configuration scheme of the cloud host based on the resource occupation and use value of the combination of different cloud hosts running on the target host, thereby further completing the hot migration of the cloud host based on the preferred configuration scheme. On the one hand, the cloud host after hot migration can reasonably occupy more resources of the physical host machine, and on the other hand, it can reduce the situation where the number of remaining processor cores in the physical host machine is much larger than the remaining memory or the remaining memory is much larger than the number of remaining processor cores, resulting in the situation that the physical host machine cannot continue to allocate new cloud hosts even though there are remaining resources, effectively improving the resource utilization of the physical host machine. At the same time, the hot migration method of the cloud host of the embodiment of the present invention can be applied in the process of cloud platform operation, real-time monitoring of the occupied resources of the cloud host in the cloud platform and the remaining resources of the physical host machine, generating the preferred configuration plan of the cloud host, hot migration of the cloud host while maintaining the normal operation of the cloud platform, and realizing the continuous and dynamic adjustment of the distribution of the cloud host during the operation of the cloud platform, so as to keep the cloud platform in a good operating state. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0114] Figure 1 A schematic diagram of the structure of a cloud platform provided by an embodiment of the present invention;

[0115] Figure 2One of the flow charts of the hot migration method of the cloud host provided by the embodiment of the present invention;

[0116] Figure 3 Flow chart 2 of the hot migration method of a cloud host provided by an embodiment of the present invention;

[0117] Figure 4 A flow chart of a cloud host migration method provided by an embodiment of the present invention;

[0118] Figure 5 A structural block diagram of cloud host migration provided by an embodiment of the present invention;

[0119] Figure 6 A structural block diagram of a network device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0120] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0121] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.

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

[0123] The embodiments of the present application provide a method and device for hot migration of a cloud host, a cloud platform, and a processor-readable storage medium to solve the problem of low resource utilization of a physical host machine in the prior art.

[0124] Among them, the method and the device are based on the same application concept. Since the method and the device solve the problem in a similar principle, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.

[0125] In order to facilitate understanding of the hot migration method of the cloud host in the embodiment of the present invention, the following contents are first introduced:

[0126] Figure 1The schematic diagram of the structure of a cloud platform provided by an embodiment of the present invention is shown. The cloud platform 100 can be operated based on multiple physical hosts 101. At least one cloud host 102 can be operated in each physical host 101, so that multiple cloud hosts 102 can be operated in the cloud platform 100.

[0127] In the embodiment of the present invention, in the case that the physical host may have unused remaining resources, the remaining resources of the physical host are quickly estimated based on the remaining number of processor cores and the remaining memory of the physical host. The target host that needs to be adjusted is selected, and the appropriate cloud host is hot migrated to the target host, so that the distribution of cloud hosts in the cloud platform can be dynamically adjusted to improve the utilization rate of platform resources.

[0128] Figure 2 The schematic diagram of the process of a hot migration method of a cloud host provided by an embodiment of the present invention is shown. The hot migration method of the cloud host can be applied to a cloud platform, such as Figure 2 As shown, the method may include the following steps:

[0129] Step 201, respectively obtaining the number of remaining processor cores and the amount of remaining memory of the physical host machine;

[0130] Specifically, in order to select a physical host machine that is currently suitable for adjustment in the cloud platform, the remaining number of processor cores and the remaining memory of some or all physical hosts in the cloud platform can be obtained respectively, so as to estimate the remaining available resources of the physical hosts.

[0131] Step 202, based on the remaining number of processor cores and the remaining memory of the physical host machine, select at least two physical host machines as target host machines;

[0132] After obtaining the remaining number of processor cores and the remaining amount of memory of the physical host, the remaining available resources of the physical host can be estimated, and a physical host suitable for adjusting the cloud host it carries can be selected as the target host.

[0133] Specifically, the target host machine may have a large number of remaining processor cores and / or a large amount of remaining memory. If the target host machine has a large number of remaining processor cores and a large amount of remaining memory, the resources of the target host machine may not be fully utilized. If the target host machine has a large number of remaining processor cores or a large amount of remaining memory, the target host machine may not be able to continue to configure a new cloud host, resulting in a waste of processor cores or memory, making the overall resource utilization of the cloud platform low.

[0134] Step 203, based on the number of processor cores, memory amount, and cloud host value occupied by the cloud host, determine the resource occupation and usage value of the combination of different cloud hosts running on the target host machine;

[0135] Specifically, the embodiment of the present invention can determine the preferred allocation scheme of different cloud host combinations in each target host based on the resource usage and usage value of the cloud host running on the target host. The resource usage and usage value of the cloud host running on the target host can be determined based on the number of processor cores, memory amount, and cloud host value occupied by the cloud host.

[0136] The number of processor cores occupied by the cloud host may refer to the number of cores of the physical host machine's central processor that the cloud host needs to occupy. The amount of memory occupied by the cloud host may refer to the amount of memory of the physical host machine that the cloud host needs to occupy. The value of the cloud host may refer to the price at which the cloud host is sold to the user. In a specific implementation, the administrator of the cloud platform may set a selling price for the cloud host based on the number of processor cores and memory occupied by the cloud host, the purpose of the cloud host, the length of time the cloud host is rented, and the personalized needs of the user. If the user uses this selling price to purchase the cloud host, the selling price may be used as the value of the cloud host.

[0137] Specifically, all cloud hosts running in at least two target hosts can be used as cloud hosts that need to be reallocated. When different cloud hosts are combined and run on the current target host, the resources occupied by the target host and the total value of the cloud hosts can be calculated respectively. The number of processor cores and memory required for the combination of cloud hosts to run on the target host can be used as the resource occupation of the current cloud host combination running on the target host, and the total value of the cloud host combination can be used as the use value of the target host.

[0138] Step 204, determining at least one target cloud host to be run on the target host based on the resource occupation and usage value of the combination of the different cloud hosts running on the target host;

[0139] Specifically, if the cloud host running on the target host can occupy as many resources of the target host as possible without exceeding the load capacity of the target host, then the current target host can be considered to have a good resource occupancy rate. If the cloud host running on the target host can have a higher value, the target host can have a higher use value, and the operation of the target host can have a better profit. For each target host, based on the resource occupancy and use value of the combination of different cloud hosts running on the target host, at least one target cloud host to be run on the target host can be determined so that the target host can have a higher resource occupancy and a higher use value.

[0140] In a specific implementation, the target cloud host may be selected by dynamic planning based on the resource usage and usage value of a combination of cloud hosts running on the target host.

[0141] Step 205: hot migrate the target cloud host to the target host machine.

[0142] After determining the target cloud host corresponding to each target host, if the target cloud host is different from the cloud host currently running in the target host, then the cloud host needs to be hot migrated. When the cloud platform or the target host that needs to be adjusted is in a business idle state, the target cloud host can be hot migrated to the target host to complete the adjustment of the cloud host, so that the distribution of cloud hosts can be continuously and dynamically adjusted during the operation of the cloud platform to keep the cloud platform in a good operating state.

[0143] Since hot migration may not affect business operations, the cloud host may also be hot migrated in other time periods other than the business idle state according to actual needs, and the present invention does not impose any limitation on this.

[0144] In an embodiment of the present invention, the remaining number of processor cores and the remaining amount of memory of the physical host are obtained respectively; based on the remaining number of processor cores and the remaining amount of memory of the physical host, at least two physical hosts are selected as target hosts; based on the number of processor cores, the amount of memory, and the value of the cloud host occupied by the cloud host, the resource occupation and use value of the combination of different cloud hosts running on the target host are determined; based on the resource occupation and use value of the combination of different cloud hosts running on the target host, at least one target cloud host to be run on the target host is determined; and the target cloud host is hot migrated to the target host. The present invention quickly selects a physical host that may have remaining resources as the physical host that currently needs to be adjusted through the remaining number of processor cores and the remaining amount of memory of the physical host, and determines the preferred configuration scheme of the cloud host based on the resource occupation and use value of the combination of different cloud hosts running on the target host, thereby further completing the hot migration of the cloud host based on the preferred configuration scheme. On the one hand, the cloud host after hot migration can reasonably occupy more resources of the physical host machine, and on the other hand, it can reduce the situation where the number of remaining processor cores in the physical host machine is much larger than the remaining memory or the remaining memory is much larger than the number of remaining processor cores, resulting in the situation that the physical host machine cannot continue to allocate new cloud hosts even though there are remaining resources, effectively improving the resource utilization of the physical host machine. At the same time, the hot migration method of the cloud host of the embodiment of the present invention can be applied in the process of cloud platform operation, real-time monitoring of the occupied resources of the cloud host in the cloud platform and the remaining resources of the physical host machine, generating the preferred configuration plan of the cloud host, hot migration of the cloud host while maintaining the normal operation of the cloud platform, and realizing the continuous and dynamic adjustment of the distribution of the cloud host during the operation of the cloud platform, so as to keep the cloud platform in a good operating state.

[0145] Figure 3 The schematic diagram of the process of a hot migration method of a cloud host provided by an embodiment of the present invention is shown. The hot migration method of the cloud host can be applied to a cloud platform, such as Figure 2 As shown, the method may include the following steps:

[0146] Step 301, respectively obtaining the number of remaining processor cores and the amount of remaining memory of the physical host machine;

[0147] Specifically, in order to select a physical host machine that is currently suitable for adjustment in the cloud platform, the remaining number of processor cores and the remaining memory of some or all physical hosts in the cloud platform can be obtained respectively, so as to estimate the remaining available resources of the physical hosts.

[0148] Step 302, obtaining the number of processor cores and memory capacity of the entire cloud platform;

[0149] After obtaining the remaining number of processor cores and the remaining amount of memory of the physical host, the remaining available resources of the physical host can be estimated, and a physical host suitable for adjusting the cloud host it carries can be selected as the target host.

[0150] Specifically, the target host machine may have a large number of remaining processor cores and / or a large amount of remaining memory. If the target host machine has a large number of remaining processor cores and a large amount of remaining memory, the resources of the target host machine may not be fully utilized. If the target host machine has a large number of remaining processor cores or a large amount of remaining memory, the target host machine may not be able to continue to configure a new cloud host, resulting in a waste of processor cores or memory, making the overall resource utilization of the cloud platform low.

[0151] In this case, if the cloud platform needs to improve the overall resource utilization, it can consider making the ratio of the number of processor cores and the amount of memory occupied by the physical host machine or a combination of physical host machines close to the ratio of the number of processor cores and the amount of memory of the cloud platform as a whole. In this case, the cloud platform can more easily obtain maximum resource utilization.

[0152] This allows us to obtain the number of processor cores and memory of the entire cloud platform, so that we can evaluate the need to adjust the physical host of the cloud server later.

[0153] Step 303, determining the ratio of the number of processor cores and the amount of memory of the entire cloud platform to obtain the overall processor-memory ratio;

[0154] Whether the remaining number of processor cores and / or the remaining amount of memory of the physical host machine is surplus can be measured by the overall processor-memory ratio of the cloud platform as a whole. Specifically, the processor-memory ratio can be the ratio of the number of processor cores and the amount of memory, and thus the overall processor-memory ratio can be the ratio of the number of processor cores and the amount of memory of the cloud platform as a whole.

[0155] In a specific implementation, the sum of the number of processor cores of all cloud hosts in the cloud platform can be calculated as the number of processor cores of the entire cloud platform; and the sum of the memory amounts of all cloud hosts in the cloud platform can be calculated as the memory amount of the entire cloud platform. Then, the ratio of the number of processor cores and memory amounts of the entire cloud platform is used as the overall processor-memory ratio.

[0156] Step 304, calculating the theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores and the remaining memory of the physical host machine;

[0157] In order to find a physical host machine that is currently suitable for cloud host adjustment, the theoretical remaining resources of the physical host machine can be calculated. Thus, the theoretical remaining resources of the physical host machine can be calculated based on the overall processor-memory ratio, the remaining number of processor cores of the physical host machine, and the remaining memory amount.

[0158] The step of calculating the theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory amount includes:

[0159] S11, determining the average number of processor cores and the average amount of memory of cloud hosts in the cloud platform;

[0160] In the cloud platform, there are two situations where you can consider adjusting the physical host of the cloud host. One is that the remaining resources are significantly more than other physical hosts, and the physical host is obviously not fully utilized. The other is that the remaining resources are relatively small, but when the remaining resources are measured based on asset value, the physical host still has more resources worth using.

[0161] Therefore, for different types of physical hosts, different methods can be used to calculate their theoretical remaining resources, so as to more reasonably find out the physical host that is suitable for cloud host adjustment.

[0162] In order to determine whether the physical host machine has more remaining resources, the average number of processor cores and the average amount of memory of the cloud hosts in the cloud platform may be determined first.

[0163] In a specific implementation, the cloud platform may provide a hot migration API (Application Programming Interface). Through the hot migration API, the number of processor cores and memory of each cloud host can be obtained, and the average number of processor cores and average memory of the cloud host can be further calculated and determined.

[0164] S12, determining whether the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of a preset core multiple, and whether the remaining memory amount of the physical host machine is greater than the average memory amount of a preset memory multiple;

[0165] After obtaining the average number of processor cores and the average amount of memory of the cloud host, it is possible to determine whether the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of the preset core multiples, and whether the remaining amount of memory of the physical host machine is greater than the average amount of memory of the preset memory multiples, so as to determine whether the physical host machine has more remaining resources.

[0166] Among them, the preset core multiple and the preset memory multiple can be determined according to actual needs, such as 2 times, 5 times, 7 times, 10 times, etc.

[0167] S13, if the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of the preset core multiples, and the remaining memory amount of the physical host machine is greater than the average memory amount of the preset memory multiples, the overall processor-memory ratio is used as the target processor-memory ratio;

[0168] If the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of the preset core multiples, and the remaining amount of memory of the physical host machine is greater than the average amount of memory of the preset memory multiples, then it can be considered that the overall resources of the physical host machine are relatively large at this time. At this time, the remaining resources of the physical host machine can be directly measured based on the overall processor-to-memory ratio.

[0169] S14, if the number of remaining processor cores of the physical host machine is not greater than the average number of processor cores of the preset core multiples, or the remaining amount of memory of the physical host machine is not greater than the average amount of memory of the preset memory multiples, determine the target processor-memory ratio corresponding to the physical host machine according to the remaining asset value of the physical host machine;

[0170] If the remaining number of processor cores of the physical host machine is not greater than the average number of processor cores of the preset core multiples, or the remaining amount of memory of the physical host machine is not greater than the average amount of memory of the preset memory multiples, then the remaining resources of the physical host machine are small, and adjusting the physical host machine may not be able to improve the resource utilization of the cloud platform. In this case, it is necessary to further determine the target processor-to-memory ratio corresponding to the physical host machine based on the remaining asset value of the physical host machine, so as to subsequently determine whether the physical host machine is worth adjusting the cloud host.

[0171] The step of determining the target processor memory ratio corresponding to the physical host machine according to the remaining asset value of the physical host machine includes:

[0172] S21, obtaining the average purchase price per core of the processor corresponding to the physical host machine for building the cloud platform, and the average purchase price per storage unit of the memory;

[0173] In order to calculate the theoretical remaining resources based on the remaining asset value of the physical host, the average purchase price per core of the processor corresponding to the physical host for building the cloud platform and the average purchase price per storage unit of the memory can be first obtained. For example, the average purchase price per processor core of the processor corresponding to the physical host for building the cloud platform and the average purchase price per GB of memory can be obtained.

[0174] S22, obtaining at least one common processor-memory ratio of a cloud host in the cloud platform;

[0175] When the processor-memory ratio is different, the remaining resources of the physical host machine that can be used to configure the cloud host may be different. Therefore, at least one commonly used processor-memory ratio of the cloud host in the cloud platform can be further obtained to determine the remaining resources of the physical host machine at different processor-memory ratios.

[0176] In one embodiment of the present invention, the step of obtaining at least one common processor memory ratio of a cloud host in the cloud platform includes:

[0177] S31, obtaining configuration specifications of a cloud host in the cloud platform; the configuration specifications include the number of processor cores and the amount of memory;

[0178] In order to determine the commonly used processor-memory ratio, the configuration specifications of the cloud host in the cloud platform may be first obtained, wherein the configuration specifications may include the number of processor cores and the amount of memory.

[0179] S32, sorting the configuration specifications from large to small according to the usage quantity of the configuration specifications, and selecting the configuration specifications whose sorting positions are before the preset sequence as the commonly used specifications;

[0180] Each configuration specification can be used by at least one cloud host. The configuration specifications can be sorted from large to small according to the number of configuration specifications used. If the sorting position is before the preset sequence, it can be considered that the configuration rule is often used. In this case, the configuration rule can be used as a common specification.

[0181] The preset order may be the second, third, fifth, tenth, etc., and the present invention does not impose any limitation on this.

[0182] S33: The ratio of the number of processor cores and the amount of memory corresponding to the common specifications is used as the common processor-memory ratio.

[0183] After the common specifications are determined, the ratio of the number of processor cores and the amount of memory can be calculated based on the number of processor cores and the amount of memory recorded in the common specifications as the common processor-memory ratio.

[0184] S23, using the common processor memory ratio and the overall processor memory ratio as candidate processor memory ratios;

[0185] The asset value corresponding to the remaining resources of the physical host machine under different processor-memory ratios can be calculated for different processor-memory ratios. Thus, the commonly used processor-memory ratio and the overall processor-memory ratio can be used as candidate processor-memory ratios.

[0186] S24, based on the candidate processor-to-memory ratio, the average purchase price per core, the average purchase price per storage unit, the remaining number of processor cores and the remaining memory of the physical host machine, respectively calculating the remaining asset value of the physical host machine under different candidate processor-to-memory ratios;

[0187] For each physical host machine whose remaining number of processor cores is not greater than the average number of processor cores of a preset core multiple, or whose remaining amount of memory is not greater than the average amount of memory of a preset memory multiple, the remaining asset value of the physical host machine under different candidate processor-memory ratios can be calculated based on the candidate processor-memory ratio, the average purchase price per core, the average purchase price per storage unit, the remaining number of processor cores of the physical host machine, and the remaining amount of memory.

[0188] In a specific implementation, the remaining asset value Vr can be calculated using the following formula:

[0189] Vr=Cr*Vc+Mr*Vm-min(Cr / CM,Mr)*(Vm+CM*Vc)

[0190] Among them, Cr is the number of processor cores remaining in the physical host machine, Vc is the average purchase price per core of the processor in the cloud platform, Mr is the amount of memory remaining in the physical host machine, Vm is the average purchase price per storage unit of memory in the cloud platform, and CM is the candidate processor memory ratio.

[0191] S25, taking the candidate processor memory ratio corresponding to the remaining asset value that meets the value condition as the target processor memory ratio.

[0192] Thereafter, a target processor memory ratio may be selected based on the remaining asset value, and the candidate processor memory ratio corresponding to the remaining asset value that meets the value condition may be used as the target processor memory ratio.

[0193] The value condition may be the maximum remaining asset value, the minimum remaining asset value, etc., which is not limited in the present invention. Generally speaking, if the physical host machine can still have a large amount of remaining resources when the remaining asset value is the minimum, then the physical host machine can be considered to have the value of cloud host adjustment, and thus the candidate processor memory ratio corresponding to the minimum remaining asset value can be used as the target processor memory ratio.

[0194] S15, calculating the theoretical remaining resources of the physical host machine by using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory amount.

[0195] Specifically, the target processor-memory ratio may be used to calculate the theoretically maximum available remaining resources of the physical host to determine whether the physical host should adjust the value of the cloud host.

[0196] In one embodiment of the present invention, the step of calculating the theoretical remaining resources of the physical host machine by using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory includes:

[0197] S41, calculating the theoretical number of remaining processor cores using the target processor memory ratio and the remaining memory of the physical host machine;

[0198] Specifically, in order to estimate the number of remaining processor cores available in the physical host machine, the target processor-to-memory ratio and the remaining memory amount of the physical host machine may be used to calculate the theoretical number of remaining processor cores.

[0199] S42, selecting a first target value from the theoretical remaining number of processor cores and the remaining number of processor cores, and calculating a difference between the remaining number of processor cores and the first target value as the remaining resource of the number of processor cores;

[0200] A first target value suitable for estimating theoretical remaining resources may be selected between the theoretical remaining number of processor cores and the actual remaining number of processor cores. In practical applications, a smaller value between the theoretical remaining number of processor cores and the actual remaining number of processor cores may be selected as the first target value.

[0201] Thereafter, the difference between the remaining number of processor cores and the first target value may be used as the remaining resource of the number of processor cores.

[0202] S43, calculating a theoretical remaining memory amount by using the target processor memory ratio and the number of remaining processor cores of the physical host machine;

[0203] Specifically, in order to estimate the amount of remaining memory available in the physical host machine, the target processor-to-memory ratio and the number of remaining processor cores of the physical host machine may be used to calculate the theoretical amount of remaining memory.

[0204] S44, selecting a second target value from the theoretical remaining memory amount and the remaining memory amount, and calculating a difference between the remaining memory amount and the second target value as the remaining memory resource;

[0205] A second target value suitable for estimating theoretical remaining resources can be selected between the theoretical remaining memory amount and the remaining memory amount. In practical applications, a smaller value between the theoretical remaining memory amount and the remaining memory amount can be selected as the second target value.

[0206] Thereafter, the difference between the remaining memory amount and the second target value may be used as the remaining memory resource.

[0207] S45, taking the remaining resources of the number of processor cores and the remaining resources of the memory as the theoretical remaining resources of the physical host machine.

[0208] After determining the remaining resources of the number of processor cores and the remaining memory resources, the remaining resources of the number of processor cores and the remaining memory resources can be used as the theoretical remaining resources of the physical host machine.

[0209] In the specific implementation, the remaining resources Cr of the processor cores if and remaining memory resources Mr if The following formula can be used for calculation:

[0210] Cr if =Cr-min(Cr,Mr*CM if )

[0211] Mr if =Mr-min(Cr / CM if ,Mr if )

[0212] Among them, Cr is the number of processor cores remaining in the physical host machine, Mr is the amount of memory remaining in the physical host machine, and CM if is the target processor memory ratio.

[0213] Step 305, based on the theoretical remaining resources of the physical host machines, select at least two physical host machines as target host machines;

[0214] After the theoretical remaining resources of each physical host are calculated, at least two physical hosts suitable for adjustment may be selected as target hosts.

[0215] In one embodiment of the present invention, the theoretical remaining resources include processor core number remaining resources and memory remaining resources;

[0216] The step of selecting at least two physical hosts as target hosts based on the theoretical remaining resources of the physical hosts includes:

[0217] S51, selecting at least two physical host machines as host machines to be grouped;

[0218] Specifically, for the cloud platform, if the ratio of the remaining resources of the processor cores of the physical host machine to the remaining resources of the total memory is close to the overall processor-memory ratio, the resource utilization of the cloud platform can be maximized at this time. Therefore, at least two physical host machines can be selected as the host machines to be grouped to determine a group of physical host machines suitable for adjustment.

[0219] S52, calculating the sum of the remaining resources of the processor cores of the host machines to be grouped to obtain the comprehensive remaining resources of the processor cores;

[0220] The remaining resources of the number of processor cores of all the host machines to be grouped may be added up, and the total value obtained may be used as the comprehensive remaining resources of the number of processor cores.

[0221] S53, calculating the sum of the remaining memory resources of the host machines to be grouped to obtain the comprehensive remaining memory resources;

[0222] The remaining memory resources of all the host machines to be grouped may be summed up, and the obtained total value may be used as the comprehensive remaining memory resources.

[0223] S54: If the ratio of the comprehensive processor core remaining resources to the comprehensive memory remaining resources is close to the overall processor memory ratio, the host machines to be grouped are used as target host machines to form a target host machine group.

[0224] If the ratio of the remaining resources of the combined number of processor cores to the remaining resources of the combined memory of the group is close to the overall processor memory ratio, then optimizing the target host machine can maximize the resource efficiency of the cloud platform. Therefore, the host machines to be grouped can be used as target hosts and form a target host group. In a specific implementation, the number of target hosts in a target host group can be 2 to 3.

[0225] Step 306, based on the number of processor cores, memory amount, and cloud host value occupied by the cloud host, determine the resource occupation and usage value of the combination of different cloud hosts running on the target host machine;

[0226] Specifically, the embodiment of the present invention can determine the preferred allocation scheme of the cloud host in each target host in turn based on the resource occupation and use value of the cloud host running on the target host. The resource occupation and use value of the cloud host running on the target host can be determined based on the number of processor cores, memory amount, and cloud host value occupied by the cloud host.

[0227] The number of processor cores occupied by the cloud host may refer to the number of cores of the central processor of the physical host machine that the cloud host needs to occupy. The amount of memory occupied by the cloud host may refer to the amount of memory of the physical host machine that the cloud host needs to occupy. The value of the cloud host may refer to the price at which the cloud host is sold to the user.

[0228] In one embodiment of the present invention, the step of determining the resource usage and usage value of the cloud host running on the target host machine based on the number of processor cores, the amount of memory occupied by the cloud host, and the value of the cloud host includes:

[0229] S61, obtaining a cloud host running on the target host machine as the cloud host to be allocated;

[0230] Specifically, the redistribution of cloud hosts can be performed between target hosts, so that a better resource utilization rate can be obtained in the target host through the redistribution of cloud hosts. Thus, the cloud hosts running on the target host can be obtained as the cloud hosts to be allocated.

[0231] S62, obtaining the number of processor cores, the amount of memory, and the value of the cloud host occupied by the cloud host to be allocated;

[0232] Thereafter, the number of processor cores, amount of memory, and value of the cloud host to be allocated may be further obtained, so as to subsequently evaluate the resource occupancy and usage value of the cloud host to be allocated running on the target host machine based on the number of processor cores, amount of memory, and value of the cloud host to be allocated.

[0233] S63, based on the preset processor over-use ratio, the preset memory over-use ratio, the number of processor cores occupied by the cloud host to be allocated, the amount of memory, and the cloud host value, determine the resource occupancy and usage value of the combination of different cloud hosts to be allocated running on the target host machine.

[0234] Specifically, since the cloud host may not always be running, the number of processor cores and the amount of memory occupied by the cloud host running in the physical host may actually be greater than the actual number of processor cores and the amount of memory of the physical host. The ratio of the number of processor cores occupied by the cloud host to the actual number of processor cores of the physical host is the processor over-opening ratio, and the ratio of the amount of memory occupied by the cloud host to the actual amount of memory of the physical host is the memory over-opening ratio. In an embodiment of the present invention, the over-opening ratio of the cloud platform can be controlled to ensure the overall stable operation of the cloud platform, and thus, the processor over-opening ratio and the memory over-opening ratio can be preset.

[0235] A dynamic programming algorithm can be used to determine the resource occupancy and usage value of different combinations of cloud hosts to be allocated running on the target host machine based on a preset processor over-commitment ratio, a preset memory over-commitment ratio, the number of processor cores occupied by the cloud hosts to be allocated, the amount of memory, and the value of the cloud hosts.

[0236] The dynamic programming algorithm calculates the resource usage and usage value of the cloud host to be allocated running on the target host machine, which can be expressed by the following formula:

[0237]

[0238] The resource usage and usage value on the target host can be expressed by the total resource value, dp[] is an array of the total resource value of the cloud hosts carried by the target host, CPU[] is an array of the number of processor cores of the cloud hosts in the target host group, MEM[] is an array of the memory amount of the cloud hosts in the target host group, value[] is an array of the cloud host value of the cloud hosts in the target host group, the processor over-use ratio of the target host is defined as j, the memory over-use ratio of the target host is defined as k, and i is the number of cloud hosts on the target host group.

[0239] Step 307, determining at least one target cloud host to be run on the target host based on the resource occupation and usage value of the combination of the different cloud hosts running on the target host;

[0240] In one embodiment of the present invention, the step of determining at least one target cloud host to be run on the target host based on the resource occupation and usage value of the combination of the different cloud hosts running on the target host includes:

[0241] S71, selecting a target host machine as the current host machine based on the serial number sequence of the target host machines;

[0242] In the process of dynamic planning, based on the serial numbering sequence of the target host machines, the target cloud host corresponding to each target host machine is determined in turn, thereby selecting a target host machine as the current host machine.

[0243] S72, determining at least one target cloud host to be run on the current host machine based on the resource occupation and usage value of the cloud host to be allocated running on the target host machine;

[0244] Thereafter, at least one target cloud host to be run on the current host machine may be determined based on a dynamic programming algorithm and based on resource occupation and usage value of the cloud host to be allocated running on the target host machine.

[0245] S73, deleting the target cloud host from the cloud hosts to be allocated;

[0246] After determining the target cloud host, it can be determined that the target cloud host is the cloud host that needs to be loaded on the current host machine, and then the target cloud host can be deleted from the cloud hosts to be allocated.

[0247] S74, execute the steps of selecting a target host machine as the current host machine based on the numbering sequence of the target host machines; determining at least one target cloud host to be run on the current host machine based on the resource occupancy and usage value of the cloud host to be allocated running on the target host machine; and deleting the target cloud host from the cloud host to be allocated until the allocation of target cloud hosts corresponding to all the target hosts is completed.

[0248] Thereafter, steps S71 to S73 may be re-executed to determine the target cloud host corresponding to the next target host machine, until the target cloud hosts are allocated, and the allocation of target cloud hosts corresponding to all the target host machines is completed.

[0249] Step 305: hot migrate the target cloud host to the target host machine.

[0250] After determining the target cloud host corresponding to each target host, if the target cloud host is different from the cloud host currently running in the target host, then the cloud host needs to be hot migrated. When the cloud platform or the target host that needs to be adjusted is in a business idle state, the target cloud host can be hot migrated to the target host to complete the adjustment of the cloud host, so that the distribution of cloud hosts can be continuously and dynamically adjusted during the operation of the cloud platform to keep the cloud platform in a good operating state.

[0251] Since hot migration may not affect business operations, the cloud host may also be hot migrated in other time periods other than the business idle state according to actual needs, and the present invention does not impose any limitation on this.

[0252] In one embodiment of the present invention, the step of hot migrating the target cloud host to the target host includes:

[0253] S81, generating a migration task table based on the correspondence between the target host machine and the target cloud host;

[0254] Since the cloud host needs to complete the migration sequentially and cannot be completed in batches, after determining the target cloud host, the target cloud host that is not in the target host and needs to be migrated to the target host can be determined based on the correspondence between the target host and the target cloud host, and a migration task table can be generated accordingly.

[0255] S82, based on the migration task table, performing a hot migration task through a preset hot migration interface; the hot migration task is used to migrate a target cloud host to a corresponding target host machine;

[0256] Thereafter, based on the migration task table, a hot migration task may be issued through a preset hot migration interface to instruct the platform to migrate a target cloud host to a corresponding target host machine.

[0257] S83, determining whether the hot migration task is completed through a preset task query interface;

[0258] The cloud platform can also provide a task query interface, through which you can query whether the hot migration task is completed.

[0259] S84, if the hot migration task is completed, based on the migration task table, a new hot migration task is issued through a preset hot migration interface until the migration of the target cloud host is completed.

[0260] If the hot migration task is completed, a hot migration task for the next target cloud host is generated based on the migration task table, and a new hot migration task is issued through a preset hot migration interface until the migration of the target cloud host is completed.

[0261] As a specific example of the present invention, Figure 4 The present invention is a flowchart of a cloud host migration method according to an embodiment of the present invention, the method comprising:

[0262] Step 401, when the cloud platform is in a business idle period, start the hot migration system in the cloud platform;

[0263] Step 402, retrieve the status of the cloud platform physical host and cloud host through the hot migration API interface;

[0264] Step 403, based on the remaining number of processor cores and the remaining memory of the physical host machine, at least two physical host machines are selected as target host machines to obtain a target host machine group;

[0265] Step 404, using a dynamic programming algorithm to determine the resource occupation and usage value of different cloud hosts running on the target host based on the number of processor cores, memory, and cloud host value occupied by the cloud host, and determining at least one target cloud host to be run on the target host, and generating a hot migration task list;

[0266] Step 405: If the number of tasks displayed is not exceeded, a hot migration task list is used to generate a hot migration task and the hot migration task is issued through the hot migration API interface;

[0267] Step 406, the cloud host migration is completed, and it is determined whether the optimization adjustment is completed. If not, a new hot migration task is generated;

[0268] Step 407: If the optimization adjustment is completed, the working status is recorded and the hot migration of the cloud host is stopped.

[0269] In an embodiment of the present invention, the remaining number of processor cores and the remaining amount of memory of the physical host are obtained respectively; based on the remaining number of processor cores and the remaining amount of memory of the physical host, at least two physical hosts are selected as target hosts; based on the number of processor cores, the amount of memory, and the value of the cloud host occupied by the cloud host, the resource occupation and use value of the combination of different cloud hosts running on the target host are determined; based on the resource occupation and use value of the combination of different cloud hosts running on the target host, at least one target cloud host to be run on the target host is determined; and the target cloud host is hot migrated to the target host. The present invention quickly selects a physical host that may have remaining resources as the physical host that currently needs to be adjusted through the remaining number of processor cores and the remaining amount of memory of the physical host, and determines the preferred configuration scheme of the cloud host based on the resource occupation and use value of the combination of different cloud hosts running on the target host, thereby further completing the hot migration of the cloud host based on the preferred configuration scheme. On the one hand, the cloud host after hot migration can reasonably occupy more resources of the physical host machine, and on the other hand, it can reduce the situation where the number of remaining processor cores in the physical host machine is much larger than the remaining memory or the remaining memory is much larger than the number of remaining processor cores, resulting in the situation that the physical host machine cannot continue to allocate new cloud hosts even though there are remaining resources, effectively improving the resource utilization of the physical host machine. At the same time, the hot migration method of the cloud host of the embodiment of the present invention can be applied in the process of cloud platform operation, real-time monitoring of the occupied resources of the cloud host in the cloud platform and the remaining resources of the physical host machine, generating the preferred configuration plan of the cloud host, hot migration of the cloud host while maintaining the normal operation of the cloud platform, and realizing the continuous and dynamic adjustment of the distribution of the cloud host during the operation of the cloud platform, so as to keep the cloud platform in a good operating state.

[0270] The communication method provided by the embodiment of the present invention is introduced above. The communication device provided by the embodiment of the present invention will be introduced below with reference to the accompanying drawings.

[0271] See also Figure 5 The embodiment of the present invention further provides a communication device, applied to SMF, the device comprising:

[0272] The acquisition module 501 is used to respectively acquire the number of remaining processor cores and the amount of remaining memory of the physical host machine;

[0273] A selection module 502 is used to select at least two physical host machines as target host machines based on the number of remaining processor cores and the amount of remaining memory of the physical host machine;

[0274] The operation occupancy determination module 503 is used to determine the resource occupancy and usage value of the combination of different cloud hosts running on the target host machine based on the number of processor cores and memory occupied by the cloud host and the preset cloud host value;

[0275] A target cloud host determination module 504 is used to determine at least one target cloud host to be run on the target host based on the resource occupation and usage value of the combination of the different cloud hosts running on the target host;

[0276] The hot migration module 505 is used to hot migrate the target cloud host to the target host machine.

[0277] Optionally, the selection module includes:

[0278] The overall resource acquisition submodule is used to obtain the number of processor cores and memory capacity of the entire cloud platform;

[0279] The overall processor-memory ratio determination submodule is used to determine the ratio of the number of processor cores and the amount of memory of the entire cloud platform to obtain the overall processor-memory ratio;

[0280] Theoretical remaining resource calculation submodule, used to calculate the theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores and the remaining memory of the physical host machine;

[0281] The target host determination submodule is used to select at least two physical hosts as target hosts based on the theoretical remaining resources of the physical hosts.

[0282] Optionally, the theoretical remaining resource calculation submodule includes:

[0283] An average resource acquisition unit, used to determine the average number of processor cores and average memory of cloud hosts in the cloud platform;

[0284] A comparison unit, configured to determine whether the number of remaining processor cores of the physical host machine is greater than an average number of processor cores of a preset core multiple, and whether the amount of remaining memory of the physical host machine is greater than an average amount of memory of a preset memory multiple;

[0285] a first target processor-memory ratio determining unit, configured to use the overall processor-memory ratio as the target processor-memory ratio if the number of remaining processor cores of the physical host machine is greater than an average number of processor cores of a preset core multiple and the amount of remaining memory of the physical host machine is greater than an average amount of memory of a preset memory multiple;

[0286] a second target processor-memory ratio determining unit, configured to determine a target processor-memory ratio corresponding to the physical host machine according to a remaining asset value of the physical host machine if the number of remaining processor cores of the physical host machine is not greater than an average number of processor cores of a preset core multiple, or the remaining amount of memory of the physical host machine is not greater than an average amount of memory of a preset memory multiple;

[0287] The theoretical remaining resource calculation unit is used to calculate the theoretical remaining resources of the physical host machine by using the target processor-memory ratio, the remaining number of processor cores of the physical host machine, and the remaining memory amount.

[0288] Optionally, the second target processor memory ratio determining unit includes:

[0289] The average price acquisition subunit is used to obtain the average purchase price per core of the processor corresponding to the physical host machine for building the cloud platform, and the average purchase price per storage unit of the memory;

[0290] A common processor-memory ratio acquisition subunit, used to acquire at least one common processor-memory ratio of a cloud host in the cloud platform;

[0291] a candidate memory ratio determination subunit, configured to use the commonly used processor memory ratio and the overall processor memory ratio as candidate processor memory ratios;

[0292] a remaining asset value calculation subunit, configured to calculate the remaining asset value of the physical host machine under different candidate processor-memory ratios based on the candidate processor-memory ratio, the average purchase price per core number, the average purchase price per storage unit, the remaining number of processor cores and the remaining memory of the physical host machine;

[0293] The target processor memory ratio determination subunit is used to use the candidate processor memory ratio corresponding to the remaining asset value that meets the value condition as the target processor memory ratio.

[0294] Optionally, the commonly used processor-memory ratio acquisition subunit is specifically used to obtain configuration specifications of the cloud host in the cloud platform; the configuration specifications include the number of processor cores and the amount of memory; the configuration specifications are sorted from large to small according to the number of configuration specifications used, and the configuration specifications whose sorting position is before a preset order are selected as commonly used specifications; the ratio of the number of processor cores and the amount of memory corresponding to the commonly used specifications is used as the commonly used processor-memory ratio.

[0295] Optionally, the theoretical remaining resource calculation unit includes:

[0296] A theoretical remaining processor core number calculation subunit, used to calculate the theoretical remaining processor core number by using the target processor memory ratio and the remaining memory amount of the physical host machine;

[0297] A processor core number remaining resource determination subunit is used to select a first target value from the theoretical remaining processor core number and the remaining processor core number, and calculate the difference between the remaining processor core number and the first target value as the processor core number remaining resource;

[0298] A theoretical remaining memory amount calculation subunit, used to calculate the theoretical remaining memory amount by using the target processor memory ratio and the number of remaining processor cores of the physical host machine;

[0299] The memory remaining resource determination subunit is used to select a second target value from the theoretical remaining memory amount and the remaining memory amount, and calculate the difference between the remaining memory amount and the second target value as the memory remaining resource;

[0300] The theoretical remaining resource calculation subunit is used to use the processor core number remaining resource and the memory remaining resource as the theoretical remaining resource of the physical host machine.

[0301] Optionally, the theoretical remaining resources include processor core number remaining resources and memory remaining resources;

[0302] The target host determination submodule includes:

[0303] A host machine selection unit to be grouped is used to select at least two physical host machines as host machines to be grouped;

[0304] A comprehensive processor core number remaining resource calculation unit, used to calculate the sum of the processor core number remaining resources of the host machines to be grouped, and obtain the comprehensive processor core number remaining resources;

[0305] A comprehensive memory remaining resource calculation unit, used for calculating the sum of the memory remaining resources of the host machines to be grouped to obtain a comprehensive memory remaining resource;

[0306] The target host machine determination unit is used to take the host machines to be grouped as target host machines and form a target host machine group if the ratio of the comprehensive processor core number remaining resources to the comprehensive memory remaining resources is similar to the overall processor memory ratio.

[0307] Optionally, the operation occupancy determination module includes:

[0308] The submodule for determining the cloud host to be allocated is used to obtain the cloud host running on the target host as the cloud host to be allocated;

[0309] A cloud host information acquisition submodule is used to obtain the number of processor cores, memory amount, and cloud host value occupied by the cloud host to be allocated;

[0310] The operation occupancy determination submodule is used to determine the resource occupancy and usage value of the combination of different cloud hosts to be allocated running on the target host machine based on the preset processor over-opening ratio, the preset memory over-opening ratio, the number of processor cores occupied by the cloud hosts to be allocated, the amount of memory, and the value of the cloud hosts.

[0311] Optionally, the target cloud host determination module includes:

[0312] A current host determination submodule, configured to select a target host as the current host based on the serial number sequence of the target host;

[0313] Determine at least one target cloud host to be run on the current host based on the resource occupation and usage value of the cloud host to be allocated running on the target host;

[0314] The target cloud host determination submodule deletes the target cloud host from the cloud hosts to be allocated;

[0315] The submodule is repeatedly executed to select a target host as the current host based on the numbering sequence of the target host; determine at least one target cloud host to be run on the current host based on the resource occupancy and usage value of the cloud host to be allocated running on the target host; and delete the target cloud host from the cloud host to be allocated until the allocation of target cloud hosts corresponding to all the target hosts is completed.

[0316] Optionally, the thermal migration module includes:

[0317] A task table generation submodule, used to generate a migration task table based on the corresponding relationship between the target host machine and the target cloud host;

[0318] A first task issuing submodule is used to issue a hot migration task through a preset hot migration interface based on the migration task table; the hot migration task is used to migrate a target cloud host to a corresponding target host machine;

[0319] The task query submodule is used to determine whether the hot migration task is completed through a preset task query interface;

[0320] The second task issuing submodule is used to issue a new hot migration task through a preset hot migration interface based on the migration task table if the hot migration task is completed, until the migration of the target cloud host is completed.

[0321] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0322] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0323] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.

[0324] The embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0325] Memory 603, used for storing computer programs;

[0326] The processor 601 is used to execute the program stored in the memory 603 to implement the following steps:

[0327] Respectively obtain the number of remaining processor cores and the amount of remaining memory of the physical host machine;

[0328] Based on the remaining number of processor cores and the remaining amount of memory of the physical host machine, at least two physical host machines are selected as target host machines;

[0329] Based on the number of processor cores and memory occupied by the cloud host, and the preset cloud host value, determine the resource occupation and usage value of the combination of different cloud hosts running on the target host machine;

[0330] Determine at least one target cloud host to be run on the target host based on resource usage and usage value of the combination of the different cloud hosts running on the target host;

[0331] Hot migrate the target cloud host to the target host machine.

[0332] Optionally, the step of selecting at least one physical host machine as the target host machine based on the number of remaining processor cores and the amount of remaining memory of the physical host machine includes:

[0333] Obtain the number of processor cores and memory capacity of the entire cloud platform;

[0334] Determine the ratio of the number of processor cores and the amount of memory of the entire cloud platform to obtain an overall processor-memory ratio;

[0335] Calculating theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores and the remaining memory of the physical host machine;

[0336] Based on the theoretical remaining resources of the physical host machines, at least two physical host machines are selected as target host machines.

[0337] Optionally, the step of calculating the theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory includes:

[0338] Determine the average number of processor cores and the average amount of memory of cloud hosts in the cloud platform;

[0339] Determine whether the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of a preset core multiple, and whether the remaining amount of memory of the physical host machine is greater than the average amount of memory of a preset memory multiple;

[0340] If the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of the preset core multiples, and the remaining memory of the physical host machine is greater than the average memory of the preset memory multiples, the overall processor-memory ratio is used as the target processor-memory ratio;

[0341] If the number of remaining processor cores of the physical host machine is not greater than the average number of processor cores of the preset core multiples, or the remaining amount of memory of the physical host machine is not greater than the average amount of memory of the preset memory multiples, determine the target processor-memory ratio corresponding to the physical host machine according to the remaining asset value of the physical host machine;

[0342] The theoretical remaining resources of the physical host machine are calculated using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory amount.

[0343] Optionally, the step of determining a target processor memory ratio corresponding to the physical host machine according to the remaining asset value of the physical host machine includes:

[0344] Obtaining the average purchase price per core of the processor corresponding to the physical host machine for building the cloud platform, and the average purchase price per storage unit of the memory;

[0345] Obtaining at least one common processor-memory ratio of a cloud host in the cloud platform;

[0346] using the common processor memory ratio and the overall processor memory ratio as candidate processor memory ratios;

[0347] Based on the candidate processor-to-memory ratio, the average purchase price per core, the average purchase price per storage unit, the remaining number of processor cores and the remaining memory of the physical host machine, respectively calculate the remaining asset value of the physical host machine under different candidate processor-to-memory ratios;

[0348] The candidate processor memory ratio corresponding to the remaining asset value that meets the value condition is used as the target processor memory ratio.

[0349] Optionally, the step of obtaining at least one common processor memory ratio of a cloud host in the cloud platform includes:

[0350] Obtaining configuration specifications of the cloud host in the cloud platform; the configuration specifications include the number of processor cores and the amount of memory;

[0351] Sort the configuration specifications according to the usage quantity of the configuration specifications from large to small, and select the configuration specifications whose sorting position is before the preset sequence as the commonly used specifications;

[0352] The ratio of the number of processor cores and the amount of memory corresponding to common specifications is taken as the common processor-memory ratio.

[0353] Optionally, the step of calculating the theoretical remaining resources of the physical host machine by using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory includes:

[0354] Calculate the theoretical number of remaining processor cores using the target processor-to-memory ratio and the remaining memory of the physical host machine;

[0355] Selecting a first target value between the theoretical remaining number of processor cores and the remaining number of processor cores, and calculating a difference between the remaining number of processor cores and the first target value as the remaining resource of the number of processor cores;

[0356] Calculate theoretical remaining memory using the target processor-to-memory ratio and the number of remaining processor cores of the physical host machine;

[0357] Selecting a second target value between the theoretical remaining memory amount and the remaining memory amount, and calculating a difference between the remaining memory amount and the second target value as the remaining memory resource;

[0358] The remaining resources of the number of processor cores and the remaining resources of the memory are taken as theoretical remaining resources of the physical host machine.

[0359] Optionally, the theoretical remaining resources include processor core number remaining resources and memory remaining resources;

[0360] The step of selecting at least two physical hosts as target hosts based on the theoretical remaining resources of the physical hosts includes:

[0361] Select at least two physical hosts as hosts to be grouped;

[0362] Calculating the sum of the remaining resources of the processor cores of the host machines to be grouped to obtain the comprehensive remaining resources of the processor cores;

[0363] Calculating the sum of the remaining memory resources of the host machines to be grouped to obtain the comprehensive remaining memory resources;

[0364] If the ratio of the comprehensive processor core number remaining resources to the comprehensive memory remaining resources is close to the overall processor memory ratio, the host machines to be grouped are taken as target host machines and form a target host machine group.

[0365] Optionally, the step of determining the resource usage and usage value of the cloud host running on the target host machine based on the number of processor cores, the amount of memory occupied by the cloud host, and the value of the cloud host includes:

[0366] Obtaining a cloud host running on the target host as the cloud host to be allocated;

[0367] Obtaining the number of processor cores, memory volume, and cloud host value occupied by the cloud host to be allocated;

[0368] Based on the preset processor over-commitment ratio, the preset memory over-commitment ratio, the number of processor cores occupied by the cloud host to be allocated, the amount of memory, and the cloud host value, determine the resource occupancy and usage value of the combination of different cloud hosts to be allocated running on the target host machine.

[0369] Optionally, the step of determining at least one target cloud host to be run on the target host based on resource usage and usage value of the combination of the different cloud hosts running on the target host includes:

[0370] Based on the serial number sequence of the target host machines, selecting a target host machine as the current host machine;

[0371] Determine at least one target cloud host to be run on the current host based on the resource occupation and usage value of the cloud host to be allocated running on the target host;

[0372] Deleting the target cloud host from the cloud hosts to be allocated;

[0373] Execute the steps of selecting a target host as the current host based on the numbering sequence of the target host machines; determining at least one target cloud host to be run on the current host machine based on the resource occupancy and usage value of the cloud host to be allocated running on the target host machine; and deleting the target cloud host from the cloud host to be allocated until the allocation of target cloud hosts corresponding to all the target hosts is completed.

[0374] Optionally, the step of hot migrating the target cloud host to the target host machine includes:

[0375] Generate a migration task table based on the correspondence between the target host machine and the target cloud host;

[0376] Based on the migration task table, a hot migration task is executed through a preset hot migration interface; the hot migration task is used to migrate a target cloud host to a corresponding target host machine;

[0377] Determine whether the hot migration task is completed through a preset task query interface;

[0378] If the hot migration task is completed, a new hot migration task is issued through a preset hot migration interface based on the migration task table until the migration of the target cloud host is completed.

[0379] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0380] The communication interface is used for communication between the above terminal and other devices.

[0381] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0382] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0383] An embodiment of the present invention further provides a processor-readable storage medium, characterized in that the processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute the above-mentioned communication method.

[0384] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0385] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0386] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer executable instructions. These computer executable instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0387] These processor executable instructions may also be stored in a processor readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the processor readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0388] These processor-executable instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0389] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for hot migration of a cloud host, characterized in that: The method is applied to a cloud platform, wherein the cloud platform has multiple cloud hosts running on multiple physical hosts, and the method comprises: Respectively obtain the number of remaining processor cores and the amount of remaining memory of the physical host machine; Based on the remaining number of processor cores and the remaining amount of memory of the physical host machine, at least two physical host machines are selected as target host machines; Based on the number of processor cores and memory occupied by the cloud host, and the preset cloud host value, determine the resource occupation and usage value of the combination of different cloud hosts running on the target host machine; Determine at least one target cloud host to be run on the target host based on resource usage and usage value of the combination of the different cloud hosts running on the target host; Hot migrating the target cloud host to the target host machine; The step of selecting at least one physical host machine as the target host machine based on the number of remaining processor cores and the amount of remaining memory of the physical host machine includes: Obtain the number of processor cores and memory capacity of the entire cloud platform; Determine the ratio of the number of processor cores and the amount of memory of the entire cloud platform to obtain an overall processor-memory ratio; Calculating theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores and the remaining memory of the physical host machine; Based on the theoretical remaining resources of the physical host machines, selecting at least two physical host machines as target host machines; The step of calculating the theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory amount includes: Determine the average number of processor cores and the average amount of memory of cloud hosts in the cloud platform; Determine whether the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of a preset core multiple, and whether the remaining amount of memory of the physical host machine is greater than the average amount of memory of a preset memory multiple; If the number of remaining processor cores of the physical host machine is greater than the average number of processor cores of the preset core multiples, and the remaining memory of the physical host machine is greater than the average memory of the preset memory multiples, the overall processor-memory ratio is used as the target processor-memory ratio; If the number of remaining processor cores of the physical host machine is not greater than the average number of processor cores of the preset core multiples, or the remaining amount of memory of the physical host machine is not greater than the average amount of memory of the preset memory multiples, determine the target processor-memory ratio corresponding to the physical host machine according to the remaining asset value of the physical host machine; Calculating theoretical remaining resources of the physical host machine using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory amount; The step of determining the target processor memory ratio corresponding to the physical host machine according to the remaining asset value of the physical host machine includes: Obtaining the average purchase price per core of the processor corresponding to the physical host machine for building the cloud platform, and the average purchase price per storage unit of the memory; Obtaining at least one common processor-memory ratio of a cloud host in the cloud platform; using the common processor memory ratio and the overall processor memory ratio as candidate processor memory ratios; Based on the candidate processor-to-memory ratio, the average purchase price per core, the average purchase price per storage unit, the remaining number of processor cores and the remaining memory of the physical host machine, respectively calculate the remaining asset value of the physical host machine under different candidate processor-to-memory ratios; The candidate processor memory ratio corresponding to the remaining asset value that meets the value condition is used as the target processor memory ratio.

2. The method according to claim 1, characterized in that The step of obtaining at least one common processor memory ratio of a cloud host in the cloud platform includes: Obtaining configuration specifications of the cloud host in the cloud platform; the configuration specifications include the number of processor cores and the amount of memory; Sort the configuration specifications according to the usage quantity of the configuration specifications from large to small, and select the configuration specifications whose sorting position is before the preset sequence as the commonly used specifications; The ratio of the number of processor cores and the amount of memory corresponding to common specifications is taken as the common processor-memory ratio.

3. The method according to claim 1, characterized in that The step of calculating the theoretical remaining resources of the physical host machine by using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory comprises: Calculate the theoretical number of remaining processor cores using the target processor-to-memory ratio and the remaining memory of the physical host machine; Selecting a first target value between the theoretical remaining number of processor cores and the remaining number of processor cores, and calculating a difference between the remaining number of processor cores and the first target value as the remaining resource of the number of processor cores; Calculate theoretical remaining memory using the target processor-to-memory ratio and the number of remaining processor cores of the physical host machine; Selecting a second target value between the theoretical remaining memory amount and the remaining memory amount, and calculating a difference between the remaining memory amount and the second target value as the remaining memory resource; The remaining resources of the number of processor cores and the remaining resources of the memory are taken as theoretical remaining resources of the physical host machine.

4. The method according to claim 1, characterized in that: The theoretical remaining resources include the remaining resources of the number of processor cores and the remaining resources of memory; The step of selecting at least two physical hosts as target hosts based on the theoretical remaining resources of the physical hosts includes: Select at least two physical hosts as hosts to be grouped; Calculating the sum of the remaining resources of the processor cores of the host machines to be grouped to obtain the comprehensive remaining resources of the processor cores; Calculating the sum of the remaining memory resources of the host machines to be grouped to obtain the comprehensive remaining memory resources; If the ratio of the comprehensive processor core number remaining resources to the comprehensive memory remaining resources is close to the overall processor memory ratio, the host machines to be grouped are taken as target host machines and form a target host machine group.

5. The method according to claim 1, characterized in that The step of determining the resource occupation and usage value of a combination of different cloud hosts running on the target host machine based on the number of processor cores and memory occupied by the cloud hosts and the preset cloud host value includes: Obtaining a cloud host running on the target host as the cloud host to be allocated; Obtaining the number of processor cores, memory volume, and cloud host value occupied by the cloud host to be allocated; Based on the preset processor over-commitment ratio, the preset memory over-commitment ratio, the number of processor cores occupied by the cloud host to be allocated, the amount of memory, and the cloud host value, determine the resource occupancy and usage value of the combination of different cloud hosts to be allocated running on the target host machine.

6. The method according to claim 5, characterized in that The step of determining at least one target cloud host to be run on the target host based on the resource occupation and usage value of the combination of the different cloud hosts running on the target host includes: Based on the serial number sequence of the target host machines, selecting a target host machine as the current host machine; Determine at least one target cloud host to be run on the current host based on the resource occupation and usage value of the cloud host to be allocated running on the target host; Deleting the target cloud host from the cloud hosts to be allocated; Execute the steps of selecting a target host as the current host based on the numbering sequence of the target host machines; determining at least one target cloud host to be run on the current host machine based on the resource occupancy and usage value of the cloud host to be allocated running on the target host machine; and deleting the target cloud host from the cloud host to be allocated until the allocation of target cloud hosts corresponding to all the target hosts is completed.

7. The method according to claim 1, characterized in that The step of hot migrating the target cloud host to the target host includes: Generate a migration task table based on the correspondence between the target host machine and the target cloud host; Based on the migration task table, a hot migration task is executed through a preset hot migration interface; the hot migration task is used to migrate a target cloud host to a corresponding target host machine; Determine whether the hot migration task is completed through a preset task query interface; If the hot migration task is completed, a new hot migration task is issued through a preset hot migration interface based on the migration task table until the migration of the target cloud host is completed.

8. A hot migration device for a cloud host, characterized in that: It is applied to a cloud platform, and the cloud platform runs multiple cloud hosts based on multiple physical hosts. The device includes: An acquisition module, used to respectively acquire the number of remaining processor cores and the amount of remaining memory of the physical host machine; A selection module, configured to select at least two physical host machines as target host machines based on the number of remaining processor cores and the amount of remaining memory of the physical host machines; An operation occupancy determination module is used to determine the resource occupancy and usage value of a combination of different cloud hosts running on the target host machine based on the number of processor cores and memory occupied by the cloud host and a preset cloud host value; A target cloud host determination module, configured to determine at least one target cloud host to be run on the target host based on resource occupation and usage value of the combination of the different cloud hosts running on the target host; A hot migration module, used for hot migrating the target cloud host to the target host machine; The selection module includes: The overall resource acquisition submodule is used to obtain the number of processor cores and memory capacity of the entire cloud platform; The overall processor-memory ratio determination submodule is used to determine the ratio of the number of processor cores and the amount of memory of the entire cloud platform to obtain the overall processor-memory ratio; Theoretical remaining resource calculation submodule, used to calculate the theoretical remaining resources of the physical host machine based on the overall processor-memory ratio, the number of remaining processor cores and the remaining memory of the physical host machine; A target host determination submodule, configured to select at least two physical hosts as target hosts based on theoretical remaining resources of the physical hosts; The theoretical remaining resource calculation submodule includes: An average resource acquisition unit, used to determine the average number of processor cores and average memory of cloud hosts in the cloud platform; A comparison unit, configured to determine whether the number of remaining processor cores of the physical host machine is greater than an average number of processor cores of a preset core multiple, and whether the amount of remaining memory of the physical host machine is greater than an average amount of memory of a preset memory multiple; a first target processor-memory ratio determining unit, configured to use the overall processor-memory ratio as the target processor-memory ratio if the number of remaining processor cores of the physical host machine is greater than an average number of processor cores of a preset core multiple and the amount of remaining memory of the physical host machine is greater than an average amount of memory of a preset memory multiple; a second target processor-memory ratio determining unit, configured to determine a target processor-memory ratio corresponding to the physical host machine according to a remaining asset value of the physical host machine if the number of remaining processor cores of the physical host machine is not greater than an average number of processor cores of a preset core multiple, or the remaining amount of memory of the physical host machine is not greater than an average amount of memory of a preset memory multiple; A theoretical remaining resource calculation unit, used to calculate the theoretical remaining resources of the physical host machine by using the target processor-memory ratio, the number of remaining processor cores of the physical host machine, and the remaining memory amount; The second target processor memory ratio determining unit comprises: The average price acquisition subunit is used to acquire the average purchase price per core of the processor corresponding to the physical host machine for building the cloud platform, and the average purchase price per storage unit of the memory; A common processor-memory ratio acquisition subunit, used to acquire at least one common processor-memory ratio of a cloud host in the cloud platform; a candidate memory ratio determination subunit, configured to use the commonly used processor memory ratio and the overall processor memory ratio as candidate processor memory ratios; a remaining asset value calculation subunit, configured to calculate the remaining asset value of the physical host machine under different candidate processor-memory ratios based on the candidate processor-memory ratio, the average purchase price per core number, the average purchase price per storage unit, the remaining number of processor cores and the remaining memory of the physical host machine; The target processor memory ratio determination subunit is used to use the candidate processor memory ratio corresponding to the remaining asset value that meets the value condition as the target processor memory ratio.

9. A cloud platform, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.

10. A processor-readable storage medium, characterized in that: The processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute the hot migration method of the cloud host according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for remediating resource overload in over-committed computing environment

    CN103377281A

  • Virtual machine newly-built method, device and equipment

    CN109739614A

  • Virtual machine scheduling method and device, medium and equipment

    CN113282369A