Resource management method and apparatus, computer device, storage medium and product

By receiving the data center identifier of the target node, matching the target cluster, generating a resource management script, and adding the target node to the cluster, the problem of limited capacity and difficult operation and maintenance of a single Kubernetes cluster is solved, and efficient resource management and disaster recovery capabilities are achieved.

WO2026001021A1PCT designated stage Publication Date: 2026-01-02BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/078414
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-28
Filing Date
2025-02-21
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Due to limited capacity and operational difficulties, a single Kubernetes cluster is unable to meet the ever-increasing demands for resource storage and management, and a failure of a single cluster may affect the data center in the same region.

Method used

A resource management method is provided, which receives the data center identifier of the target node, matches the target cluster, generates a resource management script, adds the target node to the target cluster, and manages it using a unified cluster proxy interface, avoiding direct operation of the cluster.

Benefits of technology

Managing resources at the data center level solves the problem of limited capacity in a single cluster, improves scalability and operational efficiency, lowers the barrier to entry and operational complexity, and enhances disaster recovery efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025078414_02012026_PF_FP_ABST
    Figure CN2025078414_02012026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of cloud storage. Disclosed are a resource management method and apparatus, a computer device, a storage medium and a product. The method comprises: receiving a resource management request sent by a target node; on the basis of an identifier of a data center to which the target node belongs and which is carried in the resource management request, performing matching within existing resource clusters, so as to determine a target cluster to which the target node belongs; a server acquiring a target token corresponding to the target cluster; generating a resource onboarding script on the basis of the target token and an identifier of the target cluster; and sending the resource onboarding script to the target node, so that the target node joins the target cluster on the basis of the resource onboarding script.
Need to check novelty before this filing date? Find Prior Art

Description

Resource management method and device, computer device, storage medium and product

[0001] Cross-reference to related applications

[0002] The present application claims priority to the Chinese patent application No. 202410865031.7, filed on June 28, 2024, and entitled "Resource management method and device, computer device, storage medium and product", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0003] The present disclosure relates to the technical field of cloud storage, in particular to a resource management method and device, a computer device, a storage medium and a product. BACKGROUND

[0004] Kubernetes, K8s for short, is an open-source automated operation and maintenance platform that can eliminate the operations involved in deploying and scaling containerized applications, and can help manage clusters. The demand for computing power of enterprises is increasing, and emerging technologies such as edge computing are developing, and multi-cloud and hybrid cloud applications are becoming more and more widespread. Due to factors such as limited capacity and difficult operation and maintenance, a single Kubernetes cluster is increasingly difficult to meet the increasing demand for resource storage and management. SUMMARY

[0005] In a first aspect, the present disclosure provides a resource management method, comprising:

[0006] receiving a resource management request issued by a target node, the resource management request carrying a data center identifier to which the target node belongs; matching in an existing resource cluster based on the data center identifier to determine a target cluster to which the target node belongs; obtaining a target token corresponding to the target cluster, the target token being valid within a preset time; generating a resource takeover script based on the identifier of the target cluster and the target token; and sending the resource takeover script to the target node, so that the target node joins the target cluster based on the resource takeover script.

[0007] In a second aspect, the present disclosure provides a resource management device, comprising:

[0008] The request receiving module is configured to receive a resource management request sent by a target node, and the resource management request carries a data center identifier to which the target node belongs; the cluster determining module is configured to determine a target cluster to which the target node belongs based on the data center identifier and matching in an existing resource cluster; the token obtaining module is configured to obtain a target token corresponding to the target cluster, and the target token is valid within a preset time; the script determining module is configured to generate a resource containment script based on an identifier of the target cluster and the target token; and the node joining module is configured to send the resource containment script to the target node, so that the target node joins the target cluster based on the resource containment script.

[0009] In a third aspect, the present disclosure provides a computer device, comprising a memory and a processor, the memory and the processor are communicatively connected with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the resource management method in the first aspect or any of the corresponding embodiments.

[0010] In a fourth aspect, the present disclosure provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the resource management method in the first aspect or any of the corresponding embodiments.

[0011] In a fifth aspect, the present disclosure provides a computer program product, which comprises computer instructions, and the computer instructions are used to make a computer execute the resource management method in the first aspect or any of the corresponding embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0012] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed in the specific embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present disclosure, and other drawings can also be obtained by those skilled in the art without creative labor.

