Cluster resource management method and device, computer equipment, readable storage medium and program product

By saving and updating the dependency graph of the cluster in the graph database, the problem that traditional resource management methods cannot adapt to dynamic needs is solved, and efficient resource management and utilization improvement is achieved.

CN119474422APending Publication Date: 2025-02-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411732372.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The traditional cluster network resource management method is difficult to adapt to the dynamic changes in resource requirements, resulting in static resource allocation and flexibly adjusting, which affects resource utilization.

Method used

The dependency diagram of the cluster is saved through the graph database. When a request for new or delete of the cluster is received, the dependency diagram is updated and resource management is performed based on the updated dependency diagram.

Benefits of technology

The accuracy and timeliness of resource dependencies are achieved, the efficiency of cluster resource management is improved, and the resource utilization rate is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474422A_ABST
    Figure CN119474422A_ABST
Patent Text Reader

Abstract

The invention relates to a cluster resource management method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a cluster creation request, and searching a dependency graph corresponding to the cluster creation request in a graph database; creating a new cluster node corresponding to the new cluster creation request in the dependency graph; updating the dependency relationship graph based on the dependency relationship of the new cluster nodes; and under the condition that a cluster resource management request is received, performing resource management processing based on the updated dependency graph. According to the method, the dependency graph of the cluster is stored through the graph database, resource management processing is carried out based on the updated dependency graph, the accuracy and timeliness of the resource dependency are ensured by updating the resource dependency graph in real time, then the efficiency of cluster resource management through the resource dependency graph is ensured, and the utilization rate of cluster resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a cluster resource management method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the development of cloud computing and big data technologies, applications developed based on cloud computing and big data are also constantly changing and expanding, which makes the network resource dependencies in clusters related to big data applications also constantly evolving, and the management of cluster network resources is facing increasingly severe challenges.

[0003] In traditional technology, cluster network resources are generally managed through static resource management. However, this management method is difficult to adapt to dynamic changes in resource demand. In addition, resource allocation under this management method is usually static and cannot be flexibly adjusted according to real-time demand, thus affecting resource utilization. Summary of the invention

[0004] Based on this, it is necessary to provide a cluster resource management method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve resource utilization in response to the above technical problems.

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

[0006] Obtain a cluster creation request, and search the graph database for a dependency graph corresponding to the cluster creation request;

[0007] Creating a new cluster node corresponding to the cluster creation request in the dependency graph;

[0008] Update the dependency graph based on the dependency of the newly created cluster nodes;

[0009] When a cluster resource management request is received, resource management processing is performed based on the updated dependency graph.

[0010] In one embodiment, updating the dependency graph based on the dependency of the newly created cluster node includes:

[0011] Obtain a gateway node corresponding to the newly created cluster node, and bind the newly created cluster node and the gateway node in the dependency graph;

[0012] Obtain an elastic address node corresponding to the gateway node, and bind the gateway node and the elastic address node in the dependency graph;

[0013] The elastic address node and the newly created cluster node are bound, and based on the binding relationship between the nodes, the dependency graph is updated.

[0014] In one embodiment, after binding the address node and the newly created cluster node and updating the dependency graph based on the binding relationship between the nodes, the process further includes:

[0015] Get the target elastic address node that does not have a binding relationship;

[0016] The target elastic address node and the newly created cluster node are bound, and based on the binding relationship between the nodes, the dependency graph is updated again.

[0017] In one embodiment, the method further comprises:

[0018] When receiving a cluster deletion request, searching for a deletion target node of the cluster deletion request in the updated dependency graph;

[0019] The binding relationship between the deletion target node and the deletion target node is deleted in the dependency graph.

[0020] In one of the embodiments, the cluster resource management request includes a dependency lookup request;

[0021] When a cluster resource management request is received, performing resource management processing based on the updated dependency graph includes:

[0022] In case of receiving a dependency search request, searching for a target cluster node of the dependency search request in the updated dependency graph;

[0023] Obtaining dependency relationships between various nodes in the dependency graph and the target cluster node, and generating a search result for the dependency search request;

[0024] The search result is fed back.

[0025] In one of the embodiments, the cluster resource management request includes a resource reclaim request;

