A coding method, a decoding method and a corresponding device in a distributed system environment

By combining RS coding and MSR coding in a distributed system, and using local verification and global verification methods, we optimize the data recovery solution, solve the problem of high recovery cost of traditional RS coding, and achieve lower network bandwidth occupation and response. time, improving system performance and scalability.

CN111984443BActive Publication Date: 2024-09-03ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910439739.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-05-24
Publication Date
2024-09-03
Estimated Expiration
2039-05-24

AI Technical Summary

Technical Problem

In distributed systems, traditional RS coding requires calling multiple data disks during data recovery, resulting in high recovery costs and occupying network bandwidth and IO resources. Especially when calling across regions, the response time further increases, affecting system performance.

Method used

Using a method that combines RS coding and MSR coding, the data recovery plan is optimized by performing local verification and global verification in the distributed system, using local verification data for rapid recovery, and using global verification data for cross-regional recovery. When using it, joint coding is used to reduce the recovery cost.

Benefits of technology

Without affecting the system's fault tolerance and storage cost, it significantly reduces the network bandwidth and response time for data recovery, improves system performance, and has excellent scalability, making it suitable for various partitioned system environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111984443B
    Figure CN111984443B
Patent Text Reader

Abstract

The present application proposes an encoding method, a decoding method and a corresponding device in a distributed system environment, which relates to the field of encoding fault tolerance technology. The method includes: first encoding the original data to obtain global verification data, second encoding the original data to obtain local verification data; storing the original data in one or more data partitions of the distributed system; storing the global verification data and local verification data corresponding to the original data in the data partition where the original data is stored. For the distributed system environment, the recovery cost is optimized without affecting the system fault tolerance and storage cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of coding error tolerance, and in particular to a coding method, a decoding method and a corresponding device in a distributed system environment. Background Art

[0002] At present, the storage scale of distributed systems is becoming larger and larger; and device errors in distributed systems are also a problem that cannot be ignored. Therefore, data storage cost and reliability are factors that need to be considered when designing distributed systems. Erasure codes can minimize the system's storage overhead while ensuring the same data reliability.

[0003] Erasure codes can add m pieces of coded data (used to store correction codes) to n copies of original data, and can restore the original data through any n pieces of data among the n+m pieces. This type of erasure code is also called a maximum distance separable code. Currently, the most widely used traditional code in the industry is RS coding. By adjusting the parameters k and m, it can have the performance of tolerating errors in any number of disks, but RS coding has obvious defects, which are mainly reflected in its performance in recovering data. RS coding needs to call the data of k data disks to recover any erroneous data disk. The increase in recovery cost will occupy additional network bandwidth, IO resources and recovery time. In a distributed system environment, cross-regional data calls will also occupy more network bandwidth, and the response time will be further improved. Summary of the invention

[0004] The present application provides an encoding method, a decoding method and a corresponding device in a distributed system environment, and optimizes the recovery cost of the distributed system environment without affecting the system's fault tolerance and storage cost.

[0005] The technical solutions adopted are as follows:

[0006] In a first aspect, the present invention provides an encoding method in a distributed system environment, comprising:

[0007] Performing a first encoding on the original data to obtain global verification data, and performing a second encoding on the original data to obtain local verification data;

[0008] Storing the original data in one or more data partitions of a distributed system;

[0009] The global verification data and the local verification data corresponding to the original data are stored in the data partition where the original data is stored.

[0010] Preferably, based on the data block of the original data, the original data is evenly stored in each data partition of the distributed system; the number of local verification data corresponding to the original data stored in each data partition is the same; the number of global verification data corresponding to the original data stored in each data partition is the same.

[0011] Preferably, the first encoding is RS encoding; the second encoding is MSR encoding.

[0012] In a second aspect, the present invention provides a decoding method in a distributed system environment, comprising:

[0013] Read the original data stored in the current partition;

[0014] When the amount of damage to the original data is less than or equal to a preset first threshold, the original data is restored according to a second encoding method using the local verification data stored in the current partition to obtain complete original data;

[0015] When the amount of damage to the original data is greater than a preset first threshold, the original data is restored according to a first encoding method using the global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system to obtain complete original data.

[0016] Preferably, when the amount of damage to the original data is greater than a preset second threshold, the local verification data and global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system are used to restore the original data in a joint encoding method of the first encoding and the second encoding to obtain the complete original data, wherein the second threshold is greater than the first threshold.

[0017] Preferably, the first encoding is RS encoding; the second encoding is MSR encoding.

[0018] In a third aspect, the present invention provides an encoding device in a distributed system environment, comprising:

[0019] The encoding module is configured to perform a first encoding on the original data to obtain global verification data, and perform a second encoding on the original data to obtain local verification data;

