Scheduling method and device, electronic equipment, storage medium and computer program product

By configuring scheduling parameters for Pods based on the remaining amount of memory of the physical machine in the Kubernetes system, the problem of high network communication between Pods is solved, and more efficient system performance is achieved.

CN120045317APending Publication Date: 2025-05-27CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510056133.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In Kubernetes (K8S) systems, the network communication delay between pods is high because the pod is scheduled to different physical machines, resulting in network communication that needs to cross-physical machine network cards.

Method used

By configuring scheduling parameters for Pods based on the remaining memory of the physical machine, multiple Pods are scheduled to the same physical machine as much as possible, thereby reducing network communication delay.

Benefits of technology

It reduces the network communication delay between pods and improves the performance and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045317A_ABST
    Figure CN120045317A_ABST
Patent Text Reader

Abstract

The invention discloses a scheduling method and device, electronic equipment, a storage medium and a computer program product, and the method comprises the steps: configuring a first parameter for a configuration file corresponding to each Pod in one or more Pods corresponding to a first scheduling task based on the remaining memory amount of each physical machine in one or more physical machines; the first parameter is used for indicating the physical machine to which the corresponding Pod is scheduled; wherein under the condition that the remaining memory amount of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured as an instruction for the first physical machine; the first memory application quantity represents the total quantity of memories required to be applied to the physical machine for scheduling one or more Pods; submitting a configuration file corresponding to each Pod in the one or more Pods to an interface service component of the K8S cluster to schedule the corresponding Pod; wherein under the condition that the one or more Pods are all scheduled to the corresponding physical machines, the first scheduling task is ended.
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 a scheduling method, device, electronic device, storage medium and computer program product. Background Art

[0002] In the related technology, based on the maximum concurrency supported by a single Pod in the Kubernetes (K8S) system, the number of Pods that need to be scheduled in the business scenario is determined, and then the number of Pods is evenly distributed to each physical machine in multiple physical machines based on the scheduling algorithm of the K8S cluster. When the business scenario requires communication between Pods, the network communication latency is relatively high. Summary of the invention

[0003] To solve related technical problems, the embodiments of the present application provide a scheduling method, device, electronic device, storage medium and computer program product.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a scheduling method, the method comprising:

[0006] Based on the remaining memory amount of each physical machine in the one or more physical machines, a first parameter is configured for a configuration file corresponding to each Pod in the one or more Pods corresponding to the first scheduling task; the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled; wherein, when the remaining memory amount of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured as an indication of the first physical machine; the first memory application amount represents: the total amount of memory that needs to be applied to the physical machine for scheduling the one or more Pods;

[0007] Submit the configuration file corresponding to each of the one or more Pods to the interface service component of the K8S cluster to schedule the corresponding Pod; wherein, when all of the one or more Pods are scheduled to the corresponding physical machines, the first scheduling task is completed.

[0008] In the above scheme, the configuration of the first parameter for the configuration file corresponding to each Pod in the one or more Pods corresponding to the first scheduling task based on the remaining memory of each physical machine in the one or more physical machines also includes:

[0009] When the remaining memory amount of the first physical machine is less than the first memory application amount,

[0010] Configure the first parameter corresponding to each Pod in the first quantity of Pods as an indication of the first physical machine; the first quantity represents: the maximum number of schedulable Pods supported by the remaining memory of the first physical machine;

[0011] Configure the first parameter corresponding to each Pod in the second quantity of Pods as an indication of the second physical machine; the second quantity of Pods represents: all or part of the Pods among the one or more Pods except the first quantity of Pods; the remaining memory of the second physical machine is greater than or equal to: the total amount of memory required to be applied to the physical machine for scheduling the second quantity of Pods.

[0012] In the above solution, the first physical machine represents the physical machine with the highest remaining memory among the one or more physical machines.

[0013] In the above solution, the method further includes:

[0014] Call the set interface of each physical machine among the one or more physical machines to obtain the remaining memory of the corresponding physical machine in real time, and update the first resource pool; the first resource pool is used to record the remaining memory of each physical machine among the one or more physical machines.

[0015] In the above solution, after configuring the first parameter for the configuration file corresponding to each Pod in one or more Pods corresponding to the first scheduling task, the method further includes:

[0016] Record the second memory application amount corresponding to each Pod in the one or more Pods in the first resource table; the second memory application amount represents: the amount of memory required to be applied to the physical machine for scheduling the corresponding Pod; the first resource table is used to jointly calculate the unapplied and unused memory of each physical machine with the first resource pool; the first resource pool is used to record the remaining memory of each physical machine among the one or more physical machines.

[0017] In the above solution, after the one or more Pods are scheduled to the physical machine, the method further includes:

[0018] Delete the record of the memory application amount corresponding to each Pod in the one or more Pods in the first resource table.

[0019] An embodiment of the present application further provides a scheduling method, and the method includes:

[0020] Allocate time slices to each first scheduling task in one or more first scheduling tasks in a loop; the time slice represents a period of time allowing the corresponding first scheduling task to execute;

[0021] Schedule the Pod corresponding to the first scheduling task assigned to a time slice based on the steps of any of the above methods.

[0022] In the above solution, the scheduling of the Pod corresponding to the first scheduling task assigned to a time slice includes:

[0023] During the first time period corresponding to the time slice, submit the configuration file corresponding to each first Pod corresponding to the first scheduling task assigned to the time slice to the interface service component of the K8S cluster; the first Pod represents the Pod determined to be triggered for scheduling during the first time period; the first Pod continues to be scheduled to the corresponding physical machine at times outside the first time period.

[0024] An embodiment of the present application further provides a scheduling device, including:

[0025] A configuration unit, configured to configure a first parameter for the configuration file corresponding to each Pod in one or more Pods corresponding to a first scheduling task based on the remaining memory of each physical machine in one or more physical machines; the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled; wherein, when the remaining memory of the first physical machine is greater than or equal to the first memory application amount, configure the first parameter corresponding to each Pod as an indication of the first physical machine; the first memory application amount represents: the total amount of memory that needs to be applied to the physical machine for scheduling the one or more Pods;

[0026] A first scheduling unit, configured to submit the configuration file corresponding to each Pod in the one or more Pods to the interface service component of the K8S cluster to schedule the corresponding Pod; wherein, when all of the one or more Pods are scheduled to the corresponding physical machines, the first scheduling task ends.

[0027] An embodiment of the present application further provides a scheduling device, including:

[0028] An allocation unit, configured to allocate time slices to each first scheduling task in one or more first scheduling tasks in a loop; the time slice represents a period of time allowing the corresponding first scheduling task to execute;

[0029] A second scheduling unit, configured to schedule the Pod corresponding to the first scheduling task assigned to a time slice based on the steps of any of the above methods.

[0030] An embodiment of the present application further provides an electronic device, including: a first processor and a first memory for storing a computer program capable of running on the processor,

