Container resource control method and device, electronic equipment and storage medium

By building a heterogeneous undirected graph and load prediction model, container resource allocation is dynamically adjusted to solve the problem of unbalanced resource scheduling in a multi-core fusion environment and improve the stability and efficiency of the system.

CN120670147APending Publication Date: 2025-09-19CHINA SOUTHERN POWER GRID COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510698828.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies lack elastic scaling capabilities in multi-core fusion environments, resulting in some containers being unavailable for a long time or unbalanced resource scheduling, affecting system stability and efficiency.

Method used

By obtaining container feature information and inter-association relationships, a heterogeneous undirected graph is constructed, and the load prediction model is used to output the load prediction score, determine the target resource control strategy, and dynamically adjust the container resource allocation.

Benefits of technology

It achieves adaptive control of container resources, improves application service performance, saves resources, and improves container stability and work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670147A_ABST
    Figure CN120670147A_ABST
Patent Text Reader

Abstract

The invention discloses a container resource control method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining container feature information and an association relationship between containers; constructing a corresponding heterogeneous undirected graph according to the container feature information and the association relationship between the containers; inputting the heterogeneous undirected graph into a load prediction model, and outputting a load prediction score corresponding to each isolation execution container; and determining a target resource control strategy corresponding to each isolation execution container according to the load prediction score corresponding to each isolation execution container, and performing container resource control on the isolation execution container according to the target resource control strategy. According to the invention, load prediction of the container can be realized, based on the load prediction of the container, self-adaptive control of the container resources, dynamic allocation of the container resources, improvement of application service performance, saving of the application service resources and improvement of stability and working efficiency of the container can be realized, and the method can be widely applied to the technical field of container control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of container control technology, and in particular to a container resource control method, device, electronic device, and storage medium. Background Art

[0002] A card-based application is a lightweight application form with a visual service component at its core. It splits the entire application system into multiple independent functional modules. A multi-core integrated card-based application integrates and coordinates multiple heterogeneous or homogeneous cores on the same application platform or operating environment. Each core is responsible for the operation tasks and processing logic of a certain type of card.

[0003] In a multi-core converged environment, resource control is typically achieved through static resource allocation (allocating fixed CPU and memory resources to each module), priority-based scheduling (where high-priority modules receive priority scheduling opportunities during resource competition, and can even preempt resources currently being used by lower-priority modules), or container isolation (where different modules are isolated in independent runtime environments, each with its own resource view and management permissions). However, these solutions lack elastic scaling capabilities, meaning the system struggles to adaptively adjust resources, resulting in some containers being unavailable for extended periods or imbalanced resource scheduling. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a container resource control method, device, electronic device and storage medium, which can realize adaptive control of container resources and reasonably schedule application service resources.

[0005] In one aspect, an embodiment of the present application provides a container resource control method, the method comprising the following steps:

[0006] Obtaining container feature information and the association relationship between containers; the container feature information includes the container feature time series corresponding to each isolated execution container;

[0007] Constructing a corresponding heterogeneous undirected graph based on the container feature information and the association relationship between the containers;

[0008] Inputting the heterogeneous undirected graph into a load prediction model, and outputting a load prediction score corresponding to each of the isolated execution containers;

[0009] According to the load prediction score corresponding to each of the isolated execution containers, a target resource control policy corresponding to each of the isolated execution containers is determined, and container resource control is performed on the isolated execution container according to the target resource control policy.

[0010] In some embodiments, obtaining the container feature information and the association relationship between containers specifically includes:

[0011] Obtain container characteristic parameters corresponding to each of the isolated execution containers; the container characteristic parameters include CPU utilization, memory occupancy, average response time, request throughput, and number of container restarts;

[0012] Preprocessing the container characteristic parameters corresponding to each of the isolated execution containers to determine the container characteristic time series corresponding to each of the isolated execution containers, wherein the preprocessing includes filling missing values ​​and normalizing the characteristic parameters of each of the isolated execution containers at each time point;

[0013] The inter-container association relationship is obtained, wherein the inter-container association relationship includes a physical coupling relationship, a functional dependency relationship, a strong communication association relationship, and a load similarity relationship between containers.

[0014] In some embodiments, constructing a corresponding heterogeneous undirected graph based on the container feature information and the association relationship between the containers specifically includes:

[0015] Using each of the isolated execution containers as a container node;

