Container scheduling method and device, electronic equipment, program product and storage medium

By using value functions and target reward value training in the container scheduling model, the problem of inconsistent image names but not reusing node caches is solved, and the accuracy and efficiency of container scheduling are improved, especially large-scale Improved efficiency of mirror computing tasks.

CN119025239APending Publication Date: 2024-11-26CHINA MOBILE GROUP ZHEJIANG +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411105403.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing container scheduling methods cannot reuse the mirror cache of the same node when the image names are inconsistent but the underlying images they depend on, resulting in reduced scheduling accuracy and increased mirror pull delay, affecting the efficiency of computing tasks.

Method used

By using value functions in the container scheduling model, training is based on the image layer information, scheduling actions and target reward values ​​required by the container and cached by the node, and target scheduling actions are generated to realize the scheduling decision at the mirror level, ensuring the similarity of the image layer information. Match and size to realize hierarchical scheduling and cache reuse.

Benefits of technology

Improve the accuracy of container scheduling, reduce the mirror pull delay, and improve the container deployment efficiency, especially the computing efficiency of large-image computing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025239A_ABST
    Figure CN119025239A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of container scheduling, and provides a container scheduling method and device, electronic equipment, a program product and a storage medium. The method comprises the following steps: acquiring mirror layer information required by a to-be-scheduled container and mirror layer information cached by a schedulable node; inputting the information of each mirror image layer and the selectable scheduling action into a container scheduling model to obtain a target scheduling action output by the container scheduling model; scheduling the to-be-scheduled container according to the target scheduling action; the container scheduling model is obtained by training mirror image layer information required by each container in a cluster, mirror image layer information cached by each node, each scheduling action and a target reward value after each scheduling action is executed on the basis of a value function. According to the method, multiplexing of mirror image caches of the same node can be realized through hierarchical scheduling, and the scheduling accuracy is improved, so that the mirror image pulling time delay is reduced, the container deployment efficiency is improved, and the calculation efficiency of the calculation task, particularly the calculation task depending on a large mirror image, is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of container scheduling, and in particular to a container scheduling method, device, electronic device, program product and storage medium. Background Art

[0002] With the development of cloud-native technologies, more and more computing tasks will run in Kubernetes clusters in the form of graphics processing unit containers. Some computing tasks rely on images that are much larger than general images.

[0003] The current container scheduling method is to determine whether there is a cache of the image required by the container on the node through the list of images required by the container and the existing images on the node, and prioritize scheduling the container to the node where the cache of the image required by the container exists. The scheduling judgment is mainly based on the full name of the image. When the full name of the image required by the container is consistent with the full name of the image cached by a node, the container is scheduled to the node.

[0004] However, in actual container services, there will be many services with inconsistent image names, but the dependent basic images are the same, or different users use the same images, but these images come from different image repositories. These container services could have reused the image cache of the same node, but because the full name of the image generally includes the image repository name, image name and label, in the current container scheduling method, the repository name, image name and label of the image required by the container must completely match the image repository name, image name and label of a certain node before scheduling can be performed, resulting in the above container services being unable to reuse the image cache of the same node, reducing scheduling accuracy, thereby increasing image pulling latency, reducing container deployment efficiency, and affecting computing tasks, especially the computing efficiency of computing tasks that rely on large images. Summary of the invention

[0005] The embodiments of the present application provide a container scheduling method, device, electronic device, program product and storage medium to solve the technical problem that container services cannot reuse the image cache of the same node, which reduces scheduling accuracy, thereby increasing image pulling latency, reducing container deployment efficiency, and affecting computing tasks, especially the computing efficiency of computing tasks that rely on large images.

[0006] In a first aspect, an embodiment of the present application provides a container scheduling method, including: Obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; Inputting each image layer information and optional scheduling action into the container scheduling model to obtain the target scheduling action output by the container scheduling model; Scheduling the to-be-scheduled container according to the target scheduling action; The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

[0007] In one embodiment, the container scheduling model is determined based on the following method: Generate the value function according to the image layer information required by each container, the image layer information cached by each node, and the scheduling action of scheduling each container to each node; The value function is trained iteratively to obtain the container scheduling model.

