An automatic prediction method based on an attention mechanism and a cloud resource adjustment system

By collecting resource information on the cloud platform and using the Lstm-Mix-Attention network algorithm to predict resource demand, the allocation of host resources is dynamically adjusted, solving the problem that users cannot apply for cloud host resources normally, and realizing the effective allocation of resources and meeting user needs.

CN117812081BActive Publication Date: 2025-11-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311690721.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-11
Publication Date
2025-11-04
Estimated Expiration
2043-12-11

AI Technical Summary

Technical Problem

In existing technologies, even when the total remaining capacity of the host machine is sufficient, users are still unable to apply for cloud server resources normally because the remaining capacity on each host machine is insufficient to meet the user's needs.

Method used

By collecting cloud platform resource information and cloud host application information, the Lstm-Mix-Attention network algorithm is used to predict future cloud host resource applications, and the host resource allocation is dynamically adjusted through the cloud resource automatic adjustment module to ensure that resources can meet user needs.

Benefits of technology

This ensures that users can successfully apply for cloud server resources as long as the total remaining capacity of the host machine is sufficient, thus avoiding application failures due to insufficient resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117812081B_ABST
    Figure CN117812081B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of cloud computing, and particularly relates to an automatic prediction method based on an attention mechanism and a cloud resource adjustment system, which comprises the following steps: collecting resource information in each host computer on a cloud platform and resource application information of cloud host computers, obtaining basic data, analyzing and predicting the resource application information and use of future cloud host computers based on the basic data and an Lstm-Mix-Attention network algorithm with an attention mechanism, judging whether the remaining resource information of each host computer meets the requirements of the applied cloud host computer according to the prediction result, and adjusting the resources of the host computer according to the judgment result by a cloud resource automatic adjustment algorithm, predicting the resource application of future cloud host computers by the Lstm-Mix-Attention network algorithm, so as to simulate the real application of cloud resources by users, and automatically adjusting the resource occupation of cloud host computers on the host computer by the cloud resource automatic adjustment module, so that there are enough resources for distribution when a real request comes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of cloud computing, and particularly relates to an automatic prediction method based on an attention mechanism and a cloud resource adjustment system. BACKGROUND

[0002] Cloud computing is a new business model of paying by quantity and purchasing on demand, especially in the era of big data information of computers and the Internet. The scale of the cloud computing data center is also developing more and more huge. The core is a computing method based on the Internet. Users can purchase computers and other devices and required data storage services on demand through a browser or Web.

[0003] IaaS (Infrastructure as a Service) is infrastructure as a service. Users can obtain servers, storage and network services from providers according to the actual usage or occupancy of resources by using the IaaS infrastructure as a service model. This way is very convenient. Users do not need to purchase large equipment in advance. They only need to rent from the provider at any time and any place according to their needs. Providers can provide resources of various specifications, such as cloud hosts and cloud servers, and can provide users with required operating systems, storage and network services.

[0004] In the prior art, there are some disadvantages in the scheme of applying for cloud resources by users. In particular, when the total remaining capacity in the host machine is enough for the resource demand of the user application, the user cannot normally apply for the cloud host resource. SUMMARY

[0005] The purpose of the application is to provide an automatic prediction method based on an attention mechanism and a cloud resource adjustment system. The application situation of the past cloud host is collected first, then the future cloud host resource application information is predicted through the Lstm-Mix-Attention network algorithm, and finally the cloud resources in the host machine are re-adjusted and distributed through the cloud resource automatic adjustment module, so as to achieve the purpose that the user can normally apply for the cloud resource, thereby solving the problems in the background technology.