[0016] Determine a corresponding undirected edge set based on the inter-container association relationship, wherein the undirected edge set includes all undirected edges between the container nodes, and the undirected edge indicates that at least one inter-container association relationship exists between two container nodes;

[0017] Determining node attributes of each of the container nodes according to the container feature information, wherein the node attributes include the container feature time series of the container node;

[0018] The heterogeneous undirected graph is generated according to each of the container nodes, the undirected edge set, and the node attributes of each of the container nodes.

[0019] In some embodiments, the load prediction model includes a first update layer, a second update layer, and a classification layer. Inputting the heterogeneous undirected graph into the load prediction model and outputting a load prediction score corresponding to each of the isolated execution containers specifically includes:

[0020] Inputting the heterogeneous undirected graph into the first update layer, using the first update layer to perform a time series analysis on each container node in the heterogeneous undirected graph according to the heterogeneous undirected graph, and outputting a first update vector;

[0021] Inputting the first update vector into the second update layer, performing aggregation analysis on the first update vector using the second update layer, and outputting a second update vector;

[0022] The second update vector is input to the classification layer, and the classification layer is used to perform load prediction for each container node in a preset time period, and a load prediction score corresponding to each container node in the preset time period is output.

[0023] In some embodiments, determining the target resource control policy corresponding to each isolated execution container according to the load prediction score corresponding to each isolated execution container specifically includes:

[0024] Obtaining a plurality of preset load prediction score intervals and resource control strategies corresponding to each of the load prediction score intervals;

[0025] Determining, according to the load prediction scores corresponding to the isolated execution containers, the target score interval matching each of the isolated execution containers from a plurality of load prediction score intervals;

[0026] For each of the isolated execution containers, the resource control policy corresponding to the target scoring interval is used as the target resource control policy corresponding to the isolated execution container.

[0027] In some embodiments, the heterogeneous undirected graph is specifically represented by the following formula:

[0028]

[0029] in, represents a heterogeneous undirected graph, Represents a node set, including each of the container nodes, represents a set of undirected edges, A node attribute set representing a container node, including the node attributes of each container node.

[0030] In some embodiments, the strong communication correlation relationship indicates that the historical call frequency of the two isolated execution containers within a preset time range is greater than or equal to a preset call threshold, and the load similarity relationship indicates that the load similarity of the two isolated execution containers is greater than or equal to a preset similarity threshold.

[0031] On the other hand, an embodiment of the present application provides a container resource control device, the device comprising:

[0032] A data acquisition module is used to acquire container feature information and the association relationship between containers; the container feature information includes the container feature time series corresponding to each isolated execution container;

[0033] A graph construction module, configured to construct a corresponding heterogeneous undirected graph based on the container feature information and the association relationship between the containers;

[0034] A load prediction module, configured to input the heterogeneous undirected graph into a load prediction model and output a load prediction score corresponding to each of the isolated execution containers;

[0035] The container control module is used to determine the target resource control policy corresponding to each isolated execution container according to the load prediction score corresponding to each isolated execution container, and perform container resource control on the isolated execution container according to the target resource control policy.

[0036] On the other hand, an embodiment of the present application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the container resource control method described above when executing the computer program.

[0037] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the container resource control method described above is implemented.

[0038] The embodiments of the present application include at least the following beneficial effects: the present application provides a container resource control method, device, electronic device and storage medium, which obtains container feature information and the relationship between containers, constructs a corresponding heterogeneous undirected graph based on the container feature information and the relationship between containers, inputs the heterogeneous undirected graph into a load prediction model, outputs the load prediction score corresponding to each isolated execution container, determines the target resource control policy corresponding to each isolated execution container based on the load prediction score corresponding to each isolated execution container, and performs container resource control on the isolated execution container based on the target resource control policy. The present application can realize load prediction of containers, realize adaptive control of container resources based on the load prediction of containers, dynamically allocate container resources, improve application service performance, save application service resources, and improve the stability and work efficiency of containers. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0041] Figure 1 This is a flow chart of a container resource control method provided by an embodiment of the present application;

[0042] Figure 2 This is a schematic diagram of the structure of a container resource control device provided in an embodiment of the present application;

[0043] Figure 3 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.