[0031] Wherein, when the first processor is used to run the computer program, it executes the steps of any of the above methods.

[0032] The embodiments of the present application also provide a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0033] The embodiments of the present application also provide a computer program product, including a computer program. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0034] In the embodiments of the present application, based on the remaining memory of each physical machine among one or more physical machines, a first parameter is configured for the configuration file corresponding to each of the one or more Pods corresponding to the first scheduling task; the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled; wherein, when the remaining memory of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured to indicate the first physical machine; the first memory application amount represents: the total amount of memory required to be applied to the physical machine for scheduling one or more Pods; then, the configuration file corresponding to each of the one or more Pods is submitted to the interface service component of the K8S cluster to schedule the corresponding Pod; wherein, when all of the one or more Pods are scheduled to the corresponding physical machines, the first scheduling task ends. In this way, one or more Pods in the scheduling task are scheduled to the same physical machine as much as possible. Compared with the related art, most of the network communications between these Pods do not need to cross the physical machine network card, thereby reducing the network communication delay. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic implementation flow diagram of a scheduling method provided by the embodiments of the present application;

[0036] Figure 2 It is a schematic diagram of a configuration file provided by the embodiments of the present application;

[0037] Figure 3 It is a schematic implementation flow diagram of another scheduling method provided by the embodiments of the present application;

[0038] Figure 4 It is a schematic overall architecture diagram of a scheduling system provided by the application embodiments of the present application;

[0039] Figure 5 It is a schematic overall flow diagram of a scheduling method provided by the application embodiments of the present application;

[0040] Figure 6 It is a schematic flow diagram of a scheduling method provided by the application embodiments of the present application;

[0041] Figure 7 It is a schematic structural diagram of a scheduling device provided by the embodiments of the present application;

[0042] Figure 8 A schematic diagram of the structure of another scheduling device provided in an embodiment of the present application;

[0043] Figure 9 A schematic diagram of the structure of the hardware composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In a K8S cluster, Pod represents the smallest basic unit that can be scheduled and managed. In practical applications, scheduling Pod can be understood as: assigning Pod to a node in a K8S cluster, and starting and running the Pod; where the node in a K8S cluster can be a physical machine.

[0045] In the related technology, based on the maximum concurrency supported by a single Pod in the K8S cluster, the number of Pods that need to be scheduled in the business scenario is determined, and then based on the scheduling algorithm that comes with the K8S cluster, the number of Pods is evenly distributed to each physical machine in multiple physical machines. Specifically, before scheduling the Pod, the Pod can be stress-tested and analyzed based on the business scenario to determine the maximum concurrency supported by a single Pod, and based on the historical access log records of the business scenario, the historical business access volume of the business scenario is counted, and then the business access volume of the business scenario in the future time period is predicted; then, based on the maximum concurrency supported by a single Pod and the predicted business access volume, the number of Pods that need to be scheduled in the business scenario is determined; then, based on the scheduling algorithm that comes with the K8S cluster, the number of Pods is hashed and scheduled to each physical machine in multiple physical machines, so that the number of Pods is evenly distributed on each physical machine.

[0046] In actual applications, when two Pods are distributed to different physical machines, the two Pods need to cross the physical machine network card during network communication, resulting in a high network communication latency between the two Pods. Therefore, in the related art, the network communication latency between the Pods scheduled to the physical machine is high.

[0047] Based on this, in the embodiments of the present application, based on the remaining memory amount of each physical machine among one or more physical machines, a first parameter is configured for the configuration file corresponding to each Pod among one or more Pods corresponding to the first scheduling task; the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled; wherein, when the remaining memory amount of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured as an indication of the first physical machine; the first memory application amount represents: the total amount of memory that needs to be applied to the physical machine for scheduling one or more Pods; then, the configuration file corresponding to each Pod among one or more Pods is submitted to the interface service component of the K8S cluster to schedule the corresponding Pod; wherein, when all of the one or more Pods are scheduled to the corresponding physical machines, the first scheduling task ends. In this way, one or more Pods in the scheduling task are scheduled to the same physical machine as much as possible. Compared with the related art, most of the network communications between these Pods do not need to cross the physical machine network card, thereby reducing the network communication delay.

[0048] The following further describes the present application in detail with reference to the accompanying drawings and embodiments.

[0049] Embodiments of the present application provide a scheduling method. Refer to Figure 1 , the method includes:

[0050] Step 101: Based on the remaining memory amount of each physical machine among one or more physical machines, a first parameter is configured for the configuration file corresponding to each Pod among one or more Pods corresponding to the first scheduling task.

[0051] Wherein, the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled.

[0052] Wherein, when the remaining memory amount of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured as an indication of the first physical machine; the first memory application amount represents: the total amount of memory that needs to be applied to the physical machine for scheduling one or more Pods.

[0053] In practical applications, the first scheduling task can be understood as a scheduling task to be executed. Pods to be scheduled with the same service attribute can be corresponding to the same first scheduling task, and the Pods are scheduled in terms of the scheduling task, thereby increasing the scheduling efficiency. The service attribute can be understood as relevant information for business requirements, for example, business functions or image types, etc.

[0054] In practical applications, scheduling one or more Pods corresponding to the first scheduling task can be understood as executing the first scheduling task, or can also be expressed as scheduling the first scheduling task.

[0055] In practical applications, a configuration file can be generated for each Pod corresponding to the first scheduling task. The K8S cluster can schedule the Pods based on the configuration files corresponding to each Pod. Exemplarily, the configuration file can be a yml file, that is, it follows the yml syntax.

[0056] Here, the first parameter is the parameter in the configuration file. In practical applications, the first parameter can also be expressed as a node affinity parameter, which can be understood as having the node affinity function. Exemplarily, the first parameter can be "affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution".

[0057] In practical applications, configuring the first parameter for the configuration file corresponding to each Pod in one or more Pods corresponding to the first scheduling task can mainly include the following steps:

[0058] Step 1: Determine the physical machine to which each Pod will be scheduled.

[0059] In practical applications, when the remaining memory of the first physical machine is greater than or equal to the first memory application amount, the first physical machine can be determined as the physical machine to which each Pod will be scheduled.

[0060] Step 2: Label the determined physical machines.

[0061] In practical applications, labeling the physical machines can be understood as: setting a label for the physical machines. This label can be used to distinguish each physical machine and can also be expressed as the identifier of the physical machine. The label can consist of two parts: a key and a value. Exemplarily, for a label "key1 = value1", key1 can be understood as the key of the label, and value1 can be understood as the value of the label.

[0062] In practical applications, based on the command-line management tool provided by K8S, such as kubectl, a setting instruction can be executed to label the determined physical machines. During the process of labeling the determined physical machines, the key of the label of the physical machine can be set as the task identifier of the first scheduling task.