[0013] FIG. 1 is an architecture schematic diagram of a resource management method according to an embodiment of the present disclosure;

[0014] FIG. 2 is a flow schematic diagram of a resource management method according to an embodiment of the present disclosure;

[0015] FIG. 3 is a scenario schematic diagram of a resource management method according to an embodiment of the present disclosure;

[0016] FIG. 4 is a flow schematic diagram of another resource management method according to an embodiment of the present disclosure;

[0017] FIG. 5 is a scenario schematic diagram of a resource management method according to an embodiment of the present disclosure;

[0018] FIG. 6 is a flow diagram of yet another resource management method according to an embodiment of the present disclosure;

[0019] FIG. 7 is a scenario diagram of yet another resource management method according to an embodiment of the present disclosure;

[0020] FIG. 8 is a structural block diagram of a resource management apparatus according to an embodiment of the present disclosure;

[0021] FIG. 9 is a hardware structural diagram of a computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some but not all of the embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present disclosure.

[0023] The embodiments of the present disclosure will be described in greater detail below with reference to the drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure can be more thoroughly and completely understood. It should be understood that the drawings and embodiments of the present disclosure are merely for exemplary purposes, and are not intended to limit the scope of protection of the present disclosure.

[0024] In the description of the embodiments of the present disclosure, the term “comprising” and similar terms are understood to encompass open-ended inclusion, i.e., “comprising but not limited to”. The term “based on” is understood to mean “based at least in part on”. The term “one embodiment” or “the embodiment” is understood to mean “at least one embodiment”. The term “some embodiments” is understood to mean “at least some embodiments”. Other explicit and implicit definitions can also be included below.

[0025] In this document, unless explicitly stated, performing a step “in response to A” does not mean that the step is performed immediately after A, but can include one or more intermediate steps.

[0026] It can be understood that the data involved in the technical solutions (including but not limited to the data itself, obtaining, using, storing, or deleting of the data) should comply with the requirements of the corresponding laws, regulations, and relevant provisions.

[0027] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type of information involved in the present disclosure, the scope of use, the use scenario, etc. should be informed to the relevant user and the authorization of the relevant user should be obtained through appropriate means according to relevant laws and regulations, wherein the relevant user can include any type of right subject, such as an individual, an enterprise, or a group.

[0028] For example, in response to receiving the active request of the user, the prompt information is sent to the relevant user to explicitly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can voluntarily choose whether to provide the information to the software or hardware such as the electronic device, the application program, the server or the storage medium, etc. performing the operation of the technical solutions of the present disclosure according to the prompt information.

[0029] As an optional but non-limiting implementation manner, in response to receiving the active request of the relevant user, the prompt information can be sent to the relevant user in the form of a pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry selection controls for the user to select "agree" or "disagree" to provide information to the electronic device.

[0030] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0031] Cloud storage is a cloud computing model that can store data and files on the Internet, which can be accessed by users. With the development of cloud storage technology and the increasing demand for computing power of enterprises, edge computing, multi-cloud, hybrid cloud and other related applications are also becoming more and more widespread. Today, more and more enterprises begin to use Kubernetes (abbreviated as K8s) to accelerate the development and deployment process of modern applications. However, the number of nodes that a single Kubernetes cluster can accommodate is limited, and the performance is easily limited. On the other hand, if a large number of nodes are stored in a single K8s cluster, when a certain IDC in the same region fails, other IDCs in the same region in the cluster may also be affected.

[0032] Based on this, the embodiment of the disclosure provides a resource management method. The method can be applied to a centralized server, and the server can be a terminal such as a computer or a tablet computer. The server has a CMDB (Configuration Management Database). A K8s cluster can be deployed in an edge machine room or centrally. Multiple IDCs (Internet Data Center) can share a K8s cluster. The resource management service of the server can manage the K8s cluster. The specific architecture is shown in FIG. 1.

[0033] According to the embodiment of the disclosure, a resource management method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] In this embodiment, a resource management method is provided, which can be used in the server described above. FIG. 2 is a flowchart of the resource management method according to the embodiment of the disclosure. As shown in FIG. 2, the flow includes the following steps:

[0035] In step S101, a resource management request issued by a target node is received.

[0036] The resource management request carries the data center identifier to which the target node belongs.

