Automatic prediction method and cloud resource adjustment system based on attention mechanism

By using the Lstm-Mix-Attention network algorithm based on the attention mechanism in cloud computing to predict cloud host resource requirements and automatically adjust host resources, it solves the problem of users being unable to apply for cloud host resources normally and achieves efficient allocation and utilization of resources. .

WO2024193169A1PCT designated stage expired Publication Date: 2024-09-26CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Application Number
PCT/CN2023/143139
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-11
Filing Date
2023-12-29
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

In the existing technology, users are still unable to apply for cloud host resources normally when the remaining capacity in the host is sufficient. This is mainly because the remaining capacity on each host cannot meet the user's needs, but the total remaining resources of all hosts meet the needs. .

Method used

The Lstm-Mix-Attention network algorithm based on the attention mechanism is used to predict future cloud host resource application information, and the cloud resource allocation in the host is re-adjusted through the cloud resource automatic adjustment module to ensure that users can apply for cloud resources normally. The method includes collecting resource information and resource application information, analyzing and predicting resource requirements through the Lstm-Mix-Attention network algorithm, judging whether each host meets the application requirements, and automatically adjusting resources according to the prediction results.

Benefits of technology

By predicting the user's application for cloud host resources in advance, the Lstm-Mix-Attention network algorithm is used to simulate the user's actual application for cloud resources, ensuring that sufficient resources are allocated when the actual request arrives, avoiding the inability of the user due to insufficient host resources. The situation of applying for cloud host resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023143139_26092024_PF_FP
    Figure CN2023143139_26092024_PF_FP
Patent Text Reader

Abstract

The present invention belongs to the technical field of cloud computing, and in particular relates to an automatic prediction method and cloud resource adjustment system based on an attention mechanism. The method comprises: collecting resource information in each host on a cloud platform and resource application information of each cloud host, and acquiring basic data; on the basis of the basic data, analyzing and predicting resource application information and usage conditions of the cloud host in the future by means of an Lstm-Mix-Attention network algorithm with an attention mechanism; and according to a prediction result, determining whether the current remaining resource information of each host meets the requirements of a cloud host that is applied for, and according to a determination result, adjusting resources of the host by means of an automatic cloud resource adjustment algorithm. The resource application conditions of a cloud host in the future are predicted by using an Lstm-Mix-Attention network algorithm, thereby achieving the aim of simulating a user to apply for cloud resources in a real manner; and the resource occupation conditions of the cloud host on the host are automatically adjusted by means of an automatic cloud resource adjustment module, such that when a real request comes, there are enough resources for allocation.
Need to check novelty before this filing date? Find Prior Art

Description

An automatic prediction method and cloud resource adjustment system based on attention mechanism Technical Field

[0001] The present invention belongs to the technical field of cloud computing, and in particular relates to an automatic prediction method and a cloud resource adjustment system based on an attention mechanism. Background Art

[0002] Cloud computing is a new pay-as-you-go, on-demand business model. In the era of big data and the internet, cloud computing data centers are rapidly expanding. Its core is internet-based computing, allowing users to purchase computers and other devices, as well as data storage services, on demand through browsers or the web.

[0003] IaaS (Infrastructure as a Service) stands for Infrastructure as a Service. By using this IaaS model, users can obtain server, storage, and network services from providers based on their actual resource usage or occupancy. This approach is very convenient; users don't need to purchase large equipment in advance; they can simply rent it from a provider anytime and anywhere based on their needs. Providers offer a variety of resource specifications, such as cloud hosts and cloud servers, as well as the operating system, storage, and network services required by users.

[0004] In the prior art, there are some drawbacks in the solutions for users to apply for cloud resources, especially when the total remaining capacity of the host machine is sufficient for the resource requirements applied by the user, the user cannot normally apply for cloud host resources.

[0005] Summary of the Invention

