Data distribution method and device

By evenly distributing copies of fragmented data to the storage units of heterogeneous servers in the storage system, and using consistent hashing and minimum cost maximum flow algorithms for distribution, the load imbalance caused by differences in storage capacity of heterogeneous servers is solved. problems, improving the overall performance and fault tolerance of the system.

CN118626006APending Publication Date: 2024-09-10XINGIN INFORMATION TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410672000.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing data allocation methods cannot effectively perform adaptive allocation according to the storage capacity of heterogeneous servers, resulting in unbalanced load on the storage system.

Method used

By evenly distributing the shard copy data of multiple shard data in multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block, allocate them according to the storage capacity of the heterogeneous servers, and use consistent hash processing. And the minimum cost maximum flow algorithm determines the distribution method of shard copy data to ensure that the shard copy data is evenly distributed on the storage unit.

Benefits of technology

It improves the overall load balancing level of the storage system, ensures the stability of data distribution and read and write performance, and enhances fault tolerance and fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626006A
    Figure CN118626006A
Patent Text Reader

Abstract

The invention provides a data distribution method and device, and the method comprises the steps: obtaining N pieces of fragmented data corresponding to service data, determining M disaster recovery blocks based on the N pieces of fragmented data, and each disaster recovery block of the M disaster recovery blocks comprises N pieces of fragmented copy data corresponding to the N pieces of fragmented data; determining an allocation mode of the fragmented copy data of each disaster recovery block according to the nth power sum value of the quantity of the fragmented copy data allocated by the plurality of storage units of the plurality of heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks; and according to the distribution mode of the fragment copy data of each disaster recovery block, distributing the fragment copy data of each disaster recovery block to a plurality of storage units of a plurality of heterogeneous servers corresponding to each disaster recovery block. In this way, servers of heterogeneous models can be identified, and the overall load balancing level of the storage system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a data allocation method and device. Background Art

[0002] At present, as the amount of business data undertaken by the storage system increases, the size of the corresponding cluster of the storage system is also growing. However, for scenarios that require rapid expansion such as supporting data growth and sudden traffic, there may be homogeneous servers that cannot be supplied in time, and heterogeneous servers with different storage capacities need to be used instead. However, the existing allocation method is for heterogeneous servers, and it is impossible to adaptively allocate storage capacities corresponding to heterogeneous servers, which results in unbalanced overall cluster load when expanding capacity through heterogeneous servers. Summary of the invention

[0003] The present application provides a data distribution method and device, which evenly distributes shard copy data corresponding to multiple shard data in multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block, so that adaptive distribution can be performed according to the storage capacity corresponding to the servers of heterogeneous models, thereby improving the overall load balancing level of the storage system.

[0004] In a first aspect, the present application provides a data allocation method, the method comprising:

[0005] Get N shard data corresponding to the service data, where N is an integer greater than 1;

[0006] Determine M disaster recovery blocks based on the N shard data, each of the M disaster recovery blocks includes N shard replica data corresponding to the N shard data, where M is an integer greater than 1;

[0007] Determine the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks;

[0008] According to the distribution method of the shard copy data of each disaster recovery block, the shard copy data of each disaster recovery block is distributed to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block, where n is an integer greater than 1.

[0009] It can be seen that in the present application, N sharded data are obtained by sharding the service data, and the distribution method of the sharded copy data of each disaster recovery block is determined according to the nth power and value of the number of sharded copy data allocated to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the sharded copy data of each disaster recovery block is distributed to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block. The server in this embodiment includes servers of heterogeneous models, and the capacities corresponding to the servers of heterogeneous models are different. Therefore, the average distribution of shards is not for the server, but for the different numbers of storage units corresponding to the server. The present application determines the distribution method of the sharded copy data of each disaster recovery block according to the nth power and value of the number of sharded copy data allocated to each storage unit, which can achieve the average sharding of the sharded copy data on the storage unit. In summary, the above method can improve the overall load balancing level of the storage system.

[0010] In a feasible example, before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method also includes: determining the capacity of each storage unit in the multiple storage units; determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, including: determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks and the capacity of each storage unit in the multiple storage units.

[0011] In the present application, by determining the capacity of each storage unit and allocating the shard copy data according to the capacity of each storage unit, it is ensured that the shard copy data allocated to each storage unit will not be unable to be actually used due to not meeting the capacity size of each storage unit, thereby improving the stability of data allocation.

[0012] In a feasible example, before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method also includes: determining the rotation speed of each storage unit in the multiple storage units; generating an allocation fee for each storage unit according to the rotation speed of each storage unit in the multiple storage units, the higher the rotation speed of each storage unit, the lower the allocation fee of each storage unit; determining the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, including: determining the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the product of the number of shard copy data allocated to each storage unit in the multiple storage units and the allocation fee of each storage unit.

[0013] In the present application, by setting the allocation fee of the rotation speed of each storage unit, the allocation method of the shard copy data of each disaster recovery block is determined according to the allocation fee of each storage unit combined with the number of shard copy data allocated to each storage unit. In this way, on the basis of preferentially allocating the shard copy data to the storage units with high rotation speed, it is possible to ensure that the distribution of the shard copy data on each storage unit is more uniform, thereby improving the overall load balancing level of the storage system.

[0014] In a feasible example, m target disaster recovery blocks among M disaster recovery blocks are determined; according to the nth power and value of the distribution quantity of N primary shard copy data in multiple storage units of multiple heterogeneous servers of the m target disaster recovery blocks, in each of the m target disaster recovery blocks, N shard copy data are set with part of the primary shard copy data and part of the secondary shard copy data, the primary shard copy data is readable and writable data, and the secondary copy data is read-only data, the primary shard copy data in the m target disaster recovery blocks are different from each other, and the N primary shard copy data correspond to a group of N shard data.

[0015] In the present application, in the present application, the primary shard copy data selected from the m target disaster recovery blocks satisfies the requirement that the sum of the nth power of the second allocation quantity of at least one storage unit of the heterogeneous server corresponding to the target disaster recovery block is minimized, so that the primary shard copy data can be evenly distributed on all storage units of the server corresponding to the target disaster recovery block, thereby improving the load balancing level of the storage system.

