Cluster resource scheduling method and device, electronic equipment, chip and medium
By determining the priority of service instances and dynamically adjusting, combined with the predicted allocation of resources of the transformed learning network, the problem of low resource utilization rate of cloud computing clusters is solved, and efficient utilization and optimized allocation of resources are achieved.
Patent Information
- Application Number
- CN202410984575.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-08
AI Technical Summary
In the prior art, cloud computing clusters have low resource utilization rates and fail to effectively consider the division and customized operation of service priorities, resulting in waste of resources and uneven load.
By determining the priority of service instances, dynamically adjusting priority based on activity, and using the transform learning network to predict resources, allocate native resources or idle resources, customizing operations for instances of different priority levels is achieved.
Maximize resource utilization, optimize resource allocation, ensure that high-priority services obtain sufficient resources, and at the same time, it rationally allocates idle resources, improving the efficiency and user experience of the system.
Smart Images

Figure CN118916163A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of cloud computing, and in particular to a cluster resource scheduling method, device, electronic device, chip and medium. Background Art
[0002] In the related technology, the digital signal processing (DSP) of the time series prediction algorithm is used to calculate the idle resources, oversell and limit the elastic resources, and when the node index exceeds the waterline, the corresponding Pod is restricted to analyze the cloud resources and optimize the cost. However, the related technology does not consider the division and customization of service priorities in the cluster, and there is a problem of low resource utilization. Summary of the invention
[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0004] The present disclosure provides a cluster resource scheduling method, device, electronic device, chip and medium to solve the problem of low resource utilization of the cluster. The method takes into account the existing instances and newly created side instances in the production environment, obtains and updates their priorities from the product side or deep learning algorithm, and customizes the operations of instances with different priorities. Users with high priority use the native resources of k8s, while users with low priority use oversold extended resources. The instance priority is changed in real time through monitoring to maximize resource utilization.
[0005] A first aspect of the present disclosure provides a cluster resource scheduling method, the method comprising:
[0006] Prioritize service instances;
[0007] Schedule service instances to the cluster based on priority and monitor the activity of service instances in the cluster;
[0008] Based on the activity, the priority is dynamically adjusted to the target priority, and the resource usage of the service instance is predicted according to the transformation learning network to obtain the prediction result. According to the prediction result and the target priority, the native resources or idle resources of the cluster are allocated to the service instance.
[0009] In one embodiment of the present disclosure, determining the priority of a service instance includes:
[0010] If the service instance is an existing service instance, the priority of the service instance is determined by at least one of the following three methods: the service instance interacts with the product database of the cluster to obtain customer information and obtains the priority from the customer information; obtains the priority from the name of the service instance; determines the priority by transforming the learning network;
[0011] If the service instance is a newly created service instance, the priority of the service instance is determined by at least one of the following three methods: obtaining the priority from a configuration file of the cluster; collecting customer information and obtaining the priority from the customer information; determining the priority by transforming a learning network.
[0012] In one embodiment of the present disclosure, monitoring the activity of a service instance in a cluster includes:
[0013] In the cluster, determine the Pod running the service instance through at least one of resource affiliation, active label, and namespace;
[0014] Monitor Pod status indicators, including CPU, memory, and network traffic;
[0015] Determine activity based on status indicators.
[0016] In one embodiment of the present disclosure, determining the priority by transforming the learning network includes:
[0017] Based on the historical resources used by the Pod of the service instance, the resource usage of the Pod of the service instance at the next time point is predicted through the transformation learning network;
[0018] Determine the activity of the service instance based on the resources used by the Pod of the service instance;
[0019] Determine priorities based on activity.
[0020] In one embodiment of the present disclosure, allocating native resources or idle resources of a cluster to a service instance according to the prediction result and the target priority includes:
[0021] If the target priority is the first priority, the access and restrictions of all Pods of the service instance are maintained, and the hardware resources of all Pods are exclusively occupied. Combined with the prediction results, all Pods of the service instance are deployed using native resources;
[0022] If the target priority is the second or third priority, the target priority is dynamically adjusted according to the activity of the service instance, and all Pods of the service instance are deployed using idle resources in combination with the prediction results;
[0023] If the target priority is the fourth priority, the resource requests and restrictions of all Pods of the service instance are removed, where the priorities of the first priority, the second priority, the third priority, and the fourth priority decrease in descending order.
[0024] In one embodiment of the present disclosure, dynamically adjusting the priority to a target priority based on the activity level includes:
[0025] If the activity is less than the first activity threshold and the priority is the second priority, the third priority is used as the target priority and the activity tag is updated;
[0026] If the activity is less than the second activity threshold and the priority of the service instance is the third priority, the fourth priority is used as the target priority;
[0027] If the priority of the service instance is the third priority and the activity is greater than or equal to the second activity threshold, the second priority is used as the target priority and the activity tag is updated.
[0028] In one embodiment of the present disclosure, predicting the resource usage of a service instance according to a transformation learning network to obtain a prediction result includes:
[0029] Based on Fourier transform and singular value decomposition, the global features of the status indicators of the Pod of the service instance in the time dimension are extracted through the feature extraction network. The nodes of adjacent convolutional layers of the feature extraction network are divided into at least two groups, each group includes the same number of nodes in the front convolutional layer and the back convolutional layer of the adjacent convolutional layer. The nodes of the adjacent convolutional layers are connected between different groups, and the time dimension features in the output of the adjacent convolutional layers are stacked using dilated convolutions.
[0030] The local features of the service instance are extracted through the feature extraction network, and based on the local features and global features, the linear layer is used to predict the usage resources of the service instance to obtain the prediction result.
[0031] A second aspect of the present disclosure provides a cluster resource scheduling device, the device comprising:
[0032] A determination module, used to determine the priority of a service instance;
[0033] The monitoring module is used to schedule service instances to the cluster according to their priorities and monitor the activity of service instances in the cluster.
[0034] The resource allocation module is used to dynamically adjust the priority to the target priority based on the activity, and predict the resource usage of the service instance according to the transformation learning network to obtain the prediction result. According to the prediction result and the target priority, the native resources or idle resources of the cluster are allocated to the service instance.
[0035] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the methods in the first aspect embodiment of the present disclosure.
[0036] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, characterized in that the computer instructions are used to enable a computer to execute the method in the first aspect embodiment of the present disclosure.
[0037] The fifth aspect embodiment of the present disclosure proposes a computer program product, characterized in that it includes a computer program, and when the computer program is executed by a processor, it implements any method in the first aspect embodiment of the present disclosure.
[0038] The cluster resource scheduling method provided by the present invention determines the priority of a service instance and provides an initial priority for cluster resource scheduling; according to the priority, the service instance is scheduled to the cluster, and the activity of the service instance in the cluster is monitored, and the activity of the service instance in the cluster is monitored; based on the activity, the priority is dynamically adjusted to the target priority, and the resource usage of the service instance is predicted according to the transformation learning network to obtain a prediction result, and according to the prediction result and the target priority, the native resources or idle resources of the cluster are allocated to the service instance, the service priority in the cluster is divided and customized, and the resource utilization of the cluster is improved.
[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0041] Figure 1 This is a flow chart of a cluster resource scheduling method according to an embodiment of the present disclosure;
[0042] Figure 2 A flowchart of determining the priority of a service instance according to an embodiment of the present disclosure;
[0043] Figure 3 A flowchart of monitoring the activity of a service instance in a cluster according to an embodiment of the present disclosure;
[0044] Figure 4 A flowchart of determining priorities by transforming a learning network according to an embodiment of the present disclosure;
[0045] Figure 5 A flowchart of an embodiment of the present disclosure for allocating native resources or idle resources of a cluster to a service instance according to a prediction result and a target priority;
[0046] Figure 6A flowchart of dynamically adjusting the priority to the target priority based on the activity level according to an embodiment of the present disclosure;
[0047] Figure 7 A flowchart of an embodiment of the present disclosure for predicting resource usage of a service instance according to a transformation learning network to obtain a prediction result;
[0048] Figure 8 A schematic diagram of a simplified sampling process in a TLNet according to an embodiment of the present disclosure;
[0049] Fig. 9 A schematic diagram of a simplified convolution mode in a TLNet according to an embodiment of the present disclosure;
[0050] Fig.10 A schematic diagram of a cluster resource scheduling method according to an embodiment of the present disclosure;
[0051] Fig.11 A schematic diagram of the structure of a cluster resource scheduling device according to an embodiment of the present disclosure;
[0052] Fig.12 It is a block diagram of an electronic device for implementing the cluster resource scheduling method disclosed in the present invention according to an exemplary embodiment. DETAILED DESCRIPTION
[0053] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout identify the same or similar originals or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0054] First, a brief introduction to the relevant terms in this disclosure is given:
[0055] Service instance: In the field of cloud computing, "service instance" is a widely used concept, which usually refers to an instantiation entity of a specific service or application deployed and running on a cloud platform. Specifically, when a user creates a service (such as database service, Web service, computing service, storage service, etc.) on a cloud platform, the cloud platform will allocate necessary resources (such as CPU, memory, storage space, network, etc.) to the service and start the corresponding software or application according to the configuration of the service. Such a running service unit is called a service instance, such as deployment, statefulset and other objects. The service instance in this disclosure is a deployment object.
[0056] k8s: In this disclosure, the full name is Kubernetes, which refers to a container orchestration and management platform that automates the deployment, expansion, and management of containerized applications. It supports the deployment of containerized applications across multiple host nodes and is one of the core technologies for cloud-native application deployment and management. Its functions include automated deployment, elastic scaling, and fault-tolerant processing. These functions can help enterprises achieve more efficient and reliable application deployment and management.
[0057] Pod: In this disclosure, it refers to the basic deployment unit of k8s, representing one or a group of closely related containers running in a k8s cluster, and managed by the Pod controller of the k8s cluster.
[0058] Node: In this disclosure, it refers to the working machine that actually performs computing tasks in the k8s cluster. It can be a physical server or a virtual machine, responsible for running containerized applications. Each node is managed by the k8s master node and executes the actual workload in the k8s cluster.
[0059] Transformation Learning Networks (TLNet): In this disclosure, it refers to a long-term time series prediction method, which is a lightweight LSTM prediction network based on "TLNets: Transformation Learning Networks for long-range time-series prediction".
[0060] The "East Data West Computing" project is a major digital infrastructure construction project aimed at promoting the development of the digital economy. In this context, the importance of intelligent computing power scheduling has been further highlighted. Intelligent computing power scheduling refers to the use of technologies such as artificial intelligence to intelligently schedule and manage computing resources to achieve optimal performance and maximum efficiency, thereby reducing costs and increasing efficiency. However, the current challenges are as follows:
[0061] 1. Low actual product utilization rate. Currently in the live network production environment, the difference between the resource utilization rate of many products and the actual resource utilization rate is huge, resulting in a waste of resources. At the same time, the uneven distribution between nodes will lead to uneven load and affect the user experience. Elastic resource overselling is a good solution. The difference between the service application value and the usage value is allocated to other products and services to improve resource utilization.
[0062] Second, customization is needed for customers with different priorities. Computing power is a very valuable resource. Currently, mobile cloud customers can be roughly divided into gold users, ordinary users, test users, etc. Different operations are customized for customers with different priorities, and computing power is dispatched to services with high priority and more needs, while ensuring the user experience and maximizing the utilization rate of the cluster.
[0063] 3. The running status of the Pod needs to be monitored in real time. The running status of the Pod can be monitored in real time through deep learning algorithms. Different products have different usage frequencies and operating rules. There may be a sudden increase in product traffic during a certain period of time. Therefore, how to better predict the status of the Pod and adjust its resources in real time is also a challenge.
[0064] For the above technical challenges, among the related technologies, for cluster resource management, Crane is used to analyze and optimize cloud resources. Its vision is to achieve the ultimate cost reduction under the premise of ensuring the quality of customer application operation. Its core functions include: using the time series prediction algorithm-DSP to calculate idle resources, overselling and limiting elastic resources, and when the Node indicator exceeds the waterline, the corresponding Pod will be restricted.
[0065] Crane-scheduler is a load-aware scheduling plugin. It relies on Prometheus and Node-exporter to collect and aggregate indicator data. It consists of two components: Node-annotator and Dynamic plugin. Node-annotator regularly pulls data from the resource detection tool Prometheus and marks them with timestamps on the nodes in the form of annotations; Dynamic plugin directly reads load data from the node's annotations, filters and scores candidate nodes based on a simple algorithm.
[0066] Crane does not consider the division and customization of service priorities. In order to improve resource utilization, resources need to be oversold. In the production environment, users with high priority use k8s' native resources, while users with low priority use oversold extended resources.
[0067] Crane performs real-time monitoring and restriction operations on a Pod basis, which will affect other Pods under the same product instance because the CPU, memory, and network traffic usage rates of different Pods are different.
[0068] In related technologies, deep learning-based models such as the Long Short Term Memory (LSTM) network and the Radial Basis Function (RBF) neural network are used to predict Pod resources. However, the models are too complex and will occupy a lot of computing and storage resources.
[0069] In summary, the relevant technologies do not consider the division and customization of service priorities in the cluster, and there is a problem of low resource utilization.
[0070] The method proposed in this disclosure is applied to cluster resource scheduling tasks. Compared with Crane, the technical advantages of this disclosure are as follows:
[0071] 1. Crane did not perform customized operations for customers with different priorities. The present disclosure obtains and updates their priorities from the product side or deep learning algorithm, customizes the operations of instances with different priorities, and changes instance priorities in real time through monitoring to maximize resource utilization;
[0072] 2. Crane operates in Pod units. To adapt to the production environment, this disclosure monitors and restricts service instances as units;
[0073] 3. The present invention is based on a lightweight time series prediction network, which optimizes the sampling and convolution processes while maintaining accuracy, and adjusts the system allocation resources and oversold idle resources in real time according to the prediction results, thereby reducing the computing and storage overhead to a greater extent.
[0074] The present disclosure has a rich set of scenarios and can be applied to cloud computing platforms. Public cloud, private cloud and hybrid cloud service providers can adopt this solution to optimize the allocation and management of their infrastructure resources, ensure that high-priority service instances (such as those involving financial transactions, real-time data analysis and other key businesses) obtain sufficient resource support, and reasonably allocate idle resources to low-priority or burst traffic services. It can also be applied to data center management. Large data centers often face problems of dynamic resource changes and demand fluctuations when hosting various applications, websites and online services. This technical solution helps to automatically adjust resource allocation and improve energy efficiency and response speed. It can also be applied to edge computing. In edge computing scenarios, resources are often more limited and widely distributed than in the cloud. This technology can help to quickly respond to proximal service needs and give priority to delay-sensitive business experiences, such as autonomous driving, IoT device management and real-time video stream processing. It can also be applied to scientific research computing and high-performance computing. When supercomputer centers of scientific research institutions and universities deal with large-scale simulations and data analysis, this solution can more effectively utilize computing resources and accelerate the progress of scientific research. It can also be applied to game servers, the online game industry, especially multiplayer online games and e-sports platforms, which have extremely high requirements for resource elasticity and low latency. This technology can help balance player experience and resource costs. It can also be applied to e-commerce platforms. During e-commerce promotions, such as Double Eleven and Black Friday, websites and applications will face huge access pressure. This technology can dynamically adjust resources in advance according to prediction results to ensure that the shopping experience is not affected. In short, this technical solution can be applied to any scenario that requires dynamic and efficient management of computing resources, especially in the face of uncertain demand changes and the need to ensure service quality and user experience. By predictively allocating resources, not only the efficiency of resource utilization is improved, but also the cost and business continuity are optimized. The application scenario is not limited in the disclosed embodiments.
[0075] The cluster resource scheduling method provided by the present disclosure is described in detail below with reference to the accompanying drawings.
[0076] Figure 1 Flow chart of a cluster resource scheduling method according to an embodiment of the present disclosure. The method is executed in a Pod controller in a k8s cluster. Figure 1 In the illustrated embodiment, the cluster resource scheduling method includes:
[0077] Step 101: Determine the priority of the service instance.
[0078] In this embodiment, the priority of a service instance refers to a relative level assigned to each service instance in a cluster such as a cloud platform or a distributed system based on factors such as the importance of the service, the urgency of the business demand, resource consumption, and the scope of influence. When starting to manage a service instance, the priority of the service instance is first determined as the initial priority to prepare for the order of scheduling to the cluster.
[0079] Step 102: Schedule the service instance to the cluster according to the priority, and monitor the activity of the service instance in the cluster.
[0080] In this embodiment, activity refers to the frequency of activity during the operation of a service instance within a specific time period, or a comprehensive reflection of its processing tasks, the number of requests, the amount of data interaction, resource usage and other indicators. It reflects the busyness of the service instance during actual operation and the occupation of system resources. The higher the activity, the higher the system resource occupation of the current service instance. Optionally, activity is evaluated by request processing volume, data throughput, resource utilization, response time and latency, concurrent processing capability and other aspects.
[0081] Step 103, based on the activity, dynamically adjust the priority to the target priority, and predict the resource usage of the service instance according to the transformation learning network to obtain a prediction result, and allocate the native resources or idle resources of the cluster to the service instance according to the prediction result and the target priority.
[0082] In this embodiment, the target priority refers to the priority adjusted to the service instance by the cluster after monitoring it. The prediction result refers to the predicted output of TLNet on the resource usage of the service instance at the next point in time. Native resources refer to the core resource types directly supported and managed by the k8s cluster itself, which allocate resources to the system. Idle resources refer to the difference between the allocated resources in the cluster and the resources actually used in this part of resources. Based on the activity monitored for the service instance, the priority is dynamically adjusted to the target priority, and TLNet is used to predict the resource usage of the service instance at the next point in time to obtain the prediction result. Based on the prediction result and the target priority, the native resources or idle resources of the cluster are allocated to the service instance.
[0083] In summary, according to the cluster resource scheduling method proposed in the present invention, the priority of the service instance is determined, and an initial priority is provided for cluster resource scheduling; according to the priority, the service instance is scheduled to the cluster, and the activity of the service instance in the cluster is monitored, and the activity of the service instance in the cluster is monitored; based on the activity, the priority is dynamically adjusted to the target priority, and the resource usage of the service instance is predicted according to the transformation learning network to obtain the prediction result, and according to the prediction result and the target priority, the native resources or idle resources of the cluster are allocated to the service instance, the service priority in the cluster is divided and customized, and the resource utilization of the cluster is improved.
[0084] Figure 2 The present invention is a flowchart for determining the priority of a service instance according to an embodiment of the present invention. Figure 2 Yes Figure 1 Further explanation of step 101 is based on Figure 2 The embodiment shown comprises the following steps:
[0085] Step 201, if the service instance is an existing service instance, the priority of the service instance is determined by at least one of the following three methods: the service instance interacts with the product database of the cluster to obtain customer information and obtains the priority from the customer information; obtains the priority from the name of the service instance; determines the priority by transforming the learning network.
[0086] In this embodiment, the existing service instance refers to the service instance that is already running in the cluster. If the service instance is an existing service instance, the priority of the service instance is determined by at least one of the following three methods: First, the data category and quantity generated by the interaction between the service instance and the product database of the cluster can reflect the customer information of the service instance, and the priority can be obtained based on the customer information. For example, if the customer is a gold user or an ordinary user, the service instance of the gold user can correspond to the first priority, and the service instance of the ordinary user corresponds to a priority lower than the first priority; the second is to obtain the priority from the name of the service instance. Optionally, the name of the field such as MySQL and Reddit is included in the naming of the service instance as a service instance with a higher priority. The third is to obtain the change of priority through the transformation learning network TLNet, and based on the original priority, the latest priority can be obtained.
[0087] Step 202, if the service instance is a newly created service instance, the priority of the service instance is determined by at least one of the following three methods: obtaining the priority from the configuration file of the cluster; collecting customer information and obtaining the priority from the customer information; determining the priority by transforming the learning network.
[0088] In this embodiment, the newly created service instance refers to the most recently created service instance in the cluster. If the service instance is a newly created service instance, the priority of the service instance is determined by at least one of the following three methods: First, the priority of the service instance is obtained from the configuration file of the cluster. On the product side, it can be obtained directly from the instance annotation annotation field of the yaml configuration file or the variable name name field of the instance through the plug-in; Second, customer information is counted. Optionally, customer information is counted through the custom type crd of k8s or the configuration configmap, and the priority is obtained from the customer information. For example, the priority of the service instance can be obtained through the key-value pair in the customer's crd. The third method is to obtain the change of priority through the transformation learning network TLNet, and obtain the latest priority based on the original priority. This method focuses on predicting when the service instance will use a large amount of resources through a deep learning algorithm in the later stage of resource scheduling of the service instance. The more resources are used, the higher the activity, and the higher the corresponding priority. There is a difference between the priorities before and after. Based on the difference and the priority before prediction, the latest priority can be obtained.
[0089] In this embodiment, the priorities of existing service instances or newly created service instances are directly or indirectly acquired in a variety of ways, providing initial priority data for adding service instances to a cluster for scheduling resources.
[0090] Figure 3 The present invention is a flowchart of an embodiment of monitoring the activity of a service instance in a cluster. Figure 3 Yes Figure 1 Further explanation of step 102 is based on Figure 3 The embodiment shown comprises the following steps:
[0091] Step 301: In a cluster, determine a Pod running a service instance through at least one of resource affiliation, active labels, and namespaces.
[0092] In this embodiment, after the service instance is added to the cluster according to the priority, the status of the service instance is monitored. Since a service instance contains multiple Pods, the computing resources, storage resources, and network resources of different Pods are different. For different Pods under a service instance, resource restriction operations will affect the operation of the service instance. In this embodiment, the Pod running the service instance is determined by three aspects: resource affiliation, active labels, and namespaces. Among them, the resource affiliation refers to the ownerReferences variable in k8s, which represents the affiliation between resources. For example, when ownerReferences is cascade deleted, when the root object is deleted, the k8s garbage collector will automatically delete the slave object. The active label refers to an identifier that indicates the activity of the service instance in the cluster. The affiliation of the Pod to the service instance is determined by the label and label selector, thereby determining the Pod of the service instance. The command space refers to the unit for business management in the server management product. For example, in the kafka product, all Pods of a service instance are under a namespace, so the namespace can be selected as the monitoring unit to obtain the Pod running the service instance.
[0093] Step 302, monitor the status indicators of the Pod, the status indicators include the central processing unit, memory and network traffic.
[0094] In this embodiment, according to the Pod of the service instance obtained in the above steps, the status indicators of the Pod are monitored, and the status indicators include the central processing unit, memory and network traffic.
[0095] Step 303: Determine the activity level according to the status indicator.
[0096] In this embodiment, the activity of the service instance is determined based on the monitoring of the status indicators of all Pods of the service instance. Optionally, the maximum values of the CPU usage, memory usage, and network traffic bandwidth are selected from the continuously recorded status indicators, and the activity of the service instance is comprehensively represented based on the three values. Optionally, the weighted sum of the three values is used as the activity.
[0097] In this embodiment, the real-time status monitoring is performed on the service instances added to the cluster, and the activity of the service instances in using resources is obtained, which provides timely reference data for the dynamic adjustment of the priority of the service instances in the cluster.
[0098] Figure 4 The present invention is a flowchart of determining priorities by transforming a learning network according to an embodiment of the present invention. Figure 4 Yes Figure 2The specific description of step 201 and step 202 is based on Figure 4 The embodiment shown comprises the following steps:
[0099] Step 401 : Based on the historical resources used by the Pod of the service instance, the resources used by the Pod of the service instance at the next time point are predicted by a transformation learning network.
[0100] In this embodiment, historical resources refer to the data of CPU usage, memory usage, and network traffic used by the Pod of the service instance in a period of time. Based on the historical resources used by the Pod of the service instance, the resource usage of the Pod of the service instance at the next time point is predicted through the transformation learning network.
[0101] Step 402, determining the activity of the service instance based on the usage resources of the Pod of the service instance.
[0102] In this embodiment, the resource usage of the Pod of the service instance before TLNet prediction and the resource usage of the Pod of the service instance after prediction are used. The resource usage change value of the service instance can be obtained. If the usage change value is larger, it means that the difference between the resources before and after is larger, indicating that the activity is higher. On the contrary, if the usage change value is smaller, it means that there is not much difference between the resources before and after, and the usage remains stable, indicating that the activity is low.
[0103] Step 403: Determine the priority based on the activity level.
[0104] In this embodiment, according to the activity of the service instance determined in the above steps, the priority of the service instance running in the cluster can be dynamically adjusted.
[0105] In this embodiment, TLNet is used to predict the usage resources of the Pod of the service instance in the future. By comparing the difference before and after the usage of resources, the activity of the service instance is obtained. According to the activity, the priority of the service instance is dynamically adjusted. Different resource allocation strategies will be adopted for different priorities, which is helpful to realize the customized operation of service priority.
[0106] Figure 5 This is a flowchart of an embodiment of the present disclosure for allocating native resources or idle resources of a cluster to a service instance according to prediction results and target priorities. Figure 5 Yes Figure 1 The specific description of step 103 is based on Figure 5 The embodiment shown comprises the following steps:
[0107] Step 501, if the target priority is the first priority, maintain access and restrictions to all Pods of the service instance, and monopolize the hardware resources of all Pods. Combined with the prediction results, all Pods of the service instance are deployed using native resources.
[0108] In this embodiment, if the target priority is the first priority, that is, the priority of the service instance is the highest priority, the access and restrictions of all Pods of the service instance are maintained, and the hardware resources of all Pods are monopolized. Combined with TLNet's prediction results of the resource usage of the service instance in the next period of time, all Pods of the service instance are deployed using native resources to complete the operation of the first priority service instance in the most efficient way.
[0109] Step 502: If the target priority is the second priority or the third priority, the target priority is dynamically adjusted according to the activity of the service instance, and all Pods of the service instance are deployed using idle resources in combination with the prediction results.
[0110] In this embodiment, if the target priority is the second priority or the third priority, the target priority is dynamically adjusted according to the activity of the service instance. Based on the adjusted final target priority and TLNet's prediction results on the resource usage of the service instance in the next period of time, all Pods of the service instance are deployed using idle resources to ensure that the medium-priority service instance can operate normally.
[0111] Step 503: If the target priority is the fourth priority, the resource requests and restrictions of all Pods of the service instance are removed, wherein the priorities of the first priority, the second priority, the third priority, and the fourth priority are decreased in descending order.
[0112] In this embodiment, if the target priority is the fourth priority, that is, the current priority of the service instance is the lowest, for resource allocation in the cluster, if resource cleanup is required, the resources used by all Pods of the fourth priority service instance will be released first. That is, the resource requests and restrictions of all Pods of the service instance are removed. Among them, for the first priority, the second priority, the third priority and the fourth priority in all the above embodiments, their priorities are in descending order.
[0113] In this embodiment, the native resources or idle resources of the cluster are allocated to the service instances based on the prediction results and target priority, thereby implementing customized operations of service instances with different priorities. Service instances with high priority use the native resources of k8s, while service instances with low priority use oversold idle resources. The priority of the service instances is changed in real time through monitoring, thereby maximizing resource utilization.
[0114] Figure 6The present invention is a flowchart of dynamically adjusting the priority to the target priority based on the activity level according to an embodiment of the present invention. Figure 6 Yes Figure 1 The specific description of step 103 is based on Figure 6 The embodiment shown comprises the following steps:
[0115] Step 601: If the activity level is less than the first activity threshold and the priority is the second priority, the third priority is used as the target priority, and the activity tag is updated.
[0116] In this embodiment, the first activity threshold is a value used to measure the situation of low activity. If the activity of the service instance is less than the first activity threshold, and the priority of the service instance is the second priority, it means that the activity of the service instance in the cluster is low, and the priority of the service instance needs to be downgraded, and the original second priority of the service instance is reduced to the third priority. The third priority is used as the target priority, and the active label is updated to identify the current activity.
[0117] Step 602: If the activity is less than the second activity threshold and the priority of the service instance is the third priority, the fourth priority is used as the target priority.
[0118] In this embodiment, the second activity threshold is a value used to measure the situation where the activity is very low. If the activity of the service instance is less than the second activity threshold, and the priority of the service instance is the third priority, it means that the activity of the service instance in the cluster is very low, and the priority of the service instance needs to be downgraded, and the original third priority of the service instance is reduced to the fourth priority. The fourth priority is used as the target priority of the service instance.
[0119] Step 603: If the priority of the service instance is the third priority and the activity is greater than or equal to the second activity threshold, the second priority is used as the target priority and the activity tag is updated.
[0120] In this embodiment, if the activity of the service instance is greater than or about the second activity threshold, and the priority of the service instance is the third priority, it means that the service instance has a high activity in the cluster, and the priority of the service instance needs to be upgraded. The original third priority of the service is increased to the second priority, and the second priority is used as the target priority. At the same time, the active label is updated to identify the current activity.
[0121] In this embodiment, based on the activity of the service instance, the priority is dynamically adjusted to the target priority, thereby realizing dynamic adjustment of the priority of the service instance in the cluster and providing dynamic allocation of the required priority for the resources required by all Pods of the service instance in the cluster.
[0122] Figure 7 The present invention is a flowchart of an embodiment of the present invention for predicting resource usage of a service instance according to a transformation learning network to obtain a prediction result. Figure 7 Yes Figure 1 The specific description of step 103 is based on Figure 7 The embodiment shown comprises the following steps:
[0123] Step 701, based on Fourier transform and singular value decomposition, extract the global features of the status indicators of the Pod of the service instance in the time dimension through the feature extraction network, wherein the nodes of adjacent convolutional layers of the feature extraction network are divided into at least two groups, each group includes the same number of nodes as the front convolutional layer and the rear convolutional layer of the adjacent convolutional layer, the nodes of the adjacent convolutional layers are connected between different groups, and the time dimension features in the outputs of the adjacent convolutional layers are stacked using dilated convolutions.
[0124] In this embodiment, in the feature extraction network of TLNet, the global features of the status indicators of the Pod of the service instance in the time dimension are extracted based on Fourier transform and singular value decomposition. The nodes of two adjacent convolutional layers of the feature extraction network are divided into at least two groups, each group includes the same number of nodes in the previous convolutional layer and the next convolutional layer of the adjacent convolutional layer. The nodes of adjacent convolutional layers are connected between different groups, and the time dimension features in the output of adjacent convolutional layers are stacked using dilated convolutions.
[0125] Step 702: extract local features of the service instance through a feature extraction network, and predict the used resources of the service instance using a linear layer based on the local features and global features to obtain a prediction result.
[0126] In this embodiment, the convolutional block in the feature extraction network is used to extract the local features of the status indicators of the Pod of the service instance. Based on the global features and local features extracted by the feature extraction network, the linear layer is used to predict the used resources of the service instance, and the status indicators of the Pod of the service instance in the next period of time are obtained. The status indicators can be used to reflect the resources that the service instance needs to use, that is, the prediction results.
[0127] In one implementation of this embodiment,
[0128] Figure 8 FIG. 1 is a schematic diagram of a simplified sampling process in a TLNet according to an embodiment of the present disclosure. Figure 8As shown in the figure, TLNet extracts aggregate features (sum) from two dimensions, time and space. The sum of the features extracted from each block can obtain a feature tensor of N*P*D, where N represents the number of time series, P represents the length of each time series, and D represents the number of features extracted from each time step. The time dimension P is retained for subsequent spatial feature extraction. If the time features extracted by each block can be compressed, the computational overhead of aggregation and output will be greatly reduced, and the dimension of its feature tensor can be changed to N*D. At the same time, for the service instances running in the cluster, the more distant time information is not very important for the prediction of the current moment. For example, the running status half a year ago has little effect on the current instance. The rightmost fragment (corresponding to the last time step) of each block output is extracted and summarized as the input for subsequent calculations. This is a more efficient way to aggregate features, which greatly reduces the input size of subsequent spatial operations. At the same time, the dilated convolution is used to stack the last time step features of each block, thereby retaining the information from the most recent input time steps in different ranges, and this does not cause the loss of information in the previous time steps of the input.
[0129] In one implementation of this embodiment,
[0130] Fig. 9 FIG. 4 is a simplified schematic diagram of a convolution mode in a TLNet of an embodiment of the present disclosure. Fig. 9 As shown, in the connection of traditional convolutional layers, the front and back convolutional layers are densely connected and have a lot of parameters; in group convolution, adjacent convolutional layers are grouped, and the previous convolutional layer and the corresponding next convolutional layer of adjacent convolutional layers belonging to the same group are connected by internal nodes. Although the number of parameters is reduced, only the features within the group are retained, and the feature transfer between groups is missing. The hybrid convolution used in the TLNet disclosed in the present invention can realize feature transfer within the group and between groups, while reducing the number of connections between layers, enhancing the grouping strategy in a simple and effective way, realizing communication between groups without increasing the complexity of the model, reducing the number of connections between layers, and improving computational efficiency without sacrificing progress.
[0131] In this embodiment, based on TLNet, the sampling and convolution processes are optimized while maintaining accuracy, and the system allocation of native resources or idle resources is adjusted in real time according to the prediction results, thereby reducing the computing and storage overhead to a greater extent and reducing the cost of cluster resource allocation.
[0132] Fig.10 FIG. 1 is a flow chart of a cluster resource scheduling method according to an embodiment of the present disclosure. Fig.10As shown, the cluster service includes existing stock services and newly created services. The priority of the stock service can be obtained by interacting with the database to obtain user information, or by directly obtaining the priority through the name of the service instance. For the stock service, determine whether the stock service is a service used by a gold user or an active user. If so, assign the first priority (higher) to the stock service; otherwise, assign the second priority (high) to the stock service. The priority of the newly created service can be obtained by directly obtaining the priority from the annotation (annotation) or name (name) of the service instance, or by obtaining the priority through a custom resource definition (crd) object or a configuration configmap file. For the newly created service, determine whether the Pod priority of the service is successfully read. If the reading fails, assign the second priority to the newly created service; if the reading succeeds, obtain the Pod priority of the service. Based on the priority of the stock service or the newly created service, a priority judgment is performed to determine which of the first priority, the second priority, the third priority (middle) and the fourth priority (low), wherein the first priority is higher than the second priority, the second priority is higher than the third priority, and the third priority is higher than the fourth priority. Priority judgment can be made in the following two ways: 1. Modify the spec field when sending resources through webhook. 2. Or modify it in the subcluster through the Application Programming Interface (API) server. If the priority of the existing service or the newly created service is the first priority, then maintain the access (request), limit (limit), exclusive CPU, and load balancing of the service instance. If the priority of the existing service or the newly created service is the second priority, then monitor the instance status and judge the activity of the instance. If the instance is continuously active, then use extended resources to deploy the service instance. If the instance is not active, then downgrade the priority of the instance to the third priority and modify the active label. If the priority of the existing service or the newly created service is the third priority, then monitor the status of the service instance and judge its activity. If the instance is not active, then downgrade the priority of the instance to the fourth priority, and the instance needs to be restarted to take effect as the fourth priority. If the instance is active, then increase the priority to the second priority, modify the active label, and use extended resources to deploy the instance. If the priority of an existing service or a newly created service is the fourth priority, the service instance will monitor the instance status in real time, remove the instance's access and restrictions, and continuously detect the instance status. Among all service instances of all priorities, the fourth priority service instance will be shut down first.
[0133] The present invention proposes a cluster resource scheduling method, which determines the priority of a service instance and provides an initial priority for cluster resource scheduling; according to the priority, the service instance is scheduled to the cluster, and the activity of the service instance in the cluster is monitored, and the activity of the service instance in the cluster is monitored; based on the activity, the priority is dynamically adjusted to a target priority, and the resource usage of the service instance is predicted according to a transformation learning network to obtain a prediction result, and according to the prediction result and the target priority, the native resources or idle resources of the cluster are allocated to the service instance, the service priority in the cluster is divided and customized, and the resource utilization of the cluster is improved.
[0134] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides a cluster resource scheduling device. Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.
[0135] Fig.11 FIG. 1 is a schematic diagram of the structure of a cluster resource scheduling device 1100 according to an embodiment of the present disclosure. Fig.11 As shown, the cluster resource scheduling device includes:
[0136] A determination module 1110, configured to determine a priority of a service instance;
[0137] A monitoring module 1120, for scheduling service instances into a cluster according to priorities and monitoring the activity of the service instances in the cluster;
[0138] The resource allocation module 1130 is used to dynamically adjust the priority to the target priority based on the activity, and predict the resource usage of the service instance according to the transformation learning network to obtain the prediction result, and allocate the native resources or idle resources of the cluster to the service instance according to the prediction result and the target priority.
[0139] In some embodiments, the determination module 1110 is configured to:
[0140] If the service instance is an existing service instance, the priority of the service instance is determined by at least one of the following three methods: the service instance interacts with the product database of the cluster to obtain customer information and obtains the priority from the customer information; obtains the priority from the name of the service instance; determines the priority by transforming the learning network;
[0141] If the service instance is a newly created service instance, the priority of the service instance is determined by at least one of the following three methods: obtaining the priority from a configuration file of the cluster; collecting customer information and obtaining the priority from the customer information; determining the priority by transforming a learning network.
[0142] In some embodiments, the monitoring module 1120 is used to:
[0143] In the cluster, determine the Pod running the service instance through at least one of resource affiliation, active label, and namespace;
[0144] Monitor Pod status indicators, including CPU, memory, and network traffic;
[0145] Determine activity based on status indicators.
[0146] In some embodiments, the determination module 1110 determines the priority by transforming the learning network in the following manner:
[0147] Based on the historical resources used by the Pod of the service instance, the resource usage of the Pod of the service instance at the next time point is predicted through the transformation learning network;
[0148] Determine the activity of the service instance based on the resources used by the Pod of the service instance;
[0149] Determine priorities based on activity.
[0150] In some embodiments, the resource allocation module 1130 allocates native resources or idle resources of the cluster to the service instance according to the prediction result and the target priority in the following manner:
[0151] If the target priority is the first priority, the access and restrictions of all Pods of the service instance are maintained, and the hardware resources of all Pods are exclusively occupied. Combined with the prediction results, all Pods of the service instance are deployed using native resources;
[0152] If the target priority is the second or third priority, the target priority is dynamically adjusted according to the activity of the service instance, and all Pods of the service instance are deployed using idle resources in combination with the prediction results;
[0153] If the target priority is the fourth priority, the resource requests and restrictions of all Pods of the service instance are removed, where the priorities of the first priority, the second priority, the third priority, and the fourth priority decrease in descending order.
[0154] In some embodiments, the resource allocation module 1130 dynamically adjusts the priority to the target priority based on the activity in the following manner:
[0155] If the activity is less than the first activity threshold and the priority is the second priority, the third priority is used as the target priority and the activity tag is updated;
[0156] If the activity is less than the second activity threshold and the priority of the service instance is the third priority, the fourth priority is used as the target priority;
[0157] If the priority of the service instance is the third priority and the activity is greater than or equal to the second activity threshold, the second priority is used as the target priority and the activity tag is updated.
[0158] In some embodiments, the resource allocation module 1130 predicts the resource usage of the service instance according to the transformation learning network in the following manner to obtain a prediction result:
[0159] Based on Fourier transform and singular value decomposition, the global features of the status indicators of the Pod of the service instance in the time dimension are extracted through the feature extraction network. The nodes of adjacent convolutional layers of the feature extraction network are divided into at least two groups, each group includes the same number of nodes in the front convolutional layer and the back convolutional layer of the adjacent convolutional layer. The nodes of the adjacent convolutional layers are connected between different groups, and the time dimension features in the output of the adjacent convolutional layers are stacked using dilated convolutions.
[0160] The local features of the service instance are extracted through the feature extraction network, and based on the local features and global features, the linear layer is used to predict the usage resources of the service instance to obtain the prediction result.
[0161] In summary, the priority of the service instance is determined through the cluster resource scheduling device; according to the priority, the service instance is scheduled to the cluster, and the activity of the service instance in the cluster is monitored; based on the activity, the priority is dynamically adjusted to the target priority, and the resource usage of the service instance is predicted according to the transformation learning network to obtain the prediction result, and the native resources or idle resources of the cluster are allocated to the service instance according to the prediction result and the target priority. This device solves the problem of low resource utilization of the cluster and improves the resource utilization of the cluster.
[0162] In the above embodiments provided by the present disclosure, the methods and devices provided by the embodiments of the present disclosure are introduced. In order to implement the functions in the methods provided by the above embodiments of the present disclosure, the electronic device may include a hardware structure and a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. One of the above functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.
[0163] Fig.12 It is a block diagram of an electronic device 1200 for implementing the above cluster resource scheduling method according to an exemplary embodiment.
[0164] For example, the electronic device 1200 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0165] Reference Fig.12, the electronic device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output (I / O) interface 1212 , a sensor component 1214 , and a communication component 1216 .
[0166] The processing component 1202 generally controls the overall operation of the electronic device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1202 may include one or more modules to facilitate the interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate the interaction between the multimedia component 1208 and the processing component 1202.
[0167] The memory 1204 is configured to store various types of data to support operations on the electronic device 1200. Examples of such data include instructions for any application or method operating on the electronic device 1200, contact data, phone book data, messages, pictures, videos, etc. The memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0168] The power supply component 1206 provides power to the various components of the electronic device 1200. The power supply component 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1200.
[0169] The multimedia component 1208 includes a screen that provides an output interface between the electronic device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the electronic device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0170] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the electronic device 1200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1204 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.
[0171] I / O interface 1212 provides an interface between processing component 1202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0172] The sensor assembly 1214 includes one or more sensors for providing various aspects of status assessment for the electronic device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the electronic device 1200, the relative positioning of components, such as the display and keypad of the electronic device 1200, and the sensor assembly 1214 can also detect the position change of the electronic device 1200 or a component of the electronic device 1200, the presence or absence of user contact with the electronic device 1200, the orientation or acceleration / deceleration of the electronic device 1200, and the temperature change of the electronic device 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1214 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0173] The communication component 1216 is configured to facilitate wired or wireless communication between the electronic device 1200 and other devices. The electronic device 1200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0174] In an exemplary embodiment, the electronic device 1200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0175] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1204 including instructions, and the instructions can be executed by the processor 1220 of the electronic device 1200 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0176] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the cluster resource scheduling method described in the above embodiments of the present disclosure.
[0177] An embodiment of the present disclosure further provides a computer program product, including a computer program, which executes the cluster resource scheduling method described in the above embodiment of the present disclosure when a processor executes the computer program.
[0178] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0179] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0180] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
[0181] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0182] It should be understood that the various parts of the embodiments of the present disclosure can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0183] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0184] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0185] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.
Claims
1. A cluster resource scheduling method, characterized in that: The method comprises: Prioritize service instances; Scheduling the service instance into a cluster according to the priority, and monitoring the activity of the service instance in the cluster; Based on the activity, the priority is dynamically adjusted to the target priority, and the resource usage of the service instance is predicted according to the transformation learning network to obtain a prediction result, and the native resources or idle resources of the cluster are allocated to the service instance according to the prediction result and the target priority.
2. The method according to claim 1, characterized in that: Determining the priority of the service instance includes: If the service instance is an existing service instance, the priority of the service instance is determined by at least one of the following three methods: the service instance interacts with the product database of the cluster to obtain customer information, and obtains the priority from the customer information; obtains the priority from the name of the service instance; determines the priority through the transformation learning network; If the service instance is a newly created service instance, the priority of the service instance is determined by at least one of the following three methods: obtaining the priority from a configuration file of the cluster; counting the customer information and obtaining the priority from the customer information; determining the priority through the transformation learning network.
3. The method according to claim 1, characterized in that The monitoring the activity of the service instance in the cluster includes: In the cluster, determining a Pod running the service instance by at least one of a resource affiliation, an active label, and a namespace; Monitor the status indicators of the Pod, including the CPU, memory, and network traffic; The activity level is determined according to the status indicator.
4. The method according to claim 2, characterized in that: The determining the priority by the transformation learning network comprises: Based on the historical resources used by the Pod of the service instance, predicting the used resources of the Pod of the service instance at the next time point through the transformation learning network; Determine the activity of the service instance according to the usage resources of the Pod of the service instance; Based on the activity level, the priority is determined.
5. The method according to claim 4, characterized in that The allocating the native resources or idle resources of the cluster to the service instance according to the prediction result and the target priority includes: If the target priority is the first priority, the access and restrictions of all Pods of the service instance are maintained, and the hardware resources of all Pods are exclusively occupied. In combination with the prediction result, all Pods of the service instance are deployed using the native resources. If the target priority is the second priority or the third priority, dynamically adjust the target priority according to the activity of the service instance, and use the idle resources to deploy all Pods of the service instance in combination with the prediction result; If the target priority is the fourth priority, the resource requests and restrictions of all Pods of the service instance are removed, wherein the priorities of the first priority, the second priority, the third priority and the fourth priority decrease in descending order.
6. The method according to claim 5, characterized in that The dynamically adjusting the priority to a target priority based on the activity level includes: If the activity level is less than a first activity threshold and the priority is the second priority, taking the third priority as the target priority and updating the activity tag; If the activity level is less than a second activity threshold and the priority of the service instance is the third priority, taking the fourth priority as the target priority; If the priority of the service instance is the third priority and the activity is greater than or equal to the second activity threshold, the second priority is used as the target priority and the activity tag is updated.
7. The method according to claim 5, characterized in that The predicting the resource usage of the service instance according to the transformation learning network to obtain the prediction result includes: Based on Fourier transform and singular value decomposition, the global features of the status indicators of the Pod of the service instance in the time dimension are extracted through a feature extraction network, wherein the nodes of adjacent convolutional layers of the feature extraction network are divided into at least two groups, each group includes the same number of nodes as the front convolutional layer and the rear convolutional layer of the adjacent convolutional layer, the nodes of the adjacent convolutional layers are connected between different groups, and the time dimension features in the output of the adjacent convolutional layers are stacked using dilated convolutions; The local features of the service instance are extracted through the feature extraction network, and based on the local features and the global features, the linear layer is used to predict the used resources of the service instance to obtain the prediction result.
8. A cluster resource scheduling device, characterized in that: The device comprises: A determination module, used to determine the priority of a service instance; A monitoring module, configured to schedule the service instance to a cluster according to the priority and monitor the activity of the service instance in the cluster; A resource allocation module is used to dynamically adjust the priority to a target priority based on the activity, and predict the resource usage of the service instance according to a transformation learning network to obtain a prediction result, and allocate native resources or idle resources of the cluster to the service instance according to the prediction result and the target priority.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
11. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Cited By
Cloud computing technology-based instance management method and related apparatus
WO2026145086A1