[0006] The purpose of the present invention is to provide an automatic prediction method and cloud resource adjustment system based on the attention mechanism, which first collects the application status of previous cloud hosts, then predicts future cloud host resource application information through the Lstm-Mix-Attention network algorithm, and finally readjusts and allocates the cloud resources in the host machine through the cloud resource automatic adjustment module, so as to achieve the purpose of enabling users to apply for cloud resources normally, thereby solving the problems raised in the above background technology.

[0007] To achieve the above-mentioned objectives, the present invention adopts the following technical solutions: an automatic prediction method based on an attention mechanism, comprising: collecting resource information from each host machine on a cloud platform and resource application information of a cloud host, and organizing the resource information and resource application information into basic data; based on the basic data, analyzing and predicting the resource application information and usage of future cloud hosts through an Lstm-Mix-Attention network algorithm with an attention mechanism to obtain prediction results; judging whether the remaining resource information of each current host machine meets the requirements of the applied cloud host according to the prediction results, and adjusting the resources of the host machine according to the judgment result by an automatic cloud resource adjustment algorithm so that it can host the required cloud host.

[0008] Preferably, the resource information in the host machine includes resource usage and current remaining resource capacity, and the resource application information of the cloud host includes the specifications and resource quantity of the cloud host applied for; wherein, the acquisition of the basic data is collected through the resource monitoring system of the cloud platform.

[0009] 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, which are used to fuse feature information of two different dimensions, channel and space. The input of the Mix-Attention module is connected to the output of the LSTM network module, and the application time, applied CPU size and memory size of the cloud host are input into the Lstm-Mix-Attention network algorithm to predict the CPU size and memory size applied for by the cloud host in the future.

[0010] Preferably, the Lstm-Mix-Attention network algorithm includes: performing weight learning on the channel and spatial dimensions of the input features respectively; mapping the weights to the channel feature map and the spatial feature map by matrix multiplication of the input features with the channel weights and the spatial weights respectively; adding the channel feature map and the spatial feature map to obtain the final output feature.

[0011] Preferably, the weight learning of the channel and spatial dimensions of the input features includes: given a feature map F∈R C×H×W As input, they are fed into two attention submodules to obtain a one-dimensional channel attention map M c ∈R C×1×1 and the two-dimensional spatial attention map M s ∈R 1×H×W .

[0012] Preferably, the weights are mapped to the channel feature map and the spatial feature map in a matrix multiplication manner, including: the input feature map F is multiplied with the one-dimensional channel attention map M c Multiply them together to get the feature information of the channel dimension, as shown below: Combine the input feature map F with the two-dimensional spatial attention map M s Multiply them together to get the feature information of the spatial dimension, as shown below:

[0013] Preferably, the adding of 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: Where F represents the input feature map, Represents the product of two matrices, F out Represents the final attention output feature map.

[0014] Preferably, the method of judging whether the remaining resource information of each current host machine meets the requirements of the applied cloud host based on the prediction results includes: if any one of them can meet its requirements, then applying for the cloud host on the host machine that meets the requirements; if each host machine cannot meet the specification requirements applied for by the cloud host, but the remaining total CPU and total memory of the host machine can meet its requirements, then automatically adjusting the distribution of cloud resources on the host machine.

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

[0016] The ideal capacity that can be released by each host is calculated by the following formula: RIDL i =PL i

[0017] Where i represents the ID of each host, RIDL i Indicates the minimum CPU size and memory size released by each host under ideal conditions. P represents the CPU size and memory size predicted by the Lstm-Mix-Attention network algorithm. L i Indicates the remaining capacity of each host;

[0018] Calculate the actual capacity R to be released by the host through the following formula i Must be greater than this ideal value RIDL i , R i ≥RIDL i

[0019] Where R i Indicates the actual released CPU size and memory size of each host;

[0020] The minimum capacity R for actual release is calculated by the following formula: min The corresponding host ID, R min =MIN(R i )

[0021] Where R min Indicates the minimum capacity that is actually released. The subscript min indicates the host ID corresponding to the minimum capacity that is actually released.

