Instance scheduling method and device, electronic equipment and storage medium

By obtaining the declarative configuration information and status monitoring strategy of the K8s federated cluster, the Pod scheduling step size is adaptively adjusted, which solves the problem of mismatch between the Pod scheduling step size and the system status, and improves service stability and scheduling efficiency.

CN118779082APending Publication Date: 2024-10-15BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410974368.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In the K8s federated cluster, the Pod scheduling step size does not match the actual status of the system, resulting in unstable service, long adjustment process or too many Pods being created, affecting service quality.

Method used

By obtaining the declarative configuration information and status monitoring strategies of multiple federated clusters, the system working status is determined, and the scheduling step is adjusted according to the status to realize adaptive scheduling of application instances and ensure that the scheduling step matches the system status.

Benefits of technology

It improves service stability and scheduling efficiency, and avoids system instability caused by large-scale adjustments and low efficiency caused by small-scale adjustments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779082A_ABST
    Figure CN118779082A_ABST
Patent Text Reader

Abstract

The invention relates to an instance scheduling method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining declarative configuration information corresponding to each physical cluster in a plurality of federated clusters; acquiring a state monitoring strategy corresponding to each piece of declarative configuration information; for each piece of declarative configuration information, determining a system working state corresponding to the declarative configuration information based on the state monitoring strategy; and scheduling the application examples corresponding to the declarative configuration information among the physical clusters according to the system working state. According to the embodiment of the invention, by monitoring the system working state corresponding to the declarative configuration information and scheduling the application examples among the physical clusters according to the system working state, the change of the system state can be better adapted, so that the scheduling of the application examples is better matched with the system working state of the clusters, and the user experience is improved. The situation that the system is unstable due to one-time large-amplitude adjustment and the situation that the scheduling efficiency is low due to small-amplitude adjustment are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an instance scheduling method, device, electronic device and storage medium. Background Art

[0002] Usually, a region / availability zone uses a K8s federated cluster to form a large-capacity and externally unified cluster to carry services. The cluster types in the federated cluster include self-built type and public cloud type. When changing the public cloud or selecting a site for self-built data center and rebuilding, Pod scheduling in the K8s cluster is often involved. However, the upper-layer application does not need to be aware of it, because the scheduling will give priority to the gradual method of creating on the new cluster and then deleting from the old cluster.

[0003] However, if a uniform configuration with a step size of 1 is used to schedule Pods, the entire adjustment process will take a lot of time. If the adjustment range is too large, too many Pods may be created at one time, causing a sudden increase in requests to the upstream and downstream of the service, affecting the service quality. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides an example scheduling method, device, electronic device and storage medium.

[0005] In a first aspect, the present application provides an instance scheduling method, comprising:

[0006] Get declarative configuration information corresponding to each physical cluster in multiple federated clusters;

[0007] Obtaining the status monitoring strategy corresponding to each of the declarative configuration information;

[0008] For each of the declarative configuration information, determine the system working state corresponding to the declarative configuration information based on the state monitoring strategy;

[0009] The application instances corresponding to the declarative configuration information are scheduled among the physical clusters according to the system working status.

[0010] Optionally, determining the system working state corresponding to the declarative configuration information based on the state monitoring strategy includes:

[0011] Extracting the application indicator associated with the declarative configuration information and the indicator range corresponding to the application indicator in the status monitoring strategy;

[0012] Acquire indicator data corresponding to the application indicator in the physical cluster corresponding to the declarative configuration information;

[0013] The system working state corresponding to the declarative configuration information is determined according to the indicator data and the indicator range.

[0014] Optionally, determining the system working state corresponding to the declarative configuration information according to the indicator data and the indicator range includes:

[0015] Determine whether the indicator data is within its corresponding indicator range;

[0016] If the indicator data is within the corresponding indicator range, determining that the system working state corresponding to the declarative configuration information is a normal state;

[0017] If the indicator data is outside the corresponding indicator range, it is determined that the system working state corresponding to the declarative configuration information is an abnormal state.