[0037] The target node can be a physical server or a cloud host. The data center is an IDC. Each node has its corresponding data center. According to the coordinate information of the node, the regional operator data center corresponding to each node can be determined.

[0038] When the target node needs to be managed, the target node sends a resource management request to the server. The resource management request carries the data center identifier to which the target node belongs. That is, the target data center corresponding to the target node can be determined according to the resource management request.

[0039] In step S102, the data center identifier is matched in the existing resource cluster to determine the target cluster to which the target node belongs.

[0040] The resource cluster refers to multiple K8s clusters. Each K8s cluster can have multiple planned data centers. The correspondence between the cluster and the data center is stored in the CMDB of the server.

[0041] The resource management service of the server queries the K8s cluster matched with the data center in the CMDB according to the data center identifier in the resource management request. In the query process, the K8s cluster may have stored the data center, so that the target cluster to which the target node belongs can be directly determined. In addition, the cluster to which the data center belongs may not be queried to have been stored, and the cluster most suitable for storing the current data center can be selected according to the current storage condition of each cluster. The cluster in which the data center can be stored is the target cluster to which the target node belongs. After the target cluster is determined, if the correspondence between the target cluster and the data center to which the target node belongs is not stored in the CMDB, the correspondence is stored.

[0042] In step S103, a target token corresponding to the target cluster is obtained, and the target token is valid within a preset time.

[0043] After the target cluster to which the target node belongs is determined, the target token of the target cluster is obtained through a specified proxy interface. The target token can be set to be valid within a preset time, so as to ensure that the target token is not used by other nodes and the security of data is ensured. In the embodiment, the specified proxy interface refers to a cluster proxy interface, which can be K8s-apiserver.

[0044] In step S104, a resource management script is generated based on the identifier of the target cluster and the target token.

[0045] Each cluster has a corresponding identifier. After the target token of the target cluster is obtained by the server, the target token is rendered through a preset script. The representation of the target cluster, the target token and other information are filled into the corresponding fields in the preset script, so as to generate a resource management script. The resource management script includes node initialization information (node initialization), join cluster information (join cluster) and tagging after the node is successfully accessed, etc. The node initialization can include formatted disk, partitioning, configuring iptables (firewall) rules, configuring network card information and other data.

[0046] In step S105, the resource management script is sent to the target node, so that the target node joins the target cluster based on the resource management script.

[0047] After the resource management script is generated, the server sends the resource management script to the target node. After the target node receives the resource management script, the target node executes the resource management script, so as to join the target cluster.

[0048] The scenario corresponding to the resource management method provided in the embodiments of the present disclosure is shown in FIG. 3. The server receives a resource management request sent by a target node, matches in an existing resource cluster according to a data center identifier carried in the resource management request, and thus determines a target cluster to which the target node belongs. The server obtains a target token corresponding to the target cluster, and generates a resource management script based on the target token and the identifier of the target cluster, and sends the resource management script to the target node, so that the target node joins the target cluster based on the resource management script. This method can be used when managing nodes at the data center level, and the nodes are managed at the data center level, which solves the problem of limited capacity of a single cluster and has strong scalability. In addition, the cluster does not need to be operated, and the number of existing clusters does not need to be perceived, which reduces the use threshold and operation complexity and improves the operation and maintenance efficiency.

[0049] In the embodiments, a resource management method is provided, which can be used in the server described above. FIG. 4 is a flowchart of the resource management method according to the embodiments of the present disclosure. As shown in FIG. 4, the flow includes the following steps:

[0050] In step S201, a resource management request sent by a target node is received.

[0051] For details, refer to step S101 of the embodiment shown in FIG. 2, which will not be repeated here.

[0052] In step S202, a target cluster to which the target node belongs is determined by matching in an existing resource cluster based on a data center identifier.

[0053] Specifically, step S202 includes the following steps.

[0054] In step S2021, it is determined whether there is a corresponding first resource cluster in the existing resource cluster for the data center identifier.

[0055] The existing resource cluster can be one or more K8s clusters, and each cluster can store multiple data centers, and a data center can store one or more nodes. The correspondence between K8s and data centers is stored in the CMDB of the server. It is determined whether there is a first resource cluster corresponding to the data center in the existing resource cluster according to the data center identifier, that is, a first resource cluster storing the data center.

[0056] In step S2022, if there is a corresponding first resource cluster, the target cluster to which the target node belongs is determined as the first resource cluster.