[0008] In one embodiment, the iterative training of the value function to obtain the container scheduling model includes: According to the image layer information currently required by each container and the image layer information currently cached by each node, select the current scheduling action to schedule each container to each node; Execute the corresponding current scheduling action for each container and each node to obtain the new currently required image layer information of each container, the new currently cached image layer information of each node, and the target reward value; According to the new currently required image layer information of each container and the new currently cached image layer information of each node, a new current scheduling action is selected, and the value function is updated according to the new currently required image layer information of each container, the new currently cached image layer information of each node, the new current scheduling action and the target reward value; If the number of training iterations does not reach the number threshold, then return to the step of executing the corresponding current scheduling action on each container and each node to obtain the new currently required image layer information of each container, the new currently cached image layer information of each node, and the target reward value, until the number of training iterations reaches the number threshold, and the value function at this time is determined as the container scheduling model.

[0009] In one embodiment, the target reward value is determined based on the following method: According to the information of each image layer, the first reward value of the image layer is obtained; According to the size of each image layer, the second reward value of the image layer is obtained; Using the adjustment parameter to adjust the first reward value of the image layer and the second reward value of the image layer to obtain an adjusted reward value; The first reward value of the image layer, the second reward value of the image layer, and the adjusted reward value are weightedly summed to obtain the target reward value.

[0010] In one embodiment, obtaining the first reward value of the image layer according to the information of each image layer includes: Calculate the similarity between the image layer information currently required by each container and the image layer information currently cached by each node; According to the similarity, a first reward value of the image layer is obtained.

[0011] In one embodiment, obtaining the second reward value of the image layer according to the size of each image layer includes: Calculate the ratio between the image layer size cached by each node and the image layer size required by each container; According to the ratio, the second reward value of the image layer is obtained.

[0012] In a second aspect, an embodiment of the present application provides a container scheduling device, including: The image layer information acquisition module is used to obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; A scheduling action acquisition module is used to: input each image layer information and optional scheduling action into a container scheduling model to obtain a target scheduling action output by the container scheduling model; A scheduling module, used to: schedule the container to be scheduled according to the target scheduling action; The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory storing a computer program, wherein when the processor executes the program, the steps of the container scheduling method described in the first aspect are implemented.

[0014] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the container scheduling method described in the first aspect.

[0015] In a fifth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium, including a computer program, which, when executed by a processor, implements the steps of the container scheduling method described in the first aspect.

[0016] The container scheduling method, device, electronic device, program product and storage medium provided by the present application obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node, input each image layer information and optional scheduling action into the container scheduling model, obtain the target scheduling action output by the container scheduling model, and schedule the container to be scheduled according to the target scheduling action. Since the container scheduling model is obtained by training the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action and the target reward value after each scheduling action is executed on the basis of the value function, the model is obtained on the basis of fully learning the image layer information required by the container, the image layer information cached by the node, the scheduling action between the container and the node, and the reward obtained after executing the scheduling action and the relationship between them, and can output the target scheduling action at the level of the image layer information based on this. Since the image layer information can accurately represent the properties of each image, when the image names are inconsistent but the dependent base images are consistent, or when the images used are the same but these images come from different image repositories resulting in inconsistent full names of the images, the image layer information can remain consistent. Therefore, the above container services can reuse the image cache of the same node through hierarchical scheduling, improve scheduling accuracy, thereby reducing image pulling latency, improving container deployment efficiency, and further improving computing tasks, especially computing tasks that rely on large images. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is one of the flow diagrams of the container scheduling method provided in the embodiment of the present application; Figure 2 This is the second flow chart of the container scheduling method provided in the embodiment of the present application; Figure 3 This is the third flow chart of the container scheduling method provided in the embodiment of the present application; Figure 4 is a schematic diagram of the structure of a container scheduling device provided in an embodiment of the present application; Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0020] Figure 1 This is one of the flow diagrams of the container scheduling method provided in the embodiment of the present application. Figure 1 , an embodiment of the present application provides a container scheduling method, which may include: 101. Obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; 102. Input each image layer information and optional scheduling action into the container scheduling model to obtain the target scheduling action output by the container scheduling model; 103. Schedule the container to be scheduled according to the target scheduling action.