[0016] In a feasible example, before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method also includes: determining m target disaster recovery blocks in the M disaster recovery blocks; setting part of the primary shard copy data and part of the secondary shard copy data in each target disaster recovery block in the m target disaster recovery blocks, the primary shard copy data is readable and writable data, and the secondary allocated copy data is read-only data, the primary shard copy data in the m target disaster recovery blocks are different from each other, and the N primary shard copy data correspond to a group of N shard data; according to each disaster recovery block in the M disaster recovery blocks The method of allocating shard copy data of each disaster recovery block is determined based on the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block, including: determining the method of allocating shard copy data of each disaster recovery block according to the nth power sum of the first allocation number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in M ​​disaster recovery blocks, wherein the first allocation number of shard copy data allocated to each storage unit in the multiple storage units is the sum of the number of primary shard copy data allocated to each storage unit multiplied by a first preset weight and the number of secondary shard copy data multiplied by a second preset weight, and the first preset weight is different from the second preset weight.

[0017] In the present application, by setting different preset weights for calculating the first allocation quantity for the primary shard copy data and the secondary shard copy data through the above method, when allocating the shard copy data, it can be ensured that the primary shard copy data is evenly distributed on at least one storage unit in the server corresponding to the target disaster recovery block, and it can also be ensured that the shard copy data is evenly distributed on at least one storage unit in the server corresponding to the entire disaster recovery block, thereby improving the load balancing level of the storage system.

[0018] In a feasible example, M disaster recovery blocks correspond to M server sets, each of the M server sets includes multiple heterogeneous servers, and determining m target disaster recovery blocks in the M disaster recovery blocks includes: determining m target server sets in the M server sets, the m target server sets can perform shard copy data migration between each other; determining m target disaster recovery blocks in the M disaster recovery blocks corresponding to the m target server sets.

[0019] In the present application, m target disaster recovery blocks corresponding to m target server sets that can perform shard copy data migration with each other are determined, so that after allocation, service migration can be facilitated in the event of a failure, thereby improving the fault tolerance of the storage system.

[0020] In a feasible example, before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method also includes: determining the rotation speed of each storage unit in the multiple storage units; generating an allocation fee for each storage unit according to the rotation speed of each storage unit in the multiple storage units, the higher the rotation speed of each storage unit, the lower the allocation fee of each storage unit, wherein the allocation fee of each storage unit includes a first allocation fee and a second allocation fee, and the first allocation fee is lower than the second allocation fee; according to the rotation speed of each storage unit in the M disaster recovery blocks, The method of allocating shard copy data of each disaster recovery block is determined based on the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block, including: determining the method of allocating shard copy data of each disaster recovery block based on the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the product of the number of primary shard copy data allocated to each storage unit in the multiple storage units and the first allocation fee of each storage unit, and the product of the number of secondary shard copy data allocated to each storage unit in the multiple storage units and the second allocation fee of each storage unit.

[0021] In the present application, by setting the first allocation fee of allocating the primary shard copy data to the storage unit with a high rotation speed lower than the second allocation fee of allocating the secondary copy data to the storage unit with a high rotation speed, the primary shard copy data can be preferentially allocated to the storage unit with a high rotation speed, thereby improving the overall read and write performance of the storage system.

[0022] In a feasible example, the N shard data are obtained by performing consistent hashing on the service data.

[0023] In this application, since consistent hashing has the characteristics of dynamic scalability, for example, when adding or deleting nodes, the consistent hashing algorithm only needs to remap the small amount of data affected, which greatly saves the cost of data movement. Data partitioning through consistent hashing is more suitable for rapid expansion scenarios.

[0024] In a second aspect, the present application provides a data distribution device, the device comprising:

[0025] An acquisition unit, used to acquire N pieces of data corresponding to the service data, where N is an integer greater than 1;

[0026] A determination unit, configured to determine M disaster recovery blocks based on the N shard data, each of the M disaster recovery blocks including N shard replica data corresponding to the N shard data, where M is an integer greater than 1;

[0027] The determination unit is further used to determine the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, where n is an integer greater than 1;

[0028] The processing unit is used to distribute the shard copy data of each disaster recovery block to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block according to the distribution method of the shard copy data of each disaster recovery block.

[0029] In a third aspect, the present application provides an electronic device comprising a processor, a memory, and a communication interface. The processor, the memory, and the communication interface are interconnected and perform communication with each other. The memory stores executable program code, the communication interface is used for wireless communication, and the processor is used to call the executable program code stored in the memory to execute, for example, some or all of the steps described in any method of the first aspect.

[0030] In a fourth aspect, the present application provides a computer-readable storage medium, in which electronic data is stored. When the electronic data is executed by a processor, it is used to execute the electronic data to implement some or all of the steps described in the first aspect of the present application.

[0031] In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the present application. The computer program product may be a software installation package. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0033] Figure 1 A schematic diagram of the structure of a storage system provided in an embodiment of the present application;

[0034] Figure 2 A flowchart of a data distribution method provided in an embodiment of the present application;

[0035] Figure 3 A schematic diagram of the structure of a storage cluster provided in an embodiment of the present application;

[0036] Figure 4A schematic diagram of the structure of a data allocation model provided in an embodiment of the present application;

[0037] Figure 5 A block diagram of the functional units of a data distribution device provided in an embodiment of the present application;

[0038] Figure 6 A block diagram of the functional units of another data distribution device provided in an embodiment of the present application;

[0039] Figure 7 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps is not limited to the listed steps, but optionally includes steps that are not listed, or optionally includes other steps inherent to these processes, methods, products or devices.

[0042] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0043] See also Figure 1 , Figure 1 A schematic diagram of a storage system provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the storage system 100 includes a plurality of servers 101, wherein each of the plurality of servers 101 includes at least one storage unit.

[0044] There are heterogeneous servers with different numbers of storage units among the multiple servers 101. For example, among the multiple servers 101, there may be a first server including one storage unit and a second server including three storage units. The multiple servers 101 may be divided into multiple server sets.

[0045] The present application divides the service data to be allocated to obtain N shard data, and determines M disaster recovery blocks based on the N shard data, and each of the M disaster recovery blocks includes N shard copy data corresponding to the N shard data, and determines the allocation method of the shard copy data of each disaster recovery block according to the n-th power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and according to the allocation method of the shard copy data of each disaster recovery block, allocates the shard copy data of each disaster recovery block to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block. The server in this embodiment includes servers of heterogeneous models, and the corresponding capacities of the servers of heterogeneous models are different. Therefore, the average allocation of shards is not for the server, but for the different number of storage units corresponding to the server. The present application determines the allocation method of the shard copy data of each disaster recovery block according to the n-th power and value of the number of shard copy data allocated to each storage unit, which can achieve average sharding of the shard copy data on the storage unit. In summary, the above method can improve the overall load balancing level of the storage system.

