Load prediction method and device for container cloud platform, and storage medium
By quantifying the load values of containers and nodes in the container cloud platform and building a multiplicative LSTM network model to predict container load, the problems of uneven load and improper resource utilization in the container cloud platform are solved, and resource utilization and service availability are improved.
Patent Information
- Application Number
- CN202411849329.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-25
AI Technical Summary
How to effectively manage and schedule uneven load and improper resource utilization in the container cloud platform to improve resource utilization, reliability and service availability.
By quantifying the load situation of container cloud resources, determining the load value of each container and node, building a load prediction model, and using multiplication LSTM network to predict container load in the future time period.
Improve the accuracy and adaptability of load prediction in container cloud environments, provide stronger resource management and scheduling support, and reduce response time, over-configuration and insufficient configuration problems.
Smart Images

Figure CN119690590A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of container resource scheduling, and specifically relates to a load prediction method, device, and storage medium for a container cloud platform. Background Art
[0002] Cloud service platforms based on container technology face challenges such as the expansion of container scale, complex dependencies, and diversified resource structures. How to effectively manage and schedule problems such as uneven load and improper resource utilization in container cloud environments has become a focus of urgent research. Accurate workload information can reserve resources in advance to effectively execute and manage upcoming workloads, reduce response time, over-configuration and under-configuration issues, and improve resource utilization, reliability, and service availability. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention proposes a load prediction method, device, and storage medium for a container cloud platform, which improves the accuracy and adaptability of load prediction in a container cloud environment.
[0004] In order to achieve the above object, the present invention provides a load prediction method for a container cloud platform, comprising:
[0005] Quantify the load of container cloud resources, determine the load value of each container and each node, and obtain load time series data;
[0006] Taking the load time series data as input, constructing a load prediction model;
[0007] The constructed load prediction model is used to predict the container load in the future period of time.
[0008] In some embodiments, for each container, the average CPU utilization and the average memory utilization of the container in a unit time are calculated to determine the load value of the container in a unit time;
[0009] For each node, the total load of all containers of the node is calculated, and the resource consumption of the node's system process and other processes is taken into account. Combined with static and dynamic factors, the load value of the node per unit time is determined.
[0010] In some embodiments, the load value of the container is expressed as:
[0011] load1 i =δ cpu avg(used cpu )+δ mem avg(used mem )
[0012] Among them, load1i Indicates the load value of container i per unit time, used cpu and used mem They represent the sampling values of the CPU utilization and memory utilization of the node host in unit time t, avg represents the average value, and δ cpu and δ mem They represent the weight ratios of the average CPU utilization and the average memory utilization respectively.
[0013] In some embodiments, the static factors include CPU utilization, memory utilization, disk I / O utilization and network I / O utilization; wherein the CPU utilization is the percentage of time a single node occupies the CPU per unit time; the memory utilization is the average value of the ratio of the memory allocated to a single node over a period of time to the total memory; the disk I / O utilization is the percentage of disk processing read or write requests; the network I / O utilization is the ratio of network throughput to bandwidth;
[0014] The dynamic factors include resource request amount and resource service intensity; wherein the resource request amount includes the resource demand of a single node and the total resource demand of the node cluster per unit time; the resource service intensity includes the resource service intensity of a single node and the total resource service intensity of the node cluster per unit time.
[0015] In some embodiments, the load value of the node is expressed as:
[0016]
[0017] Among them, load2 i represents the load value of node i per unit time, They represent the CPU utilization, memory utilization, disk I / O utilization, and network I / O utilization of node i per unit time t; r t represents the resource demand of node i per unit time t, R t Represents the total resource demand of the node cluster per unit time t; q t represents the resource service intensity of node i per unit time t, Q t The total resource demand of the node cluster per unit time t; δ1~δ6 represent the weight proportion of each influencing factor.
[0018] In some embodiments, the load prediction model uses a multiplication LSTM network, and the multiplication LSTM network is generated by combining a multiplication RNN network with an LSTM network;
[0019] Taking the load time series data as input, determine the intermediate state of the multiplication RNN network and the hidden state of the current time step, connect the intermediate state to the input gate, output gate, and forget gate of the LSTM network, determine the states of the input gate, output gate, and forget gate of the current time step, and construct the load prediction model.
[0020] In some embodiments, the load prediction model is expressed as:
[0021] m t =(W mx X t )⊙(W mh h t-1 )
[0022] h t =(W hx X t )+(W hm m t )
[0023] i t =σ(W ix X t -W im m t )
[0024] o t =σ(W ox X t -W om m t )
[0025] f t =σ(W fx X t -W fm m t )
[0026] Among them, m t Represents the intermediate state of the multiplication RNN network, W mx Represents the weight matrix input to the multiplication RNN network, which is used to transform the input data of the current time step; X t Represents the input data of the current time step, that is, the input load time series data; W mh Represents the weight matrix from the hidden state to the intermediate state at the previous time step, h t-1 represents the hidden state of the previous time step, ⊙ represents the element-wise multiplication; h t represents the hidden state of the current time step, W hx Represents the weight matrix of the hidden state input to the current time step, W hm Represents the weight matrix from the intermediate state to the hidden state at the current time step; i trepresents the state of the input gate of the LSTM network at the current time step, σ represents the Sigmoid activation function, which maps the input to between 0 and 1, and W ix Represents the weight matrix input to the input gate, W im Represents the weight matrix from the intermediate state to the input gate; o t Represents the state of the output gate of the LSTM network at the current time step, W ox Represents the weight matrix from input to output gate, W om represents the weight matrix from the intermediate state to the output gate; f t represents the state of the forget gate of the LSTM network at the current time step, W fx Represents the weight matrix input to the forget gate, W fm Represents the weight matrix from the intermediate state to the forget gate.
[0027] In some embodiments, the load value of each container is arranged in chronological order, and the load value of each node is arranged in chronological order to obtain the load time series data.
[0028] Another aspect of the present invention further provides a load prediction device for a container cloud platform, adopting the above method, the device at least comprises:
[0029] The load quantification module is used to quantify the load of container cloud resources, determine the load value of each container and each node, and obtain load time series data;
[0030] A model building module, used to build a load prediction model using the load time series data as input;
[0031] The prediction module is used to predict the container load in the future time period by using the constructed load prediction model.
[0032] On the other hand, the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-mentioned load prediction method for a container cloud platform.
[0033] It can be seen from the above scheme that the advantages of the present invention are:
[0034] The load prediction method for the container cloud platform disclosed in the present invention quantifies the load of the container cloud resources, determines the load value of each container and the load value of each node, and obtains the load time series data. The dynamic factors are combined with the static factors to determine the load of the node to truly reflect the resource load in the container cloud environment. The load time series data is used as input, and a load prediction model is constructed in combination with the LSTM network and the multiplication RNN network, which is easy to parallelize and realize efficient training. Finally, the constructed load prediction model is used to predict the container load in the future time period. This method improves the accuracy and adaptability of load prediction in the container cloud environment, and provides more powerful support for container resource management and scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The overall flow chart of a load prediction method for a container cloud platform provided by an embodiment of the present invention is shown;
[0036] Figure 2 A schematic block diagram of a load prediction device for a container cloud platform provided by an embodiment of the present invention is shown.
[0037] in:
[0038] 200: a load prediction device for a container cloud platform;
[0039] 210: load quantization module;
[0040] 220: model building module;
[0041] 230: prediction module. DETAILED DESCRIPTION
[0042] In order to make the above features and effects of the present invention more clearly understood, embodiments are given below and described in detail with reference to the accompanying drawings.
[0043] See also Figure 1 , Figure 1 The overall flow diagram of a load prediction method for a container cloud platform provided by an embodiment of the present invention is shown. The load prediction method for a container cloud platform comprises the following steps:
[0044] Step S1: quantify the load of container cloud resources, determine the load value of each container and the load value of each node, and obtain load time series data.
[0045] In one embodiment, the load of container cloud resources can be collected from a container management platform, a monitoring tool, or a log system for quantification. The load of container cloud resources generally includes the load of the container and the load of the node, wherein the container is a lightweight, portable, self-contained software packaging technology used to encapsulate an application and all its dependencies and configurations together. The load of a container mainly refers to the computing resources consumed by the application running in the container. In cloud computing and containerized environments, a node generally refers to a host or virtual machine running a container. The load of a node refers to the computing resources consumed by all containers on the node and other processes that may exist. The load of a container only focuses on the resource consumption of an application within a single container, while the load of a node focuses on the resource consumption of all containers and processes on the entire node.
[0046] Specifically, in this embodiment, the load of the container is measured by the indicators of CPU utilization and memory utilization. For each container, the average CPU utilization and average memory utilization of the container in a unit time are calculated to determine the load value of the container in a unit time. The load value of the container is expressed as:
[0047] load1 i =δ cpu avg(used cpu )+δ mem avg(used mem )
[0048] Among them, load1 i Indicates the load value of container i per unit time, used cpu and used mem They represent the sampling values of the CPU utilization and memory utilization of the node host in unit time t, avg represents the average value, and δ cpu and δ mem They represent the weight ratios of the average CPU utilization and the average memory utilization respectively.
[0049] The container cloud environment is in a dynamic state of constant change. The existing node load is modeled by selecting some key static physical influencing factors, such as CPU, memory, disk I / O, and network bandwidth. However, the non-significance and uncertainty of these indicators make it difficult for them to truly reflect the resource load in the container cloud environment. Therefore, in this embodiment, the node load is determined by combining static factors and characteristic dynamic factors.
[0050] Specifically, for each node, the sum of the loads of all containers of the node is calculated, and the resource consumption of the node's own system process and other processes is considered. Combined with static and dynamic factors, the load value of the node per unit time is determined.
[0051] Among them, the static factors include CPU utilization, memory utilization, disk I / O utilization and network I / O utilization; among them, the CPU utilization is the percentage of time a single node occupies the CPU per unit time; the memory utilization is the average value of the ratio of the memory allocated to a single node over a period of time to the total memory; the disk I / O utilization is the percentage of disk processing read or write requests; the network I / O utilization is the ratio of network throughput to bandwidth.
[0052] The dynamic factors include resource request volume, resource service intensity, and resource available time. The resource request volume includes the resource demand of a single node per unit time and the total resource demand of the node cluster. The average number of service requests received by node i per unit time t is r i , then the total resource request amount of the node cluster in unit time t is:
[0053] The resource service intensity includes the resource service intensity of a single node per unit time and the total resource service intensity of the node cluster. i Indicates that: time avg =r i / p i , then the resource service intensity q of the node in unit time i =time avg / time int , time int Indicates the length of time. The total resource service intensity of the node cluster per unit time is:
[0054] Combining the above static and dynamic factors, the load value of node i in unit time t is expressed as:
[0055]
[0056] Among them, load2 i represents the load value of node i per unit time, They represent the CPU utilization, memory utilization, disk I / O utilization, and network I / O utilization of node i per unit time t; r t represents the resource demand of node i per unit time t, R t Represents the total resource demand of the node cluster per unit time t; q t represents the resource service intensity of node i per unit time t, Q t The total resource demand of the node cluster per unit time t; δ1~δ6 represent the weight proportion of each influencing factor.
[0057] In one embodiment, the load values of each container are further arranged in time sequence, and the load values of each node are arranged in time sequence, so as to obtain the load time series data.
[0058] In this embodiment, multi-dimensional factors are combined to model the time series data in the container cloud environment from the aspects of container load and node load. Static factors are combined with dynamic factor characteristics to determine the node load, which can meet the needs of change sensitivity and active adaptability in the cloud environment.
[0059] Step S2: Using the load time series data as input, a load prediction model is constructed.
[0060] In one embodiment, the load prediction model adopts a multiplication LSTM network, and the multiplication LSTM network is generated by a multiplication RNN network combined with an LSTM network. The LSTM network and the multiplication RNN network each have different functions. The LSTM network controls the flow of information, while the multiplication RNN network allows transitions between states. In this embodiment, a multiplication LSTM network is used, combining the advantages of LSTM and multiplication RNN, to predict the load of a container cloud environment. Specifically, taking the load time series data as input, the intermediate state of the multiplication RNN network and the hidden state of the current time step are determined, and the intermediate state is connected to the input gate, output gate, and forget gate of the LSTM network, and the states of the input gate, output gate, and forget gate of the current time step are determined. The multiplication RNN network is combined with the LSTM network to construct the load prediction model. The load prediction model is expressed as:
[0061] m t =(W mx X t )⊙(W mh h t-1 )
[0062] h t =(W hx X t )+(W hm m t )
[0063] i t =σ(W ix X t -W im m t )
[0064] o t =σ(W ox X t -W om m t )
[0065] ft =σ(W fx X t -W fm m t )
[0066] Among them, m t Represents the intermediate state of the multiplication RNN network, W mx Represents the weight matrix input to the multiplication RNN network, which is used to transform the input data of the current time step; X t Represents the input data of the current time step, that is, the input load time series data; W mh Represents the weight matrix from the hidden state to the intermediate state at the previous time step, h t-1 represents the hidden state of the previous time step, ⊙ represents the element-wise multiplication; h t represents the hidden state of the current time step, W hx Represents the weight matrix of the hidden state input to the current time step, W hm Represents the weight matrix from the intermediate state to the hidden state at the current time step, which is used to pass the information of the intermediate state to the hidden state; i t represents the state of the input gate of the LSTM network at the current time step, σ represents the Sigmoid activation function, which maps the input to between 0 and 1, and W ix Represents the weight matrix input to the input gate, W im Represents the weight matrix from the intermediate state to the input gate, which is used to adjust the impact of the intermediate state on the input gate; o t Represents the state of the output gate of the LSTM network at the current time step, W ox Represents the weight matrix from input to output gate, W om Represents the weight matrix from the intermediate state to the output gate, which is used to adjust the impact of the intermediate state on the output gate; f t represents the state of the forget gate of the LSTM network at the current time step, W fx Represents the weight matrix input to the forget gate, W fm Represents the weight matrix from the intermediate state to the forget gate, which is used to adjust the impact of the intermediate state on the forget gate.
[0067] In this embodiment, the advantages of LSTM and multiplication RNN are combined to build a load prediction model. Information is dynamically selected and adjusted in the information flow, so as to more effectively capture the important features in the input data. And the memory unit can be better managed, making the preservation of important information and the forgetting of irrelevant information more flexible. Compared with traditional LSTM and other deep variants, the multiplication LSTM network can flexibly adjust the update method of its hidden state according to different inputs, and has a simple structure, which is easier to parallelize and achieve efficient training.
[0068] In addition, in one embodiment, the constructed load forecasting model is further evaluated using evaluation indicators such as root mean square error RMSE, mean absolute percentage error MAPE, and absolute error MAE. RMSE is a commonly used indicator to measure the deviation between the prediction result and the true value. It calculates the square root of the average of the sum of squares of the differences between the predicted value and the true value. The smaller the RMSE, the smaller the deviation between the predicted value and the true value, and the higher the prediction accuracy of the model. MAPE is a commonly used indicator to measure the relative error between the prediction result and the true value. It calculates the percentage average of the absolute error between the predicted value and the true value. The smaller the MAPE, the smaller the relative error between the predicted value and the true value, and the higher the prediction accuracy of the model. The absolute error is the difference between the measured value and the true value, which reflects the deviation of the measured value from the true value. In the load forecasting model, the absolute error can be expressed as the absolute value of the difference between the predicted value and the true value.
[0069] Step S3: Use the constructed load prediction model to predict the container load in a future time period.
[0070] Finally, the trained prediction model is used to predict the container load in the future. The prediction results can provide a basis for decision-making such as resource allocation and load balancing. The resource allocation of the container cloud is dynamically adjusted according to the prediction results to ensure that sufficient resource support can be provided during peak load periods, and that excess resources can be released during low load periods to reduce costs.
[0071] In summary, the load prediction method for the container cloud platform disclosed in the present invention considers the combination of dynamic factors and static factors to determine the load of the node to truly reflect the resource load in the container cloud environment. The load prediction model is constructed by combining the LSTM network and the multiplication RNN network, which is easy to parallelize and achieve efficient training. This method improves the accuracy and adaptability of load prediction in the container cloud environment, and provides more powerful support for container resource management and scheduling.
[0072] In addition, it should be noted that the load prediction method for container cloud platform disclosed in the present invention is not limited to the order of steps S1-S3, and steps can be reordered, added or deleted. For example, the steps recorded in the present invention can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of the present invention can be achieved, the present invention is not limited here.
[0073] In addition, corresponding to the aforementioned embodiment of the load prediction method for a container cloud platform, the present invention also provides an embodiment of a load prediction device for a container cloud platform.
[0074] See also Figure 2, an embodiment of the present invention provides a load prediction device 200 for a container cloud platform, the device at least comprising:
[0075] The load quantification module 210 is used to quantify the load of the container cloud resources, determine the load value of each container and the load value of each node, and obtain load time series data.
[0076] The model building module 220 is used to build a load prediction model using the load time series data as input.
[0077] The prediction module 230 is used to predict the container load in a future time period by using the constructed load prediction model.
[0078] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of each module of the described device can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0079] According to an embodiment of the present invention, the present invention also provides a machine-readable medium, which may be a tangible medium, which may contain or store a program for use by an instruction execution system, apparatus or device or for use in conjunction with an instruction execution system, apparatus or device, and the computer program, when executed by a processor, implements the steps of the above-mentioned load prediction method for a container cloud platform.
[0080] In addition, the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0081] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A load prediction method for a container cloud platform, characterized in that: Include: Quantify the load of container cloud resources, determine the load value of each container and each node, and obtain load time series data; Taking the load time series data as input, constructing a load prediction model; The constructed load prediction model is used to predict the container load in the future period of time.
2. The method according to claim 1, characterized in that For each container, calculate the average CPU utilization and average memory utilization of the container per unit time, and determine the load value of the container per unit time; For each node, the total load of all containers of the node is calculated, and the resource consumption of the node's system process and other processes is taken into account. Combined with static and dynamic factors, the load value of the node per unit time is determined.
3. The method according to claim 2, characterized in that The load value of the container is expressed as: load1 i =δ cpu avg(used cpu )+δ mem avg(used mem ) Among them, load1 i Indicates the load value of container i per unit time, used cpu and used mem They represent the sampling values of the CPU utilization and memory utilization of the node host in unit time t, avg represents the average value, and δ cpu and δ mem They represent the weight ratios of the average CPU utilization and the average memory utilization respectively.
4. The method according to claim 2, characterized in that: The static factors include CPU utilization, memory utilization, disk I / O utilization and network I / O utilization; wherein the CPU utilization is the percentage of time a single node occupies the CPU per unit time; the memory utilization is the average value of the ratio of the memory allocated to a single node over a period of time to the total memory; the disk I / O utilization is the percentage of disk processing read or write requests; the network I / O utilization is the ratio of network throughput to bandwidth; The dynamic factors include resource request amount and resource service intensity; wherein the resource request amount includes the resource demand of a single node and the total resource demand of the node cluster per unit time; the resource service intensity includes the resource service intensity of a single node and the total resource service intensity of the node cluster per unit time.
5. The method according to claim 4, characterized in that The load value of the node is expressed as: Among them, load2 i represents the load value of node i per unit time, They represent the CPU utilization, memory utilization, disk I / O utilization, and network I / O utilization of node i per unit time t; r t represents the resource demand of node i per unit time t, R t Represents the total resource demand of the node cluster per unit time t; q t represents the resource service intensity of node i per unit time t, Q t The total resource demand of the node cluster per unit time t; δ1~δ6 represent the weight proportion of each influencing factor.
6. The method according to claim 1, characterized in that The load prediction model adopts a multiplication LSTM network, and the multiplication LSTM network is generated by combining a multiplication RNN network with an LSTM network; Taking the load time series data as input, determine the intermediate state of the multiplication RNN network and the hidden state of the current time step, connect the intermediate state to the input gate, output gate, and forget gate of the LSTM network, determine the states of the input gate, output gate, and forget gate of the current time step, and construct the load prediction model.
7. The method according to claim 6, characterized in that The load prediction model is expressed as: m t =(W mx X t )⊙(W mh h t-1 ) h t =(W hx X t )+(W hm m t ) i t =σ(W ix X t -W im m t ) o t =σ(W ox X t -W om m t ) f t =σ(W fx X t -W fm m t ) Among them, m t Represents the intermediate state of the multiplication RNN network, W mx Represents the weight matrix input to the multiplication RNN network, which is used to transform the input data of the current time step; X t Represents the input data of the current time step, that is, the input load time series data; W mh Represents the weight matrix from the hidden state to the intermediate state at the previous time step, h t-1 represents the hidden state of the previous time step, ⊙ represents the element-wise multiplication; h t represents the hidden state of the current time step, W hx Represents the weight matrix of the hidden state input to the current time step, W hm Represents the weight matrix from the intermediate state to the hidden state at the current time step; i t represents the state of the input gate of the LSTM network at the current time step, σ represents the Sigmoid activation function, which maps the input to between 0 and 1, and W ix Represents the weight matrix input to the input gate, W im Represents the weight matrix from the intermediate state to the input gate; o t Represents the state of the output gate of the LSTM network at the current time step, W ox Represents the weight matrix from input to output gate, W om represents the weight matrix from the intermediate state to the output gate; f t represents the state of the forget gate of the LSTM network at the current time step, W fx Represents the weight matrix input to the forget gate, W fm Represents the weight matrix from the intermediate state to the forget gate.
8. The method according to claim 1, characterized in that The load value of each container is arranged in chronological order, and the load value of each node is arranged in chronological order to obtain the load time series data.
9. A load prediction device for a container cloud platform, characterized in that: The method according to any one of claims 1 to 8 is adopted, wherein the device at least comprises: The load quantification module is used to quantify the load of container cloud resources, determine the load value of each container and each node, and obtain load time series data; A model building module, used to build a load prediction model using the load time series data as input; The prediction module is used to predict the container load in the future time period by using the constructed load prediction model.
10. A computer-readable storage medium, characterized in that: A computer program is stored, which, when executed by a processor, implements the steps of the load prediction method for a container cloud platform as described in any one of claims 1 to 8.