[0021] The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

[0022] In step 101, the deployment request of the container to be scheduled can be obtained from the scheduling queue, the deployment information therein can be obtained, the full name of the image required for the container to be scheduled can be obtained from the deployment information, the full name of the image cached by the schedulable node can be obtained from the image list of each node synchronized from Kubelet to the distributed key-value storage system, and the corresponding image layer information can be obtained from the image repository according to the full name of each image.

[0023] In step 102, the target scheduling action output by the container scheduling model is the action of scheduling any container to any node. Therefore, the target scheduling action output by the container scheduling model is equivalent to outputting the scheduling node adapted for each container.

[0024] In step 103, each container is scheduled to a scheduling node adapted thereto for deployment.

[0025] Specifically, the information of the adapted scheduling node can be bound to the corresponding container and submitted to the cluster for deployment.

[0026] The container scheduling method provided in this embodiment obtains the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node, inputs each image layer information and the optional scheduling action into the container scheduling model, obtains the target scheduling action output by the container scheduling model, and schedules the container to be scheduled according to the target scheduling action. Since the container scheduling model is obtained by training the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed on the basis of the value function, the model is obtained on the basis of fully learning the image layer information required by the container, the image layer information cached by the node, the scheduling action between the container and the node, and the reward obtained after executing the scheduling action and the relationship between them, and can output the target scheduling action at the level of the image layer information based on this. Since the image layer information can accurately represent the properties of each image, when the image names are inconsistent but the dependent base images are consistent, or when the images used are the same but these images come from different image repositories resulting in inconsistent full names of the images, the image layer information can remain consistent. Therefore, the above container services can reuse the image cache of the same node through hierarchical scheduling, improve scheduling accuracy, thereby reducing image pulling latency, improving container deployment efficiency, and further improving computing tasks, especially computing tasks that rely on large images.

[0027] Figure 2 This is the second flow chart of the container scheduling method provided in the embodiment of the present application. Figure 2 In one embodiment, the container scheduling model can be determined based on the following method: 201. Generate a value function according to the image layer information required by each container, the image layer information cached by each node, and the scheduling action of scheduling each container to each node; 202. According to the image layer information currently required by each container and the image layer information currently cached by each node, select the current scheduling action of scheduling each container to each node; 203. Execute the corresponding current scheduling action on each container and each node to obtain the new currently required image layer information of each container, the new currently cached image layer information of each node, and the target reward value; 204. According to the new currently required image layer information of each container and the new currently cached image layer information of each node, a new current scheduling action is selected, and the value function is updated according to the new currently required image layer information of each container, the new currently cached image layer information of each node, the new current scheduling action and the target reward value; 205. If the number of training iterations does not reach the number threshold, return to step 203; 206. If the number of training iterations reaches the number threshold, the value function at this time is determined as the container scheduling model.

[0028] In step 201, the image layer information required by each container and the image layer information cached by each node can be used Indicates that the scheduling action of each container to each node can be used , then the value function can be expressed as , meaning the image layer set is In the state, execute the scheduling action The expected returns that can be obtained.

[0029] In step 202 to step 204, the iterative process can be expressed by the following formula: ; in, is the learning rate, which controls the weight of each iteration and usually takes a value between 0 and 1. is a discount factor used to balance the importance of immediate rewards and future rewards, usually between 0 and 1. For execution The target reward value after It is a collection of the image layer information currently required by each container and the image layer information currently cached by each node. is the current dispatch action, It is a collection of the new image layer information currently required by each container and the new image layer information currently cached by each node. is the new currently scheduled action.

[0030] The above iterative process can be understood as: finding the new current image layer set Execute all possible new currently scheduled actions in the state The maximum expected return , the maximum expected return can be regarded as the future reward, the target reward value Can be regarded as an immediate reward, so Multiply by the discount factor To balance The importance of Get the sum of the balanced immediate rewards and future rewards, and then use the learning rate Perform a weighted sum on the current value function and the total reward, and use the weighted sum result to update the current value function, completing an iteration of the value function.

[0031] It should be noted that before the iteration starts, the value function can also be initialized. The space size of the value function is ,in, yes The size of the space, yes The size of the space.