[0063] Exemplarily, the setting instruction can be "kubectl label node node1 task1 = 1", where this instruction is used to indicate labeling the physical machine named node1, that is, setting the key of the label of this physical machine as task1, and task1 is equivalent to the task identifier of the first scheduling task in the embodiments of the present application.

[0064] Step 3: Based on the determined tags of the physical machines, configure the first parameter for the configuration file corresponding to each Pod of the first scheduling task.

[0065] In practical applications, when the K8S cluster performs scheduling based on this configuration file, it can schedule the Pod to the physical machine corresponding to the tag corresponding to the first parameter.

[0066] Figure 2 An example of a configuration file with the first parameter configured is provided. Here, "preferredDuringSchedulingIgnoredDuringExecution" is equivalent to the first parameter in the embodiments of the present application. The tag of the determined physical machine corresponding to the Pod corresponding to the first parameter is task1. Based on this, the key of the first parameter is configured as task1. When the K8S cluster performs scheduling based on this configuration file, it can schedule the Pod to the physical machine whose tag key is task1, that is, it can schedule the Pod to the determined physical machine.

[0067] In practical applications, the remaining memory of a physical machine can be understood as the unused memory in the physical machine, or it can also be expressed as the memory amount of the remaining memory. Before the Pod is scheduled to the physical machine, the Pod can first apply for memory resources from the physical machine. In this case, the memory resources applied by the Pod in the physical machine have not been used yet, and the memory resources that have been applied and not used can be expressed as: pre-used memory resources; after the Pod is scheduled to the physical machine, the Pod has been started and becomes effective, and the physical machine runs the Pod based on the memory resources applied by the Pod. In this case, the memory resources applied by the Pod in the physical machine are used, rather than pre-used.

[0068] Here, when the remaining memory of the first physical machine is greater than or equal to the first memory application amount, configure the first parameter corresponding to each Pod as an indication of the first physical machine. That is to say, in this case, when the K8S cluster performs scheduling based on the configuration file corresponding to one or more Pods of the first scheduling task, it will schedule each Pod to the first physical machine, and the remaining memory of the first physical machine can support one or more Pods corresponding to the first scheduling task. In this way, one or more Pods in the scheduling task can be scheduled to the same physical machine, thereby reducing the communication delay between Pods.

[0069] In practical applications, the first memory application amount can be calculated based on the second memory application amount corresponding to each Pod of the first scheduling task. The second memory application amount can be understood as: the memory amount that needs to be applied to the physical machine to schedule the corresponding Pod. Exemplarily, the first memory application amount can be equal to the sum of the second memory application amounts corresponding to all Pods of the first scheduling task.

[0070] In practical applications, one or more physical machines can be all the physical machines in a K8S cluster.

[0071] In practical applications, based on the remaining memory of each physical machine among one or more physical machines and the first memory application amount, one or more physical machines can be screened, and the physical machines that meet the first set condition can be marked. Exemplarily, the physical machines that meet the first set condition can be marked as physical machines with a high scheduling priority; then, a first physical machine can be determined from the physical machines that meet the first set condition. The first set condition includes: the remaining memory is greater than or equal to the first memory application amount.

[0072] In one embodiment, the first physical machine represents the physical machine with the highest remaining memory among one or more physical machines.

[0073] In practical applications, when there are physical machines that meet the first set condition among one or more physical machines, the physical machine with the highest remaining memory among the physical machines that meet the first set condition can be determined as the first physical machine. It can be understood that the determined first physical machine is also the physical machine with the highest remaining memory among one or more physical machines.

[0074] In practical applications, when there are no physical machines that meet the first set condition among one or more physical machines, the physical machine with the highest remaining memory among one or more physical machines can be determined as the first physical machine.

[0075] In one embodiment, based on the remaining memory of each physical machine among one or more physical machines, configuring a first parameter for the configuration file corresponding to each Pod among one or more Pods corresponding to the first scheduling task further includes:

[0076] When the remaining memory of the first physical machine is less than the first memory application amount,

[0077] Configure the first parameter corresponding to each Pod among the first number of Pods as an indication of the first physical machine; the first number represents: the maximum number of schedulable Pods supported by the remaining memory of the first physical machine;

[0078] Configure the first parameter corresponding to each Pod among the second number of Pods as an indication of the second physical machine; the second number of Pods represents: all or part of the Pods among one or more Pods except the first number of Pods; the remaining memory of the second physical machine is greater than or equal to: the total amount of memory required to be applied to the physical machine for scheduling the second number of Pods.

[0079] Here, the first quantity of Pods can be understood as: the Pods determined to be scheduled to the first physical machine. Since the first quantity represents: the maximum number of Pods supported by the remaining memory of the first physical machine, therefore, the first physical machine cannot support scheduling: Pods other than the first quantity of Pods among one or more Pods.

[0080] Understandably, the first quantity is the maximum number of Pods that the first physical machine can support. Therefore, although it is not possible to make the first physical machine support all Pods, the remaining memory of the first physical machine has been fully utilized. Configure the first parameter corresponding to each Pod in the first quantity of Pods as an indication to the first physical machine: It can be regarded as: regarding the first physical machine as the physical machine to which each Pod will be scheduled as much as possible, that is, scheduling one or more Pods to the first physical machine as much as possible.

[0081] In practical applications, for the Pods that the first physical machine cannot support scheduling, that is, the remaining Pods other than the first quantity of Pods, the second physical machine can be used as the physical machine to which these Pods will be scheduled as much as possible. The second physical machine can be the physical machine with the second-highest remaining memory among one or more physical machines.

[0082] In the case where the remaining memory of the second physical machine is greater than or equal to: the total amount of memory that all Pods other than the first quantity of Pods among one or more Pods need to apply to the physical machine, the first parameter corresponding to all Pods other than the first quantity of Pods can be configured as an indication to the second physical machine.

[0083] In the case where the remaining memory of the second physical machine is less than: the total amount of memory that all Pods other than the first quantity of Pods among one or more Pods need to apply to the physical machine, the first parameter corresponding to some of the Pods other than the first quantity of Pods can be configured as an indication to the second physical machine. In this case, the number of Pods whose first parameter is configured as an indication to the second physical machine can be the maximum number of Pods that the second physical machine can support.

[0084] For the Pods that the second physical machine cannot support scheduling, referring to the above method of configuring the first parameter, the first parameter of the configuration file corresponding to these Pods can be configured as an indication to the same physical machine as much as possible.

[0085] Step 102: Submit the configuration file corresponding to each Pod in one or more Pods to the interface service component of the K8S cluster to schedule the corresponding Pod.

[0086] Among them, in the case where all of one or more Pods are scheduled to the corresponding physical machine, the first scheduling task ends.