[0057] When it is found that there is a first resource cluster corresponding to the data center, the first resource cluster can be determined as the target cluster in which the target node can be stored.

[0058] In some optional embodiments, step S2021 includes:

[0059] Step a1, based on the data center identifier, query in the resource cluster database to determine whether the data center identifier has a corresponding first resource cluster in the existing resource cluster.

[0060] The resource cluster database is used to represent the identifier of the data center included in the existing resource cluster.

[0061] The resource cluster database is a CMDB stored in the server, and the resource cluster database stores the identifier of the data center and the data center stored in the existing resource cluster. The resource management service of the server queries in the resource cluster database based on the data center identifier after receiving the resource management request, so as to determine whether the corresponding relationship between the data center and the cluster has been stored.

[0062] The above step S202 further includes:

[0063] Step S2023, if there is no corresponding first resource cluster, acquiring the remaining capacity of the existing resource cluster.

[0064] The resource management database of the server also stores the capacity upper limit and the number of nodes already stored of each cluster. According to the capacity upper limit and the number of nodes already stored, the remaining capacity of each cluster can be calculated, and the remaining capacity represents the number of nodes that can be currently stored.

[0065] When no first resource cluster corresponding to the data center is queried, the remaining capacity of each cluster determined in the resource management database is calculated.

[0066] Step S2024, based on the remaining capacity of the existing resource cluster, determining the target cluster to which the target node belongs.

[0067] According to the remaining capacity, each resource cluster is scored, and the remaining capacity is positively correlated with the score, that is, the higher the remaining capacity, the higher the score. The cluster with the highest score is determined as the target cluster. Among them, it can be set that only the cluster with a remaining capacity greater than a certain capacity threshold is scored, and if only one cluster has a remaining capacity greater than the capacity threshold, the cluster is directly taken as the target cluster.

[0068] In some optional embodiments, the above step S2024 includes:

[0069] Step b1, based on the data center identifier, determining the target area to which the target node belongs.

[0070] The identifier of the data center can be used to represent the corresponding data center, and the data center identifier carries the area information of the data center, which can include the coordinates of the data center, the province and city to which it belongs, etc., so as to determine the target area to which the target node belongs.

[0071] Step b2, determining the number of data centers belonging to the target region in the existing resource cluster, the existing resource cluster including at least one data center.

[0072] The number of data centers belonging to the target region in each existing resource cluster is counted, and there can be data centers belonging to the target region in each cluster, that is, data centers in the same region can be stored in different clusters.

[0073] Step b3, determining the target cluster to which the target node belongs based on the remaining capacity of the existing resource cluster and the number of data centers belonging to the target region.

[0074] The remaining capacity of each cluster and the number of data centers belonging to the target region stored in each cluster are integrated to score each cluster, and the most matched target cluster is further determined.

[0075] Further, step b3 includes:

[0076] Step b31, determining a first score value of the existing resource cluster as the target cluster based on the remaining capacity of the existing resource cluster, the first score value being positively correlated with the remaining capacity.

[0077] Each cluster is scored based on the remaining capacity of each cluster, and the score obtained is the first score value. The higher the remaining capacity, the higher the first score value.

[0078] Step b32, determining a second score value of the existing resource cluster as the target cluster based on the number of data centers belonging to the target region, the second score value being negatively correlated with the number of data centers belonging to the target region.

[0079] The number of data centers belonging to the target region in each existing resource cluster is counted, and there can be data centers belonging to the target region in each cluster, that is, data centers in the same region can be stored in different clusters. In the same cluster, the more data centers in the same region, the more likely it is that when any data center fails, other data centers in the same region will also fail. Based on this, in this embodiment, the number of data centers belonging to the target region in the cluster is scored, and the higher the number, the lower the second score value. Taking the region as a consideration factor, it is avoided that too many data centers in the same region are in the same cluster, and the disaster recovery efficiency is improved.

[0080] Step b33, determining a target score value of the existing resource cluster as the target cluster based on the fusion result of the first score value and the second score value.

[0081] The first score value and the second score value are integrated by comprehensively considering the first score value and the second score value, and the target score value of each cluster can be determined by calculating according to a pre-designed calculation formula.

[0082] Step b34, determining the target cluster to which the target node belongs based on the size of the target score corresponding to each existing resource cluster.