[0018] Optionally, scheduling the application instances corresponding to the declarative configuration information among the physical clusters according to the system working state includes:

[0019] Obtaining a current scheduling step of an application instance corresponding to the declarative configuration information;

[0020] Extracting target clusters and target quantities in the state monitoring strategy;

[0021] Determine the target scheduling step length according to the system working state and the current scheduling step length;

[0022] The application instances corresponding to the declarative configuration information are scheduled to the target cluster according to the target scheduling step until the target number is reached.

[0023] Optionally, determining a target scheduling step length according to the system working state and a current scheduling step length includes:

[0024] If the system operating state is normal, the current scheduling step size of the application instance is increased to obtain the target scheduling step size.

[0025] Optionally, determining a target scheduling step length according to the system working state and a current scheduling step length includes:

[0026] If the system operating state is an abnormal state and the current scheduling step length is different from the scheduling step length corresponding to the previous polling cycle, the current scheduling step length is kept unchanged, and the current scheduling step length is determined as the target scheduling step length.

[0027] Optionally, determining a target scheduling step length according to the system working state and a current scheduling step length includes:

[0028] If the system operating state is an abnormal state and the current scheduling step size is the same as the scheduling step size corresponding to the previous polling cycle, the current scheduling step size is reduced to obtain the target scheduling step size.

[0029] In a second aspect, the present application provides an instance scheduling device, including:

[0030] A first acquisition module is used to obtain declarative configuration information corresponding to each physical cluster in multiple federated clusters;

[0031] A second acquisition module is used to obtain the status monitoring strategy corresponding to each declarative configuration information;

[0032] A determination module, configured to determine, for each declarative configuration information, a system working state corresponding to the declarative configuration information based on the state monitoring strategy;

[0033] A scheduling module is used to schedule application instances corresponding to the declarative configuration information among the physical clusters according to the system working state.

[0034] Optionally, the determining module includes:

[0035] A first extraction unit, configured to extract, in the status monitoring strategy, an application indicator associated with the declarative configuration information and an indicator range corresponding to the application indicator;

[0036] A first acquisition unit, configured to acquire indicator data corresponding to the application indicator in a physical cluster corresponding to the declarative configuration information;

[0037] A first determining unit is used to determine a system working state corresponding to the declarative configuration information according to the indicator data and the indicator range.

[0038] Optionally, the first determining unit includes:

[0039] A first determining subunit, used to determine whether the indicator data is within its corresponding indicator range;

[0040] A second determining subunit is used to determine that the system working state corresponding to the declarative configuration information is a normal state if the indicator data is within the corresponding indicator range;

[0041] The third determining subunit is used to determine that the system working state corresponding to the declarative configuration information is an abnormal state if the indicator data is outside the corresponding indicator range.

[0042] Optionally, the scheduling module includes:

[0043] A second acquisition unit, configured to acquire a current scheduling step of an application instance corresponding to the declarative configuration information;

[0044] A second extraction unit, configured to extract a target cluster and a target quantity from the state monitoring strategy;

[0045] A second determining unit, configured to determine a target scheduling step length according to the system operating state and a current scheduling step length;

[0046] A scheduling unit is used to schedule the application instances corresponding to the declarative configuration information to the target cluster according to the target scheduling step until the target number is reached.

[0047] Optionally, the second determining unit includes:

[0048] The first step size adjustment subunit is used to increase the current scheduling step size of the application instance to obtain the target scheduling step size if the system working state is normal.

[0049] Optionally, the second determining unit includes:

[0050] The second step adjustment subunit is used to keep the current scheduling step unchanged and determine the current scheduling step as the target scheduling step if the system working state is abnormal and the current scheduling step is different from the scheduling step corresponding to the previous polling cycle.

[0051] Optionally, the second determining unit includes:

[0052] The third step adjustment subunit is used to reduce the current scheduling step size to obtain the target scheduling step size if the system working state is an abnormal state and the current scheduling step size is the same as the scheduling step size corresponding to the previous polling cycle.

[0053] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0054] Memory, used to store computer programs;

[0055] The processor is used to implement any instance scheduling method described in the first aspect when executing a program stored in the memory.

[0056] In a fourth aspect, the present application provides a computer-readable storage medium, on which a program of an instance scheduling method is stored. When the program of the instance scheduling method is executed by a processor, the steps of the instance scheduling method described in any one of the first aspects are implemented.

[0057] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0058] The method provided in the embodiment of the present application, BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0061] Figure 1 A flowchart of an example scheduling method provided in an embodiment of the present application;

[0062] Figure 2 A structural diagram of a system architecture provided for an embodiment of the present application;

[0063] Figure 3 A flowchart of an example scheduling method in a practical application provided in an embodiment of the present application;

[0064] Figure 4 A structural diagram of an example scheduling device provided in an embodiment of the present application;

[0065] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0067] Since the Pod scheduling step size in the prior art does not match the actual state of the system, the services provided by the cluster are unstable. For example, if a configuration with a step size of 1 is uniformly used to schedule Pods, the entire adjustment process will take a lot of time; if the adjustment step size is too large, too many Pods may be created at one time, causing a sudden increase in requests to the upstream and downstream of the service, affecting the service quality. To this end, the embodiments of the present application provide an instance scheduling method, device, electronic device, and storage medium.

[0068] The present application embodiment provides an example scheduling method, such as Figure 1 As shown, the example scheduling method may include the following steps:

[0069] Step S101, obtaining declarative configuration information corresponding to each physical cluster in multiple federated clusters;

[0070] In the embodiment of the present application, the federated cluster includes multiple physical clusters. Exemplarily, the physical cluster may refer to a Kubernetes physical cluster.

[0071] like Figure 2 As shown, federated cluster A: consists of multiple physical K8s clusters; federated cluster B: consists of multiple physical K8s clusters.

[0072] Policy Configuration Center: The policy configuration center stores monitoring-related configurations: 1. Deployment name; 2. Application indicators that need to be monitored; 3. Normal indicator ranges for application indicators; 4. Resource-related configurations include: 1. Deployment name; 2. The expected number of Pods under this Deployment in each physical cluster, that is, the target number, which refers to the expectation before adjustment. For example, at 12:00, there are actually 5 Pods in cluster A and 6 Pods in cluster B. If you want to adjust now, you only need to configure an expected state, that is, set the expected number of 0 Pods in cluster A and 11 Pods in cluster B at 12:01. Then the controller starts the adjustment. The adjustment is completed until the actual and expected values ​​are consistent.

[0073] Indicator monitoring device: This device is responsible for collecting monitoring indicators related to each cluster. The global controller will judge the health of the entire Deployment based on these indicators.

[0074] Global controller: Responsible for receiving the configuration of each Deployment from the policy configuration center. Then, the global controller monitors the health information of each Deployment and decides whether to increase or decrease the scheduling step of the Pod.

[0075] In order to deploy containerized applications on a Kubernetes cluster, you need to create a Kubernetes deployment controller configuration (Deployment). Deployment specifies the template of the target application instance, the number of required replicas, and other configuration details in a declarative form. After receiving this configuration, the system will generate the corresponding number of application instances (Pods) based on the template and reasonably distribute them to the computing nodes in the cluster.

[0076] Among them, Pod: In Kubernetes (an open source container orchestration system), Pod is the smallest deployment unit that can create and manage a group of related containers. They share storage resources and can communicate with each other through localhost.

[0077] Pod Ready: In Kubernetes, the "Ready" state of a Pod means that all containers in the Pod have been successfully started and are ready to accept traffic.

[0078] Deployment: In Kubernetes, a Deployment is an object that describes the desired state and can create and update Pod instances. Deployment ensures that when a Pod or node fails, the Kubernetes system will create a new Pod to replace it, thereby ensuring that the application always runs stably.

