Data read / write method and apparatus therefor
Patent Information
- Application Number
- CN202011625100.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2040-12-30
AI Technical Summary
[0004]如果分别满足两类用户的需求,则需要分别建立对应两种类型的存储集群,即需要分别建立对应的物理资源池,部署成本高
[0062] In this embodiment, the client receives the view information of the target DHT ring sent by the management node. This target DHT ring is obtained by merging multiple initial DHT rings, and the initial DHT ring is a DHT ring corresponding to an Availability Zone (AZ). After merging, a single AZ plog or a multi-AZ plog can be created. That is, users in a single AZ and users in multiple AZs can share the storage node corresponding to a target DHT ring, thereby reducing the deployment cost of the storage cluster and improving the utilization efficiency of the storage node.
Smart Images

Figure CN114697352B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a data reading and writing method and device. Background Technology
[0002] As the number of users of public cloud databases increases, the cluster size also grows larger.
[0003] One type of user will choose a cross-Availability Zone (AZ) data storage method with high data reliability, which requires the establishment of a storage cluster deployed across AZs. Another type of user does not need cross-AZ disaster recovery for their data, or does not want to bear the cost of cross-AZ storage, and only needs to achieve a certain durability within one AZ.
[0004] If the needs of two types of users are to be met separately, then two corresponding storage clusters need to be built, which means that corresponding physical resource pools need to be built separately, resulting in high deployment costs. Summary of the Invention
[0005] This application provides a data read / write method that allows user devices in a single Availability Zone (AZ) and user devices in multiple AZs to share the first storage node corresponding to a target distributed hash table (DHT), thereby reducing the deployment cost of the storage cluster and improving the utilization efficiency of the storage node.
[0006] The first aspect of this application provides a data read / write method, including:
[0007] The client receives the view information of the target DHT ring sent by the management node. The target DHT ring is obtained by the management node from merging multiple initial DHT rings. The multiple initial DHT rings are created by the management node. The initial DHT ring includes multiple initial partitions. The initial partitions include multiple first storage nodes. The view information of the target DHT ring is used to create logical data storage unit plog. The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs.
[0008] In this embodiment, the client receives the view information of the target DHT ring sent by the management node. This target DHT ring is obtained by merging multiple initial DHT rings, and the initial DHT ring is a DHT ring corresponding to an Availability Zone (AZ). After merging, a single AZ plog or a multi-AZ plog can be created. That is, users in a single AZ and users in multiple AZs can share the storage node corresponding to a target DHT ring, thereby reducing the deployment cost of the storage cluster and improving the utilization efficiency of the storage node.
[0009] Based on the data read / write method of the first aspect of this application, in one possible implementation, the client receives a first creation request sent by the user equipment. The first creation request is used to instruct the creation of a first plog. The client determines to create the first plog in a first partition based on the first creation request and the information of the target DHT ring. The first partition includes multiple initial partitions, and each initial partition corresponds to a different initial DHT ring. The client sends a second creation request to the target storage node. The second creation request is used to instruct the target storage node to create the first plog. The target storage node is the storage node corresponding to the primary partition of the first partition. The primary partition of the first partition belongs to one of the multiple initial partitions, and the target storage node belongs to one of the multiple first storage nodes. The client receives the metadata of the first plog sent by the target storage node. The metadata of the first plog is used to read and write data in the storage node corresponding to the first plog. The client sends the metadata of the first plog to the user equipment.
[0010] In this embodiment, the first plog of a single AZ or the first plog of multiple AZs can be created according to the target DHT ring, which allows users of a single AZ and users of multiple AZs to share the storage node corresponding to the target DHT ring, thereby reducing the deployment cost of the storage cluster and improving the utilization efficiency of the storage node.
[0011] Based on the data read / write method of the first aspect of this application, in one possible implementation, the first plog is the plog of a single AZ, and the multiple first storage nodes corresponding to the first plog belong to the same initial partition.
[0012] In this embodiment, the first plog is the plog of a single AZ, which improves the feasibility of the solution.
[0013] Based on the data read / write method of the first aspect of this application, in one possible implementation, the first plog is a plog of multiple Availability Zones (AZs), and the multiple first storage nodes corresponding to the first plog belong to at least two initial partitions.
[0014] In this embodiment of the application, the first plog is a plog of multiple AZs, which improves the feasibility of the solution.
[0015] Based on the data read / write method of the first aspect of this application, in one possible implementation, the metadata of the first plog includes the ID information of the first plog, the ID information of the first plog includes differentiated tag information, and the differentiated tag information is used to record the information of multiple first storage nodes corresponding to the first plog.
[0016] In this embodiment, the ID information of the first plog includes differentiated marker information, so that when the data of the first plog needs to be read later, the information of the corresponding first storage node can be directly obtained from the ID information of the first plog, saving the resource overhead of needing to obtain the metadata of the first plog separately.
[0017] Based on the data reading and writing method of the first aspect of this application, in one possible implementation, the differentiated marking information is bitmap information.
[0018] In this embodiment, the differentiated marker information is bitmap information, which improves the feasibility of the solution.
[0019] Based on the data read / write method of the first aspect of this application, in one possible implementation, the client determines to create a first plog in the first partition according to the first creation request and the information of the target DHT ring, including the client obtaining the AZ attribute of the first plog according to the first creation request, the AZ attribute including a single AZ plog and a plog with multiple AZs, and the client determining to create a first plog in the first partition according to the information of the target DHT ring and the AZ attribute of the first plog.
[0020] In this embodiment, the creation of the first plog in the first partition is determined based on the AZ attribute of the first plog, which improves the feasibility of the solution.
[0021] Based on the data read / write method of the first aspect of this application, in one possible implementation, the method further includes: the client receiving a first read / write request sent by the user equipment, the first read / write request being used to read and write the first storage node corresponding to the first plog, and the client obtaining the data in the first storage node corresponding to the first plog based on the metadata of the first plog.
[0022] In this embodiment of the application, the data of the first storage node of the first plog is obtained based on the metadata of the first plog, which improves the feasibility of the solution.
[0023] Based on the data read / write method of the first aspect of this application, in one possible implementation, the primary partition is determined by the management node from multiple initial partitions according to a hash algorithm.
[0024] In this embodiment, the primary partition is determined based on a hash algorithm, which improves the randomness of the primary partition determination.
[0025] Based on the data read / write method of the first aspect of this application, in one possible implementation, the primary partition is determined by the management node based on the load information of each initial partition in the first partition.
[0026] In this embodiment, the primary partition is determined based on load information, thus balancing the load of each partition.
[0027] A second aspect of this application provides a data read / write method, including:
[0028] The management node creates multiple initial distributed hash rings (DHTs). Each initial DHT includes multiple initial partitions, and each initial partition includes multiple first storage nodes. The management node merges these multiple initial DHTs to obtain a target DHT, which includes multiple first partitions, and each first partition includes multiple initial partitions. Each initial partition corresponds to a different initial DHT. The management node sends view information of the target DHT to the client. This view information is used to create logical data storage units (plogs). The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs.
[0029] In this embodiment of the application, the target DHT ring is obtained by merging multiple initial DHT rings. The initial DHT ring is a DHT ring corresponding to an Availability Zone (AZ). After merging, a single AZ plog or a multi-AZ plog can be created. That is, users in a single AZ and users in multiple AZs can share the storage node corresponding to a target DHT ring, thereby reducing the deployment cost of the storage cluster and improving the utilization efficiency of the storage node.
[0030] A third aspect of this application provides a client, including:
[0031] The receiving unit is used to receive the view information of the target DHT ring sent by the management node. The target DHT ring is obtained by the management node from merging multiple initial DHT rings. The multiple initial DHT rings are created by the management node. The initial DHT ring includes multiple initial partitions. The initial partitions include multiple first storage nodes. The view information of the target DHT ring is used to create logical data storage units (plogs). The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs.
[0032] Optionally, the receiving unit is also configured to receive a first creation request sent by the user equipment, the first creation request being used to instruct the creation of a first plog;
[0033] The client also includes:
[0034] The determining unit is used to determine, based on the first creation request and the information of the target DHT ring, to create a first plog in the first partition. The first partition includes multiple initial partitions, and each initial partition corresponds to a different initial DHT ring.
[0035] The sending unit is used to send a second creation request to the target storage node. The second creation request is used to instruct the target storage node to create a first plog. The target storage node is the storage node corresponding to the primary partition of the first partition. The primary partition of the first partition belongs to one of multiple initial partitions, and the target storage node belongs to one of multiple first storage nodes.
[0036] The receiving unit is also used to receive the metadata of the first plog sent by the target storage node. The metadata of the first plog is used to read and write the data in the storage node corresponding to the first plog.
[0037] The sending unit is also used to send metadata of the first plog to the user equipment.
[0038] Optionally, the first plog is a single AZ plog, and the multiple first storage nodes corresponding to the first plog belong to the same initial partition.
[0039] Optionally, the first plog is a multi-AZ plog, and the multiple first storage nodes corresponding to the first plog belong to at least two initial partitions.
[0040] Optionally, the metadata of the first plog includes the ID information of the first plog, which includes differentiated tag information. The differentiated tag information is used to record the information of multiple first storage nodes corresponding to the first plog.
[0041] Optionally, the differential tagging information is bitmap information.
[0042] Optionally, the client also includes:
[0043] The acquisition unit is used to acquire the AZ attributes of the first plog according to the first creation request. The AZ attributes include plogs of a single AZ and plogs of one or more AZs.
[0044] The determining unit is also used to determine the creation of the first plog in the first partition based on the information of the target DHT ring and the AZ attribute of the first plog.
[0045] Optionally, the receiving unit is further configured to receive a first read / write request sent by the user equipment, the first read / write request being used to read or write the first storage node corresponding to the first plog;
[0046] The acquisition unit is also used to acquire data in the first storage node corresponding to the first plog based on the metadata of the first plog.
[0047] Optionally, the primary partition is determined by the management node from multiple initial partitions based on a hash algorithm.
[0048] Optionally, the primary partition is determined by the management node based on the load information of each initial partition in the first partition.
[0049] The methods executed by each unit of the client provided in the third aspect of this application are similar to the methods executed by the client in the second aspect mentioned above, and will not be described in detail here.
[0050] A fourth aspect of this application provides a management server, including:
[0051] A creation unit is used to create multiple initial distributed hash rings (DHT rings). Each initial DHT ring includes multiple initial partitions, and each initial partition includes multiple first storage nodes.
[0052] The merging unit is used to merge multiple initial DHT rings to obtain a target DHT ring. The target DHT ring includes multiple first partitions, and each first partition includes multiple initial partitions. Each initial partition corresponds to a different initial DHT ring.
[0053] The sending unit is used to send view information of the target DHT ring to the client. The view information of the target DHT ring is used to create logical data storage unit plog. The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs.
[0054] The methods performed by each unit of the management server provided in the fourth aspect of this application are similar to the methods performed by the management server in the third aspect mentioned above, and will not be repeated here.
[0055] The fifth aspect of this application provides a client, including:
[0056] A processor coupled to memory, the memory storing at least one program instruction or code, the processor loading and executing the at least one program instruction or code to enable the client to implement the data read / write method of the first aspect.
[0057] The sixth aspect of this application provides a management server, including:
[0058] A processor coupled to memory, which stores at least one program instruction or code, which is loaded and executed by the processor to enable the management server to implement the second aspect of the data read / write method.
[0059] The seventh aspect of this application provides a computer storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in the first or second aspect of this application.
[0060] The eighth aspect of this application provides a computer program product that, when executed on a computer, causes the computer to perform the method as described in the first or second aspect of this application.
[0061] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0062] In this embodiment, the client receives the view information of the target DHT ring sent by the management node. This target DHT ring is obtained by merging multiple initial DHT rings, and the initial DHT ring is a DHT ring corresponding to an Availability Zone (AZ). After merging, a single AZ plog or a multi-AZ plog can be created. That is, users in a single AZ and users in multiple AZs can share the storage node corresponding to a target DHT ring, thereby reducing the deployment cost of the storage cluster and improving the utilization efficiency of the storage node. Attached Figure Description
[0063] Figure 1 A prior art data storage system architecture diagram provided for embodiments of this application;
[0064] Figure 2 A data storage system architecture diagram provided for embodiments of this application;
[0065] Figure 3 A flowchart illustrating the data read / write method provided in this application embodiment;
[0066] Figure 4 A schematic diagram of a DHT ring provided in an embodiment of this application;
[0067] Figure 5 This is another schematic diagram of the DHT ring structure provided in an embodiment of this application;
[0068] Figure 6 A schematic diagram illustrating partition merging provided in this application embodiment;
[0069] Figure 7 Another schematic diagram of partition merging provided for an embodiment of this application;
[0070] Figure 8 A schematic diagram illustrating the differentiated marking information provided in the embodiments of this application;
[0071] Figure 9 Another schematic diagram illustrating the differentiated marking information provided in the embodiments of this application;
[0072] Figure 10 Another schematic diagram illustrating the differentiated marking information provided in the embodiments of this application;
[0073] Figure 11 This is another schematic diagram of the data read / write method provided in the embodiments of this application;
[0074] Figure 12 This is another schematic diagram of the data read / write method provided in the embodiments of this application;
[0075] Figure 13 A schematic diagram of the client structure provided in the embodiments of this application;
[0076] Figure 14 This is another schematic diagram of the client structure provided in an embodiment of this application;
[0077] Figure 15 A schematic diagram of the structure of the management server provided in the embodiments of this application;
[0078] Figure 16 This is another schematic diagram of the client structure provided in an embodiment of this application;
[0079] Figure 17 This is another schematic diagram of the management server structure provided in an embodiment of this application. Detailed Implementation
[0080] This application provides a data read / write method that allows a client to create a single AZ data logical storage unit plog or a multi-AZ plog based on the received view information of the target DHT ring, thereby reducing the deployment cost of the storage cluster and improving the utilization efficiency of the storage nodes.
[0081] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0082] To facilitate understanding of the data storage system architecture provided in the embodiments of this application, this application first describes the data storage system architecture in the prior art, as detailed below.
[0083] Please see Figure 1 This is a diagram of a prior art data storage system architecture provided in the embodiments of this application.
[0084] In existing technologies, among public cloud database users, some choose highly reliable cross-availability zone (AZ) data storage, thus requiring the establishment of cross-AZ deployed storage clusters. Other users do not require cross-AZ data disaster recovery, or do not want to bear the deployment costs associated with cross-AZ deployment, therefore choosing single-AZ data storage, thus requiring the establishment of single-AZ deployed storage clusters.
[0085] like Figure 1As shown, a single-AZ application refers to the application used by a user in a single AZ, while a multi-AZ application refers to the application used by multiple users in multiple AZs. The resource pool of a single AZ belongs to the storage cluster corresponding to that single-AZ application, and the resource pool of a multi-AZ belongs to the storage cluster corresponding to multiple AZ applications. This resource pool consists of a group of storage nodes, which can be computer devices such as servers, desktop computers, laptops, etc., or other devices with storage capabilities; the specifics are not limited here.
[0086] Because a single-AZ application requires the creation of a corresponding single-AZ resource pool, while a multi-AZ application requires the creation of a multi-AZ resource pool, the deployment cost of resource pools is high. Furthermore, when the data throughput of a single-AZ resource pool is low at certain times, the single-AZ resource pool will be idle, while the data throughput of the multi-AZ resource pool is high at this time, which will result in uneven utilization of the overall resource pool and low resource utilization rate in the resource pool.
[0087] Table 1 below shows the performance of single-AZ resource pools and multi-AZ resource pools for application categories in the prior art.
[0088] Table 1 Performance of Existing Single-AZ Resource Pools and Multi-AZ Resource Pools
[0089] Capacity type cloud storage high Low 3AZ Pool Low performance type Big Data Low high Single AZ Pool high
[0090] As shown in Table 1, the resource pools of multi-AZ have low computing resource utilization, while the resource pools of single-AZ have too few computing resources.
[0091] To address the problems in the prior art, this application provides a method that can reduce the deployment cost of resource pools and improve the resource utilization rate within the resource pools. Please refer to the following description for details.
[0092] Please see Figure 2 This is an architecture diagram of the data storage system provided in the embodiments of this application.
[0093] This application embodiment achieves the ability for a single resource pool to simultaneously provide data carrying capacity for single-AZ applications and multi-AZ applications by sharing a resource pool for applications with multiple AZ attributes.
[0094] like Figure 2 As shown, a converged resource pool is a physical resource pool that can simultaneously support single-AZ applications and multi-AZ applications. This converged resource pool improves functionality to allow single-AZ applications and multi-AZ applications to share a single physical resource pool. Storage nodes are the physical storage nodes within the converged resource pool.
[0095] The storage node can be a computer device, such as a server, desktop computer, laptop computer, or other device with storage function; no specific limitation is made here.
[0096] It should be noted that in practical applications, this data storage system can include more devices. For example, it can also include user devices, which are user devices corresponding to a single AZ application or multiple AZ applications. When the storage system needs to be used, the user devices will interact with the converged resource pool to access it. The converged resource pool also includes a plog management node, which manages the physical storage nodes and plogs within the resource pool. Each plog corresponds to one or more physical storage nodes within a partition, and each physical storage node has a plog service, a software process that executes tasks such as handling read and write requests. The converged resource pool can also include plog client devices, which process information sent by the plog management node or user devices and then send specific tasks to the physical storage nodes.
[0097] Based on the above Figure 2 The data storage system architecture shown below will be described in detail below with reference to the methods in the embodiments of this application.
[0098] Please see Figure 3 This is a flowchart illustrating the data reading and writing method provided in the embodiments of this application.
[0099] In step 201, the management node creates multiple initial distributed hash rings (DHT rings).
[0100] Before creating the merged resource pool, the management node first creates multiple initial distributed hash rings (DHTs), which include multiple initial partitions, each containing multiple first storage nodes.
[0101] An initial DHT ring corresponds to a resource pool within a single Availability Zone (AZ), and the initial DHT ring serves as an intermediate layer for data routing to balanced nodes. Specifically, for example... Figure 4As shown, this physical DHT ring includes multiple initial partitions, such as pt0, pt1, and pt2. Each initial partition includes multiple first storage nodes; for example, pt2 includes three first storage nodes: node0, node1, and node2. In this single-AZ DHT ring, one plog corresponds to one or more first storage nodes in an initial partition. For example, plog1 corresponds to node0, node1, and node2, and plog2 corresponds to node3, node4, and node5 in pt3.
[0102] In one possible implementation, within an initial partition, the storage node corresponding to the primary partition receives tasks sent by the client and distributes these tasks to other backup partitions within the initial partition for execution. For example, when a plog needs to be created, the storage node corresponding to the primary partition receives a request from the client to create the plog. If this request is for creating two data replicas, the storage node corresponding to the primary partition will create one data replica locally and send the task of creating the other data replica to the storage nodes corresponding to other backup partitions for execution. In practical applications, the client can also directly send tasks to all primary and backup partitions in the initial partition; this is not a limitation here.
[0103] Specifically, when creating the initial DHT ring, the management node can calculate the information of all storage nodes in a single AZ resource pool, and determine how many initial partitions to divide the pool into, and how many storage nodes to allocate to each partition. A hash-based balanced distribution algorithm is used to ensure that the storage nodes in each initial partition of the calculated DHT ring are the same, and that the capacity and performance of each storage node are basically the same.
[0104] Each initial DHT ring has a corresponding initial DHT ring view information, which describes the mapping relationship between the management node and each storage node to each initial partition.
[0105] In step 202, the management node merges multiple initial DHT rings to obtain the target DHT ring.
[0106] After creating multiple initial DHT rings, the management node merges these multiple DHT rings to obtain a target DHT ring. The view information of the target DHT ring is used to create a plog, which includes plogs of a single AZ and plogs of multiple AZs.
[0107] Specifically, the management node merges the initial partitions in each initial DHT ring to obtain multiple target partitions, which include the first storage nodes from the initial partitions. For example... Figure 5 As shown, the management node creates three initial DHT rings: DHT rings corresponding to AZ0, AZ1, and AZ2. The management node merges these three initial DHT rings by merging the pt0 partitions in the AZ0 ring with the pt0 partitions in the AZ1 and AZ2 rings, resulting in a new pt0 partition. Similarly, the management node merges all initial partitions in the AZ0, AZ1, and AZ2 rings in the same way to obtain a target DHT ring.
[0108] More specifically, such as Figure 6 As shown, the pt0 of the DHT ring corresponding to AZ0 includes three first storage nodes, namely node0, node1, and node2; the pt0 of the DHT ring corresponding to AZ1 includes three first storage nodes, namely node3, node4, and node5; and the pt0 of the DHT ring corresponding to AZ2 includes three first storage nodes, namely node6, node7, and node8. When merging, since the first storage node at the front is the primary partition and the others are secondary partitions, there are several methods to determine the primary partition, which are described below.
[0109] The first method is to merge them sequentially.
[0110] The three first storage nodes included in pt0 of the DHT ring corresponding to AZ0 are arranged in the first part, the three first storage nodes included in pt0 of the DHT ring corresponding to AZ1 are arranged in the second part, and the three first storage nodes included in pt0 of the DHT ring corresponding to AZ3 are arranged in the third part, that is, in the order of node0, node1, node2, node3, node4, node5, node6, node7, node8, where node0 is the storage node corresponding to the primary partition.
[0111] The second method is to merge the partitions by taking the remainder of their serial numbers.
[0112] For example, when merging pt0, the partition sequence number 0 of pt0 is divided by 3, with a remainder of 0. Therefore, the three first storage nodes included in pt0 of the DHT ring corresponding to AZ0 are placed in the first part, and the remaining parts can be arranged arbitrarily. Here, the divisor of 3 indicates the number of initial partitions to be merged. If there are 4 initial partitions to be merged, then it is divided by 4. The specific division is not limited here. For example, when merging pt1, such as... Figure 7As shown, dividing the partition sequence number 1 of pt1 by 3 leaves a remainder of 2. Therefore, the three first storage nodes included in pt0 of the DHT ring corresponding to AZ1 are placed in the first part, and the remaining parts can be arranged arbitrarily. The divisor of 3 indicates the number of initial partitions to be merged. If there are 4 initial partitions to be merged, then divide by 4. The specific number is not limited here.
[0113] In practical applications, there are many other ways to determine the primary partition after merging. For example, by statistically analyzing the load or resource usage of the storage nodes of the initial partitions to be merged, the storage node corresponding to the initial partition with the low load rate can be used as the primary partition. Alternatively, a random balancing shuffling algorithm can be used to randomly select a storage node corresponding to the initial partition to be merged as the primary partition. The specific method for determining the primary partition is not limited here.
[0114] After merging to obtain the target DHT ring, the management node obtains the view information of the target DHT ring based on the target DHT ring. The view information of the target DHT ring can be used to create a target plog. The target plog can be a single AZ plog or a multi-AZ plog. The specifics are not limited here.
[0115] In step 203, the management node sends the view information of the target DHT ring to the client.
[0116] After obtaining the view information of the target DHT ring, the management node sends the view information of the target DHT ring to the client.
[0117] In one possible implementation, after the management node sends the view information of the target DHT ring to the client, it can also send the view information of the target DHT ring to all storage nodes in the target partitions of the target DHT ring. After receiving the view information of the target DHT ring, each storage node performs the next routing step based on the view information.
[0118] In one possible implementation, after the management node sends the view information of the target DHT ring to the client, the management node also sends pre-allocated plog ID information to the storage nodes corresponding to the primary partitions in all target partitions of the target DHT ring. In this way, if the target storage node receives a plog creation request later, it can directly use these plog IDs without having to apply for plog IDs from the management node again, thus saving signaling overhead.
[0119] In step 204, the user equipment sends a first creation request to the client.
[0120] When a user equipment needs to create a plog, it sends a first creation request to the client, which instructs the creation of the first plog.
[0121] When a user equipment needs to create a plog for a single Availability Zone (AZ), the first plog is the single AZ plog. When a user equipment needs to create a plog for multiple AZs, the first plog is the multi-AZ plog.
[0122] In step 205, the client determines to create the first plog in the first partition based on the first creation request and the information of the target DHT ring.
[0123] After receiving the first creation request, the client determines to create the first plog in the first partition based on the first creation request and the view information of the target DHT ring. The first partition is a partition in the target partition and includes the first storage node corresponding to multiple initial partitions. The initial DHT ring corresponding to each of the multiple initial partitions is different.
[0124] The client will use different methods to create the plog depending on whether the first creation request is used to indicate whether to create a single AZ plog or a multi-AZ plog. These methods will be described below.
[0125] 1. Create a plog for a single AZ.
[0126] Specifically, when the first creation request is used to instruct the creation of the first plog for a single AZ, the client determines the number of data replicas to be created based on the instruction information carried in the first creation request, and determines the differential marking information according to the required number of data replicas. This differential marking information is used to record the information of multiple first storage nodes corresponding to the first plog. This differential marking information can be bitmap information, where a single digit represents the data carried by a first storage node. For example, if the initial partition corresponding to the AZ0 region in the target partition has three first storage nodes, then the first three digits in the bitmap information represent the status of the data replicas of these three first storage nodes. In one possible implementation, the portion that needs to carry data is marked as 1 in the bitmap information, and the portion that does not need to carry data is marked as 0. Figure 8The bitmap information shown indicates that this first plog is a single AZ plog. The three 1s in the first part indicate that data needs to be carried in the first storage node of the initial partition corresponding to the first AZ region, while the 0s in the other parts indicate that no data needs to be carried in the first storage node of the initial partition corresponding to other AZ regions. It can be understood that if data needs to be carried in the first storage node of the initial partition corresponding to the second AZ region, then the first part of the bitmap information is marked as 0, the second part as 1, and the third part as 0.
[0127] 2. Create a plog with multiple AZs.
[0128] Specifically, when the first creation request is used to instruct the creation of the first plog for multiple Availability Zones (AZs), the client determines the number of data replicas to be created based on the instruction information carried in the first creation request, and determines the differential marking information based on the required number of data replicas. This differential marking information is used to mark the information of the multiple first storage nodes corresponding to the first plog. This differential marking information can be bitmap information, where a single digit represents the data carried by a first storage node. For example, if the initial partition corresponding to the AZ0 region in the target partition has three first storage nodes, then in the bitmap information, the first three digits represent the data that these three first storage nodes need to carry. In one possible implementation, in the bitmap information, the portion that needs to carry data is marked as 1, and the portion that does not need to carry data is marked as 0. Figure 9 The bitmap information shown indicates that this first plog is a multi-AZ plog. A single '1' in the first part indicates that data needs to be stored in the third first storage node of the initial partition corresponding to the first AZ region. A single '1' in the second part indicates that data needs to be stored in the third first storage node of the initial partition corresponding to the second AZ region. A single '1' in the third part indicates that data needs to be stored in the third first storage node of the initial partition corresponding to the third AZ region. The remaining '0's indicate that no data needs to be stored in the corresponding first storage node. Because there are three '1's in this bitmap information, it indicates that this bitmap information is used to represent a multi-AZ plog with three data replicas. When a multi-AZ application needs to create three data replicas, the management node determines to create these three data replicas in different AZ regions to ensure data reliability across multiple AZs. It can be understood that if one wants to create a multi-AZ plog with six data replicas, such as... Figure 10The bitmap information shown indicates that the two 1s in the first part represent data needs to be stored in the second and third first storage nodes of the initial partition corresponding to the first AZ region; the two 1s in the second part represent data needs to be stored in the second and third first storage nodes of the initial partition corresponding to the second AZ region; the two 1s in the third part represent data needs to be stored in the second and third first storage nodes of the initial partition corresponding to the third AZ region; and the other 0s represent no data needs to be stored in the corresponding first storage node. This application does not limit the specific method of the differential marking information, as long as the differential marking information can represent the data copy creation status of all first storage nodes in the target partition.
[0129] Understandably, in practical applications, other methods can be used to record whether the first storage node carries data. For example, a separate array can be used to record whether the first storage node of the initial partition corresponding to each AZ needs to carry data. When using an array to record whether the first storage node carries data, the data and metadata are saved together. When the array is needed, it is retrieved from the local machine.
[0130] In step 206, the client sends a second creation request to the target storage node.
[0131] After determining the differential tag information, the client generates a second creation request based on the differential tag information. The second creation request is used to instruct the target storage node to create the first plog. The target storage node is the storage node corresponding to the primary partition of the first partition. The primary partition of the first partition belongs to one of multiple initial partitions, and the target storage node belongs to one of multiple first storage nodes.
[0132] Specifically, the second creation request may include object type, differential tagging information, and data status of AZ regions. The object type indicates whether a single AZ or multiple AZs plog needs to be created and the number of data replicas to be created. The data status of the AZ regions indicates whether data replicas need to be created in each AZ region of the target partition. See Table 2 below:
[0133] Table 2 Second Creation Request Information Table
[0134] 1AZ 3 copies 111 000 000 100 1AZ 3 copies 000 111 000 010 1AZ 3 copies 000 000 111 001 3AZ 3 copies 001 001 001 111 3AZ 6 copies 011 011 011 111
[0135] In this context, "1AZ 3 replicas" indicates the creation of a plog for a single AZ, with 3 data replicas. Similarly, "3AZ 6 replicas" indicates the creation of a plog for 3 AZs, with 6 data replicas. Bitmap information can be found in the bitmap information described in the previous steps and will not be repeated here. A number of 1 in the data status of an AZ region indicates that data replicas need to be created in that AZ region of the target partition, while a number of 0 indicates that data replicas do not need to be created in that AZ region of the target partition.
[0136] In step 207, the target storage node creates the first plog.
[0137] After receiving the second creation request from the client, the target storage node obtains the ID of the first plog. This ID contains the ID information of the DHT ring and the ID information of the first partition. Specifically, the target storage node can send a retrieval message to the management node, instructing the management node to allocate a plog ID to ensure that each plog has a unique ID. In practical applications, the plog ID can also be pre-sent by the management node to the target storage node, in which case the target storage node only needs to obtain the plog ID directly from its local machine.
[0138] After obtaining the ID of the plog, the target storage node sends creation task information to other first storage nodes that need to create data replicas according to the second creation request. After receiving the creation task information, the other first storage nodes that need to create data replicas create data replicas according to the creation task information.
[0139] The second creation request is used to indicate whether to create a plog for a single AZ or a plog for multiple AZs. The target storage node will have different creation methods, which will be described below.
[0140] 1. Create a plog for a single AZ.
[0141] like Figure 11As shown, in step 1, the user equipment of a single AZ sends a first creation request to the client, which instructs the creation of a plog for that single AZ. In step 2, the client sends a second creation request to the target storage node node0. In step 3, the target storage node node0 sends creation task information to the other first storage nodes node1 and node2 corresponding to the AZ0 region according to the second creation request. Node1 and node2 create data replicas based on this creation task information. It is understood that node0, node1, and node2 are only illustrative examples. In actual applications, there may be more first storage nodes in the AZ0 region. If the second creation request instructs the creation of a plog with two data replicas, then two first storage nodes are selected in the AZ0 region to create the data replicas based on the differential tagging information. If the second creation request instructs the creation of a plog with more data replicas, then the corresponding first storage nodes are selected in the AZ0 region to create multiple data replicas based on the differential tagging information.
[0142] 2. Create a plog with multiple AZs.
[0143] like Figure 12As shown, in step 1, the user equipment of the multiple AZs sends a first creation request to the client, which instructs the creation of a plog for the multiple AZs. In step 2, the client sends a second creation request to the target storage node node0. In step 3, the target storage node node0 sends creation task information to the other first storage nodes node1, node2, node3, node4, node5, node6, node7, and node8 corresponding to the AZ0, AZ1, and AZ2 areas according to the second creation request. Nodes node1, node2, node3, node4, node5, node6, node7, and node8 create data replicas according to the creation task information. It is understandable that node1, node2, node3, node4, node5, node6, node7, and node8 are just examples. In actual applications, there may be more first storage nodes in the AZ0, AZ1, and AZ2 regions. If the second creation request indicates the creation of a plog with 3 data replicas, then the first storage nodes marked as replica creation status in the differential marking information of the AZ0, AZ1, and AZ2 regions send creation task information so that these first storage nodes marked as replica creation status can create data replicas. If the second creation request indicates the creation of a plog with more data replicas, then the corresponding first storage nodes in the AZ0, AZ1, and AZ2 regions are selected to create multiple data replicas based on the differential marking information.
[0144] After creating the first plog for a single or multiple AZs, the target storage node writes the differential tag information into the ID information of the first plog and creates the metadata of the first plog based on the ID information. In this embodiment, the differential information is directly written into the ID of the first plog, so that when it is needed later, it is not necessary to read the metadata of the first plog on disk; the ID of the first plog can be used directly to determine which first storage nodes need to be read and written.
[0145] In step 208, the target storage node sends the metadata of the first plog to the client.
[0146] After creating the metadata for the first plog, the target storage node sends the metadata for the first plog to the client.
[0147] In step 209, the client sends the metadata of the first plog to the user equipment.
[0148] After receiving the metadata of the first plog, the client saves the metadata locally and then sends the metadata of the first plog to the user equipment. The user equipment, after receiving the metadata of the first plog, also saves the metadata of the first plog locally.
[0149] In step 210, the user equipment sends a first read / write request to the client.
[0150] When a user equipment needs to read or write data in the first plog, it sends a first read / write request to the client based on the metadata of the first plog stored locally. This first read / write request is used to request to read or write data in one or more first storage nodes corresponding to the first plog.
[0151] In step 211, the client reads data from multiple first storage nodes corresponding to the first plog based on the metadata of the first plog.
[0152] After receiving the first read / write request, the client sends a read / write task to the corresponding first storage node based on the first read / write request and the metadata of the first plog. After receiving the read / write task, the corresponding first storage node performs data read / write based on the plog service in the first storage node.
[0153] When the first read / write request is for reading or writing data corresponding to the plog of a single AZ, such as Figure 11 As shown, in step 4, the user equipment in a single AZ sends a first read / write request to the client. In step 5, after receiving the first read / write request, if the ID information of the first plog shows that the three first storage nodes node0, node1, and node2 in the AZ0 area are marked as 1, it indicates that the three first storage nodes node0, node1, and node2 in the AZ0 area store data copies corresponding to the first plog. Then, the client sends read / write tasks to the three first storage nodes node0, node1, and node2 that store the data copies. After receiving the read / write tasks, the three first storage nodes node0, node1, and node2 read / write the local data copies according to their respective plog services and return the read / write results to the client. After receiving the read / write results, the client sends the read / write results to the user equipment.
[0154] When the first read / write request is for reading or writing data corresponding to the plog of multiple Availability Zones, such as Figure 12As shown, in step 4, the user equipment in multiple AZs sends a first read / write request to the client. In step 5, after receiving the first read / write request, if the ID information of the first plog is marked as 1 for the first storage nodes node0, node1, node2, node3, node4, node5, node6, node7, and node8 in AZ0, AZ1, and AZ2 respectively, it indicates that the first storage nodes node0, node1, node2, node3, node4, node5, node6, node7, and node8 in AZ0, AZ1, and AZ2 respectively store data copies corresponding to the first plog. The client then sends the first read / write request to the AZ containing the data copies. The first storage nodes node0, node1, node2, node3, node4, node5, node6, node7, and node8 in AZ0, AZ1, and AZ2 send read / write tasks. After receiving the read / write task, the first storage nodes node0, node1, node2, node3, node4, node5, node6, node7, and node8 in AZ0, AZ1, and AZ2 respectively read and write the local data replicas according to their respective plog services and return the read / write results to the client. After receiving the read / write results, the client sends the read / write results to the user device.
[0155] In this embodiment, the client can create a single-AZ plog or a multi-AZ plog based on the view information of the target DHT ring. This eliminates the need to create separate resource pools for single-AZ and multi-AZ applications, reducing the deployment cost of the storage cluster and improving the utilization efficiency of storage nodes. Furthermore, by writing differentiated tagging information into the plog's ID, the client can read and write data using only the plog's ID without accessing excessive information, thus improving data read and write efficiency.
[0156] The data read / write methods in the embodiments of this application have been described above. The client and management server in the embodiments of this application are described below.
[0157] Please see Figure 13 This is a schematic diagram of the client provided in this application.
[0158] A client includes:
[0159] The receiving unit 1301 is used to receive the view information of the target DHT ring sent by the management node. The target DHT ring is obtained by the management node from merging multiple initial DHT rings. The multiple initial DHT rings are created by the management node. The initial DHT ring includes multiple initial partitions. The initial partitions include multiple first storage nodes. The view information of the target DHT ring is used to create a logical data storage unit plog. The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs.
[0160] In this embodiment, the operations performed by each unit of the client are the same as those described above. Figure 5 The steps performed by the client in the illustrated embodiment are similar, and will not be repeated here.
[0161] Please see Figure 14 This is another structural diagram of the client provided in this application.
[0162] A client, characterized in that it includes:
[0163] The receiving unit 1401 is used to receive the view information of the target DHT ring sent by the management node. The target DHT ring is obtained by the management node based on the merging of multiple initial DHT rings. The multiple initial DHT rings are created by the management node. The initial DHT ring includes multiple initial partitions. The initial partitions include multiple first storage nodes. The view information of the target DHT ring is used to create a logical data storage unit plog. The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs.
[0164] Optionally, the receiving unit 1401 is further configured to receive a first creation request sent by the user equipment, the first creation request being used to instruct the creation of a first plog;
[0165] The client also includes:
[0166] The determining unit 1402 is used to determine, based on the first creation request and the information of the target DHT ring, to create a first plog in the first partition. The first partition includes multiple initial partitions, and each initial partition corresponds to a different initial DHT ring.
[0167] Sending unit 1403 is used to send a second creation request to the target storage node. The second creation request is used to instruct the target storage node to create a first plog. The target storage node is the storage node corresponding to the primary partition of the first partition. The primary partition of the first partition belongs to one of multiple initial partitions. The target storage node belongs to one of multiple first storage nodes.
[0168] The receiving unit 1401 is also used to receive metadata of the first plog sent by the target storage node, and the metadata of the first plog is used to read and write data in the storage node corresponding to the first plog;
[0169] The sending unit 1403 is also used to send metadata of the first plog to the user equipment.
[0170] Optionally, the first plog is a single AZ plog, and the multiple first storage nodes corresponding to the first plog belong to the same initial partition.
[0171] Optionally, the first plog is a multi-AZ plog, and the multiple first storage nodes corresponding to the first plog belong to at least two initial partitions.
[0172] Optionally, the metadata of the first plog includes the ID information of the first plog, which includes differentiated tag information. The differentiated tag information is used to record the information of multiple first storage nodes corresponding to the first plog.
[0173] Optionally, the differential tagging information is bitmap information.
[0174] Optionally, the client also includes:
[0175] The acquisition unit 1404 is used to acquire the AZ attribute of the first plog according to the first creation request. The AZ attribute includes the plog of a single AZ and the plog of one or more AZs.
[0176] The determining unit 1402 is also used to determine the creation of the first plog in the first partition based on the information of the target DHT ring and the AZ attribute of the first plog.
[0177] Optionally, the receiving unit 1401 is further configured to receive a first read / write request sent by the user equipment, the first read / write request being used to read and write the first storage node corresponding to the first plog;
[0178] The acquisition unit 1404 is also used to acquire data in the first storage node corresponding to the first plog based on the metadata of the first plog.
[0179] Optionally, the primary partition is determined by the management node from multiple initial partitions based on a hash algorithm.
[0180] Optionally, the primary partition is determined by the management node based on the load information of each initial partition in the first partition.
[0181] In this embodiment, the operations performed by each unit of the client are the same as those described above. Figure 5 The steps performed by the client in the illustrated embodiment are similar, and will not be repeated here.
[0182] Please see Figure 15 This is a schematic diagram of the structure of the management server provided in this application.
[0183] A management server, comprising:
[0184] Create unit 1501, which is used to create multiple initial distributed hash rings (DHT rings). Each initial DHT ring includes multiple initial partitions, and each initial partition includes multiple first storage nodes.
[0185] Merging unit 1502 is used to merge multiple initial DHT rings to obtain a target DHT ring. The target DHT ring includes multiple first partitions, and each first partition includes multiple initial partitions. Each initial partition corresponds to a different initial DHT ring.
[0186] The sending unit 1503 is used to send view information of the target DHT ring to the client. The view information of the target DHT ring is used to create a logical data storage unit plog. The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs.
[0187] In this embodiment, the operations performed by each unit of the management server are the same as those described above. Figure 5 The steps performed by the management node in the illustrated embodiment are similar, and will not be described in detail here.
[0188] Please see Figure 16 This is another schematic diagram of the client structure provided in the embodiments of this application.
[0189] The system includes a processor 1601, a memory 1602, a bus 1605, and an interface 1604. The processor 1601 is connected to the memory 1602 and the interface 1604. The bus 1605 connects the processor 1601, the memory 1602, and the interface 1604. The interface 1604 is used to receive or send data. The processor 1601 is a single-core or multi-core central processing unit, a specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention. The memory 1602 can be random access memory (RAM) or non-volatile memory, such as at least one hard disk drive. The memory 1602 is used to store computer-executable instructions. Specifically, the computer-executable instructions may include a program 1603.
[0190] In this embodiment, when the processor 1601 calls program 1603, it can enable... Figure 16 The client in the middle executes the aforementioned Figure 5 The specific operations performed by the client in the illustrated embodiment will not be described in detail here.
[0191] Please see Figure 17 This is another structural diagram of the management server provided in an embodiment of this application.
[0192] The system includes a processor 1701, a memory 1702, a bus 1705, and an interface 1704. The processor 1701 is connected to the memory 1702 and the interface 1704. The bus 1705 connects the processor 1701, the memory 1702, and the interface 1704. The interface 1704 is used to receive or send data. The processor 1701 is a single-core or multi-core central processing unit, a specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention. The memory 1702 can be random access memory (RAM) or non-volatile memory, such as at least one hard disk drive. The memory 1702 is used to store computer-executable instructions. Specifically, the computer-executable instructions may include a program 1703.
[0193] In this embodiment, when the processor 1701 calls program 1703, it can enable... Figure 17 The management server in the middle performs the aforementioned Figure 5 The specific operations performed by the management node in the illustrated embodiment will not be described in detail here.
[0194] It should be understood that the processor mentioned in the client or management server in the above embodiments of this application, or the processor provided in the above embodiments of this application, may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0195] It should also be understood that the number of processors in the client or management server in the above embodiments of this application can be one or more, and can be adjusted according to the actual application scenario. This is merely an illustrative example and is not intended to limit the scope. Similarly, the number of memories in the embodiments of this application can be one or more, and can be adjusted according to the actual application scenario. This is merely an illustrative example and is not intended to limit the scope.
[0196] It should also be noted that when the client or management server includes a processor (or processing unit) and memory, the processor in this application may be integrated with the memory, or the processor and memory may be connected through an interface. This can be adjusted according to the actual application scenario and is not limited.
[0197] This application provides a chip system including a processor for supporting a client or management server in implementing the functions of the controller involved in the above-described methods, such as processing data and / or information involved in the above-described methods. In one possible design, the chip system also includes a memory for storing necessary program instructions and data. This chip system can be composed of chips or may include chips and other discrete devices.
[0198] In another possible design, when the chip system is a chip within user equipment or an access network, the chip includes a processing unit and a communication unit. The processing unit may be, for example, a processor, and the communication unit may be, for example, an input / output interface, pins, or circuitry. The processing unit can execute computer-executable instructions stored in a storage unit to cause the chip within the client or management server to perform the aforementioned operations. Figure 5 The steps performed by the client or management server in the embodiment. Optionally, the storage unit is an in-chip storage unit, such as a register, cache, etc. The storage unit can also be an external storage unit located in the client or management server, such as read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), etc.
[0199] This application also provides a computer-readable storage medium storing a computer program thereon. When executed by a computer, the computer program implements the method flow executed by the controller of the client or management server in any of the above method embodiments. Correspondingly, the computer can be the aforementioned client or management server.
[0200] It should be understood that the controller or processor mentioned in the above embodiments of this application may be a central processing unit (CPU), or one or more combinations of other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0201] It should also be understood that the number of processors or controllers in the client, management server, or chip system in the above embodiments of this application can be one or more, and can be adjusted according to the actual application scenario. This is merely an illustrative example and is not intended to limit the scope. Similarly, the number of memories in the embodiments of this application can be one or more, and can be adjusted according to the actual application scenario. This is merely an illustrative example and is not intended to limit the scope.
[0202] It should also be understood that the memory or readable storage medium mentioned in the client or management server embodiments above in this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM).
[0203] Those skilled in the art will understand that the steps implemented by the client, management server, or processor in all or part of the above embodiments can be accomplished by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, random access memory, etc. Specifically, for example, the processing unit or processor can be a central processing unit, a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0204] When implemented using software, the method steps described in the above embodiments can be implemented, in whole or in part, in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium, etc.
[0205] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0206] The terminology used in the embodiments of this application is for the purpose of describing specific embodiments only and is not intended to limit the invention. The singular forms "a," "the," and "the" used in the embodiments of this application are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that in the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship; for example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural.
[0207] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrase “if determination” or “if detection (of the condition or event of the statement)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the condition or event of the statement)” or “in response to detection (of the condition or event of the statement).”
[0208] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A data read / write method, characterized in that, include: The client receives view information of a target distributed hash ring sent by the management node. The target distributed hash ring is obtained by the management node by merging multiple initial distributed hash rings. The multiple initial distributed hash rings are created by the management node. Each initial distributed hash ring includes multiple initial partitions. Each initial partition includes multiple first storage nodes. The view information of the target distributed hash ring is used to create a logical data storage unit plog. The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs. The client receives a first creation request sent by the user equipment, the first creation request being used to instruct the creation of a first plog; The client obtains the AZ attribute of the first plog according to the first creation request, and the AZ attribute includes the plog of a single AZ and the plog of one or more AZs; The client determines to create the first plog in the first partition based on the view information of the target distributed hash ring and the AZ attribute of the first plog. The first partition includes multiple initial partitions, and the initial distributed hash ring corresponding to each of the multiple initial partitions is different. The client sends a second creation request to the target storage node, which instructs the target storage node to create the first plog. The target storage node is the storage node corresponding to the primary partition of the first partition. The primary partition of the first partition belongs to one of the plurality of initial partitions, and the target storage node belongs to one of the plurality of first storage nodes.
2. The method according to claim 1, characterized in that, The method further includes: The client receives metadata of the first plog sent by the target storage node. The metadata of the first plog is used to read and write data in the storage node corresponding to the first plog. The client sends the metadata of the first plog to the user equipment.
3. The method according to claim 2, characterized in that, The first plog is a single AZ plog, and the multiple first storage nodes corresponding to the first plog belong to the same initial partition.
4. The method according to claim 2, characterized in that, The first plog is a multi-AZ plog, and the multiple first storage nodes corresponding to the first plog belong to at least two initial partitions.
5. The method according to any one of claims 1 to 4, characterized in that, The metadata of the first plog includes the ID information of the first plog, and the ID information of the first plog includes differential tag information, which is used to record information of multiple first storage nodes corresponding to the first plog.
6. The method according to claim 5, characterized in that, The differentiated marker information is bitmap information.
7. The method according to any one of claims 2 to 6, characterized in that, The method further includes: The client receives a first read / write request sent by the user equipment, the first read / write request being used to read and write the first storage node corresponding to the first plog; The client obtains the data in the first storage node corresponding to the first plog based on the metadata of the first plog.
8. The method according to any one of claims 1 to 7, characterized in that, The primary partition is determined by the management node from multiple initial partitions using a hash algorithm.
9. The method according to any one of claims 1 to 6, characterized in that, The primary partition is determined by the management node based on the load information of each initial partition in the first partition.
10. A data read / write method, characterized in that, include: The management node creates multiple initial distributed hash rings, each initial distributed hash ring comprising multiple initial partitions, each initial partition comprising multiple first storage nodes; The management node merges the multiple initial distributed hash rings to obtain a target distributed hash ring. The target distributed hash ring includes multiple first partitions, and each of the multiple initial partitions includes multiple initial partitions. The initial distributed hash ring corresponding to each of the multiple initial partitions is different. The management node sends the view information of the target distributed hash ring to the client. The view information of the target distributed hash ring is used to create a logical data storage unit plog. The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs. The client is used to receive a first creation request sent by the user equipment, the first creation request being used to instruct the creation of a first plog; The AZ attribute of the first plog is obtained according to the first creation request. The AZ attribute includes a plog with a single AZ and a plog with multiple AZs. The first plog is created in the first partition according to the view information of the target distributed hash ring and the AZ attribute of the first plog. The first partition includes multiple initial partitions. The initial distributed hash ring corresponding to each of the multiple initial partitions is different. A second creation request is sent to the target storage node, which instructs the target storage node to create the first plog. The target storage node is the storage node corresponding to the primary partition of the first partition. The primary partition of the first partition belongs to one of the plurality of initial partitions, and the target storage node belongs to one of the plurality of first storage nodes.
11. A client, characterized in that, include: The receiving unit is used to receive view information of a target distributed hash ring sent by the management node. The target distributed hash ring is obtained by the management node from merging multiple initial distributed hash rings. The multiple initial distributed hash rings are created by the management node. Each initial distributed hash ring includes multiple initial partitions. Each initial partition includes multiple first storage nodes. The view information of the target distributed hash ring is used to create a logical data storage unit plog. The target plog includes the plog of a single availability zone (AZ) and the plog of one or more AZs. The receiving unit is further configured to receive a first creation request sent by the user equipment, the first creation request being used to instruct the creation of a first plog; The acquisition unit is configured to acquire the AZ attribute of the first plog according to the first creation request, wherein the AZ attribute includes the plog of a single AZ and the plog of one or more AZs; The determining unit is configured to determine, based on the view information of the target distributed hash ring and the AZ attribute of the first plog, to create the first plog in the first partition, wherein the first partition includes multiple initial partitions, and the initial distributed hash ring corresponding to each of the multiple initial partitions is different; The sending unit is used to send a second creation request to the target storage node. The second creation request is used to instruct the target storage node to create the first plog. The target storage node is the storage node corresponding to the primary partition of the first partition. The primary partition of the first partition belongs to one of the plurality of initial partitions. The target storage node belongs to one of the plurality of first storage nodes.
12. The client according to claim 11, characterized in that, The receiving unit is further configured to receive metadata of the first plog sent by the target storage node, wherein the metadata of the first plog is used to read and write data in the storage node corresponding to the first plog; The sending unit is also used to send the metadata of the first plog to the user equipment.
13. The client according to claim 12, characterized in that, The first plog is a single AZ plog, and the multiple first storage nodes corresponding to the first plog belong to the same initial partition.
14. The client according to claim 12, characterized in that, The first plog is a multi-AZ plog, and the multiple first storage nodes corresponding to the first plog belong to at least two initial partitions.
15. The client according to any one of claims 11 to 14, characterized in that, The metadata of the first plog includes the ID information of the first plog, and the ID information of the first plog includes differential tag information, which is used to record information of multiple first storage nodes corresponding to the first plog.
16. The client according to claim 15, characterized in that, The differentiated marker information is bitmap information.
17. The client according to any one of claims 12 to 16, characterized in that, The receiving unit is further configured to receive a first read / write request sent by the user equipment, wherein the first read / write request is used to read and write the first storage node corresponding to the first plog; The acquisition unit is further configured to acquire data in the first storage node corresponding to the first plog based on the metadata of the first plog.
18. The client according to any one of claims 11 to 17, characterized in that, The primary partition is determined by the management node from multiple initial partitions using a hash algorithm.
19. The client according to any one of claims 11 to 16, characterized in that, The primary partition is determined by the management node based on the load information of each initial partition in the first partition.
20. A management server, characterized in that, include: A creation unit is used to create multiple initial distributed hash rings, each initial distributed hash ring including multiple initial partitions, each initial partition including multiple first storage nodes; A merging unit is used to merge the multiple initial distributed hash rings to obtain a target distributed hash ring. The target distributed hash ring includes multiple first partitions, and each of the multiple initial partitions includes multiple initial partitions. The initial distributed hash ring corresponding to each of the multiple initial partitions is different. The sending unit is used to send view information of the target distributed hash ring to the client. The view information of the target distributed hash ring is used to create a logical data storage unit plog. The target plog includes a plog of a single availability zone (AZ) and plogs of one or more AZs. The client is used to receive a first creation request sent by the user equipment. The first creation request is used to instruct the creation of a first plog. The AZ attribute of the first plog is obtained according to the first creation request. The AZ attribute includes a plog with a single AZ and a plog with multiple AZs. The first plog is created in the first partition according to the view information of the target distributed hash ring and the AZ attribute of the first plog. The first partition includes multiple initial partitions. The initial distributed hash ring corresponding to each of the multiple initial partitions is different. A second creation request is sent to the target storage node, which instructs the target storage node to create the first plog. The target storage node is the storage node corresponding to the primary partition of the first partition. The primary partition of the first partition belongs to one of the plurality of initial partitions, and the target storage node belongs to one of the plurality of first storage nodes.
21. A client, characterized in that, The client includes: A processor coupled to a memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the client to implement the data read / write method according to any one of claims 1-9.
22. A management server, characterized in that, include: A processor coupled to a memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the management server to implement the data read / write method of claim 10.
23. A readable storage medium for storing instructions that, when executed, cause the method of any one of claims 1-10 to be implemented.
Citation Information
Patent Citations
Processing method, proxy processing agent, system and method for filling a routing table of a DHT client node, router and DHT client node
CN103081445A
Capture and association of measurement data
CN105378700A