[0006] To achieve the above object, the application adopts the following technical scheme: An automatic prediction method based on an attention mechanism, comprising: collecting resource information in each host computer on a cloud platform and resource application information of the cloud host computer, and arranging the resource information and the resource application information into basic data; analyzing and predicting the resource application information and use of the future cloud host computer based on the basic data through an Lstm-Mix-Attention network algorithm with an attention mechanism, to obtain a prediction result; judging whether the remaining resource information of each current host computer meets the requirements of the applied cloud host computer according to the prediction result, and adjusting the resources of the host computer by a cloud resource automatic adjustment algorithm according to the judgment result, so that the host computer can carry the required applied cloud host computer.

[0007] Preferably, the resource information in the host computer includes resource use and current resource remaining capacity, and the resource application information of the cloud host computer includes the specification and resource amount of the applied cloud host computer; wherein the basic data is collected by a resource monitoring system of the cloud platform.

[0008] Preferably, the Lstm-Mix-Attention network algorithm includes a Mix-Attention module and an LSTM network module, the Mix-Attention module includes a channel attention submodule and a spatial attention submodule, and is used for fusing feature information of two different dimensions of channels and spaces; wherein the input of the Mix-Attention module is connected to the output of the LSTM network module, the application time, the applied CPU size and the applied memory size of the cloud host computer are taken as inputs and sent into the Lstm-Mix-Attention network algorithm, and the applied CPU size and the applied memory size of the future cloud host computer are predicted.

[0009] Preferably, the Lstm-Mix-Attention network algorithm comprises: learning the weight of the channel and spatial dimensions of the input feature respectively; respectively multiplying the input feature with the channel weight and the spatial weight in the form of matrix multiplication to map the weight to the channel feature map and the spatial feature map; adding the channel feature map and the spatial feature map to obtain the final output feature.

[0010] Preferably, the learning of the weight of the channel and spatial dimensions of the input feature respectively comprises: giving a feature mapping F C×H×W As inputs, the two attention submodules are respectively sent to obtain a one-dimensional channel attention map M c ∈R C ×1×1 and a two-dimensional spatial attention map M s ∈R 1×H×W .

[0011] Preferably, the respective multiplication of the input feature and the channel weight and the spatial weight in the form of a matrix maps the weight to the channel feature map and the spatial feature map, including: multiplying the input feature map F and the one-dimensional channel attention map M c to obtain the channel-dimension feature information as follows: multiplying the input feature map F and the two-dimensional spatial attention map M s to obtain the spatial-dimension feature information as follows:

[0012] Preferably, the addition of the channel feature map and the spatial feature map to obtain the final output feature includes: combining the channel-dimension feature information and the spatial-dimension feature information, and the attention process is as follows: wherein F represents the input feature map, represents the product of two matrices, F out represents the final attention output result feature map.

[0013] Preferably, the judging whether the remaining resource information of each host satisfies the requirement of the applied cloud host according to the prediction result includes: if any one of the hosts can satisfy the requirement, applying the cloud host on the host that satisfies the requirement; if none of the hosts can satisfy the requirement of the applied specification of the cloud host, but the total amount of the remaining CPU and the total amount of the remaining memory of the hosts can satisfy the requirement, automatically adjusting the distribution of the cloud resources on the hosts.

[0014] Preferably, the cloud resource automatic adjustment algorithm includes:

[0015] The most ideal capacity that can be released by each host is calculated by the following formula,

[0016] RIDL i = P-L i

[0017] wherein i represents the ID of each host, RIDL i represents the minimum CPU size and memory size that each host releases in the ideal state, P represents the CPU size and memory size predicted by the Lstm-Mix-Attention network algorithm, and L i represents the remaining capacity of each host;

[0018] The real capacity R that the host needs to release is calculated by the following formula i must be greater than this ideal value RIDL i ,

[0019] R i ≥ RIDL i

[0020] In the formula, R i represents the real released CPU size and memory size of each host machine;

[0021] The real released minimum capacity R min and the host machine ID corresponding thereto,

[0022] R min = MIN(R i )

[0023] In the formula, R min represents the real released minimum capacity, and the subscript min represents the host machine ID corresponding to the real released minimum capacity;

[0024] The following formula is used to calculate which cloud hosts on the host machine need to be migrated and the size of these cloud hosts,

[0025] R i =∑V j

[0026] In the formula, V j represents the resource size of the cloud host needed to be released on the i-th host machine;

[0027] The following formula is used to calculate the sum of the remaining resource capacities of the remaining host machines,

[0028]

[0029] In the formula, represents the sum of the remaining resource capacities of the remaining host machines except the i-th host machine;

[0030] The following formula is used to determine whether the remaining host machines have enough space size to migrate the real released minimum capacity R min ,

[0031]

[0032] On the other hand, the application also provides a cloud resource adjustment system based on an attention mechanism, comprising:

[0033] An information collection module is configured to collect resource information in each host machine and resource application information of cloud hosts on a cloud platform, and arrange the resource information and the resource application information into basic data;

[0034] A prediction module is configured to analyze and predict future resource application information and usage of cloud hosts based on the basic data through an Lstm-Mix-Attention network algorithm with an attention mechanism, and obtain a prediction result;

[0035] The cloud resource automatic adjustment module is configured to determine whether the remaining resource information of each host satisfies the requirement of the applied cloud host according to the prediction result, and adjust the resource of the host by the cloud resource automatic adjustment algorithm according to the determination result, so that the host can carry the required applied cloud host.

[0036] The automatic prediction method and the cloud resource adjustment system based on the attention mechanism have the following advantages compared with the prior art.

[0037] The application collects the resource information of each host and the resource application information of the cloud host on the cloud platform, and arranges the resource information and the resource application information into basic data, analyzes and predicts the resource application information and the use of the future cloud host by the Lstm-Mix-Attention network algorithm with the attention mechanism based on the basic data, obtains the prediction result, determines whether the remaining resource information of each host satisfies the requirement of the applied cloud host according to the prediction result, and adjusts the resource of the host by the cloud resource automatic adjustment algorithm according to the determination result, so that the host can carry the required applied cloud host. The information collection module can be better used in the real environment. The Lstm-Mix-Attention network algorithm is used to predict the resource application of the future cloud host, so as to simulate the real application of the cloud resource by the user. The cloud resource automatic adjustment module automatically adjusts the resource occupation of the cloud host on the host, and when the real request comes, there is enough resource for allocation. BRIEF DESCRIPTION OF DRAWINGS

[0038] Figure 1 The flowchart of the automatic prediction method based on the attention mechanism is shown in the figure.

[0039] Figure 2 The structural diagram of the Mix-Attention module is shown in the figure.

[0040] Figure 3 The structural diagram of the cloud resource adjustment system based on the attention mechanism is shown in the figure. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, not all the embodiments. The specific embodiments described herein are only used to explain the application, and are not used to limit the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.

[0042] The application provides an automatic prediction method based on an attention mechanism and a cloud resource adjustment system, and mainly aims to solve the problem that users cannot normally apply for cloud hosts even if the total remaining capacity of host computers meets the demand of user application.

[0043] In the embodiment, the application collects the application conditions of previous cloud hosts in advance, predicts future cloud host resource application information through an Lstm-Mix-Attention network algorithm, and finally adjusts and allocates the cloud resources in the host computers through a cloud resource automatic adjustment module, so that the user can normally apply for cloud resources.

[0044] As shown in Figure 1 The application provides an automatic prediction method based on an attention mechanism, which comprises the following steps.

[0045] Step 1: Collect resource information in each host computer on the cloud platform and resource application information of the cloud host, and arrange the resource information and the resource application information into basic data.

[0046] Specifically, the resource information in the host computer comprises resource usage and current resource remaining capacity, and the resource application information of the cloud host comprises the specification and resource amount of the applied cloud host; wherein the basic data is collected through a resource monitoring system of the cloud platform.

[0047] Step 2: Analyze and predict the resource application information and usage of future cloud hosts based on the basic data through an Lstm-Mix-Attention network algorithm with an attention mechanism, and obtain a prediction result.

