CN117742875A - Container scheduling method, device, electronic equipment and computer readable medium - Google Patents

Container scheduling method, device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN117742875A
CN117742875A CN202211116378.9A CN202211116378A CN117742875A CN 117742875 A CN117742875 A CN 117742875A CN 202211116378 A CN202211116378 A CN 202211116378A CN 117742875 A CN117742875 A CN 117742875A
Authority
CN
China
Prior art keywords
resource
information
residual
target
remaining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211116378.9A
Other languages
Chinese (zh)
Inventor
孙向阳
田光宇
阴培培
李秋华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202211116378.9A priority Critical patent/CN117742875A/en
Publication of CN117742875A publication Critical patent/CN117742875A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Embodiments of the present disclosure disclose container scheduling methods, apparatuses, electronic devices, and computer-readable media. One embodiment of the method comprises the following steps: selecting node identifiers corresponding to the residual resource information meeting the preset residual resource conditions from the node identifier sets as alternative node identifiers according to the resource demand information of the target container to be scheduled, and obtaining an alternative node identifier set, wherein the resource demand information comprises a resource demand set; selecting the residual resource information meeting the preset similar condition from the residual resource information of the corresponding alternative node identification set according to the resource proportion information of the corresponding resource demand set as target residual resource information; determining an alternative node identifier corresponding to the target residual resource information as a target node identifier; and dispatching the target container to be dispatched to the node equipment corresponding to the target node identifier. The embodiment is related to big data, improves the utilization rate of node equipment resources and saves the node equipment resources.

Description