[0032] In step 205 to step 206, the number threshold can be set according to actual conditions and is not limited here. In this embodiment, the number threshold can be set to 100,000 times.

[0033] Each time the model is used to perform a scheduling action output, the target reward value, image layer information, and scheduling action in the process can be collected and saved in the experience pool for subsequent model updates.

[0034] This embodiment iterates the value function, and can adjust the scheduling action according to the changes in various parameters during the iteration process, and then obtain new image layer information according to the scheduling action, so that the value function gradually converges, and finally obtains the container scheduling model, that is, the optimal scheduling action based on the image layer information for each container and each node. In the above process, first, local data can be fully utilized without leaking data, avoiding the problem of data centralization, thereby improving data utilization and model accuracy; second, it can continuously learn from iterations, continuously optimize its own scheduling strategy, and improve the efficiency and performance of the model; third, the model can be expanded according to actual conditions, such as increasing the number of agents or increasing reward functions to meet different types of business needs.

[0035] Figure 3 This is the third flow chart of the container scheduling method provided in the embodiment of the present application. Figure 3 In one embodiment, the target reward value can be determined based on the following method: 301. Obtain the first reward value of the image layer according to the information of each image layer; 302. Obtain a second reward value of the image layer according to the size of each image layer; 303. Use the adjustment parameter to adjust the first reward value of the mirror layer and the second reward value of the mirror layer to obtain an adjusted reward value; 304. Perform a weighted sum of the first reward value of the image layer, the second reward value of the image layer, and the adjusted reward value to obtain a target reward value.

[0036] Step 301 specifically includes: 301a. Calculate the similarity between the image layer information currently required by each container and the image layer information currently cached by each node; 301b. Obtain a first reward value of the image layer according to the similarity.

[0037] In step 301a to step 301b, the similarity between the image layer information currently required by each container and the image layer information currently cached by each node can be calculated according to any similarity algorithm, which is not limited here. In this embodiment, the Jaccard similarity measurement method can be used to calculate the similarity between the image layer information currently required by each container and the image layer information currently cached by each node. The following formula can be used to express the first reward value of the image layer : ; in, Representation container Required image layer information, Representation Node Cached image layer information, Indicates Jaccard similarity. The value range of is between 0 and 1. The higher the similarity, The larger the value, the lower the similarity. The smaller it is, the more likely it is to be negative.

[0038] It should be noted that any container may require one or more image layers, and any node may cache one or more image layers, which are not limited here. When calculating similarity, it is necessary to calculate the information of each image layer required by each container and the information of each image layer cached by each node.

[0039] Image layer information may include layer identification, parent layer identification, metadata, file system change content, execution commands, configuration information, permission information, dependency information, size information, summary information, user information, working directory, writable layer identification, etc.

[0040] Step 302 specifically includes: 302a. Calculate the ratio between the image layer size cached by each node and the image layer size required by each container; 302b. Obtain a second reward value of the image layer according to the ratio.

[0041] In step 302a to step 302b, the second reward value of the image layer can be expressed by the following formula: : ; in, Representation container The required image layer size, Representation Node The size of the cached image layer, and The larger the ratio, The larger the value, the higher the node The more the cached image layer matches the container needs, thereby improving the matching degree; and The smaller the ratio, The smaller the node The cached image layer is less compatible with the container. , thus reducing the matching degree.

[0042] It should be noted that when calculating and When the ratio is , it is also necessary to calculate the size of each image layer required by each container and the size of each image layer cached by each node.

[0043] In step 303, the adjusted reward value can be expressed by the following formula: : ; in, is a tuning parameter.

[0044] The adjustment parameters are introduced to adjust the impact of the similarity difference of different nodes and the image layer size on the reward value. If the similarity difference of different nodes is within the preset range, and the image layer size is also within the preset range, the node with lower similarity can be selected.

[0045] In step 304, the target reward value can be expressed by the following formula: : ; in, , and is the weight.

[0046] In practical applications, there is no strict timing relationship between step 301 and step 302; that is, they can be executed simultaneously, or any one of the steps can be executed first, depending on actual needs and is not limited here.

[0047] This embodiment obtains the target reward value by adjusting parameters and weights through the similarity between the image layer information currently required by each container and the image layer information currently cached by each node, as well as the ratio between the image layer size cached by each node and the image layer size required by each container. In the process of model iteration, this embodiment can fully take the matching degree of container and node image layer information and the matching degree of image layer size as guidance, and balance the influence of each reward value by adjusting parameters and weights, thereby improving the accuracy of the target reward value, further improving the target accuracy of model iteration, and finally realizing the accurate output of scheduling actions from each container to each node.

[0048] The following is a description of a container scheduling device provided in an embodiment of the present application. The container scheduling device described below and the container scheduling method described above can be referenced to each other.

[0049] Figure 4 Schematic diagram of the structure of the container scheduling device provided in the embodiment of the present application. Figure 4 , an embodiment of the present application provides a container scheduling device, which may include: The image layer information acquisition module 401 is used to: acquire the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; The scheduling action acquisition module 402 is used to: input each image layer information and the optional scheduling action into the container scheduling model to obtain the target scheduling action output by the container scheduling model; The scheduling module 403 is used to schedule the container to be scheduled according to the target scheduling action; The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

[0050] The container scheduling device provided in this embodiment obtains the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node, inputs each image layer information and the optional scheduling action into the container scheduling model, obtains the target scheduling action output by the container scheduling model, and schedules the container to be scheduled according to the target scheduling action. Since the container scheduling model is obtained by training the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed on the basis of the value function, the model is obtained on the basis of fully learning the image layer information required by the container, the image layer information cached by the node, the scheduling action between the container and the node, and the reward obtained after executing the scheduling action and the relationship between them, and can output the target scheduling action at the image layer information level based on this. Since the image layer information can accurately represent the properties of each image, when the image names are inconsistent but the dependent base images are consistent, or when the images used are the same but these images come from different image repositories resulting in inconsistent full names of the images, the image layer information can remain consistent. Therefore, the above container services can reuse the image cache of the same node through hierarchical scheduling, improve scheduling accuracy, thereby reducing image pulling latency, improving container deployment efficiency, and further improving computing tasks, especially computing tasks that rely on large images.

[0051] In one embodiment, a container scheduling model building module (not shown in the figure) is used to: Generate the value function according to the image layer information required by each container, the image layer information cached by each node, and the scheduling action of scheduling each container to each node; The value function is trained iteratively to obtain the container scheduling model.

[0052] In one embodiment, the container scheduling model construction module is specifically used to: According to the image layer information currently required by each container and the image layer information currently cached by each node, select the current scheduling action to schedule each container to each node; Execute the corresponding current scheduling action for each container and each node to obtain the new currently required image layer information of each container, the new currently cached image layer information of each node, and the target reward value; According to the new currently required image layer information of each container and the new currently cached image layer information of each node, a new current scheduling action is selected, and the value function is updated according to the new currently required image layer information of each container, the new currently cached image layer information of each node, the new current scheduling action and the target reward value; If the number of training iterations does not reach the number threshold, then return to the step of executing the corresponding current scheduling action on each container and each node to obtain the new currently required image layer information of each container, the new currently cached image layer information of each node, and the target reward value, until the number of training iterations reaches the number threshold, and the value function at this time is determined as the container scheduling model.

[0053] In one embodiment, a target reward value determination module (not shown in the figure) is used to: According to the information of each image layer, the first reward value of the image layer is obtained; According to the size of each image layer, the second reward value of the image layer is obtained; Using the adjustment parameter to adjust the first reward value of the image layer and the second reward value of the image layer to obtain an adjusted reward value; The first reward value of the image layer, the second reward value of the image layer, and the adjusted reward value are weightedly summed to obtain the target reward value.

[0054] In one embodiment, the target reward value determination module is specifically used to: Calculate the similarity between the image layer information currently required by each container and the image layer information currently cached by each node; According to the similarity, a first reward value of the image layer is obtained.

[0055] In one embodiment, the target reward value determination module is specifically used to: Calculate the ratio between the image layer size cached by each node and the image layer size required by each container; According to the ratio, the second reward value of the image layer is obtained.

[0056] Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call a computer program in the memory 530 to execute the steps of the container scheduling method, for example, including: Obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; Inputting each image layer information and optional scheduling action into the container scheduling model to obtain the target scheduling action output by the container scheduling model; Scheduling the container to be scheduled according to the target scheduling action; The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

[0057] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0058] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the container scheduling method provided in the above embodiments, for example, including: Obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; Inputting each image layer information and optional scheduling action into the container scheduling model to obtain the target scheduling action output by the container scheduling model; Scheduling the container to be scheduled according to the target scheduling action; The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

[0059] On the other hand, an embodiment of the present application further provides a non-transitory computer-readable storage medium on which a computer program is stored, wherein the computer program is used to enable a processor to execute the steps of the container scheduling method provided in the above embodiments, for example, including: Obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; Inputting each image layer information and optional scheduling action into the container scheduling model to obtain the target scheduling action output by the container scheduling model; Scheduling the container to be scheduled according to the target scheduling action; The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

[0060] The non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.

[0061] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0062] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A container scheduling method, characterized in that: include: Obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; Inputting each image layer information and optional scheduling action into the container scheduling model to obtain the target scheduling action output by the container scheduling model; Scheduling the container to be scheduled according to the target scheduling action; The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

2. The container scheduling method according to claim 1, characterized in that: The container scheduling model is determined based on the following method: Generate the value function according to the image layer information required by each container, the image layer information cached by each node, and the scheduling action of scheduling each container to each node; The value function is trained iteratively to obtain the container scheduling model.

3. The container scheduling method according to claim 2, characterized in that: The iterative training of the value function to obtain the container scheduling model includes: According to the image layer information currently required by each container and the image layer information currently cached by each node, select the current scheduling action to schedule each container to each node; Execute the corresponding current scheduling action for each container and each node to obtain the new currently required image layer information of each container, the new currently cached image layer information of each node, and the target reward value; According to the new currently required image layer information of each container and the new currently cached image layer information of each node, a new current scheduling action is selected, and the value function is updated according to the new currently required image layer information of each container, the new currently cached image layer information of each node, the new current scheduling action and the target reward value; If the number of training iterations does not reach the number threshold, then return to the step of executing the corresponding current scheduling action on each container and each node to obtain the new currently required image layer information of each container, the new currently cached image layer information of each node, and the target reward value, until the number of training iterations reaches the number threshold, and the value function at this time is determined as the container scheduling model.

4. The container scheduling method according to claim 3, characterized in that: The target reward value is determined based on the following method: According to the information of each image layer, the first reward value of the image layer is obtained; According to the size of each image layer, the second reward value of the image layer is obtained; Using the adjustment parameter to adjust the first reward value of the image layer and the second reward value of the image layer to obtain an adjusted reward value; The first reward value of the image layer, the second reward value of the image layer, and the adjusted reward value are weightedly summed to obtain the target reward value.

5. The container scheduling method according to claim 4, characterized in that: The step of obtaining the first reward value of the image layer according to the information of each image layer includes: Calculate the similarity between the image layer information currently required by each container and the image layer information currently cached by each node; According to the similarity, a first reward value of the image layer is obtained.

6. The container scheduling method according to claim 4, characterized in that: The step of obtaining the second reward value of the image layer according to the size of each image layer includes: Calculate the ratio between the image layer size cached by each node and the image layer size required by each container; According to the ratio, the second reward value of the image layer is obtained.

7. A container scheduling device, characterized in that: include: The image layer information acquisition module is used to obtain the image layer information required by the container to be scheduled and the image layer information cached by the schedulable node; A scheduling action acquisition module is used to: input each image layer information and optional scheduling action into a container scheduling model to obtain a target scheduling action output by the container scheduling model; A scheduling module, used to: schedule the container to be scheduled according to the target scheduling action; The container scheduling model is trained on the basis of the value function through the image layer information required by each container in the cluster, the image layer information cached by each node, each scheduling action, and the target reward value after each scheduling action is executed.

8. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the container scheduling method according to any one of claims 1 to 6 are implemented.

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

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the container scheduling method according to any one of claims 1 to 6 are implemented.