[0026] When a cluster resource management request is received, performing resource management processing based on the updated dependency graph includes:

[0027] In case of receiving a resource recycling request, searching the updated dependency graph for the gateway node and the elastic address node that are not bound to the cluster node;

[0028] Based on the node information of the gateway node and the elastic address node that are not bound to the cluster node, resource node deletion processing is performed.

[0029] In a second aspect, the present application further provides a cluster resource management device, including:

[0030] A relationship graph search module is used to obtain a cluster creation request and search the dependency graph corresponding to the cluster creation request in the graph database;

[0031] A cluster node creation module, used to create a new cluster node corresponding to the cluster creation request in the dependency graph;

[0032] A relationship graph updating module, used to update the dependency graph based on the dependency relationship of the newly created cluster node;

[0033] The resource management module is used to perform resource management processing based on the updated dependency graph when a cluster resource management request is received.

[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0035] Obtain a cluster creation request, and search the graph database for a dependency graph corresponding to the cluster creation request;

[0036] Creating a new cluster node corresponding to the cluster creation request in the dependency graph;

[0037] Update the dependency graph based on the dependency of the newly created cluster nodes;

[0038] When a cluster resource management request is received, resource management processing is performed based on the updated dependency graph.

[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0040] Obtain a cluster creation request, and search the graph database for a dependency graph corresponding to the cluster creation request;

[0041] Creating a new cluster node corresponding to the cluster creation request in the dependency graph;

[0042] Update the dependency graph based on the dependency of the newly created cluster nodes;

[0043] When a cluster resource management request is received, resource management processing is performed based on the updated dependency graph.

[0044] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0045] Obtain a cluster creation request, and search the graph database for a dependency graph corresponding to the cluster creation request;

[0046] Creating a new cluster node corresponding to the cluster creation request in the dependency graph;

[0047] Update the dependency graph based on the dependency of the newly created cluster nodes;

[0048] When a cluster resource management request is received, resource management processing is performed based on the updated dependency graph.

[0049] The above-mentioned cluster resource management method, apparatus, computer equipment, computer-readable storage medium and computer program product obtain a cluster creation request, search the dependency graph corresponding to the cluster creation request in the graph database; create a new cluster node corresponding to the cluster creation request in the dependency graph; update the dependency graph based on the dependency of the new cluster node; and when receiving a cluster resource management request, perform resource management processing based on the updated dependency graph. The present application saves the dependency graph of the cluster by saving it in a graph database, and when a cluster is newly created and the cluster dependencies need to be updated, the dependency graph can also be directly retrieved from the graph database and updated in real time, and then resource management processing is performed based on the updated dependency graph, and the resource dependency graph is updated in real time to ensure the accuracy and timeliness of the resource dependency, thereby ensuring the efficiency of cluster resource management through the resource dependency graph and improving cluster resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0051] FIG1 is an application environment diagram of a cluster resource management method in one embodiment;

[0052] FIG2 is a schematic diagram of a flow chart of a cluster resource management method in one embodiment;

[0053] FIG3 is a schematic diagram of a resource dependency diagram after a new cluster node is created in one embodiment;

[0054] FIG4 is a schematic diagram of a resource dependency graph after deleting a cluster node in one embodiment;

[0055] FIG5 is a schematic diagram of a resource dependency graph after rebinding cluster nodes in one embodiment;

[0056] FIG6 is a schematic diagram of a resource dependency graph after deleting a cluster node in one embodiment;

[0057] FIG7 is a schematic diagram of resource recovery processing for a network resource node in one embodiment;

[0058] FIG8 is a block diagram of a cluster resource management system in one embodiment;

[0059] FIG9 is a structural block diagram of a cluster resource management device in one embodiment;

[0060] FIG. 10 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0062] The cluster resource management method provided in the embodiment of the present application can be applied to the application environment shown in FIG. 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. When the terminal 102 needs to create a new cluster in the system, it is necessary to update the cluster newly added to the system into the dependency graph, so as to realize the management of cluster resources through the dependency graph. At this time, a cluster creation request can be sent to the server 104 through the terminal 102 to update the dependency graph. The server 104 obtains the cluster creation request, searches the dependency graph corresponding to the cluster creation request in the graph database; creates a new cluster node corresponding to the cluster creation request in the dependency graph; and updates the dependency graph based on the dependency of the new cluster node. When the user needs to manage cluster resources, such as querying resources, a cluster resource management request can be sent to the server 104, and the server 104 performs resource management processing based on the updated dependency graph when receiving the cluster resource management request. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.