[0048] Specifically, the Lstm-Mix-Attention network algorithm comprises a Mix-Attention module and an LSTM network module, the Mix-Attention module comprises a channel attention submodule and a spatial attention submodule, and is used for fusing feature information in two different dimensions of channels and spaces.

[0049] The output of the LSTM network module is input into the Mix-Attention module, the application time, the CPU size and the memory size of the cloud host are input into the Lstm-Mix-Attention network algorithm, and the CPU size and the memory size of the future cloud host are predicted.

[0050] In addition, the Lstm-Mix-Attention network algorithm comprises: learning weights of input features in channel and spatial dimensions respectively; respectively multiplying the input features and the channel weights and the spatial weights in a matrix manner to map the weights to channel feature maps and spatial feature maps; and adding the channel feature maps and the spatial feature maps to obtain final output features. Specifically, the following is performed.

[0051] Given a feature map F element-of R C×H×W As input, the two attention sub-modules are respectively fed to obtain a one-dimensional channel attention map M c element-of R C×1×1 And a two-dimensional spatial attention map M s element-of R 1×H×W .

[0052] The input feature map F is multiplied by the one-dimensional channel attention map M c to obtain channel-dimension feature information, as follows:

[0053] The input feature map F is multiplied by the two-dimensional spatial attention map M s to obtain spatial-dimension feature information, as follows:

[0054] The channel-dimension feature information and the spatial-dimension feature information are combined, and the attention process is as follows:

[0055] In the formula, F represents the input feature map, represents the product of two matrices, F out represents the final attention output result feature map.

[0056] Step three: according to the prediction result, it is judged whether the remaining resource information of each host meets the requirements of the applied cloud host, and the resource of the host is adjusted by the cloud resource automatic adjustment algorithm to enable it to carry the required applied cloud host according to the judgment result.

[0057] Specifically, according to the prediction result, it is judged whether the remaining resource information of each host meets the requirements of the applied cloud host, comprising: if any one of them can meet its requirements, the cloud host is applied on the host that meets the requirements; if each one cannot meet the specification requirements of the cloud host applied, but the total amount of CPU and the total amount of memory of the remaining host can meet its requirements, the distribution of cloud resources on the host is automatically adjusted.

[0058] In addition, the cloud resource automatic adjustment algorithm comprises:

[0059] The most ideal capacity that can be released by each host is calculated by the following formula,

[0060] RIDL i = P - L i

[0061] where i represents the ID of each host machine, RIDL i represents the minimum CPU size and memory size released by each host machine in an ideal state, P represents the CPU size and memory size predicted by the Lstm-Mix-Attention network algorithm, and L i represents the remaining capacity of each host machine;

[0062] The real capacity R to be released by the host machine is calculated by the following formula i must be greater than this ideal value RIDL i ,

[0063] R i ≥ RIDL i

[0064] where R i represents the CPU size and memory size actually released by each host machine;

[0065] The minimum real released capacity R min and the host machine ID corresponding thereto are calculated by the following formula

[0066] R min = MIN(R i )

[0067] where R min represents the minimum real released capacity, and the subscript min represents the host machine ID corresponding to the minimum real released capacity;

[0068] The cloud hosts needed to be migrated on the host machine and the size of these cloud hosts are calculated by the following formula

[0069] R i = ∑V j

[0070] where V j represents the resource size of the cloud host needed to be released on the ith host machine;

[0071] The sum of the remaining resource capacities of the remaining host machines is calculated by the following formula

[0072]

[0073] where represents the sum of the remaining resource capacities of the remaining host machines except the ith host machine;

[0074] Determine whether the remaining host machine has enough space size to migrate the minimum capacity R of the real release by the following formula min ,

[0075]