[0087] In practical applications, the interface service component can be the API Server component of the K8S cluster, also known as k8s-api-server. After submitting the configuration file corresponding to the Pod to the interface service component of the K8S cluster, the interface service component can create resources on the corresponding physical machine based on the configuration file, thereby starting and running the Pod, that is, scheduling the Pod to the corresponding physical machine.

[0088] Exemplarily, after submitting the configuration file corresponding to the Pod to the interface service component of the K8S cluster, the interface service component can execute a set instruction, such as "kubectl apply -f pod.yml", thereby scheduling the Pod to the corresponding physical machine. Among them, "pod.yml" can be regarded as the file name of the configuration file submitted to the interface service component.

[0089] It should be noted that submitting the Pod configuration file to the interface service component of the K8S cluster can only be regarded as triggering the K8S cluster to schedule the Pod. At this time, the Pod has not been scheduled to the corresponding physical machine. Only after the scheduling operation of the K8S cluster on the Pod is completed can it be regarded that the Pod has been scheduled to the corresponding physical machine, that is, the scheduling of the Pod is completed.

[0090] In the embodiments of the present application, the first parameter of the configuration file corresponding to one or more Pods in the scheduling task is configured as an indication of the same physical machine as much as possible. Therefore, one or more Pods in the scheduling task can be scheduled to the same physical machine as much as possible. Compared with the related art, most of the network communications between these Pods do not need to cross the physical machine network card, thereby reducing the network communication delay.

[0091] In practical applications, the memory amount and memory application amount involved in the solution of the embodiments of the present application can be managed, that is, the memory resources are managed. The management method of the memory resources will be further described below.

[0092] In one embodiment, the scheduling method provided by the embodiments of the present application further includes:

[0093] Call the set interface of each physical machine in one or more physical machines to obtain the remaining memory amount of the corresponding physical machine in real time, and update the first resource pool; the first resource pool is used to record the remaining memory amount of each physical machine in one or more physical machines.

[0094] In practical applications, the set interface on the physical machine can be used to obtain the remaining memory amount of the physical machine in real time. Exemplarily, the set interface can be the node-exporter interface.

[0095] In practical applications, the set interfaces of each physical machine among one or more physical machines can be called at set time intervals to update the first resource pool. Also, after a Pod scheduled on a physical machine is destroyed, the set interface of the physical machine can be called to update the first resource pool. During the process of updating the first resource pool, the record of the remaining memory of the corresponding physical machine obtained in real time can be used to update the record of the remaining memory of the physical machine in the first resource pool.

[0096] In practical applications, based on the record of the remaining memory of each physical machine in the first resource pool, a first parameter can be configured for the configuration file corresponding to each Pod among one or more Pods corresponding to the first scheduling task.

[0097] In one embodiment, after configuring the first parameter for the configuration file corresponding to each Pod among one or more Pods corresponding to the first scheduling task, the scheduling method provided by the embodiments of the present application further includes:

[0098] Record the second memory application amount corresponding to each Pod among one or more Pods in a first resource table; the second memory application amount represents the amount of memory that needs to be applied to the physical machine for scheduling the corresponding Pod; the first resource table is used to jointly calculate the unapplied and unused memory amount of each physical machine with the first resource pool; the first resource pool is used to record the remaining memory amount of each physical machine among one or more physical machines.

[0099] In practical applications, after configuring the first parameter for the configuration file corresponding to each Pod corresponding to the first scheduling task, it can be considered that the physical machine to which each Pod will be scheduled is determined, and the amount of memory that each physical machine needs to prepare for each Pod is determined, which is equivalent to realizing the memory application of each Pod to the corresponding physical machine.

[0100] In practical applications, the first resource table can be used to record the memory application information corresponding to each Pod, and the memory application information can include the second memory application amount corresponding to the corresponding Pod. The memory application information can also include the physical machine information applied by the corresponding Pod, such as the physical machine identifier.

[0101] In practical applications, the first resource table can be a MySQL table, and the first resource table can be updated based on MySQL transaction operations.

[0102] In practical applications, based on the first resource table, the total amount of memory applied by Pods to each physical machine can be determined, that is, the amount of memory applied to each physical machine can be determined. Based on the records in the first resource table and the records of the remaining memory amount of each physical machine in the first resource pool, the unapplied memory amount in the remaining memory of each physical machine can be jointly calculated, that is, the unapplied and unused memory amount of each physical machine can be determined.

[0103] In practical applications, the amount of memory on each physical machine that is not applied for and not used can represent the difference between the remaining memory of the physical machine and the amount of memory that has been applied for on the physical machine.

[0104] In practical applications, the amount of memory on a physical machine that is not applied for and not used can be understood as the actually available memory of the physical machine. During the execution of a first scheduling task, there may be a situation where other tasks outside the first scheduling task need to apply for the memory resources of the physical machine. In this case, other tasks can apply for the memory resources based on the actually available memory of the physical machine to avoid the memory resources applied for by other tasks being already applied for by the Pod corresponding to the first scheduling task, that is, to avoid memory conflicts. It can be understood that memory conflicts easily lead to scheduling errors. Therefore, the solution of the embodiment of the present application can avoid scheduling errors, thereby improving the accuracy of scheduling.

[0105] In one embodiment, after one or more Pods are scheduled to a physical machine, the scheduling method provided by the embodiment of the present application further includes:

[0106] Delete the records of the memory application amounts corresponding to each Pod in one or more Pods from the first resource table.

[0107] In practical applications, after each Pod in the first scheduling task is scheduled to a physical machine, the records of the memory application amounts corresponding to the Pod can be deleted from the first resource table. Or after all the Pods corresponding to the first scheduling task are scheduled to the physical machine, the records of all the memory application amounts corresponding to these Pods can be deleted from the first resource table.

[0108] In practical applications, after the Pod corresponding to the first scheduling task is scheduled to a physical machine, the physical machine runs the Pod based on the memory resources applied for by the Pod. In this case, the memory resources applied for by the Pod in the physical machine are used rather than pre-used. Even if the records of the memory application amounts corresponding to the Pod are deleted from the first resource table, memory conflicts can be avoided. Deleting the memory application records in the first resource table can reduce the amount of data in the first resource table, thereby saving storage resources.

[0109] In practical applications, the memory resource management method provided by the embodiment of the present application can also be expressed as a memory resource pool management algorithm.

[0110] In practical applications, during the process of scheduling Pods, multiple first scheduling tasks may need to be executed. The one or more Pods corresponding to each first scheduling task can be scheduled based on the scheduling method in any of the above embodiments.

[0111] Based on this, the embodiment of the present application also provides a scheduling method, see Figure 3, the method includes:

[0112] Step 301: Loop to allocate time slices for each of one or more first scheduling tasks.

[0113] Among them, a time slice represents a period of time that allows the corresponding first scheduling task to execute.

[0114] In practical applications, looping to allocate time slices for each of one or more first scheduling tasks can be understood as:

[0115] Perform multiple rounds of time slice allocation for one or more first scheduling tasks until all the first scheduling tasks end. During the process of performing one round of time slice allocation for one or more first scheduling tasks, time slices can be allocated to each first scheduling task in sequence until: all the first scheduling tasks have been allocated time slices in this round of time slice allocation, or all the first scheduling tasks end.

[0116] Exemplarily, assume there are three first scheduling tasks, namely Task 1, Task 2, and Task 3. Then, the order in which these tasks are allocated time slices can be: Task 1, Task 2, Task 3, Task 1, Task 2, Task 3, that is, two rounds of time slice allocation are performed.

[0117] In practical applications, looping to allocate time slices for each of one or more first scheduling tasks can also be expressed as: the time slices rotate cyclically among one or more first scheduling tasks.

[0118] In practical applications, when a first scheduling task is allocated a time slice, the first scheduling task can be executed. When the execution duration of the first scheduling task reaches the size of the time slice, a time slice is allocated to the next first scheduling task.

[0119] In practical applications, the size of a time slice can represent: the length of time that allows the corresponding first scheduling task to execute. When the execution time of the first scheduling task allocated with the time slice reaches the size of the time slice, it can be regarded as the end of this time slice.

[0120] In practical applications, time slices of the same time slice size can be allocated to one or more first scheduling tasks.

[0121] Step 302, schedule the Pod corresponding to the first scheduling task allocated with the time slice.

[0122] Specifically, based on the scheduling method in any of the foregoing embodiments, schedule the Pod corresponding to the first scheduling task allocated with the time slice.

[0123] In practical applications, when a first scheduling task is assigned a time slice, the first scheduling task can be executed, that is, schedule one or more Pods corresponding to the first scheduling task.

[0124] In practical applications, when a first scheduling task is assigned a time slice, the scheduling of Pods in the first scheduling task can be triggered. For example, the configuration file of the Pod in the first scheduling task can be submitted to the interface service component of the K8S cluster to trigger the K8S cluster to schedule the Pod. When the time slice assigned to a first scheduling task ends, the first scheduling task can be suspended. The scheduling of Pods in the suspended first scheduling task can no longer be triggered.

[0125] It can be understood that due to the limitation of the time slice length, it may not be possible to trigger the scheduling of all Pods corresponding to the first scheduling task assigned to this time slice within one time slice. However, since the time slices are allocated cyclically, the first scheduling task that has not completed the scheduling of all Pods will be assigned a time slice again. When the first scheduling task is assigned a time slice again, the first scheduling task can continue to trigger the scheduling of Pods that have not been triggered for scheduling.

[0126] In practical applications, when a first scheduling task is suspended, although the scheduling of Pods corresponding to the first scheduling task is no longer triggered, the Pods that have been triggered for scheduling can still be scheduled continuously. For example, the K8S cluster can continue to schedule the Pods corresponding to the submitted configuration files. In this way, multiple Pods that have been triggered for scheduling can be scheduled in parallel, improving the scheduling efficiency.

[0127] In the related art, when scheduling multiple Pods, the K8S cluster is first triggered to schedule one Pod, and then when the scheduling of this Pod by the K8S is completed, the K8S cluster is triggered to schedule the next Pod. Therefore, the K8S cluster schedules multiple Pods serially, resulting in low scheduling efficiency. In the embodiments of the present application, time slices are cyclically allocated to each of one or more first scheduling tasks, and the Pods corresponding to the first scheduling tasks assigned time slices are scheduled. On this basis, the first scheduling tasks assigned time slices can trigger the scheduling of Pods, and the Pods corresponding to the suspended first scheduling tasks can be scheduled simultaneously. In this way, multiple Pods that have been triggered for scheduling can be scheduled in parallel, thereby improving the scheduling efficiency compared with the related art.

[0128] In one embodiment, scheduling the Pods corresponding to the first scheduling task assigned a time slice includes:

[0129] During the first time period corresponding to the time slice, submit the configuration file corresponding to each first Pod of the first scheduling task assigned to the time slice to the interface service component of the K8S cluster; the first Pod represents a Pod determined to be triggered for scheduling during the first time period; the first Pod continues to be scheduled to the corresponding physical machine outside the first time period.

[0130] In practical applications, during the first time period corresponding to the time slice, the first scheduling task corresponding to the time slice can be executed, and outside the first time period corresponding to the time slice, the first scheduling task corresponding to the time slice can be suspended.

[0131] In practical applications, based on the length of the first time period corresponding to the time slice, the number of Pods that can be triggered for scheduling during the first time period can be determined, and then this number of Pods is determined as the first Pod. The length of the first time period corresponding to the time slice can be understood as the time slice size.

[0132] In practical applications, the calculation formula corresponding to the time slice size can be expressed as:

[0133] Time slice size = (First duration × Third quantity) / Fourth quantity.

[0134] Among them, the third quantity represents the number of one or more first scheduling tasks, and the third quantity can also be expressed as the current scheduling task number. The fourth quantity represents the average value of the number of Pods corresponding to one or more first scheduling tasks, and the fourth quantity can also be expressed as the average number of Pods of the current all scheduling tasks.

[0135] Exemplarily, assume there are two first scheduling tasks, namely task 1 and task 2, and the number of Pods corresponding to these two first scheduling tasks are: quantity 1 and quantity 2 respectively. Then, the third quantity is 2, and the fourth quantity is: (quantity 1 + quantity 2) / 2.

[0136] In practical applications, the first duration represents the average value of the scheduling task execution durations of one or more first scheduling tasks. The scheduling task execution duration can be understood as: the duration of the corresponding scheduling task before it ends, and the execution duration can also be expressed as the execution time.

[0137] In practical applications, when determining the time slice size, the first scheduling task has not ended yet. Therefore, the determined first duration is: an estimated value of the average value of the actual scheduling task execution durations of one or more first scheduling tasks. The first duration can also be expressed as: the estimated average execution time of the scheduling task.

[0138] In practical applications, the average value of the scheduling execution durations of one or more second scheduling tasks can be used as the first duration. The second scheduling tasks can be understood as one or more scheduling tasks that have ended before the execution of the first scheduling task, and the second scheduling tasks can also be referred to as historical scheduling tasks.

[0139] Exemplarily, assume that there are two first scheduling tasks, namely Task 1 and Task 2, and there are three second scheduling tasks, namely Task 3, Task 4, and Task 5. The scheduling execution durations of these three second scheduling tasks are respectively: Duration 1, Duration 2, and Duration 3. Then, the average value of the scheduling execution times of Task 3, Task 4, and Task 5, that is, (Duration 1 + Duration 2 + Duration 3) / 3, can be used as: the estimated value of the average scheduling execution time of Task 1 and Task 2, that is, as the first duration.