Container scheduling method, device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a container scheduling method, apparatus, electronic device, and computer readable medium.
Background
Container orchestration refers to the deployment, management, and monitoring of multiple containers. Currently, when a container of a cluster is scheduled, a node needs to be selected from all nodes of the cluster, and a general method is as follows: any node with the residual resource quantity meeting the resource demand quantity of the container is selected from the cluster nodes for scheduling.
However, when selecting cluster nodes in the above manner, there are often the following technical problems: the resource demand type of the container is not considered, so that the bucket effect (for example, 10% of CPU remains, 90% of memory remains and serious waste of memory resources) of the cluster nodes is caused, and the resource utilization rate of the node equipment is low, so that the resource waste of the node equipment is caused.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose container scheduling methods, apparatus, electronic devices, and computer readable media to address one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a container scheduling method, the method comprising: selecting node identifiers corresponding to the residual resource information meeting the preset residual resource conditions from the node identifier sets as alternative node identifiers according to the resource demand information of the target container to be scheduled, and obtaining an alternative node identifier set, wherein the resource demand information comprises a resource demand set; selecting residual resource information meeting preset similar conditions from the residual resource information corresponding to the candidate node identification set as target residual resource information according to the resource proportion information corresponding to the resource demand set; determining an alternative node identifier corresponding to the target residual resource information as a target node identifier, wherein node equipment corresponding to the target node identifier is used for running the target container to be scheduled; and dispatching the target container to be dispatched to the node equipment corresponding to the target node identifier.
Optionally, after selecting, from the node identifier set, the node identifier that the corresponding residual resource information meets the preset residual resource condition as the candidate node identifier, and obtaining the candidate node identifier set, the method further includes: and generating resource proportion information according to the resource demand set.
Optionally, generating the resource proportion information according to the resource demand set includes: determining the resource demand of the corresponding central processor resource in the resource demand set as the central processor resource demand; determining the resource demand of the corresponding memory resource in the resource demand set as the memory resource demand; and determining the ratio of the CPU resource demand to the memory resource demand as resource ratio information.
Optionally, the remaining resource information in the respective remaining resource information includes a remaining resource amount set; and selecting, from the remaining resource information corresponding to the candidate node identifier set, remaining resource information satisfying a preset similarity condition as target remaining resource information according to the resource proportion information corresponding to the resource demand set, including: for each piece of the pieces of the residual resource information, generating residual resource proportion information corresponding to the candidate node identification of the residual resource information according to a residual resource quantity set included in the residual resource information; and selecting the residual resource information meeting the preset similarity condition from the residual resource information as target residual resource information, wherein the preset similarity condition is that the similarity between the residual resource proportion information corresponding to the residual resource information and the resource proportion information is a first target similarity, and the first target similarity is the maximum value of the similarity between the residual resource proportion information corresponding to the residual resource information and the resource proportion information.
Optionally, the generating the remaining resource proportion information corresponding to the candidate node identifier of the remaining resource information includes: determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor; determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity; and determining the ratio of the residual resource quantity of the CPU to the residual resource quantity of the memory as residual resource ratio information.
Optionally, the selecting, according to the resource proportion information corresponding to the resource demand set, the remaining resource information that meets the preset similar condition from the remaining resource information corresponding to the candidate node identification set as the target remaining resource information further includes: in response to the selected number of target remaining resource information being greater than the preset number, performing the steps of: determining the resource demand of the corresponding graphic processor resource in the resource demand set as the graphic processor resource demand; determining the resource demand of the corresponding central processor resource in the resource demand set as the central processor resource demand; determining the resource demand of the corresponding memory resource in the resource demand set as the memory resource demand; updating the resource proportion information into the proportion of the CPU resource demand, the memory resource demand and the graphics processor resource demand; updating each piece of residual resource proportion information corresponding to the selected target residual resource information; selecting target residual resource information meeting a preset updating similarity condition from the selected target residual resource information as candidate target residual resource information, wherein the preset updating similarity condition is that the similarity between the corresponding updated residual resource proportion information and the updated resource proportion information is a second target similarity, and the second target similarity is the maximum value in the similarity between the updated residual resource proportion information and the updated resource proportion information; and in response to determining that the number of the selected candidate target residual resource information is the preset number, determining the candidate target residual resource information as target residual resource information.
Optionally, the selecting, according to the resource proportion information corresponding to the resource demand set, the remaining resource information that meets the preset similar condition from the remaining resource information corresponding to the candidate node identification set as the target remaining resource information further includes: and in response to determining that the number of the selected candidate target residual resource information is greater than the preset number, selecting candidate target residual resource information with the largest corresponding central processing unit residual resource amount from the selected candidate target residual resource information as target residual resource information.
Optionally, the updating the respective remaining resource proportion information corresponding to the selected target remaining resource information includes: for each of the above-described respective remaining resource proportion information, the following steps are performed: determining a residual resource quantity set corresponding to the residual resource proportion information; determining the residual resource quantity of the corresponding graphics processor resource in the determined residual resource quantity set as the graphics processor residual resource quantity; determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor; determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity; and updating the residual resource proportion information into the proportion of the residual resource quantity of the CPU, the residual resource quantity of the memory and the residual resource quantity of the graphic processor.
In a second aspect, some embodiments of the present disclosure provide a container scheduling apparatus, the apparatus comprising: the first selection unit is configured to select node identifiers corresponding to the residual resource information meeting preset residual resource conditions from the node identifier sets as alternative node identifiers according to the resource demand information of the target container to be scheduled, and obtain an alternative node identifier set, wherein the resource demand information comprises a resource demand set; a second selecting unit configured to select, as target remaining resource information, remaining resource information satisfying a preset similar condition from among respective remaining resource information corresponding to the candidate node identification set according to the resource proportion information corresponding to the resource demand set; the determining unit is configured to determine an alternative node identifier corresponding to the target residual resource information as a target node identifier, wherein node equipment corresponding to the target node identifier is used for running the target container to be scheduled; and the scheduling unit is configured to schedule the target container to be scheduled to the node equipment corresponding to the target node identification.
Optionally, after the first selection unit, the apparatus further comprises: and a resource proportion information generating unit configured to generate resource proportion information according to the resource demand set.
Optionally, the resource proportion information generating unit is further configured to: determining the resource demand of the corresponding central processor resource in the resource demand set as the central processor resource demand; determining the resource demand of the corresponding memory resource in the resource demand set as the memory resource demand; and determining the ratio of the CPU resource demand to the memory resource demand as resource ratio information.
Optionally, the remaining resource information in the respective remaining resource information includes a remaining resource amount set.
Optionally, the second selecting unit includes: a residual resource proportion information generating unit and a target residual resource information selecting unit. Wherein the remaining resource proportion information generating unit is configured to generate, for each piece of the remaining resource information, remaining resource proportion information corresponding to an alternative node identifier of the remaining resource information according to a remaining resource amount set included in the remaining resource information. The target remaining resource information selecting unit is configured to select remaining resource information satisfying the preset similarity condition from the respective remaining resource information as target remaining resource information, wherein the preset similarity condition is that a similarity between remaining resource proportion information corresponding to the remaining resource information and the resource proportion information is a first target similarity, and the first target similarity is a maximum value of similarities between respective remaining resource proportion information corresponding to the respective remaining resource information and the resource proportion information.
Optionally, the remaining resource proportion information generating unit is further configured to: determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor; determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity; and determining the ratio of the residual resource quantity of the CPU to the residual resource quantity of the memory as residual resource ratio information.
Optionally, the second selecting unit further includes: an execution unit and a determination unit. Wherein the execution unit is configured to execute the following steps in response to the number of the selected target remaining resource information being greater than the preset number: determining the resource demand of the corresponding graphic processor resource in the resource demand set as the graphic processor resource demand; determining the resource demand of the corresponding central processor resource in the resource demand set as the central processor resource demand; determining the resource demand of the corresponding memory resource in the resource demand set as the memory resource demand; updating the resource proportion information into the proportion of the CPU resource demand, the memory resource demand and the graphics processor resource demand; updating each piece of residual resource proportion information corresponding to the selected target residual resource information; selecting target residual resource information meeting a preset updating similarity condition from the selected target residual resource information as candidate target residual resource information, wherein the preset updating similarity condition is that the similarity between the corresponding updated residual resource proportion information and the updated resource proportion information is a second target similarity, and the second target similarity is the maximum value of the similarity between the updated residual resource proportion information and the updated resource proportion information. The determination unit is configured to determine the candidate target remaining resource information as target remaining resource information in response to determining that the number of the selected candidate target remaining resource information is the preset number.
Optionally, the second selecting unit further includes: and an alternative target remaining resource information selecting unit configured to select, as target remaining resource information, alternative target remaining resource information having the largest amount of remaining resources of the corresponding central processor from among the selected alternative target remaining resource information in response to determining that the number of the selected alternative target remaining resource information is greater than the preset number.
Optionally, the execution unit includes: an execution subunit configured to, for each of the respective remaining resource proportion information described above, execute the steps of: determining a residual resource quantity set corresponding to the residual resource proportion information; determining the residual resource quantity of the corresponding graphics processor resource in the determined residual resource quantity set as the graphics processor residual resource quantity; determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor; determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity; and updating the residual resource proportion information into the proportion of the residual resource quantity of the CPU, the residual resource quantity of the memory and the residual resource quantity of the graphic processor.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors causes the one or more processors to implement the method described in any of the implementations of the first aspect above.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
The above embodiments of the present disclosure have the following advantageous effects: by the container scheduling method of some embodiments of the present disclosure, the utilization rate of the node equipment resources is improved, and the node equipment resources are saved. Specifically, the reasons for the low utilization rate of the resources of the node equipment and the waste of the resources of the node equipment are as follows: the resource demand type of the container is not considered, so that the bucket effect (for example, 10% of CPU remains, 90% of memory remains and serious waste of memory resources) of the cluster nodes is caused, and the resource utilization rate of the node equipment is low, so that the resource waste of the node equipment is caused. Based on this, in the container scheduling method of some embodiments of the present disclosure, first, according to the resource demand information of the target container to be scheduled, a node identifier corresponding to the remaining resource information and meeting the preset remaining resource condition is selected from the node identifier set as an alternative node identifier, and an alternative node identifier set is obtained. Wherein the resource demand information includes a resource demand set. Therefore, the residual resources of the nodes corresponding to the candidate node identifications can meet the resource requirements of the target container to be scheduled. And then, selecting the residual resource information meeting the preset similar condition from the residual resource information corresponding to the candidate node identification set according to the resource proportion information corresponding to the resource demand set as target residual resource information. Therefore, the target residual resource information with similar residual resources and the resource proportion of the residual resources can be selected according to the resource proportion information of the target container to be scheduled. And then, determining the alternative node identification corresponding to the target residual resource information as a target node identification. And the node equipment corresponding to the target node identifier is used for running the target container to be scheduled. Thus, the target node identification may be the node identification of the candidate node with a similar proportion of the remaining resources to the resources of the target container to be scheduled. And finally, dispatching the target container to be dispatched to the node equipment corresponding to the target node identifier. Thus, the target container to be scheduled can be scheduled to the alternative nodes with similar proportions of the residual resources and the resources. And because the resource proportion of the node equipment corresponding to the target node identification and the target container to be scheduled is similar, the types of the residual resources are similar to the resource demand types of the target container to be scheduled, the bucket effect of the cluster nodes can be reduced, the containers with similar resource demand types can be integrated together, the resource utilization rate of the node equipment is improved, and the equipment resources are saved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is an architecture diagram of an exemplary system in which some embodiments of the present disclosure may be applied;
FIG. 2 is a flow chart of some embodiments of a container scheduling method according to the present disclosure;
FIG. 3 is a schematic diagram of a target container to be scheduled and clusters according to some embodiments of the container scheduling method of the present disclosure;
FIG. 4 is a flow chart of further embodiments of a container scheduling method according to the present disclosure;
FIG. 5 is a schematic structural view of some embodiments of a container scheduling apparatus according to the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which the container scheduling method or container scheduling apparatus of some embodiments of the present disclosure may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting information display, including but not limited to smartphones, tablet computers, electronic book readers, laptop and desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing support for information displayed on the terminal devices 101, 102, 103. The background server can analyze the received data and feed back the processing result to the terminal equipment.
It should be noted that, the container scheduling method provided by the embodiment of the present disclosure may be performed by the terminal devices 101, 102, 103, or may be performed by the server 105. Accordingly, the container scheduling means may be provided in the terminal devices 101, 102, 103 or in the server 105. The present invention is not particularly limited herein.
The server may be hardware or software. When the server is hardware, the server may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a container scheduling method according to the present disclosure is shown. The container scheduling method comprises the following steps:
step 201, selecting a node identifier corresponding to the residual resource information meeting the preset residual resource condition from the node identifier set as an alternative node identifier according to the resource demand information of the target container to be scheduled, and obtaining an alternative node identifier set.
In some embodiments, an execution body of the container scheduling method (for example, a server shown in fig. 1) may select, according to resource requirement information of a target container to be scheduled, a node identifier of which corresponding residual resource information meets a preset residual resource condition from a node identifier set as an alternative node identifier, to obtain an alternative node identifier set. The target container to be scheduled may be any newly created container or container in a cluster to be scheduled. The clusters may be a set of mutually independent computers interconnected through a high-speed network. The container may be the smallest management unit of the cluster. For example, the cluster may be a Kubernetes cluster. The container may be a POD in Kubernetes. The resource requirement information may be resource related information required for running the target container to be scheduled. The resource demand information may include a set of resource demands. The set of resource requirements may be respective resource requirements corresponding to different device resource types. The different device resource types described above may include, but are not limited to: central processor resources, memory resources. The different device resource types described above may also include disk resources. The resource requirement corresponding to the CPU resource may be the core number. The resource demand of the corresponding memory resource may be a memory size. The resource demand of the corresponding disk resource may be the disk IO size. The set of node identifiers may be a set of identifiers for respective nodes in a cluster. The above-mentioned nodes may be node devices constituting a cluster for running containers. For example, the Node may be a Node in a Kubernetes cluster. The remaining resource information may be information related to remaining device resources in the node corresponding to the node identifier. The remaining resource information may include, but is not limited to: the amount of remaining resources corresponds to the amount of remaining resources of the central processing unit resources and the amount of remaining resources corresponds to the memory resources. The remaining resource information may further include a remaining resource amount corresponding to the disk resource. The remaining amount of resources corresponding to the cpu resources may be the remaining number of cores. The remaining amount of the corresponding memory resource may be a remaining memory size. The remaining resource amount of the corresponding disk resource may be the remaining disk IO size. The preset remaining resource condition may be that each remaining resource amount included in the remaining resource information is greater than or equal to a resource demand amount corresponding to the remaining resource amount in the resource demand amount set.
As an example, the set of resource requirements may include a resource requirement 1C for the corresponding central processor resource and a resource requirement 10G for the corresponding memory resource. The node identification set may be [ node1, node2, node3, node4, node5]. The remaining resource information of node1 may be [ cpu:20C, memory:180G ]. The remaining resource information of node2 may be [ cpu:10C, memory:80G ]. The remaining resource information of node3 may be [ cpu:45C, memory:8G ]. The remaining resource information of node4 may be [ cpu:32C, memory:128G ]. Where cpu may represent the remaining cores of the corresponding central processor resource. memory may represent the remaining memory size of the corresponding memory resource. The preset remaining resource condition may be that the number of remaining cores included in the remaining resource information is greater than or equal to 1C, and the size of remaining memory included in the remaining resource information is greater than or equal to 10G. Thus, the nodes corresponding to the residual resource information satisfying the preset residual resource condition are identified as node1, node2 and node4. The resulting set of candidate node identities is node1, node2, node4.
Alternatively, the execution body may generate the resource proportion information according to the resource demand set. In practice, the execution body may determine a ratio between the respective resource demands in the resource demand set as the resource ratio information. Here, the ratio may be a ratio reduced by the greatest common divisor of the respective resource demands, or may be a ratio reduced by the resource demands corresponding to the cpu resources. Therefore, the resource proportion information can be automatically generated according to the resource demand set included in the resource demand information of the target container to be scheduled.
Step 202, selecting the residual resource information meeting the preset similar condition from the residual resource information of the corresponding alternative node identification set according to the resource proportion information of the corresponding resource demand set as target residual resource information.
In some embodiments, the execution body may select, as the target remaining resource information, remaining resource information satisfying a preset similar condition from among the respective remaining resource information corresponding to the candidate node identification set according to the resource proportion information corresponding to the resource demand set. The resource proportion information may be a proportion between the resource demands in the resource demand set. For example, the resource demand set may include a resource demand 1C for central processor resources, a resource demand 10G for memory resources, and a resource demand 4KiB for disk resources. The resource proportion information may be 1:10:4. the resource proportion information may be included in the resource demand information. The remaining resource information in the respective remaining resource information may further include remaining resource proportion information. The above-described remaining resource proportion information may be a proportion between respective remaining resource amounts included in the remaining resource information. The preset similarity condition may be that the similarity between the remaining resource information and the resource requirement information is the maximum similarity. The maximum similarity may be a maximum value of similarity between each of the remaining resource information and the resource demand information. Here, it is described. The similarity may be cosine similarity. Here, the ratio may be a ratio reduced by the greatest common divisor of the respective resource demand amounts or the respective remaining resource amounts, or may be a ratio reduced by the resource demand amounts or the remaining resource amounts corresponding to the cpu resources. The remaining resource proportion information and the resource types corresponding to the dimensions of the resource proportion information are the same. For example, the remaining resource proportion information may be 1:9:6. the resource proportion information may be 1:10:4. the remaining resource proportion information and the first dimension of the resource proportion information both correspond to the central processor resource. And the remaining resource proportion information and the second dimension of the resource proportion information correspond to the memory resource. And the remaining resource proportion information and the third dimension of the resource proportion information correspond to disk resources.
In practice, first, the execution body may extract the resource sub-ratio of the corresponding cpu resource and the memory resource from the resource ratio information. For example, the resource proportion information 1 may be: 10:4, extracting resource sub-proportion 1 of corresponding CPU resource and memory resource: 10. then, for the remaining resource proportion information included in each piece of the remaining resource information, the remaining resource sub-proportion of the corresponding central processor resource and memory resource is extracted from the remaining resource proportion information. Then, a remaining resource sub-ratio having the smallest absolute value of the difference from the above-mentioned resource sub-ratio may be selected as the target remaining resource sub-ratio from among the extracted remaining resource sub-ratios. Then, the remaining resource information corresponding to the target remaining resource sub-ratio may be determined as remaining resource information satisfying the preset similar condition.
In practice, the execution body may further select, as the target remaining resource proportion information, remaining resource proportion information having the greatest similarity with the above-mentioned resource proportion information from among the respective remaining resource proportion information corresponding to the selected target remaining resource sub-proportion in response to determining that the number of the selected target remaining resource sub-proportions is greater than 1. Here, the above-mentioned similarity may be cosine similarity. It may be appreciated that when determining the similarity between the resource proportion information and the remaining resource proportion information, the resource proportion information and the remaining resource proportion information may be mapped into vectors to determine the similarity, respectively. For example, the resource proportion information 1 may be: 10:4 are mapped to vectors (1, 10, 4). Then, the remaining resource information corresponding to the target remaining resource proportion information may be determined as remaining resource information satisfying the preset similarity condition.
In practice, the execution body may further select, as the target remaining-resource-ratio information, any remaining-resource-ratio information having the largest remaining resource amount of the corresponding central-processor resource included in the corresponding remaining-resource information, from among the remaining-resource-ratio information having the largest similarity to the above-mentioned resource-ratio information, in response to determining that the number of remaining-resource-ratio information having the largest similarity to the above-mentioned resource-ratio information is larger than 1.
And 203, determining the alternative node identification corresponding to the target residual resource information as a target node identification.
In some embodiments, the execution body may determine the candidate node identifier corresponding to the target remaining resource information as a target node identifier. The node device corresponding to the target node identifier may be used to run the target container to be scheduled.
And step 204, scheduling the target container to be scheduled to the node equipment corresponding to the target node identification.
In some embodiments, the execution body may schedule the target container to be scheduled to the node device corresponding to the target node identifier. In practice, the execution body may bind the target node identifier and the container identifier of the target container to be scheduled, so as to implement scheduling of the target container to be scheduled to the node device corresponding to the target node identifier. For example, the target node identifier and the container identifier may be sent to a kube-apiserver, so as to bind the target node identifier and the container identifier of the target container to be scheduled, thereby implementing scheduling of the target container to be scheduled to the node device corresponding to the target node identifier. As shown in fig. 3, 301 is a node device of each node included in the cluster. 3011 identify a corresponding node device for the target node. The execution body may schedule the target container 302 to be scheduled to the node device 3011. Wherein the target container to be scheduled 302 may be container 001. 001 may be a container identification.
The above embodiments of the present disclosure have the following advantageous effects: by the container scheduling method of some embodiments of the present disclosure, the utilization rate of the node equipment resources is improved, and the node equipment resources are saved. Specifically, the reasons for the low utilization rate of the resources of the node equipment and the waste of the resources of the node equipment are as follows: the resource demand type of the container is not considered, so that the bucket effect (for example, 10% of CPU remains, 90% of memory remains and serious waste of memory resources) of the cluster nodes is caused, and the resource utilization rate of the node equipment is low, so that the resource waste of the node equipment is caused. Based on this, in the container scheduling method of some embodiments of the present disclosure, first, according to the resource demand information of the target container to be scheduled, a node identifier corresponding to the remaining resource information and meeting the preset remaining resource condition is selected from the node identifier set as an alternative node identifier, and an alternative node identifier set is obtained. Wherein the resource demand information includes a resource demand set. Therefore, the residual resources of the nodes corresponding to the candidate node identifications can meet the resource requirements of the target container to be scheduled. And then, selecting the residual resource information meeting the preset similar condition from the residual resource information corresponding to the candidate node identification set according to the resource proportion information corresponding to the resource demand set as target residual resource information. Therefore, the target residual resource information with similar residual resources and the resource proportion of the residual resources can be selected according to the resource proportion information of the target container to be scheduled. And then, determining the alternative node identification corresponding to the target residual resource information as a target node identification. And the node equipment corresponding to the target node identifier is used for running the target container to be scheduled. Thus, the target node identification may be the node identification of the candidate node with a similar proportion of the remaining resources to the resources of the target container to be scheduled. And finally, dispatching the target container to be dispatched to the node equipment corresponding to the target node identifier. Thus, the target container to be scheduled can be scheduled to the alternative nodes with similar proportions of the residual resources and the resources. And because the resource proportion of the node equipment corresponding to the target node identification and the target container to be scheduled is similar, the types of the residual resources are similar to the resource demand types of the target container to be scheduled, the bucket effect of the cluster nodes can be reduced, the containers with similar resource demand types can be integrated together, the resource utilization rate of the node equipment is improved, and the equipment resources are saved.
With further reference to fig. 4, a flow 400 of further embodiments of a container scheduling method is shown. The flow 400 of the container scheduling method includes the steps of:
step 401, selecting a node identifier corresponding to the residual resource information meeting the preset residual resource condition from the node identifier set as an alternative node identifier according to the resource demand information of the target container to be scheduled, and obtaining an alternative node identifier set.
In some embodiments, the specific implementation of step 401 and the technical effects thereof may refer to step 201 in those embodiments corresponding to fig. 2, which are not described herein.
Step 402, determining a resource demand of a corresponding central processor resource in the resource demand set as the central processor resource demand.
In some embodiments, the execution body of the container scheduling method (e.g., the server shown in fig. 1) may determine the resource demand of the corresponding central processor resource in the above-described resource demand set as the central processor resource demand. For example, the resource demand set may include resource demand 1C for central processor resources, resource demand 10G for memory resources. The execution body may determine the resource demand 1C of the corresponding cpu resource in the resource demand set as the cpu resource demand.
In step 403, the resource demand of the corresponding memory resource in the resource demand set is determined as the memory resource demand.
In some embodiments, the execution body may determine a resource demand of a corresponding memory resource in the resource demand set as the memory resource demand. As an example, the execution body may determine the resource demand 10G of the corresponding memory resource in the resource demand set illustrated in step 402 as the memory resource demand.
Step 404, determining the ratio of the cpu resource demand to the memory resource demand as the resource ratio information.
In some embodiments, the execution body may determine a ratio of the cpu resource demand to the memory resource demand as the resource ratio information. In practice, the execution entity may first determine a greatest common divisor of the cpu resource requirement and the memory resource requirement. Then, the ratio of the cpu resource demand to the memory resource demand, which is reduced by the greatest common divisor, may be determined as resource ratio information.
In practice, the execution body may determine, as the resource proportion information, a proportion of the cpu resource demand and the memory resource demand, which is obtained by simplifying the cpu resource demand. Thus, the ratio of the resource demand amounts corresponding to the central processor resource and the memory resource can be determined as the resource ratio information.
Step 405, for each piece of residual resource information in the pieces of residual resource information, generating residual resource proportion information of the candidate node identification corresponding to the residual resource information according to the residual resource quantity set included in the residual resource information.
In some embodiments, for each piece of the pieces of the remaining resource information, the execution body may generate remaining resource proportion information corresponding to an alternative node identifier of the piece of the remaining resource information according to a remaining resource amount set included in the piece of the remaining resource information. In practice, the execution body may determine the remaining resource amount of the corresponding central processor resource in the remaining resource amount set as the central processor remaining resource amount. Then, the remaining resource amount of the corresponding memory resource in the remaining resource amount set may be determined as the remaining memory resource amount. Then, the ratio of the amount of remaining resources of the cpu to the amount of remaining resources of the memory may be determined as remaining resource ratio information. For example, the set of remaining resource amounts may be [ cpu:20C, memory:180G ]. The remaining resource proportion information may be 1:9.
And step 406, selecting the residual resource information meeting the preset similar condition from the residual resource information as target residual resource information.
In some embodiments, the execution body may select, as the target remaining resource information, remaining resource information satisfying the preset similarity condition from the respective remaining resource information. The preset similarity condition may be that a similarity between the remaining resource proportion information corresponding to the remaining resource information and the resource proportion information is a first target similarity. The first target similarity may be a maximum value of the similarity between the respective pieces of remaining resource proportion information corresponding to the respective pieces of remaining resource information and the resource proportion information. In practice, the execution subject may select, from the respective pieces of residual resource information, residual resource information having a smallest absolute value of a difference between the corresponding residual resource proportion information and the resource proportion information, and use the selected residual resource information as the residual resource information satisfying the preset similar condition.
In practice, the execution body may further select, as the remaining resource information satisfying the preset similarity condition, any remaining resource information having the largest amount of remaining resources of the corresponding central processor from among the remaining resource information having the smallest absolute value of the difference between the corresponding remaining resource proportion information and the resource proportion information, in response to the number of remaining resource information having the smallest absolute value of the difference between the corresponding remaining resource proportion information and the resource proportion information being greater than 1. Thus, the target remaining resource information can be selected from the dimensions of the central processor resource and the memory resource.
Optionally, the set of resource requirements may further include a resource requirement of a corresponding graphics processor resource. First, the execution body may execute the following steps in response to the number of the selected target remaining resource information being greater than a preset number:
first, determining the resource demand of the corresponding graphics processor resource in the resource demand set as the graphics processor resource demand. For example, the resource demand for the corresponding graphics processor resource may be a memory size. The preset number may be 1.
And secondly, determining the resource demand of the corresponding CPU resource in the resource demand set as the CPU resource demand.
And thirdly, determining the resource demand of the corresponding memory resource in the resource demand set as the memory resource demand.
And fourth, updating the resource proportion information into the proportion of the CPU resource demand, the memory resource demand and the graphics processor resource demand. In practice, the execution entity may reduce the ratio of the cpu resource demand, the memory resource demand, and the graphics processor resource demand by a greatest common divisor of the cpu resource demand, the memory resource demand, and the graphics processor resource demand. The resource proportion information may then be updated to a reduced proportion. In practice, the execution body may further reduce the ratio of the cpu resource requirement, the memory resource requirement, and the graphics processor resource requirement by the cpu resource requirement.
And fifthly, updating the proportion information of each residual resource corresponding to the selected target residual resource information. In practice, for each of the above-described respective remaining-resource-proportion information, the following steps are performed:
first, a set of remaining resource amounts corresponding to the remaining resource proportion information is determined. In practice, a set of remaining resource amounts included in the remaining resource information corresponding to the remaining resource proportion information may be determined.
Then, the determined remaining resource amount of the corresponding graphics processor resource in the remaining resource amount set is determined as the graphics processor remaining resource amount. For example, the amount of remaining resources corresponding to graphics processor resources may be the remaining memory size.
And then, determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor.
And secondly, determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity.
And finally, updating the residual resource proportion information into the proportion of the residual resource quantity of the central processing unit, the residual resource quantity of the memory and the residual resource quantity of the graphic processor. In practice, the execution body may reduce the ratio of the cpu residual resource amount, the memory residual resource amount, and the graphics processor residual resource amount by a greatest common divisor of the cpu residual resource amount, the memory residual resource amount, and the graphics processor residual resource amount. The remaining resource proportion information may then be updated to a reduced proportion. In practice, the execution body may reduce the ratio of the cpu residual resource amount, the memory residual resource amount, and the graphics processor residual resource amount by using the cpu residual resource amount.
And sixthly, selecting target residual resource information meeting the preset updating similar condition from the selected target residual resource information as alternative target residual resource information. The preset update similarity condition may be the similarity between the corresponding updated remaining resource proportion information and the updated resource proportion information, and may be the second target similarity. The second target similarity may be a maximum value of the updated similarity between the respective pieces of remaining resource proportion information and the updated resource proportion information. In practice, the execution subject may select, from the remaining resource proportion information corresponding to the selected target remaining resource information, remaining resource proportion information having the greatest similarity with the resource proportion information as the target remaining resource proportion information. Then, the target remaining resource information corresponding to the selected target remaining resource proportion information may be used as the candidate target remaining resource information.
Then, in response to determining that the number of the selected target residual resource information candidates is the preset number, the target residual resource information candidates are determined as target residual resource information.
Alternatively, in response to determining that the number of the selected candidate target remaining resource information is greater than the preset number, the execution body may select candidate target remaining resource information having the largest amount of remaining resources of the corresponding central processing unit from the selected candidate target remaining resource information as the target remaining resource information. In practice, any candidate target remaining resource information with the largest amount of remaining resources of the corresponding central processing unit may be selected from the selected candidate target remaining resource information as the target remaining resource information.
Step 407, determining the candidate node identifier corresponding to the target residual resource information as the target node identifier.
And step 408, scheduling the target container to be scheduled to the node equipment corresponding to the target node identification.
In some embodiments, the specific implementation of steps 407-408 and the technical effects thereof may refer to steps 203-204 in those embodiments corresponding to fig. 2, which are not described herein.
As can be seen in fig. 4, the flow 400 of the container scheduling method in some embodiments corresponding to fig. 4 embodies the steps extended from the selection of target remaining resource information from the dimensions of the central processor resource and the memory resource, as compared to the description of some embodiments corresponding to fig. 2. Therefore, the schemes described in the embodiments can reduce the bucket effect of cluster nodes, integrate containers with similar demand types under the dimension of the central processing unit resource and the memory resource, improve the resource utilization rate of node equipment and save the equipment resource.
With further reference to fig. 5, as an implementation of the method illustrated in the above figures, the present disclosure provides some embodiments of a container scheduling apparatus, which apparatus embodiments correspond to those illustrated in fig. 2, and which apparatus is particularly applicable in a variety of electronic devices.
As shown in fig. 5, the container scheduling apparatus 500 of some embodiments includes: a first selection unit 501, a second selection unit 502, a determination unit 503, and a scheduling unit 504. The first selecting unit 501 is configured to select, according to resource requirement information of a target container to be scheduled, a node identifier corresponding to residual resource information that meets a preset residual resource condition from a node identifier set as an alternative node identifier, and obtain an alternative node identifier set, where the resource requirement information includes a resource requirement set; the second selecting unit 502 is configured to select, according to the resource proportion information corresponding to the resource demand set, remaining resource information satisfying a preset similar condition from among the respective remaining resource information corresponding to the candidate node identification set, as target remaining resource information; the determining unit 503 is configured to determine an alternative node identifier corresponding to the target remaining resource information as a target node identifier, where a node device corresponding to the target node identifier is used to run the target container to be scheduled; the scheduling unit 504 is configured to schedule the target container to be scheduled to a node device corresponding to the target node identifier.
Optionally, after the first selection unit 501, the container scheduling apparatus 500 may further include: a resource proportion information generating unit (not shown in the figure) configured to generate resource proportion information from the above-described resource demand set.
Optionally, the resource proportion information generating unit may be further configured to: determining the resource demand of the corresponding central processor resource in the resource demand set as the central processor resource demand; determining the resource demand of the corresponding memory resource in the resource demand set as the memory resource demand; and determining the ratio of the CPU resource demand to the memory resource demand as resource ratio information.
Optionally, the remaining resource information in the respective remaining resource information includes a remaining resource amount set.
Alternatively, the second selection unit 502 may include: a remaining resource proportion information generating unit and a target remaining resource information selecting unit (not shown in the figure). Wherein the remaining resource proportion information generating unit is configured to generate, for each piece of the remaining resource information, remaining resource proportion information corresponding to an alternative node identifier of the remaining resource information according to a remaining resource amount set included in the remaining resource information. The target remaining resource information selecting unit is configured to select remaining resource information satisfying the preset similarity condition from the respective remaining resource information as target remaining resource information, wherein the preset similarity condition is that a similarity between remaining resource proportion information corresponding to the remaining resource information and the resource proportion information is a first target similarity, and the first target similarity is a maximum value of similarities between respective remaining resource proportion information corresponding to the respective remaining resource information and the resource proportion information.
Alternatively, the remaining resource proportion information generating unit may be further configured to: determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor; determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity; and determining the ratio of the residual resource quantity of the CPU to the residual resource quantity of the memory as residual resource ratio information.
Optionally, the second selecting unit 502 may further include: an execution unit and a determination unit (not shown in the figure). Wherein the execution unit is configured to execute the following steps in response to the number of the selected target remaining resource information being greater than the preset number: determining the resource demand of the corresponding graphic processor resource in the resource demand set as the graphic processor resource demand; updating the resource proportion information into the proportion of the CPU resource demand, the memory resource demand and the graphics processor resource demand; updating each piece of residual resource proportion information corresponding to the selected target residual resource information; selecting target residual resource information meeting a preset updating similarity condition from the selected target residual resource information as candidate target residual resource information, wherein the preset updating similarity condition is that the similarity between the corresponding updated residual resource proportion information and the updated resource proportion information is a second target similarity, and the second target similarity is the maximum value of the similarity between the updated residual resource proportion information and the updated resource proportion information. The determination unit is configured to determine the candidate target remaining resource information as target remaining resource information in response to determining that the number of the selected candidate target remaining resource information is the preset number.
Optionally, the second selecting unit 502 may further include: an alternative target remaining resource information selecting unit (not shown in the figure) configured to select, as target remaining resource information, alternative target remaining resource information having the largest amount of remaining resources of the corresponding central processing unit from among the selected alternative target remaining resource information in response to determining that the number of the selected alternative target remaining resource information is greater than the above-described preset number.
Alternatively, the execution unit may include: an execution subunit (not shown in the figure) configured to, for each of the above-described respective remaining-resource-proportion information, execute the steps of: determining a residual resource quantity set corresponding to the residual resource proportion information; determining the residual resource quantity of the corresponding graphics processor resource in the determined residual resource quantity set as the graphics processor residual resource quantity; determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor; determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity; and updating the residual resource proportion information into the proportion of the residual resource quantity of the CPU, the residual resource quantity of the memory and the residual resource quantity of the graphic processor.
It will be appreciated that the elements described in the container scheduling apparatus 500 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting benefits described above with respect to the method are equally applicable to the apparatus 500 and the units contained therein, and are not described in detail herein.
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., server in fig. 1) 600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 6 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications device 609, or from storage device 608, or from ROM 602. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that, the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: selecting node identifiers corresponding to the residual resource information meeting the preset residual resource conditions from the node identifier sets as alternative node identifiers according to the resource demand information of the target container to be scheduled, and obtaining an alternative node identifier set, wherein the resource demand information comprises a resource demand set; selecting residual resource information meeting preset similar conditions from the residual resource information corresponding to the candidate node identification set as target residual resource information according to the resource proportion information corresponding to the resource demand set; determining an alternative node identifier corresponding to the target residual resource information as a target node identifier, wherein node equipment corresponding to the target node identifier is used for running the target container to be scheduled; and dispatching the target container to be dispatched to the node equipment corresponding to the target node identifier.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes a first selection unit, a second selection unit, a determination unit, and a scheduling unit. The names of the units do not form a limitation on the unit itself in a certain case, for example, the first selecting unit may also be described as a unit for selecting, from the node identifier set, a node identifier corresponding to the remaining resource information and meeting the preset remaining resource condition as an alternative node identifier according to the resource requirement information of the target container to be scheduled, to obtain an alternative node identifier set.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (11)