[0079] K8s: Also known as Kubernetes, it is an open source container orchestration platform whose main function is to automate the deployment, expansion, and management of containerized applications.

[0080] In this step, the declarative configuration information, that is, the Deployment information, in each physical cluster in the federated cluster may be periodically obtained for each federated cluster according to a preset polling cycle.

[0081] Step S102, obtaining a status monitoring strategy corresponding to each of the declarative configuration information;

[0082] In order to understand the system working status related to the application instance, the declarative configuration information can be monitored. Different declarative configuration information corresponds to different status monitoring strategies. Therefore, this step can obtain the corresponding status monitoring strategy for each declarative configuration information.

[0083] Step S103, for each declarative configuration information, determining the system working state corresponding to the declarative configuration information based on the state monitoring strategy;

[0084] The status monitoring strategy may include: application indicators associated with the declarative configuration information, and indicator ranges corresponding to the application indicators. Exemplarily, the application indicators associated with the declarative configuration information may be success rate, response time, and the like.

[0085] In this step, the status monitoring strategy corresponding to each declarative configuration information can be used to determine whether the application indicator associated with the declarative configuration information is within the corresponding indicator range, thereby obtaining the system working status corresponding to the declarative configuration information, and then facilitating understanding of the system working status related to the application instance.

[0086] Step S104: scheduling application instances corresponding to the declarative configuration information among the physical clusters according to the system working status.

[0087] In this step, the application instances may be scheduled between physical clusters in different federated clusters according to the system working status of the cluster, or may be scheduled between different physical clusters in the same federated cluster.

[0088] The embodiment of the present application monitors the system working status corresponding to the declarative configuration information and schedules the application instances between physical clusters according to the system working status, so as to better adapt to the changes in the system status and make the scheduling of the application instances more closely match the system working status of the cluster, thereby avoiding the situation where a one-time large-scale adjustment leads to system instability and a small-scale adjustment leads to low scheduling efficiency.

[0089] In another embodiment of the present application, step S103 determines the system working state corresponding to the declarative configuration information based on the state monitoring strategy, including:

[0090] Step S201, extracting application indicators associated with the declarative configuration information and indicator ranges corresponding to the application indicators in the status monitoring strategy;

[0091] In an embodiment of the present application, the status monitoring strategy includes: application indicators associated with the declarative configuration information and indicator ranges corresponding to the application indicators. The application indicators associated with the declarative configuration information can reflect the system working status corresponding to the declarative configuration information, and the indicator range can limit the normal range of the application indicators.

[0092] In this step, the application indicators and indicator ranges contained in the status monitoring strategy may be extracted.

[0093] Step S202, obtaining indicator data corresponding to the application indicator in the physical cluster corresponding to the declarative configuration information;

[0094] For example, if the application indicator is success rate, you can obtain the success rate data within the polling cycle in the physical cluster corresponding to the declarative configuration information;

[0095] For another example, if the application indicator is response time, the response time at the current moment can be obtained in the physical cluster corresponding to the declarative configuration information.

[0096] Step S203: determining the system working state corresponding to the declarative configuration information according to the indicator data and the indicator range.

[0097] In this step, it can be determined whether the indicator data is within its corresponding indicator range; if the indicator data is within its corresponding indicator range, it is determined that the system working state corresponding to the declarative configuration information is a normal state; if the indicator data is outside its corresponding indicator range, it is determined that the system working state corresponding to the declarative configuration information is an abnormal state.

[0098] The embodiment of the present application can determine the system working state corresponding to the declarative configuration information according to whether the indicator data corresponding to the application indicator is within the indicator range corresponding to the application indicator, so as to schedule the application instance according to the system working state and ensure that the scheduling of the application instance better adapts to the system working state.

[0099] In another embodiment of the present application, step S104 schedules the application instances corresponding to the declarative configuration information among the physical clusters according to the system working state, including:

[0100] Step S301, obtaining the current scheduling step of the application instance corresponding to the declarative configuration information;

[0101] In this step, since the scheduling step length has not yet been determined in the current polling cycle, the current scheduling step length is the scheduling step length determined in the previous polling cycle.

[0102] Step S302, extracting the target cluster and the target quantity in the status monitoring strategy;

[0103] In the embodiment of the present application, the state monitoring strategy includes: a target cluster to which the application instance is to be scheduled and a target number of application instances to be scheduled to the target cluster.

[0104] In this step, the target clusters and target quantities contained in the status monitoring policy may be extracted.

[0105] Step S303, determining a target scheduling step length according to the system working state and the current scheduling step length;

[0106] In one implementation of the present application, if the system operating state is normal, the current scheduling step size of the application instance is increased to obtain the target scheduling step size;

[0107] In this implementation, when the system is in a normal operating state, the scheduling step size may be increased to improve scheduling efficiency.

[0108] In another embodiment of the present application, if the system working state is an abnormal state and the current scheduling step size is different from the scheduling step size corresponding to the previous polling period, the current scheduling step size is kept unchanged, and the current scheduling step size is determined as the target scheduling step size;

[0109] In this implementation, the previous polling cycle refers to the polling cycle before the previous polling cycle, and the scheduling step corresponding to the previous polling cycle refers to the scheduling step determined by the polling cycle before the previous polling cycle. The difference between the current scheduling step and the scheduling step corresponding to the previous polling cycle indicates that the scheduling step of the previous polling cycle has been adjusted to increase or decrease, and the scheduling step has not been kept unchanged before. At this time, if the system working state is abnormal, the current scheduling step can be kept unchanged, and the current scheduling step is determined as the target scheduling step, so that the system working state can be restored to normal by keeping the scheduling step unchanged.

[0110] In another implementation of the present application, if the system operating state is an abnormal state and the current scheduling step is the same as the scheduling step corresponding to the previous polling cycle, the current scheduling step is reduced to obtain the target scheduling step.

[0111] The current scheduling step is the same as the scheduling step corresponding to the previous polling cycle, which indicates that the scheduling step of the previous polling cycle has not been adjusted to increase or decrease, and the scheduling step has been kept unchanged before. At this time, if the system working state is abnormal, the current scheduling step can be reduced, in order to restore the system working state to normal by reducing the scheduling step.

[0112] Step S304: Schedule the application instances corresponding to the declarative configuration information to the target cluster according to the target scheduling step until the target number is reached.

[0113] In this step, the application instances corresponding to the declarative configuration information may be deleted from the old cluster according to the target scheduling step, and created on the new target cluster according to the target scheduling step until the target number is reached.

[0114] The embodiment of the present application can adaptively adjust the step size. This adaptive step size adjustment strategy can improve the scheduling speed and operation and maintenance efficiency while ensuring service stability, thereby achieving an intelligent balance between ensuring system stability and improving efficiency.

[0115] Based on the above embodiment, taking the migration of x Pods in the A2 physical cluster under the federated cluster A to the A1 physical cluster as an example, the process of adaptive instance scheduling is as follows: Figure 3 shown.

[0116] 1. The global controller obtains the health configuration (i.e., the status monitoring policy of the aforementioned embodiment) and resource distribution configuration (i.e., the distribution status of application instances in the old cluster) of all Deployments from the policy configuration center;

[0117] 2. The policy configuration center returns configuration information;

[0118] 3. The global controller starts adjusting all Deployments. For Deployment D, assuming that the current Pod distribution of federated cluster A is A1:25, A2:20, and the expected distribution is A1:35, A2:10, a new Pod is created on A1 with an initialization step of 1.

[0119] 4. The global controller periodically polls the indicator monitoring device for health information of Deployment D, i.e., the declarative configuration information of the aforementioned embodiment;

[0120] 5. The indicator monitoring device returns the monitored health information;