[0063] In an exemplary embodiment, as shown in FIG2 , a cluster resource management method is provided, which is described by taking the method applied to the server 104 in FIG1 as an example, and includes the following steps 201 to 207. Among them:

[0064] Step 201, obtain a cluster creation request, and search the graph database for a dependency graph corresponding to the cluster creation request.

[0065] Among them, the cluster creation request is used to create a new cluster in the cluster system and update the cluster to the dependency graph of the cluster system. The graph database is a data management system that uses points and edges as basic storage units and is designed with efficient storage and query of graph data. It uses a graph structure to represent data, in which entities are represented as nodes and the relationship between entities is represented as edges. The present application uses a graph database to save the dependency graph of the cluster system and uses the dependency graph to manage the cluster system. In a specific embodiment, the graph database of the present application can be implemented by a Neo4j database, which is a high-performance NOSQL graph database that stores structured data on the network instead of in a table. It is an embedded, disk-based Java persistence engine with full transactional features, but it stores structured data on the network (called a graph from a mathematical perspective) instead of in a table. A dependency graph is a graph that shows the dependencies between elements. The dependency graph is used to intuitively display the dependencies between elements (such as modules, classes, functions, etc.) in the system, that is, changes in one element may affect another element. In this application, a dependency graph is used to represent the dependency relationship among clusters, gateways, and IP addresses in a cluster system.

[0066] Exemplarily, the present application implements the management of cluster resources through a dependency graph, and in order to effectively save the dependency graph, the various nodes corresponding to the cluster system and the dependencies between the nodes can be pre-identified to construct a dependency graph corresponding to the cluster system. Afterwards, the dependency graph is saved in the graph database, and the resource dependency graph is constructed by scanning the network resources in the cluster system, and then the dependencies between the resources are analyzed. When it is necessary to create a new cluster in the cluster system, the newly created cluster system can be synchronized to the dependency graph through a cluster creation request. Therefore, when a cluster is newly created, it is necessary to search the graph database for the cluster system pointed to by the cluster creation request and obtain the corresponding dependency graph.

[0067] Step 203: Create a new cluster node corresponding to the cluster creation request in the dependency graph.

[0068] Step 205: Update the dependency graph based on the dependency of the newly created cluster nodes.

[0069] Exemplarily, after finding the dependency graph, it is necessary to update the relevant information of the newly created cluster to the dependency graph, and perform the relevant settings of the newly created cluster through the updated dependency graph, so as to ensure the synchronization of the dependency graph and the cluster system. At this time, you can first directly create a new cluster node corresponding to the cluster creation request in the dependency graph, and because the newly created cluster node cannot exist alone, it is also necessary to update the dependency graph based on the dependency of the newly created cluster node. For a cluster system, the dependency of the cluster node can specifically include the address node of the gateway node and the elastic IP address. By searching the original node in the system, or building a new node, and then establishing the dependency between the newly created cluster node and the gateway node, and the newly created cluster node and the address node, the dependency graph is updated to ensure the validity of the dependency graph.

[0070] Step 207: When a cluster resource management request is received, resource management processing is performed based on the updated dependency graph.

[0071] Exemplarily, after the update of the dependency graph is completed, the cluster resources can be managed based on the dependency graph. When the user wants to manage the cluster resources, the corresponding cluster resource management request can be submitted to the server 104 through the terminal 102, and the server 104 can start the corresponding management process after receiving the corresponding cluster resource management request. The processing process can first find the dependency graph pointed to by the request, and then identify the type of the request, and process it according to the type of the request and the found dependency graph. The cluster resource management request can include a query class request, at which time the relevant dependency of the cluster node requested by the user can be found based on the dependency graph, and the corresponding query result can be fed back to it. In another embodiment, the cluster resource management request can also be periodically triggered, such as a request for the recovery of cluster resources in the system, which can be triggered according to a period, such as setting an interval of 1 hour. After the cluster resource management request for cluster resource recovery is triggered, the server 104 can determine isolated resource nodes in the cluster system that do not have dependencies based on the real-time dependency graph, and recover these nodes, thereby improving resource utilization.