1. A method of scheduling containers, comprising:
selecting node identifiers corresponding to the residual resource information meeting preset residual resource conditions from the node identifier sets as alternative node identifiers according to the resource demand information of the target container to be scheduled, and obtaining an alternative node identifier set, wherein the resource demand information comprises a resource demand set;
selecting residual resource information meeting preset similar conditions from the residual resource information corresponding to the candidate node identification set as target residual resource information according to the resource proportion information corresponding to the resource demand set;
determining an alternative node identifier corresponding to the target residual resource information as a target node identifier, wherein node equipment corresponding to the target node identifier is used for operating the target container to be scheduled;
and dispatching the target container to be dispatched to node equipment corresponding to the target node identifier.
2. The method of claim 1, wherein after selecting, from the node identifier set, a node identifier corresponding to the remaining resource information that satisfies a preset remaining resource condition as an alternative node identifier, and obtaining the alternative node identifier set, the method further includes:
And generating resource proportion information according to the resource demand set.
3. The method of claim 2, wherein the generating resource proportion information from the set of resource requirements comprises:
determining the resource demand of the corresponding central processor resource in the resource demand set as the central processor resource demand;
determining the resource demand of the corresponding memory resource in the resource demand set as the memory resource demand;
and determining the ratio of the CPU resource demand to the memory resource demand as resource ratio information.
4. The method of claim 1, wherein the remaining resource information in the respective remaining resource information comprises a remaining resource amount set; and
selecting, from the pieces of remaining resource information corresponding to the candidate node identification sets, remaining resource information satisfying a preset similar condition as target remaining resource information according to the resource proportion information corresponding to the resource demand set, including:
for each piece of residual resource information in the pieces of residual resource information, generating residual resource proportion information corresponding to the alternative node identification of the residual resource information according to a residual resource quantity set included in the residual resource information;
And selecting the residual resource information meeting the preset similarity condition from the residual resource information as target residual resource information, wherein the preset similarity condition is that the similarity between the residual resource proportion information corresponding to the residual resource information and the resource proportion information is a first target similarity, and the first target similarity is the maximum value of the similarity between the residual resource proportion information corresponding to the residual resource information and the resource proportion information.
5. The method of claim 4, wherein the generating remaining resource proportion information corresponding to the candidate node identification of the remaining resource information comprises:
determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor;
determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity;
and determining the ratio of the residual resource quantity of the central processing unit to the residual resource quantity of the memory as residual resource ratio information.
6. The method according to claim 4, wherein the selecting, from the respective pieces of remaining resource information corresponding to the candidate node identification sets, remaining resource information satisfying a preset similarity condition as target remaining resource information according to the resource proportion information corresponding to the resource demand set, further comprises:
In response to the selected number of target remaining resource information being greater than the preset number, performing the steps of:
determining the resource demand of the corresponding graphic processor resource in the resource demand set as the graphic processor resource demand;
determining the resource demand of the corresponding central processor resource in the resource demand set as the central processor resource demand;
determining the resource demand of the corresponding memory resource in the resource demand set as the memory resource demand;
updating the resource proportion information into the proportion of the CPU resource demand, the memory resource demand and the graphics processor resource demand;
updating each piece of residual resource proportion information corresponding to the selected target residual resource information;
selecting target residual resource information meeting a preset updating similarity condition from the selected target residual resource information as candidate target residual resource information, wherein the preset updating similarity condition is that the similarity between the corresponding updated residual resource proportion information and the updated resource proportion information is second target similarity, and the second target similarity is the maximum value in the similarity between the updated residual resource proportion information and the updated resource proportion information;
And in response to determining that the number of the selected candidate target remaining resource information is the preset number, determining the candidate target remaining resource information as target remaining resource information.
7. The method of claim 6, wherein the selecting, from the respective remaining resource information corresponding to the candidate node identification set, remaining resource information satisfying a preset similarity condition as target remaining resource information according to the resource proportion information corresponding to the resource demand set, further comprises:
and in response to determining that the number of the selected candidate target residual resource information is greater than the preset number, selecting candidate target residual resource information with the largest corresponding central processor residual resource amount from the selected candidate target residual resource information as target residual resource information.
8. The method of claim 6, wherein the updating the respective remaining resource proportion information corresponding to the selected target remaining resource information comprises:
for each of the respective remaining resource proportion information, performing the steps of:
determining a residual resource quantity set corresponding to the residual resource proportion information;
Determining the residual resource quantity of the corresponding graphics processor resource in the determined residual resource quantity set as the graphics processor residual resource quantity;
determining the residual resource quantity of the corresponding central processor resource in the residual resource quantity set as the residual resource quantity of the central processor;
determining the residual resource quantity of the corresponding memory resource in the residual resource quantity set as the memory residual resource quantity;
and updating the residual resource proportion information into the proportion of the residual resource quantity of the central processing unit, the residual resource quantity of the memory and the residual resource quantity of the graphic processor.
9. A container scheduling apparatus comprising:
the first selection unit is configured to select node identifiers, corresponding to the residual resource information, meeting preset residual resource conditions from the node identifier sets according to the resource demand information of the target container to be scheduled, as alternative node identifiers to obtain alternative node identifier sets, wherein the resource demand information comprises a resource demand set;
a second selecting unit configured to select, as target remaining resource information, remaining resource information satisfying a preset similar condition from among respective remaining resource information corresponding to the candidate node identification set according to the resource proportion information corresponding to the resource demand set;
The determining unit is configured to determine an alternative node identifier corresponding to the target residual resource information as a target node identifier, wherein node equipment corresponding to the target node identifier is used for running the target container to be scheduled;
and the scheduling unit is configured to schedule the target container to be scheduled to the node equipment corresponding to the target node identification.
10. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
11. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-8.
CN202211116378.9A 2022-09-14 2022-09-14 Container scheduling method, device, electronic equipment and computer readable medium Pending CN117742875A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211116378.9A CN117742875A (en) 2022-09-14 2022-09-14 Container scheduling method, device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211116378.9A CN117742875A (en) 2022-09-14 2022-09-14 Container scheduling method, device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN117742875A true CN117742875A (en) 2024-03-22

