Method for managing instances and instance management platform
By monitoring instance resource utilization to generate historical task portraits and automatically generate scaling strategies, it solves the problem of cumbersome and error-prone manual formulation of strategies in the cloud service platform, and improves resource utilization and task execution efficiency.
Patent Information
- Application Number
- PCT/CN2024/070390
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-27
- Filing Date
- 2024-01-03
- Publication Date
- 2024-10-03
Smart Images

Figure CN2024070390_03102024_PF_FP_ABST
Abstract
Description
A method for managing an instance and an instance management platform
[0001] This application claims priority to the Chinese patent application with application number 202310308241.1 filed with the State Intellectual Property Office of China on March 27, 2023, and priority to the Chinese patent application with the invention name “A method for managing instances and an instance management platform”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of cloud services, and more specifically, to a method for managing instances and an instance management platform. Background Art
[0003] The distributed task scheduling system based on cloud services primarily provides task segmentation and orchestration, as well as real-time, precise task scheduling. It offers features such as scheduled tasks, one-time tasks, task orchestration, and distributed batch execution. To enhance the service-oriented capabilities of the cloud service platform, the task scheduling system also needs to control the elastic scaling of cloud server (Elastic Compute Service, ECS) resources, replenishing them during busy periods and recycling them during idle periods, thereby further reducing resource costs.
[0004] When using a distributed task scheduling system, users need to develop an elastic scaling strategy based on historical experience that matches the task execution profile. Specifically, they need to develop a strategy for determining when to scale, how to scale, and which scaling metrics to use. The configuration process for this strategy is cumbersome and prone to errors due to the high degree of manual intervention.
[0005] Summary of the Invention
[0006] The present application provides a method for managing instances and an instance management platform. The method can automatically generate scaling policies, solving the problems of cumbersome scaling policy configuration and high degree of manual intervention that can easily lead to errors.
[0007] In a first aspect, a method for managing instances is provided. The method includes: an instance management platform monitoring instances running tasks in a scaling group to obtain resource utilization of the instances, where the resource utilization includes one or more of the following: central processing unit (CPU) utilization and memory utilization; the instance management platform generating a historical task profile based on the resource utilization, where the historical task profile includes one or more of the following: historical task timing characteristics and historical task resource characteristics, where the historical task timing characteristics indicate the timing characteristics of historical tasks when the scaling group is running, and the historical task resource characteristics indicate the resource type of the scaling group, where the resource type includes one or more of the following: compute-intensive, memory-intensive, input / output-intensive (IO-intensive) (or read / write-intensive), and graphics-intensive; the instance management platform generating one or more scaling policies based on the historical task profile using a first model, where the first model takes the historical task profile as input and outputs one or more scaling policies as output; the instance management platform recommending one or more scaling policies to a user; the instance management platform determining the scaling policy selected by the user; and adjusting the number of instances or instance specifications in the scaling group based on the scaling policy selected by the user.
[0008] The above technical solution can fully utilize large amounts of high-quality data and use models to automatically generate reasonable scaling policies based on historical task profiles. This solves the problems of cumbersome scaling policy configuration and large errors caused by manual intervention, and can also improve scaling effectiveness. Furthermore, formulating scaling policies based on historical task profiles can reduce the problems of large data calculations, cumbersome parameter conversion, and low accuracy that arise when formulating scaling policies directly based on monitoring data. This makes scaling policy generation more efficient and reasonable.
[0009] In combination with the first aspect, in certain implementations of the first aspect, the scaling strategy includes one or more of the following: a scheduled scaling strategy and an alarm scaling strategy, and using the first model to generate one or more scaling strategies based on historical task profiles includes: using the first model to determine one or more of the following parameters of the scheduled scaling strategy based on the historical task profiles: scaling time, scheduled scaling semantics, and scheduled scaling scale; using the first model to determine one or more of the following parameters of the alarm scaling strategy based on the historical task profiles: alarm indicators, alarm thresholds, alarm scaling semantics, and alarm scaling scale.
[0010] Based on the above implementation, the relevant parameters determined by the required policy generation model are specifically refined, which enables the subsequent scaling group to adjust the instance more accurately, thereby further improving the scaling effect.
[0011] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: the instance management platform determines the remaining resource amount of the scaling group based on the number of instances and the specifications of the instances; the instance management platform decides to suspend the task and wait, or to schedule the task between scaling groups based on the resource type and remaining resource amount of the scaling group.
[0012] Based on the above implementation, task execution throttling parameters can be dynamically adjusted according to the type and remaining resources in the scaling group, and the optimal scaling group can be selected to complete task delivery, thereby avoiding resource waste and improving the task execution efficiency of the scaling group.
[0013] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the instance management platform presenting historical task timing features and historical task resource features to the user.
[0014] Based on this technical solution, when users formulate scaling strategies themselves, the historical task portrait can assist users in completing scaling strategy formulation, thereby helping to improve the scaling effect of the scaling strategy.
[0015] In combination with the first aspect, in certain implementations of the first aspect, generating a historical task portrait based on resource utilization includes: preprocessing the resource utilization to obtain processing data, the preprocessing including one or more of the following: normalization, vectorization; using a second model to generate a historical task portrait based on the processing data, the input of the second model is the processing data, and the output of the second model is the historical task portrait.
[0016] Based on this solution, the second model is used to extract historical task portraits based on data such as resource utilization. Compared with manual analysis and extraction of task portraits, the historical task portraits can be extracted faster and more accurately; and the second model can extract historical task portraits based on pre-processed processing data, which is conducive to more efficient and accurate generation of historical task portraits.
[0017] In combination with the first aspect, in certain implementations of the first aspect, the historical task timing characteristics include one or more of the following: average running time of historical tasks, peak period of historical task volume, low period of historical task volume, and historical task execution cycle.
[0018] In a second aspect, an instance management platform is provided, including: a monitoring module for monitoring instances running tasks in a scaling group to obtain resource utilization of the instances, where the resource utilization includes one or more of the following: central processing unit (CPU) utilization and memory utilization; a policy generation module for generating historical task profiles based on the resource utilization, where the historical task profiles include one or more of the following: historical task timing characteristics and historical task resource characteristics, where the historical task timing characteristics are used to indicate the timing characteristics of historical tasks when the scaling group is running, and the historical task resource characteristics are used to indicate the resource type of the scaling group, where the resource type includes one or more of the following: compute-intensive, memory-intensive, input / output-intensive, and graphics-intensive; the policy generation module is further used to generate one or more scaling policies based on the historical task profiles using a first model, where the input of the first model is the historical task profile, and the output of the first model is one or more scaling policies; an execution module for recommending one or more scaling policies to a user; the execution module is further used to determine the scaling policy selected by the user; and the execution module is further used to adjust the number of instances or instance specifications in the scaling group based on the scaling policy selected by the user.
[0019] Based on the above technical solution, the policy generation module can fully utilize a large amount of high-quality data, use models to automatically generate reasonable scaling policies based on historical task profiles, and enable scaling policies through interaction with users, thus solving the problems of cumbersome scaling policy configuration and large errors caused by manual intervention, and can improve scaling effects. In addition, formulating scaling policies based on historical task profiles reduces the large amount of data calculation, cumbersome parameter conversion, and low accuracy caused by formulating scaling policies directly based on monitored data, making the generation of scaling policies more efficient and reasonable.
[0020] In combination with the second aspect, in certain implementations of the second aspect, the scaling strategy includes one or more of the following: a scheduled scaling strategy and an alarm scaling strategy. The strategy generation module is specifically used to use the first model to determine one or more of the following parameters of the scheduled scaling strategy based on historical task profiles: scaling time, scheduled scaling semantics, and scheduled scaling scale; and use the first model to determine one or more of the following parameters of the alarm scaling strategy based on historical task profiles: alarm indicators, alarm thresholds, alarm scaling semantics, and alarm scaling scale.
[0021] In combination with the second aspect, in certain implementations of the second aspect, the execution module is also used to: determine the remaining resources of the scaling group based on the number of instances and the specifications of the instances; decide to suspend the task and wait, or schedule the task between scaling groups based on the resource type and remaining resources of the scaling group.
[0022] In combination with the second aspect, in some implementations of the second aspect, the execution module is further configured to present historical task timing features and historical task resource features to the user.
[0023] In combination with the second aspect, in certain implementations of the second aspect, the strategy generation module is specifically used to: preprocess resource utilization to obtain processing data, the preprocessing including one or more of the following: normalization, vectorization; use the second model to generate a historical task portrait based on the processing data, the input of the second model is the processing data, and the output of the second model is the historical task portrait.
[0024] In combination with the second aspect, in certain implementations of the second aspect, the historical task timing characteristics include one or more of the following: average running time of historical tasks, peak period of historical task volume, low period of historical task volume, and historical task execution cycle.
[0025] In a third aspect, a computing device is provided, comprising a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call and execute the instructions from the memory, so that the computing device executes the method in the first aspect or any possible implementation of the first aspect.
[0026] In a fourth aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call and execute the instructions from the memory, so that the computing device cluster executes the method in the first aspect or any possible implementation of the first aspect.
[0027] In conjunction with the fourth aspect, in certain implementations of the fourth aspect, the processor may be a general-purpose processor, which may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated into the processor or located independently of the processor.
[0028] In a fifth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0029] In combination with the fifth aspect, in certain implementations of the fifth aspect, the above-mentioned storage medium may specifically be a non-volatile storage medium.
[0030] In a sixth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method in the first aspect or any possible implementation of the first aspect.
[0031] In a seventh aspect, a chip is provided, which obtains instructions and executes the instructions to implement the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0032] In combination with the seventh aspect, in certain implementations of the seventh aspect, the chip includes a processor and a data interface, and the processor reads instructions stored in the memory through the data interface to execute the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0033] In combination with the seventh aspect, in certain implementations of the seventh aspect, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] FIG1 is a schematic diagram of a cloud service system architecture provided in an embodiment of the present application.
[0035] FIG2 is a schematic flowchart of a method 200 for managing instances provided in an embodiment of the present application.
[0036] FIG3 is a schematic flowchart of a method 300 for generating a historical task portrait according to an embodiment of the present application.
[0037] FIG4 is a schematic diagram of a client interface provided in an embodiment of the present application.
[0038] FIG5 is a schematic structural block diagram of an instance management platform provided in an embodiment of the present application.
[0039] FIG6 is a schematic structural block diagram of a computing device provided in an embodiment of the present application.
[0040] FIG7 is a schematic structural block diagram of a computing device cluster provided in an embodiment of the present application.
[0041] FIG8 is a schematic structural block diagram of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The technical solution in this application will be described below with reference to the accompanying drawings.
[0043] This application will present various aspects, embodiments, or features around systems including multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. Furthermore, combinations of these aspects may also be used.
[0044] Additionally, in the embodiments of this application, words such as "exemplary" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as an "exemplary" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner.
[0045] The architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of the architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
[0046] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0047] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, 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 or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0048] The technical solution of this application is applicable to a cloud platform system (hereinafter referred to as a cloud platform). A cloud platform is a server platform that provides an operating environment and resources, such as instances and memory, for applications. It also supports the deployment of multiple instances of applications to support highly concurrent external user access.
[0049] FIG1 shows a schematic diagram of a cloud service system architecture provided by an embodiment of the present application. As shown in FIG1 , a client can access a cloud platform via the Internet. Typically, a cloud platform includes multiple servers, such as server 1 to server n, each of which includes cloud service resources. For example, server 1 includes cloud service 1 and cloud service 2, and cloud service resources provide corresponding cloud services to tenants. The client is connected to the server through a management platform 10. The hardware layer of the server may include a processor, memory, network card, and data bus, etc.
[0050] To facilitate understanding, the following first introduces relevant terms and concepts that may be involved in the embodiments of this application.
[0051] 1. Telescopic group
[0052] A scaling group can be understood as a collection of ECS instances with the same application scenario, or the smallest unit for managing elastically scalable cloud servers. The number of instances in a scaling group can be elastically scaled. For example, if the load on the instances in a scaling group is too high, the number of instances in the group can be increased to distribute the load across each instance in the group. If the load on the instances in a scaling group is low, some instances can be deleted to conserve system resources.
[0053] 2. Scaling Strategy
[0054] Scaling policies are used to define how a scaling group performs elastic scaling. Classic elastic scaling policies include scheduled scaling policies and alarm scaling policies.
[0055] A scheduled scaling policy is used to instruct the execution of elastic scaling activities at a set time. You need to specify: the scaling time, that is, when to scale; the scaling scale, that is, the amount of expansion or contraction when scaling is triggered; and the scaling semantics, that is, the action to be performed, including increase, decrease, adjust to, increase by a certain percentage, decrease by a certain percentage, etc.
[0056] Alarm scaling policies are used to instruct elastic scaling to be executed when observable indicators and set thresholds are exceeded. These policies require the following: alarm indicators, such as central processing unit (CPU) utilization, memory usage, and custom business indicators; alarm thresholds, which determine when scaling is executed when the monitored indicator data reaches the threshold; alarm scaling scales, which determine the amount of capacity expansion or contraction when scaling is triggered; and alarm scaling semantics, which determine the action to be performed, including increase, decrease, adjust to, increase by a certain percentage, and decrease by a certain percentage.
[0057] The above briefly explains the terms involved in this application, which will not be repeated in the following embodiments. In addition, the above explanation of the terms is only for ease of understanding and does not limit the scope of protection of the embodiments of this application.
[0058] Distributed task scheduling systems are widely used in continuous delivery scenarios such as DevOps (a general term for processes, methods, and systems that emphasize communication and collaboration between software developers (Dev) and IT operations technicians (Ops)). Distributed task scheduling systems can reasonably shield users from the details of ECS resource scheduling in the cloud platform, thereby reducing the mental burden on users and allowing them to better focus on their business.
[0059] The task scheduling system can obtain task data for target tasks and upload it to the cloud platform. Current task scheduling systems used on cloud platforms, such as Kubernetes, provide the Kubernetes Auto Scaler component to manage and scale scaling groups. However, this often requires users to analyze business load characteristics and configure scaling policies, such as determining the scaling cycle, scaling scale, and alarm indicators. The system then collects monitoring indicator data, triggers scaling policies based on alarms or time, and dynamically adjusts ECS instances through the resource adjustment interface provided by the cloud computing vendor. The cumbersome manual configuration of scaling policies requires significant manpower and material resources, and relying on manual experience can lead to errors.
[0060] In view of this, an embodiment of the present application provides a method for managing instances. This method can obtain resource utilization by monitoring instances of running tasks in a scaling group, generate historical task profiles based on the resource utilization, and then use a model to automatically generate scaling policies based on the historical task profiles. This method can effectively solve the problems of cumbersome scaling policy configuration, high degree of manual intervention, and prone to errors.
[0061] FIG2 shows a schematic flow chart of a method 200 for managing resources on a cloud platform provided in an embodiment of the present application. The method includes the following steps.
[0062] S210: The instance management platform monitors the instances running tasks in the scaling group to obtain monitoring indicator data of the instances.
[0063] In some embodiments, the instance management platform may be a cloud platform. The cloud can be generally understood as a group or cluster of remote computers that work together to build a platform that provides users with a variety of services, such as computing power for analyzing business data. Computing can refer to the various requirements for building business systems. In some embodiments, the cloud platform can also be referred to as a cloud computing platform.
[0064] Specifically, an instance can be a server resource. For example, an instance can be a virtual machine, a container, a database, a microservice, etc. In some embodiments, an instance can also be referred to as an ECS instance.
[0065] In some embodiments, the monitoring indicator data may include resource utilization, where the resource utilization may include one or more of the following: CPU utilization, memory utilization, GPU utilization, disk utilization, and video memory utilization.
[0066] In some embodiments, the monitoring indicator data may further include one or more of the following: load indicators, network indicators, custom indicators, disk read rate, and disk write rate. Among them, the network indicators may include public network bandwidth indicators and intranet bandwidth indicators.
[0067] S220, the instance management platform generates a historical task profile based on the monitoring indicator data;
[0068] The historical task profile can be used to reflect the characteristics of historical tasks run by instances in a scaling group. It is understood that the historical tasks can be all or part of the historical tasks run by the instance. In some embodiments, the historical task profile can include one or more of the following: historical task timing characteristics and historical task resource characteristics. The historical task timing characteristics can be used to indicate the timing characteristics of historical tasks when the scaling group was running, and the historical task resource characteristics can be used to indicate the resource types of the scaling group.
[0069] Optionally, historical task timing characteristics may include one or more of the following: historical task average runtime, historical task peak hours, historical task low hours, and historical task execution cycles. Using these parameters to reflect historical task timing characteristics facilitates the subsequent policy generation model to more accurately and effectively generate scaling policies based on these parameters.
[0070] Optionally, resource types may include one or more of the following: one or more of compute-intensive, memory-intensive, input-output intensive (IO intensive) (or read-write intensive), and graphics-intensive. Among them, compute-intensive usually requires a large amount of calculations, consuming CPU resources; IO intensive usually consumes less CPU, and most of the task time is spent waiting for IO operations to complete; graphics intensive usually requires a large amount of graphics rendering, requiring strong processing and storage capabilities. This embodiment is based on historical task resource characteristics, which is conducive to the subsequent strategy generation model to more accurately predict the amount of resources required at different times during the task execution process based on this characteristic, thereby generating a more reasonable scaling strategy.
[0071] S230: The instance management platform generates one or more scaling policies based on the historical task profile using the first model.
[0072] The "first model" in the specific examples of this application can also be described as a "strategy generation model", which will not be repeated below. It should be understood that the following examples are only given for the convenience of description and understanding and should not constitute any limitation on the technical solution.
[0073] In some embodiments, the policy generation model can be a machine learning model. It is understood that the policy generation model can be pre-trained and can output scaling policies based on input historical task profiles. Exemplarily, the machine learning algorithm used to implement the profile generation model can include one or more of the following: classification algorithms, such as the K-nearest neighbor algorithm; regression algorithms, such as linear regression; or clustering algorithms, such as the K-means algorithm.
[0074] Optionally, scaling policies may include one or more of the following: scheduled scaling policies, alarm scaling policies, and periodic scaling policies. Alarm scaling policies can instruct the instance management platform to automatically increase, decrease, or set the number or specifications of instances based on alarm data from the monitoring system (e.g., CPU usage); scheduled scaling policies can instruct the instance management platform to automatically increase, decrease, or set the number or specifications of instances based on a configured time point; and periodic scaling policies can instruct the instance management platform to periodically increase, decrease, or set the number or specifications of instances based on a configured period (e.g., daily, weekly, or monthly).
[0075] S240: The instance management platform recommends one or more scaling strategies to the user and determines the scaling strategy selected by the user.
[0076] In some implementations, after the instance management platform generates one or more scaling policies, it may interact with the user, for example, by recommending the aforementioned scaling policies to the user.
[0077] Exemplarily, the scaling policy can be presented to the user via the front-end. Exemplarily, one or more of the following parameters of a scheduled scaling policy can be presented to the user via the front-end: scaling time, scheduled scaling semantics, and scheduled scaling scale. Exemplarily, one or more of the following parameters of an alarm scaling policy can also be presented to the user via the front-end: alarm indicator, alarm threshold, alarm scaling semantics, and alarm scaling scale.
[0078] It's understood that users can choose whether to enable the recommended scaling policy, as well as which one or more scaling policies to select. For scaling policies that users choose to enable, scaling of the scaling group will be triggered when the policy conditions are met. For scaling policies that users don't choose to enable, scaling of the scaling group will not be triggered.
[0079] S250: The instance management platform adjusts the number of instances or instance specifications in the scaling group according to the scaling policy selected by the user.
[0080] In some implementations, a scaling group can be scaled horizontally (also known as horizontal scaling) or vertically (also known as vertical scaling). Horizontal scaling can be understood as adjusting the number of instances in a scaling group, for example, increasing or decreasing the number of instances. Vertical scaling can be understood as adjusting the specifications of instances in a scaling group, for example, increasing or decreasing the instance's CPU, memory, bandwidth, and other configurations.
[0081] The above technical solution can fully utilize large amounts of high-quality data, use models to automatically generate reasonable scaling policies based on historical task profiles, and enable scaling policies through user interaction, thus solving the problems of cumbersome scaling policy configuration and large errors caused by manual intervention, and improving scaling effectiveness. Furthermore, by formulating scaling policies based on historical task profiles, it reduces the large amount of data calculation, cumbersome parameter conversion, and low accuracy that arise when formulating scaling policies directly based on monitoring data, making scaling policy generation more efficient and reasonable.
[0082] Optionally, the historical task portrait can be obtained by manual analysis based on the historical task data, or the historical task portrait can be generated by a machine learning model based on the historical task data. In some implementations, generating the historical task portrait based on the monitoring indicator data in step S220 can specifically include: using a second model to generate the historical task portrait based on the monitoring indicator data, where the input of the second model is the monitoring indicator data and the output of the second model is the historical task portrait.
[0083] The "second model" in the specific examples of this application can be described as a "portrait generation model", which will not be repeated below. It should be understood that the following examples are only given for the convenience of description and understanding and should not constitute any limitation on the technical solution.
[0084] Optionally, the profile generation model can be a trained machine learning model, where the input can be monitoring indicator data and the output is a historical task profile. A wide range of machine learning algorithms are available for implementing this profile generation model, including common deep learning algorithms such as gradient descent, backpropagation, and pooling. Classification algorithms such as the K-nearest neighbor algorithm and clustering algorithms such as the K-means algorithm can also be used.
[0085] Based on this solution, the second model is used to extract historical task portraits based on data such as resource utilization in the monitoring indicator data. Compared with manual analysis and extraction of task portraits, historical task portraits can be extracted faster and more accurately.
[0086] In some implementations, the monitoring indicator data may be pre-processed to obtain processed data before being input into the portrait generation model. FIG3 provides a method for generating a historical task portrait. As shown in FIG3 , the above step S220 may specifically include the following steps:
[0087] S221, preprocessing the monitoring indicator data to obtain processed data;
[0088] The preprocessing may include one or more of the following: normalization and vectorization.
[0089] S222, using the second model to generate a historical task portrait based on the processed data, the input of the second model is the processed data, and the output of the second model is the historical task portrait.
[0090] Based on this solution, the portrait generation model can extract historical task portraits based on the preprocessed monitoring indicator data, which is conducive to more efficient and accurate generation of historical task portraits.
[0091] In some implementations, after generating the historical task profile in step S220, the historical task profile can also be presented to the user, specifically, the temporal characteristics and / or resource characteristics of the historical tasks. Specifically, the task profile can be presented via a front-end user interface. Based on this technical solution, when users independently formulate scaling policies, the historical task profile can assist them in formulating the policy, thereby improving the scaling effectiveness of the policy.
[0092] In some implementations, the policy generation model used in step S230 generates a scaling policy based on historical task profiles. Specifically, the policy generation model can determine one or more of the following parameters for the scheduled scaling policy based on the historical task profiles: scaling time, scheduled scaling semantics, and scheduled scaling scale. An example of a scheduled scaling policy is: "2023 / 03 / 01 00:00:00, add 3 instances." Another example is: "2023 / 03 / 01 00:00:00, expand capacity by 3."
[0093] In some implementations, step S230 may specifically use the policy generation model to determine one or more of the following parameters for the alarm scaling policy: alarm indicator, alarm threshold, alarm scaling semantics, and alarm scaling scale. Optionally, the alarm threshold may include an upper threshold and a lower threshold. Examples of alarm scaling policies include: "CPU usage > 70%, add 2 instances"; "CPU usage < 30%, reduce 2 instances."
[0094] Optionally, in step S230 , the policy generation model can be used to determine one or more of the following parameters for the periodic scaling policy: the scaling period, the periodic scaling semantics, and the periodic scaling scale. An example of a periodic scaling policy is: "2023 / 03 / 01 00:00:00 - 2023 / 03 / 31 23:59:59, increase instances by 10% daily."
[0095] Optionally, when the business load is difficult to predict, users can select an alarm policy. The system will trigger scaling activities based on real-time monitoring data (such as CPU usage) and dynamically adjust the number or specifications of instances in the scaling group.
[0096] When business load changes regularly, users can choose a scheduled policy or a periodic policy to adjust the number or specifications of instances in the scaling group.
[0097] Through the above implementation, the relevant parameters determined by the required policy generation model are specifically refined, which enables the subsequent scaling group to adjust the instance more accurately, thereby further improving the scaling effect.
[0098] In some implementations, in step S260 , the number of instances in the scaling group or the specifications of the instances are adjusted. Specifically, the following adjustment modes may be used: direct adjustment mode, progressive adjustment mode, and tracking adjustment mode.
[0099] Direct adjustment mode directly adjusts the number of instances or instance specifications in a scaling group to the set value. For example, if the scaling policy includes "CPU usage > 70%, expand by 3," when the alarm scaling policy is triggered, the instance management platform can directly add three instances to the scaling group.
[0100] The progressive adjustment mode refers to segmented expansion and contraction based on monitoring alarms. It adds step-by-step definitions to the direct adjustment mode, allowing for fine-grained control of expansion and contraction.
[0101] Tracking mode allows you to select a monitoring metric and specify a target value. The instance management platform automatically calculates the required number of instances and scales them up or down to maintain the metric near the target value. For example, if a scaling policy includes "Maintain CPU utilization at 70%," when an alarm is triggered, the platform calculates the required number of instances and scales them up or down to maintain CPU utilization near 70%.
[0102] After a scaling operation is performed on a scaling group, the resource capacity within the scaling group changes, which may cause a mismatch between the task and the actual resource load capacity. For example, after the number of instances increases, a task may not match the actual resource load capacity due to some throttling reasons, resulting in resource waste.
[0103] Optionally, when tasks are issued, the task type can be determined based on the business it belongs to, such as pipeline business, big data business, model training business, etc. Task types can also be categorized as compute-intensive, memory-intensive, read / write-intensive, graphics-intensive, etc. In some implementations, tasks can be preferentially scheduled to scaling groups that match their type. For example, compute-intensive tasks can be preferentially scheduled to compute-intensive scaling groups, while memory-intensive tasks can be preferentially scheduled to memory-intensive scaling groups.
[0104] In some implementations, the instance management platform can also calculate the remaining resources of the scaling group based on the number and specifications of instances in the scaling group. Optionally, tasks can be preferentially scheduled to scaling groups with larger remaining resources.
[0105] In some implementations, the instance management platform can decide to suspend a task or schedule it between scaling groups based on the resource type and remaining resource amount of the scaling group. In other words, the instance management platform can dynamically adjust task throttling based on the resource type and remaining resource amount of the scaling group. When dispatching tasks, the task can be preferentially scheduled to the scaling group that matches the task type and has the largest remaining resource amount. This scaling group can be called the optimal scaling group. If the remaining resource amount of all scaling groups that match the task type is relatively low, the task can be suspended.
[0106] Based on the above implementation, task execution throttling parameters can be dynamically adjusted according to the resource type and remaining resource amount in the scaling group, and the optimal scaling group can be selected to complete task delivery, thereby avoiding resource waste and improving the task execution efficiency of the scaling group.
[0107] Figure 4 shows a schematic diagram of a client interface provided by an embodiment of the present application. For example, a user can click the "Scaling Policy Configuration Recommendation" option to view the current policy and recommended policies. Recommended policies 1 and 2 may be policies generated by the policy recommendation model of the present application. Optionally, a user can click the "Recommended Policy 1" option to view the specific parameters of the scaling policy. For example, after clicking Recommended Policy 1, the interface may display "CPU usage > 70%, expand capacity by 3."
[0108] Optionally, the instance management platform can monitor the instance's various monitoring indicators in real time. During normal operation, each performance indicator is within a reasonable range.
[0109] For example, the user can click the "Enable" option to enable the corresponding recommended strategy. For example, after the user clicks the "Enable" option corresponding to recommended strategy 1, when the instance CPU usage is monitored to be greater than 70%, the scaling activity of recommended strategy 1 will be triggered, causing the cloud platform to execute the expansion operation and add 3 instances to the scaling group to avoid task execution abnormalities.
[0110] For example, the recommended strategy 2 can be "CPU usage <30%, scale down 1". After the user clicks the "Enable" option corresponding to the recommended strategy 2, when the CPU usage is monitored to be less than 30%, the scaling activity of the recommended strategy 2 will be triggered to reduce resource waste and reduce operating costs.
[0111] The above describes in detail the method embodiment of the embodiment of the present application. The following describes the device embodiment of the embodiment of the present application. The device embodiment and the method embodiment correspond to each other. Therefore, for parts not described in detail in the device embodiment, please refer to the previous method embodiment.
[0112] FIG5 shows a schematic structural block diagram of an instance management platform 500 provided in an embodiment of the present application. The instance management platform may include: a monitoring module 510 for monitoring instances running tasks in a scaling group to obtain instance resource utilization. Resource utilization includes one or more of the following: CPU utilization and memory utilization; a policy generation module 520 for generating historical task profiles based on resource utilization. The historical task profiles include one or more of the following: historical task timing characteristics and historical task resource characteristics. The historical task timing characteristics indicate the timing characteristics of historical tasks when running in the scaling group. The historical task resource characteristics indicate the resource types of the scaling group. The resource types may include one or more of the following: compute-intensive, memory-intensive, input / output-intensive, and graphics-intensive; the policy generation module 520 is further configured to generate one or more scaling policies based on the historical task profiles using a first model. The first model takes the historical task profiles as input and outputs the one or more scaling policies as output; an execution module 530 is configured to recommend one or more scaling policies to a user; the execution module 530 is further configured to determine the scaling policy selected by the user; and the execution module 530 is further configured to adjust the number of instances or instance specifications in the scaling group based on the scaling policy selected by the user.
[0113] Based on the above technical solution, the policy generation module 520 can make full use of a large amount of high-quality data, use the model to automatically generate a reasonable scaling policy based on the historical task profile, and can interact with the user through the execution module 530 to enable the scaling policy, thereby solving the problems of cumbersome scaling policy configuration and large errors in manual intervention, and improving the scaling effect; in addition, the policy generation module 520 formulates the scaling policy based on the historical task profile, reducing the problems of large data calculation volume, cumbersome parameter conversion, and low accuracy caused by directly formulating the scaling policy based on the monitored data, making the generation of the scaling policy more efficient and reasonable.
[0114] In some possible implementations, the scaling policy may include one or more of the following: a scheduled scaling policy and an alarm scaling policy. The policy generation module is specifically configured to use the first model to determine one or more of the following parameters of the scheduled scaling policy based on historical task profiles: scaling time, scheduled scaling semantics, and scheduled scaling scale; and use the first model to determine one or more of the following parameters of the alarm scaling policy based on historical task profiles: alarm indicators, alarm thresholds, alarm scaling semantics, and alarm scaling scale.
[0115] Based on the above implementation, the relevant parameters determined by the required policy generation model are specifically refined, which enables the subsequent scaling group to adjust the instance more accurately, thereby further improving the scaling effect.
[0116] In some possible implementations, the execution module 530 may also be used to: determine the remaining resource amount based on the number of instances and the instance specifications; decide to suspend the task or schedule the task between scaling groups based on the resource type and remaining resource amount of the scaling group.
[0117] Based on the above implementation, task execution throttling parameters can be dynamically adjusted according to the type and remaining resources in the scaling group, and the optimal scaling group can be selected to complete task delivery, which can reduce resource waste and improve the task execution efficiency of the scaling group.
[0118] In some implementations, the execution module 530 may also present historical task timing features and historical task resource features to the user.
[0119] Based on this technical solution, when users formulate their own scaling strategies, historical task profiles can assist users in completing the scaling strategy formulation, thereby helping to improve the scaling effect of the scaling strategy.
[0120] In some embodiments, the strategy generation module 520 can be specifically used to: preprocess resource utilization to obtain processing data, the preprocessing including one or more of the following: normalization, vectorization; use a second model to generate a historical task portrait based on the processing data, the input of the second model is the processing data, and the output of the second model is the historical task portrait.
[0121] Based on this solution, the strategy generation module 520 can use the second model to extract historical task portraits based on data such as resource utilization. Compared with manual analysis and extraction of task portraits, it can extract historical task portraits faster and more accurately; and the second model can extract historical task portraits based on pre-processed processing data, which is conducive to the generation of historical task portraits more efficiently and accurately.
[0122] In some embodiments of the present application, the historical task timing characteristics may include one or more of the following: average running time of historical tasks, peak period of historical task volume, low period of historical task volume, and historical task execution cycle.
[0123] The monitoring module, policy generation module, and execution module can all be implemented via software or hardware. For example, the implementation of the monitoring module will be described below using the monitoring module as an example. Similarly, the implementation of the policy generation module and execution module can refer to the implementation of the monitoring module.
[0124] As an example of a software functional unit, a monitoring module may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the monitoring module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0125] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0126] As an example of a hardware functional unit, a monitoring module may include at least one computing device, such as a server. Alternatively, the monitoring module may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0127] The multiple computing devices included in the monitoring module can be distributed in the same region or in different regions. They can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the monitoring module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0128] It should be noted that, in other embodiments, the monitoring module can be used to execute any step in the method for managing an instance, the policy generation module can be used to execute any step in the method for managing an instance, and the execution module can be used to execute any step in the method for managing an instance. The steps that the monitoring module, the policy generation module, and the execution module are responsible for implementing can be specified as needed. The full functions of the instance management platform are realized by respectively implementing different steps in the method for managing an instance through the monitoring module, the policy generation module, and the execution module.
[0129] The present application also provides a computing device 600. As shown in Figure 6, computing device 600 includes a bus 602, a processor 604, a memory 606, and a communication interface 608. Processor 604, memory 606, and communication interface 608 communicate with each other via bus 602. Computing device 600 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 100.
[0130] Bus 602 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG6 shows a single bus line, but this does not imply a single bus or type of bus. Bus 602 may include a path for transmitting information between various components of computing device 600 (e.g., memory 606, processor 604, and communication interface 608).
[0131] The processor 604 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0132] The memory 606 may include volatile memory, such as random access memory (RAM). The processor 604 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0133] The memory 606 stores executable program code, and the processor 604 executes the executable program code to implement the functions of the aforementioned monitoring module, policy generation module, and execution module, thereby implementing the aforementioned method for managing instances. In other words, the memory 606 stores instructions for executing the aforementioned method for managing instances.
[0134] The communication interface 608 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 600 and other devices or a communication network.
[0135] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0136] As shown in Figure 7, the computing device cluster includes at least one computing device 600. The memory 606 in one or more computing devices 600 in the computing device cluster may store the same instructions for executing the above-mentioned method for managing instances.
[0137] In some possible implementations, the memory 606 of one or more computing devices 600 in the computing device cluster may also store partial instructions for executing the above-mentioned method for managing instances. In other words, the combination of one or more computing devices 600 can jointly execute the instructions for executing the above-mentioned method for managing instances.
[0138] It should be noted that the memory 606 in different computing devices 600 in the computing device cluster can store different instructions, each for executing a portion of the functions of the aforementioned instance management platform. In other words, the instructions stored in the memory 606 in different computing devices 600 can implement the functions of one or more of the data monitoring module, the policy generation module, and the execution module.
[0139] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), among others. FIG. 8 illustrates a possible implementation. As shown in FIG. 8 , two computing devices 600A and 600B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 606 in the computing device 600A stores instructions for executing the functions of the monitoring module and the execution module. Simultaneously, the memory 606 in the computing device 600B stores instructions for executing the functions of the policy generation module.
[0140] The connection method between the computing device clusters shown in Figure 8 can be considered to be that the method model training of the management instance provided by this application requires a large amount of calculation, so it is considered to hand over the functions implemented by the policy generation module to the computing device 600B for execution.
[0141] It should be understood that the functionality of the computing device 600A shown in FIG8 may also be implemented by multiple computing devices 600. Similarly, the functionality of the computing device 600B may also be implemented by multiple computing devices 600.
[0142] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute the aforementioned method for managing instances.
[0143] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned method for managing instances.
[0144] An embodiment of the present application also provides a chip, which includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface to execute the above-mentioned method of managing instances.
[0145] Optionally, the chip includes a processor and a data interface, and the processor reads instructions stored in the memory through the data interface to execute the above-mentioned method of managing instances.
[0146] Optionally, the chip may further include a memory storing instructions, and the processor is configured to execute the instructions stored in the memory. When the instructions are executed, the processor is configured to execute the above-mentioned method for managing instances.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for managing an instance, characterized in that: include: The instance management platform monitors the instances running tasks in the scaling group to obtain resource utilization of the instances, where the resource utilization includes one or more of the following: CPU utilization, memory utilization; The instance management platform generates a historical task profile based on the resource utilization, where the historical task profile includes one or more of the following: a historical task timing feature and a historical task resource feature, where the historical task timing feature is used to indicate a characteristic of a historical task in terms of timing when the scaling group is running, and the historical task resource feature is used to indicate a resource type of the scaling group, where the resource type includes one or more of the following: computing intensive, memory intensive, input / output intensive, and graphics intensive; The instance management platform generates one or more scaling policies according to the historical task profile using a first model, where an input of the first model is the historical task profile, and an output of the first model is the one or more scaling policies; The instance management platform recommends the one or more scaling strategies to the user; The instance management platform determines the scaling strategy selected by the user; The instance management platform adjusts the number of instances or the specifications of the instances in the scaling group according to the scaling policy selected by the user.
2. The method according to claim 1, characterized in that The scaling strategy includes one or more of the following: a timed scaling strategy, an alarm scaling strategy, The using the first model to generate one or more scaling strategies according to the historical task profile includes: Determine one or more of the following parameters of the scheduled scaling strategy according to the historical task profile using the first model: scaling time, scheduled scaling semantics, and scheduled scaling scale; The first model is used to determine one or more of the following parameters of the alarm scaling strategy according to the historical task portrait: alarm indicator, alarm threshold, alarm scaling semantics, and alarm scaling scale.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: The instance management platform determines the remaining resources of the scaling group according to the number of instances and specifications of the instances; The instance management platform decides to suspend the task or schedule the task between scaling groups according to the resource type and the remaining resource amount of the scaling group.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: The instance management platform presents the historical task timing characteristics and the historical task resource characteristics to the user.
5. The method according to any one of claims 1 to 4, characterized in that The generating of the historical task portrait based on the resource utilization rate includes: Preprocessing the resource utilization to obtain processing data, wherein the preprocessing includes one or more of the following: normalization and vectorization; A second model is used to generate the historical task portrait according to the processed data, wherein the input of the second model is the processed data, and the output of the second model is the historical task portrait.
6. The method according to any one of claims 1 to 5, characterized in that The historical task time series characteristics include one or more of the following: average running time of historical tasks, peak time of historical task volume, valley time of historical task volume, and historical task execution cycle.
7. An instance management platform, characterized in that: include: A monitoring module is used to monitor the instances of running tasks in the scaling group to obtain resource utilization of the instances, where the resource utilization includes one or more of the following: CPU utilization and memory utilization; A policy generation module, configured to generate a historical task profile based on the resource utilization, wherein the historical task profile includes one or more of the following: a historical task timing feature and a historical task resource feature, wherein the historical task timing feature is used to indicate a characteristic of a historical task in terms of timing when the scaling group is running, and the historical task resource feature is used to indicate a resource type of the scaling group, wherein the resource type includes one or more of the following: computing intensive, memory intensive, input / output intensive, and graphics intensive; The strategy generation module is further used to generate one or more scaling strategies according to the historical task portrait using a first model, where the input of the first model is the historical task portrait, and the output of the first model is the one or more scaling strategies; An execution module, configured to recommend the one or more scaling strategies to a user; The execution module is also used to determine the scaling strategy selected by the user; The execution module is further configured to adjust the number of instances or specifications of instances in the scaling group according to the scaling policy selected by the user.
8. The instance management platform according to claim 7, characterized in that: The scaling strategy includes one or more of the following: a timed scaling strategy, an alarm scaling strategy, The strategy generation module is specifically used to determine one or more of the following parameters of the timed scaling strategy according to the historical task portrait using the first model: scaling time, timed scaling semantics, and timed scaling scale; The first model is used to determine one or more of the following parameters of the alarm scaling strategy according to the historical task portrait: alarm indicator, alarm threshold, alarm scaling semantics, and alarm scaling scale.
9. The instance management platform according to claim 7 or 8, characterized in that: The execution module is also used for: Determining the remaining resources of the scaling group according to the number of instances and specifications of the instances; It is determined according to the resource type and the remaining resource amount of the scaling group whether to suspend the task and wait, or to schedule the task between scaling groups.
10. The instance management platform according to any one of claims 7 to 9, characterized in that: The execution module is also used for: The historical task timing characteristics and the historical task resource characteristics are presented to the user.
11. The instance management platform according to any one of claims 7 to 10, characterized in that: The strategy generation module is specifically used for: Preprocessing the resource utilization to obtain processing data, wherein the preprocessing includes one or more of the following: normalization and vectorization; A second model is used to generate the historical task portrait according to the processed data, wherein the input of the second model is the processed data, and the output of the second model is the historical task portrait.
12. The instance management platform according to any one of claims 7 to 11, characterized in that: The historical task time series characteristics include one or more of the following: average running time of historical tasks, peak time of historical task volume, valley time of historical task volume, and historical task execution cycle.
13. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 6.
15. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
CVM instance adjusting method and device, cloud platform and server
CN109445911A
Elastic expansion and contraction method, device and equipment in multi-cloud environment and medium
CN113760516A
Operation management method for electric power system cloud simulation platform
WO2016101638A1
Scaling method for a service, and related device
WO2021197364A1