[0076] In this embodiment, compared with the static data algorithm, the pre-experiment test by the information collection module is more conducive to the application of the algorithm in the real environment. The Lstm-Mix-Attention network algorithm is used to predict the size of the future cloud host that may be applied in advance, so as to prevent the situation of insufficient capacity of the host when the user's actual application of the cloud host is received. The cloud resource automatic adjustment module dynamically adjusts the cloud resource allocation through the hot migration technology, which effectively avoids the situation that the user cannot normally apply the cloud host resource due to insufficient host resources.

[0077] On the other hand, the embodiment proposes a cloud resource adjustment system based on attention mechanism, as shown in Figure 3 , including: information collection module, prediction module (Lstm-Mix-Attention prediction module), cloud resource automatic adjustment module.

[0078] Exemplarily, the information collection module is used to collect resource information in each host on the cloud platform and resource application information of the cloud host, and arrange the resource information and the resource application information into basic data.

[0079] In this embodiment, the required information is first collected through the resource monitoring system of the cloud platform, mainly aiming at the resource usage, current resource remaining capacity in each host on the cloud platform, and information collection on the specification and resource amount of the cloud host applied in the cloud platform. This step provides basic data for the machine learning prediction module in the next step to predict the resource application information of the future cloud host in the cloud platform.

[0080] The prediction module is used to analyze and predict the resource application information and usage of the future cloud host based on the basic data through the Lstm-Mix-Attention network algorithm with attention mechanism, and obtain the prediction result.

[0081] The resource application information and usage of the cloud host obtained by using the resource monitoring system of the cloud platform in this embodiment are analyzed and predicted. The system uses an Lstm-Mix-Attention network algorithm to predict future application information of the cloud host. In order to solve the gradient disappearance and gradient explosion phenomenon in the back propagation process, experts propose a special RNN model, the Long-Short Term Memory model. The model solves the long memory problem that the RNN model does not have by introducing a gate mechanism. The LSTM neural network algorithm can statistically analyze past time series data to predict the development trend of things.

[0082] On the other hand, in order to obtain more accurate prediction results, a special attention mechanism Mix-Attention is designed to actively focus on important information, enhance relevant information, and suppress irrelevant information, so as to obtain better feature representation. The output of the LSTM network is taken as the input of the Mix-Attention module, which includes two sub-modules: a channel attention sub-module and a spatial attention sub-module. The channel and spatial features of different dimensions are fused, as shown in Figure 2 .

[0083] First, the input features are respectively subjected to channel and spatial dimension weight learning, secondly, the input features and channel weights and spatial weights are respectively mapped to channel feature maps and spatial feature maps in the form of matrix multiplication, and finally the channel feature maps and spatial feature maps are added to obtain the final output features. The specific operation steps are as follows:

[0084] (1) Given a feature map F ∈ R C×H×W is input into two attention sub-modules respectively to obtain a one-dimensional channel attention map M c ∈ R C×1×1 and a two-dimensional spatial attention map M s ∈ R 1×H×W .

[0085] (2) Multiply the input feature map F and the one-dimensional channel attention map M c to obtain the channel dimension feature information, as follows:

[0086] (3) Multiply the input feature map F and the two-dimensional spatial attention map M s to obtain the spatial dimension feature information, as follows:

[0087] (4) The channel dimension feature information is combined with the spatial dimension feature information, and the attention process is as follows:

[0088] In the formula, F represents the input feature map, represents the product of two matrices, F out represents the final attention output result feature map.

[0089] The application time, the CPU size and the memory size of the cloud host are input into the Lstm-Mix-Attention network algorithm, and the CPU size and the memory size applied by the future cloud host are predicted.

[0090] The cloud resource automatic adjustment module is used for judging whether the remaining resource information of each host meets the requirements of the applied cloud host according to the prediction result, and adjusting the resources of the host according to the judgment result by the cloud resource automatic adjustment algorithm, so that the host can carry the required applied cloud host.

[0091] In the embodiment, the CPU size and the memory size predicted by the Lstm-Mix-Attention network algorithm are used to judge whether the remaining CPU capacity and the memory capacity of each host meet the specification requirements of the applied cloud host. If any of them can meet the requirements, the cloud host is applied on the host that meets the requirements; if none of them can meet the specification requirements of the applied cloud host, but the total amount of the remaining CPU and the memory of the host can meet the requirements, the distribution of the cloud resources on the host is automatically adjusted, specifically, part of the cloud resources on a certain host is migrated to other hosts, so that a certain host can obtain sufficient capacity to carry the required applied cloud host.

[0092] The cloud resource automatic adjustment algorithm is as follows:

[0093] The most ideal capacity that can be released by each host is calculated by the following formula,

[0094] RIDL i =P-L i (1)

[0095] In the formula, i represents the ID of each host, RIDL i represents the CPU size and the memory size released by each host in the ideal state, P represents the CPU size and the memory size predicted by the Lstm-Mix-Attention network algorithm, and L i represents the remaining capacity of each host;

[0096] The real capacity R iR i ,

[0097] R i ≥RIDL i (2)

[0098] wherein R i represents the real released CPU size and memory size of each host machine;

[0099] The real released minimum capacity R min and the host machine ID corresponding thereto are calculated by the following formula:

[0100] R min = MIN(R i ) (3)

[0101] wherein R min represents the real released minimum capacity, and the subscript min represents the host machine ID corresponding to the real released minimum capacity;

[0102] The cloud host to be migrated on the host machine and the size of the cloud host are calculated by the following formula:

[0103] R i =∑V j (4)

[0104] wherein V j represents the resource size of the cloud host to be released on the i-th host machine;

[0105] The total of the remaining resource capacities of the remaining host machines is calculated by the following formula:

[0106]

[0107] wherein represents the total of the remaining resource capacities of the remaining host machines except the i-th host machine;

[0108] It is judged by the following formula whether the remaining host machines have enough space size to migrate the real released minimum capacity R min ,

[0109]

[0110] It can be known from formula (1) that the most ideal capacity that can be released by each host machine, and from formula (2) that the real capacity R i must be greater than the ideal value RIDL iThe cloud host can meet the specification requirements applied for. Since the capacity of each allocated cloud host on each host is different, the real capacity required to be released by each host can be obtained through the two formulas. Because the migration capacity is different, the network bandwidth required and the resources consumed are different, so the smaller the capacity of the migrated cloud host, the higher the migration efficiency, and the less the resources consumed. The minimum real released capacity R can be obtained through formula (3) min The corresponding host ID.

[0111] After obtaining the host ID of the minimum real released capacity, the sum of the remaining resource capacity of the remaining hosts can be calculated through formula (5), so as to judge whether the remaining hosts have enough space size to migrate the minimum real released capacity R through formula (6) min If the remaining hosts have enough space, the cloud hosts on the host to be migrated and the size of the cloud hosts can be obtained through formula (4), so as to judge whether the remaining hosts have enough space to migrate each required cloud host in turn.

[0112] The cloud hosts containing R min on the min host are migrated to other hosts through whole machine live migration. The whole machine live migration technology is to migrate the cloud host from one host to another host, and the service is not interrupted during the migration process, and the user has no perception.

[0113] Compared with the static data algorithm, the pre-experimental test by using the information collection module is more beneficial to the application of the algorithm in the real environment. The Lstm-Mix-Attention network algorithm is used to predict the size of the specification that the cloud host may apply in advance, so as to prevent the situation that the host capacity is insufficient when the user's actual cloud host application request arrives. The cloud resource automatic adjustment module dynamically adjusts the cloud resource allocation through the live migration technology, which effectively avoids the situation that the user cannot normally apply cloud host resources and the like due to insufficient host resources.

[0114] In addition, the present application also provides a terminal device, and the automatic prediction method based on the attention mechanism involved in the present embodiment is mainly applied to the terminal device. The terminal device can be a PC, a portable computer, a mobile terminal and the like.