[0020] A partitioning module, configured to store the original data in one or more data partitions of a distributed system;

[0021] The allocation module is configured to store global verification data and local verification data corresponding to the original data in the data partition where the original data is stored.

[0022] Preferably, the partitioning module stores the original data evenly in each data partition of the distributed system according to the data blocks of the original data; the number of local verification data corresponding to the original data stored in each data partition is the same; and the number of global verification data corresponding to the original data stored in each data partition is the same.

[0023] In a fourth aspect, the present invention provides a decoding device in a distributed system environment, comprising:

[0024] A communication module, configured to read the original data stored in the current partition;

[0025] A recovery module, configured to, when the amount of damage to the original data is less than or equal to a preset first threshold, recover the original data according to a second encoding method using local verification data stored in the current partition to obtain complete original data;

[0026] The recovery module is also configured to, when the amount of damage to the original data is greater than a preset first threshold, use the global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system to recover the original data according to the first encoding method to obtain complete original data.

[0027] Preferably, the recovery module is also configured to, when the amount of damage to the original data is greater than a preset second threshold, use the local verification data and global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system to recover the original data in a joint encoding method of the first encoding and the second encoding to obtain the complete original data, wherein the second threshold is greater than the first threshold.

[0028] Compared with the prior art, this application has the following beneficial effects:

[0029] This application combines RS coding and MSR coding into a new coding form using the idea of ​​local verification. The new coding form ensures the data reliability and storage cost of the entire distributed system while also having the excellent performance of low single-disk recovery cost of MSR coding. Compared with the traditional RS coding scheme in a distributed system environment, the performance of the system will be greatly improved after using the new coding; and it has excellent scalability, and after adjusting the parameters, it can be applied to various partitioned system environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A flowchart of an encoding method in a distributed system environment according to an embodiment of the present invention;

[0031] Figure 2 A schematic diagram of partitioning and storing original data and verification data in a distributed system according to an embodiment of the present invention;

[0032] Figure 3 A flowchart of a decoding method in a distributed system environment according to an embodiment of the present invention;

[0033] Figure 4 A schematic diagram of the structure of an encoding device in a distributed system environment according to an embodiment of the present invention;

[0034] Figure 5 A schematic diagram of the structure of a decoding method in a distributed system environment according to an embodiment of the present invention;

[0035] Figure 6 The figure is a flowchart of a decoding process in a distributed system environment according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The technical solution of the present application will be described in more detail below with reference to the accompanying drawings and embodiments.

[0037] It should be noted that, if there is no conflict, the embodiments of the present application and the various features in the embodiments can be combined with each other, all within the protection scope of the present application. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than here.

[0038] In one configuration, the distributed system includes multiple data partitions, each data partition includes one or more data disks for storing data, and each data disk may include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0039] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium. The memory may include one or more modules.

[0040] Computer readable media include permanent and non-permanent, removable and non-removable storage media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0041] Embodiment 1

[0042] like Figure 1 As shown, an embodiment of the present invention provides an encoding method in a distributed system environment, including:

[0043] S101, performing a first encoding on the original data to obtain global verification data, and performing a second encoding on the original data to obtain local verification data;

[0044] S102, storing the original data in one or more data partitions of the distributed system;

[0045] S103. Store global verification data and local verification data corresponding to the original data in the data partition where the original data is stored.

[0046] In an embodiment of the present invention, taking the number of original data as n as an example, the n copies of the original data are first encoded to obtain m copies of global verification data, and the n copies of the original data are second encoded to obtain k copies of local verification data; the n copies of the original data are saved in a data partition of the distributed system, and accordingly, the global verification data and local verification data corresponding to the original data are also stored in the partition where the original data is located.

[0047] Preferably, according to the data block of the original data, the original data is evenly stored in each data partition of the distributed system; the number of local verification data corresponding to the original data stored in each data partition is the same; the number of global verification data corresponding to the original data stored in each data partition is the same;

[0048] In an embodiment of the present invention, taking the number of original data as n as an example, n copies of original data are evenly stored in each data partition of the distributed system; the number of local verification data stored in each data partition is the same; and the number of global verification data stored in each data partition is the same.

[0049] In the embodiment of the present invention, n copies of original data are stored evenly in each data partition of the distributed system for load balancing. For example, 21 copies of original data are evenly distributed in 3 data partitions, and each partition stores 7 copies of original data and their corresponding global verification data and local verification data. In addition, the average distribution in actual applications is load balanced as much as possible. For example, if there are two data partitions and 21 copies of original data are transmitted, 10 copies of original data and their corresponding global verification data and local verification data can be stored in one data partition, and 11 copies of original data and their corresponding global verification data and local verification data can be stored in another data partition.

[0050] like Figure 2 As shown, the embodiment of the present invention is 3AZ (Available Zone refers to the available zone in the system), where each zone has 6 copies of original data, each zone has 2 copies of local verification data (denoted as P in the figure), and each zone has 12 copies of global verification data, with 4 copies stored in each zone (denoted as G in the figure). The amount of data in the entire distributed system is 18+6+12.

[0051] Preferably, the first encoding is RS encoding; the second encoding is MSR encoding.

[0052] MSR coding is a type of regeneration code, which can significantly reduce the cost of data recovery by changing the traditional coding method.

[0053] In the embodiment of the present invention, local verification data is generated by using MSR encoding according to data partitions and stored in the corresponding data partitions; global verification data is generated according to the RS encoding scheme and distributed to each partition. Combining the advantages and disadvantages of RS encoding and MSR encoding, the two encodings are combined into a new encoding using the idea of ​​local verification. The new encoding ensures the data reliability and storage cost of the entire system while also having the excellent performance of low single-disk recovery cost of MSR encoding. Compared with the RS encoding scheme in a 3AZ environment, the performance of the system will be greatly improved after using the new encoding; in addition, the embodiment of the present invention has excellent scalability, and can be applied to various partitioned system environments after adjusting the parameters.

[0054] Embodiment 2

[0055] like Figure 3 As shown, an embodiment of the present invention provides a decoding method in a distributed system environment, including:

[0056] S201, reading the original data stored in the current partition;

[0057] S202: When the amount of damage to the original data is less than or equal to a preset first threshold, recover the original data according to a second encoding method using the local verification data stored in the current partition to obtain complete original data;

[0058] S203. When the amount of damage to the original data is greater than a preset first threshold, the original data is restored according to a first encoding method using the global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system to obtain complete original data.

[0059] In an embodiment of the present invention, when the amount of damage to the original data is greater than a preset second threshold, the local verification data and global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system are used to restore the original data in a joint encoding method of the first encoding and the second encoding to obtain the complete original data, wherein the second threshold is greater than the first threshold.

[0060] In the embodiment of the present invention, the first encoding is RS encoding; the second encoding is MSR encoding.

[0061] In the embodiment of the present invention, when performing data decoding and recovery, different situations are discussed. If the amount of lost data is small, for example, only 1 or 2 copies of data are wrong. Then it is only necessary to use the local verification data to adopt the MSR coding recovery scheme for recovery. At this time, the optimization effect of MSR coding on the recovery cost can be utilized. If a large-scale data error occurs, such as the failure of all data in a data partition. Then global verification data is required for recovery. At this time, the RS coding scheme is used, so the recovery cost is the same as the RS coding. In some extreme cases, global verification data and local verification data may be required for joint recovery. The data reliability of this system is achieved.

[0062] Embodiment 3

[0063] like Figure 4 As shown, an embodiment of the present invention provides an encoding device in a distributed system environment, including:

[0064] The encoding module 100 is configured to perform a first encoding on the original data to obtain global verification data, and perform a second encoding on the original data to obtain local verification data;

[0065] A partitioning module 200, configured to store the original data in one or more data partitions of a distributed system;

[0066] The allocation module 300 is configured to store global verification data and local verification data corresponding to the original data in the data partition where the original data is stored.

[0067] In an embodiment of the present invention, the encoding module 100 performs a first encoding on n copies of original data to obtain m copies of global verification data, and performs a second encoding on the n copies of original data to obtain k copies of local verification data; the partitioning module 200 saves the n copies of original data to a data partition of a distributed system, and the allocation module 300 also stores the global verification data and local verification data corresponding to the original data in the partition where the original data is located.

[0068] In an embodiment of the present invention, the partitioning module 200 stores the original data evenly in each data partition of the distributed system based on the data blocks of the original data; the number of local verification data corresponding to the original data stored in each data partition is the same; and the number of global verification data corresponding to the original data stored in each data partition is the same.

[0069] Embodiment 4

[0070] like Figure 5 As shown, an embodiment of the present invention provides a decoding device in a distributed system environment, including:

[0071] The communication module 400 is configured to read the original data stored in the current partition;

[0072] The recovery module 500 is configured to, when the amount of damage to the original data is less than or equal to a preset first threshold, recover the original data according to a second encoding method using the local verification data stored in the current partition to obtain complete original data;

[0073] The recovery module 500 is also configured to, when the amount of damage to the original data is greater than a preset first threshold, use the global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system to recover the original data according to the first encoding method to obtain complete original data.

[0074] In an embodiment of the present invention, the recovery module 500 is also configured to, when the amount of damage to the original data is greater than a preset second threshold, use the local verification data and global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system to recover the original data in a joint encoding method of the first encoding and the second encoding to obtain the complete original data, wherein the second threshold is greater than the first threshold.

[0075] Embodiment 5