[0072] The above-mentioned cluster resource management method obtains a cluster creation request, searches the graph database for the dependency graph corresponding to the cluster creation request; creates a new cluster node corresponding to the cluster creation request in the dependency graph; updates the dependency graph based on the dependency of the new cluster node; and upon receiving a cluster resource management request, performs resource management processing based on the updated dependency graph. The present application saves the dependency graph of the cluster by saving it in a graph database. When a cluster is newly created and the cluster dependencies need to be updated, the dependency graph can also be directly retrieved from the graph database and updated in real time. Then, resource management processing is performed based on the updated dependency graph. The resource dependency graph is updated in real time to ensure the accuracy and timeliness of the resource dependencies, thereby ensuring the efficiency of cluster resource management through the resource dependency graph and improving cluster resource utilization.

[0073] In an exemplary embodiment, step 205 includes: obtaining the gateway node corresponding to the newly created cluster node, and binding the newly created cluster node and the gateway node in the dependency graph; obtaining the elastic address node corresponding to the gateway node, and binding the gateway node and the elastic address node in the dependency graph; binding the elastic address node and the newly created cluster node, and updating the dependency graph based on the binding relationship between the nodes.

[0074] Among them, the gateway node is the NAT gateway node, which mainly realizes the function of address translation. As a key node of network traffic, the performance of NAT gateway directly affects the transmission efficiency of the entire network. Elastic address node (Elastic IP, EIP) is an elastic IP node. Elastic IP is a static IP address based on the cloud external network (hereinafter referred to as the external network, which can be the external Internet or the internal LAN of the enterprise). It is an IP address that can be directly accessed through the external network and is mapped to the bound instance through NAT.

[0075] Exemplarily, taking NAT gateway nodes and elastic IP nodes as network resources, in a cluster, a cluster needs to be bound to a NAT gateway, an EIP, and an elastic EIP bound to a NAT gateway. Multiple clusters can share NAT gateways and gateway-bound EIPs. Therefore, when creating a new cluster node on a dependency graph, after creating a new cluster node, it is necessary to find or establish a gateway node and an elastic address node, and establish a binding dependency relationship between nodes. In a specific embodiment, a new cluster node Cluster can be created by using the MERGE command, and then a query statement can be run to find out whether there is a gateway node NAT. If there is a NAT node, a gateway node corresponding to the new cluster node is obtained. If not, a new NAT node is directly created, and then the gateway node and the elastic address node are bound in the dependency graph. The binding relationship here is recorded as [:CN] (Cluster&NAT), and then the query statement is run to check whether there is an elastic address node EIP bound to the gateway node NAT. If there is a bound EIP node, if there is no bound node, a new EIP node is created and bound to the NAT node. The binding relationship here is [:NE] (NAT &EIP). After that, the elastic address node Eip bound to the Nat gateway is bound to the newly created cluster node Cluster through the relationship [:CE] (Cluster&EIP), so that the newly created cluster node is bound to each network resource node of the system. After the dependency graph is updated, the cluster system can be updated according to the updated dependency graph, and the binding relationship between the new cluster and the cluster and network resources can be created.

[0076] Furthermore, after step 205, the method further includes: obtaining a target elastic address node for which no binding relationship exists; binding the target elastic address node and the newly created cluster node, and updating the dependency graph again based on the binding relationship between the nodes.

[0077] Exemplarily, after establishing the dependency graph, for each newly created cluster node, a spare elastic address node EIP can also be bound to it. At this time, a query statement can be run to find an EIP node that is not bound to any relationship. If it exists, the name of the first node is obtained, and the EIP node is directly bound to the newly created cluster node. If it does not exist, a new target elastic address node with a binding relationship is created. In one embodiment, the cluster creation request is used to request the creation of three new cluster nodes Cluster (serial numbers 4, 8, and 10 respectively). These three cluster nodes share the NAT gateway and the EIP resources associated with the gateway, and each uses the spare EIP resources. The resource dependency graph constructed at this time can be specifically shown in Figure 3.

