Distributed block storage resource optimization method and device, computer equipment and medium
By using storage linked lists to manage cluster resources in distributed block storage systems, the problem of excessive cluster load in large-scale distributed block storage scenarios is solved, load capacity and resource utilization efficiency are improved, and system stability and scalability are ensured. .
Patent Information
- Application Number
- CN202411237825.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-06
AI Technical Summary
In the large-scale distributed block storage scenario, creating a large number of cluster handles causes excessive load on the cluster, which may lead to cluster paralysis.
By setting up a storage linked list in the cluster resource management module, querying and matching the storage information of the target client, store its unique identity in the linked list when there is a matching shared object, registering a new shared object and generating an information linked list when it does not exist, realizing the implementation of the Shared object management for clusters, storage pools, and volumes.
It improves the load capacity of the distributed block storage system, reduces resource consumption, avoids frequent creation and destruction of cluster handles, improves performance and response speed, and ensures the stability and scalability of the system.
Smart Images

Figure CN119088315A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distributed systems, and in particular to a distributed block storage resource optimization method, device, computer equipment and medium. Background Art
[0002] SPDK (Storage Performance Development Kit) provides a set of tools and library functions for writing high-performance, scalable, user-mode storage applications. It moves all necessary drivers to user space and uses polling mode instead of interrupt mode, thus avoiding kernel context switching and eliminating interrupt processing overhead.
[0003] A distributed block storage cluster is a scalable storage architecture that enables cross-device data distribution and supports load sharing by multiple servers. This storage architecture can be used as a long-term storage device in physical and virtual machine applications, and usually includes advanced services such as backup and snapshots. When SPDK is used in a distributed block storage cluster, block storage operations can be implemented through librbd. When a client connects, SPDK creates a cluster handle, storage pool context, and volume context for the client to perform business isolation management on the volume.
[0004] However, in large-scale distributed block storage scenarios, the above solution will create a large number of cluster handles for a large number of volumes, causing a large load on the cluster. Summary of the invention
[0005] In view of this, the present invention provides a distributed block storage resource optimization method, apparatus, computer equipment and medium to improve the load capacity of a cluster.
[0006] In a first aspect, the present invention provides a distributed block storage resource optimization method, the method is applied to a cluster resource management module in a distributed block storage system, the cluster resource management module is provided with a storage linked list; the storage linked list is used to store identifiers of cluster shared objects, storage pool shared objects and volume shared objects; the method comprises:
[0007] When the target client logs in and connects, querying the shared object in the cluster resource management module according to the storage information of the target client; the storage information includes at least one of the cluster information, storage pool information and volume information of the target client;
[0008] If there is a shared object matching the storage information of the target client, the unique identifier of the target client is stored in an information linked list of the shared objects matching the storage information of the target client.
[0009] The distributed block storage resource optimization method provided by the present invention has the following advantages:
[0010] A cluster resource management module is provided in the distributed block storage system, and a storage list is provided in the cluster resource management module, and the storage list can be used to store the identifiers of cluster shared objects, storage pool shared objects and volume shared objects; when a target client logs in and connects, the cluster resource management module will query whether there is a shared object matching the storage information of the target client in the cluster resource management module according to the storage information on the target client, that is, whether there is a cluster, storage pool and volume matching the target client; when there is a shared object matching the storage information of the target client, the unique identifier of the target client can be stored in the information linked list corresponding to the sharing, so that the target clients using the same cluster, storage pool or volume are maintained through the linked list, thereby improving the load capacity of the distributed block storage system and reducing the resource consumption of the distributed block storage system.
[0011] In an optional embodiment, the method further includes:
[0012] If there is no shared object matching the storage information of the target client, register a new shared object in the cluster resource management module and generate a corresponding information linked list according to the storage information of the target client;
[0013] The unique identifier of the target client is stored in the information linked list of the new shared object.
[0014] In an optional implementation, when the storage information includes cluster information of the target client, if there is a shared object matching the storage information of the target client, storing the unique identifier of the target client in an information linked list of the shared object matching the storage information of the target client includes:
[0015] According to the cluster information, acquiring, in the cluster resource management module, a cluster sharing object that matches the storage information of the target client;
[0016] The unique identifier of the target client is stored in the information linked list of the cluster shared object;
[0017] When the storage information includes storage pool information of the target client, if there is a shared object matching the storage information of the target client, storing the unique identifier of the target client in an information linked list of the shared object matching the storage information of the target client comprises:
[0018] According to the storage pool information, acquiring, in the cluster resource management module, a storage pool sharing object that matches the storage information of the target client;
[0019] The unique identifier of the target client is stored in the information linked list of the cluster shared object;
[0020] When the storage information includes volume information of the target client, if there is a shared object matching the storage information of the target client, storing the unique identifier of the target client in an information linked list of the shared object matching the storage information of the target client comprises:
[0021] According to the volume information, acquiring, in the cluster resource management module, a volume sharing object that matches the storage information of the target client;
[0022] The unique identifier of the target client is stored in the information linked list of the volume sharing object.
[0023] In an optional embodiment, the method further includes:
[0024] When the target client logs out of the connection, obtaining the corresponding cluster shared object in the cluster resource management module according to the cluster information of the target client;
[0025] The unique identification information of the target client is deleted from the information linked list of the cluster shared object.
[0026] In an optional embodiment, the method further includes:
[0027] When the target client logs out of the connection, obtaining the corresponding cluster shared object in the cluster resource management module according to the storage pool information of the target client;
[0028] The unique identification information of the target client is deleted from the information linked list of the storage pool shared object.
[0029] In an optional embodiment, the method further includes:
[0030] When the target client logs out of the connection, obtaining a corresponding volume sharing object in the cluster resource management module according to the volume information of the target client;
[0031] The unique identification information of the target client is deleted from the information linked list of the volume sharing object.
[0032] In an optional embodiment, the method further includes:
[0033] The information linked list of each shared object is checked according to the specified period, and the shared objects whose information linked list is empty are deleted.
[0034] In a second aspect, the present invention provides a distributed block storage resource optimization device, the device is applied to a cluster resource management module in a distributed block storage system, the cluster resource management module is provided with a storage linked list; the storage linked list is used to store identifiers of cluster shared objects, storage pool shared objects and volume shared objects; the device comprises:
[0035] A shared object query unit, configured to query the shared object in the cluster resource management module according to the storage information of the target client when the target client logs in and connects; the storage information includes at least one of the cluster information, storage pool information and volume information of the target client;
[0036] The identification processing unit is used to store the unique identification of the target client in the information linked list of the shared objects matching the storage information of the target client if there is a shared object matching the storage information of the target client.
[0037] The distributed block storage resource optimization device provided by the present invention has the following advantages:
[0038] A cluster resource management module is provided in the distributed block storage system, and a storage list is provided in the cluster resource management module, and the storage list can be used to store the identifiers of cluster shared objects, storage pool shared objects and volume shared objects; when a target client logs in and connects, the cluster resource management module will query whether there is a shared object matching the storage information of the target client in the cluster resource management module according to the storage information on the target client, that is, whether there is a cluster, storage pool and volume matching the target client; when there is a shared object matching the storage information of the target client, the unique identifier of the target client can be stored in the information linked list corresponding to the sharing, so that the target clients using the same cluster, storage pool or volume are maintained through the linked list, thereby improving the load capacity of the distributed block storage system and reducing the resource consumption of the distributed block storage system.
[0039] In a possible implementation manner, the device further includes:
[0040] A registration unit, configured to register a new shared object in the cluster resource management module and generate a corresponding information linked list according to the storage information of the target client if there is no shared object matching the storage information of the target client;
[0041] The identification processing unit is further used to save the unique identification of the target client in the information linked list of the new shared object.
[0042] In a possible implementation, when the storage information includes cluster information of the target client, the identification processing unit is further used to: obtain, in the cluster resource management module, a cluster shared object that matches the storage information of the target client according to the cluster information; and store the unique identification of the target client in an information linked list of the cluster shared object;
[0043] When the storage information includes the storage pool information of the target client, the identification processing unit is further used to: obtain, in the cluster resource management module, a storage pool sharing object that matches the storage information of the target client according to the storage pool information; and store the unique identification of the target client in the information linked list of the cluster sharing object;
[0044] When the storage information includes volume information of the target client, the identification processing unit is further used to: obtain a volume sharing object that matches the storage information of the target client in the cluster resource management module based on the volume information; and store the unique identifier of the target client in the information linked list of the volume sharing object.
[0045] In a possible implementation, the identification processing unit is further used to obtain the corresponding cluster shared object in the cluster resource management module according to the cluster information of the target client when the target client logs out of the connection; and delete the unique identification information of the target client from the information linked list of the cluster shared object.
[0046] In a possible implementation, the identification processing unit is also used to obtain the corresponding cluster shared object in the cluster resource management module according to the storage pool information of the target client when the target client logs out of the connection; and delete the unique identification information of the target client from the information linked list of the storage pool shared object.
[0047] In a possible implementation, the identification processing unit is also used to obtain the corresponding volume sharing object in the cluster resource management module according to the volume information of the target client when the target client logs out of the connection; and delete the unique identification information of the target client from the information linked list of the volume sharing object.
[0048] In a possible implementation, the identification processing unit is further configured to detect the information linked list of each shared object according to a specified period, and delete the shared object whose information linked list is empty.
[0049] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the distributed block storage resource optimization method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0050] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the distributed block storage resource optimization method of the first aspect or any corresponding embodiment thereof.
[0051] In a fifth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the distributed block storage resource optimization method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 is a structural diagram of a distributed block storage system provided by an embodiment of the present invention;
[0054] Figure 2 It is a flow chart of a distributed block storage resource optimization method provided by an embodiment of the present invention;
[0055] Figure 3 It is a flow chart of a distributed block storage resource optimization method provided by an embodiment of the present invention;
[0056] Figure 4 A schematic diagram showing a client login process involved in an embodiment of the present application is shown;
[0057] Figure 5 A schematic diagram showing a client logout process involved in an embodiment of the present application;
[0058] Figure 6 A distributed block storage resource optimization device provided by this embodiment is shown;
[0059] Figure 7 It is a structural schematic diagram of a computer device provided by an optional embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0061] SPDK technology runs the device driver in user mode, avoiding context switching and interrupt processing between kernel mode and user mode, significantly reducing processing overhead, so that more processing power can be used for actual data storage operations. In addition, SPDK uniformly encapsulates block device semantics in user space and abstracts multiple block device layers to support different types of backend storage devices.
[0062] When using SPDK for distributed block storage clusters, block storage operations are usually implemented through the librbd library. When a client connects, the system creates a corresponding cluster handle, storage pool context, and volume context for it to implement business isolation management of the volume. However, this approach has problems in large-scale distributed block storage environments: when the number of volumes reaches tens of thousands, if a cluster handle is opened for each volume, a large amount of cluster resources will be occupied, significantly increasing the load on the cluster, and may even cause the cluster to crash.
[0063] In order to solve the above problems, the present invention proposes a distributed block storage resource optimization method. In the process of using SPDK to connect to distributed block storage, the method improves the load capacity of the cluster and reduces resource consumption by creating and managing cluster resource sharing objects.
[0064] It should be noted that the steps shown in the present application can be executed in a distributed system including, for example, a set of computer-executable instructions, and that, although a 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.
[0065] Figure 1 FIG. 1 is a schematic diagram of a distributed block storage system provided by an embodiment of the present invention. Figure 1 As shown, the system includes a server cluster 110 consisting of a plurality of servers.
[0066] Optionally, the servers are connected via a wired network or a wireless network to form a server cluster 110. Optionally, the server cluster 110 includes computing nodes and storage nodes. In the server cluster, computing nodes and storage nodes play different roles and each undertakes specific tasks to jointly support the operation of the distributed storage system.
[0067] Compute nodes are mainly responsible for performing various computing tasks, including data processing, analysis, calculation, and application running. In a distributed block storage system, compute nodes can assume the role of a client, sending storage requests or data processing tasks. The main task of storage nodes is to provide persistent data storage services. They are equipped with high-speed storage devices, responsible for storing data uploaded by clients, and responding to read requests.
[0068] Optionally, the cluster resource management module in the present application may be set on a computing node to execute the steps involved in the following embodiments.
[0069] Specifically, in this embodiment, a distributed block storage resource optimization method is provided, which is applied to a cluster resource management module in a distributed block storage system. The cluster resource management module is set as follows: Figure 1 In the server cluster 110 in the distributed block storage system shown in the figure, a storage linked list is provided in the cluster resource management module; the storage linked list is used to store the identifiers of cluster shared objects, storage pool shared objects and volume shared objects. Figure 2 FIG. 1 is a flow chart of a distributed block storage resource optimization method provided by an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0070] Step S201: when a target client logs in and connects, query the shared objects in the cluster resource management module according to the storage information of the target client.
[0071] The storage information includes at least one of cluster information, storage pool information, and volume information of the target client.
[0072] In the cluster resource management module in the embodiment of the present application, a storage cluster handle management container is provided, and the storage cluster handle management container is used to implement the shared management of the cluster, including registration, deletion and update. Each storage cluster handle object structure not only contains cluster-related connection attributes and interaction context, but also maintains the storage linked list containers of different storage pools and volumes under the cluster. Objects of different storage pools and volumes are managed in the storage linked list container through shared pointers, thereby realizing the creation, management and maintenance of cluster, storage pool and volume shared objects.
[0073] When the target client attempts to connect, the system obtains the client's storage information, including cluster information, storage pool information, and volume information.
[0074] Based on the client storage information obtained, the system queries the "Storage Cluster Handle Management Container" in the cluster resource management module to see if the corresponding shared object already exists. This container is used to manage all shared resources of the cluster, including storage cluster handle objects, which maintain storage linked list containers of different storage pools and volumes under the cluster.
[0075] By storing the shared pointers managed in the linked list container, the system checks the existing shared objects one by one to determine whether there is an object that matches the target client's storage information.
[0076] Step S202: if there is a shared object matching the storage information of the target client, the unique identifier of the target client is stored in an information linked list of the shared object matching the storage information of the target client.
[0077] If a shared object matching the target client's storage information is found in step S201, the system will proceed to the next step: the system will store the target client's unique identifier (such as a client ID or other identifier) in the information list of the shared object matching it, and the system may update the status or properties of the shared object based on the newly connected client information, such as updating the connected client list, adjusting the resource allocation strategy, etc.
[0078] The above solution queries shared objects. If there are shared objects that match the target client, they can be reused directly, avoiding the creation of new cluster handles for each client, reducing redundant use of resources, reducing frequent creation and destruction of cluster handles, reducing system overhead, and improving performance and response speed. By centrally managing shared objects of storage pools and volumes, cluster resource management is more efficient and orderly, which helps maintain the stability and scalability of the cluster.
[0079] To summarize, a cluster resource management module is provided in the distributed block storage system, and a storage list is provided in the cluster resource management module, and the storage list can be used to store the identifiers of cluster shared objects, storage pool shared objects and volume shared objects; when the target client logs in and connects, the cluster resource management module will query whether there is a shared object matching the storage information of the target client in the cluster resource management module according to the storage information on the target client, that is, whether there is a cluster, storage pool and volume matching the target client; when there is a shared object matching the storage information of the target client, the unique identifier of the target client can be stored in the information linked list corresponding to the share, so that the target clients using the same cluster, storage pool or volume are maintained through the linked list, thereby improving the load capacity of the distributed block storage system and reducing the resource consumption of the distributed block storage system.
[0080] Figure 3FIG. 1 is a flow chart of a distributed block storage resource optimization method provided by an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:
[0081] Step S301: when a target client logs in and connects, query the shared objects in the cluster resource management module according to the storage information of the target client.
[0082] The storage information includes at least one of cluster information, storage pool information, and volume information of the target client.
[0083] Step S302A: if there is a shared object matching the storage information of the target client, the unique identifier of the target client is stored in an information linked list of shared objects matching the storage information of the target client.
[0084] Specifically, the cluster resource management module may obtain, in the cluster resource management module, a cluster sharing object that matches the storage information of the target client according to the cluster information;
[0085] The unique identifier of the target client is stored in the information linked list of the cluster shared object;
[0086] In a possible implementation, according to the storage pool information, a storage pool sharing object matching the storage information of the target client is acquired in the cluster resource management module;
[0087] The unique identifier of the target client is stored in the information linked list of the cluster shared object;
[0088] In a possible implementation, according to the volume information, a volume sharing object matching the storage information of the target client is acquired in the cluster resource management module;
[0089] The unique identifier of the target client is stored in the information linked list of the volume sharing object.
[0090] That is to say, after the target client logs in and connects, the cluster resource management module can search and manage shared objects according to storage information of different levels (i.e., cluster information, storage pool information, and volume information). In the embodiment of the present application, storage objects are divided into three levels: cluster, storage pool, and volume, and shared objects are searched and managed layer by layer.
[0091] Among them, cluster is the highest level of abstraction of storage system, usually composed of multiple servers (nodes), which are interconnected through the network and jointly provide storage resources and services. A cluster can contain tens to thousands of nodes, depending on the system scale and design goals. Storage pool is a logical partition within the cluster, which organizes a group of physical storage devices (such as hard disks, solid-state drives, etc.) together to form a unified storage resource pool. Volume is a logical storage unit within the storage pool, which divides a specific capacity of storage space from the storage pool and provides it to upper-level applications or operating systems as an independent storage device.
[0092] This hierarchical management approach ensures that objects at each layer can be correctly identified and managed, reducing the complexity of redundant creation and management of resources. By searching for existing shared objects at each layer, the system can effectively reuse these objects and reduce resource consumption caused by repeated creation. When matching shared objects are found, the system will update the status of these objects, add the identifier of the new client to the information list, and the information list of the shared object stores the identifiers of all clients connected to the object, allowing the system to efficiently manage the connection information of multiple clients.
[0093] Please refer to Figure 4 , which shows a schematic diagram of a client login process involved in an embodiment of the present application. Figure 4 As shown, after the client logs in, the cluster resource management module matches the cluster information of the target client and registers the cluster shared object; if there is a registered cluster shared object, the client unique identifier is added to the cluster shared object maintenance list; at this time, the cluster resource management module matches the storage pool information again, registers the storage pool shared object, and if there is a registered storage pool object, the client unique identifier is added to the storage pool shared object maintenance list; at this time, the cluster resource management module matches the volume information again, registers the volume shared object, and if there is a registered volume shared object, the client unique identifier is added to the volume shared object maintenance list.
[0094] Step S302B: if there is no shared object matching the storage information of the target client, a new shared object is registered in the cluster resource management module according to the storage information of the target client and a corresponding information linked list is generated.
[0095] Step S303: Save the unique identifier of the target client in the information linked list of the new shared object.
[0096] Specifically, if no matching cluster sharing object is found, the system will create a new cluster sharing object based on the target client's cluster information; then, the system will check whether there is a matching storage pool sharing object based on the target client's storage pool information. If not, a new storage pool sharing object will be created; finally, the system will check whether there is a matching volume sharing object based on the target client's volume information. If not, a new volume sharing object will be created.
[0097] That is to say, when no corresponding shared object is found, the system needs to create a new shared object and generate a corresponding information list. The system first searches for existing shared objects in the cluster resource management module based on the target client's storage information (cluster information, storage pool information, and volume information), such as searching level by level (cluster, storage pool, volume) to ensure that the specific storage requirements of the target client are accurately matched.
[0098] In another possible implementation, if there is no shared object that matches the storage information of the target client, the cluster resource management module can search the existing shared object list and search for a shared object similar to the storage information of the target client based on the defined merge conditions, thereby writing the unique identifier of the target client into a linked list of similar shared objects.
[0099] Optionally, the above steps may be performed when the cluster resource management module is in a compatible mode, that is, if the volume requested by the new client is the same as the volume of an existing shared object and the access modes are compatible, the shared object is considered a candidate object for merging.
[0100] Optionally, when the unique identifier of the target client is written into a linked list of similar shared objects, a compatible identifier can be added to the unique identifier of the target client, thereby indicating that the unique identifier of the target client is stored in a compatible manner in the linked list of shared objects; if the unique identifier stored in a compatible manner in the shared object is greater than a quantity threshold, the cluster resource management module can determine the number of clients whose unique identifiers belong to the same category (for example, the same cluster, the same storage pool or the same volume) according to the type of the compatible identifier, and generate a new shared object and linked list based on the clients of the category that meet the quantity, and write the unique identifier into it.
[0101] In a possible implementation, when the target client logs out, a shared object matching the storage information is obtained based on the storage information of the target client, and the unique identification information of the target client is deleted from the information linked list of the shared object matching the storage information.
[0102] Specifically, when the target client logs out, the corresponding cluster shared object is obtained in the cluster resource management module according to the cluster information of the target client; and the unique identification information of the target client is deleted from the information linked list of the cluster shared object.
[0103] Specifically, when the target client logs out, the corresponding cluster shared object is obtained in the cluster resource management module according to the storage pool information of the target client; and the unique identification information of the target client is deleted from the information linked list of the storage pool shared object.
[0104] Specifically, when the target client logs out, the corresponding volume sharing object is obtained in the cluster resource management module according to the volume information of the target client; and the unique identification information of the target client is deleted from the information linked list of the volume sharing object.
[0105] When the target client logs out, the system needs to find the corresponding shared object based on the client's storage information and delete the client's unique identification information from the information linked list of these shared objects. This operation involves shared objects at three different levels: cluster, storage pool, and volume, to ensure that all resources related to the client can be correctly released and managed. When the target client logs out, the system first finds the corresponding cluster shared object in the cluster resource management module based on the client's cluster information. In the found cluster shared object, the system deletes the unique identification information of the target client from the information linked list. As a result, the client is no longer associated with the cluster shared object. The system then finds the corresponding storage pool shared object in the cluster resource management module based on the target client's storage pool information; in the found storage pool shared object, the system deletes the unique identification information of the target client from the information linked list, thereby disassociating the client from the storage pool. Finally, the system finds the corresponding volume shared object based on the target client's volume information; in the found volume shared object, the system deletes the unique identification information of the target client from the information linked list, indicating that the client no longer uses the volume.
[0106] Please refer to Figure 5 , which shows a schematic diagram of a client logout process involved in an embodiment of the present application. Figure 5As shown, after the client logs out, the cluster resource management module matches the volume information, obtains the volume sharing object, and deletes the client's unique identifier from the volume sharing object maintenance linked list; matches the storage pool information, obtains the storage pool sharing object, and deletes the client's unique identifier from the storage pool sharing object maintenance linked list; then matches the cluster information, obtains the cluster sharing object, and deletes the client's unique identifier from the cluster sharing object maintenance linked list. During the client login process, if there is a matching cluster sharing object, storage pool sharing object, or volume sharing object, the unique identifier is directly added to the corresponding linked list; if it does not exist, the corresponding shared object will be registered and the corresponding linked list will be generated. Therefore, when the client is in the login state, the cluster sharing object, storage pool sharing object, and volume sharing object maintenance linked list in the cluster resource management module will contain the client's unique identifier. Therefore, when the client logs out, it is necessary to perform the unique identifier deletion operation at all three levels.
[0107] In the above scheme, when the target client logs out, the unique identification information is deleted at each level (cluster, storage pool, volume) according to its storage information, ensuring the timely release of resources and efficient management of the system. This mechanism not only optimizes system performance and reduces resource waste, but also improves system stability and data consistency.
[0108] In a possible implementation, the information linked list of each shared object is checked according to a specified period, and the shared object whose information linked list is empty is deleted.
[0109] Specifically, the system sets up a scheduled task or periodic mechanism to periodically scan all shared objects in the cluster resource management module (including cluster shared objects, storage pool shared objects, and volume shared objects). The detection period can be configured according to the actual needs of the system, such as every few minutes, hours, or once a day. For each shared object, the system checks the information linked list attached to it. The information linked list usually records the unique identification information of the client associated with the shared object (such as the client ID). An empty information linked list means that no client is currently connected or using the shared object. If the information linked list of a shared object is empty, the system will assume that the shared object is no longer used by any client, and the system will delete these useless shared objects to free up system resources and avoid unnecessary memory usage and other resource consumption.
[0110] The above technical solution of detecting and deleting shared objects with empty information lists according to a specified period provides an efficient resource management strategy for the storage system. This mechanism ensures the timely cleaning of useless shared objects, optimizes the utilization of system resources, and improves overall performance and stability. At the same time, the automated cleaning process simplifies system management and maintenance, supports the scalability and flexibility of the system, and adapts to diverse storage needs. Through this refined management strategy, the storage system can maintain efficient and reliable operation in a complex environment.
[0111] To summarize, a cluster resource management module is provided in the distributed block storage system, and a storage list is provided in the cluster resource management module, and the storage list can be used to store the identifiers of cluster shared objects, storage pool shared objects and volume shared objects; when the target client logs in and connects, the cluster resource management module will query whether there is a shared object matching the storage information of the target client in the cluster resource management module according to the storage information on the target client, that is, whether there is a cluster, storage pool and volume matching the target client; when there is a shared object matching the storage information of the target client, the unique identifier of the target client can be stored in the information linked list corresponding to the share, so that the target clients using the same cluster, storage pool or volume are maintained through the linked list, thereby improving the load capacity of the distributed block storage system and reducing the resource consumption of the distributed block storage system.
[0112] In this embodiment, a distributed block storage resource optimization device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0113] This embodiment provides a distributed block storage resource optimization device, such as Figure 6 As shown, the device is applied to a cluster resource management module in a distributed block storage system, and a storage linked list is provided in the cluster resource management module; the storage linked list is used to store identifiers of cluster shared objects, storage pool shared objects, and volume shared objects; the device includes:
[0114] A shared object query unit 601 is used to query the shared object in the cluster resource management module according to the storage information of the target client when the target client logs in and connects; the storage information includes at least one of the cluster information, storage pool information and volume information of the target client;
[0115] The identification processing unit 602 is configured to store the unique identification of the target client in an information linked list of the shared objects matching the storage information of the target client if there is a shared object matching the storage information of the target client.
[0116] The distributed block storage resource optimization device provided by the present invention has the following advantages:
[0117] A cluster resource management module is provided in the distributed block storage system, and a storage list is provided in the cluster resource management module, and the storage list can be used to store the identifiers of cluster shared objects, storage pool shared objects and volume shared objects; when a target client logs in and connects, the cluster resource management module will query whether there is a shared object matching the storage information of the target client in the cluster resource management module according to the storage information on the target client, that is, whether there is a cluster, storage pool and volume matching the target client; when there is a shared object matching the storage information of the target client, the unique identifier of the target client can be stored in the information linked list corresponding to the sharing, so that the target clients using the same cluster, storage pool or volume are maintained through the linked list, thereby improving the load capacity of the distributed block storage system and reducing the resource consumption of the distributed block storage system.
[0118] In a possible implementation manner, the device further includes:
[0119] A registration unit, configured to register a new shared object in the cluster resource management module and generate a corresponding information linked list according to the storage information of the target client if there is no shared object matching the storage information of the target client;
[0120] The identification processing unit 602 is further configured to store the unique identification of the target client in the information linked list of the new shared object.
[0121] In a possible implementation, when the storage information includes cluster information of the target client, the identification processing unit 602 is further used to: obtain, in the cluster resource management module, a cluster shared object that matches the storage information of the target client according to the cluster information; and store the unique identification of the target client in an information linked list of the cluster shared object;
[0122] When the storage information includes the storage pool information of the target client, the identification processing unit 602 is further used to: obtain, in the cluster resource management module, a storage pool sharing object that matches the storage information of the target client according to the storage pool information; and store the unique identification of the target client in the information linked list of the cluster sharing object;
[0123] When the storage information includes volume information of the target client, the identification processing unit 602 is further used to: obtain, in the cluster resource management module, a volume sharing object that matches the storage information of the target client based on the volume information; and store the unique identifier of the target client in the information linked list of the volume sharing object.
[0124] In a possible implementation, the identification processing unit 602 is also used to obtain the corresponding cluster shared object in the cluster resource management module according to the cluster information of the target client when the target client logs out of the connection; and delete the unique identification information of the target client from the information linked list of the cluster shared object.
[0125] In a possible implementation, the identification processing unit 602 is also used to obtain the corresponding cluster shared object in the cluster resource management module according to the storage pool information of the target client when the target client logs out of the connection; and delete the unique identification information of the target client from the information linked list of the storage pool shared object.
[0126] In a possible implementation, the identification processing unit 602 is also used to obtain the corresponding volume sharing object in the cluster resource management module according to the volume information of the target client when the target client logs out of the connection; and delete the unique identification information of the target client from the information linked list of the volume sharing object.
[0127] In a possible implementation, the identification processing unit 602 is further configured to detect the information linked list of each shared object according to a specified period, and delete the shared object whose information linked list is empty.
[0128] The embodiment of the present invention also provides a computer device having the above Figure 6 The distributed block storage resource optimization device is shown.
[0129] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0130] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0131] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0132] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0133] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0134] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0135] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0136] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or 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 a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0137] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0138] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A distributed block storage resource optimization method, characterized in that: The method is applied to a cluster resource management module in a distributed block storage system, wherein a storage linked list is provided in the cluster resource management module; The storage linked list is used to store the identifiers of cluster shared objects, storage pool shared objects and volume shared objects; the method comprises: When the target client logs in and connects, querying the shared object in the cluster resource management module according to the storage information of the target client; the storage information includes at least one of the cluster information, storage pool information and volume information of the target client; If there is a shared object matching the storage information of the target client, the unique identifier of the target client is stored in an information linked list of the shared objects matching the storage information of the target client.
2. The method according to claim 1, characterized in that The method further comprises: If there is no shared object matching the storage information of the target client, register a new shared object in the cluster resource management module and generate a corresponding information linked list according to the storage information of the target client; The unique identifier of the target client is stored in the information linked list of the new shared object.
3. The method according to claim 1 or 2, characterized in that: When the storage information includes cluster information of the target client, if there is a shared object matching the storage information of the target client, storing the unique identifier of the target client in an information linked list of the shared object matching the storage information of the target client comprises: According to the cluster information, acquiring, in the cluster resource management module, a cluster sharing object that matches the storage information of the target client; The unique identifier of the target client is stored in the information linked list of the cluster shared object; When the storage information includes storage pool information of the target client, if there is a shared object matching the storage information of the target client, storing the unique identifier of the target client in an information linked list of the shared object matching the storage information of the target client comprises: According to the storage pool information, acquiring, in the cluster resource management module, a storage pool sharing object that matches the storage information of the target client; The unique identifier of the target client is stored in the information linked list of the cluster shared object; When the storage information includes volume information of the target client, if there is a shared object matching the storage information of the target client, storing the unique identifier of the target client in an information linked list of the shared object matching the storage information of the target client comprises: According to the volume information, acquiring, in the cluster resource management module, a volume sharing object that matches the storage information of the target client; The unique identifier of the target client is stored in the information linked list of the volume sharing object.
4. The method according to claim 3, characterized in that The method further comprises: When the target client logs out of the connection, obtaining the corresponding cluster shared object in the cluster resource management module according to the cluster information of the target client; The unique identification information of the target client is deleted from the information linked list of the cluster shared object.
5. The method according to claim 3, characterized in that: The method further comprises: When the target client logs out of the connection, obtaining the corresponding cluster shared object in the cluster resource management module according to the storage pool information of the target client; The unique identification information of the target client is deleted from the information linked list of the storage pool shared object.
6. The method according to claim 3, characterized in that: The method further comprises: When the target client logs out of the connection, obtaining a corresponding volume sharing object in the cluster resource management module according to the volume information of the target client; The unique identification information of the target client is deleted from the information linked list of the volume sharing object.
7. The method according to claim 3, characterized in that The method further comprises: The information linked list of each shared object is checked according to the specified period, and the shared objects whose information linked list is empty are deleted.
8. A distributed block storage resource optimization device, characterized in that: The device is applied to a cluster resource management module in a distributed block storage system, wherein a storage linked list is provided in the cluster resource management module; The storage linked list is used to store the identifiers of cluster shared objects, storage pool shared objects and volume shared objects; the device comprises: A shared object query unit, configured to query the shared object in the cluster resource management module according to the storage information of the target client when the target client logs in and connects; the storage information includes at least one of the cluster information, storage pool information and volume information of the target client; The identification processing unit is used to store the unique identification of the target client in the information linked list of the shared objects matching the storage information of the target client if there is a shared object matching the storage information of the target client.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the distributed block storage resource optimization method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the distributed block storage resource optimization method according to any one of claims 1 to 7.