[0076] like Figure 2 As shown, the encoding method is as follows: local check data is generated according to the partition using MSR encoding and stored in the partition to which it belongs. Global check data is generated according to the RS encoding scheme and evenly distributed to each partition. Figure 2In the example, each partition has 2 copies of local verification data. There are 12 copies of global verification data in total, 4 copies are stored in each partition. The entire encoding parameter is 18+6+12, of which 18 copies of original data are stored, and an average of 6 copies are stored in each partition.

[0077] like Figure 6 As shown in the figure, the data recovery is discussed in different situations. If the amount of lost data is small, for example, only 1 or 2 copies of data are wrong, it is only necessary to use the local encoding and MSR encoding recovery scheme for recovery. This is to take advantage of the optimization effect of MSR encoding on the recovery cost. If a large-scale data error occurs, such as a partition completely failing. Global checksum data is required for recovery. Due to the RS encoding scheme used, the recovery cost is the same as that of RS encoding. In some extreme cases, global checksum and local checksum may be required for joint recovery.

[0078] The embodiment of the present invention combines the advantages of RS coding and MSR coding, so that the new coding is more suitable for the system in the 3AZ environment in terms of network bandwidth and response time.

[0079] In the embodiment of the present invention, the local check data is encoded using the MSR encoding scheme, which has obvious advantages in network bandwidth occupation during recovery compared to direct XOR operation encoding. For example, when the partition encoding is configured as 4+2, there are 2 local check data and 4 global check data. The LRC (Local Reconstruction Code, a new type of encoding using local check) encoding scheme needs to call 4 times the amount of data, while the MSR encoding only needs to call 2.5 times the amount of data.

[0080] Although the embodiments disclosed in the present invention are as above, the contents are only embodiments adopted for facilitating understanding of the technical solution of the present invention, and are not used to limit the present invention. Any technician in the technical field to which the present invention belongs can make any modifications and changes in the form and details of the implementation without departing from the core technical solution disclosed in the present invention, but the protection scope defined by the present invention shall still be subject to the scope defined in the attached claims.

Claims

1. A coding method in a distributed system environment, characterized in that: include: Performing a first encoding on the original data to obtain global verification data, and performing a second encoding on the original data to obtain local verification data; The first encoding is RS encoding, and the second encoding is MSR encoding; According to the data blocks of the original data, the original data is stored evenly in each data partition of the distributed system; The global verification data and local verification data corresponding to the original data are stored in the data partition where the original data is stored; wherein the number of local verification data corresponding to the original data stored in each data partition is the same; and the number of global verification data corresponding to the original data stored in each data partition is the same.

2. A decoding method in a distributed system environment, characterized in that: include: Read the original data stored in the current partition; When the amount of damage to the original data is less than or equal to a preset first threshold, the original data is restored according to a second encoding method using the local verification data stored in the current partition to obtain complete original data; When the amount of damage to the original data is greater than a preset first threshold, the original data is restored according to a first encoding method using the global check data stored in the current partition and the global check data stored in other data partitions of the distributed system to obtain complete original data; When the amount of damage to the original data is greater than a preset second threshold, the local verification data and the global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system are used to restore the original data in a joint encoding method of the first encoding and the second encoding to obtain the complete original data, wherein the first encoding is RS encoding and the second encoding is MSR encoding; and the second threshold is greater than the first threshold.

3. A coding device in a distributed system environment, characterized in that: include: The encoding module is configured to perform a first encoding on the original data to obtain global verification data, and perform a second encoding on the original data to obtain local verification data; The first encoding is RS encoding, and the second encoding is MSR encoding; A partitioning module, configured to store the original data evenly in each data partition of the distributed system according to the data blocks of the original data; An allocation module is configured to store global verification data and local verification data corresponding to the original data in a data partition where the original data is stored, wherein the number of local verification data corresponding to the original data stored in each data partition is the same; and the number of global verification data corresponding to the original data stored in each data partition is the same.

4. A decoding device in a distributed system environment, characterized in that: include: A communication module, configured to read the original data stored in the current partition; A recovery module, configured to, when the amount of damage to the original data is less than or equal to a preset first threshold, use the local verification data stored in the current partition to perform data recovery on the original data according to the second encoding method to obtain complete original data; The recovery module is further configured to, when the amount of damage to the original data is greater than a preset first threshold, use the global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system to perform data recovery on the original data according to the first encoding method to obtain complete original data; The recovery module is also configured to, when the amount of damage to the original data is greater than a preset second threshold, use the local verification data and the global verification data stored in the current partition and the global verification data stored in other data partitions of the distributed system to recover the original data in a joint encoding method of the first encoding and the second encoding to obtain the complete original data, wherein the first encoding is RS encoding and the second encoding is MSR encoding; and the second threshold is greater than the first threshold.