[0078] In an exemplary embodiment, the method further includes: when a cluster deletion request is received, searching for a deletion target node of the cluster deletion request in the updated dependency graph; and deleting the deletion target node and the binding relationship between the deletion target node and the deletion target node in the dependency graph.

[0079] Exemplarily, the present application can also delete the cluster node in the dependency graph according to the request, and synchronize the updated relationship to the cluster system. In the case of receiving a cluster deletion request, the information in the cluster deletion request can be first extracted to determine the name of the specified deletion cluster, and the cluster node as the deletion target node can be found according to the name, and the binding relationship between the deletion target node and the deletion target node can be deleted in the dependency graph. At the same time, according to the updated dependency graph, management is performed to update the actual cluster system. In a specific embodiment, the dependency graph is stored in the Neo4j graph database. At this time, for the deletion process, the DETACH DELETE statement can be used to delete the deletion target node and all its associated relationships, while retaining the cluster management resources and only deleting the cluster node. In a specific embodiment, the cluster node with id=4 is deleted in the dependency graph established in Figure 3, and the updated dependency relationship can be shown in Figure 4. In this embodiment, by deleting the node through the dependency graph and updating the dependency graph, the binding relationship of the resource can be automatically released when deleting or reducing the cluster, but the resource itself is not deleted. This method avoids the waste of resources and ensures that the resources can be reused by other clusters or applications.

[0080] Furthermore, in the present application, the reuse of free network resources can be realized based on the dependency graph of network resources. a) A new cluster is created. Since there are NAT gateway nodes and EIP nodes bound to the NAT gateway nodes, the nodes of the new cluster are bound to the existing NAT gateway nodes and EIP nodes through the relationships [:CN] and [:CE] respectively. Then run the query statement to find an EIP node in a free state and establish a binding relationship with the node. In one embodiment, the dependency graph after creating a cluster (id=12) can be specifically shown in Figure 5. In this embodiment, by automatically selecting free resources and binding them when creating a new cluster or expanding a cluster, or automatically creating new resources and binding them when resources are insufficient, this resource management method is more intelligent and efficient than manually allocating and binding resources, thereby improving resource management efficiency and utilization efficiency.

[0081] In one embodiment, the cluster resource management request includes a dependency search request; step 207 includes: when receiving the dependency search request, searching for the target cluster node of the dependency search request in the updated dependency graph; obtaining the dependency between each type of node and the target cluster node in the dependency graph, generating a search result for the dependency search request; and feeding back the search result.

[0082] Exemplarily, the present application can be applied to query processing of cluster resources. For example, when a user wants to query the dependencies related to cluster resources, he can submit a corresponding dependency search request and specify the target cluster node to be queried in the dependency search request. Since the dependency graph stores the binding relationships between all cluster nodes, gateway nodes, and address nodes in the cluster system, after determining the target cluster node, the target cluster node can be located directly in the updated dependency graph through a query statement. Afterwards, based on the dependency graph, the dependencies between various nodes and the target cluster node are extracted, and these dependencies are listed to generate the search results of the dependency search request; and the results are fed back to the target user. In this embodiment, a graph database is used to store the dependency graph of network resources, and the advantages of the graph database are used to perform query operations on resource dependencies, thereby effectively ensuring the efficiency and accuracy of cluster relationship queries.

[0083] In another embodiment, the cluster resource management request may also include a resource recovery request. Step 207 includes: in the case of receiving a resource recovery request, searching for gateway nodes and elastic address nodes that are not bound to cluster nodes in the updated dependency graph; and performing resource node deletion processing based on the node information of the gateway nodes and elastic address nodes that are not bound to the cluster nodes. Among them, the resource recovery request can be submitted by the user through the operation terminal, or it can be generated regularly by setting a fixed time interval. In the case of receiving a resource recovery request, searching for gateway nodes and elastic address nodes that are not bound to cluster nodes in the updated dependency graph, these gateway nodes and elastic address nodes are in a free state, if there is a new cluster node, the new cluster node can be bound to these gateway nodes and elastic address nodes. If there is no new cluster and the resource recovery request is triggered, these network resources need to be recovered. At this time, the resource node deletion processing can be performed based on the node information of the gateway nodes and elastic address nodes that are not bound to the cluster nodes. In one embodiment, the dependency graph in FIG3 can be shown in FIG6 to delete all clusters, including 4 free elastic address nodes and 1 gateway node. At this time, resource recycling can be performed on these 5 nodes, and the specific process can be shown in FIG7. The present application automatically identifies and removes non-dependent resources through resource recycling requests, which is more efficient than manually managing resource dependencies.