[0140] In practical applications, the method of executing one or more first scheduling tasks based on time slices provided by the embodiments of the present application can be described as a round-robin scheduling algorithm.

[0141] In practical applications, the implementation manner of the scheduling method provided in the above embodiments is not limited to a specific language or framework. Exemplarily, it can be implemented based on the Golang (go) language.

[0142] The following further describes the present application in detail in combination with application embodiments.

[0143] The application embodiment of the present application provides a scheduling system. This scheduling system can perform scheduling based on the scheduling method provided by the embodiments of the present application, and this scheduling system can also be referred to as a scheduler or a scheduling task platform.

[0144] Here, Figure 4 shows the overall architecture diagram of this scheduling system, Figure 5 shows the overall flowchart of the scheduling method executed by this scheduling system. Refer to Figure 4 And Figure 5 The overall process of the scheduling method executed by the scheduling system provided by the application embodiment of the present application mainly includes the following steps:

[0145] Step 1: Obtain the input parameters required for the first scheduling task.

[0146] In practical applications, the input of this step can include: the mirror types to be scheduled and the number of mirrors corresponding to each mirror type. The number of mirrors can be used to determine the number of Pods to be scheduled. The output of this step can include: persistently storing the input data into MySQL.

[0147] In practical applications, the scheduling system can obtain the data input by the user based on the user's call to the Hypertext Transfer Protocol (HTTP) interface, that is, obtain the input parameters required for the first scheduling task. The input parameters required for the first scheduling task can be used to determine the Pod corresponding to the first scheduling task.

[0148] Step 2: Generate a configuration file corresponding to the Pod corresponding to the first scheduling task based on the input parameters required for the first scheduling task.

[0149] In practical applications, the input of this step can include: the image type and the number of images. The output of this step can include: the configuration files corresponding to one or more Pods corresponding to the first scheduling task.

[0150] In practical applications, the image type and the number of images required for the first scheduling task can be read from MySQL, and then, based on the syntax that the configuration file needs to follow, the image type and the number of images required for the first scheduling task, the configuration files corresponding to one or more Pods corresponding to the first scheduling task are created respectively. Exemplarily, the configuration file can be a yml file and follows the yml syntax.

[0151] Step 3: Schedule the Pods in the first scheduling task based on the configuration file.

[0152] In practical applications, the input of this step can include: the configuration file corresponding to the Pod corresponding to the first scheduling task. The output of this step can include: the Pods that have been started and are running in the physical machines of the K8S cluster.

[0153] In practical applications, based on the scheduling method provided in the embodiments of the present application, the node affinity parameter can be configured for the configuration file corresponding to each Pod in one or more Pods corresponding to the first scheduling task, and the node affinity parameter is equivalent to the first parameter in the embodiments of the present application; then the configuration file corresponding to each Pod in one or more Pods is submitted to the interface service component of the K8S cluster to schedule the corresponding Pod. In the case of having one or more first scheduling tasks, time slices can be cyclically allocated to each first scheduling task in one or more first scheduling tasks, and the Pods corresponding to the first scheduling tasks allocated with time slices are scheduled.

[0154] In practical applications, scheduling can be performed based on the memory resource pool management algorithm, the node affinity function, and the time slice round-robin scheduling algorithm provided in the embodiments of the present application.

[0155] Step 4: Obtain the health check data of the Pod corresponding to the first scheduling task.

[0156] In practical applications, the input of this step may include: instructions provided by the K8S cluster for performing health checks on Pods. Performing a health check on a Pod can be understood as: checking whether the Pod is running normally on the physical machine of the K8S cluster, that is, whether it is healthy. The output of this step may include: health check data for all Pods corresponding to the first scheduling task, and further determining whether the status of each Pod is Ready, obtaining a judgment result; in the case where the judgment result indicates that there is a Pod whose status is not Ready, output the name (pod_name) of the Pod whose status is not Ready, and continue to execute step 5; in the case where the judgment result indicates that the status of all Pods corresponding to the first scheduling task is Ready, end the scheduling process.

[0157] In practical applications, when the status of a Pod is Ready, it can be considered that the Pod is running normally.

[0158] Step 5: Delete the Pods whose status is not Ready.

[0159] In practical applications, the input of this step may include: a pod_name list composed of the pod_name of the Pods whose status is not Ready. The output of this step may include: performing a deletion operation on each Pod corresponding to the pod_name list.

[0160] In practical applications, each Pod may be wrapped by a Deployment object, and the deleted Pod will be automatically restarted.

[0161] In practical applications, after step 5 is executed, it can jump to step 4.

[0162] In practical applications, the implementation manner of the scheduling system provided by the application embodiment of the present application is not limited to a specific language or framework. Exemplarily, it can be implemented based on the go language.

[0163] The following further describes the method of step 3 in the above overall process, that is, "scheduling the Pods in the first scheduling task based on the configuration file". See Figure 6 , the method of scheduling the Pods in the first scheduling task based on the configuration file mainly includes the following steps:

[0164] Step 1: Asynchronously maintain the memory resource pool based on the memory resource pool management algorithm provided by the embodiment of the present application, and apply for the required memory resources for the Pods corresponding to the first scheduling task based on the memory resource pool.

[0165] In practical applications, the memory resource pool is equivalent to the first resource pool in the embodiment of the present application, and applying for memory resources for the Pods can be regarded as applying for memory resources for the Pods.

[0166] In practical applications, based on the memory resource pool, the physical machines to which each Pod corresponding to the first scheduling task will be scheduled can be determined, and then memory resources can be applied for from the determined physical machines.

[0167] In practical applications, based on the record of the remaining memory of the physical machines in the memory resource pool and the total amount of memory that the Pods corresponding to the first scheduling task need to apply for from the physical machines, one or more physical machines to which the Pods corresponding to the first scheduling task will be scheduled can be determined as the same physical machine as much as possible.

[0168] Step 2: Label the physical machines to which each Pod corresponding to the first scheduling task will be scheduled.

[0169] Step 3: Based on the labels of the physical machines, configure node affinity parameters for the configuration files corresponding to each Pod corresponding to the first scheduling task.

[0170] In practical applications, based on the above steps 1 to 3, memory resources can be applied for each first scheduling task among one or more first scheduling tasks, and node affinity parameters can be configured for the configuration files corresponding to each Pod corresponding to each first scheduling task.

[0171] Step 4: Schedule one or more first scheduling tasks based on the round-robin scheduling algorithm.

[0172] In practical applications, based on one or more first scheduling tasks, a list of tasks to be scheduled can be generated. Each list item in the list of tasks to be scheduled represents a first scheduling task, and then based on the list of tasks to be scheduled, one or more first scheduling tasks can be scheduled.

[0173] In practical applications, time slices can be cyclically allocated to each first scheduling task in the list of tasks to be scheduled. When a first scheduling task is allocated a time slice, the first scheduling task is executed.

