Data processing method and device

By dividing the data into local verification shards and global verification shards, it is possible to perform data repair through a single data center and between data centers in multiple data centers, solving the problems in the existing technology. The problem of high data repair penalty ratio and high decoding complexity improves data reliability and reduces storage costs.

CN118567903APending Publication Date: 2024-08-30SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410742452.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Among the existing data disaster recovery methods in multi-location data centers, single-layer encoding requires data transmission between data centers for data repair, and the repair penalty is relatively high; while the intra-cluster EC + inter-cluster XOR method requires decoding complexity, Storage redundancy and cost are higher.

Method used

Divide the target storage data into several first data shards according to the data storage capacity of a single data strip, including local verification shards and global verification shards distributed in multiple data centers. Through local verification shards, Data repair with global parity sharding can be performed in a single data center or between data centers, reducing the penalty ratio of repair, and reducing storage costs and decoding complexity.

Benefits of technology

It improves data reliability, reduces repair penalty ratio and storage cost, avoids high-frequency data transmission between data centers, and reduces decoding complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567903A
    Figure CN118567903A
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method, and the method comprises the steps: dividing target storage data into a plurality of first data fragments according to a single data strip under the condition of receiving the target storage data, the data strip comprises N second data fragments which are at least distributed in two data centers, M local verification fragments which are at least distributed in three data centers and K global verification fragments which are at least distributed in three data centers; segmenting each first data fragment into N parts, respectively writing the N parts into second data fragments of one data strip, and generating corresponding local verification fragments and global verification fragments according to the data written into the current second data fragments; and according to the coded second data fragment, the local verification fragment and the global verification fragment, distributing storage nodes and writing. According to the data processing method provided by the embodiment of the invention, the repair penalty ratio, the data redundancy, the decoding complexity and the storage cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, computer equipment and storage medium. Background Art

[0002] Object storage systems generally use redundancy to ensure the reliability of stored data, and replicas are a common form of redundancy. However, in order to reduce storage costs and improve data reliability, more and more object storage systems use erasure coding (EC) algorithms to achieve data redundancy.

[0003] At present, there are two main types of data disaster recovery solutions in multiple data centers (including three centers in two locations): one is based on a single-layer coding method, for example, Reed-Solomon code (an erasure code algorithm) is first used to encode a data stripe, and then the corresponding blocks in the data stripe are stored in different data centers; the other is the intra-cluster EC + inter-cluster XOR method, that is, an erasure code algorithm is used for encoding in a single data center, and XOR (exclusive OR operation) is used between data centers to store the generated redundant blocks in the designated data center, forming XOR-based data center redundancy.

[0004] However, the first single-layer encoding method requires data transmission between data centers to repair data during disk repair and degraded reading, and the penalty ratio for repair is relatively large; while the second method of intra-cluster EC + inter-cluster XOR has a high decoding complexity, and the storage redundancy and cost are relatively high. Summary of the invention

[0005] The purpose of this application is to provide a data processing method, device, computer equipment and storage medium to solve the following technical problems: Among the current data disaster recovery methods for data centers in multiple locations, the single-layer encoding method must transmit data between data centers to repair data, and the penalty ratio for repair is relatively high; while the intra-cluster EC + inter-cluster XOR method has relatively high decoding complexity, storage redundancy and cost.

[0006] One aspect of an embodiment of the present application provides a data processing method, comprising: upon receiving target storage data, dividing the target storage data into a plurality of first data shards according to the data storage capacity of a single data stripe, wherein the data stripe comprises N second data shards distributed in at least two data centers, M local check shards and K global check shards, the local check shards being distributed in at least three data centers and corresponding to local check data used to repair data within the data center, and the global check shards being distributed in at least three data centers and corresponding to global check data used to repair data between data centers; dividing each of the first data shards into N parts, and writing each of the parts into one of the second data shards of the data stripe; generating local check data and global check data corresponding to the current data stripe according to the data written into the current second data shard; writing the generated local check data and global check data into the local check shard and the global check shard of the current data stripe respectively; allocating storage nodes to the second data shard, the local check shard and the global check shard, and writing the second data shard, the local check shard and the global check shard into the storage nodes.

[0007] Optionally, the second data shards of each data stripe are configured as L groups, and local verification data and global verification data corresponding to the current data stripe are generated according to the data written by the current second data shard, including: generating first global verification data corresponding to each group according to the data written by each group in the current data stripe, and the global verification data includes the first global verification data; and writing the generated local verification data and global verification data into the local verification shard and the global verification shard of the current data stripe respectively, including: writing the first global verification data into the first global verification shard, the first global verification shard and the second data shard corresponding to different data centers, and the global verification shard includes the first global verification shard.

[0008] Optionally, one data center corresponds to one local check shard, and the local check shard includes several first local check shards and one second local check shard. The first local check data corresponding to the first local check shard is generated using an erasure code algorithm based on the data written by the second data shard, and the second local check data corresponding to the second local check shard is generated using an exclusive OR operation based on the first local check data.

