Training, determination methods, devices, equipment and media for container power consumption determination models
By iteratively training a container power consumption determination model and utilizing different types of neural network models and actual server power consumption, the problem of difficult determination of container power consumption is solved, enabling fast and efficient prediction of container power consumption and optimization of resource scheduling.
Patent Information
- Application Number
- CN202310968480.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-08-02
AI Technical Summary
Existing technologies struggle to quickly and efficiently determine the power consumption of containers during operation, especially when multiple containers are running on virtual machines, leading to difficulties in resource scheduling.
By iteratively training the container power consumption determination model based on a sample set, the load information of containers and virtual machines is obtained. Different types of neural network models (such as multi-layer fully connected networks, convolutional networks, residual networks, and deconvolutional networks) are used to determine the estimated power consumption of containers. The model parameters are adjusted and trained in conjunction with the actual power consumption of the server to achieve accurate prediction of container power consumption.
It enables the rapid and accurate determination of container power consumption during operation, supporting more efficient resource scheduling and energy conservation and emission reduction.
Smart Images

Figure CN117150288B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of container technology, and in particular to a container power consumption determination model training method, container power consumption determination method, apparatus, device and medium. Background Technology
[0002] With the development of cloud computing technology, cloud-native technologies have gradually become mainstream, and applications such as Software as a Service (SaaS) are increasingly being containerized. Applications no longer need to run in a fixed virtual machine, but rather use lightweight and scalable containers as their runtime units. Containers can serve as the basic unit for resource partitioning and scheduling. In today's context of energy conservation and emission reduction, effective container scheduling methods are typically needed to reduce service costs and respond to national green and low-carbon requirements in order to better utilize resources.
[0003] Generally, knowing the power consumption of a container during operation allows for better scheduling. However, since containers typically run on virtual machines, and a single virtual machine may run many containers, and the resources used by a task may be distributed across multiple containers, it is very difficult to independently measure the power consumption of each container in practice.
[0004] Therefore, how to quickly and efficiently determine the power consumption of a container during operation is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for determining container power consumption, which can quickly and efficiently determine the power consumption of a container during operation.
[0006] In a first aspect, this application provides a method for training a container power consumption determination model, the method comprising:
[0007] Based on the sample set, the container power consumption determination model to be trained is subjected to at least one round of iterative training, and the corresponding target container power consumption determination model is output; wherein, in each round of iteration, at least the following steps are performed:
[0008] Obtain the first sample load of each container in the sample set during operation; input the first sample load of different containers into different container sub-models in the container power consumption determination model to be trained; and determine the estimated power consumption of each container based on the output information of each container sub-model.
[0009] The estimated power consumption of the server is determined based on the estimated power consumption of each container.
[0010] Based on the server's estimated power consumption and the actual power consumption of the server during operation, which is pre-saved in the sample set, the parameters of each container sub-model included in the container power consumption determination model to be trained are adjusted.
[0011] In one possible implementation, before determining the estimated power consumption of the server based on the estimated power consumption of each container, the method further includes:
[0012] Obtain the second sample load of each virtual machine in the server in the sample set during operation; input the second sample load of different virtual machines into different virtual machine sub-models in the container power consumption determination model to be trained; determine the estimated intermediate power consumption of each virtual machine based on the output information of each virtual machine sub-model.
[0013] The process of determining the estimated power consumption of the server based on the estimated power consumption of each container includes:
[0014] For each virtual machine, the estimated power consumption of the virtual machine is determined based on the estimated intermediate power consumption of the virtual machine, the preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and the preset container estimated power consumption weight; based on the estimated power consumption of each virtual machine, the estimated power consumption of the server is determined.
[0015] The parameters of each container sub-model included in the container power consumption determination model to be trained are adjusted, including:
[0016] The parameters of each container sub-model and the virtual machine sub-model included in the container power consumption determination model to be trained are adjusted.
[0017] In one possible implementation, the step of inputting the first sample load of different containers into different container sub-models included in the container power consumption determination model to be trained includes:
[0018] For each container, the target load type of the container is determined based on the load type of each sub-load contained in the first sample load of the container; the target container sub-model type corresponding to the target load type is determined based on the pre-saved correspondence between container load types and container sub-model types, and the first sample load of the container is input into the container sub-model of the type of the target container sub-model.
[0019] In one possible implementation, determining the target load type for each container based on the load type of each sub-load contained in the first sample load of that container includes:
[0020] For each container, based on the load type of each sub-load contained in the first sample load of that container, obtain the number of sub-loads corresponding to each load type, and determine the load type with the most sub-loads as the target load type of that container.
[0021] In one possible implementation, determining the estimated power consumption of each container based on the output information of each container sub-model includes:
[0022] For each container, the estimated power consumption of the container is determined based on the output information of the container sub-model of the first sample load input of the container and the preset power consumption influence weight corresponding to the target load type of the container.
[0023] In one possible implementation, the process of storing the correspondence between the container load type and the container sub-model type includes:
[0024] If the container load type is CPU consumption type, save the correspondence between the CPU consumption type and the container sub-model type of the multi-layer fully connected network structure;
[0025] If the container load type is a memory consumption type, save the correspondence between the memory consumption type and the container sub-model type of the convolutional network structure;
[0026] If the container load type is a storage consumption type, save the correspondence between the storage consumption type and the container sub-model type of the residual network structure;
[0027] If the container load type is network consumption type, save the correspondence between the network consumption type and the container sub-model type of the deconvolution network structure.
[0028] Secondly, this application provides a method for determining the power consumption of a container, the method comprising:
[0029] For any given container, obtain the load on that container during operation;
[0030] The load is input into the container sub-model included in the target container power consumption determination model trained by any of the above methods, and the power consumption of the container during operation is obtained based on the output information of the container sub-model.
[0031] In one possible implementation, the method further includes:
[0032] If the power consumption of the container during operation is detected to exceed a preset power consumption threshold, a warning message will be output.
[0033] Thirdly, this application provides a container power consumption determination model training device, the device comprising:
[0034] The acquisition module is used to perform at least one round of iterative training on the container power consumption determination model to be trained based on a sample set, and output the corresponding target container power consumption determination model; wherein, in each round of iteration, at least the following steps are performed: acquiring the first sample load of each container contained in any server in the sample set during operation; inputting the first sample load of different containers into different container sub-models contained in the container power consumption determination model to be trained respectively, and determining the estimated power consumption of each container based on the output information of each container sub-model;
[0035] The determination module is used to determine the estimated power consumption of the server based on the estimated power consumption of each container.
[0036] The adjustment module is used to adjust the parameters of each container sub-model included in the container power consumption determination model to be trained, based on the estimated power consumption of the server and the actual sample power consumption of the server during operation that is pre-saved in the sample set.
[0037] In one possible implementation, the determining module is further configured to obtain the second sample load of each virtual machine contained in the server in the sample set during operation; input the second sample load of different virtual machines into different virtual machine sub-models contained in the container power consumption determination model to be trained; and determine the estimated intermediate power consumption of each virtual machine based on the output information of each virtual machine sub-model.
[0038] For each virtual machine, the estimated power consumption of the virtual machine is determined based on the estimated intermediate power consumption of the virtual machine, the preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and the preset container estimated power consumption weight; based on the estimated power consumption of each virtual machine, the estimated power consumption of the server is determined.
[0039] The adjustment module is specifically used to adjust the parameters of each container sub-model and the virtual machine sub-model included in the container power consumption determination model to be trained.
[0040] In one possible implementation, the acquisition module is specifically used to determine the target load type of each container based on the load type of each sub-load contained in the first sample load of the container; determine the target container sub-model type corresponding to the target load type based on the pre-saved correspondence between container load types and container sub-model types; and input the first sample load of the container into the container sub-model of the type of the target container sub-model.
[0041] In one possible implementation, the acquisition module is specifically used to obtain, for each container, the number of sub-loads corresponding to each load type based on the load type of each sub-load contained in the first sample load of the container, and determine the load type with the most sub-loads as the target load type of the container.
[0042] In one possible implementation, the acquisition module is specifically used to determine the estimated power consumption of each container based on the output information of the container sub-model of the first sample load input of the container and a preset power consumption influence weight corresponding to the target load type of the container.
[0043] In one possible implementation, the acquisition module is specifically used to save the correspondence between the CPU consumption type and the container sub-model type of the multi-layer fully connected network structure if the container load type is a CPU consumption type.
[0044] If the container load type is a memory consumption type, save the correspondence between the memory consumption type and the container sub-model type of the convolutional network structure;
[0045] If the container load type is a storage consumption type, save the correspondence between the storage consumption type and the container sub-model type of the residual network structure;
[0046] If the container load type is network consumption type, save the correspondence between the network consumption type and the container sub-model type of the deconvolution network structure.
[0047] Fourthly, this application provides a container power consumption determination device, the device comprising:
[0048] The runtime module is used to obtain the load of any container during its operation.
[0049] The input module is used to input the load into the container sub-model included in the target container power consumption determination model trained by any of the above methods, and obtain the power consumption of the container during operation based on the output information of the container sub-model.
[0050] In one possible implementation, the device further includes:
[0051] The early warning module is used to output a set early warning message if it detects that the power consumption of the container during operation exceeds a preset power consumption threshold.
[0052] Fifthly, this application provides an electronic device that includes at least a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the steps of any of the methods described above.
[0053] In a sixth aspect, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above.
[0054] In a seventh aspect, this application provides a computer program product comprising: computer program code, which, when run on a computer, causes the computer to perform the steps of any of the methods described above.
[0055] In this embodiment, during each iteration of training the container power consumption determination model, the first sample load of each container in the sample set is obtained during operation. The first sample load of different containers is input into different container sub-models in the container power consumption determination model to be trained. Based on the output information of each container sub-model, the estimated power consumption of each container is determined. Based on the estimated power consumption of each container, the estimated power consumption of the server is determined. Based on the estimated power consumption of the server and the actual sample power consumption of the server during operation that is pre-saved in the sample set, the parameters of each container sub-model in the container power consumption determination model to be trained are adjusted, thereby obtaining the trained target container power consumption determination model. Based on the trained target container power consumption determination model of this application, the real-time power consumption of the container during operation can be determined quickly and efficiently. Attached Figure Description
[0056] To more clearly illustrate the implementation methods in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0057] Figure 1 This illustration shows a schematic diagram of the training process of a first container power consumption determination model provided in some embodiments of this application;
[0058] Figure 2 This application provides a schematic diagram of a server structure according to some embodiments;
[0059] Figure 3 This illustration shows a schematic diagram of the training process of a second container power consumption determination model provided in some embodiments of this application;
[0060] Figure 4 This paper illustrates a schematic diagram of the training process of a third container power consumption determination model provided in some embodiments of this application.
[0061] Figure 5 This illustration shows a schematic diagram of a first type of container power consumption determination process provided in some embodiments of this application;
[0062] Figure 6 This paper illustrates a schematic diagram of a second container power consumption determination process provided in some embodiments of this application;
[0063] Figure 7 This paper illustrates a schematic diagram of a third container power consumption determination process provided in some embodiments of this application;
[0064] Figure 8 This paper illustrates a schematic diagram of a fourth container power consumption determination process provided in some embodiments of this application;
[0065] Figure 9 This paper illustrates a fifth container power consumption determination process provided in some embodiments of this application;
[0066] Figure 10 The diagram shows a schematic of a container power consumption determination model training device provided in some embodiments of this application;
[0067] Figure 11 The diagram shows a schematic of a container power consumption determination device provided in some embodiments of this application;
[0068] Figure 12 The diagram shows a schematic representation of an electronic device structure provided in some embodiments of this application. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of this application clearer, a further detailed description of this application will be provided below with reference to the accompanying drawings. Obviously, the embodiments described in this application are merely some embodiments, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0070] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0071] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0072] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0073] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0075] To quickly and efficiently determine the power consumption of a container during operation, this application provides a method, apparatus, device, and medium for determining container power consumption.
[0076] Example 1:
[0077] Figure 1 The diagram illustrates the training process of the first container power consumption determination model provided in some embodiments of this application, such as... Figure 1 As shown, the process includes the following steps:
[0078] S100: Based on the sample set, perform at least one round of iterative training on the container power consumption determination model to be trained, and output the corresponding target container power consumption determination model; wherein, in each round of iteration, at least steps S101 to S103 are executed.
[0079] The container power consumption determination model training method provided in this application embodiment is applied to electronic devices, such as mobile terminals, PCs, or servers.
[0080] See Figure 2 , Figure 2 The diagram illustrates a server architecture according to some embodiments of this application. A server (also known as a physical server) can run multiple virtual machines, such as virtual machine 1, ..., virtual machine s in the diagram, where s is a positive integer. A virtual machine can run multiple containers. For example, virtual machine 1 can run containers 1, ..., container n, etc., and virtual machine n can run containers 1', ..., container n', etc. Here, n and n' are both positive integers.
[0081] The sample set can contain information about several servers. For each server, the sample set can contain the load of each container within that server during operation (for ease of description, the load of the containers in the sample set during operation is referred to as the first sample load). The electronic device can perform at least one round of iterative training on the container power consumption determination model to be trained based on the first sample loads of the containers within each server in the sample set, thereby outputting the corresponding trained target container power consumption determination model (for ease of description, the trained container power consumption determination model is referred to as the target container power consumption determination model).
[0082] In each iteration of training, the electronic device can train the container power consumption determination model based on the first sample load of containers contained in at least one server, and adjust the model parameters of the container power consumption determination model. The electronic device can output the trained target container power consumption determination model after training the model based on the first sample load of containers on all servers in the sample set, or it can output the trained target container power consumption determination model when it is determined that the training loss of the container power consumption determination model meets the training objective, etc., without specific limitations.
[0083] The following section will first describe the process of iteratively training the container power consumption determination model based on the first sample load of containers contained in one of the servers. The process of iteratively training the model based on the first sample load of containers contained in other servers is similar and will not be repeated here. Specifically, the process of iteratively training the model based on the first sample load of containers contained in one server can be found in steps S101 to S103.
[0084] S101: Obtain the first sample load of each container in the sample set during operation; input the first sample load of different containers into different container sub-models contained in the container power consumption determination model to be trained, and determine the estimated power consumption of each container based on the output information of each container sub-model.
[0085] In one possible implementation, for any server in the sample set, the electronic device can obtain the load of each container contained in that server during operation (for ease of description, the load of the containers in the sample set during operation is referred to as the first sample load). The container power consumption determination model can contain several container sub-models. After obtaining the first sample load of each container during operation, the first sample load of different containers can be input into different container sub-models respectively. That is, each container can correspond to a container sub-model (neural network instance), and each container sub-model can input the first sample load of one container. Optionally, the number of container sub-models contained in the container power consumption determination model can be no less than (greater than or equal to) the number of containers contained in any server.
[0086] Optionally, the container sub-model can perform power consumption analysis on the first sample load input into itself, and finally output the estimated power consumption of the corresponding container. The electronic device can determine the estimated power consumption of each container based on the output information of each container sub-model.
[0087] S102: Determine the estimated power consumption of the server based on the estimated power consumption of each container.
[0088] In one possible implementation, the estimated power consumption of the server can be determined based on the estimated power consumption of each container contained within the server. For example, the sum of the estimated power consumption of each container contained within the server can be used to determine the estimated power consumption of the server.
[0089] S103: Based on the estimated power consumption of the server and the actual sample power consumption of the server during operation that is pre-saved in the sample set, adjust the parameters of each container sub-model included in the container power consumption determination model to be trained.
[0090] In one possible implementation, since the actual power consumption of a server is easier to measure and obtain than that of a virtual machine or container, the sample set can pre-store the actual power consumption of the server during operation (actual sample power consumption), and this actual power consumption can be used as a supervision signal to train the container power consumption determination model.
[0091] Specifically, after determining the server's estimated power consumption, since the server's actual sample power consumption is pre-saved, the accuracy of the container power consumption determination model's identification result can be determined by whether the estimated power consumption and the actual sample power consumption are consistent. In practice, if they are inconsistent, it indicates that the container power consumption determination model's identification result is inaccurate, and the parameters of each container sub-model included in the container power consumption determination model need to be adjusted to train the container power consumption determination model.
[0092] Optionally, when adjusting the parameters of each container sub-model in the container power consumption determination model, a gradient descent algorithm can be used to backpropagate the gradient of the parameters of each container sub-model to train the container power consumption determination model. This application does not make specific limitations on this.
[0093] In one possible implementation, after training the container power consumption determination model, the power consumption of the container during operation can be quickly and accurately obtained based on the obtained target container power consumption determination model. Optionally, for any container, the load of the container during operation can be obtained, and then the load can be input into a container sub-model included in the target container power consumption determination model. The container sub-model can perform power consumption analysis on the load and output the power consumption of the container during operation.
[0094] In this embodiment, during each iteration of training the container power consumption determination model, the first sample load of each container in the sample set is obtained during operation. The first sample load of different containers is input into different container sub-models in the container power consumption determination model to be trained. Based on the output information of each container sub-model, the estimated power consumption of each container is determined. Based on the estimated power consumption of each container, the estimated power consumption of the server is determined. Based on the estimated power consumption of the server and the actual sample power consumption of the server during operation that is pre-saved in the sample set, the parameters of each container sub-model in the container power consumption determination model to be trained are adjusted, thereby obtaining the trained target container power consumption determination model. Based on the trained target container power consumption determination model of this application, the real-time power consumption of the container during operation can be determined quickly and efficiently.
[0095] Example 2:
[0096] To improve the accuracy of the container power consumption determination model, based on the above embodiments, in this embodiment, before determining the estimated power consumption of the server based on the estimated power consumption of each container, the method further includes:
[0097] Obtain the second sample load of each virtual machine in the server in the sample set during operation; input the second sample load of different virtual machines into different virtual machine sub-models in the container power consumption determination model to be trained; determine the estimated intermediate power consumption of each virtual machine based on the output information of each virtual machine sub-model.
[0098] The process of determining the estimated power consumption of the server based on the estimated power consumption of each container includes:
[0099] For each virtual machine, the estimated power consumption of the virtual machine is determined based on the estimated intermediate power consumption of the virtual machine, the preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and the preset container estimated power consumption weight; based on the estimated power consumption of each virtual machine, the estimated power consumption of the server is determined.
[0100] The parameters of each container sub-model included in the container power consumption determination model to be trained are adjusted, including:
[0101] The parameters of each container sub-model and the virtual machine sub-model included in the container power consumption determination model to be trained are adjusted.
[0102] In one possible implementation, for each server, the sample set may also include the load of each virtual machine contained in that server during operation (for ease of description, the load of the virtual machines in the sample set during operation is referred to as the second sample load). The electronic device can perform at least one round of iterative training on the container power consumption determination model to be trained based on the second sample load of the virtual machines contained in each server in the sample set, and the first sample load of each container in the virtual machine, and then output the corresponding trained target container power consumption determination model.
[0103] In each iteration of training, for any server in the sample set, the electronic device can obtain the second sample load of each virtual machine (VM) within that server during its operation. The container power consumption determination model can contain several VM sub-models. After obtaining the second sample load of each VM during its operation, the second sample load of different VMs can be input into different VM sub-models. That is, each VM can correspond to a VM sub-model (neural network instance), and each VM sub-model can input the second sample load of one VM. Optionally, the number of VM sub-models in the container power consumption determination model can be no less than (greater than or equal to) the number of VMs in any given server.
[0104] Optionally, the virtual machine sub-model can perform power consumption analysis on the second sample load input into itself, and finally output the estimated intermediate power consumption of the corresponding virtual machine. Optionally, in order to more accurately adjust the parameters of the container sub-model and improve the accuracy of the prediction results (identification results) of the container sub-model, the estimated power consumption of the virtual machine can be determined based on the estimated intermediate power consumption output by the virtual machine sub-model and the estimated power consumption of each container contained in the corresponding virtual machine (wherein, the estimated power consumption of the container is the estimated power consumption output by the corresponding container sub-model).
[0105] For example, for each virtual machine, the estimated power consumption of the virtual machine can be determined based on the estimated intermediate power consumption of the virtual machine, a preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and a preset container estimated power consumption weight. Optionally, the estimated power consumption of the virtual machine can be: estimated power consumption of the virtual machine × intermediate power consumption weight + sum of the estimated power consumption of each container contained in the virtual machine × container estimated power consumption weight. The intermediate power consumption weight and container estimated power consumption weight can be flexibly set according to requirements, and this application does not impose specific limitations on them. For example, the sum of the intermediate power consumption weight and the container estimated power consumption weight can be 1. The following example illustrates how this application determines the estimated power consumption of a virtual machine, using an intermediate power consumption weight and a container estimated power consumption weight of 0.5. The estimated power consumption of virtual machine A can be: estimated intermediate power consumption of virtual machine A × 0.5 + sum of the estimated power consumption of each container contained in virtual machine A × 0.5.
[0106] After obtaining the estimated power consumption of each virtual machine, the estimated power consumption of the server can be determined based on the estimated power consumption of each virtual machine. For example, the sum of the estimated power consumption of each virtual machine can be used to determine the estimated power consumption of the server.
[0107] Optionally, the parameters of each container sub-model in the container power consumption determination model to be trained can be adjusted based on the server's estimated power consumption and the actual sample power consumption of the server during operation, which is pre-saved in the sample set. At the same time, the parameters of each virtual machine sub-model in the container power consumption determination model can also be adjusted, which will not be elaborated here.
[0108] In this embodiment, the container power consumption determination model includes both a container sub-model and a virtual machine sub-model. The model can be considered a two-layer neural network model. The first-layer container sub-model can be considered a container-virtual machine integrated model, which can obtain the estimated power consumption of the virtual machine based on the output information of the container sub-model (estimated power consumption of the container). The second-layer virtual machine sub-model can be considered a virtual machine-server integrated model, which can obtain the estimated power consumption of the server based on the estimated power consumption of the virtual machine sub-model. Based on the two-layer neural network structure of this application, the accuracy of determining the power consumption of the container during operation can be improved.
[0109] Optionally, considering that in addition to load, the virtual machine's fixed configuration (such as hardware configuration) can also cause power consumption, to accurately determine the virtual machine's power consumption and thus improve the accuracy of container power consumption determination, besides inputting the virtual machine's second sample load into the virtual machine sub-model, the virtual machine's fixed configuration data can also be input into the virtual machine sub-model. The virtual machine sub-model performs power consumption analysis on both the virtual machine's fixed configuration data and load, thereby outputting the virtual machine's estimated intermediate power consumption. The virtual machine's fixed configuration can be flexibly set according to requirements, and this application does not impose specific limitations on it.
[0110] To facilitate understanding, the training process of the container power consumption determination model of this application will be explained below through a specific embodiment. (See reference...) Figure 3 , Figure 3 The diagram illustrates a training process for a second container power consumption determination model provided in some embodiments of this application. This process includes the following steps:
[0111] S301: Obtain the first sample load of each container in the sample set during operation for any server; input the first sample load of different containers into different container sub-models in the container power consumption determination model to be trained, and determine the estimated power consumption of each container based on the output information of each container sub-model. Simultaneously, obtain the second sample load of each virtual machine in the sample set during operation for the server; input the second sample load of different virtual machines into different virtual machine sub-models in the container power consumption determination model to be trained; and determine the estimated intermediate power consumption of each virtual machine based on the output information of each virtual machine sub-model.
[0112] S302: For each virtual machine, determine the estimated power consumption of the virtual machine based on the estimated intermediate power consumption of the virtual machine, the preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and the preset container estimated power consumption weight.
[0113] S303: Determine the estimated power consumption of the server based on the estimated power consumption of each virtual machine.
[0114] S304: Based on the server's estimated power consumption and the actual sample power consumption of the server during operation pre-saved in the sample set, adjust the parameters of each container sub-model and the virtual machine sub-model included in the container power consumption determination model to be trained.
[0115] Example 3:
[0116] To improve the accuracy of the container power consumption determination module, based on the above embodiments, in this embodiment, the step of inputting the first sample load of different containers into different container sub-models included in the container power consumption determination model to be trained includes:
[0117] For each container, the target load type of the container is determined based on the load type of each sub-load contained in the first sample load of the container; the target container sub-model type corresponding to the target load type is determined based on the pre-saved correspondence between container load types and container sub-model types, and the first sample load of the container is input into the container sub-model of the type of the target container sub-model.
[0118] In one possible implementation, to avoid overfitting of the neural network (model), reduce computational complexity, and improve the accuracy of the container power consumption determination module, the sub-loads in the first sample load of the container can be classified to determine the target load type of the container. For different target load types, a suitable container sub-model can be determined for that container. Specifically, for each container, the target load type of the container can be determined based on the load type of each sub-load included in the first sample load of the container.
[0119] Optionally, when determining the target load type of a container based on the load type of each sub-load included in the first sample load of the container, the load type of each sub-load included in the first sample load of the container can be determined according to the load type identifier carried by each sub-load in the first sample load of the container, etc., and any one or more of these load types can be determined as the target load type of the container. Optionally, to improve the accuracy of determining the target load type of the container, after determining the load type of each sub-load included in the first sample load of the container, the number of sub-loads corresponding to each load type can be obtained separately, and any one or more load types whose number of sub-loads is not less than a set threshold can be determined as the target load type of the container.
[0120] Optionally, to improve the accuracy and speed of determining the target load type of a container, the load type with the most sub-loads can be determined as the target load type of the container. For example, suppose the first sample load of any container includes sub-loads of the following types: Central Processing Unit (CPU) consumption type (this type of load can be considered to have high CPU utilization), memory consumption type (this type of load can be considered to have high memory utilization), storage consumption type (this type of load can be considered to have high storage input / output (I / O) consumption), and network consumption type (this type of load can be considered to have high network traffic consumption). If the number of sub-loads corresponding to the CPU consumption type exceeds the number of sub-loads corresponding to the other three load types, then the target load type of the container can be determined as the CPU consumption type. If the number of sub-loads corresponding to the memory consumption type exceeds the number of sub-loads corresponding to the other three load types, then the target load type of the container can be determined as the memory consumption type. If the number of sub-loads corresponding to the storage consumption type exceeds the number of sub-loads corresponding to the other three load types, then the target load type of the container can be determined as the storage consumption type. And if the number of sub-loads corresponding to the network consumption type exceeds the number of sub-loads corresponding to the other three load types, then the target load type of the container can be determined as the network consumption type.
[0121] In one possible implementation, when storing the correspondence between container load type and container sub-model type, if the container load type is CPU consumption type, then the correspondence between CPU consumption type and container sub-model type of multi-layer fully connected network structure is stored; if the container load type is memory consumption type, then the correspondence between memory consumption type and container sub-model type of convolutional network structure is stored; if the container load type is storage consumption type, then the correspondence between storage consumption type and container sub-model type of residual network structure is stored; if the container load type is network consumption type, then the correspondence between network consumption type and container sub-model type of deconvolutional network structure is stored.
[0122] Optionally, after determining the target load type of the container, the target container sub-model type can be determined based on a pre-saved correspondence between container load types and container sub-model types. The first sample load of the container can then be input into the container sub-model of the target container sub-model type. For example, when the container load type is CPU consumption, the first sample load can be input into a container sub-model with a multi-layer fully connected network structure. When the container load type is memory consumption, the first sample load can be input into a container sub-model with a convolutional network structure. When the container load type is storage consumption, the first sample load can be input into a container sub-model with a residual network structure. When the container load type is network consumption, the first sample load can be input into a container sub-model with a deconvolutional network structure.
[0123] In one possible implementation, for any container, if the target load type of the container includes several (multiple) load types, the sub-loads of different load types of the container can be input into different types of container sub-models respectively, and the sum of the estimated sub-power consumption output by these several (multiple) different types of container sub-models can be determined as the estimated power consumption of the container. This will not be elaborated further here.
[0124] Since this application can determine the target load type of the container based on the load type of each sub-load contained in the first sample load of the container; and determine the target container sub-model type corresponding to the target load type based on the pre-saved correspondence between the container load type and the container sub-model type, and input the first sample load of the container into the container sub-model of the type of the target container sub-model, it can further avoid model overfitting, reduce computational complexity, and improve the accuracy of determining the power consumption of the container.
[0125] Considering that the impact of container load on container power consumption varies depending on the type of container load, in order to improve the accuracy of the container power consumption determination model and the accuracy of the determined container power consumption, based on the above embodiments, in this embodiment, the step of determining the estimated power consumption of each container based on the output information of each container sub-model includes:
[0126] For each container, the estimated power consumption of the container is determined based on the output information of the container sub-model of the first sample load input of the container and the preset power consumption influence weight corresponding to the target load type of the container.
[0127] In one possible implementation, different power consumption impact weights can be pre-configured for different container load types. These power consumption impact weights can be flexibly set according to requirements, and this application does not impose specific limitations on them. When determining the estimated power consumption of each container based on the output information of each container sub-model, the estimated power consumption of each container can be determined based on the output information of the container sub-model of the first sample load input of that container and the pre-set power consumption impact weights corresponding to the target load type of that container.
[0128] For ease of description, the process of determining the estimated power consumption of a container in this application is explained below using formulas. For example, assume that the power consumption influence weight corresponding to the target load type of a certain container is W. k This means that the output information (output power consumption) of the container sub-model inputting the first sample load of the container is represented by the F(X, θ) neural network function, where θ represents the parameters of the container sub-model, and X represents the first sample load input into the container sub-model. Therefore, for any container, the estimated power consumption of the container can be the product of the corresponding power consumption influence weight and the corresponding container sub-model output information (output power consumption), which is: W k ×F(X, θ).
[0129] Where k represents any load type of the container, n represents the total number of load types of the container, i represents any virtual machine in the server, s represents the total number of virtual machines in the server, j represents any container in a virtual machine, m represents the total number of containers contained in a virtual machine, and W k X represents the power consumption impact weight of the target load type for any container in a virtual machine. jk Let E represent the first sample load of any container in a virtual machine, and E represent the actual sample power consumption of the server. Optionally, E can also be the difference between the actual sample power consumption and the inherent power consumption of the server. That is, the actual sample power consumption of the server can be used as a supervision signal to train the container power consumption determination model, or the difference between the actual sample power consumption and the inherent power consumption of the server (which can be considered as the power consumption generated during server operation) can be used as a supervision signal to train the container power consumption determination model. The loss function generated during training is expressed by the formula: In other words, the target loss function can reflect the difference between the sum of the estimated power consumption of all containers on the server (physical server) and the actual total power consumption (the actual power consumption of the server). The model parameters (neural network weights) can be adjusted based on this difference until the difference meets the preset difference threshold, thereby obtaining the final model parameters and the trained target container power consumption determination model.
[0130] To facilitate understanding, the training process of the container power consumption determination model of this application will be explained below through a specific embodiment. (See reference...) Figure 4 , Figure 4 This paper illustrates a schematic diagram of the training process for a third container power consumption determination model provided in some embodiments of this application. The process includes the following steps:
[0131] S401: Obtain the first sample load of each container in the sample set during operation for any server; for each container, determine the target load type of the container based on the load type of each sub-load contained in the first sample load of the container; based on the pre-saved correspondence between container load types and container sub-model types, determine the target container sub-model type corresponding to the target load type, input the first sample load of the container into the container sub-model of the target container sub-model type, and determine the estimated power consumption of each container based on the output information of each container sub-model. Simultaneously, the second sample load of each virtual machine in the sample set during operation for the server can be obtained; the second sample load of different virtual machines is input into the different virtual machine sub-models contained in the container power consumption determination model to be trained; and the estimated intermediate power consumption of each virtual machine is determined based on the output information of each virtual machine sub-model.
[0132] S402: For each virtual machine, determine the estimated power consumption of the virtual machine based on the estimated intermediate power consumption of the virtual machine, the preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and the preset container estimated power consumption weight.
[0133] S403: Determine the estimated power consumption of the server based on the estimated power consumption of each virtual machine.
[0134] S404: Based on the server's estimated power consumption and the actual sample power consumption of the server during operation pre-saved in the sample set, adjust the parameters of each container sub-model and the virtual machine sub-model included in the container power consumption determination model to be trained.
[0135] Example 4:
[0136] Based on the same technical concept, and building upon the above embodiments, this application also provides a method for determining container power consumption, see below. Figure 5 , Figure 5 This illustration shows a schematic diagram of a first type of container power consumption determination process provided by some embodiments of this application, the process including the following steps:
[0137] S501: For any container, obtain the load of the container during operation.
[0138] S502: Input the load into the container sub-model included in the target container power consumption determination model trained based on the above embodiments, and obtain the power consumption of the container during operation based on the output information of the container sub-model.
[0139] In one possible implementation, for any container, after obtaining the load of the container during operation, the load of the container can be randomly input into any container sub-model included in the target container power consumption determination model, and the power consumption of the container during operation can be obtained based on the output information of the container sub-model.
[0140] Optionally, to improve the accuracy of the determined container power consumption, for any container, after obtaining the load of the container during operation, the target load type of the container can be determined based on the load type of each sub-load contained in the container's load; based on the pre-saved correspondence between container load types and container sub-model types, the target container sub-model type corresponding to the target load type of the container can be determined; then, the load of the container during operation is input into the container sub-model of the type of the target container sub-model; and the power consumption of the container during operation is obtained based on the output information of the container sub-model. The process of determining the target load type of the container based on the load type of each sub-load contained in the container's load is similar to the process of determining the target load type of the container based on the load type of each sub-load contained in the first sample load of the container in the above embodiment, and will not be repeated here.
[0141] To facilitate understanding, the training process of the container power consumption determination model of this application will be explained below through a specific embodiment. (See reference...) Figure 6 , Figure 6 This illustration shows a second container power consumption determination process provided by some embodiments of this application, which includes the following steps:
[0142] S601: For any container, obtain the load of that container during operation.
[0143] S602: Based on the load type of each sub-load contained in the load of the container, determine the target load type of the container; based on the pre-saved correspondence between container load type and container sub-model type, determine the target container sub-model type corresponding to the target load type, and input the load of the container into the container sub-model of the target container sub-model type contained in the target container power consumption determination model.
[0144] S603: Based on the output information of the container sub-model, obtain the power consumption of the container during operation.
[0145] Optionally, similar to the model training process, when determining the power consumption of a virtual machine during operation based on the target container power consumption determination model, the power consumption of the virtual machine during operation can be determined based on the sum of the power consumption of each container contained within the virtual machine. Alternatively, the load of the virtual machine during operation can be input into the virtual machine sub-model contained in the target container power consumption determination model. Based on the estimated intermediate power consumption of the virtual machine output by the virtual machine sub-model, the preset intermediate power consumption weights, the sum of the power consumption of each container contained within the virtual machine, and the preset estimated power consumption weights of the containers, the power consumption of the virtual machine during operation can be determined. This will not be elaborated further here.
[0146] Example 5:
[0147] To better manage containers, based on the above embodiments, the method in this application embodiment further includes:
[0148] If the power consumption of the container during operation is detected to exceed a preset power consumption threshold, a warning message will be output.
[0149] In one possible implementation, after obtaining the power consumption of the container during operation based on the output information of the container sub-model, the obtained power consumption can be compared with a preset power consumption threshold. If the power consumption of the container during operation exceeds the preset power consumption threshold, it can be considered that the power consumption of the container is abnormal, and a set warning message can be output. This application does not specifically limit the method of outputting the warning message; it can be flexibly set according to requirements. For example, the warning message indicating that the power consumption of the container during operation exceeds the preset power consumption threshold can be fed back to the unified management module in the electronic device via a feedback output module.
[0150] To facilitate understanding, the container power consumption determination process provided in this application will be explained below through a specific embodiment. (See reference...) Figure 7 , Figure 7 This illustration shows a third type of container power consumption determination process provided in some embodiments of this application. The process includes the following steps:
[0151] S701: For any given container, obtain the load on that container during its operation.
[0152] S702: The load input of the container during operation is used to determine the power consumption of the target container during operation. Based on the output information of the container sub-model, the power consumption of the container during operation is obtained from the container sub-model included in the target container power consumption determination model trained by the above embodiments.
[0153] S703: Determine whether the power consumption of the container during operation exceeds the preset power consumption threshold. If so, proceed to S704.
[0154] S704: Outputs the set warning information.
[0155] To facilitate understanding, the container power consumption determination process provided in this application will be explained below through a specific embodiment. (See reference...) Figure 8 , Figure 8 This illustration shows a fourth container power consumption determination process provided in some embodiments of this application. Optionally, the electronic device may include a data acquisition module, a power consumption prediction module, and a feedback output module.
[0156] The data acquisition module can collect the real-time dynamic load of containers and virtual machines during operation. In addition, the data acquisition module can also collect the real-time dynamic load and actual power consumption of the server during operation.
[0157] Optionally, the power consumption prediction module can train a container power consumption determination model and predict the power consumption of the container during operation based on the trained target container power consumption determination model. The power consumption prediction module may include a load classification submodule, a model training submodule, and a power consumption prediction submodule.
[0158] When model training or container power consumption prediction is required, the power consumption prediction module can send a parameter acquisition request to the data acquisition module. Responding to this request, the data acquisition module can begin recording parameters such as the load of containers and virtual machines during operation, and the actual power consumption of the server. The data acquisition module can then send these collected parameters to the power consumption prediction module. The load classification submodule within the power consumption prediction module can first classify the load of containers during operation to obtain the target load type of the containers. The training process of the model training submodule for the container power consumption determination model is similar to the above embodiment and will not be repeated here. Taking the prediction of container power consumption during operation based on the trained target container power consumption determination module as an example, the power consumption prediction submodule can input the container load into the container sub-model corresponding to the target load type, thereby predicting (evaluating) the power consumption of the container during operation. When it is detected that the power consumption of the predicted container exceeds the set power consumption threshold during operation, the feedback output module in the electronic device can feed back the warning information that the power consumption of the container exceeds the preset power consumption threshold to the unified management module. The unified management module can then perform subsequent processing such as resource scheduling adjustment on the container. For example, the unified management module can send the subsequent processing such as resource scheduling adjustment of the container to the feedback output module. The feedback output module can then schedule and adjust the container according to the subsequent processing such as resource scheduling adjustment. This application does not make any specific limitations in this regard.
[0159] Optionally, the unified management module can be integrated with the feedback output module in the same electronic device or in different electronic devices; this application does not specifically limit this. Similarly, the data acquisition module, power consumption prediction module, and feedback output module can be integrated in the same electronic device or in different electronic devices; this application also does not specifically limit this. Optionally, the container in this application's embodiments can be a container created on a public cloud, etc. The virtual machine is a virtual machine that hosts the container. The server can be a physical machine in a data center; this application does not specifically limit this.
[0160] To facilitate understanding, the container power consumption determination process provided in this application will be explained below through a specific embodiment. (See reference...) Figure 9 , Figure 9 This illustration shows a fifth container power consumption determination process provided in some embodiments of this application, which includes the following steps:
[0161] S900: Based on the sample set, perform at least one round of iterative training on the container power consumption determination model to be trained, and output the corresponding target container power consumption determination model; wherein, in each round of iteration, at least the following steps S901-S904 are executed.
[0162] S901: Obtain the first sample load of each container in the sample set during operation for any server; for each container, determine the target load type of the container based on the load type of each sub-load contained in the first sample load of the container; based on the pre-saved correspondence between container load types and container sub-model types, determine the target container sub-model type corresponding to the target load type, and input the first sample load of the container into the container sub-model of the target container sub-model type. For each container, determine the estimated power consumption of the container based on the output information of the container sub-model input with the first sample load of the container and the preset power consumption influence weight corresponding to the target load type of the container. At the same time, obtain the second sample load of each virtual machine in the sample set during operation for the server; input the second sample load of different virtual machines into the different virtual machine sub-models contained in the container power consumption determination model to be trained; determine the estimated intermediate power consumption of each virtual machine based on the output information of each virtual machine sub-model.
[0163] S902: For each virtual machine, determine the estimated power consumption of the virtual machine based on the estimated intermediate power consumption of the virtual machine, the preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and the preset container estimated power consumption weight.
[0164] S903: Determine the estimated power consumption of the server based on the estimated power consumption of each virtual machine.
[0165] S904: Based on the server's estimated power consumption and the actual power consumption of the server during operation pre-saved in the sample set, adjust the parameters of each container sub-model and the virtual machine sub-model included in the container power consumption determination model to be trained.
[0166] S905: For any given container, obtain the load on that container during its operation.
[0167] S906: Based on the load type of each sub-load contained in the load of the container, determine the target load type of the container; based on the pre-saved correspondence between container load type and container sub-model type, determine the target container sub-model type corresponding to the target load type, and input the load of the container into the container sub-model of the target container sub-model type contained in the target container power consumption determination model.
[0168] S907: Based on the output information of the container sub-model and the preset power consumption impact weight corresponding to the target load type of the container, obtain the power consumption of the container during operation.
[0169] Steps S900-S904 can be considered as the training process of the container power consumption determination model. Steps S905-S907 can be considered as the process of evaluating the power consumption of the container during operation based on the trained target container power consumption determination model.
[0170] Example 6:
[0171] Based on the same technical concept, this application provides a training device for a container power consumption determination model, see reference. Figure 10 , Figure 10 The diagram shows a schematic of a container power consumption determination model training device according to some embodiments of this application. The device includes:
[0172] The acquisition module 101 is used to perform at least one round of iterative training on the container power consumption determination model to be trained based on the sample set, and output the corresponding target container power consumption determination model; wherein, in each round of iteration, at least the following steps are performed: acquiring the first sample load of each container contained in any server in the sample set during operation; inputting the first sample load of different containers into different container sub-models contained in the container power consumption determination model to be trained respectively; and determining the estimated power consumption of each container based on the output information of each container sub-model.
[0173] The determination module 102 is used to determine the estimated power consumption of the server based on the estimated power consumption of each container.
[0174] The adjustment module 103 is used to adjust the parameters of each container sub-model included in the container power consumption determination model to be trained, based on the estimated power consumption of the server and the actual sample power consumption of the server during operation that is pre-saved in the sample set.
[0175] In one possible implementation, the determining module 102 is further configured to obtain the second sample load of each virtual machine contained in the server in the sample set during operation; input the second sample load of different virtual machines into different virtual machine sub-models contained in the container power consumption determination model to be trained; and determine the estimated intermediate power consumption of each virtual machine based on the output information of each virtual machine sub-model.
[0176] For each virtual machine, the estimated power consumption of the virtual machine is determined based on the estimated intermediate power consumption of the virtual machine, the preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and the preset container estimated power consumption weight; based on the estimated power consumption of each virtual machine, the estimated power consumption of the server is determined.
[0177] The adjustment module 103 is specifically used to adjust the parameters of each container sub-model and the virtual machine sub-model included in the container power consumption determination model to be trained.
[0178] In one possible implementation, the acquisition module 101 is specifically used to determine the target load type of each container based on the load type of each sub-load contained in the first sample load of the container; determine the target container sub-model type corresponding to the target load type based on the pre-saved correspondence between container load types and container sub-model types; and input the first sample load of the container into the container sub-model of the type of the target container sub-model.
[0179] In one possible implementation, the acquisition module 101 is specifically used to obtain the number of sub-loads corresponding to each load type for each container based on the load type of each sub-load contained in the first sample load of the container, and determine the load type with the most sub-loads as the target load type of the container.
[0180] In one possible implementation, the acquisition module 101 is specifically used to determine the estimated power consumption of each container based on the output information of the container sub-model of the first sample load input of the container and the preset power consumption influence weight corresponding to the target load type of the container.
[0181] In one possible implementation, the acquisition module 101 is specifically used to save the correspondence between the CPU consumption type and the container sub-model type of the multi-layer fully connected network structure if the container load type is a CPU consumption type.
[0182] If the container load type is a memory consumption type, save the correspondence between the memory consumption type and the container sub-model type of the convolutional network structure;
[0183] If the container load type is a storage consumption type, save the correspondence between the storage consumption type and the container sub-model type of the residual network structure;
[0184] If the container load type is network consumption type, save the correspondence between the network consumption type and the container sub-model type of the deconvolution network structure.
[0185] Example 7:
[0186] Based on the same technical concept, this application provides a container power consumption determination device, see reference. Figure 11 , Figure 11 The diagram shows a schematic of a container power consumption determination device according to some embodiments of this application. The device includes:
[0187] The operation module 111 is used to obtain the load of any container during operation.
[0188] The input module 112 is used to input the load into the container sub-model included in the target container power consumption determination model trained by any of the above methods, and obtain the power consumption of the container during operation based on the output information of the container sub-model.
[0189] In one possible implementation, the device further includes:
[0190] The early warning module is used to output a set early warning message if it detects that the power consumption of the container during operation exceeds a preset power consumption threshold.
[0191] Example 8:
[0192] Based on the same technical concept, this application also provides an electronic device. Figure 12 The present application provides schematic diagrams of the structure of an electronic device according to some embodiments, such as... Figure 12 As shown, the electronic device includes: a processor 121, a communication interface 122, a memory 123, and a communication bus 124, wherein the processor 121, the communication interface 122, and the memory 123 communicate with each other through the communication bus 124.
[0193] The memory 123 stores a computer program, which, when executed by the processor 121, causes the processor 121 to perform the steps of any of the above methods.
[0194] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0195] Communication interface 122 is used for communication between the above-mentioned electronic device and other devices.
[0196] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0197] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0198] Example 8:
[0199] Based on the same technical concept, embodiments of this application provide a computer-readable storage medium storing a computer program executable by an electronic device. When the program is run on the electronic device, it causes the electronic device to perform the steps of any of the above methods.
[0200] The aforementioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in an electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), optical storage such as CDs, DVDs, BDs, HVDs, etc., and semiconductor storage such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs), etc.
[0201] Based on the same technical concept, this application provides a computer program product, which includes: computer program code, which, when run on a computer, causes the computer to implement the method described in any of the above-described method embodiments applied to electronic devices.
[0202] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof, or in whole or in part, as a computer program product. The computer program product includes one or more computer instructions, which, when loaded and executed on a computer, generate, in whole or in part, the processes or functions described in the embodiments of this application.
[0203] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0204] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0205] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0206] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0207] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for training a container power consumption determination model, characterized in that, The method includes: Based on the sample set, the container power consumption determination model to be trained is subjected to at least one round of iterative training, and the corresponding target container power consumption determination model is output; wherein, in each round of iteration, at least the following steps are performed: Obtain the first sample load of each container in the sample set during operation; input the first sample load of different containers into different container sub-models contained in the container power consumption determination model to be trained; and determine the estimated power consumption of each container based on the output information of each container sub-model; wherein each container corresponds to one container sub-model; and the number of container sub-models contained in the container power consumption determination model is not less than the number of containers contained in the server. The sum of the estimated power consumption of each container contained in the server is determined as the estimated power consumption of the server. Based on the server's estimated power consumption and the actual sample power consumption of the server during operation, which is pre-saved in the sample set, the parameters of each container sub-model included in the container power consumption determination model to be trained are adjusted; wherein, the difficulty of obtaining the actual sample power consumption of the server during operation is lower than the difficulty of obtaining the actual power consumption of the containers included in the server.
2. The method according to claim 1, characterized in that, Before determining the estimated power consumption of the server based on the estimated power consumption of each container, the method further includes: Obtain the second sample load of each virtual machine in the server in the sample set during operation; input the second sample load of different virtual machines into different virtual machine sub-models in the container power consumption determination model to be trained; determine the estimated intermediate power consumption of each virtual machine based on the output information of each virtual machine sub-model. The process of determining the estimated power consumption of the server based on the estimated power consumption of each container includes: For each virtual machine, the estimated power consumption of the virtual machine is determined based on the estimated intermediate power consumption of the virtual machine, the preset intermediate power consumption weight, the sum of the estimated power consumption of each container contained in the virtual machine, and the preset container estimated power consumption weight; based on the estimated power consumption of each virtual machine, the estimated power consumption of the server is determined. The parameters of each container sub-model included in the container power consumption determination model to be trained are adjusted, including: The parameters of each container sub-model and the virtual machine sub-model included in the container power consumption determination model to be trained are adjusted.
3. The method according to claim 1, characterized in that, The step of inputting the first sample load of different containers into different container sub-models included in the container power consumption determination model to be trained includes: For each container, the target load type of the container is determined based on the load type of each sub-load contained in the first sample load of the container; the target container sub-model type corresponding to the target load type is determined based on the pre-saved correspondence between container load types and container sub-model types, and the first sample load of the container is input into the container sub-model of the type of the target container sub-model.
4. The method according to claim 3, characterized in that, For each container, determining the target load type of the container based on the load type of each sub-load contained in the first sample load of the container includes: For each container, based on the load type of each sub-load contained in the first sample load of that container, obtain the number of sub-loads corresponding to each load type, and determine the load type with the most sub-loads as the target load type of that container.
5. The method according to claim 3, characterized in that, The step of determining the estimated power consumption of each container based on the output information of each container sub-model includes: For each container, the estimated power consumption of the container is determined based on the output information of the container sub-model based on the first sample load input of the container and the preset power consumption influence weight corresponding to the target load type of the container.
6. The method according to claim 3, characterized in that, The process of saving the correspondence between the container load type and the container sub-model type includes: If the container load type is CPU consumption type, save the correspondence between the CPU consumption type and the container sub-model type of the multi-layer fully connected network structure; If the container load type is a memory consumption type, save the correspondence between the memory consumption type and the container sub-model type of the convolutional network structure; If the container load type is a storage consumption type, save the correspondence between the storage consumption type and the container sub-model type of the residual network structure; If the container load type is network consumption type, save the correspondence between the network consumption type and the container sub-model type of the deconvolution network structure.
7. A method for determining the power consumption of a container, characterized in that, The method includes: For any given container, obtain the load on that container during operation; The load is input into the container sub-model included in the target container power consumption determination model trained based on any one of the methods described in claims 1-6, and the power consumption of the container during operation is obtained based on the output information of the container sub-model.
8. The method according to claim 7, characterized in that, The method further includes: If the power consumption of the container during operation is detected to exceed a preset power consumption threshold, a warning message will be output.
9. An electronic device, characterized in that, The electronic device includes at least a processor and a memory, the processor being configured to implement the steps of the method as described in any one of claims 1-8 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Virtual machine power consumption prediction model training method, power consumption prediction method and device
CN115202829A
Energy consumption determination method, device and equipment and computer readable storage medium
CN115757002A