Instance scheduling method and device, hybrid scheduling component, storage medium and product
By using a hybrid scheduling component to uniformly manage the resource status of virtual machines and containers and generate reasonable scheduling solutions, the problem of resource waste and scheduling incoordination caused by separate management of virtual machines and containers is solved, achieving more efficient resource utilization and scheduling flexibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
- Filing Date
- 2026-04-08
- Publication Date
- 2026-05-08
AI Technical Summary
In existing technologies, virtual machines and containers are managed by different systems, leading to resource waste and scheduling incoordination.
A hybrid scheduling component is provided for managing multiple types of runtime instances (including virtual machines and containers) within a cluster. By receiving scheduling requests, obtaining resource status, generating an initial set of scheduling solutions, and selecting a target scheduling solution to create a component instance on the compute node, unified resource status monitoring and scheduling decisions are achieved.
It achieves more reasonable resource allocation, improves scheduling flexibility and adaptability, avoids resource waste and scheduling incoordination, and supports the hybrid deployment of containers and virtual machines.
Smart Images

Figure CN121996360A_ABST
Abstract
Description
Technical Field
[0001] This application relates to cloud computing technology, and more particularly to an instance scheduling method, instance scheduling device, hybrid scheduling component, computer-readable storage medium, and computer program product. Background Technology
[0002] Virtual machines and containers typically belong to two independent management architectures, scheduled by corresponding management components to their respective managed physical machines. With the rapid development of Kubernetes cloud-native technology, more and more businesses are undergoing containerization. However, a complete business consists of many different business components, and most enterprises still deploy a large number of these components in virtual machines. Therefore, there is an urgent need for a scheduling solution that supports a hybrid of containers and virtual machines. Currently, at least one problem exists: virtual machines and containers are managed by different systems, leading to resource waste and scheduling inconsistencies. Summary of the Invention
[0003] This application provides an instance scheduling method, an instance scheduling device, a hybrid scheduling component, a computer-readable storage medium, and a computer program product.
[0004] The technical solution of this application embodiment is implemented as follows: This application provides an instance scheduling method applied to a hybrid scheduling component. The hybrid scheduling component manages the resources of multiple hybrid nodes, which are compute nodes within a cluster that support multiple types of runtime instances. The types of runtime instances include virtual machines and containers. The method includes: Receive a scheduling request for mixed services sent by a client; wherein the scheduling request is used to instruct the deployment of multiple component instances on a compute node; the runtime type of the multiple component instances is one of the multiple types of runtime instances; Obtain the resource status of each computing node within the cluster; Based on the resource status and the component composition information and component resource requirements contained in the scheduling request, an initial scheduling solution set is generated; wherein, each scheduling solution in the initial scheduling solution set represents a deployment scheme for deploying multiple component instances on different computing nodes; Select a target scheduling solution from the initial set of scheduling solutions; Multiple instances of the component are created on the computing node corresponding to the target scheduling solution.
[0005] This application provides an instance scheduling device applied to a hybrid scheduling component. The hybrid scheduling component manages the resources of multiple hybrid nodes, which are compute nodes within a cluster that support multiple types of runtime instances. The types of runtime instances include virtual machines and containers. The device includes: A receiving unit is configured to receive a scheduling request for a mixed service sent by a client; wherein the scheduling request is used to instruct the deployment of multiple component instances on a compute node; the runtime type of the multiple component instances is one of the multiple types of runtime instances; The acquisition unit is used to acquire the resource status of each computing node in the cluster. The processing unit is configured to generate an initial scheduling solution set based on each resource status and the component composition information and component resource requirements contained in the scheduling request; wherein each scheduling solution in the initial scheduling solution set represents a deployment scheme for deploying multiple component instances on different computing nodes; The processing unit is configured to select a target scheduling solution from the initial scheduling solution set; The processing unit is used to create multiple instances of the component on the computing node corresponding to the target scheduling solution.
[0006] This application provides a hybrid scheduling component, including: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method provided in the embodiments of this application.
[0007] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing instance scheduling provided in this application when executed by a processor.
[0008] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the instance scheduling provided in this application.
[0009] The embodiments of this application have the following beneficial effects: the hybrid scheduling component can perform unified resource status monitoring and scheduling decisions on nodes that support multiple types of runtime instances (containers and virtual machines) within the cluster. The generation mechanism of the scheduling set can intelligently match according to the component composition information and resource requirements, thereby achieving more reasonable resource allocation and improving the flexibility and adaptability of scheduling. In this way, the resource waste and scheduling incoordination problems caused by containers and virtual machines being managed by different systems in traditional scenarios are avoided. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating the instance scheduling method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the integrated scheduling system architecture for virtual machines and containers providing embodiments of this application; Figure 3 This is a schematic diagram of the integrated scheduling process for virtual machines and containers using hybrid resources provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of the instance scheduling device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the hybrid scheduling component provided in the embodiments of this application. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0012] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0013] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0014] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0015] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0016] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0017] Figure 1 This is a flowchart illustrating the instance scheduling method provided in the embodiments of this application. The following will be combined with... Figure 1 The steps shown are explained as follows: Figure 1 As shown, this method is applied to a hybrid scheduling component, which manages the resources of multiple hybrid nodes. These hybrid nodes are compute nodes within the cluster that support multiple types of runtime instances, including virtual machines and containers. The method includes steps 101 to 105. Step 101: Receive a scheduling request for mixed services sent by the client; wherein the scheduling request is used to instruct the deployment of multiple component instances on the compute node; the runtime type of the multiple component instances is one of multiple types of runtime instances.
[0018] In this embodiment, since the hybrid node supports at least two types of runtime instances, hybrid deployment across runtime instances is achieved. The hybrid scheduling component can perform unified resource status monitoring and scheduling decisions for hybrid nodes that support multiple types of runtime instances (containers and virtual machines) within the cluster, avoiding the resource waste and scheduling incoordination problems caused by containers and virtual machines being managed by different systems in traditional scenarios.
[0019] As can be understood, a runtime environment refers to the environment provided for running computer programs. In other words, the runtime environment includes the supporting libraries, data structures, functions, and other components required during the execution of a computer program. These provide the necessary infrastructure, enabling the computer program to run on a specific operating system and hardware. Types of runtime environments include virtual machines, containers, and bare-metal servers. Virtual machines include kernel-based virtual machines, and containers include Linux containers and DocKe containers. In this application, the runtime environment is also referred to as a runtime instance.
[0020] Step 102: Obtain the status of each resource on each compute node in the cluster.
[0021] In this embodiment, resource status refers to resource usage, including but not limited to one or more of the following: Central Processing Unit (CPU) utilization and remaining capacity, memory usage and available space, storage resource usage and remaining capacity, network bandwidth usage, number of currently running instances on the node, and load status.
[0022] Step 103: Generate an initial scheduling solution set based on the component composition information and component resource requirements contained in each resource status and scheduling request; wherein, each scheduling solution in the initial scheduling solution set represents a deployment scheme that deploys multiple component instances on different computing nodes.
[0023] Here, based on the component composition information and component resource requirements contained in each resource status and scheduling request, an initial scheduling solution set is generated, which includes multiple random scheduling solutions that satisfy resource constraints.
[0024] In this embodiment, the initial scheduling solution set includes N possible scheduling results for the current business component based on the component composition information, where N is a positive integer. When initializing the global scheduling solution, the same component instance can be scheduled to multiple computing nodes with sufficient remaining resources, resulting in various scheduling combinations. The global scheduling solution is initialized using a random construction method, randomly assigning each component instance to a computing node that meets the resource requirements. Due to the random selection, each generated scheduling result may be different, resulting in N different scheduling solutions. This randomness covers more scheduling possibilities, providing diverse reference schemes for subsequent health assessments and optimized scheduling.
[0025] In this embodiment, the scheduling solution generation mechanism can intelligently match component composition information and resource requirements, thereby achieving more reasonable resource allocation and improving the flexibility and adaptability of scheduling.
[0026] In this embodiment, for a complete business system consisting of multiple components, the solution allows different components to be deployed in containers or virtual machines to meet the different needs of different components for isolation, performance and compatibility.
[0027] Step 104: Select a target scheduling solution from the initial scheduling solution set.
[0028] In this embodiment, the target scheduling solution is the key decision output in the entire hybrid scheduling process. It transforms the theoretical scheduling scheme into a concrete and executable deployment plan. Here, the target scheduling solution is an array of length Z, where Z is a positive integer. Each element represents the deployment node number of the corresponding component instance, providing explicit guidance for specific deployment operations.
[0029] Step 105: Create multiple component instances on the computing node corresponding to the target scheduling solution.
[0030] In this embodiment, multiple component instances are created on the compute nodes corresponding to the target scheduling solution to achieve business deployment. This can be achieved through the following steps: First, parse the target scheduling solution: convert the array structure in the target scheduling solution into a specific component-node mapping relationship, where each element of the array corresponds to the deployment node number of a component instance; second, verify node resources: verify the resource status of the target node again before creation to ensure that it still meets the resource requirements of the component instance; finally, perform distributed creation: according to the node information specified in the scheduling solution, schedule each component instance to the corresponding compute node, and create and deploy it through the corresponding runtime environment (container or virtual machine). Therefore, this step realizes the implementation of scheduling decisions, transforming the theoretically optimal scheduling scheme into actual deployment actions, completing the closed loop from scheduling decision to physical execution; it supports hybrid deployment mode, that is, it supports the creation of component instances in both container and virtual machine runtime environments simultaneously, meeting the actual needs of enterprise hybrid deployment.
[0031] The instance scheduling method provided in this application is applied to a hybrid scheduling component, which manages the resources of multiple hybrid nodes. These hybrid nodes are compute nodes within a cluster that support multiple types of runtime instances, including virtual machines and containers. The method includes: receiving a scheduling request for a hybrid service sent by a client; wherein the scheduling request instructs the deployment of multiple component instances on compute nodes; the runtime type of the multiple component instances is one of the multiple types of runtime instances; obtaining the resource status of each compute node within the cluster; generating an initial scheduling solution set based on each resource status and the component composition information and component resource requirements contained in the scheduling request; wherein each scheduling solution in the initial scheduling solution set represents a deployment scheme for deploying multiple component instances on different compute nodes; selecting a target scheduling solution from the initial scheduling solution set; and creating multiple component instances on the compute node corresponding to the target scheduling solution. Therefore, the hybrid scheduling component of this application can perform unified resource status monitoring and scheduling decisions for nodes that support multiple types of runtime instances (containers and virtual machines) within the cluster. The generation mechanism of the scheduling set can intelligently match according to the component composition information and resource requirements, thereby achieving more reasonable resource allocation and improving the flexibility and adaptability of scheduling. In this way, the resource waste and scheduling incoordination problems caused by containers and virtual machines being managed by different systems in traditional scenarios are avoided.
[0032] In some embodiments, step 103 generates an initial scheduling solution set based on the component composition information and component resource requirements contained in each resource status and scheduling request, which can be achieved through the following steps: Step 1031: Based on the resource requirements corresponding to each component instance in each resource status and component resource requirements, select candidate computing nodes from all computing nodes in the cluster.
[0033] In this embodiment, by pre-screening candidate computing nodes with sufficient resources, repeated checks and adjustments in subsequent steps can be avoided, improving overall scheduling efficiency. Furthermore, when screening candidate computing nodes based on the resource requirements of component instances, considering resource status can prevent the over-concentration of multiple component instances on a few resource-sufficient nodes, contributing to a more even load distribution across the entire cluster. This allows the scheduling algorithm to focus more on optimizing other metrics, such as inter-component correlation or load balancing. Through these methods, it is ensured that the initial scheduling solution set not only includes reasonable deployment schemes but also guarantees that these schemes will not fail due to insufficient resources during actual execution.
[0034] Step 1032: Based on the number of components Z and the number of candidate computing nodes K included in the component composition information, generate N sets of random scheduling results as the initial scheduling solution set; each scheduling solution in the initial scheduling solution set is an array of length Z, where each element in the array represents the number of the computing node to be deployed corresponding to the component instance, and K is a positive integer.
[0035] In this embodiment, based on the resource requirements of each component instance in each resource state and component resource requirements, nodes that do not meet the resource requirements are pre-excluded from all computing nodes in the cluster, and candidate computing nodes are selected to ensure that each component instance can be deployed on a node that meets its resource requirements. Furthermore, multiple random scheduling solutions are generated under the premise of satisfying resource constraints, providing a rich search space for subsequent optimization algorithms and avoiding getting trapped in local optima.
[0036] In some embodiments, step 104, which selects a target scheduling solution from the initial set of scheduling solutions, can be achieved through the following steps: Step 1041: Generate the association matrix of components based on the association relationships between components contained in the scheduling request.
[0037] In this embodiment, a matrix reflecting the degree of component association is constructed by analyzing the dependencies and interaction frequency among components in the hybrid service. The element Cor[i][j] in the matrix represents the association strength between the i-th component and the j-th component. This matrix quantifies the dependencies between components, providing business logic-level guidance for subsequent scheduling decisions. Here, i and j are positive integers.
[0038] Step 1042: For each scheduling solution, calculate the resource occupancy status of multiple component instances on the corresponding computing nodes to obtain the business evaluation index of each scheduling solution.
[0039] In this embodiment, the current resource usage of each computing node within the cluster is comprehensively evaluated, including the utilization rate of key resources such as CPU, memory, and storage, and corresponding business evaluation indicators are calculated in conjunction with business requirements. These indicators are used to quantify the merits of each scheduling solution in terms of resource utilization, ensuring that the selected scheduling scheme can effectively utilize cluster resources.
[0040] Step 1043: Generate each indication parameter for each scheduling solution; wherein each indication parameter is used to determine whether the i-th component instance and the j-th component instance are scheduled to the same computing node.
[0041] In this embodiment, by analyzing the component association matrix and resource status, indication parameters are generated to determine which component instances should be scheduled to the same compute node. When the inter-component correlation is high and node resources are sufficient, the indication parameters will tend to deploy these components on the same node to reduce network communication overhead and improve system performance.
[0042] Step 1044: Select a target scheduling solution from the initial scheduling solution set based on each indication parameter, the elements in the correlation matrix, and the service evaluation index of each scheduling solution.
[0043] In this embodiment, the final target scheduling solution selection process comprehensively considers three key factors: the degree of correlation between components (reflected by the correlation matrix), the rationality of resource allocation (reflected by business evaluation indicators), and the optimization strategy for node deployment (reflected by indicator parameters). Through weighted calculation or comprehensive scoring, the optimal scheduling scheme is selected from the initial set of scheduling solutions, ensuring that the selected solution achieves the best balance in both business logic and resource utilization. This multi-dimensional evaluation mechanism ensures that the final selected target scheduling solution not only meets resource constraints but also optimizes the collaboration efficiency between business components.
[0044] In some embodiments, step 1044, which selects a target scheduling solution from the initial set of scheduling solutions based on each indication parameter, the elements in the correlation matrix, and the service evaluation index of each scheduling solution, can be achieved through the following steps: Step 10441: Generate each association index based on each indicator parameter and the elements in the association matrix; wherein the element represents the degree of association between the i-th component instance and the j-th component instance; wherein each association index represents the association score when the i-th component instance and the j-th component instance are scheduled to the same computing node.
[0045] In this embodiment, the correlation score between components is calculated by analyzing the indicator parameters and elements of the correlation matrix. For example, when the i-th component instance and the j-th component instance are scheduled to the same computing node, their correlation score is determined by the value of the Cor[i][j] element in the correlation matrix. If the correlation between components is high, the score will be higher; otherwise, the score will be lower. This indicator reflects the rationality of the business logic when components are deployed on the same node.
[0046] In this embodiment, the association matrix iCor is component-based. During scheduling, the association degree of components needs to be mapped to the instance level. For example, if the association degree between the backend service component and the database component is 1, then each instance of the backend service is associated with each instance of the database. The goal of this application's scheduling is to optimize the overall health of the business, which requires considering the deployment status of all instances. Therefore, the calculation of association degree needs to be performed at the instance level to ensure that the scheduling result meets the business logic and performance requirements.
[0047] Step 10442: Determine the comprehensive score of each scheduling solution based on the business evaluation index and each related index of each scheduling solution.
[0048] In this embodiment, business evaluation metrics and related metrics are integrated and calculated to form a comprehensive score for each scheduling solution. Business evaluation metrics mainly reflect resource utilization efficiency, while related metrics reflect the business rationality of component deployment. Through weighted or comprehensive calculation methods, a comprehensive score is generated for each scheduling solution, which comprehensively considers the degree of resource constraint satisfaction and the degree of business logic optimization.
[0049] Step 10443: Based on the comprehensive score of each scheduling solution, select the scheduling solution with a comprehensive score greater than the threshold from the initial scheduling solution set as the target scheduling solution.
[0050] In this embodiment, a comprehensive score is used for screening, and scheduling solutions with a comprehensive score exceeding a preset threshold are selected as the final target scheduling solutions. This threshold setting ensures that the selected scheduling solutions meet certain standards in both resource utilization and business relevance. Through threshold filtering, poor-quality scheduling schemes can be eliminated, ensuring that the final selected scheduling solution has good overall performance.
[0051] In some embodiments, step 1042 calculates the resource occupancy status of multiple component instances on the corresponding computing nodes for each scheduling solution to obtain the service evaluation index of each scheduling solution. This can be achieved through the following steps: Step 10421: Determine the utilization rate of the remaining resources on each compute node for all component instances scheduled to each compute node.
[0052] In this embodiment, resource utilization is quantified by calculating the occupancy rate of resources requested by the scheduled component instance within the remaining resources of the compute node. For each compute node, the ratio of its currently allocated resources to the total resources is evaluated to reflect the node's load level.
[0053] Step 10422: Determine the business score of each computing node based on the occupancy rate of each computing node.
[0054] In this embodiment, a weighted scoring function is used to generate node-level business scores based on the utilization rate data of each computing node. This weighted function typically considers the reasonableness of resource utilization, for example, giving lower scores to nodes with excessively high utilization and higher scores to nodes with balanced resource utilization.
[0055] Step 10423: Calculate the average service score of all computing nodes and use the average as the service evaluation index for each scheduling solution.
[0056] In this embodiment, the service scores of all computing nodes are arithmetically averaged to obtain a single scalar value—the service evaluation index for each scheduling solution. This index comprehensively reflects the overall performance of the scheduling solution in terms of resource utilization.
[0057] In some embodiments, step 10422, which determines the service score of each computing node based on the occupancy rate of each computing node, can be achieved through the following steps: When the occupancy rate is less than or equal to the first threshold, the business score of each computing node is determined as the first score. When the resource utilization rate of a computing node is less than or equal to a preset first threshold, the node is considered to be in a state of relatively relaxed resource utilization. At this time, the business score of the node is set to the preset first score, indicating that the node has sufficient resource reserves to meet the deployment requirements of component instances.
[0058] When the occupancy rate is greater than or equal to the second threshold, the business score of each computing node is determined as the second score. When the resource utilization rate of a computing node is greater than or equal to a preset second threshold, the node is determined to be in a state of resource strain. At this time, the node's business score is set to the preset second score, indicating that the node's resources are close to saturation, and deploying new component instances may face the risk of resource contention.
[0059] When the occupancy rate is greater than the first threshold but less than the second threshold, the business score of each computing node is determined as the third score based on the first threshold using a linear interpolation algorithm.
[0060] When the resource utilization rate of a computing node falls between the first and second thresholds, a linear interpolation algorithm is used to calculate the node's service score. By mapping the relationship between the utilization rate and the two thresholds to the score interval, a third score is obtained, falling between the first and second scores. This method can more precisely reflect the continuous changes in the node's resource utilization status.
[0061] In this embodiment, a hierarchical evaluation of the resource status of computing nodes is achieved by dividing the system into three threshold intervals, enabling scheduling decisions to distinguish nodes with different resource utilization levels. The linear interpolation algorithm ensures a smooth transition of node scores as resource occupancy changes continuously, avoiding abrupt changes in evaluation results due to threshold jumps. This scoring mechanism can effectively identify nodes with scarce and abundant resources, providing a more accurate quantitative basis for selecting scheduling solutions and improving the overall quality of the scheduling scheme. By adjusting the threshold parameters, the system can flexibly adapt to the resource utilization efficiency requirements of different business scenarios, enhancing the adaptability and robustness of the scheduling system.
[0062] In some embodiments, the above instance scheduling method further includes the following steps: Get the running status of multiple component instances; the running status includes whether the scheduling was successful or failed. Here, the system continuously monitors the operational status of deployed component instances and collects scheduling status information for each component in real time. This status information includes whether the component instance has been successfully deployed to the target compute node, and any specific problems encountered during deployment. Through this continuous monitoring mechanism, the system can promptly detect scheduling failures.
[0063] For component instances whose running status is scheduling failure, the target scheduling solution corresponding to the component instance whose running status is scheduling success is adjusted according to the target scheduling solution corresponding to the component instance whose running status is scheduling success, so as to obtain the adjusted scheduling solution; When a component instance scheduling failure is detected, the system records the specific reason for the failure, such as insufficient resources, node unavailability, or configuration error. Simultaneously, the system analyzes the attributes of the failed component instance, including its resource requirements, relationships, and other key information, providing a basis for subsequent scheduling adjustments.
[0064] Create the instance of the component that failed to be scheduled on the compute node corresponding to the adjusted scheduling solution.
[0065] For component instances that fail to be scheduled, the system references the target scheduling solutions corresponding to those that were successfully scheduled. By comparing and analyzing the node allocation strategies and resource utilization patterns in the successful scheduling solutions, the system can deduce a deployment scheme that is more suitable for the current failed component instance. This adjustment strategy based on successful experience can effectively improve the success rate of rescheduling.
[0066] Based on the above analysis results, the system optimizes and adjusts the original scheduling solution to generate a new scheduling scheme. This adjusted scheduling solution reconsiders the resource requirements, relationships, and current cluster resource status of the failed component instances, ensuring that the new deployment scheme is more reasonable in terms of resource constraints and business logic. Subsequently, the system recreates the failed component instances on the corresponding compute nodes according to the adjusted scheduling solution.
[0067] Therefore, it can be seen that through the fault adaptive adjustment mechanism, the system can automatically handle scheduling failures, significantly improving the success rate of hybrid service deployment; this mechanism enables the system to have fault tolerance and self-healing capabilities, and even if some components fail to schedule, the system can quickly restore normal service operation through adjustment strategies; the adjustment strategy based on the successful scheduling solution can allocate cluster resources more rationally, avoiding resource waste and over-concentration.
[0068] Figure 2 This is a schematic diagram of the integrated scheduling system architecture for virtual machines and containers providing embodiments of this application, as shown below. Figure 2 As shown in the diagram, this architecture diagram illustrates the hybrid virtual machine / container cluster architecture and the integrated hybrid task template. The integrated hybrid task template describes business component information in a specific format, such as name, type, resource request, and associated components. The backend service is a virtual machine instance associated with a relational database management system (such as MySQL) container instance. The console's associated components are yet to be defined (or can be considered to have no associated components). The hybrid virtual machine / container cluster includes management nodes and compute nodes. On the management node, the hybrid scheduling component receives tasks and collaborates with the virtual machine and container management components to manage related transactions. The compute nodes have virtual machine and container agent components that run multiple virtual machine and container instances, with all nodes jointly supporting business operations.
[0069] like Figure 2 As shown, the integrated hybrid task template provided in this application supports configuring the correlation field to associate other components with the current business components. For example, the backend service can be associated with the MySQL database business.
[0070] Figure 3 This is a schematic diagram of the integrated scheduling process for virtual machines and containers using hybrid resources provided in this application embodiment, such as... Figure 3 As shown, the process includes the following steps: Step 301: The user applies to create a hybrid service; Step 302: Automatically generate the relationship topology of each component of the hybrid business; Step 303: Initialize N sets of candidate scheduling results; Step 304: Calculate and score the health of the candidate scheduling results; Step 305: Calculate the correlation score for the candidate scheduling results; Step 306: Multi-dimensional comprehensive score; Step 307: Select the winning solution to construct the next round of scheduling combinations; Step 308: Determine whether to terminate. If yes, proceed to step 309; otherwise, proceed to step 304. Step 309: Select the globally optimal scheduling solution; Step 310: Notify the virtual machine / container management component to create an instance on the corresponding node; Step 311, monitor the container / virtual machine instance; Step 312: Determine if creation was successful. If yes, end the process; otherwise, proceed to step 303.
[0071] Furthermore, combined Figure 2 and Figure 3 The following further clarifies the process by which the hybrid scheduling component obtains real-time information on the resource usage of computing nodes within the cluster and simultaneously receives hybrid service scheduling requests for integrated scheduling: Step 1: Automatically generate a global component association topology: For mixed business scenarios with Z component instances, generate a global association topology based on the association attributes. Let iCor be a symmetric matrix with respect to this symmetric matrix, where... This indicates the degree of association between the i-th and j-th components, such as... Figure 2 As shown, assuming the three business components—backend, mysql, and console—are components 0, 1, and 2 respectively, iCor can be represented as... A matrix can effectively represent the topological relationships between the various components of the entire business. Step 2: Initialize the global scheduling solution: Randomly generate N scheduling results. As the initial solution, each scheduling result This represents a set of scheduling solutions for all Z component instances. ;For example, This indicates the scheduling result of the third group, which schedules the first and second component instances to compute node 5, and the z-th component instance to compute node 7.
[0072] Step 3: Customize and score business health: Step 2 yielded N scheduling solutions, determining N possible scheduling outcomes for the current business component. Further, based on the resources requested by the business and the remaining resources of the computing nodes, the business health can be customized and calculated. The definition method is as follows: ; ; ; in, Indicates the CPU resources requested by the component instance. This indicates the remaining CPU resources of the compute node where the current instance resides. This represents the CPU remaining resource utilization rate of all component instances scheduled to the k-th compute node in the current service scheduling result. A utilization rate below 80% earns 100 points, indicating that after deploying the service components on that compute node, the node still has sufficient CPU remaining resources to ensure service stability. A utilization rate above 95% earns 0 points, with linear scoring between 80% and 95%. For a complete business, its application health score The average score of all K compute nodes to be scheduled for all components included in the current service. Finally, the business health of each of the N scheduling solutions is calculated. This method allows for an overall evaluation of the scheduling results.
[0073] Step 4: Business Component Relevance Scoring: Similarly, score the N sets of scheduling results based on their relevance. ; in, The correlation between the i-th instance and the j-th instance of the current solution is obtained in Step 1; This indicates whether the i-th and j-th instances are scheduled to the same physical node. If they are, the score is 1; otherwise, it is 0. That is, if the i-th and j-th instances are related but not scheduled to the same node, the score is 0. Ultimately, the goal is to ensure that the scheduling results of deploying highly related business components to the same node receive a high score.
[0074] Step 5: Multi-dimensional comprehensive scoring: Normalize the health and relevance scores of the N groups of scheduling results obtained in Step 3 and Step 4 and calculate the weighted values to obtain the comprehensive score of the N groups of scheduling results; Step 6: Select the winning solution to construct the next round of scheduling combinations: Since the initial N sets of solutions are randomly generated, directly selecting the highest-scoring solution from Step 5 as the scheduling result may not be the optimal combination. Therefore, select the top T sets of solutions from the previous round, where T is a positive integer, and generate NT new sets of solutions. Two sets of solutions are selected with the probability of being selected based on their scores. The [1,x] and (x,z] parts of the two sets of solutions are then combined to generate a new solution, resulting in NT sets of new solutions.
[0075] Step 7: Select the global optimal scheduling result: Repeat Step 3 to Step 6 until the set stopping conditions are met. Finally, select the solution with the highest score from the N sets of scheduling solutions as the final scheduling result of the hybrid service. Here, the stopping conditions include but are not limited to: (1) Reaching the preset maximum number of iterations: The system sets a maximum iteration limit, and automatically stops when the number of iterations reaches this value; (2) Meeting the convergence condition: When the score change of the optimal solution is less than the preset threshold in several consecutive iterations, it is considered to have converged; (3) Reaching the target performance index: Stop when the health score of the scheduling result reaches the preset minimum requirement; (4) Meeting resource constraints: Stop when the resource requirements of all component instances can be met and there are no resource conflicts.
[0076] Step 8: Create business component instances: Notify the virtual machine / container management component to create instances on the corresponding compute nodes according to the scheduling results.
[0077] Step 9: Monitor the status of business instances: Monitor the virtual machine / container management component to obtain the instance status. If all instances are successful, this round of scheduling is successful and ends; if some instances fail, proceed to Step 10. Step 10, Scheduling Compensation: Obtain the lists of successfully created and failed instances, and return to Step 2 for compensation scheduling. During compensation scheduling, the scheduling results for all instances successfully created in the previous round are no longer randomly generated, but directly inherit the scheduling results from the previous round. Only failed instances are re-compensated for scheduling.
[0078] This application proposes a unified scheduling method and system for virtual machines and containers. A hybrid scheduling component is added to the virtual machine / container hybrid cluster to provide scheduling and orchestration functions for hybrid services. It automatically generates a global topology of service components and, combined with the service health definition based on the global resource status of hybrid service components and physical machines, achieves integrated scheduling of individual hybrid services. Simultaneously, a scheduling compensation mechanism is provided to address the potential failure to create some instances after hybrid scheduling, thereby improving the reliability and stability of the hybrid scheduling system.
[0079] This application constructs a hybrid scheduling system that provides a unified management engine for virtual machines and containers, integrating OpenStack and Kubernetes systems. Container instances are directly managed by the Kubernetes component on the corresponding node, eliminating the need to create additional virtual machines to host containers and saving physical resources. In contrast, the approach of using containers as internal applications within virtual machines requires creating an additional virtual machine for each container, which inevitably consumes physical resources. The instance scheduling method provided in this application effectively conserves physical resources.
[0080] This application provides a hybrid scheduling strategy that automatically generates hybrid instance association topologies to schedule a group of service-related containers and virtual machines to physically adjacent nodes, thereby optimizing data transmission efficiency between hybrid instances and significantly reducing communication latency in hybrid service scenarios. Compared to three traditional solutions: Solution 1 introduces a new scheduler as a unified entry point to receive requests from both virtual machines and container managers. The scheduler can receive one type of request at a time and schedule instances (virtual machines / containers) based on the resource size of the request. Although this solution provides a unified scheduler to support scheduling of containers and virtual machines, it cannot support unified scheduling of hybrid services (a task containing both virtual machines and containers) because the unified scheduler only supports receiving and processing requests from containers or virtual machine managers separately. Solution 2 introduces a joint scheduling device to receive hybrid service creation requests. A service can include both virtual machines and containers. Since a single compute node may not be sufficient to support all components of the current service, the joint scheduling device will split the service into multiple sub-services based on strategies such as CPU thresholds, and then schedule each sub-service separately. However, the scheduling process requires splitting the hybrid service into multiple sub-services before scheduling them separately. For a complete business application, the components are interconnected, making it difficult to guarantee the overall performance of the business system through the separate scheduling approach. Solution three uses a unified resource scheduler to create virtual machines and / or containers. This solution uses a proximity window lookup method to select the first compute node that meets the requirements and schedules the instance to the corresponding compute node. However, this method deploys all hybrid instances on the same physical node each time, failing to optimally utilize and allocate the physical resources of the compute node. Solution four creates containers on virtual machines as built-in applications, meaning the containers are created on the operating system of the virtual machine and treated the same as other virtual machines. This solution creates containers on virtual machines as built-in applications, and the virtual machines themselves consume additional physical resources. Based on this, this application constructs a hybrid scheduling system that provides a unified management engine for virtual machines and containers, integrating OpenStack and Kubernetes systems. Container instances are directly managed by the Kubernetes component on the corresponding node, eliminating the need to create additional virtual machines to host containers and saving physical resources. This application provides a hybrid scheduling strategy that automatically generates a hybrid instance association topology to schedule a group of business-related containers and virtual machines to physically adjacent nodes, thereby optimizing the data transmission efficiency between hybrid instances and significantly reducing communication latency in hybrid business scenarios.This application provides a scheduling compensation mechanism to address the problem that some instances may be successfully scheduled but fail to be created in mixed business scenarios, thus affecting the overall business operation. Based on the scheduling results of successfully created instances, a compensatory scheduling is performed using an improved genetic algorithm to ensure the reliability of the mixed scheduling system.
[0081] This application provides a scheduling compensation mechanism to address the issue in hybrid service scenarios where some instances may be successfully scheduled but fail to be created, thus impacting overall service operation. Compensatory scheduling is performed based on the scheduling results of successfully created instances, combined with an improved genetic algorithm, ensuring the reliability of the hybrid scheduling system. Traditional transmission technologies only provide scheduling schemes and do not consider the possibility of instance creation failures after successful scheduling. This application provides a failure scheduling compensation scheme. When some instances are successfully scheduled but ultimately fail to be created, compensatory scheduling is performed based on an improved genetic algorithm. The scheduling results of already successful instances are combined to reschedule the failed instances, ensuring the reliability and stability of the scheduling system.
[0082] This application also provides an instance scheduling device applied to a hybrid scheduling component. The hybrid scheduling component manages the resources of multiple hybrid nodes, which are compute nodes within a cluster that support multiple types of runtime instances. The types of runtime instances include virtual machines and containers, such as... Figure 4 As shown, the instance scheduling device includes: The receiving unit 401 is used to receive a scheduling request for mixed services sent by the client; wherein the scheduling request is used to instruct the deployment of multiple component instances on the compute node; the runtime type of the multiple component instances is one of multiple types of runtime instances; Acquisition unit 402 is used to acquire the status of each resource of each computing node in the cluster; The processing unit 403 is used to generate an initial scheduling solution set based on the component composition information and component resource requirements contained in each resource status and scheduling request; wherein each scheduling solution in the initial scheduling solution set represents a deployment scheme for deploying multiple component instances on different computing nodes; Processing unit 403 is used to select a target scheduling solution from the initial scheduling solution set; Processing unit 403 is used to create multiple component instances on the computing node corresponding to the target scheduling solution.
[0083] In some embodiments, the processing unit 403 is configured to select candidate computing nodes from all computing nodes in the cluster based on the resource requirements corresponding to each component instance in each resource status and component resource requirements; and generate N sets of random scheduling results as an initial scheduling solution set based on the number of components Z and the number of candidate computing nodes included in the component composition information; each scheduling solution in the initial scheduling solution set is an array of length Z, where each element in the array represents the number of the computing node to be deployed corresponding to the component instance, and Z, K, and N are positive integers.
[0084] In some embodiments, the processing unit 403 is configured to calculate the resource occupancy status of multiple component instances on the corresponding computing nodes for each scheduling solution, and obtain the service evaluation index of each scheduling solution; generate each indication parameter for each scheduling solution; wherein each indication parameter is used to determine whether the i-th component instance and the j-th component instance are scheduled to the same computing node; and select a target scheduling solution from the initial scheduling solution set according to each indication parameter, the elements in the association matrix and the service evaluation index of each scheduling solution, where i and j are positive integers.
[0085] In some embodiments, the processing unit 403 is configured to generate each association index based on each indication parameter and an element in the association matrix; wherein the element represents the degree of association between the i-th component instance and the j-th component instance; wherein each association index represents the association score when the i-th component instance and the j-th component instance are scheduled to the same computing node; determine the comprehensive score of each scheduling solution based on the business evaluation index of each scheduling solution and each association index; and select the scheduling solution with a comprehensive score greater than a threshold from the initial scheduling solution set as the target scheduling solution based on the comprehensive score of each scheduling solution.
[0086] In some embodiments, the processing unit 403 is configured to determine the utilization rate of the remaining resources of each computing node for all component instances scheduled to each computing node; determine the service score of each computing node based on the utilization rate of each computing node; calculate the average service score of all computing nodes, and use the average value as the service evaluation index of each scheduling solution.
[0087] In some embodiments, the processing unit 403 is configured to determine the service score of each computing node as a first score when the occupancy rate is less than or equal to a first threshold; determine the service score of each computing node as a second score when the occupancy rate is greater than or equal to a second threshold; and determine the service score of each computing node as a third score based on the first threshold using a linear interpolation algorithm when the occupancy rate is greater than the first threshold and less than the second threshold.
[0088] In some embodiments, the processing unit 403 is used to obtain the running status of multiple component instances; wherein the running status includes scheduling success or scheduling failure; for the component instance whose running status is scheduling failure, the target scheduling solution corresponding to the component instance whose running status is scheduling success is adjusted according to the target scheduling solution corresponding to the component instance whose running status is scheduling success to obtain the adjusted scheduling solution; and the component instance whose running status is scheduling failure is created on the computing node corresponding to the adjusted scheduling solution.
[0089] This application also provides a hybrid scheduling component for managing the resources of multiple hybrid nodes. These hybrid nodes are compute nodes within a cluster that support multiple types of runtime instances, including virtual machines and containers. Figure 5 As shown, the hybrid scheduling component 500 includes: Memory 501 is used to store computer-executable instructions or computer programs; When processor 502 executes computer-executable instructions or computer programs stored in memory 501, it performs the following steps: Receive a scheduling request for mixed services sent by the client; wherein the scheduling request is used to instruct the deployment of multiple component instances on the compute node; the runtime type of the multiple component instances is one of multiple types of runtime instances; Get the status of each resource on each compute node in the cluster; Based on the component composition information and component resource requirements contained in each resource status and scheduling request, an initial scheduling solution set is generated; wherein, each scheduling solution in the initial scheduling solution set represents a deployment scheme for deploying multiple component instances on different computing nodes; Select a target scheduling solution from the initial set of scheduling solutions; Create multiple component instances on the compute nodes corresponding to the target scheduling solution.
[0090] It should be noted that the explanations of the steps in this embodiment that are the same as those in the above embodiments can be found in the descriptions in the above embodiments, and will not be repeated here.
[0091] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the instance scheduling method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0092] This application provides a computer program product including a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of a hybrid scheduling component reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the hybrid scheduling component to perform the instance scheduling method described above in this application.
[0093] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the instance scheduling method provided in this application. For example, ... Figure 1 The instance scheduling method is shown.
[0094] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0095] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0096] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
[0097] As an example, computer-executable instructions can be deployed to execute on a single device, or on multiple devices located in one location, or on multiple devices distributed across multiple locations and interconnected via a communication network.
[0098] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. An instance scheduling method, characterized in that, The method is applied to a hybrid scheduling component that manages the resources of multiple hybrid nodes, where each hybrid node is a compute node within a cluster that supports multiple types of runtime instances, including virtual machines and containers. Receive a scheduling request for mixed services sent by a client; wherein the scheduling request is used to instruct the deployment of multiple component instances on a compute node; the runtime type of the multiple component instances is one of the multiple types of runtime instances; Obtain the resource status of each computing node within the cluster; Based on the resource status and the component composition information and component resource requirements contained in the scheduling request, an initial scheduling solution set is generated; wherein, each scheduling solution in the initial scheduling solution set represents a deployment scheme for deploying multiple component instances on different computing nodes; Select a target scheduling solution from the initial set of scheduling solutions; Multiple instances of the component are created on the computing node corresponding to the target scheduling solution.
2. The method according to claim 1, characterized in that, The step of generating an initial scheduling solution set based on each resource state and the component composition information and component resource requirements contained in the scheduling request includes: Based on each of the resource states and the resource requirements corresponding to each of the component instances in the component resource requirements, candidate computing nodes are selected from all computing nodes in the cluster. Based on the component composition information, including the number of components Z and the number of candidate computing nodes K, N sets of random scheduling results are generated as the initial scheduling solution set; wherein, each scheduling solution in the initial scheduling solution set is an array of length Z, and each element in the array represents the number of the computing node to be deployed corresponding to the component instance, and Z, K and N are positive integers.
3. The method according to claim 1, characterized in that, Selecting a target scheduling solution from the initial set of scheduling solutions includes: Generate an association matrix of components based on the relationships between components contained in the scheduling request; For each scheduling solution, the resource occupancy status of multiple component instances on the corresponding computing nodes is calculated to obtain the service evaluation index of each scheduling solution. For each of the aforementioned scheduling solutions, an indication parameter is generated; wherein each of the aforementioned indication parameters is used to determine whether the i-th component instance and the j-th component instance are scheduled to the same compute node, and i and j are positive integers; Based on each of the indicated parameters, the elements in the correlation matrix, and the service evaluation index of each of the scheduling solutions, a target scheduling solution is selected from the initial set of scheduling solutions.
4. The method according to claim 3, characterized in that, The step of selecting a target scheduling solution from the initial scheduling solution set based on each of the indicated parameters, the elements in the correlation matrix, and the service evaluation index of each scheduling solution includes: Each association index is generated based on each of the indicated parameters and the elements in the association matrix; wherein the elements represent the degree of association between the i-th component instance and the j-th component instance, and each association index represents the association score when the i-th component instance and the j-th component instance are scheduled to the same computing node; The comprehensive score of each scheduling solution is determined based on the business evaluation index and the correlation index of each scheduling solution. Based on the comprehensive score of each scheduling solution, the scheduling solution with a comprehensive score greater than a threshold is selected from the initial scheduling solution set as the target scheduling solution.
5. The method according to claim 3, characterized in that, The step of calculating the resource occupancy status of multiple component instances on the corresponding computing nodes for each scheduling solution to obtain the service evaluation index of each scheduling solution includes: Determine the utilization rate of the resources requested by all component instances scheduled to each compute node in the remaining resources of each compute node; The service score of each computing node is determined based on the utilization rate of each computing node. Calculate the average service score of all computing nodes, and use the average value as the service evaluation index for each scheduling solution.
6. The method according to claim 5, characterized in that, The step of determining the service score of each computing node based on the occupancy rate of each computing node includes: When the occupancy rate is less than or equal to the first threshold, the service score of each computing node is determined as the first score. When the occupancy rate is greater than or equal to the second threshold, the service score of each computing node is determined as the second score. When the occupancy rate is greater than the first threshold and less than the second threshold, the service score of each computing node is determined as the third score based on the first threshold using a linear interpolation algorithm.
7. An instance scheduling device, characterized in that, An apparatus is applied to a hybrid scheduling component that manages the resources of multiple hybrid nodes, wherein the multiple hybrid nodes are compute nodes within a cluster that support multiple types of runtime instances, including virtual machines and containers. The apparatus includes: A receiving unit is configured to receive a scheduling request for a mixed service sent by a client; wherein the scheduling request is configured to instruct the deployment of multiple component instances on a compute node; the runtime type of the multiple component instances is one of the multiple types of runtime instances; The acquisition unit is used to acquire the resource status of each computing node in the cluster. The processing unit is configured to generate an initial scheduling solution set based on each resource status and the component composition information and component resource requirements contained in the scheduling request; wherein each scheduling solution in the initial scheduling solution set represents a deployment scheme for deploying multiple component instances on different computing nodes; The processing unit is configured to select a target scheduling solution from the initial scheduling solution set; The processing unit is used to create multiple instances of the component on the computing node corresponding to the target scheduling solution.
8. A hybrid scheduling component, characterized in that, The hybrid scheduling component includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Resource scheduling method and device, and related equipment
CN111176792A
Resource scheduling method and device, computer equipment and computer readable storage medium
CN116954815A
Scheduling method and device of container deployment unit, equipment, medium and program product
CN117194003A
Resource scheduling method and device, equipment and storage medium
CN118400432A
Cross-runtime instance hybrid deployment method and device based on cloud computing technology
CN119440795A