[0083] According to the sorting of the target scores of each cluster, the target cluster to which the target node belongs can be determined as the target cluster that the target node is most suitable for storing.

[0084] Step S203, obtaining a target token corresponding to the target cluster, the target token being valid within a preset time.

[0085] Specifically, the above step S203 includes:

[0086] Step S2031, sending a token request to a cluster agent interface.

[0087] The token request carries the identification of the target cluster, and the cluster agent interface corresponds to the existing resource cluster.

[0088] The cluster agent interface is a proxy interface that can serve as a unified interface for all clusters and can be used for resource acquisition, verification, etc. of each cluster, supporting cross-cluster operations. The cluster agent interface corresponds to all existing resource clusters. The token request carries the identification of the target cluster, so that the cluster agent interface determines the target cluster through the identification of the target cluster. After determining the target cluster, the token request is sent to the cluster agent interface.

[0089] The server also deploys a cluster management interface and a query management script interface, wherein the query management script interface is used to obtain a resource management script to enable the target node to join the matched cluster; and the cluster management interface is used to perform change operations on the cluster according to actual needs, and the specific change operations can include adding a cluster, updating a cluster, deleting a cluster, etc.

[0090] Step S2032, receiving the target token fed back by the cluster agent interface based on the identification of the target cluster.

[0091] The cluster agent interface determines the target cluster through the identification of the target cluster, and then determines to generate a target token corresponding to the target cluster, and sends the target token to the resource management service of the server. The target token can be set to be valid within a preset time.

[0092] Step S204, generating a resource management script based on the identification of the target cluster and the target token.

[0093] Specifically, the above step S204 includes:

[0094] Step S2041, rendering a resource management template based on the identification of the target cluster and the target token to generate a resource management script.

[0095] The resource management service of the server stores a resource management template, renders the resource management script according to the received identification of the target cluster and the target token, fills in preset fields in the resource management script, and generates the resource management script after rendering. The resource management script can include node initialization information (node initialization), join cluster information (join cluster), and tagging of the node after successful access, etc. The node initialization can include formatted disk, partitioning, iptables rule configuration, network card information configuration, etc.

[0096] In step S205, the resource management script is sent to the target node, so that the target node joins the target cluster based on the resource management script.

[0097] For details, please refer to step S105 of the embodiment shown in FIG. 2, which will not be repeated here.

[0098] In some optional embodiments, the resource management method further includes identifying the target node, and the identification content includes the data center identification.

[0099] After the target node joins the target cluster by executing the resource management script, the target node is identified, i.e., the target node is tagged, and the identification content includes the data center identification.

[0100] Since there can be many nodes in the cluster, different nodes come from different data centers, and identifying the nodes facilitates understanding which nodes are in each data center and facilitates screening.

[0101] The resource management method provided by the embodiments of the present disclosure queries whether there is a target cluster to which the target node belongs, and if not, plans the target node by scoring. In the planning process, the remaining capacity of the cluster, the data centers in the same region in the cluster, etc. are considered as factors to avoid too many data centers in the same region in the same cluster, improve the disaster recovery rate, and solve the problem of limited capacity of a single cluster. When managing the nodes, the management is performed at the data center level, one cluster can manage multiple data center resources, and has high scalability. A unified cluster proxy interface is abstracted, and when managing the nodes, there is no need to care about the specific cluster, which reduces the use threshold and operation complexity and improves the operation and maintenance efficiency.

[0102] A resource management method is provided in the embodiment, as shown in FIG. 5. The resource management service is on the service side together with the CMDB, and the K8s-apiserver is the cluster proxy interface. When a node needs to be managed, the node requests a management script from the resource management service on the service side, initiates a resource management request, the resource management service queries the CMDB according to the data center related information of the node in the resource management request, determines the corresponding K8s cluster, obtains a target token from the cluster proxy interface, assembles a management script based on the obtained target token, and sends the obtained management script to the node. The node joins the target K8s cluster by executing the management script.

[0103] A resource management method is provided in the embodiment, which can be used in the service side as described above. FIG. 6 is a flowchart of the resource management method according to the embodiment of the present disclosure. As shown in FIG. 6, the flow includes the following steps:

[0104] In step S301, a first deployment request of a workload is obtained.

[0105] The first deployment request carries an identifier of a target data center.

[0106] When a workload needs to be deployed, a user initiates a first deployment request, specifies a data center to be deployed in the first deployment request, and deploys the workload by calling a resource management service SDK (Software Development Kit).

[0107] In step S302, a second resource cluster to which a target data center belongs is determined based on the identifier of the target data center.

[0108] The resource management service of the service side queries a second resource cluster planned for the data center in the CMDB according to the data center identifier in the resource management request. In the query process, the data center is queried according to the area information of the data center.

[0109] In step S303, the workload is deployed into the target data center of the second resource cluster.

[0110] After the resource management service queries the second resource cluster from the CMDB, the workload is deployed into the target data center in the corresponding second resource cluster.

[0111] In some optional embodiments, step S303 includes: sending, to a cluster agent interface, a second deployment request of the workload, so as to deploy the workload to a target data center of the second resource cluster based on the cluster agent interface, wherein the second deployment request carries an identifier of the second resource cluster and an identifier of the target data center.

[0112] After the resource management service queries the second resource cluster from the CMDB, the resource management service sends a second deployment request through the cluster agent interface, the second deployment request carrying an identifier of the second resource cluster and an identifier of the target data center, and the second deployment request is used to deploy the workload to the target data center.

[0113] The resource management method provided in the embodiments of the present disclosure has a unified cluster agent interface, can directly deploy to a specific data center, solves the problem of upper limit of capacity of a single cluster, does not need to operate the cluster, reduces the use threshold and operation complexity, improves the operation and maintenance efficiency, and shields the underlying complexity.

[0114] In the embodiments, a resource management apparatus is also provided, which is used to implement the above-described embodiments and embodiments, and details are not repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation of hardware, or a combination of software and hardware, is also possible and contemplated.

[0115] The resource management apparatus provided in the embodiments includes the following modules, as shown in FIG. 8:

[0116] The request receiving module 401 is configured to receive a resource management request sent by a target node, the resource management request carrying an identifier of a data center to which the target node belongs;

[0117] The cluster determining module 402 is configured to match in an existing resource cluster based on the identifier of the data center, and determine a target cluster to which the target node belongs;

[0118] The token obtaining module 403 is configured to obtain a target token corresponding to the target cluster, the target token being valid within a preset time;

[0119] The script determining module 404 is configured to generate a resource containment script based on the identifier of the target cluster and the target token;

[0120] The node joining module 405 is configured to send the resource containment script to the target node, so that the target node joins the target cluster based on the resource containment script.

[0121] In some optional embodiments, the cluster determination module 402 comprises:

[0122] a first resource cluster determination unit configured to determine whether there is a corresponding first resource cluster of the data center identifier in the existing resource clusters;

[0123] a first target cluster determination unit configured to determine, if there is the corresponding first resource cluster, that a target cluster to which the target node belongs is the first resource cluster.

[0124] In some optional embodiments, the first target cluster determination unit comprises:

[0125] a first target cluster determination subunit configured to query, based on the data center identifier, a resource cluster database to determine whether there is a corresponding first resource cluster of the data center identifier in the existing resource clusters, the resource cluster database being configured to represent identifiers of data centers included in the existing resource clusters.

[0126] In some optional embodiments, the cluster determination module 402 further comprises:

[0127] a remaining capacity acquisition unit configured to acquire, if there is no corresponding first resource cluster, a remaining capacity of the existing resource clusters;

[0128] a second target cluster determination unit configured to determine, based on the remaining capacity of the existing resource clusters, a target cluster to which the target node belongs.

[0129] In some optional embodiments, the second target cluster determination unit comprises:

[0130] a target area determination subunit configured to determine, based on the data center identifier, a target area to which the target node belongs;

[0131] a data center number determination subunit configured to determine, in the existing resource clusters including at least one data center, a number of data centers belonging to the target area;

[0132] a target cluster determination subunit configured to determine, based on the remaining capacity of the existing resource clusters and the number of data centers belonging to the target area, a target cluster to which the target node belongs.

[0133] In some optional embodiments, the target cluster determination subunit comprises:

[0134] a first score value determination subunit configured to determine, based on the remaining capacity of the existing resource clusters, a first score value of the existing resource clusters as the target cluster, the first score value being positively correlated with the remaining capacity;

[0135] a second score value determination sub-unit, configured to determine a second score value of the existing resource cluster for the target cluster based on a quantity of data centers belonging to the target region, the second score value being negatively correlated with the quantity of data centers belonging to the target region;

[0136] a target score value determination sub-unit, configured to determine a target score value of the existing resource cluster for the target cluster based on a fusion result of the first score value and the second score value.

[0137] a cluster determination sub-unit, configured to determine a target cluster to which the target node belongs based on the size of the target score value corresponding to each of the existing resource clusters.

[0138] In some optional embodiments, the script determination module 404 includes:

[0139] a template rendering unit, configured to render a resource containment template based on the identification of the target cluster and the target token, to generate the resource containment script.

[0140] In some optional embodiments, the token acquisition module 403 includes:

[0141] a token request sending unit, configured to send a token request to a cluster agent interface, the token request carrying the identification of the target cluster, the cluster agent interface corresponding to the existing resource cluster;

[0142] a token receiving unit, configured to receive the target token fed back by the cluster agent interface based on the identification of the target cluster.

[0143] In some optional embodiments, the apparatus further includes:

[0144] a node identification module, configured to identify the target node, the identification including the identification of the data center.

[0145] In some optional embodiments, the apparatus further includes:

[0146] a first deployment acquisition module, configured to acquire a first deployment request of a workload, the first deployment request carrying the identification of a target data center;

[0147] a second resource cluster determination module, configured to determine a second resource cluster to which the target data center belongs based on the identification of the target data center;

[0148] a workload deployment module, configured to deploy the workload to a target data center of the second resource cluster.

[0149] In some alternative embodiments, the second resource cluster determination module comprises:

[0150] The second resource cluster determination unit is configured to send a second deployment request of a workload to a cluster agent interface, so as to deploy the workload to a target data center of the second resource cluster based on the cluster agent interface, and the second deployment request carries an identifier of the second resource cluster and an identifier of the target data center.

[0151] Further function descriptions of the above-mentioned modules and units are the same as those of the corresponding embodiments, and will not be described here.

[0152] The resource management apparatus in the embodiments is presented in the form of functional units. The units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories executing one or more software or fixed programs, and / or other devices that can provide the above functions.

[0153] The embodiments of the present disclosure further provide a computer device with the resource management apparatus shown in FIG. 8.

[0154] Please refer to FIG. 9, which is a structural schematic diagram of a computer device according to an alternative embodiment of the present disclosure. As shown in FIG. 9, the computer device comprises one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively connected with different buses, and can be installed on a common mainboard or in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in the memory or the memory to display graphical information on a GUI of an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memories, if necessary. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). In FIG. 9, one processor 10 is taken as an example.

[0155] The processor 10 can be a central processor, a network processor, or a combination thereof. The processor 10 can further include a hardware chip. The hardware chip can be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic gate array, a generic array logic, or any combination thereof.

[0156] The memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods illustrated by the above embodiments.

[0157] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function, and the like. The data storage area can store data created according to the use of the computer device, and the like. In addition, the memory 20 can include a high-speed random access memory, and can further include a non-transitory memory such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some alternative embodiments, the memory 20 can optionally include a memory disposed remotely from the processor 10, which can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0158] The memory 20 can include a volatile memory such as a random access memory, and can further include a non-volatile memory such as a flash memory, a hard disk, or a solid state disk, and a combination of the above-mentioned kinds of memories.

[0159] The computer device further includes a communication interface 30 for communication of the computer device with other devices or communication networks.

[0160] The embodiments of the present disclosure further provide a computer readable storage medium, and the above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network downloading of computer code, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, and the like. Further, the storage medium can further include a combination of the above-mentioned kinds of memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method illustrated by the above embodiments is implemented.

[0161] Part of the present disclosure can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present disclosure can be invoked or provided. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file and the like, and accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.

[0162] Although the embodiments of the present disclosure are described in conjunction with the drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present disclosure, and such modifications and changes fall within the scope defined by the appended claims.

Claims

1. A resource management method, comprising: Receive a resource management request sent by the target node, wherein the resource management request carries the data center identifier to which the target node belongs; Based on the data center identifier, a matching process is performed in the existing resource clusters to determine the target cluster to which the target node belongs; Obtain the target token corresponding to the target cluster, which is valid for a preset time. Generate a resource management script based on the identifier of the target cluster and the target token; The resource management script is sent to the target node so that the target node can join the target cluster based on the resource management script.

2. The method according to claim 1, wherein, The step of matching the target node to its target cluster within existing resource clusters based on the data center identifier includes: Determine whether the data center identifier has a corresponding first resource cluster in the existing resource cluster; If there is a corresponding first resource cluster, then the target cluster to which the target node belongs is determined to be the first resource cluster.

3. The method according to claim 2, wherein, Determining whether the data center identifier has a corresponding first resource cluster in the existing resource clusters includes: Based on the data center identifier, a query is performed in the resource cluster database to determine whether the data center identifier has a corresponding first resource cluster in the existing resource cluster. The resource cluster database is used to characterize the identifiers of the data centers included in the existing resource cluster.

4. The method according to claim 2, wherein, The step of matching the target node to its target cluster within existing resource clusters based on the data center identifier further includes: If there is no corresponding first resource cluster, obtain the remaining capacity of the existing resource cluster; Based on the remaining capacity of the existing resource cluster, the target cluster to which the target node belongs is determined.

5. The method according to claim 4, wherein, Determining the target cluster to which the target node belongs based on the remaining capacity of the existing resource cluster includes: Based on the data center identifier, the target region to which the target node belongs is determined; Determine the number of data centers belonging to the target region within the existing resource cluster, wherein the existing resource cluster includes at least one data center; Based on the remaining capacity of the existing resource cluster and the number of data centers belonging to the target region, the target cluster to which the target node belongs is determined.

6. The method according to claim 5, wherein, The step of determining the target cluster to which the target node belongs based on the remaining capacity of the existing resource cluster and the number of data centers belonging to the target region includes: Based on the remaining capacity of the existing resource cluster, the existing resource cluster is determined as the first score value of the target cluster, and the first score value is positively correlated with the remaining capacity; Based on the number of data centers belonging to the target region, the existing resource cluster is determined as the second score value of the target cluster, and the second score value is negatively correlated with the number of data centers belonging to the target region; Based on the fusion result of the first score and the second score, the existing resource cluster is determined as the target score of the target cluster; Based on the target score corresponding to each of the existing resource clusters, the target cluster to which the target node belongs is determined.

7. The method according to claim 1, wherein, The process of generating a resource management script based on the identifier of the target cluster and the target token includes: Based on the identifier of the target cluster and the target token, the resource management template is rendered to generate the resource management script.

8. The method according to claim 1, wherein, Obtaining the target token corresponding to the target cluster includes: Send a token request to the cluster proxy interface, the token request carrying the identifier of the target cluster, the cluster proxy interface corresponding to the existing resource cluster; Receive the target token fed back by the cluster proxy interface based on the identifier of the target cluster.

9. The method according to claim 1, further comprising: The target node is identified, and the identification includes the data center identifier.

10. The method according to any one of claims 1 to 9, further comprising: Obtain the first deployment request for the workload, which carries the identifier of the target data center; The second resource cluster to which the target data center belongs is determined based on the identifier of the target data center; The workload is deployed to the target data center of the second resource cluster.

11. The method according to claim 10, wherein, Deploying the workload to the target data center of the second resource cluster includes: A second deployment request for the workload is sent to the cluster proxy interface to deploy the workload to the target data center of the second resource cluster based on the cluster proxy interface. The second deployment request carries the identifier of the second resource cluster and the identifier of the target data center.

12. A resource management device, comprising: The request receiving module is used to receive resource management requests sent by the target node, wherein the resource management request carries the data center identifier to which the target node belongs; The cluster determination module is used to match the target node to the target cluster in the existing resource clusters based on the data center identifier. The token acquisition module is used to acquire the target token corresponding to the target cluster, and the target token is valid for a preset time. The script determination module is used to generate a resource management script based on the identifier of the target cluster and the target token; The node joining module is used to send the resource management script to the target node so that the target node can join the target cluster based on the resource management script.

13. A computer device, comprising: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the resource management method according to any one of claims 1 to 11 by executing the computer instructions.

14. A computer-readable storage medium storing computer instructions for causing a computer to perform the resource management method according to any one of claims 1 to 11.

15. A computer program product comprising computer instructions for causing a computer to perform the resource management method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Multi-cluster nano-management method and platform, equipment and storage medium

    CN117155933A

  • Multi-cluster nano-management method and platform, equipment and storage medium

    CN117955980A

  • Resource management method and device, computer equipment, storage medium and product

    CN118413573A

  • Validation of payload for deployment to a target environment

    US20220276848A1