Family

ID=90281805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211116378.9A Pending CN117742875A (en) 2022-09-14 2022-09-14 Container scheduling method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN117742875A (en)

Similar Documents

Publication Publication Date Title
CN110391938B (en) Method and apparatus for deploying services
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN111427701A (en) Workflow engine system and business processing method
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN113760488B (en) Method, apparatus, device and computer readable medium for scheduling tasks
CN110650209A (en) Method and device for realizing load balance
CN115357350A (en) Task configuration method and device, electronic equipment and computer readable medium
CN113419841B (en) Message scheduling method and device, electronic equipment and computer readable medium
CN117609226A (en) Information stream data storage method and device, electronic equipment and readable medium
CN113760498A (en) Message consumption method, device, electronic equipment and computer readable medium
CN112035256A (en) Resource allocation method, device, electronic equipment and medium
CN110941683B (en) Method, device, medium and electronic equipment for acquiring object attribute information in space
CN117742875A (en) Container scheduling method, device, electronic equipment and computer readable medium
CN112527454A (en) Container group scheduling method and device, electronic equipment and computer readable medium
CN113448652A (en) Request processing method and device
CN112099841A (en) Method and system for generating configuration file
CN116319322B (en) Power equipment node communication connection method, device, equipment and computer medium
CN116755889B (en) Data acceleration method, device and equipment applied to server cluster data interaction
CN115309410B (en) Edge cluster application publishing method and device of edge computing scene and electronic equipment
CN112311833B (en) Data updating method and device
CN110750242B (en) File deployment method, system, medium and electronic equipment
CN112799863B (en) Method and device for outputting information
CN116820354B (en) Data storage method, data storage device and data storage system
CN113468053B (en) Application system testing method and device
CN112148448B (en) Resource allocation method, apparatus, device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination