Data recovery method, electronic equipment and storage medium

By determining the lost target data block from the source data block and the verification data block in the distributed storage system, and using the encoded associated data in the surviving data block for recovery, the problem of excessive network bandwidth occupancy when the data block is lost is solved, and efficient data recovery is achieved.

CN120045379APending Publication Date: 2025-05-27ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311594556.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In a distributed storage system, when data blocks are lost, all surviving data blocks need to be read to repair the lost data blocks, resulting in a large amount of repair bandwidth, occupying a large amount of network bandwidth, and thus causing network blockage.

Method used

By determining the lost target data block from the source data block and the verification data block, the data in the surviving data block that is associated with the target data block is restored, avoiding the use of all unlost data, thereby reducing network bandwidth usage.

Benefits of technology

It effectively reduces the network bandwidth occupied during data recovery, avoids network blockage, and improves the reliability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045379A_ABST
    Figure CN120045379A_ABST
Patent Text Reader

Abstract

The invention discloses a data recovery method, electronic equipment and a storage medium, belongs to the technical field of distributed storage, and is used for reducing network bandwidth occupied during data recovery. The method comprises: determining a lost target data block from a source data block and a verification data block, the verification data block being obtained by encoding the source data block, the verification data block comprising a first number of first verification data blocks, any first verification data in the first verification data block is obtained by encoding part of source data in the source data block; under the condition that the number of the target data blocks is smaller than a first number, survivor data having coding association with the target data blocks are obtained from survivor data blocks, and the survivor data blocks are data blocks except the target data blocks in the source data blocks and the first verification data blocks; the survivor data is partial data of the first verification data and / or the source data in the survivor data block; and recovering the target data block according to the coding association between the survivor data and the target data block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of distributed storage technology, and specifically relates to a data recovery method, an electronic device and a storage medium. Background Art

[0002] Under the background of the rapid development of information and communication technology, storage, network and computing have become the three pillars of information and communication technology (ICT). With the popularization of high-speed fixed-line and mobile Internet, data has exploded, and massive data has created a lot of value in analysis and mining. Distributed storage systems have received extensive attention and application due to their good high availability and scalability. However, in distributed storage systems, failures of various storage nodes often occur, which may cause data loss in the storage system. Erasure Coding (EC) is a commonly used technology to combat data loss. Through a certain encoding method, the source data block in the storage system is encoded to generate a check data block. When a data block is lost, all surviving data blocks in the source data block and the check data block are read, and the lost data block can be repaired according to the decoding method of the erasure code. During the repair process, the total amount of source data and check data in the downloaded surviving data block is called the repair bandwidth.

[0003] For large-scale storage systems, no matter how many data blocks are lost, all surviving data blocks need to be read when repairing the lost data blocks, which will generate a large amount of repair bandwidth, occupy a large amount of network bandwidth, and then cause network congestion problems. Summary of the invention

[0004] The embodiments of the present application provide a data recovery method, an electronic device, and a storage medium, which can solve the problem that a large amount of repair bandwidth is generated when repairing lost data blocks, so that a large amount of network bandwidth is occupied, thereby causing network congestion.

[0005] In a first aspect, an embodiment of the present application provides a data recovery method, the method comprising: determining a lost target data block from a source data block and a check data block, the check data block being obtained by encoding the source data block, the check data block comprising a first number of first check data blocks, any first check data in the first check data blocks being obtained by encoding part of source data in the source data block; when the number of target data blocks is less than the first number, obtaining surviving data that is coded associated with the target data block from surviving data blocks, the surviving data block being a data block other than the target data block in the source data block and the first check data block, the surviving data being part of the first check data and / or source data in the surviving data block; and recovering the target data block based on the coded association between the surviving data and the target data block.

[0006] In a second aspect, an embodiment of the present application provides a data recovery device, which includes: a determination module, used to determine a lost target data block from a source data block and a check data block, the check data block being obtained by encoding the source data block, the check data block including a first number of first check data blocks, any first check data in the first check data blocks being obtained by encoding part of the source data in the source data block; an acquisition module, used to acquire, when the number of the target data blocks is less than the first number, surviving data that is coded associated with the target data block from surviving data blocks, the surviving data block being a data block other than the target data block in the source data block and the first check data block, and the surviving data being part of the first check data and / or source data in the surviving data block; an execution module, used to recover the target data block according to the coded association between the surviving data and the target data block.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In an embodiment of the present application, a lost target data block is determined from a source data block and a check data block, the check data block is obtained by encoding the source data block, the check data block includes a first number of first check data blocks, and any first check data in the first check data block is obtained by encoding part of the source data in the source data block; when the number of target data blocks is less than the first number, surviving data that is coded associated with the target data block is obtained from the surviving data blocks, the surviving data blocks are data blocks other than the target data blocks in the source data blocks and the first check data blocks, and the surviving data are part of the first check data and / or source data in the surviving data blocks; according to the coded association between the surviving data and the target data block, the target data block is restored, and when restoring the target data block, it is restored by using the surviving data that is coded associated with the lost data block, thereby avoiding the use of all the non-lost data, reducing the network bandwidth occupied when restoring the target data block, and avoiding the problem of network congestion. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flowchart of a data recovery method provided by an embodiment of the present application;

[0011] Figure 2 is a schematic diagram of a disk array provided in an embodiment of the present application;

[0012] Figure 3 This is a data correspondence diagram provided in an embodiment of the present application;

[0013] Figure 4 This is another data correspondence diagram provided in an embodiment of the present application;

[0014] Figure 5 It is a structural schematic diagram of a data recovery device provided in an embodiment of the present application;

[0015] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0017] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0018] The data recovery method, electronic device and storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0019] Figure 1 A data recovery method provided by an embodiment of the present application is shown, and the method can be executed by an electronic device, and the electronic device may include: a server and / or a terminal device. In other words, the method can be executed by software or hardware installed in the electronic device, and the method includes the following steps:

[0020] Step 102: Determine the lost target data block from the source data block and the check data block.

[0021] The data recovery method in the embodiment of the present application is applicable to a disk array of k+r1+1, where k is the number of disks storing source data, and the source data in the disks can also be referred to as source data blocks. r1+1 is the number of disks storing verification data, and the verification data in the disks can also be referred to as verification data blocks. The verification data blocks are obtained by encoding the source data blocks, and the verification data blocks include a first number of first verification data blocks, and any first verification data in the first verification data blocks is obtained by encoding part of the source data in the source data blocks.

[0022] like Figure 2In the disk array schematic diagram shown, each disk in the disk array has w storage areas of the same size, where w is a positive integer. The source data stored in each storage area can be represented by d, and the stored check data can be represented by p. For example, d(2,1) can represent the second source data in disk 1, and p(2,r1) can represent the second check data in the r1th check data disk. At this time, all the source data contained in disk 1 can be called the first source data block, and the check data contained in disk k+r1 can be called the r1th check data block. The 1st to r1th check data blocks are local check data blocks, that is, the first check data blocks mentioned above, and r1 is the first number mentioned above. The first check data block is only related to part of the source data in the disk array. The r1+1th disk stores a global check block, which is related to all the source data blocks in the disk array. In the actual encoding process of encoding the source data block to obtain the check data block, the space of the r1+1th disk may be used in full, only partially, or not at all. The data recovery method in the embodiment of the present application enables the above-mentioned k, r1+1 storage system to resist data loss in data blocks in any r1 disks (including source data disks and verification data disks), and completely recover the lost data content of the disks. Therefore, in the embodiment of the present application, when data loss occurs, the lost target data block can be first determined from the source data block and the verification data block.

[0023] Step 104: when the number of the target data blocks is less than the first number, obtain, from the surviving data blocks, surviving data that is coding-associated with the target data blocks.

[0024] Specifically, in an embodiment of the present application, the surviving data block is a data block other than the target data block in the source data block and the first verification data block. In an embodiment of the present application, any first verification data is obtained by encoding part of the source data in the source data block, and the part of the source data is coded associated with the any first verification data, and the coding association can also be used to represent the process of encoding part of the source data to obtain the first verification data. In the case where the number of lost target data blocks is less than the first number, surviving data coded associated with the target data block can be obtained from the surviving data block, and the surviving data is part of the first verification data and / or source data in the surviving data block. For example, in the case where the target data block is the source data block, then the surviving data coded associated with the target data block can be obtained according to the encoding process of encoding the source data in the target data block to obtain the first verification data block. For another example, in the case where the target data block is the first verification data block, the surviving data coded associated with the target data block can be obtained according to the encoding process of encoding the source data in the source data block to obtain the target data block. That is, in the embodiment of the present application, when the number of lost target data blocks is less than the first number, it is not necessary to obtain all the data in the surviving data blocks to perform data recovery of the target data blocks.

[0025] Step 106: Restore the target data block according to the coding association between the surviving data and the target data block.

[0026] Specifically, since the surviving data that is coded associated with the target data block is coded associated with the target data block, that is, the surviving data can be obtained by encoding the data in the target data block, or the data in the target data block is obtained by encoding the surviving data. Therefore, after obtaining the surviving data that is coded associated with the lost target data block, the target data block can be restored according to the coding association between the surviving data and the target data block. For example, the source data in the target data block is encoded to obtain the surviving data, then when the target data block is lost, the target data block can be restored according to the inverse encoding process of encoding the source data to obtain the surviving data.

[0027] The data recovery method provided by the embodiment of the present application determines the lost target data block from the source data block and the check data block, the check data block is obtained by encoding the source data block, the check data block includes a first number of first check data blocks, and any first check data in the first check data block is obtained by encoding part of the source data in the source data block; when the number of target data blocks is less than the first number, obtains surviving data that is coded associated with the target data block from the surviving data blocks, the surviving data blocks are data blocks other than the target data blocks in the source data blocks and the first check data blocks, and the surviving data are the first check data and / or part of the source data in the surviving data blocks; according to the coding association between the surviving data and the target data block, the target data block is restored, and when restoring the target data block, it is not necessary to use all the data in the surviving data block, and the surviving data that is coded associated with the lost data block can be used for restoration, thereby avoiding the use of all the non-lost data, reducing the network bandwidth occupied when restoring the target data block, and avoiding the problem of network congestion.

[0028] In one implementation, before determining the lost target data block from the source data block and the check data block, the method further includes:

[0029] Obtain the first quantity, the second quantity of the source data blocks, a source data array and the number of source data array rows, wherein the source data array includes the second quantity of source data blocks; encode the source data array according to the first quantity, the second quantity and the number of source data array rows to obtain the first check data block.

[0030] In an embodiment of the present application, it is necessary to encode the source data in the source data block to obtain a first verification data block. Specifically, it is first necessary to obtain the first number of the first verification data block, the second number of the source data block, the source data array composed of the source data, and the number of source data array rows. Then, the source data in the source data array can be encoded according to the first number, the second number, and the number of source data array rows to obtain the first verification data block. Among them, the second number is an integer greater than 0, the first number is an integer greater than 0, and the first number can be set according to actual needs. In an embodiment of the present application, the number of global verification data blocks can also be obtained, and the number of global verification data blocks can also be set according to actual needs. The number of global verification data blocks is an integer greater than or equal to 0 and less than or equal to the number of data array rows. In an embodiment of the present application, the first number can be r1, the number of global verification data blocks can be r2, the number of data array rows is w, and the number of data array rows w can be determined according to pre-configuration, wherein logr1(w) needs to be a positive integer, satisfying the number of verification data blocks r=r1+r2 / w. Among them, the size of each first verification data block is w times the size of each global verification data block. The value range of the number of check data blocks r is r1≤r≤r1+1. r is at most r1 plus 1, which means that the present invention can recover any r1 or less data block loss by using at most r1+1 redundancy, and the redundancy is lower than that of the traditional LRC code, and the resource utilization rate is higher.

[0031] Among them, a first check data block corresponds to a column in the source data array, and a global check data block corresponds to an item in the source data array. In one example, r1=4, r2=2, w=4, which means there are 4 first check data blocks p1, p2, p3, p4, and p4.5 represents a global check data block, wherein the decimal place of the subscript indicates that the number of check data blocks is less than the number of rows w, that is, the global check data block does not occupy a complete column. In this example, the decimal 0.5 means that the global check data block occupies half of a complete column. In this way, when recovering the target data block, it is not necessary to use all the data in the surviving data block, and it can be recovered through the surviving data that is coded associated with the lost data block, avoiding the use of all the non-lost data, reducing the network bandwidth occupied when recovering the target data block, and avoiding the problem of network congestion.

[0032] In one implementation, encoding the source data array according to the first number, the second number, and the number of rows of the source data array to obtain the first check data block includes:

[0033] According to the second number, the number of rows of the source data array, the source data array and the first generation coefficient corresponding to the source data, generate the first first check data block of the first number of first check data blocks, wherein any first check data of the first first check data block is coded associated with the corresponding current row source data in the source data array; according to the second number, the number of rows of the source data array, the source data array and the first generation coefficient corresponding to the source data, generate the first check parts of the other first check data blocks of the first number of first check data blocks except the first first check data block, wherein the first check part of each of the other first check data blocks is coded associated with the corresponding current row source data in the source data array; according to the first number, the number of rows of the source data array and the source data array, determine the second check parts of the other first check data blocks.

[0034] Specifically, in the first number of check data blocks, the first check data block is generated by encoding the source data in the source data array according to the second number, the number of source data array rows and the first generation coefficient corresponding to the source data. Among them, any first check data of the first check data block is coded associated with the corresponding current row source data in the source data array, that is, the following relationship exists:

[0035]

[0036] Wherein, p(i,1) represents the i-th first check data of the first check data block, the value range of i is [1, w], w represents the number of rows in the data array, k represents the second number of source data blocks, that is, the number of columns in the data array, and a 1,i,j When generating the first check data block, the generation coefficient corresponding to the source data in the i-th row and j-th column of the data array, wherein the generation coefficient is a coefficient multiplied by the source data block in the current row when obtaining the check data block in each row of the data array, and is obtained according to at least the following parameters: a finite field size q, and a number of source data blocks k. The finite field size q is determined by preconfiguration.

[0037] In an embodiment of the present application, except for the first first check data block, other first check data blocks mainly include two parts: a first check part and a second check part. Except for the first first check data block, each check block in other first check data blocks is the sum of the first check part and the second check part on the configured finite field q. The first check parts of other first check data blocks except the first first check data block in the first number of first check data blocks can be generated according to the second number, the number of source data array rows, the source data array and the first generation coefficient corresponding to the source data, wherein the first check part of each other first check data block is coded associated with the corresponding current row source data in the source data array. That is, the following relationship exists:

[0038]

[0039] Wherein, p(i,s) represents the i-th first check data of the s-th first check data block, the value range of s is [2,r1], the value range of i is [1,w], w is the number of rows in the data array, r1 is the first number of the first check data blocks, k represents the second number of source data blocks, that is, the number of columns in the source data array, a s,i,j (j ranges from 1 to k) is the generation coefficient of the first verification data in the i-th row in the s-th first verification data block, and the generation coefficients are all positive integers.

[0040] In an embodiment of the present application, the second check part of the first check data needs to be determined based on the first number of the first check data blocks, the number of source data array rows and the source data array. When recovering the target data block, it is not necessary to use all the data in the surviving data block, and the data can be recovered by the surviving data that is coded associated with the lost data block, thereby avoiding the use of all the non-lost data and the need to introduce too much redundancy. The network bandwidth occupied when recovering the target data block can be reduced, thereby ensuring the reliability of the system.

[0041] In one implementation, determining the second check part of the other first check data blocks based on the first quantity, the number of source data array rows and the source data array includes: determining the number of sub-data array columns based on the first quantity and the number of source data array rows; dividing the source data array into at least one sub-data array based on the number of sub-data array columns; determining an index matrix based on the number of source data array rows and the number of sub-data array columns, the number of rows in the index matrix being the same as the number of source data array rows, and the number of columns in the index matrix being the same as the number of sub-data array columns; assigning values ​​to elements in the index matrix based on the first quantity; and determining the second check part of the other first check data blocks based on the elements of the index matrix and the sub-data array.

[0042] Specifically, before determining the second verification part of the first verification data block, it is necessary to first determine the number of sub-data array columns k' according to the first number and the number of source data array rows. The number of sub-data array columns k' can be obtained according to the following relationship:

[0043] k'=r1×logr1(w)

[0044] Wherein, k' is a positive integer less than or equal to k; and the number of columns of the sub-data array is equal to w.

[0045] According to the sub-data array k', the source data array is divided into at least one sub-data array. 1 to k' source data blocks are the first sub-data array, k'+1 to 2k' source data blocks are the second sub-data array, and when k cannot be divided by k', the remaining remainder data blocks constitute the last incomplete sub-data array. In one example, the number of source data blocks k=4, the number of first check data blocks r1=4, the number of data array rows w=4, and the number of sub-data array columns k'=4 is obtained. In this example, the sub-data array is the same as the source data array. In another example, the number of source data blocks k=50, the number of first check data blocks r1=4, the number of data array rows w=1024, and the number of sub-data array columns k'=20 is obtained. In this example, the first 1 to 20 columns of the source data array are a sub-data array, the 21 to 40 columns of the source data array constitute another sub-data array, and the 41 to 50 columns constitute the first half of a sub-data array.

[0046] According to the number of source data array rows and the number of sub-data array columns, the index matrix can be determined. The number of rows in the index matrix is ​​the same as the number of source data array rows, and the number of columns in the index matrix is ​​the same as the number of sub-data array columns. That is, the dimension of the index matrix is ​​w*k'. In the embodiment of the present application, it is necessary to assign values ​​to the elements in the index matrix according to the first number of the first check data block, and the elements of the index matrix only contain integers of [0, r1-1].

[0047] The second check parts of the second to r1 check blocks in the r1 first check data blocks are obtained from the source data of other rows in the source data array, and the number of other row source data included in the second check part is at least At most The corresponding relationship between the other rows of source data in the source data array and the first check block can be determined according to the elements in the index matrix T and the sub-data array. Then the second check part of other first check data blocks is determined. The check data block obtained by the above method reduces the computational complexity without introducing a large amount of redundancy, and significantly reduces the repair bandwidth and improves the system reliability, which can alleviate the network congestion caused by restoring the damaged storage node data.

[0048] In one implementation, assigning values ​​to elements in the index matrix according to the first quantity includes:

[0049] According to the column number and the first quantity of the elements in each column of the index matrix, each column of the elements is grouped respectively; for each column of the elements in the index matrix, a first target group is determined according to the column number and the first quantity; the elements in each column of the index matrix that belong to the first target group are assigned a preset value; according to the first quantity, the elements in each column of the index matrix that do not belong to the first target group are assigned a value.

[0050] Specifically, the elements of each column are grouped according to the column number and the first quantity of the elements of each column in the index matrix. For example, the row number of each column in the index matrix is ​​divided into r1 groups. Each column in the index matrix contains w rows, and these w rows are divided into r1 groups. The rows contained in each group are G1'=(G1, G1+r1, ..., Gr1n-r1+1), G2'=(G2, G2+r1, ..., Gr1n-r1+2), ..., Gr1'=(Gr1, G2r1, ..., Gr1n), where G1, G2, ..., Gr1n are arrays obtained by sorting the row numbers from small to large and evenly dividing them into r1n groups, where in Indicates rounding up, y indicates the column number, and the value range is 1 to k'. In an example, r1 = 4, w = 16, k = 8, then k' = 8, for column y = 1, n = 1, then G1' = G1 = [1, 2, 3, 4], G2' = G2 = [5, 6, 7, 8], G3' = G3 = [9, 10, 11, 12], G4' = G4 = [13, 14, 15, 16]. For column y=5, n=2, then G1=[1], G2=[2], ..., G16=

[16] , G1'=[G1, G5, G9, G13]=[1, 5, 9, 13], G2'=[G2, G6, G10, G14]=[2, 6, 10, 14], G3'=[G3, G7, G11, G15]=[3, 7, 11, 15], G4'=[G4, G8, G12, G16]=[4, 8, 12, 16].

[0051] For each column element of the index matrix, the first target group is determined according to the column number and the first quantity, and the elements in each column element of the index matrix that belong to the first target group are assigned a preset value. That is, for the yth column of the index matrix, c=((y-1)mod r1)+1 is calculated, and the corresponding elements whose row numbers belong to the first target group Gc' are assigned a preset value, for example, the preset value can be 0. According to the first quantity, the elements in each column element of the index matrix that do not belong to the first target group are assigned a value. That is, except for the corresponding elements whose row numbers belong to the first target group Gc', the elements corresponding to the remaining r1-1 groups of row numbers are assigned values ​​of 1 to r1-1 respectively. In a specific example, r1=4, w=16, k=8, k'=8, for column y=5, it can be calculated that c=1, G1'=[G1, G5, G9, G13]=[1, 5, 9, 13], G2'=[G2, G6, G10, G14]=[2, 6, 10, 14], G3'=[G3, G7, G11, G15]=[3, 7, 11, 15], G4'=[G4, G8, G12, G16]=[4, 8, 12, 16]. At this time, Gc'=G1', so the corresponding element whose row number belongs to G1' is assigned 0, that is, T(1,5)=T(5,5)=T(9,5)=T(13,5)=0, the corresponding element whose row number belongs to G2' is assigned 1, that is, T(2,5)=T(6,5)=T(10,5)=T(14,5)=1, the corresponding element whose row number belongs to G3' is assigned 2, that is, T(3,5)=T(7,5)=T(11,5)=T(15,5)=2, and the corresponding element whose row number belongs to G4' is assigned 3, that is, T(4,5)=T(8,5)=T(12,5)=T(16,5)=3.

[0052] In one implementation, determining the second check part of the other first check data block according to the elements of the index matrix and the sub-data array includes:

[0053] Traverse each element in the index matrix to obtain target elements whose element values ​​are greater than a preset threshold; determine the target first verification data block corresponding to each target element according to the first index of each target element in the index matrix and determine the target source data corresponding to each target element from each sub-data array; determine the target first verification data in the target first verification data block corresponding to each target element according to the first index of each target element; add the target source data corresponding to each target element as the second verification part to the target verification data corresponding to each target element.

[0054] Specifically, each element in the index matrix can be traversed to obtain the target element whose element value is greater than a preset threshold value, and the preset threshold value can be set according to actual needs, for example, it can be set to 0. According to the first index of each target element in the index matrix, the target first verification data block corresponding to each target element can be determined and the target source data corresponding to each target element can be determined from each sub-data array. According to the first index of each target element, the target first verification data in the target first verification data block corresponding to each target element can be determined. Then, the target source data corresponding to each target element can be added as a second verification part to the target verification data corresponding to each target element. After determining the second verification part of other first verification data blocks, when recovering the target data block, it is not necessary to use all the data in the surviving data block, and it can be recovered by the surviving data that is coded and associated with the lost data block, avoiding the use of all the non-lost data, not needing to introduce too much redundancy, and can reduce the network bandwidth occupied when recovering the target data block, ensuring the reliability of the system.

[0055] In one implementation, determining, according to the first index of each target element, the target first verification data in the target first verification data block corresponding to each target element includes:

[0056] According to the first index of each target element, determine the second target group to which each target element belongs; determine the second index of each target element from each second target group; according to the second index of each target element, determine the target first verification data from the target first verification data block corresponding to each target element.

[0057] Traverse each element in the index matrix T. If T(x,y) is equal to the preset threshold, for example, the preset threshold is 0, T(x,y) is equal to 0, which means that the source data block indexed as (x,y) in each sub-data array is not added to the first verification data block as "other row source data". In a specific example, x=1, y=1, r1=4, k'=4, k=10, T(1,1)=0, then the source data d(1,1), d(1,5), d(1,9) are not used as other row source data; if T(x,y) is equal to t, t>0, it means that the source data block indexed as (x,y) in each sub-data array is added to the verification data p(s,t+1) as "other row source data". The target first verification data s is determined as follows: first, group according to the row number corresponding to column y in the first index, find the second target group Gm' (m≠c) to which x belongs, and obtain the second index index_x of x therein. According to the second index number, the target first verification data can be determined from the target first verification data block, then the target first verification data s = Gc' (index_x).

[0058] In a specific example, the index matrix k=8,k'=4,r1=4,w=4,the first column and the fifth column in the source data array correspond to the first column of the index matrix. Then d(1,1) and d(1,5) are added as other row data to the check data p(1,2), d(2,1) and d(2,5) are added as other row data to the check data p(1,3), and d(3,1) and d(3,5) are added as other row data to the check data p(1,4).

[0059] In another specific example, Figure 3 As shown, k=8, k'=8, r1=4, and w=16. Figure 3 The 8 columns on the left are source data blocks, and the 4 columns on the right are first check data blocks, where the first check data block 1' is only related to the current row source data, and the first check data blocks 2' to 4' contain other row data. Figure 3 The corresponding relationship between the source data block as "other row data" and the first check data block 2'-4' is given. Figure 3 As shown, source data blocks d(5,1), d(6,1), d(7,1), d(8,1) and d(2,5), d(1,6), d(1,7), d(1,8) correspond to check data blocks p(1,2), p(2,2), p(3,2), p(4,2). To further illustrate the correspondence, Figure 4 Specific examples of their corresponding relationships are given. Figure 4 In the figure, d(1,5), d(2,5) and the check data p(1,2) have the same pattern and color, which indicates that d(1,5) and d(2,5) are added to the check data p(1,2) as other row data.

[0060] In one implementation, after determining the lost target data block from the source data block and the check data block, the method further includes:

[0061] When the number of the target data blocks is equal to the first number, obtain the first verification data block, the source data block and the second verification data block that are not lost, and any second verification data block of the second verification data block is obtained by encoding all the source data in the source data block; and restore the target data block according to the coding association between the first verification data block, the source data block, the second verification data block and the target data block.

[0062] In an embodiment of the present application, the check data block also includes a second check data block, which is the global check data block mentioned above. The second check data block is obtained by encoding all source data in the source data block. When the number of lost target data blocks is equal to the first number mentioned above, it is necessary to obtain the first check data block, the source data block, and the second check data block that are not lost. The target data block is restored according to the coding association between the first check data block, the source data block, and the second check data block that are not lost and the target data block. It is ensured that the lost target data block can be restored when the number of lost target data blocks is equal to the first number.

[0063] In one implementation, before determining the lost target data block from the source data block and the check data block, the method further includes:

[0064] Obtain a third number of second verification data blocks, a source data array and the number of source data array columns, wherein the source data array includes a second number of source data blocks; determine the second verification data in each of the second verification data blocks based on the third number, the number of source data array columns, the second generation coefficient of each of the second verification data blocks and each of the source data in the source data array.

[0065] Specifically, to encode the source data in the source data block to obtain the second check data block, firstly, the third number r2 of the second check data blocks and the number k of source data array columns need to be obtained, and then the second check data in each second check data block is determined according to the third number and the number k of source data array columns, the second generation coefficient of each second check data block and each source data in the source data array. That is, r2 second check data blocks are obtained according to the following relationship:

[0066]

[0067] Where p(t,r+1) represents the tth second check data block, the value range of t is [1, r2], β i,j,t is the generation coefficient of the t-th second check data block, and the generation coefficient is a positive integer. The second check data block is related to all source data blocks. The generation coefficients of the first check data block and the second check data block can be obtained from the generation matrix of the RS code. It is ensured that when the number of lost target data blocks is equal to the first number, the lost target data block can be restored by the second check data block.

[0068] The data recovery method provided by this application is described below through specific examples:

[0069] Example 1:

[0070] In this example, as shown in Table 1 below, the number of source data blocks k=4, the number of first check data blocks r1=2, the number of second check data blocks r2=0, the number of sub-data array columns k'=4, the number of repetitions dup=1, res=0, and the number of source data array rows according to w=r1 k / r1 It is obtained that the number of source data array rows w=4, g(x,y) represents the linear combination of the source data of the xth row and the first k columns of the source data array, and y represents the yth first check data block. The first first check data block is a linear combination of the source data of the current row of the source data array, and the second first check data block is a linear combination of the source data of the current row of the source data array and the source data of at least one other row. The second first check data block of the first row is obtained by g(1,2)+d(3,1)+d(2,3), where g(1,2) is a linear combination of the source data of the current row, and d(3,1) and d(2,3) are the source data of other rows. When the first source data block is lost, d(1,1) and d(2,1) are first restored based on the two check data g(1,1) and g(2,1) and the 6 non-lost source data of the 1st and 2nd rows. Then g(1,2)+d(3,1)+d(2,3) and g(2,2)+d(4,1)+d(1,4) are used to restore d(3,1) and d(4,1). No additional data needs to be read at this time. Therefore, to restore a lost column, only half of the non-lost data needs to be read, avoiding the need to read all the non-lost data when restoring the data block. This application significantly reduces the repair bandwidth when restoring the lost data block.

[0071] Table 1

[0072]

[0073] Example 2:

[0074] In this example, as shown in Table 2 below, the number of source data blocks k=4, the number of first check data blocks r1=4, the number of second check data blocks r2=0, the number of rows of the sub-data array k'=4, the number of repetitions dup=1, res=0, and the number of rows of the source data array is calculated according to w=r1 k / r1It is obtained that the number of rows of the source data array is w=4, g(x,y) represents the linear combination of the source data of the xth row and the first k columns of the source data array, and y represents the yth first check data block. The first first check data block is a linear combination of the source data of the current row of the source data array, and the second to fourth first check data blocks are linear combinations of the source data of the current row of the source data array and at least one other row of source data. In this example, the second first check data block of the first row in the check data array is obtained by g(1,2)+d(2,1), where g(1,2) is a linear combination of the source data of the current row, and d(2,1) is the source data of other rows. When the first source data block is lost, d(1,1) is first restored based on g(1,1) and the three non-lost source data of the first row. Then use g(1,2)+d(2,1), g(1,3)+d(3,1) and g(1,4)+d(4,1) to restore d(2,1), d(3,1) and d(4,1). No additional data needs to be read. Therefore, to restore a lost column, only 1 / 4 of the unlost data needs to be read, avoiding the need to read all the unlost data when restoring the data block. This application significantly reduces the repair bandwidth when restoring the lost data block.

[0075] Table 2

[0076]

[0077] Example 3:

[0078] In this example, as shown in Table 3 below, the number of source data blocks k=8, the number of sub-data array columns k'=4, the number of repetitions dup=2, res=2, the number of first check data blocks r1=4, the number of second check data blocks r2=0, and the number of rows of the source data array is w=r1 k' / r1 It is obtained that the number of source data array rows w=4, g(x,y) represents the linear combination of the source data of the xth row and the first k columns of the source data array, and y represents the yth first check data block. The first first check data block is a linear combination of the source data of the current row of the source data array, and the second to fourth first check data blocks are linear combinations of the source data of the current row of the source data array and at least one other row of source data. d1~d4 is a sub-data array, d5~d8 is also a sub-data array, and d9~d10 is part of a sub-data array. d(2,1), d(2,5), and d(2,9) have the same relative positions in different sub-data arrays. They play the same role in generating check data, and all serve as non-row source data to generate the second first check data block g(1,2)+d(2,1)+d(2,5)+d(2,9) of the first row in the check data array.

[0079] When the first source data block is lost, d(1,1) is first restored based on g(1,1) and the 9 non-lost source data in the first row. Then g(1,2)+d(2,1)+d(2,5)+d(2,9), g(1,3)+d(3,1)+d(3,5)+d(3,9) and g(1,4)+d(4,1)+d(4,5)+d(4,9) as well as d(2,5), d(3,5), d(4,5), d(2,9), d(3,9), d(4,9) are used to restore d(2,1), d(3,1) and d(4,1). At this time, no additional data needs to be read. Therefore, to restore the loss of the first column, only 19 / 52 of the non-lost data needs to be read, which avoids the need to read all the non-lost data when restoring the data block. The present application significantly reduces the repair bandwidth when restoring the lost data block.

[0080] Table 3

[0081]

[0082] Example 4:

[0083] In this example, as shown in Table 4 below, the number of source data blocks k=150, the number of sub-data array columns k'=4, the number of repetitions dup=37, res=2, the number of first check data blocks r1=4, the number of second check data blocks r2=2, and the number of source data array rows according to w=r1 k ' / r1 The number of rows of the source data array is obtained, w=4, g(x,y) represents the linear combination of the source data of the xth row and the first k columns of the array, and y represents the yth first check data block. h(x,1) represents the xth second check data block of the array. The first first check data block is a linear combination of the source data of the current row of the source data array, and the second to fourth first check data blocks are linear combinations of the source data of the current row of the source data array and at least one other row of source data. d1~d4 are a sub-data array, d145~d148 are also a sub-data array, and d149~d150 are part of a sub-data array. d(2,1), d(2,5), ..., d(2,145) and d(2,149) have the same relative positions in different sub-data arrays. They play the same role in generating verification data and are all used as non-row source data to generate the second first verification data block g(1,2)+d(2,1)+d(2,5)+...+d(2,145)+d(2,149) in the first row of the array.

[0084] When the first source data block is lost, d(1,1) is first restored based on g(1,1) and the 149 non-lost source data in the first row. Then, d(2,1), d(3,1) and d(4,1) are restored using the second to fourth first check data blocks in the first row of the array and the other row source data d(2,5), d(2,9), ..., d(2,149), d(3,5), d(3,9), ..., d(3,149) and d(4,5), d(4,9), ..., d(4,149). To restore the loss of the first column, about 43% of the non-lost data needs to be read, which avoids the need to read all the non-lost data when restoring the data block. The present application significantly reduces the repair bandwidth when restoring the lost data block.

[0085] When the 1st, 2nd, 3rd and 4th source data blocks are lost, it is necessary to read all the non-lost source data and the first check data block, and restore the lost source data by solving the linear equations containing 16 unknowns. If the coefficient matrix of the linear equations is not reversible, it is necessary to read the second check data block h(1,1) or h(2,1) or h(1,1) and h(2,1) to replace any one or two equations in the original equations until the coefficient matrix of the linear equations is reversible.

[0086] Table 4

[0087]

[0088] It should be noted that the data recovery method provided in the embodiment of the present application can be executed by a data recovery device or a control module in the data recovery device for executing the data recovery method. In the embodiment of the present application, the data recovery device provided in the embodiment of the present application is described by taking the data recovery device executing the data recovery method as an example.

[0089] Figure 5 Schematic diagram of the structure of a data recovery device according to an embodiment of the present application. Figure 5 As shown, the data recovery device 500 includes: a determination module 510 , an acquisition module 520 and an execution module 530 .

[0090] A determination module 510 is used to determine a lost target data block from a source data block and a check data block, wherein the check data block is obtained by encoding the source data block, and the check data block includes a first number of first check data blocks, and any first check data in the first check data blocks is obtained by encoding part of the source data in the source data block; an acquisition module 520 is used to acquire, when the number of the target data blocks is less than the first number, surviving data that is coded associated with the target data block from surviving data blocks, wherein the surviving data block is a data block other than the target data block in the source data block and the first check data block, and the surviving data is part of the first check data and / or source data in the surviving data block; an execution module 530 is used to restore the target data block according to the coded association between the surviving data and the target data block.

[0091] In one implementation, the execution module 530 is further used to obtain the first quantity, the second quantity of the source data blocks, a source data array and the number of source data array rows, the source data array including the second number of source data blocks; encode the source data array according to the first quantity, the second quantity, and the number of source data array rows to obtain the first check data block.

[0092] In one implementation, the execution module 530 is used to generate a first first check data block among the first number of first check data blocks according to the second number, the number of rows of the source data array, the source data array and the first generation coefficient corresponding to the source data, wherein any first check data of the first first check data block is coded associated with the corresponding current row source data in the source data array; generate a first check part of other first check data blocks among the first number of first check data blocks except the first first check data block according to the second number, the number of rows of the source data array, the source data array and the first generation coefficient corresponding to the source data, wherein the first check part of each of the other first check data blocks is coded associated with the corresponding current row source data in the source data array; determine the second check part of the other first check data blocks according to the first number, the number of rows of the source data array and the source data array.

[0093] In one implementation, the execution module 530 is used to determine the number of sub-data array columns based on the first number and the number of source data array rows; divide the source data array into at least one sub-data array based on the number of sub-data array columns; determine an index matrix based on the number of source data array rows and the number of sub-data array columns, the number of rows in the index matrix being the same as the number of source data array rows, and the number of columns in the index matrix being the same as the number of sub-data array columns; assign values ​​to elements in the index matrix based on the first number; and determine the second check part of the other first check data blocks based on the elements of the index matrix and the sub-data array.

[0094] In one implementation, the execution module 530 is used to group the elements in each column of the index matrix according to the column number and the first quantity; determine the first target group for each column of the index matrix according to the column number and the first quantity; assign the elements in each column of the index matrix that belong to the first target group to a preset value; and assign values ​​to the elements in each column of the index matrix that do not belong to the first target group according to the first quantity.

[0095] In one implementation, the execution module 530 is used to traverse each element in the index matrix to obtain target elements whose element values ​​are greater than a preset threshold; determine the target first verification data block corresponding to each target element according to the first index of each target element in the index matrix and determine the target source data corresponding to each target element from each sub-data array; determine the target first verification data in the target first verification data block corresponding to each target element according to the first index of each target element; and add the target source data corresponding to each target element as the second verification part to the target first verification data corresponding to each target element.

[0096] In one implementation, the execution module 530 is used to determine the second target group to which each target element belongs based on the first index of each target element; determine the second index of each target element from each second target group; and determine the target first verification data from the target first verification data block corresponding to each target element based on the second index of each target element.

[0097] In one implementation, the execution module 530 is further used to obtain, when the number of the target data blocks is equal to the first number, a first check data block, a source data block and a second check data block that are not lost, wherein any second check data block of the second check data block is obtained by encoding all source data in the source data block; and restore the target data block according to the coding association between the first check data block, the source data block, the second check data block and the target data block.

[0098] In one implementation, the execution module 530 is further used to obtain a third number of second verification data blocks, a source data array and a number of source data array columns, wherein the source data array includes a second number of source data blocks; and determine the second verification data in each of the second verification data blocks based on the third number, the number of source data array columns, the second generation coefficient of each of the second verification data blocks and each of the source data in the source data array.

[0099] The data recovery device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0100] The data recovery device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0101] The data recovery device provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0102] Alternatively, if Figure 6As shown, an embodiment of the present application further provides an electronic device 600, including a processor 601 and a memory 602, the memory 602 storing a program or instruction that can be run on the processor 601, and the program or instruction is implemented when executed by the processor 601: determining a lost target data block from a source data block and a check data block, the check data block is obtained by encoding the source data block, the check data block includes a first number of first check data blocks, any first check data in the first check data block is obtained by encoding part of the source data in the source data block; when the number of the target data blocks is less than the first number, obtaining surviving data that is coded associated with the target data block from surviving data blocks, the surviving data block is a data block other than the target data block in the source data block and the first check data block, and the surviving data is the first check data and / or part of the source data in the surviving data block; and restoring the target data block according to the coded association between the surviving data and the target data block.

[0103] In one implementation, before determining the lost target data blocks from the source data blocks and the check data blocks, the first number, the second number of the source data blocks, the source data array and the number of source data array rows are obtained, and the source data array includes the second number of source data blocks; the source data array is encoded according to the first number, the second number, and the number of source data array rows to obtain the first check data block.

[0104] In one implementation, the first first check data block of the first number of first check data blocks is generated based on the second number, the number of rows of the source data array, the source data array and the first generation coefficient corresponding to the source data, wherein any first check data of the first first check data block is coded associated with the corresponding current row source data in the source data array; the first check parts of the other first check data blocks of the first number of first check data blocks except the first first check data block are generated based on the second number, the number of rows of the source data array, the source data array and the first generation coefficient corresponding to the source data, wherein the first check part of each of the other first check data blocks is coded associated with the corresponding current row source data in the source data array; the second check parts of the other first check data blocks are determined based on the first number, the number of rows of the source data array and the source data array.

[0105] In one implementation, the number of sub-data array columns is determined based on the first number and the number of source data array rows; the source data array is divided into at least one sub-data array based on the number of sub-data array columns; an index matrix is ​​determined based on the number of source data array rows and the number of sub-data array columns, the number of rows in the index matrix being the same as the number of source data array rows, and the number of columns in the index matrix being the same as the number of sub-data array columns; elements in the index matrix are assigned values ​​based on the first number; and the second check part of the other first check data blocks is determined based on the elements of the index matrix and the sub-data array.

[0106] In one implementation, each column of elements in the index matrix is ​​grouped according to the column number and the first quantity; for each column of elements in the index matrix, a first target group is determined according to the column number and the first quantity; the elements in each column of the index matrix that belong to the first target group are assigned preset values; and according to the first quantity, the elements in each column of the index matrix that do not belong to the first target group are assigned values.

[0107] In one implementation, each element in the index matrix is ​​traversed to obtain target elements whose element values ​​are greater than a preset threshold; according to the first index of each target element in the index matrix, the target first verification data block corresponding to each target element is determined and the target source data corresponding to each target element is determined from each sub-data array; according to the first index of each target element, the target first verification data in the target first verification data block corresponding to each target element is determined; and the target source data corresponding to each target element is added as the second verification part to the target first verification data corresponding to each target element.

[0108] In one implementation, based on the first index of each target element, the second target group to which each target element belongs is determined; the second index of each target element is determined from each second target group; and based on the second index of each target element, the target first verification data is determined from the target first verification data block corresponding to each target element.

[0109] In one implementation, after determining the lost target data block from the source data block and the check data block, when the number of the target data blocks is equal to the first number, obtain the first check data block, the source data block and the second check data block that are not lost, and any second check data block of the second check data block is obtained by encoding all the source data in the source data block; and restore the target data block based on the coding association between the first check data block, the source data block, the second check data block and the target data block.

[0110] In one implementation, before determining the lost target data blocks from the source data blocks and the check data blocks, a third number of second check data blocks, a source data array, and the number of source data array columns are obtained, and the source data array includes a second number of source data blocks; based on the third number, the number of source data array columns, the second generation coefficient of each second check data block, and each source data in the source data array, the second check data in each second check data block is determined.

[0111] The specific execution steps can refer to the various steps of the above data recovery method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0112] It should be noted that the electronic devices in the embodiments of the present application include: servers, terminals, or other devices except terminals.

[0113] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0114] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).

[0115] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.

[0116] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned data recovery method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0117] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as ROM, RAM, magnetic disk or optical disk.

[0118] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0120] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A data recovery method, characterized in that, comprising: determining a lost target data block from source data blocks and parity data blocks, where the parity data blocks are obtained by encoding the source data blocks, the parity data blocks include a first number of first parity data blocks, and any first parity data in the first parity data blocks is obtained by encoding part of the source data in the source data blocks; when the number of the target data blocks is less than the first number, obtaining surviving data associated with the target data blocks in coding from surviving data blocks, where the surviving data blocks are data blocks other than the target data blocks in the source data blocks and the first parity data blocks, and the surviving data is part of the first parity data and / or source data in the surviving data blocks; restoring the target data blocks according to the coding association between the surviving data and the target data blocks.

2. The method according to claim 1, characterized in that, before determining the lost target data block from the source data blocks and the parity data blocks, further comprising: obtaining the first number, the second number of the source data blocks, a source data array, and the number of rows of the source data array, where the source data array includes the second number of source data blocks; encoding the source data array according to the first number, the second number, and the number of rows of the source data array to obtain the first parity data blocks.

3. The method according to claim 2, characterized in that, the encoding the source data array according to the first number, the second number, and the number of rows of the source data array to obtain the first parity data blocks includes: generating the first first parity data block among the first number of first parity data blocks according to the second number, the number of rows of the source data array, the source data array, and a first generation coefficient corresponding to the source data, where any first parity data in the first first parity data block has a coding association with the corresponding current row source data in the source data array; generating first parity parts of the other first parity data blocks among the first number of first parity data blocks except the first first parity data block according to the second number, the number of rows of the source data array, the source data array, and the first generation coefficient corresponding to the source data, where the first parity part of each of the other first parity data blocks has a coding association with the corresponding current row source data in the source data array; determining a second parity part of the other first parity data blocks according to the first number, the number of rows of the source data array, and the source data array.

4. The method according to claim 3, characterized in that, the determining the second parity part of the other first parity data blocks according to the first number, the number of rows of the source data array, and the source data array includes: determining the number of columns of a sub-data array according to the first number and the number of rows of the source data array; dividing the source data array into at least one sub-data array according to the number of columns of the sub-data array; Determine an index matrix according to the number of rows of the source data array and the number of columns of the sub-data array, where the number of rows in the index matrix is the same as the number of rows of the source data array, and the number of columns of the index matrix is the same as the number of columns of the sub-data array; Assign values to the elements in the index matrix according to the first quantity; Determine the second check part of the other first check data block according to the elements of the index matrix and the sub-data array.

5. The method according to claim 4, wherein, The assigning values to the elements in the index matrix according to the first quantity includes: Group the elements in each column of the index matrix respectively according to the column number of the elements in each column of the index matrix and the first quantity; For each column of elements in the index matrix, determine a first target group respectively according to the column number and the first quantity; Assign a preset value to the elements belonging to the first target group among the elements in each column of the index matrix; Assign values to the elements not belonging to the first target group among the elements in each column of the index matrix according to the first quantity.

6. The method according to claim 4, wherein, The determining the second check part of the other first check data block according to the elements of the index matrix and the sub-data array includes: Traverse each element in the index matrix to obtain target elements whose element values are greater than a preset threshold; Determine the target first check data block corresponding to each target element according to the first index of each target element in the index matrix, and determine the target source data corresponding to each target element from each sub-data array; Determine the target first check data in the target first check data block corresponding to each target element according to the first index of each target element; Add the target source data corresponding to each target element as the second check part to the target first check data corresponding to each target element.

7. The method according to claim 6, wherein, The determining the target first check data in the target first check data block corresponding to each target element according to the first index of each target element includes: Determine the second target group to which each target element belongs according to the first index of each target element; Determine the second index of each target element from each second target group; Determine the target first check data from the target first check data block corresponding to each target element according to the second index of each target element.

8. The method according to claim 1, wherein, After determining the missing target data block from the source data block and the check data block, it further includes: When the number of the target data blocks is equal to the first quantity, obtain the un-lost first check data block, source data block and the second check data block, and any second check data block of the second check data block is encoded from all the source data in the source data block; Restore the target data block according to the encoding association between the un-lost first check data block, source data block and the second check data block and the target data block.

9. The method according to claim 8, wherein, before determining the missing target data block from the source data block and the check data block, further comprising: obtaining a third quantity of second check data blocks, a source data array, and the number of columns of the source data array, the source data array including the second quantity of the source data blocks; determining second check data in each of the second check data blocks according to the third quantity, the number of columns of the source data array, second generation coefficients of each of the second check data blocks, and each of the source data in the source data array.

10. An electronic device, wherein, comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the data recovery method according to any one of claims 1-9.

11. A readable storage medium, wherein, the readable storage medium stores a program or instructions, the program or instructions, when executed by a processor, implementing the steps of the data recovery method according to any one of claims 1-9.