[0121] 6. Global control checks whether the newly created Pod Ready on A1 is Ready. In Kubernetes, the "Ready" status of a Pod indicates that all containers in the Pod have been successfully started and are ready to receive traffic.

[0122] 7. When the newly created Pod on A1 is Ready, it starts to reduce one Pod on A2 with a step size of 1;

[0123] 8. During this round of adjustment, the global controller determines whether the indicator corresponding to Deployment D is within the configured normal range. If it is within the normal range, the next round of adjustment step is changed to 2, that is, first start 2 Pods in A1, and reduce 2 Pods in A2 after the Pod is Ready. If the indicator is normal, the step size will continue to increase in the next round, otherwise it will decrease until the Pod distribution is A1:35, A2:10.

[0124] In another embodiment of the present application, an instance scheduling device is also provided, such as Figure 4 As shown, including:

[0125] A first acquisition module 11 is used to acquire declarative configuration information corresponding to each physical cluster in multiple federated clusters;

[0126] A second acquisition module 12 is used to acquire a status monitoring strategy corresponding to each of the declarative configuration information;

[0127] A determination module 13, configured to determine, for each declarative configuration information, a system working state corresponding to the declarative configuration information based on the state monitoring strategy;

[0128] The scheduling module 14 is used to schedule the application instances corresponding to the declarative configuration information among the physical clusters according to the system working status.

[0129] Optionally, the determining module includes:

[0130] A first extraction unit, configured to extract, in the status monitoring strategy, an application indicator associated with the declarative configuration information and an indicator range corresponding to the application indicator;

[0131] A first acquisition unit, configured to acquire indicator data corresponding to the application indicator in a physical cluster corresponding to the declarative configuration information;

[0132] A first determining unit is used to determine a system working state corresponding to the declarative configuration information according to the indicator data and the indicator range.

[0133] Optionally, the first determining unit includes:

[0134] A first determining subunit, used to determine whether the indicator data is within its corresponding indicator range;

[0135] A second determining subunit is used to determine that the system working state corresponding to the declarative configuration information is a normal state if the indicator data is within the corresponding indicator range;

[0136] The third determining subunit is used to determine that the system working state corresponding to the declarative configuration information is an abnormal state if the indicator data is outside the corresponding indicator range.

[0137] Optionally, the scheduling module includes:

[0138] A second acquisition unit, configured to acquire a current scheduling step of an application instance corresponding to the declarative configuration information;

[0139] A second extraction unit, configured to extract a target cluster and a target quantity from the state monitoring strategy;

[0140] A second determining unit, configured to determine a target scheduling step length according to the system operating state and a current scheduling step length;

[0141] A scheduling unit is used to schedule the application instances corresponding to the declarative configuration information to the target cluster according to the target scheduling step until the target number is reached.

[0142] Optionally, the second determining unit includes:

[0143] The first step size adjustment subunit is used to increase the current scheduling step size of the application instance to obtain the target scheduling step size if the system working state is normal.

[0144] Optionally, the second determining unit includes:

[0145] The second step adjustment subunit is used to keep the current scheduling step unchanged and determine the current scheduling step as the target scheduling step if the system working state is abnormal and the current scheduling step is different from the scheduling step corresponding to the previous polling cycle.

[0146] Optionally, the second determining unit includes:

[0147] The third step adjustment subunit is used to reduce the current scheduling step size to obtain the target scheduling step size if the system working state is an abnormal state and the current scheduling step size is the same as the scheduling step size corresponding to the previous polling cycle.

[0148] In another embodiment of the present application, an electronic device is provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;

[0149] Memory, used to store computer programs;

[0150] The processor is used to implement the instance scheduling method described in any of the above method embodiments when executing the program stored in the memory.

[0151] In the electronic device provided by the embodiment of the present invention, the processor realizes the system working state corresponding to the monitoring declarative configuration information by executing the program stored in the memory, and schedules the application instances between physical clusters according to the system working state. This can better adapt to the changes in the system state, make the scheduling of the application instance more matched with the system working state of the cluster, avoid the situation where a one-time large-scale adjustment causes system instability, and avoid the situation where a small adjustment causes low scheduling efficiency.

