Microservice scheduling method and device based on cost awareness and storage medium
Through the cost-aware microservice scheduling method, the selection and distribution of computing power resources are optimized, and the problems of low efficiency and high usage cost in the existing technology are solved, and more efficient and economical computing power resources are achieved.
Patent Information
- Application Number
- CN202311099708.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-29
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, the acquisition method of computing power resources is manual ordering, which is complex in the acquisition process and difficult in operation, resulting in low efficiency and high cost in the use of computing power resources.
A cost-aware microservice scheduling method is provided. By obtaining cluster data, microservice information data and microservice historical data, the cluster object list and microservice object are determined, and the deployment and request distribution of microservice objects are carried out based on the cost calculation and scheduling probability list, realizing the optimal selection and scheduling of computing power resources.
By optimizing the selection and distribution of computing power resources, the efficiency of computing power resources is improved, the cost of use is reduced, and the problems of low efficiency and high cost of use of computing power resources in the existing technology are solved.
Smart Images

Figure CN119536964A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to Internet technologies, and in particular to a cost-aware microservice scheduling method, device, and storage medium. Background Art
[0002] With the development of the information society, computing power resources have become the core resource for technological development. The construction of computing power infrastructure and intelligent scheduling of computing power that serve the development of computing power resources have become a direction with application prospects. The scheduling and use of computing power resources are based on the computing power network, and the acquisition of computing power resources is achieved through manual ordering.
[0003] In the prior art, the computing power network is implemented by obtaining the computing, storage and network resource information of the service nodes through a centralized or distributed network control plane, and realizing the optimal allocation of computing power resources; the computing power resources are obtained by selecting a cloud operator based on demand, selecting the products and services provided by the operator that meet one's own needs, selecting the resource area according to business requirements and filling in the resource parameters, and finally completing the ordering of computing power resources.
[0004] Since the method of obtaining computing power resources in the prior art is manual ordering, the acquisition process is complicated and difficult to operate, and the setting of ordering parameters for computing power resources depends on user experience, and there is a lack of standardized acquisition process; and with the complexity of application scenarios, the demand for scheduling and use of computing power resources in the computing power network increases, the flexibility of resource scheduling decreases, and the operation and maintenance cost of the computing power network increases accordingly; therefore, there are technical problems in the prior art that the use efficiency of computing power resources is low and the cost of computing power resources is high. Summary of the invention
[0005] The present application provides a cost-aware microservice scheduling method, device and storage medium to solve the technical problems of low computing resource utilization efficiency and high computing resource utilization cost existing in the prior art.
[0006] In a first aspect, the present application provides a cost-aware microservice scheduling method, the method comprising:
[0007] Obtain cluster data, microservice information data and microservice historical data, and determine the cluster object list based on the cluster data and cluster model, and determine the microservice object based on the microservice information data and microservice deployment model;
[0008] Perform cost calculation based on the preprocessed cluster object list, determine a second cluster object list, deploy microservice objects based on the second cluster object list and determine a deployment strategy;
[0009] In response to the microservice request, obtain microservice request information, and determine the microservice request object based on the microservice request information and the microservice request model;
[0010] Determine a second cluster object list bound to the microservice based on the microservice request object;
[0011] Cost calculation is performed based on the preprocessed second cluster object list, a cluster scheduling probability list is determined, and microservice request objects are distributed based on the scheduling probability list.
[0012] Optionally, performing cost calculation based on the preprocessed cluster object list, determining a second cluster object list, and deploying microservice objects based on the second cluster object list and determining a deployment strategy include:
[0013] Determine a first cluster object list from the cluster object list based on the first preset condition, perform cost calculation based on the microservice object and the first cluster object list, and obtain a second cluster object list;
[0014] The microservice object is bound to the cluster in the second cluster object list based on the second cluster object column, and is determined as a deployment strategy, and the microservice object is deployed to the cluster.
[0015] Optionally, determining the first cluster list from the cluster object list based on the first preset condition includes:
[0016] Based on the microservice object, determine the total computing resource demand and storage resource demand of the microservice object;
[0017] Traverse the cluster object list to determine whether the total computing power resource demand and storage resource demand are lower than the total computing power resource and storage resource demand of the cluster; if so,
[0018] Then determine whether the maximum delay limit between the cluster and the platform set by the microservice object's microservice is greater than the delay between the cluster and the hybrid cloud integrated scheduling platform of the cluster; if so,
[0019] Then determine the resource requirements of a single copy of the microservice based on the microservice object, determine the node resources of the cluster based on the cluster, and judge whether the node resources meet the resource requirements of a single copy of the microservice; if so,
[0020] Then add the cluster to the first cluster object list;
[0021] Among them, the cluster object list is a list of clusters that includes cluster resource information and network information, the microservice object includes the network information and resource information of the microservice requirements, and the microservice request object includes the microservice information corresponding to the microservice request and the network information and resource information required by the microservice request.
[0022] Optionally, performing cost calculation based on the microservice object and the first cluster object list and obtaining the second cluster object list includes:
[0023] determining cluster pricing data based on the cluster data;
[0024] Determine a list of cluster pricing objects based on pricing data and a cluster pricing model;
[0025] Determine the microservice deployment cost corresponding to each cluster in the first cluster object list based on the cluster pricing list and the microservice objects;
[0026] Sort the clusters in the first cluster object list in ascending order based on the microservice deployment cost;
[0027] The number of clusters that need to be deployed for the microservice is obtained based on the microservice object, and the second cluster object list is obtained from the first cluster object list in an incremental manner based on the number of clusters that need to be deployed for the microservice.
[0028] Optionally, binding the microservice object to a cluster in the second cluster object list based on the second cluster object list, determining it as a deployment strategy, and deploying the microservice object to the cluster includes:
[0029] Traverse the second cluster object list, bind the microservice object to the cluster in the second cluster object list, and determine the deployment strategy for the microservice object;
[0030] The cluster resource status in the second cluster object list is updated, and the microservice objects and the deployment strategies of the microservice objects are recorded in the microservice history data and stored in the database.
[0031] Optionally, cost calculation is performed based on the preprocessed second cluster object list, a cluster scheduling probability list is determined, and microservice request objects are distributed based on the scheduling probability list, including:
[0032] Acquire a third cluster object list based on the second preset condition and the second cluster object list;
[0033] Performing cost calculation on the third cluster object list based on the microservice request object, and determining a scheduling probability list corresponding to the third cluster object list;
[0034] Distribute and process microservice request objects based on the scheduling probability list.
[0035] Optionally, acquiring a third cluster object list based on the second preset condition and the second cluster object list includes:
[0036] Obtain the latency limit and network bandwidth required for the request based on the microservice request object;
[0037] Traverse the second cluster object list, and add the cluster to the third cluster object list when the delay limit required by the request is greater than the delay between the cluster and the hybrid cloud integrated scheduling platform and the network bandwidth required by the request is less than the total public network export bandwidth of the cluster.
[0038] Optionally, performing cost calculation on the third cluster object list based on the microservice request object to determine a scheduling probability list corresponding to the third cluster object list includes:
[0039] Based on the microservice request object, determine the cluster request scheduling cost corresponding to the cluster in the third cluster object list, and obtain the cluster request scheduling cost vector corresponding to the third cluster object list; based on the microservice request object, calculate the load of the cluster in the third cluster object list, and obtain the cluster request scheduling load vector corresponding to the third cluster object list;
[0040] The cost vector and the load vector are weighted to obtain a scheduling probability list corresponding to the third cluster object list.
[0041] Optionally, the distribution processing of the microservice request object is performed based on the scheduling probability list, including:
[0042] The scheduling probability of the microservice request corresponding to each cluster in the third cluster object list is determined based on the scheduling probability list, and the microservice request is distributed and scheduled based on the probability.
[0043] Optionally, after obtaining cluster data, microservice information data and microservice historical data, determining a cluster object list based on the cluster data and the cluster model, and determining a microservice object based on the microservice information data and the microservice deployment model, the method further includes:
[0044] Filter based on microservice historical data to determine whether the microservice object is recorded in the microservice historical data. If so, determine the deployment strategy corresponding to the microservice object based on the microservice historical data, and deploy the microservice object based on the deployment strategy.
[0045] In a second aspect, the present application provides a cost-aware microservice scheduling device, including:
[0046] The first acquisition module is used to acquire cluster data, microservice information data and microservice historical data, and determine a cluster object list based on the cluster data and the cluster model, and determine a microservice object based on the microservice information data and the microservice deployment model;
[0047] A first processing module is used to perform cost calculation based on the preprocessed cluster object list, determine a second cluster object list, deploy microservice objects based on the second cluster object list, and determine a deployment strategy;
[0048] A second acquisition module is used to respond to the microservice request, acquire microservice request information, and determine the microservice request object based on the microservice request information and the microservice request model;
[0049] A determination module, configured to determine a second cluster object list bound to the microservice based on the microservice request object;
[0050] The second processing module is used to perform cost calculation based on the preprocessed second cluster object list, determine the cluster scheduling probability list, and distribute the microservice request objects based on the scheduling probability list.
[0051] Optionally, the device is also used to:
[0052] Determine a first cluster object list from the cluster object list based on the first preset condition, perform cost calculation based on the microservice object and the first cluster object list, and obtain a second cluster object list;
[0053] The microservice object is bound to the cluster in the second cluster object list based on the second cluster object column, and is determined as a deployment strategy, and the microservice object is deployed to the cluster.
[0054] Optionally, the device is also used to:
[0055] Based on the microservice object, determine the total computing resource demand and storage resource demand of the microservice object;
[0056] Traverse the cluster object list to determine whether the total computing power resource demand and storage resource demand are lower than the total computing power resource and storage resource demand of the cluster; if so,
[0057] Then determine whether the maximum delay limit between the cluster and the platform set by the microservice object's microservice is greater than the delay between the cluster and the hybrid cloud integrated scheduling platform of the cluster; if so,
[0058] Then determine the resource requirements of a single copy of the microservice based on the microservice object, determine the node resources of the cluster based on the cluster, and judge whether the node resources meet the resource requirements of a single copy of the microservice; if so,
[0059] Then add the cluster to the first cluster object list;
[0060] Among them, the cluster object list is a list of clusters that includes cluster resource information and network information, the microservice object includes the network information and resource information of the microservice requirements, and the microservice request object includes the microservice information corresponding to the microservice request and the network information and resource information required by the microservice request.
[0061] Optionally, the device is also used to:
[0062] determining cluster pricing data based on the cluster data;
[0063] Determine a list of cluster pricing objects based on pricing data and a cluster pricing model;
[0064] Determine the microservice deployment cost corresponding to each cluster in the first cluster object list based on the cluster pricing list and the microservice objects;
[0065] Sort the clusters in the first cluster object list in ascending order based on the microservice deployment cost;
[0066] The number of clusters that need to be deployed for the microservice is obtained based on the microservice object, and the second cluster object list is obtained from the first cluster object list in an incremental manner based on the number of clusters that need to be deployed for the microservice.
[0067] Optionally, the device is also used to:
[0068] Traverse the second cluster object list, bind the microservice object to the cluster in the second cluster object list, and determine the deployment strategy for the microservice object;
[0069] The cluster resource status in the second cluster object list is updated, and the microservice objects and the deployment strategies of the microservice objects are recorded in the microservice history data and stored in the database.
[0070] Optionally, the device is also used to:
[0071] Acquire a third cluster object list based on the second preset condition and the second cluster object list;
[0072] Performing cost calculation on the third cluster object list based on the microservice request object, and determining a scheduling probability list corresponding to the third cluster object list;
[0073] Distribute and process microservice request objects based on the scheduling probability list.
[0074] Optionally, the device is also used to:
[0075] Obtain the latency limit and network bandwidth required for the request based on the microservice request object;
[0076] Traverse the second cluster object list, and add the cluster to the third cluster object list when the delay limit required by the request is greater than the delay between the cluster and the hybrid cloud integrated scheduling platform and the network bandwidth required by the request is less than the total public network export bandwidth of the cluster.
[0077] Optionally, the device is also used to:
[0078] Based on the microservice request object, determine the cluster request scheduling cost corresponding to the cluster in the third cluster object list, and obtain the cluster request scheduling cost vector corresponding to the third cluster object list; based on the microservice request object, calculate the load of the cluster in the third cluster object list, and obtain the cluster request scheduling load vector corresponding to the third cluster object list;
[0079] The cost vector and the load vector are weighted to obtain a scheduling probability list corresponding to the third cluster object list.
[0080] Optionally, the device is also used to:
[0081] The scheduling probability of the microservice request corresponding to each cluster in the third cluster object list is determined based on the scheduling probability list, and the microservice request is distributed and scheduled based on the probability.
[0082] Optionally, the device is also used to:
[0083] Filter based on microservice historical data to determine whether the microservice object is recorded in the microservice historical data. If so, determine the deployment strategy corresponding to the microservice object based on the microservice historical data, and deploy the microservice object based on the deployment strategy.
[0084] A third aspect of the present application provides a cost-aware microservice scheduling device, including:
[0085] Processor and memory;
[0086] Memory stores computer-executable instructions;
[0087] The processor executes the computer-executable instructions stored in the memory, so that the cost-aware microservice scheduling device performs any one of the cost-aware microservice scheduling methods in the first aspect.
[0088] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement a cost-aware microservice scheduling method as described in any one of the first aspects.
[0089] The cost-aware microservice scheduling method, device and storage medium provided in the present application include: obtaining cluster data, microservice information data and microservice historical data, and determining a cluster object list based on the cluster data and the cluster model, and determining a microservice object based on the microservice information data and the microservice deployment model; performing cost calculation based on the preprocessed cluster object list, determining a second cluster object list, deploying microservice objects based on the second cluster object list and determining a deployment strategy; obtaining microservice request information in response to a microservice request, and determining a microservice request object based on the microservice request information and the microservice request model; determining a second cluster object list bound to the microservice based on the microservice request object; performing cost calculation based on the preprocessed second cluster object list, determining a cluster scheduling probability list, and distributing microservice request objects based on the scheduling probability list; thereby By comparison, the cluster queue that meets the resource requirements of the microservice is determined, and the microservice deployment cost is calculated for each cluster in the cluster queue, the computing resource cost and network resource cost required for the deployment of the microservice in the cluster are obtained, and the clusters are sorted according to the cluster cost. The cluster with the lowest cost is selected from the sorted cluster queue according to the deployment requirements of the microservice, and the microservice is deployed in the selected cluster, thereby optimizing the selection of computing resources; when using computing resources, the cluster corresponding to the request is determined by obtaining the information of the microservice request, and then the cost of distributing the request to each cluster and the load after distribution are calculated. The cluster to which the request can finally be distributed is determined by minimizing the cost and the load, thereby realizing the scheduling of microservice requests and realizing the request scheduling with the optimal cost and load; the technical effect of improving the utilization efficiency of computing resources and reducing the cost of computing resources is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0091] Figure 1 The process of the cost-aware microservice scheduling method provided in the embodiment of the present application Figure 1 ;
[0092] Figure 2 The process of the cost-aware microservice scheduling method provided in the embodiment of the present application Figure 2 ;
[0093] Figure 3 Cost-aware scheduling algorithm application process provided in this application embodiment Figure 1 ;
[0094] Figure 4The process of the cost-aware microservice scheduling method provided in the embodiment of the present application Figure 3 ;
[0095] Figure 5 A flowchart of the microservice request scheduling algorithm application provided in the embodiment of the present application;
[0096] Figure 6 A flow chart of the application of the cluster screening algorithm provided in the embodiment of the present application;
[0097] Figure 7 Cost-aware scheduling algorithm application process provided in this application embodiment Figure 2 ;
[0098] Figure 8 A flow chart of a cluster resource status update algorithm provided in an embodiment of the present application;
[0099] Fig. 9 A flow chart of a request scheduling algorithm based on cost and load perception provided in an embodiment of the present application;
[0100] Fig.10 A schematic diagram of the structure of a cost-aware microservice scheduling device provided in an embodiment of the present application;
[0101] Fig.11 A hardware structure diagram of a cost-aware microservice scheduling device provided in an embodiment of the present application.
[0102] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0103] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0104] In the prior art, users obtain computing resources by selecting a cloud operator based on their needs, selecting products and services provided by the operator that meet their needs, selecting a resource area and filling in resource parameters according to business requirements, and finally completing the ordering of computing resources; the implementation method of the computing network that schedules and uses computing resources is to obtain the computing, storage and network resource information of the service nodes through a centralized or distributed network control plane, and realize the optimal allocation of computing resources; among them, the manual ordering of computing resources has a complex acquisition process and high operation difficulty, and the setting of the ordering parameters of computing resources depends on the user's experience, and lacks a standardized acquisition process; and with the complexity of application scenarios, the scheduling and use of computing resources in the computing network has increased, and the existing computing network implementation methods cannot fully meet the flexible scheduling requirements of computing resources, the flexibility of resource scheduling is reduced, and the operation and maintenance costs of the computing network are correspondingly increased; therefore, there are technical problems in the prior art of low efficiency and high cost of computing resources.
[0105] The cost-aware microservice scheduling method, device and storage medium provided in the present application include: obtaining cluster data, microservice information data and microservice historical data, and determining a cluster object list based on the cluster data and the cluster model, and determining a microservice object based on the microservice information data and the microservice deployment model; performing cost calculation based on the preprocessed cluster object list, determining a second cluster object list, deploying microservice objects based on the second cluster object list and determining a deployment strategy; obtaining microservice request information in response to a microservice request, and determining a microservice request object based on the microservice request information and the microservice request model; determining a second cluster object list bound to the microservice based on the microservice request object; performing cost calculation based on the preprocessed second cluster object list, determining a cluster scheduling probability list, and distributing microservice request objects based on the scheduling probability list; thereby The information is compared to determine the cluster queue that meets the microservice resource requirements, and the microservice deployment cost is calculated for each cluster in the cluster queue to obtain the computing resource cost and network resource cost required for the microservice to be deployed in the cluster, and the clusters are sorted according to the cluster cost. The cluster with the lowest cost is selected from the sorted cluster queue according to the deployment requirements of the microservice, and the microservice is deployed in the selected cluster, thereby optimizing the selection of computing resources. When using computing resources, the cluster corresponding to the request is determined by obtaining the information of the microservice request, and then the cost of distributing the request to each cluster and the load after distribution are calculated. The cluster to which the request can be finally distributed is determined by minimizing the cost and the load, thereby realizing the scheduling of microservice requests and optimizing the request scheduling with optimal cost and load. The technical problems of low efficiency and high cost of computing resources are solved.
[0106] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0107] Figure 1 The process of the cost-aware microservice scheduling method provided in the embodiment of the present application Figure 1 .
[0108] like Figure 1 As shown, the method includes:
[0109] S101, obtaining cluster data, microservice information data and microservice historical data, and determining a cluster object list based on the cluster data and the cluster model, and determining a microservice object based on the microservice information data and the microservice deployment model;
[0110] In this embodiment, the microservice deployment model includes the microservice's replica information, cluster requirement information, computing power resource requirement information, network resource requirement information, and storage resource requirement information; the cluster model includes cluster computing power resource information, cluster storage resource information, cluster network resource information, and cluster workload node information.
[0111] S102: Perform cost calculation based on the preprocessed cluster object list, determine a second cluster object list, deploy microservice objects based on the second cluster object list, and determine a deployment strategy;
[0112] In this embodiment, preprocessing the cluster object list includes: comparing the resource requirement information of the microservice object with the resource information of each cluster in the cluster object list, and adding the cluster that meets the resource requirement of the microservice object to the processed cluster object list.
[0113] In this embodiment, the cost calculation of the cluster object list includes: calculating the deployment cost required when the microservice object is deployed to each cluster in the cluster object list, and determining the cluster with the lowest deployment cost based on the deployment cost and the microservice object's demand for the number of deployment clusters, and determining it as the second cluster object list; wherein, after determining the second cluster object list, the microservice object is deployed to the cluster in the second cluster object list, and the deployment behavior of the microservice object, the deployed cluster, and the information of the service object are determined as the deployment strategy.
[0114] S103, in response to the microservice request, obtaining microservice request information, and determining a microservice request object based on the microservice request information and a microservice request model;
[0115] In this embodiment, the microservice request model includes the name of the microservice corresponding to the microservice request and the network resources required by the microservice request.
[0116] S104: Determine a second cluster object list bound to the microservice based on the microservice request object;
[0117] In this embodiment, the microservice request object can be searched by the name of the microservice in the microservice request object, and the information of the cluster where the microservice is deployed is determined, and the deployed cluster is determined as the second season group object list.
[0118] S105: Perform cost calculation based on the preprocessed second cluster object list, determine a cluster scheduling probability list, and distribute microservice request objects based on the scheduling probability list.
[0119] The cost-aware microservice scheduling method provided by the present application includes: obtaining cluster data, microservice information data and microservice historical data, and determining a cluster object list based on the cluster data and the cluster model, and determining a microservice object based on the microservice information data and the microservice deployment model; performing cost calculation based on the preprocessed cluster object list, determining a second cluster object list, and deploying microservice objects based on the second cluster object list and determining a deployment strategy; obtaining microservice request information in response to a microservice request, and determining a microservice request object based on the microservice request information and the microservice request model; determining a second cluster object list bound to the microservice based on the microservice request object; performing cost calculation based on the preprocessed second cluster object list, determining a cluster scheduling probability list, and distributing the microservice request object based on the scheduling probability list; thereby performing cost calculation on the cluster resource information and the resource information required by the microservice. By comparison, the cluster queue that meets the microservice resource requirements is determined, and the microservice deployment cost is calculated for each cluster in the cluster queue, the computing resource cost and network resource cost required for the microservice to be deployed in the cluster are obtained, and the clusters are sorted according to the cluster cost. The cluster with the lowest cost is selected from the sorted cluster queue according to the deployment requirements of the microservice, and the microservice is deployed in the selected cluster, thereby optimizing the selection of computing resources. When using computing resources, the cluster corresponding to the request is determined by obtaining the information of the microservice request, and then the cost of distributing the request to each cluster and the load after distribution are calculated. The cluster to which the request can finally be distributed is determined by minimizing the cost and the load, thereby realizing the scheduling of microservice requests and realizing the request scheduling with the optimal cost and load. The technical problems of low efficiency and high cost of computing resources are solved.
[0120] Figure 2 The process of the cost-aware microservice scheduling method provided in the embodiment of the present application Figure 2 , Figure 3 Cost-aware scheduling algorithm application process provided in this application embodiment Figure 1 .like Figure 2 and Figure 3 As shown, the method includes:
[0121] S201, obtaining cluster data, microservice information data and microservice historical data, and determining a cluster object list based on the cluster data and the cluster model, and determining a microservice object based on the microservice information data and the microservice deployment model;
[0122] In this embodiment, the microservice deployment model is represented by a 6-tuple:
[0123] s={s nm , n clt , n pod , r cpt , r bs , r fs , t dly , v bw , v flw}
[0124] in, Indicates the name of the microservice s, Indicates the number of clusters that microservices need to deploy, Indicates the number of microservice replicas that should be deployed in a single cluster. Represents the computing resources required by a single microservice replica, A block storage resource representing a single replica requirement, A file storage resource representing a single copy requirement, Indicates the maximum latency limit imposed by the microservice on the cluster to the platform. represents the bandwidth resources required by a single replica, Indicates the network traffic that a single replica is expected to generate per hour.
[0125] The cluster model is expressed as:
[0126]
[0127] The cluster model consists of a collection of workload nodes within the cluster. is the total amount of cluster computing resources, is the total amount of cluster block storage resources, is the total amount of cluster file storage resources, where file storage resources are storage resources that can be shared by all workload nodes in the cluster. is the latency between the cluster and the hybrid cloud integrated scheduling platform. The bandwidth capacity of the cluster's public network egress.
[0128] Workload Nodes The resource model is:
[0129] w j = {r cpt , r bs}
[0130] in is the computing resource bound to node j, and the block storage resource is the storage resource bound to a single workload node. Indicates w j The block storage resources bound to it.
[0131] Workload Nodes The pricing model is modeled as follows:
[0132]
[0133] in For node w j Computing resource costs, is the lease period of computing resources, The cost per GB of block storage per hour.
[0134] S202: Screening based on the microservice historical data to determine whether the microservice object is recorded in the microservice historical data. If so, determining the deployment strategy corresponding to the microservice object based on the microservice historical data, and deploying the microservice object based on the deployment strategy;
[0135] S203, based on the microservice object, determine the total computing power resource demand and the total storage resource demand of the microservice object; traverse the cluster object list to determine whether the total computing power resource demand and the total storage resource demand are lower than the total computing power resource and the total storage resource of the cluster; if so, determine whether the microservice of the microservice object's microservice's maximum delay from the cluster to the platform is greater than the delay from the cluster of the cluster to the hybrid cloud integrated scheduling platform;
[0136] In this embodiment, the microservice deployment cluster selects variable x k is the optimization variable, where It shows that microservices are deployed in cluster k, and the problem model is established with the optimization goal of minimizing the comprehensive deployment cost of microservices (7).
[0137]
[0138] stC1:
[0139] C2:
[0140]
[0141]
[0142]
[0143]
[0144]
[0145] C3:
[0146]
[0147]
[0148]
[0149] C4:
[0150] Constraint C1 indicates that the optimization variable is a 0-1 variable. Constraint C2 indicates that if the microservice is deployed in cluster k, the sum of the computing power, block storage, file storage, and network bandwidth resource requirements of all copies of the microservice is less than the corresponding resource volume of cluster k, and the microservice's limit on latency is greater than the latency from the cluster to the platform. (i) It refers to the i-th replica of microservice S, where the resource requirements of each replica are consistent.
[0151] S204: If yes, determine the resource requirements of a single copy of the microservice based on the microservice object, determine the node resources of the cluster based on the cluster, and judge whether the node resources meet the resource requirements of a single copy of the microservice; if yes, add the cluster to the first cluster object list;
[0152] In this embodiment, the resource requirement for the replica corresponds to constraint C3, indicating that if the microservice is deployed in cluster k, then for any replica s (i) , there is a node w in the cluster j , so that the node resources meet the single replica resource requirements. The replica is finally bound to the node. Constraint C3 avoids the situation where the total cluster resources are sufficient but no node meets the requirements.
[0153] S205, determining cluster pricing data based on cluster data; determining a cluster pricing object list based on the pricing data and the cluster pricing model; determining a microservice deployment cost corresponding to each cluster in the first cluster object list based on the cluster pricing list and the microservice object;
[0154] In this embodiment, cluster c k The pricing model is:
[0155]
[0156] in is the average computing resource cost of workload nodes in the cluster, is the average cost per GB of block storage resources in the cluster, The average cost per GB of file storage resources in the cluster; Indicates the cluster network resource billing mode. Indicates payment by bandwidth. Indicates a fixed bandwidth fee per Mbps; Indicates that payment is based on traffic. Indicates the traffic fee per GB.
[0157] Cluster c k The pricing model parameters can be calculated by the following formula:
[0158]
[0159]
[0160]
[0161] The f(x1, x2) function is defined as follows:
[0162]
[0163] In formulas (1)-(2), the computing power cost and storage cost of the nodes in the cluster are averaged, and the units are summarized as RMB / hour and RMB / GB / hour.
[0164] Among them, formula (1) represents the sum of the cost of computing resources of workload nodes in the cluster divided by the lease period of computing resources, and then divides it by the number of workload nodes in the cluster, so as to calculate the average computing resource cost of workload nodes in the cluster; formula (2) represents the calculation of the average cost of block storage resources of each node in the cluster, and then sums and divides it by the number of nodes in the cluster, so as to obtain the average cost per GB of block storage resources in the cluster; formula (3) represents the calculation of the per GB traffic fee in the cluster based on different billing methods.
[0165] Microservices deployed to cluster c k The comprehensive deployment cost calculation formula is as follows:
[0166]
[0167] The specific calculation of the comprehensive deployment cost formula (5) includes: computing power cost Storage costs and network costs Calculate the cost of a single microservice replica and multiply by the number of microservice replicas And get the cost of deploying microservices to the cluster.
[0168] S206. Sort the clusters in the first cluster object list in ascending order based on the microservice deployment cost; obtain the number of clusters that need to be deployed for the microservice based on the microservice object, and obtain the second cluster object list from the first cluster object list in ascending order based on the number of clusters that need to be deployed for the microservice;
[0169] In this embodiment, the restriction on the number of clusters corresponds to constraint C4 in problem model (7), in which the number of deployed clusters is restricted, and the number of deployed clusters needs to meet the number of clusters required by microservice s.
[0170] S207, traverse the second cluster object list, bind the microservice object to the cluster in the second cluster object list, and determine the deployment strategy of the microservice object; update the cluster resource status in the second cluster object list, record the microservice object and the deployment strategy of the microservice object in the microservice history data, and store it in the database.
[0171] By executing S201 to S207, a cluster list that meets the microservice deployment requirements can be determined based on the microservice information and cluster information, and the microservice deployment cost can be calculated in the cluster list. Based on the result of the cost calculation, the cluster information on which the microservice can be deployed is obtained, and the microservice deployment is implemented; thereby achieving the technical effect of improving the efficiency and accuracy of computing resource acquisition when deploying microservices.
[0172] Figure 4 The process of the cost-aware microservice scheduling method provided in the embodiment of the present application Figure 3 , Figure 5 This is a flowchart of the microservice request scheduling algorithm application provided in the embodiment of this application. Figure 4 and Figure 5 As shown, the method includes:
[0173] S401, in response to a microservice request, obtaining microservice request information, and determining a microservice request object based on the microservice request information and a microservice request model;
[0174] In this embodiment, the microservice request model is represented by a 4-tuple:
[0175] q={s nm , t dly , v bw , v flw}
[0176] in Indicates the name of the microservice requested by the microservice request. This name uniquely identifies a deployed microservice. It means the delay limit, bandwidth and public network traffic per hour required for a single request.
[0177] S402: Determine a second cluster object list bound to the microservice based on the microservice request object;
[0178] In this embodiment, the name of the microservice corresponding to the request is determined based on the microservice request object. Information on the cluster where the microservice is deployed is queried from the database according to the name of the microservice, and the cluster information is determined as a second cluster object list.
[0179] In this embodiment, in the distribution scheduling process of request q, the platform firstly calculates the request model according to the Parameter search for schedulable clusters in Deployed microservices A collection of clusters.
[0180] S403, obtaining the delay limit required for the request and the network bandwidth required for the request based on the microservice request object;
[0181] In this embodiment, the microservice request q is distributed to the cluster The scheduling probability To optimize the variables, the problem model (10) is established to minimize the weighted sum of the request dispatch scheduling cost and the load variance as the optimization target. In order to reduce the algorithm effect deviation problem caused by the different numerical dimensions of multiple optimization targets, this paper uses the linear normalization method shown in formula (8) to normalize some parameters.
[0182]
[0183] use Represents a cluster The target microservice for request q deployed in The number of copies of Represents all microservices deployed in the cluster A vector of the number of replicas.
[0184]
[0185] The number of replicas reflects the load capacity of the cluster for the same request. In formula (9), z k Divided by the normalized number of replicas, the probability z k After being dispatched to cluster k, the microservices deployed in the cluster The actual load status.
[0186]
[0187] stC1:
[0188] C2: If or but
[0189]
[0190] C3:
[0191] In the optimization objective of problem model (10), the variance value of the load state after scheduling is used to characterize the load balancing situation. Indicates that microservices are deployed The cluster request scheduling cost vector of α b , α p are weighting factors for request scheduling cost and load variance, respectively. Constraint C1 indicates that the optimization variable domain is [0,1]. Constraint C3 indicates that the sum of scheduling probabilities is 1.
[0192] S404, traversing the second cluster object list, and when the delay limit required by the request is greater than the delay between the cluster and the hybrid cloud integrated scheduling platform of the cluster and the network bandwidth required by the request is less than the total public network export bandwidth of the cluster, adding the cluster to the third cluster object list;
[0193] In this embodiment, the delay limit and network bandwidth limit correspond to constraint C2, which means that if the delay limit of request q is less than the delay Or the bandwidth demand of request q is greater than the remaining bandwidth of the cluster Then the scheduling probability is 0.
[0194] In this embodiment, the deployed microservices are selected based on the request model q and constraint C2. A collection of clusters That is, the third cluster object list.
[0195] S405. Based on the microservice request object, determine the cluster request scheduling cost corresponding to the cluster in the third cluster object list, and obtain the cluster request scheduling cost vector corresponding to the third cluster object list; based on the microservice request object, calculate the load of the cluster in the third cluster object list, and obtain the cluster request scheduling load vector corresponding to the third cluster object list; perform weighted processing on the cost vector and the load vector to obtain a scheduling probability list corresponding to the third cluster object list;
[0196] In this embodiment, since computing power and storage costs have been considered in the microservice deployment stage, and network costs are costs that are strongly related to request q, the cost of distributing microservice requests to cluster k only considers network costs, and its calculation formula is as follows:
[0197]
[0198] In this embodiment, a model is established based on the problem model (10) to solve the quadratic programming (QP) problem, or a calculation graph is constructed and the BP neural network algorithm is used to solve the variables. The specific solution is: use formula (6) to calculate the cost of deploying request q to each cluster, and use the linear normalization formula (8) to calculate the cost vector corresponding to the cost of each cluster; dispatch the request to cluster c k The probability z in k Multiply the cost vector by the load vector, and sum the results of all clusters; calculate the load of each cluster after the scheduling request is made by formula (9), sum the loads of all clusters and take the average, calculate the load variance of each cluster, sum the load variance of each cluster and take the average, so as to obtain the load state of a certain cluster; calculate the probability of scheduling to the cluster by finding the minimum value of the load and the cost, and finally obtain the scheduling probability of each cluster in the third cluster object list, that is, the scheduling probability list.
[0199] S406: Determine the scheduling probability of the microservice request corresponding to each cluster in the third cluster object list based on the scheduling probability list, and perform distribution scheduling processing on the microservice request based on the probability;
[0200] In this embodiment, the scheduling of microservices is based on probability Select the target scheduling cluster for request q.
[0201] By executing S401 to S406, it is possible to calculate the load and cost of scheduling microservice requests to each cluster, and calculate the probability of scheduling to each cluster based on cost minimization and load minimization, thereby scheduling microservice requests based on probability, achieving the technical effect of improving the utilization of computing resources.
[0202] Figure 6 The cluster screening algorithm application flow chart provided in the embodiment of the present application is as follows: Figure 7 Cost-aware scheduling algorithm application process provided in this application embodiment Figure 2 , Figure 8 The following is a flow chart of the cluster resource status update algorithm provided in the embodiment of the present application. Figures 6 to 8 As shown, including:
[0203] Cluster screening includes: inputting a cluster object list and a microservice object, traversing the cluster object list, determining whether the total resources of the cluster meet all the replicas of the microservice, and if so, deeply copying the cluster working node list, and traversing the replicas of the microservice to determine whether the working nodes in the cluster meet the requirements of the replicas of the microservice, and if so, updating the information of the cluster working nodes; if all the microservice replicas are traversed, determining whether all the replicas of the microservice have deployable nodes in the cluster, and if so, adding the cluster to the candidate cluster list; if all the clusters are traversed, outputting a candidate cluster list that meets the microservice requirements, that is, the first cluster object list in this application; wherein the working node is represented as a worker and the microservice replica is represented as a pod.
[0204] The cost-aware scheduling algorithm includes: inputting a cluster object list, a candidate cluster name, and a microservice object; initializing a dictionary of cluster name and microservice deployment cost key-value pairs: result = {cluster_name: price}; traversing the cluster object list according to the candidate cluster name to determine the microservice type, where the microservice type includes: CPU\GPU\FPGA demand type; the cluster deployment cost of the microservice price = CPU\GPU\FPGA type node average cost + microservice block storage resources * cluster block storage resource unit price + microservice required file storage resources * cluster file storage unit price; determining whether the billing method of the set network resources is B andwidth, if yes, the network cost is determined to be the public network bandwidth required by the microservice * the unit price of the public network bandwidth at the cluster export; if not, the network cost is determined to be the traffic required by the microservice per hour * the unit price of the public network traffic at the cluster export; if the cluster traversal is completed, the result dictionary is sorted from low to high according to the price. If the elements in the result dictionary are less than the number of deployment clusters n required by the microservice, a warning is output: only len(result) clusters can meet the demand, where len is used to calculate the number of elements in result; if it is greater than n, the first n results with the lowest price are output, where Bandwidth is the broadband billing method.
[0205] The deployment cost of microservices consists of computing power cost + storage cost + network cost. Microservices are divided into CPU-demand type, GPU-demand type and FPGA-demand type. The working nodes in the cluster are also divided into CPU-demand type, GPU-demand type and FPGA-demand type.
[0206] Computing cost: The CPU node cost in the computing cost is: sum up all (CPU node cost / CPU node cost ordering time) in the cluster and then take the average, the cost unit is RMB / hour. The GPU node cost in the computing cost is: sum up all (GPU node cost / GPU node cost ordering time) in the cluster and then take the average, the cost unit is RMB / hour. The FPGA node cost in the computing cost is: sum up all (FPGA node cost / FPGA node cost ordering time) in the cluster and then take the average, the cost unit is RMB / hour.
[0207] Storage cost: The block storage cost is: sum up all (cloud disk price / cloud disk capacity / cloud disk subscription time) under the cluster and then take the average. The cost unit is RMB / GB hour.
[0208] There are two cases for file storage: First, if the file storage resource is built on the block storage resource in the cluster, the file storage cost is the same as the block storage cost per room. Second, if the file storage resource is provided by the subscribed cloud provider, the file storage cost is the cost directly given by the cloud provider.
[0209] Network cost: Nodes in the cluster access the public network or are accessed from the public network through the cluster's load balancing server or NAT network. Cluster network resources are mainly divided into fixed bandwidth billing and flow billing. If the cluster network resources are billed by flow, the network cost unit is RMB / GB / hour; if the cluster network resources are billed by fixed bandwidth, the network cost unit is RMB / Mbps / hour.
[0210] The cluster resource status update algorithm includes: inputting a cluster object list, a scheduling result dictionary, and a microservice object; traversing the cluster according to the cluster name in the scheduling result, and if the traversal is not completed, judging the type of microservice and determining the type of microservice; using the total computing power and storage resources of the cluster - the number of microservice replicas * the computing power and storage resources required for a single microservice replica; judging the network billing method of the cluster, and calculating the remaining export bandwidth of the cluster based on the billing method. If the billing method is Bandwidth, the remaining export bandwidth of the cluster = cluster export loan - the number of microservice replicas * the public network export bandwidth required for a single microservice; if the cluster adopts traffic billing, traversing the microservice replicas to obtain the working node in the cluster that meets the needs of a single microservice replica; assuming that the microservice is deployed on the working node, calculating the computing power and storage resources of the working node - the computing power and storage resources required for a single microservice replica, until all replicas and all clusters are traversed.
[0211] Fig. 9 The flowchart of the request scheduling algorithm based on cost and load perception provided in the embodiment of the present application is as follows. Fig. 9As shown, it includes: inputting microservice request information and cluster object list; constructing a microservice request object according to the microservice request information and the microservice request model; traversing the cluster where the microservice corresponding to the microservice request is deployed, and calculating the cluster scheduling cost according to the microservice request object; if the traversal is completed, the cluster scheduling weight factor based on the network cost is obtained by memorizing the normalization method; the scheduling weight factor based on the load capacity is obtained by normalizing according to the number of replicas deployed in each cluster; the comprehensive weight factor is obtained based on the network cost and the scheduling weight factor based on the load capacity; the cluster comprehensive weight factor is used as the scheduling, and the application corresponding to the microservice request is scheduled based on probability.
[0212] The cost-aware microservice scheduling method provided in the present application includes: obtaining cluster data, microservice information data and microservice historical data, and determining a cluster object list based on the cluster data and the cluster model, and determining the microservice object based on the microservice information data and the microservice deployment model; and comparing the resource requirements of the microservice object with the resource requirements of the cluster, obtaining a cluster list that meets the resource requirements of the microservice object and determining a first cluster object list; performing cost calculation based on the first cluster object list, and determining a second cluster object list; deploying microservice objects based on the second cluster object list and determining a deployment strategy; in response to a microservice request, obtaining microservice request information, and determining a microservice request object based on the microservice request information and the microservice request model; determining the corresponding microservice based on the microservice request object, and determining a second cluster object list bound to the microservice based on the query; performing cost calculation and cluster load calculation based on the preprocessed second cluster object list, determining a cluster scheduling probability list based on the calculation results, and determining a scheduling probability list based on the scheduling probability. The microservice request objects are distributed according to the list; thus, by obtaining cluster resource information, the clusters that meet the microservice resource requirements are judged, and the clusters that meet the requirements are determined as the cluster list to achieve preliminary screening of clusters; the selected clusters are deployed for cost calculation, and the cost of deploying microservices to each cluster is calculated, so as to sort them according to the results of cost calculation, and obtain the cluster with the lowest cost as the cluster to be deployed for the microservice; the final cluster list is determined based on the deployment requirements of the microservice, and the microservice is deployed by updating the cluster resources; in the microservice request stage, the deployed clusters are obtained according to the information of the microservice, and the cost of deploying the microservice to the cluster and the load of the cluster are used as optimization targets, and the probability of final scheduling to each cluster is obtained through probability calculation, and the cluster that the request finally needs to be scheduled is selected based on the probability list, so as to achieve the optimal scheduling of microservice requests, improve the utilization rate of cluster resources, and maintain the stable operation of the cluster; it solves the technical problems of low efficiency and high cost of computing power resources.
[0213] Fig.10The schematic diagram of the structure of a cost-aware microservice scheduling device provided in an embodiment of the present application. The device of this embodiment can be in the form of software and / or hardware. Fig.10 As shown, a cost-aware microservice scheduling device 1000 provided in an embodiment of the present application includes: a first acquisition module 1001, a first processing module 1002, a second acquisition module 1003, a determination module 1004, and a second processing module 1005.
[0214] The first acquisition module 1001 is used to acquire cluster data, microservice information data and microservice historical data, and determine a cluster object list based on the cluster data and the cluster model, and determine a microservice object based on the microservice information data and the microservice deployment model;
[0215] The first processing module 1002 is used to perform cost calculation based on the preprocessed cluster object list, determine a second cluster object list, deploy microservice objects based on the second cluster object list, and determine a deployment strategy;
[0216] The second acquisition module 1003 is used to respond to the microservice request, obtain microservice request information, and determine the microservice request object based on the microservice request information and the microservice request model;
[0217] A determination module 1004 is used to determine a second cluster object list bound to the microservice based on the microservice request object;
[0218] The second processing module 1005 is used to perform cost calculation based on the preprocessed second cluster object list, determine a cluster scheduling probability list, and distribute microservice request objects based on the scheduling probability list.
[0219] In a possible implementation, the device is further used for:
[0220] Determine a first cluster object list from the cluster object list based on the first preset condition, perform cost calculation based on the microservice object and the first cluster object list, and obtain a second cluster object list;
[0221] The microservice object is bound to the cluster in the second cluster object list based on the second cluster object column, and is determined as a deployment strategy, and the microservice object is deployed to the cluster.
[0222] In a possible implementation, the device is further used for:
[0223] Based on the microservice object, determine the total computing resource demand and storage resource demand of the microservice object;
[0224] Traverse the cluster object list to determine whether the total computing power resource demand and storage resource demand are lower than the total computing power resource and storage resource demand of the cluster; if so,
[0225] Then determine whether the maximum delay limit between the cluster and the platform set by the microservice object's microservice is greater than the delay between the cluster and the hybrid cloud integrated scheduling platform of the cluster; if so,
[0226] Then determine the resource requirements of a single copy of the microservice based on the microservice object, determine the node resources of the cluster based on the cluster, and judge whether the node resources meet the resource requirements of a single copy of the microservice; if so,
[0227] Then add the cluster to the first cluster object list;
[0228] Among them, the cluster object list is a list of clusters that includes cluster resource information and network information, the microservice object includes the network information and resource information of the microservice requirements, and the microservice request object includes the microservice information corresponding to the microservice request and the network information and resource information required by the microservice request.
[0229] In a possible implementation, the device is further used for:
[0230] determining cluster pricing data based on the cluster data;
[0231] Determine a list of cluster pricing objects based on pricing data and a cluster pricing model;
[0232] Determine the microservice deployment cost corresponding to each cluster in the first cluster object list based on the cluster pricing list and the microservice objects;
[0233] Sort the clusters in the first cluster object list in ascending order based on the microservice deployment cost;
[0234] The number of clusters that need to be deployed for the microservice is obtained based on the microservice object, and the second cluster object list is obtained from the first cluster object list in an incremental manner based on the number of clusters that need to be deployed for the microservice.
[0235] In a possible implementation, the device is further used for:
[0236] Traverse the second cluster object list, bind the microservice object to the cluster in the second cluster object list, and determine the deployment strategy for the microservice object;
[0237] The cluster resource status in the second cluster object list is updated, and the microservice objects and the deployment strategies of the microservice objects are recorded in the microservice history data and stored in the database.
[0238] In a possible implementation, the device is further used for:
[0239] Acquire a third cluster object list based on the second preset condition and the second cluster object list;
[0240] Performing cost calculation on the third cluster object list based on the microservice request object, and determining a scheduling probability list corresponding to the third cluster object list;
[0241] Distribute and process microservice request objects based on the scheduling probability list.
[0242] In a possible implementation, the device is further used for:
[0243] Obtain the latency limit and network bandwidth required for the request based on the microservice request object;
[0244] Traverse the second cluster object list, and add the cluster to the third cluster object list when the delay limit required by the request is greater than the delay between the cluster and the hybrid cloud integrated scheduling platform and the network bandwidth required by the request is less than the total public network export bandwidth of the cluster.
[0245] In a possible implementation, the device is further used for:
[0246] Based on the microservice request object, determine the cluster request scheduling cost corresponding to the cluster in the third cluster object list, and obtain the cluster request scheduling cost vector corresponding to the third cluster object list; based on the microservice request object, calculate the load of the cluster in the third cluster object list, and obtain the cluster request scheduling load vector corresponding to the third cluster object list;
[0247] The cost vector and the load vector are weighted to obtain a scheduling probability list corresponding to the third cluster object list.
[0248] In a possible implementation, the device is further used for:
[0249] The scheduling probability of the microservice request corresponding to each cluster in the third cluster object list is determined based on the scheduling probability list, and the microservice request is distributed and scheduled based on the probability.
[0250] In a possible implementation, the device is further used for:
[0251] Filter based on microservice historical data to determine whether the microservice object is recorded in the microservice historical data. If so, determine the deployment strategy corresponding to the microservice object based on the microservice historical data, and deploy the microservice object based on the deployment strategy.
[0252] The cost-aware microservice scheduling device provided by the present application includes: a first acquisition module, which is used to acquire cluster data, microservice information data and microservice historical data, and determine a cluster object list based on the cluster data and the cluster model, and determine a microservice object based on the microservice information data and the microservice deployment model; a first processing module, which is used to compare the resource requirements of the microservice object with the resource requirements of the cluster, acquire a cluster list that meets the resource requirements of the service object and determine a first cluster object list; perform cost calculation based on the first cluster object list, and determine a second cluster object list; deploy microservice objects based on the second cluster object list and determine a deployment strategy; a second acquisition module, which is used to respond to a microservice request, acquire microservice request information, and determine a microservice request object based on the microservice request information and the microservice request model; a determination module, which is used to determine the corresponding microservice based on the microservice request object, and determine the second cluster object list bound to the microservice based on the query; a second processing module, which is used to perform cost calculation and cluster load calculation based on the preprocessed second cluster object list, and calculate the cost based on the calculation. The cluster scheduling probability list is determined based on the calculation results, and the microservice request objects are distributed based on the scheduling probability list; thus, by obtaining cluster resource information, the cluster that meets the microservice resource requirements is judged, and the cluster that meets the requirements is determined as the cluster list to achieve preliminary screening of clusters; the clusters obtained by the screening are deployed for cost calculation, and the cost of deploying microservices to each cluster is calculated, so as to sort them according to the results of cost calculation, and obtain the cluster with the lowest cost as the cluster to be deployed for the microservice; the final cluster list is determined based on the deployment requirements of the microservice, and the microservice is deployed by updating the cluster resources; in the microservice request stage, the deployed cluster is obtained according to the information of the microservice, and the cost of deploying the microservice to the cluster and the load of the cluster are used as optimization targets. Through probability calculation, the probability of final scheduling to each cluster is obtained, and the cluster that the request finally needs to be scheduled is selected from the probability list, so as to achieve the most efficient scheduling of microservice requests, improve the utilization rate of cluster resources, and maintain the stable operation of the cluster; it solves the technical problems of low efficiency and high cost of computing power resources.
[0253] Fig.11 The hardware structure diagram of the cost-aware microservice scheduling device provided in the embodiment of the present application. Fig.11 As shown, the cost-aware microservice scheduling device 1100 includes:
[0254] Processor 1101 and memory 1102;
[0255] Memory stores computer-executable instructions;
[0256] The processor executes the computer-executable instructions stored in the memory 1102 , so that the cost-aware microservice scheduling device executes the cost-aware microservice scheduling method as described above.
[0257] It should be understood that the processor 1101 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), or application-specific integrated circuits (ASIC). A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor. The memory 1102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a disk, or an optical disk.
[0258] The embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement a cost-aware microservice scheduling method.
[0259] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0260] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A cost-aware microservice scheduling method, characterized in that: include: Acquire cluster data, microservice information data and microservice historical data, and determine a cluster object list based on the cluster data and cluster model, and determine a microservice object based on the microservice information data and microservice deployment model; Perform cost calculation based on the preprocessed cluster object list to determine a second cluster object list, and deploy the microservice object based on the second cluster object list and determine a deployment strategy; In response to the microservice request, obtain microservice request information, and determine a microservice request object based on the microservice request information and the microservice request model; Determine the second cluster object list bound to the microservice based on the microservice request object; Cost calculation is performed based on the preprocessed second cluster object list to determine a cluster scheduling probability list, and the microservice request object is distributed based on the scheduling probability list.
2. The method according to claim 1, characterized in that The performing cost calculation based on the preprocessed cluster object list, determining a second cluster object list, and deploying the microservice object based on the second cluster object list and determining a deployment strategy includes: Determine a first cluster object list from the cluster object list based on a first preset condition, perform cost calculation based on the microservice object and the first cluster object list, and obtain a second cluster object list; The microservice object is bound to a cluster in the second cluster object list based on the second cluster object list, and is determined as a deployment strategy, and the microservice object is deployed to the cluster.
3. The method according to claim 2, characterized in that The determining the first cluster list from the cluster object list based on the first preset condition includes: Based on the microservice object, determine the total computing resource demand and the total storage resource demand of the microservice object; Traverse the cluster object list to determine whether the total amount of computing power resource demand and the total amount of storage resource demand are lower than the total amount of computing power resource and the total amount of storage resource of the cluster; if so, Then determine whether the microservice of the microservice object has a maximum delay limit from the cluster to the platform that is greater than the delay from the cluster of the cluster to the hybrid cloud integrated scheduling platform; if so, Then determine the resource requirements of a single copy of the microservice based on the microservice object, determine the node resources of the cluster based on the cluster, and judge whether the node resources meet the resource requirements of the single copy of the microservice; if so, then adding the cluster to the first cluster object list; Among them, the cluster object list is a list of clusters including cluster resource information and network information, the microservice object includes microservice demand network information and resource information, and the microservice request object includes microservice information corresponding to the microservice request and network information and resource information required by the microservice request.
4. The method according to claim 3, characterized in that The performing cost calculation based on the microservice object and the first cluster object list and obtaining the second cluster object list includes: determining cluster pricing data based on the cluster data; Determine a cluster pricing object list based on the pricing data and the cluster pricing model; Determine the microservice deployment cost corresponding to each cluster in the first cluster object list based on the cluster pricing list and the microservice object; Sort the clusters in the first cluster object list in ascending order based on the microservice deployment cost; The number of clusters that need to be deployed for the microservice is obtained based on the microservice object, and the second cluster object list is obtained from the first cluster object list in an incremental manner based on the number of clusters that need to be deployed for the microservice.
5. The method according to claim 4, characterized in that The step of binding the microservice object to a cluster in the second cluster object list based on the second cluster object list, determining the deployment strategy, and deploying the microservice object to the cluster includes: Traversing the second cluster object list, binding the microservice object to the cluster in the second cluster object list, and determining the deployment strategy for the microservice object; The cluster resource status in the second cluster object list is updated, and the microservice object and the deployment strategy of the microservice object are recorded in the microservice history data and stored in a database.
6. The method according to claim 1, characterized in that The cost calculation is performed based on the preprocessed second cluster object list, a cluster scheduling probability list is determined, and the microservice request object is distributed based on the scheduling probability list, including: Acquire a third cluster object list based on the second preset condition and the second cluster object list; Performing cost calculation on the third cluster object list based on the microservice request object, and determining the scheduling probability list corresponding to the third cluster object list; The microservice request object is distributed and processed based on the scheduling probability list.
7. The method according to claim 6, characterized in that The acquiring the third cluster object list based on the second preset condition and the second cluster object list includes: Obtaining the delay limit required for the request and the network bandwidth required for the request based on the microservice request object; Traverse the second cluster object list, and add the cluster to the third cluster object list when the delay limit required by the request is greater than the delay between the cluster and the hybrid cloud integrated scheduling platform of the cluster and the network bandwidth required by the request is less than the total public network export bandwidth of the cluster.
8. The method according to claim 7, characterized in that The performing cost calculation on the third cluster object list based on the microservice request object to determine the scheduling probability list corresponding to the third cluster object list includes: Based on the microservice request object, determine the cluster request scheduling cost corresponding to the cluster in the third cluster object list, and obtain the cluster request scheduling cost vector corresponding to the third cluster object list; based on the microservice request object, calculate the load of the cluster in the third cluster object list, and obtain the cluster request scheduling load vector corresponding to the third cluster object list; The cost vector and the load vector are weighted to obtain a scheduling probability list corresponding to the third cluster object list.
9. The method according to claim 8, characterized in that The distributing and processing the microservice request object based on the scheduling probability list includes: The scheduling probability of the microservice request corresponding to each cluster in the third cluster object list is determined based on the scheduling probability list, and the microservice request is distributed and scheduled based on the probability.
10. The method according to claim 1, characterized in that After acquiring cluster data, microservice information data and microservice history data, determining a cluster object list based on the cluster data and the cluster model, and determining a microservice object based on the microservice information data and the microservice deployment model, the method further includes: Screening is performed based on the microservice historical data to determine whether the microservice object is recorded in the microservice historical data. If so, the deployment strategy corresponding to the microservice object is determined based on the microservice historical data, and the microservice object is deployed based on the deployment strategy.
11. A cost-aware microservice scheduling device, characterized in that: include: A first acquisition module is used to acquire cluster data, microservice information data and microservice history data, and determine a cluster object list based on the cluster data and the cluster model, and determine a microservice object based on the microservice information data and the microservice deployment model; A first processing module, configured to perform cost calculation based on the preprocessed cluster object list, determine a second cluster object list, deploy the microservice object based on the second cluster object list, and determine a deployment strategy; A second acquisition module is used to respond to the microservice request, acquire microservice request information, and determine the microservice request object based on the microservice request information and the microservice request model; A determination module, configured to determine the second cluster object list bound to the microservice based on the microservice request object; The second processing module is used to perform cost calculation based on the preprocessed second cluster object list, determine a cluster scheduling probability list, and distribute the microservice request object based on the scheduling probability list.
12. A cost-aware microservice scheduling device, comprising: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the cost-aware microservice scheduling device executes the cost-aware microservice scheduling method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the cost-aware microservice scheduling method according to any one of claims 1 to 10.