[0022] The cloud hosts that need to be migrated and the sizes of these cloud hosts can be calculated using the following formula: R i =∑V j

[0023] Where V j Indicates the size of the cloud host resources that need to be released on the i-th host;

[0024] The sum of the remaining resource capacities of the remaining hosts is calculated using the following formula:

[0025] Where, TL i Represents the sum of the remaining resource capacities of all hosts except the i-th host;

[0026] Use the following formula to determine whether the remaining hosts have enough space to migrate the minimum capacity R that is actually released: min ,

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

[0028] An information collection module is used to collect resource information from each host machine on the cloud platform and resource application information of the cloud host, and organize the resource information and resource application information into basic data;

[0029] A prediction module is used to 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 to obtain prediction results;

[0030] The cloud resource automatic adjustment module is used to determine whether the remaining resource information of each host machine meets the requirements of the applied cloud host based on the prediction results, and adjust the resources of the host machine according to the judgment result by the cloud resource automatic adjustment algorithm so that it can host the required cloud host.

[0031] Technical effects and advantages of the present invention: Compared with the existing technology, the automatic prediction method and cloud resource adjustment system based on the attention mechanism proposed in the present invention have the following advantages:

[0032] The present invention collects resource information of each host machine on the cloud platform and resource application information of the cloud host, and organizes the resource information and resource application information into basic data. Based on the basic data, the resource application information and usage of the future cloud host are analyzed and predicted through the Lstm-Mix-Attention network algorithm with an attention mechanism to obtain the prediction results. According to the prediction results, it is judged whether the remaining resource information of each host machine meets the requirements of the applied cloud host. According to the judgment results, the cloud resource automatic adjustment algorithm adjusts the resources of the host machine so that it can carry the required cloud host. The information collection module can be better used in a 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 user's actual application for cloud resources; the cloud resource automatic adjustment module automatically adjusts the resource occupancy of the cloud host on the host machine, so that when a real request comes, there are enough resources for allocation. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] FIG1 is a flow chart of an automatic prediction method based on an attention mechanism of the present invention;

[0034] FIG2 is a structural diagram of the Mix-Attention module of the present invention;

[0035] FIG3 is a structural diagram of a cloud resource adjustment system based on an attention mechanism according to the present invention. DETAILED DESCRIPTION

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

[0037] This invention provides an automatic prediction method and cloud resource adjustment system based on an attention mechanism. This method aims to solve the problem where the total remaining capacity of the host machines meets the user's application requirements, but the user is still unable to apply for cloud hosting normally. The reason is that the remaining capacity of each host machine cannot meet the user's application requirements, but the total remaining resources of all hosts do meet the requirements.

[0038] In this embodiment, the application status of previous cloud hosts is collected in advance, and the future cloud host resource application information is predicted through the Lstm-Mix-Attention network algorithm. Finally, the cloud resources in the host are readjusted and allocated through the cloud resource automatic adjustment module, so that users can apply for cloud resources normally.

[0039] As shown in FIG1 , the present invention provides an automatic prediction method based on an attention mechanism, comprising:

[0040] Step 1: Collect resource information from each host machine on the cloud platform and resource application information of the cloud host, and organize the resource information and resource application information into basic data;

[0041] Specifically, the resource information in the host machine includes resource usage and current remaining resource capacity, and the resource application information of the cloud host includes the specifications and resource quantity of the cloud host applied for; wherein, the acquisition of the basic data is collected through the resource monitoring system of the cloud platform.

[0042] Step 2: Based on the basic data, the resource application information and usage of the future cloud host are analyzed and predicted through the Lstm-Mix-Attention network algorithm with an attention mechanism to obtain the prediction results;

[0043] Specifically, 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 of two different dimensions, channel and space.

[0044] The input of the Mix-Attention module is connected to the output of the LSTM network module. The application time, requested CPU size, and memory size of the cloud host are fed into the LSTM-Mix-Attention network algorithm as input to predict the CPU size and memory size requested by the cloud host in the future.

[0045] The Lstm-Mix-Attention network algorithm includes: learning weights for the channel and spatial dimensions of input features; performing matrix multiplication on the input features with the channel weights and spatial weights to map the weights to the channel feature map and spatial feature map; and adding the channel feature map and spatial feature map to obtain the final output features. The details are as follows.

[0046] Given a feature map F∈R C×H×W As input, they are fed into two attention submodules to obtain a one-dimensional channel attention map M c∈R C×1×1 and the two-dimensional spatial attention map M s ∈R 1×H×W .

[0047] Combine the input feature map F with the one-dimensional channel attention map M c Multiply them together to get the feature information of the channel dimension, as shown below:

[0048] Combine the input feature map F with the two-dimensional spatial attention map M s Multiply them together to get the feature information of the spatial dimension, as shown below:

[0049] Combining the feature information of the channel dimension with the feature information of the spatial dimension, the attention process is as follows:

[0050] Where F represents the input feature map, Represents the product of two matrices, F out Represents the final attention output feature map.

[0051] Step 3: Based on the prediction results, determine whether the remaining resource information of each host currently meets the requirements of the requested cloud host, and adjust the resources of the host by the cloud resource automatic adjustment algorithm based on the judgment result so that it can host the required cloud host.

[0052] Specifically, based on the prediction results, it is determined whether the remaining resource information of each current host machine meets the requirements of the applied cloud host, including: if any one of them can meet its requirements, then apply for the cloud host on the host machine that meets the requirements; if each host cannot meet the specification requirements applied for by the cloud host, but the remaining total CPU and total memory of the host machine can meet its requirements, then automatically adjust the distribution of cloud resources on the host machine.

[0053] In addition, the cloud resource automatic adjustment algorithm includes:

[0054] The ideal capacity that can be released by each host is calculated by the following formula: RIDL i =PL i

[0055] Where i represents the ID of each host, RIDL i Indicates the minimum CPU size and memory size released by each host under ideal conditions. P represents the CPU size and memory size predicted by the Lstm-Mix-Attention network algorithm. L i Indicates the remaining capacity of each host;

[0056] Calculate the actual capacity R to be released by the host through the following formula i Must be greater than this ideal value RIDL i , R i ≥RIDL i

[0057] Where R i Indicates the actual released CPU size and memory size of each host;

[0058] The minimum capacity R for actual release is calculated by the following formula: min The corresponding host ID, R min =MIN(R i )

[0059] Where R min Indicates the minimum capacity that is actually released. The subscript min indicates the host ID corresponding to the minimum capacity that is actually released.

[0060] The cloud hosts that need to be migrated and the sizes of these cloud hosts can be calculated using the following formula: R i =∑V j

[0061] Where V j Indicates the size of the cloud host resources that need to be released on the i-th host;

[0062] The sum of the remaining resource capacities of the remaining hosts is calculated using the following formula:

[0063] Where, TL i Represents the sum of the remaining resource capacities of all hosts except the i-th host;

[0064] Use the following formula to determine whether the remaining hosts have enough space to migrate the minimum capacity R that is actually released: min ,

[0065] In this embodiment, compared to proposing an algorithm based on static data, pre-testing the algorithm using an information collection module is more conducive to its application in a real-world environment. The Lstm-Mix-Attention network algorithm is used to predict in advance the size of the cloud host that may be requested in the future, preventing the host from having insufficient capacity when the user actually requests a cloud host. The cloud resource automatic adjustment module dynamically adjusts cloud resource allocation using hot migration technology, effectively preventing situations where users are unable to apply for cloud host resources due to insufficient host resources.

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

[0067] Exemplarily, the information collection module is used to collect resource information from each host machine on the cloud platform and resource application information of the cloud host, and organize the resource information and resource application information into basic data.