[0152] The communication bus 1140 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0153] The communication interface 1120 is used for communication between the above electronic device and other devices.

[0154] The memory 1130 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0155] The above-mentioned processor 1110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0156] In another embodiment of the present application, a computer-readable storage medium is provided, on which a program of the instance scheduling method is stored. When the program of the instance scheduling method is executed by a processor, the steps of the instance scheduling method described in any of the aforementioned method embodiments are implemented.

[0157] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0158] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. An instance scheduling method, characterized in that: include: Get declarative configuration information corresponding to each physical cluster in multiple federated clusters; Obtaining the status monitoring strategy corresponding to each of the declarative configuration information; For each of the declarative configuration information, determine the system working state corresponding to the declarative configuration information based on the state monitoring strategy; The application instances corresponding to the declarative configuration information are scheduled among the physical clusters according to the system working status.

2. The instance scheduling method according to claim 1, characterized in that: Determining the system working state corresponding to the declarative configuration information based on the state monitoring strategy includes: Extracting the application indicator associated with the declarative configuration information and the indicator range corresponding to the application indicator in the status monitoring strategy; Acquire indicator data corresponding to the application indicator in the physical cluster corresponding to the declarative configuration information; The system working state corresponding to the declarative configuration information is determined according to the indicator data and the indicator range.

3. The instance scheduling method according to claim 2, characterized in that: Determining the system working state corresponding to the declarative configuration information according to the indicator data and the indicator range includes: Determine whether the indicator data is within its corresponding indicator range; If the indicator data is within the corresponding indicator range, determining that the system working state corresponding to the declarative configuration information is a normal state; If the indicator data is outside the corresponding indicator range, it is determined that the system working state corresponding to the declarative configuration information is an abnormal state.

4. The instance scheduling method according to claim 1, characterized in that: Scheduling the application instances corresponding to the declarative configuration information among the physical clusters according to the system working state includes: Obtaining a current scheduling step of an application instance corresponding to the declarative configuration information; Extracting target clusters and target quantities in the state monitoring strategy; Determine the target scheduling step length according to the system working state and the current scheduling step length; The application instances corresponding to the declarative configuration information are scheduled to the target cluster according to the target scheduling step until the target number is reached.

5. The instance scheduling method according to claim 4, characterized in that: Determining a target scheduling step length according to the system working state and the current scheduling step length includes: If the system operating state is normal, the current scheduling step size of the application instance is increased to obtain the target scheduling step size.

6. The instance scheduling method according to claim 4, characterized in that: Determining a target scheduling step length according to the system working state and the current scheduling step length includes: If the system working state is an abnormal state and the current scheduling step length is different from the scheduling step length corresponding to the previous polling cycle, the current scheduling step length is kept unchanged, and the current scheduling step length is determined as the target scheduling step length.

7. The instance scheduling method according to claim 4, characterized in that: Determining a target scheduling step length according to the system working state and the current scheduling step length includes: If the system operating state is an abnormal state and the current scheduling step size is the same as the scheduling step size corresponding to the previous polling cycle, the current scheduling step size is reduced to obtain the target scheduling step size.

8. An instance scheduling device, characterized in that: include: A first acquisition module is used to obtain declarative configuration information corresponding to each physical cluster in multiple federated clusters; A second acquisition module is used to obtain the status monitoring strategy corresponding to each declarative configuration information; A determination module, configured to determine, for each declarative configuration information, a system working state corresponding to the declarative configuration information based on the state monitoring strategy; A scheduling module is used to schedule application instances corresponding to the declarative configuration information among the physical clusters according to the system working state.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the instance scheduling method described in any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program of the instance scheduling method, and when the program of the instance scheduling method is executed by a processor, the steps of the instance scheduling method described in any one of claims 1 to 7 are implemented.