[0009] Optionally, the global check shard also includes a second global check shard, and second global check data corresponding to the second global check shard is generated using an erasure code algorithm based on data written to the second data shard, and one data center corresponds to one second global check shard.

[0010] Optionally, the method further includes: in the event that the second data shard fails, repairing the data based on the first local check shard, or repairing the data based on the first global check shard via a dedicated line of a data center.

[0011] Optionally, the method also includes: in the event of a failure of the first local check shard, performing data repair based on the second data shard of the data center corresponding to the failed first local check shard, or, performing data repair based on the first local check shard and the second local check shard of other data centers through a dedicated line of the data center; in the event of a failure of the second local check shard, performing data repair based on the first global check shard of the data center corresponding to the second local check shard, or, performing data repair based on the first local check shard through a dedicated line of the data center.

[0012] Optionally, the method further includes: in the event that the first global check shard fails, performing data repair according to the second data shard of the group corresponding to the failed first global check shard through a dedicated line of the data center.

[0013] Optionally, the method further includes: in the event that a failure occurs in the second global check shard, performing data repair using M second data shards.

[0014] One aspect of an embodiment of the present application further provides a data processing device, including: a receiving module, which is used to divide the target storage data into a plurality of first data shards according to the data storage capacity of a single data stripe when receiving the target storage data, wherein the data stripe includes N second data shards distributed in at least two data centers, M local check shards and K global check shards, the local check shards are distributed in at least three data centers and correspond to local check data used to repair data within the data center, and the global check shards are distributed in at least three data centers and correspond to global check data used to repair data between data centers; a splitting module , used to split each of the first data slices into N, and then write them into the second data slices of one of the data stripes respectively; a generation module, used to generate local verification data and global verification data corresponding to the current data stripe according to the data written into the current second data slice; a first writing module, used to write the generated local verification data and global verification data into the local verification slice and the global verification slice of the current data stripe respectively; a second writing module, used to allocate storage nodes to the second data slice, the local verification slice and the global verification slice, and write the second data slice, the local verification slice and the global verification slice into the storage nodes.

[0015] One aspect of an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor is used to implement the steps of the above-mentioned data processing method when executing the computer program.

[0016] One aspect of an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned data processing method.

[0017] The data processing method, apparatus, computer device, and storage medium provided in the embodiments of the present application include the following advantages:

[0018] The target storage data is divided into several first data shards according to the data storage capacity of a single data stripe, wherein the data stripe includes N second data shards distributed in at least two data centers, M local check shards distributed in at least three data centers, and K global check shards distributed in at least three data centers; each first data shard is cut into N parts and written into a second data shard of a data stripe, and a local check shard and a global check shard corresponding to the current data stripe are generated according to the data written in the current second data shard; the encoded shards are allocated and written into storage nodes; since the repair can be performed through both the local check shard and the global check shard, the repair can be performed through the data of a single data center or the data between data centers, thereby improving the reliability of the data, avoiding the disadvantage that the data can only be repaired through data transmission between data centers, and the penalty ratio of the repair is relatively low; in addition, since the encoding is performed through the data arrangement between data centers, the redundancy of the data is low, the storage cost is low, and the disadvantages of the EC within the cluster + the XOR between clusters are avoided, and the complexity of decoding is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 The environment architecture diagram of the embodiment of the present application is schematically shown;

[0020] Figure 2 A flowchart schematically shows a data processing method according to the first embodiment of the present application;

[0021] Figure 3 This is an example diagram of the arrangement of data stripes of the data processing method of the first embodiment of the present application;

[0022] Figure 4 This is an example diagram of the data writing principle of the data processing method of Embodiment 1 of the present application;

[0023] Figure 5 for Figure 2 Flowchart of newly added steps;

[0024] Figure 6 A block diagram schematically shows a data processing device according to Embodiment 2 of the present application;

[0025] Figure 7 The hardware architecture diagram of a computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0027] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0028] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.

[0029] The following is an explanation of the terms involved in this application:

[0030] A data stripe is a coding unit containing several blocks. Each block consists of data bits ranging from 1 Byte to several MB. Each stripe uses a specified coding algorithm. The blocks in the stripe are divided into data blocks and check blocks. The data blocks store the user's data information, while the check blocks store the corresponding check information generated after being encoded by the coding algorithm.

[0031] The Erasure Code (EC) algorithm is a data protection method and also a forward error correction coding method. The algorithm mainly divides the original data into multiple data blocks, then generates additional redundant data blocks or coding blocks for these data blocks, and stores these blocks in different locations, such as disks, storage nodes or other geographical locations. In this way, even if some data blocks are lost or damaged, the original data can be restored through the remaining data blocks and redundant data blocks. The advantage of the erasure code algorithm is that it can effectively save storage space and has higher reliability than the multi-copy strategy. However, the erasure code algorithm also brings some additional burdens, such as increased computational workload and network load.