[0174] In practical applications, during the execution of the current first scheduling task, the configuration file corresponding to the selected Pod in the current first scheduling task can be submitted to the k8s-api-server. At the end of the time slice of the current first scheduling task, the completion status of the current first scheduling task is judged to obtain a judgment result. When the judgment result indicates that the current first scheduling task has ended, that is, has been completed, the scheduling task is marked as completed and removed from the list of tasks to be scheduled.

[0175] In practical applications, the current scheduling task can be understood as: the first scheduling task allocated a time slice. The selected Pod in the current first scheduling task is equivalent to the first Pod in the embodiments of the present application.

[0176] In the application implementation example of the present application, based on the memory resource pool management algorithm and the node affinity function, one or more Pods corresponding to the first scheduling task are scheduled, so that one or more Pods in the first scheduling task can be scheduled to the same physical machine as much as possible, thereby reducing the network communication delay. Further, in the application implementation example of the present application, based on the round-robin scheduling algorithm, one or more first scheduling tasks are scheduled, so that the Pods in the first scheduling task can be scheduled in parallel, further improving the scheduling efficiency.

[0177] Based on the above embodiments, the present application also provides a scheduling device, see Figure 7 , and the scheduling device includes:

[0178] A configuration unit 71, configured to configure a first parameter for the configuration file corresponding to each Pod in one or more Pods corresponding to the first scheduling task based on the remaining memory of each physical machine in one or more physical machines; the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled; wherein, when the remaining memory of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured as an indication of the first physical machine; the first memory application amount represents: the total amount of memory that needs to be applied to the physical machine for scheduling the one or more Pods;

[0179] A first scheduling unit 72, configured to submit the configuration file corresponding to each Pod in the one or more Pods to the interface service component of the K8S cluster to schedule the corresponding Pod; wherein, when all the one or more Pods are scheduled to the corresponding physical machines, the first scheduling task ends.

[0180] In actual application, both the configuration unit 71 and the first scheduling unit 72 can be implemented by a processor in the scheduling device.

[0181] It should be noted that: when the scheduling device provided in the above embodiment performs scheduling, only the above-mentioned division of each program module is used for illustration. In actual application, the above-mentioned processing can be allocated to different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the above-mentioned processing. In addition, the scheduling device provided in the above embodiment and the scheduling method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0182] Based on the above embodiments, the present application also provides a scheduling device, see Figure 8 , and the scheduling device includes:

[0183] An allocation unit 81 for cyclically allocating time slices to each of one or more first scheduling tasks; the time slice represents a period of time allowing the corresponding first scheduling task to execute;

[0184] A second scheduling unit 82 for scheduling the Pod corresponding to the first scheduling task allocated with a time slice based on the scheduling method in any of the foregoing embodiments.

[0185] In actual application, both the allocation unit 81 and the second scheduling unit 82 can be implemented by a processor in the scheduling device.

[0186] It should be noted that: when the scheduling device provided in the foregoing embodiment performs scheduling, only the division of the foregoing each program module is used for illustration. In actual application, the foregoing processing can be allocated to different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the foregoing processing. In addition, the scheduling device provided in the foregoing embodiment and the scheduling method embodiment belong to the same concept. For the specific implementation process, refer to the method embodiment and will not be elaborated here.

[0187] Based on the hardware implementation of the foregoing program module, and in order to implement the method of the embodiments of the present application, the present application also provides an electronic device. Refer to Figure 9 , the electronic device includes:

[0188] A first communication interface 1 capable of information interaction with other devices;

[0189] A first processor 2 connected to the first communication interface 1 to implement information interaction with other devices. When running a computer program, it is used to execute the method provided by one or more technical solutions in the foregoing embodiments. And the computer program is stored on the first memory 3.

[0190] Specifically, the first processor 2 is used to configure a first parameter for the configuration file corresponding to each Pod in one or more Pods corresponding to the first scheduling task based on the remaining memory of each physical machine in one or more physical machines; the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled; wherein, when the remaining memory of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured as an indication of the first physical machine; the first memory application amount represents: the total amount of memory that needs to be applied to the physical machine for scheduling the one or more Pods;

[0191] Submit the configuration file corresponding to each Pod in the one or more Pods to the interface service component of the K8S cluster to schedule the corresponding Pod; wherein, when all of the one or more Pods are scheduled to the corresponding physical machines, the first scheduling task ends.

[0192] In one embodiment, the first processor 2 configures a first parameter for the configuration file corresponding to each Pod in one or more Pods corresponding to the first scheduling task based on the remaining memory of each physical machine among one or more physical machines, and further includes:

[0193] In the case where the remaining memory of the first physical machine is less than the first memory application amount,

[0194] Configure the first parameter corresponding to each Pod in the first number of Pods as an indication of the first physical machine; the first number represents: the maximum number of schedulable Pods supported by the remaining memory of the first physical machine;

[0195] Configure the first parameter corresponding to each Pod in the second number of Pods as an indication of the second physical machine; the second number of Pods represents: all or part of the Pods among the one or more Pods other than the first number of Pods; the remaining memory of the second physical machine is greater than or equal to: the total amount of memory to be applied to the physical machine for scheduling the second number of Pods.

[0196] In one embodiment, the first physical machine represents the physical machine with the highest remaining memory among the one or more physical machines.

[0197] In one embodiment, the first processor 2 is further configured to:

[0198] Call the set interface of each physical machine among the one or more physical machines to obtain the remaining memory of the corresponding physical machine in real time, and update the first resource pool; the first resource pool is used to record the remaining memory of each physical machine among the one or more physical machines.

[0199] In one embodiment, after the first processor 2 configures the first parameter for the configuration file corresponding to each Pod in one or more Pods corresponding to the first scheduling task, it is further configured to:

[0200] Record the second memory application amount corresponding to each Pod in the one or more Pods in the first resource table; the second memory application amount represents: the amount of memory to be applied to the physical machine for scheduling the corresponding Pod; the first resource table is used to jointly calculate the unapplied and unused memory of each physical machine with the first resource pool; the first resource pool is used to record the remaining memory of each physical machine among the one or more physical machines.

[0201] In one embodiment, after the one or more Pods are scheduled to the physical machine, the first processor 2 is further configured to:

[0202] Delete the record of the memory application amount corresponding to each Pod in the one or more Pods in the first resource table.

[0203] In one embodiment, the first processor 2 is further configured to:

[0204] Loop to allocate time slices for each of the one or more first scheduling tasks; the time slice represents a period of time allowing the corresponding first scheduling task to execute;

[0205] Based on the scheduling method in any of the foregoing embodiments, schedule the Pod corresponding to the first scheduling task allocated with a time slice.

[0206] In one embodiment, the first processor 2 schedules the Pod corresponding to the first scheduling task allocated with a time slice, including:

[0207] Within the first time period corresponding to the time slice, submit the configuration file corresponding to each first Pod corresponding to the first scheduling task allocated with the time slice to the interface service component of the K8S cluster; the first Pod represents the Pod determined to be triggered for scheduling within the first time period; the first Pod continues to be scheduled to the corresponding physical machine at times outside the first time period.

[0208] It should be noted that: The specific processing process of the first communication interface 1 can be understood with reference to the above method.

[0209] Of course, in actual application, each component in the electronic device is coupled together through the bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 9 all kinds of buses are labeled as the bus system 4.

[0210] The first memory 3 in the embodiments of the present application is used to store various types of data to support operations in the electronic device. Examples of these data include: any computer program for operating on the electronic device.

[0211] The method disclosed in the embodiments of the present application can be applied to the first processor 2 or implemented by the first processor 2. The first processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the first processor 2 or instructions in the form of software. The above-mentioned first processor 2 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 2 can implement or execute various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. Combining the steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed and completed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, and this storage medium is located in the first memory 3. The first processor 2 reads the information in the first memory 3 and combines its hardware to complete the steps of the foregoing method.

[0212] In an exemplary embodiment, the electronic device can be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs, Microprocessors, or other electronic components for executing the foregoing method.

[0213] It can be understood that the first memory 3 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), sync link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.

[0214] In an exemplary embodiment, the embodiments of this application also provide a storage medium, namely a computer storage medium, specifically a computer-readable storage medium. For example, it includes an electronic device storing a computer program, and the above computer program can be executed by the first processor 2 of the electronic device to complete the steps described in the foregoing method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0215] In an exemplary embodiment, the embodiments of this application also provide a computer program product, including a computer program, and the computer program can be executed by the first processor 2 of the electronic device to complete the steps described in any of the foregoing methods.

[0216] It should be noted that: "first", "second", etc. are used to distinguish similar objects and do not necessarily describe a specific order or sequence.

[0217] In this article, the term "and / or" is merely a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "one or more" in this article means any one or any combination of at least two of multiple ones. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set composed of A, B, and C.

[0218] In addition, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

Claims

1. A scheduling method, characterized in that: The method comprises: Based on the remaining memory amount of each physical machine in the one or more physical machines, a first parameter is configured for a configuration file corresponding to each Pod in the one or more Pods corresponding to the first scheduling task; the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled; wherein, when the remaining memory amount of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured as an indication of the first physical machine; the first memory application amount represents: the total amount of memory that needs to be applied to the physical machine for scheduling the one or more Pods; Submit the configuration file corresponding to each of the one or more Pods to the interface service component of the K8S cluster to schedule the corresponding Pod; wherein, when all of the one or more Pods are scheduled to the corresponding physical machines, the first scheduling task is completed.

2. The method according to claim 1, characterized in that The configuring a first parameter for a configuration file corresponding to each of the one or more Pods corresponding to the first scheduling task based on the remaining memory of each of the one or more physical machines also includes: When the remaining memory amount of the first physical machine is less than the first memory application amount, The first parameter corresponding to each Pod in the first number of Pods is configured as an indication of the first physical machine; the first number represents: the maximum number of scheduled Pods supported by the remaining memory of the first physical machine; The first parameter corresponding to each Pod in the second number of Pods is configured as an indication of the second physical machine; the second number of Pods represents: all or part of the one or more Pods except the first number of Pods; the remaining memory of the second physical machine is greater than or equal to: the total amount of memory required to be applied to the physical machine for scheduling the second number of Pods.

3. The method according to claim 1 or 2, characterized in that: The first physical machine represents a physical machine having the highest amount of remaining memory among the one or more physical machines.

4. The method according to claim 1, characterized in that The method further comprises: The setting interface of each of the one or more physical machines is called to obtain the remaining memory of the corresponding physical machine in real time, and update the first resource pool; the first resource pool is used to record the remaining memory of each of the one or more physical machines.

5. The method according to claim 1, characterized in that After configuring the first parameter for the configuration file corresponding to each of the one or more Pods corresponding to the first scheduling task, the method further includes: The second memory application amount corresponding to each Pod in the one or more Pods is recorded in the first resource table; the second memory application amount represents: the amount of memory that needs to be applied to the physical machine to schedule the corresponding Pod; the first resource table is used to calculate the amount of unapplied and unused memory of each physical machine together with the first resource pool; the first resource pool is used to record the remaining memory of each physical machine in the one or more physical machines.

6. The method according to claim 5, characterized in that After the one or more Pods are scheduled to the physical machine, the method further includes: Delete the record of the memory application amount corresponding to each Pod in the one or more Pods in the first resource table.

7. A scheduling method, characterized in that: The method comprises: cyclically allocating a time slice for each of the one or more first scheduled tasks; the time slice represents a period of time that allows the corresponding first scheduled task to be executed; Based on the scheduling method described in any one of claims 1 to 6, the Pod corresponding to the first scheduling task allocated to the time slice is scheduled.

8. The method according to claim 7, characterized in that The step of scheduling the Pod corresponding to the first scheduling task assigned to the time slice includes: Within the first time period corresponding to the time slice, the configuration file corresponding to each first Pod corresponding to the first scheduling task assigned to the time slice is submitted to the interface service component of the K8S cluster; the first Pod representation is determined to be the Pod triggered for scheduling within the first time period; the first Pod continues to be scheduled to the corresponding physical machine outside the first time period.

9. A scheduling device, characterized in that: include: A configuration unit, configured to configure a first parameter for a configuration file corresponding to each of the one or more Pods corresponding to the first scheduling task based on the remaining memory of each physical machine in the one or more physical machines; the first parameter is used to indicate the physical machine to which the corresponding Pod will be scheduled; wherein, when the remaining memory of the first physical machine is greater than or equal to the first memory application amount, the first parameter corresponding to each Pod is configured as an indication of the first physical machine; the first memory application amount represents: the total amount of memory that needs to be applied to the physical machine for scheduling the one or more Pods; The first scheduling unit is used to submit the configuration file corresponding to each of the one or more Pods to the interface service component of the K8S cluster to schedule the corresponding Pod; wherein, when all of the one or more Pods are scheduled to the corresponding physical machines, the first scheduling task is completed.

10. A scheduling device, characterized in that: include: An allocating unit, configured to cyclically allocate a time slice to each of the one or more first scheduled tasks; The time slice represents a period of time that allows the corresponding first scheduled task to be executed; The second scheduling unit is used to schedule the Pod corresponding to the first scheduling task allocated to the time slice based on the scheduling method described in any one of claims 1 to 6.

11. An electronic device, characterized in that: a first processor and a first memory for storing a computer program executable on the processor, Wherein, when the first processor is used to run the computer program, the steps of the method described in any one of claims 1 to 8 are executed.

12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.