[0046] Based on this, an embodiment of the present application provides a data allocation method, and the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.

[0047] See also Figure 2 , Figure 2 A flow chart of a data allocation method provided in an embodiment of the present application is provided, and the method is applied to the above storage system, such as Figure 2 As shown, the method comprises the following steps:

[0048] Step S201, obtaining N pieces of data corresponding to the service data.

[0049] Among them, N shard data is obtained by partitioning the service data, and N is an integer greater than 1. Data partitioning can be performed by hash sharding algorithm, range sharding algorithm or other data partitioning algorithms. The specific sharding strategy needs to be determined according to the actual storage products, service objects and their reading and writing habits.

[0050] For example, if there are three storage nodes, and there is a data set containing multiple user records, each of which has a unique identifier. If it is necessary to evenly distribute these user data to the three nodes, hash sharding can be performed based on the identifier of the user data. Specifically, for each user data, the hash value of its identifier needs to be calculated. At this time, a hash function hash(identifier)%3 can be selected. The function maps the identifier of the user data to three integers 0, 1, and 2, which correspond to three storage nodes respectively. Based on this, each user data can be assigned to the corresponding node according to the hash value of the identifier corresponding to it. Hash sharding can evenly distribute data on the three nodes, and perform request routing based on the hash value in read and write operations. Since the data is evenly distributed, the read and write requests can also be evenly distributed to each node, thereby achieving load balancing.

[0051] If there is a data set containing user orders, each order has a unique order number, and the order number range is 1 to 10000. If you need to store these order data in three storage nodes in a certain order, you can shard the order data based on the order number. For example, you can divide the order number range from 1 to 10000 into three equal ranges: 1-3333, 3334-6666, and 6667-10000, which correspond to three storage nodes respectively, and allocate the order data to the corresponding storage node according to the range of the order number.

[0052] In a feasible embodiment, the N shard data are obtained by performing consistent hashing on the service data.

[0053] Among them, consistent hashing refers to data partitioning through a consistent hashing sharding algorithm. Consistent hashing sharding is a special hashing sharding technology that maps data to a continuous ring. Each position on the ring corresponds to a node. The data is determined by calculating the hash value and finding the nearest node clockwise on the ring to determine the node to be stored. In this way, when adding or deleting nodes, it usually only affects a small amount of data movement. Therefore, the consistent hashing sharding algorithm can not only achieve uniform distribution of data, but also has the characteristics of dynamic scalability. This consistent hashing sharding algorithm is more suitable for rapid expansion scenarios.

[0054] Step S202, determining M disaster recovery blocks based on N shard data.

[0055] Each of the M disaster recovery blocks includes N shard copy data corresponding to the N shard data, and M is an integer greater than 1. Determining the M disaster recovery blocks based on the N shard data can be to copy the N shard data into M copies, thereby obtaining M disaster recovery blocks. Each of the M disaster recovery blocks corresponds to a server set, and the server set includes multiple heterogeneous servers. Disaster recovery such as data disaster recovery can be achieved between the M server sets. The multiple servers included in each server set may be heterogeneous servers. Heterogeneous servers represent different machine models, such as servers including different numbers of storage units, and the storage unit may refer to a disk or other information carrier.

[0056] Step S203, determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks.

[0057] Wherein, n is an integer greater than 1. Exemplarily, if n is 2, the current step may be to determine the allocation method of the shard copy data of each disaster recovery block according to the square sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks. Specifically, it may be to determine the allocation method of the shard copy data of each disaster recovery block corresponding to the minimum value of the sum of the nth power.

[0058] The present application can achieve the determination of the above-mentioned allocation method by adopting the minimum cost maximum flow algorithm. Specifically, the shard copy data allocated on each storage unit is aggregated to a sink, and the cost of each storage unit to the sink is expressed by the nth power of the number of shard copy data from each storage unit to the sink. The minimum cost maximum flow algorithm is used to determine the number of shard copy data allocated on each storage unit when the total cost from each storage unit to the sink is minimized, and the final allocation method is obtained based on this.

[0059] Step S204, according to the allocation method of the shard copy data of each disaster recovery block, distribute the shard copy data of each disaster recovery block to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block.

[0060] Among them, each disaster recovery block needs to be allocated with complete service data so that the M server sets corresponding to the M disaster recovery blocks can achieve the disaster recovery effect. According to the nth power and value of the number of shard copy data allocated to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block, the allocation method of the shard copy data of each disaster recovery block is determined, and according to the allocation method of the shard copy data of each disaster recovery block, the shard copy data of each disaster recovery block is allocated to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block, so that the shard copy data in each disaster recovery block can be evenly distributed under the multiple storage units included in the multiple heterogeneous servers corresponding to each disaster recovery block, thereby achieving the effect of load balancing.

[0061] In addition, when determining the allocation method, the capacity of each storage unit may also be considered, so that the allocation of shard copy data on each storage unit is limited according to the capacity of each storage unit.

[0062] Specifically, in a feasible embodiment, before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method also includes: determining the capacity of each storage unit in the multiple storage units; determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, including: determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks and the capacity of each storage unit in the multiple storage units.

[0063] Among them, the remaining allocatable capacity of each storage unit may be different, so when allocating, it is not ideal to arbitrarily allocate shard copy data to each storage unit. Therefore, before determining the allocation method, the capacity of each storage unit can be determined, and the allocation method of the shard copy data of each disaster recovery block can be determined in combination with the capacity of each storage unit, so as to ensure that the shard copy data allocated to each storage unit will not be unable to be actually used due to not meeting the capacity size of each storage unit. Specifically, the allocation method of the shard copy data of each disaster recovery block can be determined based on the n-th power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the capacity of each storage unit in the multiple storage units, so that when the number of allocated copy data allocated to each storage unit in the multiple storage units meets the capacity of the storage unit, the allocation method of the shard copy data of each disaster recovery block can be determined when the n-th power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block can reach the minimum.

[0064] In an embodiment of the present application, by determining the capacity of each storage unit and allocating the shard copy data according to the capacity of each storage unit, it is ensured that the shard copy data allocated to each storage unit will not be unable to be actually used due to not meeting the capacity size of each storage unit, thereby improving the stability of data allocation.

[0065] In addition, the cost allocated to each storage unit may be set according to the read and write speed of each storage unit.

[0066] Specifically, in a feasible embodiment, before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method also includes: determining the rotation speed of each storage unit in the multiple storage units; generating an allocation fee for each storage unit according to the rotation speed of each storage unit in the multiple storage units, the higher the rotation speed of each storage unit, the lower the allocation fee of each storage unit; determining the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, including: determining the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the product of the number of shard copy data allocated to each storage unit in the multiple storage units and the allocation fee of each storage unit.

[0067] Among them, the present application reflects the read and write speed of each storage unit through the rotation speed of each storage unit. In the allocation of the shard copy data of each storage unit, the storage unit with a high rotation speed is allocated as much as possible, so as to improve the overall read and write performance of the shard copy data after the shard copy data is allocated. Specifically, according to the n-th power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the product of the number of shard copy data allocated to each storage unit in the multiple storage units and the allocation cost of each storage unit, determine the allocation method of the shard copy data of each disaster recovery block when the sum of the n-th power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block and the product of the number of shard copy data allocated to each storage unit in the multiple storage units and the allocation cost of each storage unit is the smallest, and subsequently according to the allocation method of the shard copy data of each disaster recovery block, the shard copy data of each disaster recovery block is allocated to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block.

[0068] In the present application, by setting the allocation fee of the rotation speed of each storage unit, the allocation method of the shard copy data of each disaster recovery block is determined according to the allocation fee of each storage unit combined with the number of shard copy data allocated to each storage unit. In this way, on the basis of preferentially allocating the shard copy data to the storage units with high rotation speed, it is possible to ensure that the distribution of the shard copy data on each storage unit is more uniform, thereby improving the overall load balancing level of the storage system.

[0069] In addition, for multiple server sets in a region, the storage system can also set corresponding primary shard copy data and secondary shard copy data for the shard copy data allocated to the multiple server sets. The primary shard copy data can provide write operations, and the secondary shard copy data can provide read operations. The following is a detailed description of this application:

[0070] In a feasible embodiment, m target disaster recovery blocks among M disaster recovery blocks are determined; according to the nth power and value of the allocation quantity of N primary shard copy data in multiple storage units of multiple heterogeneous servers of the m target disaster recovery blocks, N shard copy data in each target disaster recovery block among the m target disaster recovery blocks are set with part of the primary shard copy data and part of the secondary shard copy data, the primary shard copy data is readable and writable data, and the secondary copy data is read-only data, the primary shard copy data in the m target disaster recovery blocks are different from each other, and the N primary shard copy data correspond to a group of N shard data.

[0071] Among them, the m target disaster recovery blocks refer to the disaster recovery blocks that need to set the primary shard copy data and the slave shard copy data corresponding to the M disaster recovery blocks. Since write operations occupy more resources than read operations, in general, the difference in the number of primary shard copy data set between each target disaster recovery block is small, and the resource may refer to resources such as a central processing unit and a network. N primary shard copy data correspond to a group of N shard data, that is, the N shard data included in a complete service data should have corresponding primary shard copy data that can provide write services. When the server where the first primary copy data is located fails, the service of the first primary shard copy data can be migrated to the server where the first slave shard copy data corresponding to the first primary shard copy data in other disaster recovery blocks among the m target disaster recovery blocks is located, and the first slave shard copy data provides the service corresponding to the first primary shard copy data.

[0072] This embodiment means that after the shard copy data of each disaster recovery block in the M disaster recovery blocks are allocated to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block through the above embodiment, the corresponding primary shard copy data can be set in the m target disaster recovery blocks after the allocation is completed, so that the sum of the second allocation number n of the primary shard copy data of the m target disaster recovery blocks in at least one storage unit of the heterogeneous server corresponding to the target disaster recovery block is minimized, and the shard copy data in the m disaster recovery blocks except for the set primary shard copy data are set as slave shard copy data. In this way, it can be ensured that the selected primary shard copy data is more evenly distributed on the storage unit corresponding to each server in the m target disaster recovery blocks, thereby improving the load balancing level of the storage system.

[0073] In the present application, in the present application, the primary shard copy data selected from the m target disaster recovery blocks satisfies the requirement that the sum of the nth power of the second allocation quantity of at least one storage unit of the heterogeneous server corresponding to the target disaster recovery block is minimized, so that the primary shard copy data can be evenly distributed on all storage units of the server corresponding to the target disaster recovery block, thereby improving the load balancing level of the storage system.

[0074] In addition, in addition to allocating the shard copy data of each disaster recovery block to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block and then setting the corresponding primary shard copy data therefrom, the primary shard copy data may also be set before determining the allocation method, and the allocation of the primary shard copy data may be considered when determining the allocation method, which is described in detail below:

[0075] In a feasible embodiment, before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method also includes: determining m target disaster recovery blocks in the M disaster recovery blocks; setting part of the primary shard copy data and part of the secondary shard copy data in each target disaster recovery block in the m target disaster recovery blocks, the primary shard copy data is readable and writable data, and the secondary allocated copy data is read-only data, the primary shard copy data in the m target disaster recovery blocks are different from each other, and the N primary shard copy data correspond to a group of N shard data; according to each disaster recovery block in the M disaster recovery blocks The method of allocating shard copy data of each disaster recovery block is determined based on the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block, including: determining the method of allocating shard copy data of each disaster recovery block according to the nth power sum of the first allocation number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in M ​​disaster recovery blocks, wherein the first allocation number of shard copy data allocated to each storage unit in the multiple storage units is the sum of the number of primary shard copy data allocated to each storage unit multiplied by a first preset weight and the number of secondary shard copy data multiplied by a second preset weight, and the first preset weight is different from the second preset weight.

[0076] Among them, if it is necessary to set the corresponding primary shard copy data from the m target disaster recovery blocks among the M disaster recovery blocks before determining the distribution method of the shard copy data of each disaster recovery block, it is necessary to ensure that the corresponding primary shard copy data selected from the m target disaster recovery blocks are evenly distributed on multiple storage units of the heterogeneous servers corresponding to the m target disaster recovery blocks. Therefore, this embodiment needs to meet two conditions, the first condition is that the primary shard copy data is evenly distributed on multiple storage units of multiple heterogeneous servers corresponding to the m target disaster recovery blocks, and the second condition is that the overall shard copy data is evenly distributed on multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks.

[0077] Since the present application determines the allocation method of the shard copy data of each disaster recovery block according to the n-th power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block. Then, on the basis of determining the allocation method according to the above method, the first allocation number of the shard copy data allocated to each storage unit in the multiple storage units can be set to be the sum of the number of primary shard copy data allocated in each storage unit multiplied by the first preset weight and the number of secondary shard copy data multiplied by the second preset weight, and the first preset weight is different from the second preset weight. Exemplarily, if storage unit 1 is allocated with one secondary shard copy data and one primary shard copy data, if the first preset weight is 2 and the second preset weight is 3, then the first allocation number of shard copy data in storage unit 1 should be 5.

[0078] Since the preset weights corresponding to the primary shard copy data and the secondary shard copy data are different, when determining the distribution method of the shard copy data of each disaster recovery block according to the first distribution quantity, the primary shard copy data and the secondary shard copy data will be evenly distributed on multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block. For example, if there are 3 storage units, 3 primary shard copy data and 3 secondary shard copy data, the first preset weight is 0.5, the second preset weight is 1.5, and n is 2, it can be seen that if the 3 primary shard copy data and the 3 secondary shard copy data are distributed to the 3 storage units, the sum of the squares of the first distribution quantity of the 3 storage units is minimized, and the distribution method of distributing the 3 primary shard copy data to the 3 storage units and the 3 secondary shard copy data to the 3 storage units can be obtained.

[0079] In the present application, the above method is set to set different preset weights when calculating the first allocation quantity for the primary shard copy data and the secondary shard copy data. When allocating the shard copy data, it can ensure that the primary shard copy data is evenly distributed on at least one storage unit in the server corresponding to the target disaster recovery block, and it can also ensure that the shard copy data is evenly distributed on at least one storage unit in the server corresponding to the entire disaster recovery block, thereby improving the load balancing level of the storage system.

[0080] In a feasible embodiment, M disaster recovery blocks correspond to M server sets, each server set in the M server sets includes multiple heterogeneous servers, and determining m target disaster recovery blocks in the M disaster recovery blocks includes: determining m target server sets in the M server sets, the m target server sets can perform shard copy data migration between each other; determining m target disaster recovery blocks in the M disaster recovery blocks corresponding to the m target server sets.

[0081] Among them, the current setting of master-slave shard copy data is mainly for m server sets within the range where shard copy data can be migrated between each other, so as to determine the corresponding m target disaster recovery blocks according to the m server sets that can migrate shard copy data between each other. If the distance is far, it is not conducive to data backup. Mutual shard copy data migration can refer to physical distance or communication distance.

[0082] It is understandable that there may be multiple m target disaster recovery blocks in the M disaster recovery blocks, and each of the m target disaster recovery blocks shall meet the conditions shown in the above embodiment. For example, the M disaster recovery blocks include disaster recovery block 1, disaster recovery block 2, disaster recovery block 3, disaster recovery block 4 and disaster recovery block 5, wherein the server sets corresponding to disaster recovery block 1 and disaster recovery block 2 can migrate shard copy data with each other, and the server sets corresponding to disaster recovery block 3 and disaster recovery block 4 can migrate shard copy data with each other; then the corresponding master-slave shard copy data can be set between disaster recovery block 1 and disaster recovery block 2, and the corresponding master-slave shard copy data can also be set between disaster recovery block 3 and disaster recovery block 4.

[0083] In the present application, m target disaster recovery blocks corresponding to m target server sets that can perform shard copy data migration with each other are determined, so that after allocation, service migration can be facilitated in the event of a failure, thereby improving the fault tolerance of the storage system.

[0084] In addition, in a feasible embodiment, before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method also includes: determining the rotation speed of each storage unit in the multiple storage units; generating an allocation fee for each storage unit according to the rotation speed of each storage unit in the multiple storage units, the higher the rotation speed of each storage unit, the lower the allocation fee of each storage unit, wherein the allocation fee of each storage unit includes a first allocation fee and a second allocation fee, and the first allocation fee is lower than the second allocation fee; according to each of the M disaster recovery blocks, The method of allocating shard copy data of each disaster recovery block is determined according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in M ​​disaster recovery blocks, the method comprising: determining the method of allocating shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in M ​​disaster recovery blocks, the product of the number of primary shard copy data allocated to each storage unit in the multiple storage units and the first allocation fee of each storage unit, and the product of the number of secondary shard copy data allocated to each storage unit in the multiple storage units and the second allocation fee of each storage unit.

[0085] Among them, since the rotation speed of each storage unit in this application can be used to reflect the read and write performance of each storage unit, the higher the rotation speed of the storage unit, the better the read and write performance of the storage unit. Since the resources occupied by the write operation corresponding to the primary shard copy data are greater than the read operation corresponding to the secondary shard copy data, the primary shard copy data should be allocated to the storage unit with a higher rotation speed than the secondary shard copy data.

[0086] Specifically, the first allocation fee and the second allocation fee corresponding to the allocation of the primary shard copy data and the secondary shard copy data to each storage unit are determined according to the rotation speed of each storage unit. Since the first allocation fee is lower than the second allocation fee, when the n-th power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the product of the number of primary shard copy data allocated to each storage unit in the multiple storage units and the first allocation fee of each storage unit, and the product of the number of secondary shard copy data allocated to each storage unit in the multiple storage units and the second allocation fee of each storage unit, the allocation method of the shard copy data of each disaster recovery block is determined when the sum of the above three is the smallest. In this way, the primary shard copy data can be preferentially allocated to the storage unit with a high rotation speed.

[0087] In the present application, by setting the first allocation fee of allocating the primary shard copy data to the storage unit with a high rotation speed lower than the second allocation fee of allocating the secondary copy data to the storage unit with a high rotation speed, the primary shard copy data can be preferentially allocated to the storage unit with a high rotation speed, thereby improving the overall read and write performance of the storage system.

[0088] For example, see Figure 3 , Figure 3 A schematic diagram of a storage cluster structure provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, there are three server sets, among which there are two target server sets and one non-target server set. The two target server sets are respectively the first target server set 300 and the second target server set 310, and the non-target server set is the third server set 320. The first target server set 300 includes server 1 and server 2, the second target server set 310 includes server 3 and server 4, and the third server set 320 includes server 5. Each server set is allocated four shards, namely shard 0, shard 1, shard 2, and shard 3. Primary shards are also selected between the first target server set 300 and the second target server set 310. In the first target server set 300, shard 0 and shard 1 are used as primary shards, that is, primary shard 0 distributed by server 1 and primary shard 1 distributed by server 2; in the second target server set 310, shard 2 and shard 3 are used as primary shards, that is, primary shard 2 distributed by server 3 and primary shard 3 distributed by server 4.

[0089] Below through Figure 4 The allocation algorithm shown in this application is described in detail:

[0090] For example, see Figure 4 , Figure 4 A structural diagram of a data allocation model provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, it includes shard bucket nodes, disaster recovery block nodes, server nodes, and storage unit nodes. The shard bucket nodes include shard bucket b1, shard bucket b2, shard bucket b3, and shard bucket b4; the disaster recovery block nodes include disaster recovery blocks r1, disaster recovery blocks r2, and disaster recovery blocks r3; the disaster recovery block nodes correspond to the server nodes, disaster recovery block r1 includes server h1, disaster recovery block r2 includes servers h2 and server h3, and disaster recovery block r3 includes servers h4, server h5, and server h6; the server nodes correspond to the storage unit nodes, server h1 includes storage units d1, storage units d2, storage units d3, and storage units d4, server h2 includes storage units d5, server h3 includes storage units d6 and storage units d7, server h4 includes storage units d8, server h5 includes storage units d9, and server h6 includes storage units d10. The number of storage units between multiple servers in the figure is different, which means that this is a heterogeneous disaster recovery block.

[0091] Among them, starting from the source point, an edge is connected to each shard bucket with a capacity of 3, indicating that each shard bucket needs to distribute 3 shard copies. This is because only three disaster recovery blocks are described in the figure. The cost from the source point to the shard bucket is 0, which is represented by (3,0). Each shard bucket connects an edge to each disaster recovery block with a capacity of 1, indicating that each disaster recovery block can only accommodate one copy, and the cost from the shard bucket to the disaster recovery block is 0, which is represented by (1,0) (not shown in the figure). Each disaster recovery block connects an edge to its own server with unlimited capacity and a cost of 0, which is represented by (∞,0). Each server connects an edge to its own storage unit with unlimited capacity and a cost of 0, which is represented by (∞,0). Finally, each storage unit connects an edge to the sink with unlimited capacity and a cost of the square of the flow, which is represented by (∞,f^2). Finally, the minimum cost maximum flow algorithm is used to find the corresponding storage unit through which each shard copy data flows when the minimum cost from the source point to the sink point is minimized, thereby obtaining the distribution plan of the shard copy data on the storage unit.

[0092] If it is necessary to allocate the shard copy data of each disaster recovery block in the M disaster recovery blocks to at least one storage unit of the heterogeneous server corresponding to each disaster recovery block based on the capacity of each storage unit in the multiple storage units as shown in the above embodiment, then a capacity limit can be set on an edge connecting each server to its own storage unit, thereby achieving the allocation of the shard copy data of each disaster recovery block in the M disaster recovery blocks to at least one storage unit of the heterogeneous server corresponding to each disaster recovery block based on the capacity of each storage unit in the multiple storage units as shown in the above embodiment. It can be understood that the cost between the server and the storage unit can also be set separately according to the rotation speed of each storage unit. For example, if the cost from h1 to d1 is set to 2, it can be represented by (∞,2).

[0093] If it is necessary to select the primary shard copy data from the target disaster recovery block, it is also performed according to the above algorithm. According to the above embodiment, there are two ways to set the primary shard copy data from the target disaster recovery block, one is to set it before determining the allocation method, and the other is to set it after determining the allocation method.

[0094] Before determining the allocation method, it is set that the flow rate of the aforementioned shard copy data from each storage unit to the sink is the number of shard copy data, but at this time, it is necessary to set the flow rate of each primary shard copy data from each storage unit to the sink to be the number of primary shard copy data multiplied by the first preset weight, and set the flow rate of each slave shard copy data from each storage unit to the sink to be the number of slave shard copy data multiplied by the second preset weight. Then, according to the above method, the minimum cost maximum flow algorithm is used to find the corresponding storage unit through which each shard copy data flows under the condition of the minimum cost from the source point to the sink, thereby obtaining the distribution plan of the shard copy data on the storage unit. At the same time, when determining the allocation plan, the capacity of each storage unit and the rotation speed of each storage unit can also be considered, which will not be elaborated here.

[0095] After determining the allocation method, specifically, the edge capacity from the source point to each shard bucket is set to 1, which means that each shard bucket has only one primary copy to be distributed. Since the distribution of shard copy data in each storage unit has been determined according to the above algorithm, it is only necessary to establish indirect directed edges from each shard bucket to the storage unit where the primary shard copy data is placed. For example, b1 has two copies distributed in d1 and d5 respectively, then establish connections b1->r1->h1->d1, b1->r2->h2->d5, and the capacity and cost settings of each edge remain unchanged. The same is true for other shard buckets. Through the minimum cost maximum flow algorithm, the corresponding primary shard copy data is determined from the shard copy data that has been allocated in the storage unit, so that the directed edges established by the distribution of the determined primary shard copy data in the storage unit meet the minimum cost requirements.

[0096] It can be seen that in the embodiment of the present application, the distribution method of the shard copy data of each disaster recovery block is determined according to the nth power and value of the number of shard copy data allocated to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the shard copy data of each disaster recovery block is distributed to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block. The servers in this embodiment include servers of heterogeneous models, and the capacities corresponding to the servers of heterogeneous models are different. Therefore, the average distribution of shards is not for the servers, but for the different numbers of storage units corresponding to the servers. The present application determines the distribution method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to each storage unit, which can achieve average sharding of the shard copy data on the storage unit. In summary, the above method can improve the overall load balancing level of the storage system.

[0097] In accordance with the above-mentioned embodiment, please refer to Figure 5 , Figure 5 A block diagram of the functional units of a data distribution device provided in an embodiment of the present application, such as Figure 5 As shown, the data distribution device 50 includes:

[0098] The acquisition unit 501 is used to acquire N pieces of data corresponding to the service data, where N is an integer greater than 1;

[0099] A determining unit 502 is configured to determine M disaster recovery blocks based on the N shard data, each of the M disaster recovery blocks including N shard replica data corresponding to the N shard data, where M is an integer greater than 1;

[0100] The determining unit 502 is further configured to determine a distribution mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks;

[0101] Processing unit 503 is used to distribute the shard copy data of each disaster recovery block to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block according to the distribution method of the shard copy data of each disaster recovery block, where n is an integer greater than 1.

[0102] In a feasible embodiment, the N shard data are obtained by performing consistent hashing on the service data.

[0103] In a feasible embodiment, the determination unit 502 is used to determine the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and is also used to: determine the capacity of each storage unit in the multiple storage units; the determination unit 502 is used to determine the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, including: determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks and the capacity of each storage unit in the multiple storage units.

[0104] In a feasible embodiment, the determination unit 502 is used to determine the allocation method of the shard copy data of each disaster recovery block before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and is also used to: determine the rotation speed of each storage unit in the multiple storage units; generate the allocation fee of each storage unit according to the rotation speed of each storage unit in the multiple storage units, the higher the rotation speed of each storage unit, the lower the allocation fee of each storage unit; the determination unit 502 is used to determine the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, including: determining the allocation method of the shard copy data of each disaster recovery block according to the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the product of the number of shard copy data allocated to each storage unit in the multiple storage units and the allocation fee of each storage unit.

[0105] In a feasible embodiment, the determination unit 502 is used to determine m target disaster recovery blocks among the M disaster recovery blocks; according to the nth power and value of the allocation quantity of N primary shard copy data in multiple storage units of multiple heterogeneous servers of the m target disaster recovery blocks, in each of the m target disaster recovery blocks, N shard copy data are set with part of the primary shard copy data and part of the secondary shard copy data, the primary shard copy data is readable and writable data, and the secondary allocated copy data is read-only data, the primary shard copy data in the m target disaster recovery blocks are different from each other, and the N primary shard copy data correspond to a group of N shard data.

[0106] In a feasible embodiment, the determination unit 502 is used to determine the allocation method of the shard copy data of each disaster recovery block before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and is also used to: determine m target disaster recovery blocks in the M disaster recovery blocks; set part of the primary shard copy data and part of the secondary shard copy data in the N shard copy data in each target disaster recovery block in the m target disaster recovery blocks, the primary shard copy data is readable and writable data, and the secondary allocated copy data is read-only data, the primary shard copy data in the m target disaster recovery blocks are different from each other, and the N primary shard copy data correspond to a group of N shard data; according to the M disaster recovery blocks The method of allocating shard copy data of each disaster recovery block is determined based on the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block, including: determining the method of allocating shard copy data of each disaster recovery block based on the nth power sum of the first allocation number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in M ​​disaster recovery blocks, wherein the first allocation number of shard copy data allocated to each storage unit in the multiple storage units is the sum of the number of primary shard copy data allocated to each storage unit multiplied by a first preset weight and the number of secondary shard copy data multiplied by a second preset weight, and the first preset weight is different from the second preset weight.

[0107] In a feasible embodiment, M disaster recovery blocks correspond to M server sets, each server set in the M server sets includes multiple heterogeneous servers, and the determination unit 502 is used to determine m target disaster recovery blocks in the M disaster recovery blocks, including: determining m target server sets in the M server sets, the m target server sets can perform shard copy data migration between each other; determining m target disaster recovery blocks in the M disaster recovery blocks corresponding to the m target server sets.

[0108] In a feasible embodiment, the determination unit 502 is used to determine the allocation method of the shard copy data of each disaster recovery block before determining the allocation method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks. It is also used to: determine the rotation speed of each storage unit in the multiple storage units; generate an allocation fee for each storage unit according to the rotation speed of each storage unit in the multiple storage units, the higher the rotation speed of each storage unit, the lower the allocation fee of each storage unit, wherein the allocation fee of each storage unit includes a first allocation fee and a second allocation fee, and the first allocation fee is lower than the second allocation fee; according to the M disaster recovery blocks The method of allocating the shard copy data of each disaster recovery block is determined by summing the nth power of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method of allocating the shard copy data of each disaster recovery block is determined, including: determining the method of allocating the shard copy data of each disaster recovery block according to the sum of the nth power of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the product of the number of primary shard copy data allocated to each storage unit in the multiple storage units and the first allocation fee of each storage unit, and the product of the number of secondary shard copy data allocated to each storage unit in the multiple storage units and the second allocation fee of each storage unit.

[0109] It can be understood that since the method embodiment and the device embodiment are different presentation forms of the same technical concept, the content of the method embodiment part in this application should be synchronously adapted to the device embodiment part and will not be repeated here.

[0110] In the case of integrated units, such as Figure 6 As shown, Figure 6 This is a block diagram of the functional units of another data distribution device provided in an embodiment of the present application. Figure 6 In the embodiment, the data distribution device 50 includes: a processing module 612 and a communication module 611. The processing module 612 is used to control and manage the actions of the data distribution device, for example, the steps of the acquisition unit 501, the determination unit 502 and the processing unit 503, and / or other processes for executing the technology described herein. The communication module 611 is used to support the interaction between the data distribution device and other devices. Figure 6 As shown, the data distribution device 50 may further include a storage module 613, and the storage module 613 is used to store program codes and data of the data distribution device.

[0111] Among them, the processing module 612 can be a processor or a controller, for example, a central processing unit (CPU), a general processor, a digital signal processor (DSP), an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication module 611 can be a transceiver, an RF circuit or a communication interface, and the like. The storage module 613 can be a memory.

[0112] All relevant contents of each scenario involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here. Figure 2 The data distribution method shown.

[0113] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When a computer instruction or computer program is loaded or executed on a computer, a process or function according to an embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless 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 containing one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0114] Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of the present application. Figure 7As shown, the electronic device 700 may include one or more of the following components: a processor 701, a memory 702 and a communication interface 703. The processor 701, the memory 702 and the communication interface 703 are interconnected and perform communication work with each other, wherein the memory 702 may store one or more computer programs, and the one or more computer programs may be configured to implement the methods described in the above embodiments when executed by one or more processors 701.

[0115] The processor 701 may include one or more processing cores. The processor 701 uses various interfaces and lines to connect the various parts of the entire electronic device 700, and executes various functions and processes data of the electronic device 700 by running or executing instructions, programs, code sets or instruction sets stored in the memory 702, and calling data stored in the memory 702. Optionally, the processor 701 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 701 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. It is understandable that the above-mentioned modem may not be integrated into the processor 701, and may be implemented separately through a communication chip.

[0116] The memory 702 may include a random access memory (RAM) or a read-only memory (ROM). The memory 702 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device 700 during use, etc.

[0117] It is understandable that the electronic device 700 may include more or fewer structural elements than those in the above structural block diagram, for example, including a power module, physical buttons, a WiFi (Wireless Fidelity) module, a speaker, a Bluetooth module, a sensor, etc., which are not limited here.

[0118] The electronic device 700 may be a part of the storage system 100 or a device independent of the storage system 100 .

[0119] An embodiment of the present application provides a computer-readable storage medium, wherein program data is stored in the computer-readable storage medium, and when the program data is executed by a processor, it is used to execute part or all of the steps of any one of the data allocation methods recorded in the above method embodiments.

[0120] The present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps of any data distribution method described in the above method embodiment. The computer program product may be a software installation package.

[0121] It should be noted that, for the method embodiments of any of the aforementioned data allocation methods, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present application.

[0122] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "one" does not exclude multiple situations. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0123] A person skilled in the art can understand that all or part of the steps in the various methods of the method embodiments of any of the above-mentioned data allocation methods can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a disk or an optical disk, etc.

[0124] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation method of a data distribution method and device of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​a data distribution method and device of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0125] The present application is described with reference to the flowcharts and / or block diagrams of the methods, hardware products, and computer program products of the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0126] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0128] It can be understood that any product that is controlled or configured to execute the processing method of the flowchart described in a method embodiment of a data distribution method of the present application, such as the terminal and computer program product in the above flowchart, belongs to the category of related products described in the present application.

[0129] Obviously, those skilled in the art can make various changes and modifications to the data distribution method and device provided by the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data distribution method, It is characterized in that The method comprises: Get N shard data corresponding to the service data, where N is an integer greater than 1; Determine M disaster recovery blocks based on the N shard data, each of the M disaster recovery blocks includes N shard replica data corresponding to the N shard data, and M is an integer greater than 1; Determine the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, where n is an integer greater than 1; According to the distribution method of the shard copy data of each disaster recovery block, the shard copy data of each disaster recovery block is distributed to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block.

2. The method according to claim 1, It is characterized in that The method further comprises: Determine m target disaster recovery blocks among the M disaster recovery blocks; According to the nth power and value of the allocation quantity of N primary shard copy data in multiple storage units of multiple heterogeneous servers of the m target disaster recovery blocks, part of the primary shard copy data and part of the secondary shard copy data are set in the N shard copy data in each of the m target disaster recovery blocks, the primary shard copy data is readable and writable data, and the secondary copy data is read-only data, the primary shard copy data in the m target disaster recovery blocks are different from each other, and the N primary shard copy data correspond to a group of the N shard data.

3. The method according to claim 1, It is characterized in that Before determining the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method further includes: Determine m target disaster recovery blocks among the M disaster recovery blocks; In each of the m target disaster recovery blocks, N shard copy data are set with part of the primary shard copy data and part of the secondary shard copy data, the primary shard copy data is readable and writable data, and the secondary copy data is read-only data, the primary shard copy data in the m target disaster recovery blocks are different from each other, and the N primary shard copy data correspond to a group of the N shard data; Determining a distribution method of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, including: The allocation method of the shard copy data of each disaster recovery block is determined based on the nth power sum of the first allocation quantity of the shard copy data allocated to the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, wherein the first allocation quantity of the shard copy data allocated to each storage unit in the multiple storage units is the sum of the quantity of the primary shard copy data allocated in each storage unit multiplied by a first preset weight and the quantity of the secondary shard copy data multiplied by a second preset weight, and the first preset weight is different from the second preset weight.

4. The method according to claim 2 or 3, It is characterized in that The M disaster recovery blocks correspond to M server sets, each of the M server sets includes a plurality of heterogeneous servers, and determining m target disaster recovery blocks among the M disaster recovery blocks includes: Determine m target server sets in the M server sets, wherein the m target server sets can perform shard copy data migration with each other; Determine m target disaster recovery blocks corresponding to the m target server sets among the M disaster recovery blocks.

5. The method according to any one of claims 1 to 4, It is characterized in that Before determining the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method further includes: determining a capacity of each storage unit in the plurality of storage units; The method of determining the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks includes: The allocation method of the shard copy data of each disaster recovery block is determined based on the nth power and value of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the capacity of each storage unit in the multiple storage units.

6. The method according to any one of claims 1 to 4, It is characterized in that Before determining the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method further includes: determining a rotational speed of each storage unit in the plurality of storage units; generating an allocation fee for each storage unit according to a rotation speed of each storage unit in the plurality of storage units, wherein the higher the rotation speed of each storage unit, the lower the allocation fee for each storage unit; The method of determining the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks includes: The allocation method of the shard copy data of each disaster recovery block is determined based on the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, and the product of the number of shard copy data allocated to each storage unit in the multiple storage units and the allocation fee of each storage unit.

7. The method according to claim 3, It is characterized in that Before determining the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by the multiple storage units of the multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the method further includes: determining a rotational speed of each storage unit in the plurality of storage units; generating an allocation fee for each storage unit according to a rotation speed of each storage unit in the plurality of storage units, wherein the higher the rotation speed of each storage unit, the lower the allocation fee for each storage unit, wherein the allocation fee for each storage unit includes a first allocation fee and a second allocation fee, and the first allocation fee is lower than the second allocation fee; The method of determining the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks includes: The distribution method of the shard copy data of each disaster recovery block is determined based on the nth power sum of the number of shard copy data allocated to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, the product of the number of primary shard copy data allocated to each storage unit in the multiple storage units and the first allocation fee of each storage unit, and the product of the number of secondary shard copy data allocated to each storage unit in the multiple storage units and the second allocation fee of each storage unit.

8. The method according to any one of claims 1 to 7, It is characterized in that The N shard data are obtained by performing consistent hashing on the service data.

9. A data distribution device, It is characterized in that The device comprises: An acquisition unit, used to acquire N pieces of data corresponding to the service data, where N is an integer greater than 1; A determining unit, configured to determine M disaster recovery blocks based on the N shard data, each of the M disaster recovery blocks including N shard replica data corresponding to the N shard data, where M is an integer greater than 1; The determining unit is further used to determine the allocation mode of the shard copy data of each disaster recovery block according to the nth power and value of the number of shard copy data allocated by multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block in the M disaster recovery blocks, where n is an integer greater than 1; The processing unit is used to distribute the shard copy data of each disaster recovery block to multiple storage units of multiple heterogeneous servers corresponding to each disaster recovery block according to the distribution method of the shard copy data of each disaster recovery block.

10. An electronic device, It is characterized in that The device comprises: A processor, a memory, and a communication interface, wherein the processor, the memory, and the communication interface are connected to each other and perform communication work between them; The memory stores executable program code, and the communication interface is used for wireless communication; The processor is used to call the executable program code stored in the memory to execute the method according to any one of claims 1-8.

11. A computer-readable storage medium, It is characterized in that A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 8.