[0045] It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0046] The terms "at least one", "plurality", "each", "any", etc. used in this application include "at least one", "two" or more, "plurality" or "each", "any" or "any one", "each" or "any one" as used herein.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0048] It should be noted that the static resource allocation mentioned in the background technology may result in resource waste. Static allocation cannot quickly respond to the temporary resource needs of high-priority tasks, which may affect the experience. The priority-based scheduling strategy may result in low-priority tasks not getting execution opportunities for a long time, resulting in severe response delays or even functional failure. If high-priority tasks depend on the resources held by low-priority tasks, they may fall into deadlock or delayed execution. The container isolation mechanism (such as Docker, Kubernetes, etc.) mainly implements "process-level" resource isolation through namespaces and control groups (cgroups). The number of replicas or resource limits can be automatically adjusted according to CPU or memory usage. Although it can achieve adaptive adjustment of resources to a certain extent, it lacks "early perception" capability, that is, it cannot predict service load pressure in advance, and it is difficult to adjust resources in time. In addition, when multiple containers are deployed on the same server at the same time, the container will not perceive the service load pressure of another container on its own. Each container is still a resource island and lacks a unified scheduling mechanism. Therefore, the embodiments of the present application propose a container resource control method, device, electronic device and storage medium to solve the above technical problems.

[0049] Reference Figure 1 , Figure 1 This is an optional flowchart of a container resource control method provided in an embodiment of the present application. The method may include but is not limited to steps S101 to S104:

[0050] Step S101: Obtain container feature information and the association relationship between containers; the container feature information includes the container feature time series corresponding to each isolated execution container;

[0051] Step S102: construct a corresponding heterogeneous undirected graph based on the container feature information and the association relationship between containers;

[0052] Step S103: Input the heterogeneous undirected graph into the load prediction model, and output the load prediction score corresponding to each isolated execution container;

[0053] Step S104: Determine the target resource control policy corresponding to each isolated execution container based on the load prediction score corresponding to each isolated execution container, and perform container resource control on the isolated execution container based on the target resource control policy.

[0054] In some embodiments, the isolated execution container is an isolated execution unit based on lightweight virtualization (such as card-style applications, etc.), which provides independent resource views (CPU, memory, I / O, etc.) and management permissions for modules or services, implements resource quota restrictions through kernel-level isolation mechanisms (such as namespaces, Cgroups), and supports the intervention of dynamic priority scheduling policies.

[0055] In some embodiments, the time step and the collection time period are set in advance, and the container feature information is dynamically collected according to the time step. For example, the time step is 5 minutes, and the collection time period is 1 hour before the current time. Then, within the 1 hour before the current time, the container feature parameters of the isolated execution container are collected every 5 minutes to construct a container feature time series corresponding to the isolated execution parameters. The length of the container feature time series is ultimately 12, which is 1 hour divided by 5 minutes. That is, the container feature time series includes container feature parameters collected 12 times.

[0056] In some embodiments, step S101 may include but is not limited to steps S201 to S203:

[0057] Step S201: Obtain container characteristic parameters corresponding to each isolated execution container; the container characteristic parameters may include but are not limited to CPU utilization, memory usage, average response time, request throughput, and number of container restarts;

[0058] Step S202: Preprocessing the container characteristic parameters corresponding to each isolated execution container to determine the container characteristic time series corresponding to each isolated execution container, wherein the preprocessing includes filling missing values ​​and normalizing the characteristic parameters of each isolated execution container at each time point;

[0059] Step S203: Obtain the association relationship between containers, where the association relationship between containers includes the physical coupling relationship, functional dependency relationship, strong communication association relationship, and load similarity relationship between containers.

[0060] In some embodiments, the physical coupling relationship means that two isolated execution containers are deployed on the same server at the same time. The containers on the same server share resources such as CPU / memory / IO, and the coupling is strong.

[0061] Functional dependency indicates that two isolated execution containers belong to the same functional module or master-slave replica, and the load status correlation between the two containers belonging to the same functional module or master-slave replica is high.

[0062] A strong communication correlation indicates that the historical call frequency of two isolated execution containers within the preset time range is greater than or equal to the preset call threshold, where the preset time range and the preset call threshold are both custom parameters. For example, if the preset time range is set to 24 hours and the preset call threshold is 20 times, the historical call frequency between the containers is high, indicating that the load status correlation between the two is also high.

[0063] A load similarity relationship indicates that the load similarity relationship between two isolated execution containers is greater than or equal to a preset similarity threshold. The load similarity is calculated based on the CPU utilization or memory usage of the containers at multiple time points using the Pearson correlation coefficient or cosine similarity calculation. The preset similarity threshold is a custom parameter.

[0064] In some embodiments, the missing value filling includes filling by taking the average value or setting a default value, and the normalization processing includes dividing by a preset maximum value or using the Min-Max method.

[0065] In some embodiments, step S102 may include but is not limited to steps S301 to S304:

[0066] Step S301: each isolated execution container is used as a container node;

[0067] Step S302: Determine a corresponding undirected edge set based on the inter-container association relationship, where the undirected edge set includes all undirected edges between container nodes. An undirected edge indicates that at least one inter-container association relationship exists between two container nodes.

[0068] Step S303: determining the node attributes of each container node according to the container feature information, wherein the node attributes include the container feature time series of the container node;

[0069] Step S304 : generating a heterogeneous undirected graph according to each container node, the undirected edge set, and the node attributes of each container node.

[0070] In some embodiments, the heterogeneous undirected graph is specifically represented by the following formula:

[0071]

[0072] in, represents a heterogeneous undirected graph, Represents a node set, including each container node, represents a set of undirected edges, Represents the node attribute set of the container node, including the node attributes of each container node.

[0073] The node attributes of a container node may include, but are not limited to, a container feature time series corresponding to the container node and container identification information, where the container identification information includes a container ID, a container version, and a container namespace.

[0074] In step S302 of some embodiments, an undirected edge is constructed between two container nodes having one or more of a physical coupling relationship, a functional coupling relationship, a strong communication association relationship, or a load similarity relationship.

[0075] In some embodiments, the load prediction model includes a first update layer, a second update layer, and a classification layer. Step S103 may include, but is not limited to, steps S401 to S403:

[0076] Step S401: Input the heterogeneous undirected graph to the first update layer. The first update layer performs a time series analysis on each container node in the heterogeneous undirected graph according to the heterogeneous undirected graph, and outputs a first update vector.

[0077] Step S402: Input the first update vector to the second update layer, use the second update layer to perform aggregation analysis on the first update vector, and output a second update vector;

[0078] Step S403: Input the second update vector to the classification layer, use the classification layer to perform load prediction for each container node in a preset time period, and output the load prediction score corresponding to each container node in the preset time period.

[0079] In some embodiments, optionally, the preset time period is determined by the prediction start time and the prediction duration. The prediction start time is the current time of the load prediction, assuming it is T0. The prediction duration can be set by itself, assuming it is T, then the corresponding prediction end time is T1=T0+T. The preset time period is determined to be [T0, T1], and the load prediction model is used to output the load prediction score corresponding to the container node at [T0, T1]. The higher the load prediction score, the greater the load pressure on the container node.

[0080] In some embodiments, the first update layer is used to perform time series analysis on the container feature time series of all container nodes in the heterogeneous undirected graph to obtain a first update vector, wherein the number of dimensions of the first update vector is a custom parameter, and the number of computing units of the first update layer is the same as the time series length of the container feature time series.

[0081] The second update layer is used to perform aggregation analysis on the first update vector of the heterogeneous undirected graph to obtain a second update vector, wherein the number of dimensions of the second update vector is a custom parameter.

[0082] The classification space of the classification layer represents the load score of the container node within a preset time period. The classification layer is constructed based on a multi-layer perceptron, and the corresponding activation function includes a ReLU activation function, etc.

[0083] Optionally, the calculation formula for the timing analysis of the first update layer includes:

[0084]

[0085] Among them, h t represents the first update vector output by the tth computing unit, h t-1represents the first update vector output by the t-1th computing unit, x t represents the tth sequence unit of the time series input by the tth computing unit, r t represents the reset gate of the t-th computational unit, represents the first weight parameter of the tth computing unit, represents the second weight parameter of the tth computing unit, represents the first bias parameter of the tth computing unit, z t represents the update gate of the t-th computational unit, represents the third weight parameter of the tth computing unit, The fourth weight parameter of the tth computation unit, represents the second bias parameter of the tth computing unit, represents the hidden vector of the t-th computational unit, represents the fifth weight parameter of the t-th computing unit, represents the sixth weight parameter of the t-th computing unit, Represents the third bias parameter of the t-th computing unit, ⊙ represents element-by-element multiplication, σ represents the Sigmoid activation function, and tanh represents the hyperbolic tangent activation function.

[0086] In the second update layer, the calculation formulas used for aggregation analysis include:

[0087]

[0088] in, represents the second update vector of the i-th container node, N(i) represents the set of nodes that have edge connections with the i-th container node, M(i) represents the number of nodes that have edge connections with the i-th container node, represents the first update vector input to the i-th container node of the k-th attention head, represents the first update vector of the j-th container node input to the k-th attention head, express The corresponding weight parameters, express The corresponding weight parameters, represents the attention coefficient between the i-th node and the j-th node input to the k-th attention head, represents the normalization coefficient between the i-th node and the j-th node input to the k-th attention head, represents the weight parameter between the i-th node and the j-th node input to the k-th attention head, represents the normalization coefficient between the i-th node and the g-th node input to the k-th attention head, || represents the concatenation operation, LeakyReLU represents the LeakyReLU activation function, and exp represents the exponential function with the natural constant e as the base.

[0089] Optionally, assuming that the number of dimensions of the first update vector is set to 32, the number of attention heads k is set to 4, and the number of dimensions of the second update vector is set to 64, the number of dimensions of the output vector of each attention head is 16, and a multi-head attention mechanism is introduced to calculate the weights between container nodes in a heterogeneous undirected graph, so that each container node can adaptively pay attention to the importance of neighboring nodes, thereby improving the prediction accuracy of the load prediction model.

[0090] In some embodiments, step S104 may include but is not limited to steps S501 to S503:

[0091] Step S501: obtaining a plurality of preset load prediction score intervals and resource control strategies corresponding to the load prediction score intervals;

[0092] Step S502: determining a target score interval matching each isolated execution container from a plurality of load prediction score intervals based on the load prediction score corresponding to each isolated execution container;

[0093] Step S503 : For each isolated execution container, the resource control policy corresponding to the target scoring interval is used as the target resource control policy corresponding to the isolated execution container.

[0094] In some embodiments, for example, assuming that the load prediction score range is [0, 10], three load prediction score intervals are set, namely G1: [0, 7), G2: [7, 8.5) and G3: [8.5, 10]. The container control strategy for the load prediction score interval G1 is set to: maintain the resources of the isolated execution container unchanged without adjustment; the container control strategy for the load prediction score interval G2 is set to: allocate certain resources to the isolated execution container in advance to realize early hot standby container; the container control strategy for the load prediction score interval G3 is set to: immediately expand the capacity of the isolated execution container.

[0095] Reference Figure 2 , Figure 2 This is an optional structural diagram of a container resource control device provided in an embodiment of the present application. The device is used to implement the above-mentioned container resource control method. The device may include:

[0096] A data acquisition module is used to obtain container feature information and the relationship between containers; the container feature information includes the container feature time series corresponding to each isolated execution container;

[0097] The graph construction module is used to construct a corresponding heterogeneous undirected graph based on container feature information and the relationship between containers;

[0098] The load prediction module is used to input the heterogeneous undirected graph into the load prediction model and output the load prediction score corresponding to each isolated execution container;

[0099] The container control module is used to determine the target resource control policy corresponding to each isolated execution container based on the load prediction score corresponding to each isolated execution container, and perform container resource control on the isolated execution container according to the target resource control policy.

[0100] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0101] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the container resource control method when executing the computer program. The electronic device can be any smart terminal, such as a tablet computer.

[0102] It can be understood that the contents of the above method embodiments are applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0103] See also Figure 3 , Figure 3 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0104] The processor 901 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0105] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called by the processor 901 to execute the container resource control method of the embodiments of this application.

[0106] Input / output interface 903, used to implement information input and output;

[0107] Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0108] Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 );

[0109] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0110] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned container resource control method when executed by a processor.

[0111] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiment, the functions specifically implemented by the present storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0112] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0113] The embodiments of the present application provide a container resource control method, device, electronic device, and storage medium that can predict the load of a container. Based on the predicted load of a container, they can implement adaptive control of container resources, dynamically allocate container resources, improve application service performance, save application service resources, and improve container stability and work efficiency.

[0114] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0115] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0116] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0117] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0118] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0119] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0120] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0121] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0122] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0123] It should be appreciated that embodiments of the present invention may be implemented or practiced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The methods may be implemented in a computer program using standard programming techniques, including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program may be implemented in assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed application-specific integrated circuit for this purpose.