[0084] In a specific embodiment, the cluster resource management method of the present application can be implemented by a dynamic resource dependency management system. The architecture of the system can be shown in FIG8, including an event triggering and scheduling module, which is used to trigger certain tasks (regular scanning, resource cleaning) or trigger tasks according to specific events. (Resource state change, dependency change). A dependency analysis and optimization module is used to scan the network resources in the cluster, build a resource dependency graph, analyze the dependencies between resources, and the undependent resources will be identified and removed, thereby optimizing resource utilization. A resource binding module is used when a new cluster is created, and the system automatically selects unbound network resources and binds them to the corresponding cluster. If there are no available resources, the system automatically creates new resources and performs binding operations to ensure the normal operation of the cluster. A resource unbinding module is used when a cluster is deleted, and the system will unbind the network resources in the cluster, but will not delete the resources themselves, so as to avoid waste of resources and ensure that the resources can be reused by other clusters. In addition, a Neo4j graph database is also included to store the constructed dependency graph and perform efficient query and update operations. When a new cluster needs to be created, the user can submit a cluster creation request to the system. The system then obtains the cluster creation request and searches the graph database for the dependency graph corresponding to the cluster creation request; creates a new cluster node corresponding to the cluster creation request in the dependency graph; then obtains the gateway node corresponding to the new cluster node, binds the new cluster node and the gateway node in the dependency graph; obtains the elastic address node corresponding to the gateway node, binds the gateway node and the elastic address node in the dependency graph; binds the elastic address node and the new cluster node, and based on the binding relationship between the nodes. At the same time, obtain the target elastic address node that does not have a binding relationship; bind the target elastic address node and the new cluster node, and based on the binding relationship between the nodes, update the dependency graph again; in the case of receiving a cluster deletion request, search for the deletion target node of the cluster deletion request in the updated dependency graph; delete the binding relationship between the deletion target node and the deletion target node in the dependency graph. In the case of receiving a dependency search request, search for the target cluster node of the dependency search request in the updated dependency graph; obtain the dependency relationship between various nodes and the target cluster node in the dependency graph, generate the search result of the dependency search request; and feedback the search result. When a resource recycling request is received, the updated dependency graph is used to search for gateway nodes and elastic address nodes that are not bound to cluster nodes; and resource node deletion processing is performed based on the node information of the gateway nodes and elastic address nodes that are not bound to cluster nodes.

[0085] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0086] Based on the same inventive concept, the embodiment of the present application also provides a cluster resource management device for implementing the cluster resource management method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more cluster resource management device embodiments provided below can refer to the limitations of the cluster resource management method above, and will not be repeated here.

[0087] In an exemplary embodiment, as shown in FIG9 , a cluster resource management device is provided, including:

[0088] The relationship graph search module 902 is used to obtain a cluster creation request and search the dependency graph corresponding to the cluster creation request in the graph database.

[0089] The cluster node creation module 904 is used to create a new cluster node corresponding to the cluster creation request in the dependency graph.

[0090] The relationship graph updating module 906 is used to update the dependency graph based on the dependency relationships of the newly created cluster nodes.

[0091] The resource management module 908 is used to perform resource management processing based on the updated dependency graph when receiving a cluster resource management request.

[0092] In one embodiment, the relationship graph update module 906 is specifically used to: obtain the gateway node corresponding to the newly created cluster node, and bind the newly created cluster node and the gateway node in the dependency graph; obtain the elastic address node corresponding to the gateway node, and bind the gateway node and the elastic address node in the dependency graph; bind the elastic address node and the newly created cluster node, and update the dependency graph based on the binding relationship between the nodes.

[0093] In one embodiment, the relationship graph updating module 906 is further used to: obtain a target elastic address node for which no binding relationship exists; bind the target elastic address node and the newly created cluster node, and update the dependency graph again based on the binding relationship between the nodes.

[0094] In one embodiment, a node deletion module is further included, which is used to: when a cluster deletion request is received, search for the deletion target node of the cluster deletion request in the updated dependency graph; and delete the deletion target node and the binding relationship between the deletion target node and the deletion target node in the dependency graph.

[0095] In one embodiment, the cluster resource management request includes a dependency search request; the resource management module 908 is specifically used to: when receiving the dependency search request, search for the target cluster node of the dependency search request in the updated dependency graph; obtain the dependency between various nodes and the target cluster node in the dependency graph, generate the search result of the dependency search request; and feedback the search result.

[0096] In one embodiment, the cluster resource management request includes a resource recovery request; the resource management module 908 is specifically used to: when receiving a resource recovery request, search for gateway nodes and elastic address nodes that are not bound to the cluster nodes in the updated dependency graph; and perform resource node deletion processing based on the node information of the gateway nodes and elastic address nodes that are not bound to the cluster nodes.

[0097] Each module in the above cluster resource management device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0098] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG10. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store cluster resource management data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a cluster resource management method is implemented.

[0099] Those skilled in the art will understand that the structure shown in FIG. 10 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0100] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0101] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0102] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0103] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0104] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0105] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0106] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A cluster resource management method, characterized in that: The method comprises: Obtain a cluster creation request, and search the graph database for a dependency graph corresponding to the cluster creation request; Creating a new cluster node corresponding to the cluster creation request in the dependency graph; Update the dependency graph based on the dependency of the newly created cluster nodes; When a cluster resource management request is received, resource management processing is performed based on the updated dependency graph.

2. The method according to claim 1, characterized in that The updating of the dependency graph based on the dependency of the newly created cluster node includes: Obtain a gateway node corresponding to the newly created cluster node, and bind the newly created cluster node and the gateway node in the dependency graph; Obtain an elastic address node corresponding to the gateway node, and bind the gateway node and the elastic address node in the dependency graph; The elastic address node and the newly created cluster node are bound, and based on the binding relationship between the nodes, the dependency graph is updated.

3. The method according to claim 2, characterized in that After binding the address node and the newly created cluster node, and updating the dependency graph based on the binding relationship between the nodes, the method further includes: Get the target elastic address node that does not have a binding relationship; The target elastic address node and the newly created cluster node are bound, and based on the binding relationship between the nodes, the dependency graph is updated again.

4. The method according to claim 1, characterized in that The method further comprises: When receiving a cluster deletion request, searching for a deletion target node of the cluster deletion request in the updated dependency graph; The binding relationship between the deletion target node and the deletion target node is deleted in the dependency graph.

5. The method according to any one of claims 1 to 4, characterized in that: The cluster resource management request includes a dependency lookup request; When a cluster resource management request is received, performing resource management processing based on the updated dependency graph includes: In case of receiving a dependency search request, searching for a target cluster node of the dependency search request in the updated dependency graph; Obtaining dependency relationships between various nodes in the dependency graph and the target cluster node, and generating a search result for the dependency search request; The search result is fed back.

6. The method according to any one of claims 1 to 4, characterized in that: The cluster resource management request includes a resource recovery request; When a cluster resource management request is received, performing resource management processing based on the updated dependency graph includes: In case of receiving a resource recycling request, searching the updated dependency graph for a gateway node and an elastic address node that are not bound to a cluster node; Based on the node information of the gateway node and the elastic address node that are not bound to the cluster node, resource node deletion processing is performed.

7. A cluster resource management device, characterized in that: The device comprises: A relationship graph search module is used to obtain a cluster creation request and search the dependency graph corresponding to the cluster creation request in the graph database; A cluster node creation module, used to create a new cluster node corresponding to the cluster creation request in the dependency graph; A relationship graph updating module, used to update the dependency graph based on the dependency relationship of the newly created cluster node; The resource management module is used to perform resource management processing based on the updated dependency graph when a cluster resource management request is received.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

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

Citation Information

Cited By

  • Method and device for cleaning 8a database cluster resources through interface

    CN121301467A