[0032] The LRC (Locally Repairable Code) algorithm is an erasure code encoding technology that aims to improve the fault tolerance and data repair speed of data storage systems. Unlike traditional erasure code encoding technology, the LRC algorithm divides data into multiple data blocks and calculates multiple local check blocks for each data block instead of generating only one global check block. This allows data to be repaired by accessing nearby local check blocks when it is damaged, without accessing the entire data block.

[0033] Reed-Solomon codes (RS codes for short) are a type of forward error-corrected channel coding that uses a valid polynomial generated by correcting oversampled data. The coding process first finds redundancy in these polynomials at multiple points before transmitting or storing them. This sampling of the polynomial beyond the necessary value makes the polynomial overdetermined (overdefined). When the receiver receives enough points correctly, it can recover the original polynomial, even if many points on the received polynomial are distorted by noise.

[0034] Object storage system is a storage architecture for storing and accessing large amounts of unstructured data. Unlike traditional file storage or block storage, object storage treats data as independent, immutable objects, each of which contains the data itself, metadata (information describing the data), and a unique identifier.

[0035] Figure 1 The environment architecture diagram of the embodiment of the present application is schematically shown, as shown in the figure:

[0036] The client 300 is connected to the server 100 via the network 200 . The client 300 uploads the target storage data to the server 100 through the network 200. When the server 100 receives the target storage data, it divides the target storage data into several first data slices according to the data storage capacity of a single data stripe, and encodes each first data slice using a target encoding method to obtain an encoded slice; allocates a storage node to the encoded slice, and writes the encoded slice into the storage node, wherein the data stripe includes N second data slices distributed in at least two data centers, M local check slices and K global check slices, the local check slices are distributed in at least three data centers and correspond to local check data used to repair data within the data center, and the global check slices are distributed in at least three data centers and correspond to global check data used to repair data between data centers. The target encoding method includes: dividing each first data slice into N parts, writing them into the second data slice of a data stripe respectively, and generating local check data and global check data corresponding to the current data stripe according to the data written into the current second data slice, and writing the generated local check data and global check data into the local check slice and global check slice of the current data stripe respectively.

[0037] In an exemplary embodiment, the server 100 may be composed of several data centers.

[0038] The network 200 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 200 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, and / or the like. The network 200 may include wireless links, such as cellular links, satellite links, Wi-Fi links, and / or the like.

[0039] Client 300 may include devices such as mobile devices, tablet devices, laptop computers, smart devices (e.g., smart clothing, smart watches, smart glasses), virtual reality headsets, gaming devices, set-top boxes, digital streaming devices, robots, in-vehicle terminals, smart TVs, TV boxes, or e-book readers.

[0040] In the related technology, among the data disaster recovery methods of data centers in multiple locations, the single-layer encoding method must transmit data between data centers to repair data, and the penalty ratio of repair is relatively high; while the intra-cluster EC + inter-cluster XOR method has relatively high decoding complexity, storage redundancy and cost in the data center.

[0041] The data processing method of the embodiment of the present application can repair data through data in a single data center, and can also repair data through data transmission between data centers; and can reduce the repair penalty ratio of the data disaster recovery method, reduce the decoding complexity, storage redundancy and cost of the data center.

[0042] The data processing solution will be introduced through several embodiments below. For ease of understanding, the following exemplary description will be given with the server as the execution subject.

[0043] Embodiment 1

[0044] Figure 2 A flowchart of a data processing method according to the first embodiment of the present application is schematically shown. As shown in the figure, the method may include steps S410 to S431, which are specifically described as follows:

[0045] Step S410, when the target storage data is received, the target storage data is divided into several first data shards according to the data storage capacity of a single data stripe, wherein the data stripe includes N second data shards distributed in at least two data centers, M local check shards and K global check shards, the local check shards are distributed in at least three data centers and correspond to local check data used to repair data within the data center, and the global check shards are distributed in at least three data centers and correspond to global check data used to repair data between data centers.

[0046] It should be noted that the data processing method of the embodiment of the present application can be applied to scenarios such as two locations and three centers or multiple locations and multiple centers.

[0047] In general, the size of the data stripe is selected based on the following factors:

[0048] 1. Performance considerations: A larger data stripe can improve the efficiency of data transmission because more data blocks can be processed at one time when reading or writing data. However, a data stripe that is too large may increase the latency when reading data because the entire data stripe needs to be read.

[0049] 2. Fault tolerance: The number of redundant data blocks (global check shards and local check shards) in a data stripe will affect the system's fault tolerance. Generally speaking, the more redundant data blocks a data stripe contains, the stronger the system's tolerance to data corruption, but it will also increase storage costs.

[0050] 3. Data recovery speed: When data corruption occurs, the system needs to recover data through redundant data blocks. More redundant data blocks can increase the speed of data recovery, but it will also increase the overhead of data reading.

[0051] Therefore, when designing data stripes, a comprehensive determination can be made based on the server's computing power, storage capacity, and network transmission capacity.

[0052] The data storage capacity of the data stripe is determined by N and the single storage capacity of the second data shard. For example, if N=28 and the single storage capacity of the second data shard is 512KB, then the data storage capacity of the data stripe is =28*512KB=14MB; if the size of the target storage data is 28MB, then it can be divided into two first data shards according to the data storage capacity of the data stripe.

[0053] The number of M and K is usually determined by the design and configuration of the storage system, and depends on the system's requirements for data reliability and fault tolerance. The main considerations include the system's fault tolerance requirements, data recovery speed, and storage cost. In addition, the values ​​of N, M, and K can be positive integers.

[0054] The number of data centers where the second data shards are distributed can be the total number of data centers - 1. For example, if the number of data centers is 3, the number of data centers where the second data shards are distributed is 2. In a single distributed data center, the number of second data shards can be N / 2. For example, if N=28 and they are distributed in two data centers, then in a single data center with second data shards, the number of second data shards=28 / 2=14.

[0055] Step S420: split each first data shard into N parts, and write each part into a second data shard of a data stripe.

[0056] Step S430, generating local check data and global check data corresponding to the current data stripe according to the data currently written to the second data slice.

[0057] The algorithms used to generate the local verification data and the global verification data may be the same or different. In addition, the algorithms used to generate the local verification data and the global verification data of different data centers may be the same or different.

[0058] Step S440, writing the generated local check data and global check data into the local check slice and the global check slice of the current data stripe respectively.

[0059] In an exemplary embodiment, the second data shard of each data stripe is configured as L groups, and the step S430 of generating local check data and global check data corresponding to the current data stripe according to the data written to the current second data shard may include: generating first global check data corresponding to each group according to the data written to each group in the current data stripe, wherein the global check data includes first global check data. Accordingly, the step S440 of writing the generated local check data and global check data into the local check shard and the global check shard of the current data stripe respectively may include: writing the first global check data into the first global check shard, the first global check shard and the second data shard have different data centers, and the global check shard includes the first global check shard.

[0060] Specifically, for each data stripe, L groups can be configured in each data center, and the parts of the corresponding groups in different data centers can be regarded as a group. For example, if the second data shard is distributed in two data centers, the first group of data center 1 and the first group of data center 2 can be regarded as a group, the second group of data center 1 and the second group of data center 2 can be regarded as a group, and so on.

[0061] When generating the first global verification data, the first global verification data corresponding to each group is generated according to the data written by the group. For example, the first global verification data of the first group is generated according to the data written by the group composed of the first group of data center 1 and data center 2, and the first global verification data of the second group is generated according to the data written by the group composed of the second group of data center 1 and data center 2, and so on.

[0062] It can be understood that by generating first global check data for data written in the group in the data stripe and writing the generated first global check data into the first global check shard, the data in the corresponding group can be repaired through the first global check shard.

[0063] In an exemplary embodiment, one data center corresponds to one local check shard, and the local check shard includes several first local check shards and one second local check shard. The first local check data corresponding to the first local check shard is generated by using an erasure code algorithm based on the data written by the second data shard, and the second local check data corresponding to the second local check shard is generated by using an exclusive OR operation based on the first local check data.

[0064] Taking two locations and three centers as an example, including data center 1, data center 2 and data center 3, the second data shards are distributed in data center 1 and data center 2, and data center 1 and data center 2 correspond to a first local verification shard respectively. The first local verification data corresponding to the first local verification shard can be generated using the erasure code algorithm according to the data written in the second data shard in data center 1 and data center 2. Data center 3 corresponds to the second local verification shard, and the second local verification data corresponding to the second local verification shard can be generated using an exclusive OR operation based on the two first local verification data.

[0065] In an exemplary embodiment, the global check shard also includes a second global check shard, and the second global check data corresponding to the second global check shard is generated using an erasure code algorithm based on the data written in the second data shard, and one data center corresponds to one second global check shard.

[0066] For example, assuming there are two locations and three centers, and the second data shards are distributed in two data centers, then an erasure code algorithm can be used to generate three second global verification data based on the data written in the N second data shards, and written into the second global verification shards of the three data centers respectively.

[0067] Step S450, allocating storage nodes to the second data shard, the local check shard, and the global check shard, and writing the second data shard, the local check shard, and the global check shard to the storage nodes.

[0068] After the encoding is completed, according to the number of shards of all the encoded second data shards, local check shards, and global check shards of the current data stripe, the corresponding number of storage nodes is allocated between the data centers, and the shard data is written to the storage nodes. For example, if N = 28, M = 3, K = 17, then the encoded shards = 28 + 3 + 17 = 48, then 48 storage nodes can be allocated according to the encoded shards, and then the 48 shards can be concurrently written to the 48 storage nodes.

[0069] Please refer to Figure 3 , which is an example diagram of the arrangement of data stripes, and the figure takes N=28, M=3, K=17 as an example for explanation. As shown in the figure, shards 1-14 and 16-29 are the second data shards, of which 1-14 are the second data shards distributed in data center 1, and 16-29 are the second data shards distributed in data center 2; 15, 30 and 45 are local check shards, 31-44 and 46-48 are global check shards, of which 15 and 30 are the first local check shards, 45 is the second local check shard, 31-44 is the first global check shard, and 46-48 is the second global check shard. The specific encoding process is roughly as follows:

[0070] 1. The data of a single data stripe is filled into shards 1 to 14 and 16 to 29.

[0071] 2. Construct an LRC (28, 2, 3) code, encode the 28 filled second data slices, generate 2 local check data and 3 global check data, the 2 local check data are written into the 15th and 30th slices respectively, and the 3 global check data are written into the 46th to 48th slices respectively.

[0072] 3. Construct a RS (k = 4, p = 2) code and divide the 28 data blocks into 7 groups. The groups are:

[0073] {1,2,16,17},{3,4,18,19},{5,6,20,21},{7,8,22,23},{9,10,24,25},{11,12,26,27},{13,14,28,29};

[0074] After encoding according to RS (k=4, p=2), the generated check data are written into {31,32}, {33,34}, {35,36}, {37,38}, {39,40}, {41,42}, {43,44} in the 7-point group respectively.

[0075] 4. The 15th and 30th slices are XORed, and the resulting check data is written into the 45th slice. At this point, strip encoding is complete.

[0076] Please refer to Figure 4 , which is an exemplary diagram of the data writing principle of the data processing method of an embodiment of the present application, wherein the data stripe is Figure 3 Taking the data stripe of as an example, as shown in the figure, the data writing process is roughly as follows:

[0077] 1. Read user data through the upload end of the object storage system (client, web, or SDK), and upload user data by direct upload or multi-slice upload.

[0078] 2. After receiving the data, the storage gateway cuts the data into strips with a size of 28*shard_size and Figure 3 The corresponding data arrangement process is encoded to generate 48 data slices.

[0079] 3. Allocate 48 writable storage nodes through the disk allocation algorithm. The disk allocation algorithm can be designed in the gateway, or a separate module can be designed to implement the logic of disk allocation.

[0080] 4. The storage gateway writes 48 data shards to the storage node in parallel. If the storage write fails, the failed data block needs to be reallocated and rewritten until all data blocks are written.

[0081] In an exemplary embodiment, the data processing method of the embodiment of the present application may also include: in the event of a failure in the second data shard, performing data repair based on the first local check shard, or, performing data repair based on the first global check shard through a dedicated line of the data center.

[0082] In actual applications, it can be determined whether to perform data repair based on the first local check slice or through the dedicated line based on the first global check slice according to the load of the dedicated line between data centers. For example, when the dedicated line load is high, it is determined to perform data repair based on the first local check slice; when the dedicated line load is low, it is determined to perform data repair based on the first global check slice through the dedicated line.

[0083] by Figure 3 For example, when repairing based on the first local check shards (shards 15 and 30), the penalty ratio of the repair is relatively high, with a penalty ratio coefficient of 14, but no dedicated line is required, which can avoid increasing the load on the dedicated line; when repairing based on the first global check shards (shards 31-44) through the dedicated line, a dedicated line is required, but the penalty ratio of the repair is relatively low, with a penalty ratio coefficient of only 4.

[0084] In an exemplary embodiment, Figure 5 As shown, the data processing method of the embodiment of the present application may also include steps S510 to S520:

[0085] Step S510, when the first local check shard fails, data repair is performed based on the second data shard of the data center corresponding to the failed first local check shard, or data repair is performed based on the first local check shard and the second local check shard of other data centers through the dedicated line of the data center.

[0086] Continue with Figure 3For example, in the event of a failure in the first local check shard (shards 15 and 30), data repair can be performed on the second data shard of the data center corresponding to the failed first local check shard. The penalty ratio for repair is relatively high, with a penalty ratio coefficient of 14, but no dedicated line is required, and the load on the dedicated line will not be increased. For example, if shard 30 fails, data repair can be performed based on the second data shards 16-29 of data center 2 corresponding to shard 30. Data repair can also be performed based on the first local check shards and second local check shards of other data centers through the dedicated line of the data center. A dedicated line is required, but the penalty ratio for repair is relatively low, with a penalty ratio coefficient of only 2. For example, if shard 15 fails, repair is performed based on shards 30 and 45.

[0087] Step S520, when the second local check slice fails, data is repaired according to the first global check slice of the data center corresponding to the second local check slice, or data is repaired according to the first local check slice through the dedicated line of the data center.

[0088] For example, in the event that the second local check shard 45 fails, data repair can be performed based on the first global check shards (shards 31-44) of data center 3, with a penalty ratio of 14; data repair can also be performed based on the first local check shards (shards 15 and 30) through the dedicated line of the data center.

[0089] In an exemplary embodiment, the data processing method of the embodiment of the present application may also include: in the event of a failure of the first global check shard, data repair is performed through a dedicated line of the data center according to the second data shard of the group corresponding to the failed first global check shard.

[0090] Continue with Figure 3 For example, if the first global check slice 31 fails, data repair can be performed through a dedicated line according to the second data slice ({1,2,16,17}) of the corresponding group of slice 31, and the penalty ratio of the repair is 4.

[0091] In an exemplary embodiment, the data processing method of the embodiment of the present application may further include: when a failure occurs in the second global check shard, performing data repair using M second data shards.

[0092] For example, if the second global check shard (46, 47 or 48) fails, data repair is performed using shards 1-14 of data center 1 and shards 16-29 of data center 2, a total of 28 shards, and the penalty ratio for repair is 28.

[0093] In order to more clearly illustrate the data processing method of the embodiment of the present application, the following is an explanation through a specific example (wherein the data strip is represented by Figure 3For example, the scenario takes two locations and three centers as an example):

[0094] Assume that the three data centers are AZ1, AZ2, and AZ3, and the data centers are interconnected through 100 Gb / s dedicated lines.

[0095] The data writing embodiment is described as follows:

[0096] 1. A certain number of storage gateways are deployed in AZ1, AZ2, and AZ3 respectively, and they support the S3 protocol of standard object storage.

[0097] 2. Assume that a user uploads a 28MB file and the size of a single shard in the storage system is 512KB.

[0098] 3. The user calls NewMultipartUpload through an http request to obtain an uploadID for the uploaded file.

[0099] 4. The user logically divides the uploaded file into two shards of 14 MB each (recording the file offset, no splitting is required).

[0100] 5. Concurrently call S3's PutobjectPart through http according to {uploadID, partNumber} for these two data shards to upload the shard data.

[0101] 6. The shards are sent to a gateway under a certain AZ through server load balancing. Assuming it is AZ1, AZ1 receives 14MB of data in a streaming manner, then AZ1 splits it according to the internal shard size of 512KB, and splits it into 28 internal data shards.

[0102] 7. The gateway encodes the 28 internal data fragments into 48 data fragments according to the target encoding method of the embodiment of the present application.

[0103] 8. The gateway calls the disk allocation module to allocate 48 different storage nodes for the 48 data shards.

[0104] 9. The gateway writes 48 data shards concurrently to the 48 allocated different storage nodes.

[0105] 10. The gateway returns PutobjectPart success.

[0106] 11. After waiting for the user to upload both parts, call CompleteMultipartUpload through the http protocol to complete the file upload.

[0107] Degenerate read:

[0108] Assume that a storage node corresponding to the user's file fails and cannot be read. The data reading process is as follows:

[0109] 1. The user reads the 28MB file that was just uploaded. Assume that the first 14MB is read successfully.

[0110] 2. When reading the 15MB through the storage gateway, access to the storage node fails, triggering an End Of File error on the disk input.

[0111] 3. Since the location of the 15MB data fragment is the first data block of the data stripe (in AZ1), the degraded read process is entered.

[0112] 4. The gateway of AZ1 determines the load of the current dedicated line. Assuming that the load of the current dedicated line is low, the gateway determines to use the dedicated line for data repair, reads slices 16 and 17 in the stripe from AZ2, uses the dedicated line, reads slice 31 (or slice 32) in the stripe from AZ3, and decodes it in AZ1 through RS(4,2) to decode the data information of slice 1.

[0113] 5. The gateway of AZ1 transmits the 15MB data fragment back through the http protocol.

[0114] 6. The gateway of AZ1 continues to send other data shards to the user to complete the file download.

[0115] In the related art, Figure 3 For example, if shards 1-14 fail, local repair is used, and 14 blocks of data are needed for repair, with a repair penalty ratio of 14; while the data processing method of the embodiment of the present application, if a dedicated line repair method is used, only 4 blocks of data are needed for repair, with a repair penalty ratio of 4, which is 2 / 7 of the repair penalty ratio of the related art. If shards 15, 30, or 45 fail, since shards 15 and 30 are linearly calculated to get 45, only 2 blocks of data are needed, with a repair penalty ratio of 2, which is 1 / 7 of the repair penalty ratio of the related art.

[0116] The data processing method of the embodiment of the present application divides the target storage data into several first data shards according to the data storage capacity of a single data stripe, wherein the data stripe includes N second data shards distributed in at least two data centers, M local check shards distributed in at least three data centers, and K global check shards distributed in at least three data centers; each first data shard is cut into N parts and written into a second data shard of a data stripe, and a local check shard and a global check shard corresponding to the current data stripe are generated according to the data written in the current second data shard; the encoded shards are allocated and written into storage nodes; since the repair can be performed through the local check shard or the global check shard, the repair can be performed through the data of a single data center or the data between data centers, thereby improving the reliability of the data, avoiding the disadvantage that the data can only be repaired through data transmission between data centers, and the penalty ratio of the repair is relatively low; in addition, since the encoding is performed through the data arrangement between data centers, the redundancy of the data is low, the storage cost is low, and the disadvantages of the EC within the cluster + the XOR between clusters method are also avoided, and the complexity of decoding is reduced.

[0117] Embodiment 2

[0118] Figure 6 A block diagram of a data processing device 600 according to the second embodiment of the present application is schematically shown, and the data processing device 600 can be divided into one or more program modules, and one or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment.

[0119] like Figure 6 As shown, the data processing device 600 may include a receiving module 610 , a segmentation module 620 , a generation module 630 , a first writing module 640 and a second writing module 650 .

[0120] The receiving module 610 is used to divide the target storage data into a plurality of first data shards according to the data storage capacity of a single data stripe when receiving the target storage data, wherein the data stripe includes N second data shards distributed in at least two data centers, M local check shards and K global check shards, the local check shards are distributed in at least three data centers and correspond to local check data used to repair data within the data center, and the global check shards are distributed in at least three data centers and correspond to global check data used to repair data between data centers;

[0121] A splitting module 620, configured to split each first data shard into N parts, and write each part into a second data shard of a data stripe;

[0122] A generation module 630, configured to generate local check data and global check data corresponding to the current data stripe according to the data currently written to the second data slice;

[0123] A first writing module 640 is used to write the generated local check data and the generated global check data into the local check slice and the global check slice of the current data stripe respectively;

[0124] The second writing module 650 is used to allocate storage nodes to the second data shard, the local check shard and the global check shard, and write the second data shard, the local check shard and the global check shard into the storage nodes.

[0125] In an exemplary embodiment, the generation module 630 is also used to: generate first global verification data corresponding to each of the groups according to the data written by each of the groups in the current data stripe, and the global verification data includes the first global verification data; the first writing module 640 is also used to: write the first global verification data to the first global verification shard, the first global verification shard is different from the data center corresponding to the second data shard, and the global verification shard includes the first global verification shard.

[0126] In an exemplary embodiment, one data center corresponds to one local check shard, and the local check shard includes several first local check shards and one second local check shard. The first local check data corresponding to the first local check shard is generated by using an erasure code algorithm based on the data written by the second data shard, and the second local check data corresponding to the second local check shard is generated by using an exclusive OR operation based on the first local check data.

[0127] In an exemplary embodiment, the global check shard also includes a second global check shard, and the second global check data corresponding to the second global check shard is generated using an erasure code algorithm based on the data written in the second data shard, and one data center corresponds to one second global check shard.

[0128] In an exemplary embodiment, the data processing device 600 is also used to: in the event of a failure of the second data shard, perform data repair based on the first local check shard, or perform data repair based on the first global check shard via a dedicated line of the data center.

[0129] In an exemplary embodiment, the data processing device 600 is also used to: in the event of a failure of the first local check shard, perform data repair based on the second data shard of the data center corresponding to the failed first local check shard, or, perform data repair based on the first local check shard and the second local check shard of other data centers through a dedicated line of the data center; in the event of a failure of the second local check shard, perform data repair based on the first global check shard of the data center corresponding to the second local check shard, or, perform data repair based on the first local check shard through a dedicated line of the data center.

[0130] In an exemplary embodiment, the data processing device 600 is also used to: when the first global check slice fails, perform data repair according to the second data slice of the corresponding group of the failed first global check slice through the dedicated line of the data center.

[0131] In an exemplary embodiment, the data processing device 600 is further configured to: when a failure occurs in the second global check slice, perform data repair using the M second data slices.

[0132] Embodiment 3

[0133] Figure 7 The hardware architecture diagram of a computer device 700 suitable for the data processing method according to the third embodiment of the present application is schematically shown. The computer device 700 can be a device that can automatically perform numerical calculations and / or data processing according to pre-set or stored instructions. For example, it can be a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers), a gateway, etc. Figure 7 As shown, the computer device 700 includes at least but is not limited to: a memory 710, a processor 720, and a network interface 730 which can communicate with each other through a system bus. Among them:

[0134] The memory 710 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 710 can be an internal storage module of the computer device 700, such as a hard disk or memory of the computer device 700. In other embodiments, the memory 710 can also be an external storage device of the computer device 700, such as a plug-in hard disk equipped on the computer device 700, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card, etc. Of course, the memory 710 can also include both the internal storage module of the computer device 700 and its external storage device. In this embodiment, the memory 710 is generally used to store the operating system and various application software installed on the computer device 700, such as the program code of the data processing method, etc. In addition, the memory 710 can also be used to temporarily store various types of data that have been output or are to be output.

[0135] In some embodiments, the processor 720 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 720 is generally used to control the overall operation of the computer device 700, such as performing control and processing related to data interaction or communication with the computer device 700. In this embodiment, the processor 720 is used to run the program code stored in the memory 710 or process data.

[0136] The network interface 730 may include a wireless network interface or a wired network interface, and the network interface 730 is generally used to establish a communication link between the computer device 700 and other computer devices. For example, the network interface 730 is used to connect the computer device 700 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 700 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0137] It should be pointed out that Figure 7 Only a computer device having components 710 - 730 is shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0138] In this embodiment, the data processing method stored in the memory 710 can also be divided into one or more program modules and executed by one or more processors (processor 720 in this embodiment) to complete the embodiment of the present application.

[0139] Embodiment 4

[0140] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method in the embodiment are implemented.

[0141] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card, etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the data processing method in the embodiment, etc. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.

[0142] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0143] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A data processing method, characterized in that: include: In the case of receiving the target storage data, the target storage data is divided into a plurality of first data shards according to the data storage capacity of a single data stripe, wherein the data stripe includes N second data shards distributed in at least two data centers, M local check shards and K global check shards, the local check shards are distributed in at least three data centers and correspond to local check data used to repair data within the data center, and the global check shards are distributed in at least three data centers and correspond to global check data used to repair data between data centers; Splitting each of the first data slices into N parts, and writing each of the parts into the second data slice of one of the data stripes; Generate local check data and global check data corresponding to the current data stripe according to the data currently written to the second data slice; Writing the generated local check data and the generated global check data into the local check slice and the global check slice of the current data stripe respectively; A storage node is allocated for the second data shard, the local check shard, and the global check shard, and the second data shard, the local check shard, and the global check shard are written into the storage node.

2. The data processing method according to claim 1, characterized in that: The second data slice of each data stripe is configured as L groups, and the generating of local check data and global check data corresponding to the current data stripe according to the data written in the current second data slice includes: Generate first global check data corresponding to each of the groups according to the data written by each of the groups in the current data stripe, wherein the global check data includes the first global check data; The step of writing the generated local check data and the generated global check data into the local check slice and the global check slice of the current data stripe respectively includes: The first global check data is written into a first global check shard, the first global check shard and the second data shard correspond to different data centers, and the global check shards include the first global check shard.

3. The data processing method according to claim 2, characterized in that: One data center corresponds to one local check shard, and the local check shard includes several first local check shards and one second local check shard. The first local check data corresponding to the first local check shard is generated by using an erasure code algorithm based on the data written by the second data shard, and the second local check data corresponding to the second local check shard is generated by using an exclusive OR operation based on the first local check data.

4. The data processing method according to claim 3, characterized in that: The global check shard also includes a second global check shard. The second global check data corresponding to the second global check shard is generated using an erasure code algorithm based on the data written in the second data shard. One data center corresponds to one second global check shard.

5. The data processing method according to claim 4, characterized in that: The method further comprises: In the event of a failure of the second data shard, data repair is performed based on the first local check shard, or data repair is performed based on the first global check shard via a dedicated line in the data center.

6. The data processing method according to claim 4, characterized in that: The method further comprises: In the event that the first local check shard fails, data repair is performed based on the second data shard of the data center corresponding to the failed first local check shard, or data repair is performed based on the first local check shard and the second local check shard of other data centers through a dedicated line of the data center; In the event of a failure of the second local check shard, data repair is performed based on the first global check shard of the data center corresponding to the second local check shard, or data repair is performed based on the first local check shard through a dedicated line of the data center.

7. The data processing method according to claim 4, characterized in that: The method further comprises: In the event that the first global check slice fails, data repair is performed through a dedicated line of the data center according to the second data slice of the corresponding group of the failed first global check slice.

8. The data processing method according to claim 4, characterized in that: The method further comprises: In the event that the second global check shard fails, data repair is performed using the M second data shards.

9. A data processing device, characterized in that: include: A receiving module, configured to divide the target storage data into a plurality of first data shards according to the data storage capacity of a single data stripe when receiving the target storage data, wherein the data stripe includes N second data shards distributed in at least two data centers, M local check shards, and K global check shards, wherein the local check shards are distributed in at least three data centers and correspond to local check data used to repair data within the data center, and the global check shards are distributed in at least three data centers and correspond to global check data used to repair data between data centers; a splitting module, used for splitting each of the first data slices into N pieces, and then writing each piece into the second data slice of one of the data stripes; A generation module, used to generate local check data and global check data corresponding to the current data stripe according to the data currently written to the second data slice; A first writing module, used to write the generated local check data and the generated global check data into the local check slice and the global check slice of the current data stripe respectively; The second writing module is used to allocate a storage node to the second data shard, the local check shard and the global check shard, and write the second data shard, the local check shard and the global check shard into the storage node.

10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor is used to implement the steps of the data processing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed by at least one processor to enable the at least one processor to perform the steps of the data processing method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Data storage fault-tolerant redundancy method and system, computer equipment and storage medium

    CN120523648A