[0124] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0125] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A container resource control method, characterized in that: The method comprises the following steps: Obtaining container feature information and the association relationship between containers; the container feature information includes the container feature time series corresponding to each isolated execution container; Constructing a corresponding heterogeneous undirected graph based on the container feature information and the association relationship between the containers; Inputting the heterogeneous undirected graph into a load prediction model, and outputting a load prediction score corresponding to each of the isolated execution containers; According to the load prediction score corresponding to each of the isolated execution containers, a target resource control policy corresponding to each of the isolated execution containers is determined, and container resource control is performed on the isolated execution container according to the target resource control policy.

2. The container resource control method according to claim 1, characterized in that: The obtaining of container characteristic information and the association relationship between containers specifically includes: Obtain container characteristic parameters corresponding to each of the isolated execution containers; the container characteristic parameters include CPU utilization, memory occupancy, average response time, request throughput, and number of container restarts; Preprocessing the container characteristic parameters corresponding to each of the isolated execution containers to determine the container characteristic time series corresponding to each of the isolated execution containers, wherein the preprocessing includes filling missing values ​​and normalizing the characteristic parameters of each of the isolated execution containers at each time point; The inter-container association relationship is obtained, wherein the inter-container association relationship includes a physical coupling relationship, a functional dependency relationship, a strong communication association relationship, and a load similarity relationship between containers.

3. The container resource control method according to claim 2, characterized in that: The constructing of a corresponding heterogeneous undirected graph according to the container feature information and the association relationship between the containers specifically includes: Each of the isolated execution containers is used as a container node; Determine a corresponding undirected edge set based on the inter-container association relationship, wherein the undirected edge set includes all undirected edges between the container nodes, and the undirected edge indicates that at least one inter-container association relationship exists between two container nodes; Determining node attributes of each of the container nodes according to the container feature information, wherein the node attributes include the container feature time series of the container node; The heterogeneous undirected graph is generated according to each of the container nodes, the undirected edge set, and the node attributes of each of the container nodes.

4. The container resource control method according to claim 3, characterized in that: The load prediction model includes a first update layer, a second update layer, and a classification layer. Inputting the heterogeneous undirected graph into the load prediction model and outputting a load prediction score corresponding to each isolated execution container specifically includes: Inputting the heterogeneous undirected graph into the first update layer, using the first update layer to perform a time series analysis on each container node in the heterogeneous undirected graph according to the heterogeneous undirected graph, and outputting a first update vector; Inputting the first update vector into the second update layer, performing aggregation analysis on the first update vector using the second update layer, and outputting a second update vector; The second update vector is input to the classification layer, and the classification layer is used to perform load prediction for each container node in a preset time period, and a load prediction score corresponding to each container node in the preset time period is output.

5. The container resource control method according to claim 1, characterized in that: Determining a target resource control policy corresponding to each isolated execution container according to the load prediction score corresponding to each isolated execution container specifically includes: Obtaining a plurality of preset load prediction score intervals and resource control strategies corresponding to each of the load prediction score intervals; Determining, according to the load prediction scores corresponding to the isolated execution containers, the target score interval matching each of the isolated execution containers from a plurality of load prediction score intervals; For each of the isolated execution containers, the resource control policy corresponding to the target scoring interval is used as the target resource control policy corresponding to the isolated execution container.

6. The container resource control method according to claim 3, characterized in that: The heterogeneous undirected graph is specifically represented by the following formula: in, represents a heterogeneous undirected graph, Represents a node set, including each of the container nodes, represents a set of undirected edges, A node attribute set representing a container node, including the node attributes of each container node.

7. The container resource control method according to claim 2, characterized in that: The strong communication correlation relationship indicates that the historical call frequency of the two isolated execution containers within a preset time range is greater than or equal to a preset call threshold, and the load similarity relationship indicates that the load similarity of the two isolated execution containers is greater than or equal to a preset similarity threshold.

8. A container resource control device, characterized in that: The device comprises: A data acquisition module is used to obtain container feature information and the association relationship between containers; the container feature information includes the container feature time series corresponding to each isolated execution container; A graph construction module, configured to construct a corresponding heterogeneous undirected graph based on the container feature information and the association relationship between the containers; A load prediction module, configured to input the heterogeneous undirected graph into a load prediction model and output a load prediction score corresponding to each of the isolated execution containers; The container control module is used to determine the target resource control policy corresponding to each isolated execution container according to the load prediction score corresponding to each isolated execution container, and perform container resource control on the isolated execution container according to the target resource control policy.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the container resource control method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the container resource control method according to any one of claims 1 to 7 is implemented.