[0068] In this example, the cloud platform's resource monitoring system first collects the required information. This information focuses on the resource usage and remaining capacity of each host on the cloud platform, as well as the specifications and resource availability of cloud hosts requested on the cloud platform. This step provides basic data for the machine learning prediction module in the next step, which predicts future resource requests for cloud hosts on the cloud platform.

[0069] 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 an attention mechanism to obtain the prediction results.

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

[0071] To achieve more accurate prediction results, a special attention mechanism, Mix-Attention, was designed to proactively focus on important information, enhance relevant information, and suppress irrelevant information, thereby obtaining better feature representation. The output of the LSTM network serves as the input to the Mix-Attention module, which contains two submodules: the channel attention submodule and the spatial attention submodule. These submodules fuse feature information from two different dimensions: channel and spatial, as shown in Figure 2.

[0072] First, the input features are weighted in the channel and spatial dimensions. Then, the input features are respectively multiplied by the channel weights and the spatial weights to map the weights to the channel feature map and the spatial feature map. Finally, the channel feature map and the spatial feature map are added to obtain the final output feature. The specific steps are as follows:

[0073] (1) Given a feature map F∈R C×H×W As input, they are fed into two attention submodules to obtain a one-dimensional channel attention map M c ∈R C×1×1 and the two-dimensional spatial attention map M s ∈R 1×H×W .

[0074] (2) Combine the input feature map F with the one-dimensional channel attention map M c Multiply them together to get the feature information of the channel dimension, as shown below:

[0075] (3) Combine the input feature map F with the two-dimensional spatial attention map M s Multiply them together to get the feature information of the spatial dimension, as shown below:

[0076] (4) Combining the feature information of the channel dimension with the feature information of the spatial dimension, the attention process is as follows:

[0077] Where F represents the input feature map, Represents the product of two matrices, F out Represents the final attention output feature map.

[0078] The application time, requested CPU size, and memory size of the cloud host are fed into the Lstm-Mix-Attention network algorithm as input to predict the CPU size and memory size requested by the cloud host in the future.

[0079] The cloud resource automatic adjustment module is used to determine whether the remaining resource information of each host machine meets the requirements of the applied cloud host based on the prediction results, and adjust the resources of the host machine according to the judgment result by the cloud resource automatic adjustment algorithm so that it can host the required cloud host.

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

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

[0082] The ideal capacity that can be released by each host is calculated by the following formula: RIDL i =PL i (1)

[0083] Where i represents the ID of each host, RIDL i Indicates the minimum CPU size and memory size released by each host under ideal conditions. P represents the CPU size and memory size predicted by the Lstm-Mix-Attention network algorithm. L i Indicates the remaining capacity of each host;

[0084] Calculate the actual capacity R to be released by the host through the following formula i Must be greater than this ideal value RIDL i , R i ≥RIDL i (2)

[0085] Where R i Indicates the actual released CPU size and memory size of each host;

[0086] The minimum capacity R for actual release is calculated by the following formula: min The corresponding host ID, R min =MIN(R i ) (3)

[0087] Where R min Indicates the minimum capacity that is actually released. The subscript min indicates the host ID corresponding to the minimum capacity that is actually released.

[0088] The cloud hosts that need to be migrated and the sizes of these cloud hosts can be calculated using the following formula: R i =∑V j(4)

[0089] Where V j Indicates the size of the cloud host resources that need to be released on the i-th host;

[0090] The sum of the remaining resource capacities of the remaining hosts is calculated using the following formula:

[0091] Where, Represents the sum of the remaining resource capacities of all hosts except the i-th host;

[0092] Use the following formula to determine whether the remaining hosts have enough space to migrate the minimum capacity R that is actually released: min ,

[0093] Formula (1) can be used to know the ideal capacity that each host can release, and formula (2) can be used to know the actual capacity R that the host needs to release. i Must be greater than this ideal value RIDL i In order to meet the specifications of the cloud host application. Since the capacity of each allocated cloud host on each host machine is different, these two formulas can be used to obtain the actual capacity that each host machine needs to release. Because the migration capacity is different, the required network bandwidth and consumed resources are different. Therefore, the smaller the capacity of the migrated cloud host, the higher the migration efficiency and the less resources consumed. The minimum capacity R that can be actually released can be obtained through formula (3) min The corresponding host ID.