[0115] Specifically, the terminal device can include a processor (e.g., a CPU), a communication bus, a user interface, a network interface, and a memory. The communication bus is used to realize the connection communication between these components; the user interface can include a display screen (Display) and an input unit such as a keyboard (Keyboard); the network interface can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface); the memory can be a high-speed RAM memory, or a stable memory (non-volatile memory) such as a disk memory, and the memory can also be a storage device independent of the aforementioned processor.

[0116] The memory stores a readable storage medium, and the readable storage medium stores a data integrity checking program. The processor can call the prediction program stored in the memory and execute the automatic prediction method based on the attention mechanism provided by the embodiment of the application.

[0117] It can be understood that the readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of the computer readable storage medium include a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punched card or a concave-convex structure in a slot, and any suitable combination of the above. The computer readable storage medium used herein is not to be interpreted as a transitory signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (for example, optical pulses through an optical fiber cable), or an electrical signal transmitted through a wire.

[0118] The computer readable program instructions described herein can be downloaded from the computer readable storage medium to the respective computing / processing device, or to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber-optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer readable program instructions from the network and forwards the computer readable program instructions to the computer readable storage medium in the respective computing / processing device for storage.

[0119] Computer readable program instructions for carrying out operations of the present disclosure can be assembly instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0120] Finally, it should be noted that the above-mentioned only is the preferred embodiment of the present application, and is not used to limit the present application, although the present application is described in detail with reference to the foregoing embodiments, for those skilled in the art, the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced, any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application, should be included in the protection scope of the present application.

Claims

1. An automatic prediction method based on an attention mechanism, characterized in that, include: Collect resource information from each host machine on the cloud platform and resource request information from cloud hosts, and organize the resource information and resource request information into basic data; Based on the aforementioned basic data, the resource request information and usage of future cloud hosts are analyzed and predicted using an Lstm-Mix-Attention network algorithm with an attention mechanism to obtain prediction results; Based on the prediction results, it is determined whether the remaining resources of each host machine meet the requirements of the requested cloud host. Based on the determination results, the cloud resource automatic adjustment algorithm adjusts the resources of the host machine so that it can support the requested cloud host. The Lstm-Mix-Attention network algorithm includes a Mix-Attention module and an LSTM network module. The Mix-Attention module includes a channel attention submodule and a spatial attention submodule, which are used to fuse feature information from two different dimensions: channel and spatial. The Mix-Attention module receives the output of the LSTM network module as input, and takes the cloud host's application time, requested CPU size, and memory size as input to the LSTM-Mix-Attention network algorithm to predict the future requested CPU size and memory size of the cloud host. The Lstm-Mix-Attention network algorithm includes: Weights are learned for the input features in both the channel and spatial dimensions. The input features are multiplied by the channel weights and spatial weights respectively to map the weights onto the channel feature map and the spatial feature map. The channel feature map and the spatial feature map are added together to obtain the final output feature.

2. The automatic prediction method based on an attention mechanism according to claim 1, characterized in that, The resource information in the host machine includes resource usage and current remaining resource capacity, and the resource request information of the cloud host includes the specifications and resource quantity of the requested cloud host; The basic data is acquired through the cloud platform's resource monitoring system.

3. The automatic prediction method based on an attention mechanism according to claim 1, characterized in that, The step of learning channel and spatial weights for the input features includes: Given a feature map F∈R C×H×W As input, these are fed into two attention submodules respectively to obtain a one-dimensional channel attention map M. c ∈R C×1×1 And two-dimensional spatial attention map M s ∈R 1×H×W .

4. The automatic prediction method based on an attention mechanism according to claim 3, characterized in that, The step of mapping the input features to the channel feature map and the spatial feature map by matrix multiplication of the input features with the channel weights and spatial weights, respectively, includes: The input feature map F is compared with the one-dimensional channel attention map M. c Multiplying them together yields the feature information along the channel dimension, as shown in the following formula: Compare the input feature map F with the two-dimensional spatial attention map M s Multiplying them together yields the spatial dimension feature information, as shown in the following formula:

5. The automatic prediction method based on an attention mechanism according to claim 4, characterized in that, The step of adding the channel feature map and the spatial feature map to obtain the final output feature includes: combining the feature information of the channel dimension with the feature information of the spatial dimension, and the attention process is as follows: In the formula, F represents the input feature map. F represents the product of two matrices. out The feature map represents the final attention output result.

6. The automatic prediction method based on an attention mechanism according to claim 1, characterized in that, The step of determining whether the remaining resource information of each host machine meets the requirements of the applied cloud host based on the prediction result includes: If any one of them can meet its requirements, then the cloud host will be requested on the host machine that meets the requirements; If none of the individual cloud servers can meet the specifications requested by the cloud host, but the total remaining CPU and memory of the host machine can meet the requirements, the distribution of cloud resources on the host machine will be automatically adjusted.

7. The automatic prediction method based on an attention mechanism according to claim 6, characterized in that, The cloud resource automatic adjustment algorithm includes: The optimal capacity that each host machine can release is calculated using the following formula. RIDL i =PL i In the formula, i represents the ID of each host machine, RIDL i Let P represent the minimum CPU and memory size released per host machine under ideal conditions, and let L represent the CPU and memory size predicted by the Lstm-Mix-Attention network algorithm. i This indicates the remaining capacity of each host machine; The actual capacity R to be released by the host machine is calculated using the following formula. i It must be greater than this ideal value RIDL i , R i ≥RIDL i In the formula, R i This represents the actual CPU and memory size released by each host machine; The minimum actual release capacity R is calculated using the following formula. min Its corresponding host ID, R min =MIN(R i ) In the formula, R min This represents the minimum capacity actually released, and the subscript min represents the host ID corresponding to the minimum capacity actually released. The following formula is used to calculate which cloud hosts on the host machine need to be migrated and the size of these cloud hosts, R. i =ΣV j In the formula, V j This represents the amount of resources that need to be released on the i-th host machine; The total remaining resource capacity of the remaining host machines is calculated using the following formula: In the formula, This represents the total remaining resource capacity of all host machines except the i-th host machine; The following formula is used to determine whether the remaining host machines have enough space to migrate the minimum actual release capacity R. min , 8. A cloud resource adjustment system based on an attention mechanism, characterized in that, include: The information collection module is used to collect resource information from various host machines on the cloud platform and resource request information from cloud hosts, and organize the resource information and resource request information into basic data; The prediction module is used to analyze and predict the resource application information and usage of future cloud hosts based on the aforementioned basic data using an LSTM-Mix-Attention network algorithm with an attention mechanism, and obtain prediction results. The LSTM-Mix-Attention network algorithm includes a Mix-Attention module and an LSTM network module. The Mix-Attention module includes a channel attention submodule and a spatial attention submodule, used to fuse feature information from two different dimensions: channel and spatial. The input of the Mix-Attention module is connected to the output of the LSTM network module, taking the cloud host's application time, requested CPU size, and memory size as inputs to the LSTM-Mix-Attention network algorithm to predict the CPU size and memory size requested by the future cloud host. The LSTM-Mix-Attention network algorithm includes: learning weights for the input features in both channel and spatial dimensions; mapping the input features to the channel and spatial feature maps by matrix multiplication; and adding the channel and spatial feature maps to obtain the final output features. The cloud resource automatic adjustment module is used to determine whether the remaining resource information of each host machine meets the requirements of the requested cloud host based on the prediction results, and adjust the resources of the host machine by the cloud resource automatic adjustment algorithm according to the judgment results so that it can support the requested cloud host.

Citation Information

Patent Citations

  • Cloud management platform, host machines and virtual machine resource deploying method and system

    CN103577271A

  • Method and device for achieving resource scheduling

    CN108667859A