[0094] After obtaining the host ID of the smallest capacity that is actually released, the sum of the remaining resource capacities of the remaining hosts can be calculated using formula (5), and then formula (6) can be used to determine whether the remaining hosts have enough space to migrate the smallest capacity that is actually released R min If the remaining hosts have enough space, we can use formula (4) to determine which cloud hosts on the host need to be migrated and the sizes of these cloud hosts, and then determine whether the remaining hosts have enough space to migrate each required cloud host.

[0095] By hot migration of the whole machine, the min host machine containing R min The whole machine hot migration technology is to migrate the cloud host from one host to another. The business is not interrupted during the migration process and the user is unaware.

[0096] Compared to proposing algorithms based on static data, pre-testing with the information collection module is more conducive to real-world application. The LSTM-Mix-Attention network algorithm predicts the likely size of future cloud hosts, preventing the situation where host capacity is insufficient when users actually request cloud hosts. The cloud resource automatic adjustment module dynamically adjusts cloud resource allocation using hot migration technology, effectively preventing situations where users are unable to apply for cloud hosts due to insufficient host resources.

[0097] In addition, the present invention also provides a terminal device. The automatic prediction method based on the attention mechanism involved in this embodiment is mainly applied to the terminal device, which can be a PC, portable computer, mobile terminal, or other device with display and processing functions.

[0098] Specifically, a terminal device may 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 enable communication between these components; the user interface may include a display and an input unit such as a keyboard; the network interface may optionally include a standard wired interface or a wireless interface (e.g., a Wi-Fi interface); and the memory may be high-speed RAM or non-volatile memory, such as a disk drive. The memory may also be a storage device independent of the processor.

[0099] Among them, the memory stores a readable storage medium, a data integrity verification program in the readable storage medium, and the processor can call the prediction program stored in the memory and execute the automatic prediction method based on the attention mechanism provided by an embodiment of the present invention.

[0100] It will be understood that a computer-readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, 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 punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient 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 (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0101] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via 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 be stored in the computer-readable storage medium in each computing / processing device.

[0102] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0103] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An automatic prediction method based on attention mechanism, characterized in that: include: Collect resource information from each host machine on the cloud platform and resource application information of the cloud host, and organize the resource information and resource application information into basic data; Based on the basic data, the resource application information and usage of the future cloud host are analyzed and predicted through the Lstm-Mix-Attention network algorithm with an attention mechanism to obtain the prediction results; The prediction result is used to determine whether the remaining resource information of each host currently meets the requirements of the applied cloud host, and the cloud resource automatic adjustment algorithm is used to adjust the resources of the host according to the determination result so that it can carry the required cloud host.

2. The automatic prediction method based on the attention mechanism according to claim 1, characterized in that: The resource information in the host includes resource usage and current remaining resource capacity, and the resource application information of the cloud host includes the specification and resource quantity of the cloud host applied for; The basic data is collected through the resource monitoring system of the cloud platform.

3. The automatic prediction method based on the attention mechanism according to claim 1, characterized in that: 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 of two different dimensions, channel and space. The input of the Mix-Attention module is connected to the output of the LSTM network module, and the application time, the requested CPU size and the memory size of the cloud host are sent as input to the Lstm-Mix-Attention network algorithm to predict the CPU size and memory size requested by the future cloud host.

4. The automatic prediction method based on the attention mechanism according to claim 3, characterized in that: The Lstm-Mix-Attention network algorithm includes: The input features are weighted in channel and spatial dimensions respectively; The input features are respectively mapped to the channel weights and spatial weights by matrix multiplication to map the weights to the channel feature map and the spatial feature map; Add the channel feature map and the spatial feature map to get the final output feature.

5. The automatic prediction method based on the attention mechanism according to claim 4, characterized in that: The weight learning of the channel and spatial dimensions of the input features respectively includes: Given a feature map F∈R C×H×W As input, they are sent to two attention submodules respectively to obtain a one-dimensional channel attention map M c ∈R C×1×1 and the 2D spatial attention map M s ∈R 1×H×W .

6. The automatic prediction method based on the attention mechanism according to claim 5, characterized in that: The step of respectively mapping the input features with the channel weights and the spatial weights to the channel feature map and the spatial feature map in a matrix multiplication manner includes: Combine the input feature map F with the one-dimensional channel attention map M c Multiply them together to get the feature information of the channel dimension, as shown below: Combine the input feature map F with the two-dimensional spatial attention map M s Multiply them together to get the feature information of the spatial dimension, as shown below:

7. The automatic prediction method based on the attention mechanism according to claim 6, characterized in that: The channel feature map and the spatial feature map are added to obtain the final output feature, including: combining the feature information of the channel dimension with the feature information of the spatial dimension. The attention process is as follows: In the formula, F represents the input feature map, represents the product of two matrices, F out Represents the final attention output feature map.

8. The automatic prediction method based on the attention mechanism according to claim 3, characterized in that: The step of judging whether the remaining resource information of each host currently meets the requirements of the applied cloud host according to the prediction result includes: If any of them can meet the requirements, the cloud will be applied on the host that meets the requirements. Host; If each machine cannot meet the specification requirements applied for by the cloud host, but the remaining total CPU and total memory of the host machine can meet its requirements, the distribution of cloud resources on the host machine will be automatically adjusted.

9. The automatic prediction method based on the attention mechanism according to claim 8, characterized in that: The cloud resource automatic adjustment algorithm includes: The most ideal capacity that can be released by each host is calculated by the following formula: RIDDL i =PL i In the formula, i represents the ID of each host, RIDL i In an ideal state, each host machine releases the least amount of CPU and memory. P represents the CPU and memory size predicted by the Lstm-Mix-Attention network algorithm. L i Indicates the remaining capacity of each host; The actual capacity R to be released by the host is calculated by the following formula i Must be greater than this ideal value RIDL i , R i ≥RIDL i In the formula, R i Indicates the actual released CPU size and memory size of each host; The minimum capacity R for actual release is calculated by the following formula: min The corresponding host ID, R min =MIN(R i ) In the formula, R min Indicates the minimum capacity that is actually released. The subscript min indicates the host ID corresponding to the minimum capacity that is actually released. The following formula is used to calculate which cloud hosts on the host machine need to be migrated and the sizes of these cloud hosts: R i =∑V j Where V j Indicates the size of the cloud host resources that need to be released on the i-th host; The sum of the remaining resource capacities of the remaining hosts is calculated using the following formula: In the formula, Represents the sum of the remaining resource capacities of the host machines except the i-th host machine; Use the following formula to determine whether the remaining hosts have enough space to migrate the minimum capacity R that is actually released: min , 10. A cloud resource adjustment system based on attention mechanism, characterized in that: include: An information collection module is used to collect resource information from each host machine on the cloud platform and resource application information of the cloud host, and organize the resource information and resource application information into basic data; A prediction module is used to 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 to obtain prediction results; The cloud resource automatic adjustment module is used to determine whether the remaining resource information of each host machine meets the requirements of the applied cloud host according to the prediction results, and adjust the resources of the host machine according to the judgment result by the cloud resource automatic adjustment algorithm so that it can carry the required cloud host.

Citation Information

Patent Citations

  • Cloud computing resource management method and system based on LSTM

    CN111327456A

  • Cloud resource planning method and device and storage medium

    CN114205246A

  • Resource capacity expansion and contraction method and device of cloud host

    CN116775205A

  • Cloud resource management using machine learning

    US20200285503A1

Cited By

  • Cloud host migration method, computer storage medium, and program product

    WO2026103847A1