A data copy encoding method and storage medium for distributed storage system

By using Latin square scrambling matrices for data encoding in a decentralized storage system, the problems of high computational overhead and reliance on third parties are solved, fast conversion between copies and data security are achieved, and data reliability and access performance are ensured. .

CN114168979BActive Publication Date: 2024-09-20HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111320005.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-09
Publication Date
2024-09-20
Estimated Expiration
2041-11-09

AI Technical Summary

Technical Problem

Existing data copy encoding methods in distributed storage systems have excessive computational overhead or rely on trusted third parties, resulting in poor data access performance and the inability to achieve true decentralization.

Method used

Using the data scrambling method, the Latin square scrambling matrix is ​​used to encode the data to be stored, generate copies, and achieve rapid conversion between copies through the scrambling matrix of read amplification and randomness lower bound, avoiding dependence on a reliable third party. .

Benefits of technology

It improves data access performance, prevents storage providers from cheating, and ensures data reliability and security. At the same time, it does not rely on reliable third parties and reduces computing overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168979B
    Figure CN114168979B
Patent Text Reader

Abstract

The present invention discloses a data copy encoding method and storage medium for a distributed storage system, belonging to the field of information security, comprising: when a copy of the original data needs to be stored, a data scrambling step is performed on the original data, and the copy is stored; the data scrambling step comprises: after dividing the data to be encoded into scrambled blocks of size G, the scrambled blocks are used as elements in a matrix, and a corresponding matrix D=(d ij ) n*n ; G is the preset scrambling granularity, n = 2 m , m is a positive integer; the elements in the matrix D are scrambled using an n-order scrambling matrix to obtain a scrambled copy matrix as a copy of the data to be encoded; the read amplification caused by the scrambled matrix is ​​greater than a preset threshold and has a lower bound of randomness, wherein each element value represents the position of the element at the corresponding position in the matrix D in the scrambled copy after scrambling. The present invention can achieve rapid conversion between copies while ensuring data security and reliability, and does not rely on a reliable third party.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information security, and more specifically, relates to a data copy encoding method and a storage medium for a distributed storage system. Background Art

[0002] Decentralized storage, where users store data in anonymous and unmanaged devices on the Internet, may be a potential complement to traditional centralized storage, significantly saving capital expenditures and operating expenses. However, the anonymity and non-custodial nature of decentralized storage devices make malicious attacks on replicated data possible, thereby reducing the reliability of data.

[0003] John et al. defined a Sybil attack in a large-scale P2P system: a malicious entity can present multiple identities, thereby controlling a large portion of the system's nodes, causing system redundancy to be destroyed. Under the cover of anonymity, untrusted device owners can forge a large number of identities to collect as many copies of the same data as possible, but only store far fewer copies than they have collected, which seriously endangers the reliability of system data. Therefore, there is still a lot of research dedicated to solving the problems caused by this attack.

[0004] Replication proof is a new type of storage proof and an interactive protocol. Storage service providers can provide storage proof to users, proving that the user's data has been copied and stored on the service provider's only dedicated physical storage device. Replication proof can prevent various attacks such as Sybil attacks.

[0005] A Sybil attack is also a Nash equilibrium between users and storage providers. Providers will use Nash equilibrium to evaluate their actions to maximize their benefits, that is, to reach the Nash equilibrium point. From the perspective of storage space alone, providers will try to spend the least amount of storage space to earn the most benefits.

[0006] Ben et al. implemented a PoRep scheme to resist Sybil attacks in a completely public scenario. The scheme relies on time constraints, uses a very slow serial encoding function, and makes time assumptions about the encoding and communication processes. When the prover generates a proof for more than the set time limit, it is considered cheating. Ingmar et al. introduced a secure key routing protocol based on Kademlia, which relies on a trusted third party. By performing parallel searches on multiple unconnected paths, using cryptographic problems to limit the generation of free node IDs, and introducing reliable sibling broadcasts, the protocol has a high resistance to common attacks including Sybil attacks. However, in reality, it is difficult to find a completely trusted third party, and even if it is found, it is a huge expense for users.

[0007] In general, existing solutions either have excessive computational overhead, resulting in poor data access performance, or rely on trusted third parties and fail to achieve true decentralization. These shortcomings greatly reduce the applicability of decentralized storage to users and significantly limit the development of decentralized storage. Summary of the invention

[0008] In view of the defects of the prior art and the need for improvement, the present invention provides a data copy encoding method and storage medium for a distributed storage system, aiming to solve the technical problems that the existing data copy encoding method has excessive computational overhead or relies on a reliable third party.

[0009] To achieve the above object, according to one aspect of the present invention, a data replica encoding method for a distributed storage system is provided, comprising:

[0010] After receiving the original data to be stored and the corresponding storage request, the storage request is parsed to determine whether a copy of the original data needs to be stored. If so, the original data is used as the data to be encoded, and a data scrambling step is performed on it to generate a copy of the original data, and the copy is stored;

[0011] The data scrambling steps include:

[0012] (a1) After the data to be encoded is divided into scrambled blocks of size G, the scrambled blocks are used as elements in the matrix to construct the corresponding matrix D = (d ij ) n*n ; G is the preset scrambling granularity, n = 2 m , m is a positive integer;

[0013] (a2) Using an n-order scrambling matrix to scramble the elements in the matrix D, a scrambled copy matrix is ​​obtained as a copy of the data to be encoded; the read amplification rate caused by the scrambled matrix is ​​greater than a preset threshold and has a lower bound of randomness, wherein each element value represents the position of the element at the corresponding position in the matrix D in the scrambled copy after scrambling.

[0014] The data copy encoding method for a distributed storage system provided by the present invention realizes data encoding by data scrambling. Compared with the existing method for realizing data encoding based on cryptography or a trusted third party, the present invention can realize rapid conversion between copies, ensure data access performance, and does not rely on a reliable third party; because the read magnification caused by the scrambling matrix used in the present invention for data encoding is large enough (greater than a preset threshold), it is possible to add an inverse correlation between the storage space size used by the storage provider and other costs to be paid, so that the Nash equilibrium point between the storage provider and the user moves in the direction of paying more storage space, thereby effectively preventing the storage provider from cheating and ensuring data reliability; the scrambling matrix used in the encoding of the present invention also has a lower bound of randomness, which can effectively provide security guarantee. In general, the present invention uses a scrambling matrix that can cause a sufficiently large read magnification and has a lower bound of randomness to scramble the original data to realize encoding, which can realize rapid conversion between copies, ensure data access performance, and does not rely on a reliable third party, effectively solving the technical problems of the existing data copy encoding method having excessive computational overhead or relying on a reliable third party.

[0015] Furthermore, the scrambled matrix is ​​a Latin square.

[0016] The present invention uses Latin square as the scrambling matrix. Under the condition of being able to cause a sufficiently large read amplification and having a lower bound of randomness, there are many optional Latin methods. Therefore, the present invention can provide a sufficiently large scrambling copy space and further improve data reliability.

[0017] Furthermore, the scrambling matrix is ​​generated by:

[0018] By using Galois field addition operations, the elements of the 2nd to nth columns in the scrambled matrix are calculated according to the index data pre-stored in the memory space to generate a scrambled matrix;

[0019] The index data is the first column element calculated by Galois Field multiplication.

[0020] The generation process of Latin square includes Galois field multiplication operation and Galois field addition operation, wherein Galois field multiplication operation is used to generate the first element of each row, that is, the first column element in the whole matrix, and Galois field addition operation generates other elements of the corresponding row according to the first element of each row; the present invention stores the result of Galois field multiplication operation which takes a long time in memory space as index data in advance, and when performing data encoding, calculates the remaining elements in Latin square in real time through Galois field addition operation which takes a short time, thereby effectively reducing internal and external memory overhead without affecting the encoding speed.

[0021] Furthermore, the column numbers of the elements in the matrix D remain unchanged before and after scrambling.

[0022] Furthermore, in step (a2), the scrambling of multiple columns of elements in the matrix D is performed in parallel.

[0023] When performing data scrambling, the present invention ensures that the column order remains unchanged, ensures that the read and write operations of each column in the matrix do not interfere with each other, and performs scrambling of multiple column elements in parallel, which can further improve the speed of data encoding.

[0024] Furthermore, G=2.

[0025] By setting G=2, the present invention can perform fine-grained scrambling of data, so that when a cheater reads part of the data of a replica, he must access all the data of another replica or spend the same I / O bandwidth, which causes a large amount of additional I / O penalties to the cheater, and the Nash equilibrium of the system is moved, thereby preventing storage providers from cheating and ensuring data security.

[0026] Furthermore, the data replica encoding method for a distributed storage system provided by the present invention further includes:

[0027] (b1) After receiving the challenge request, determine whether the requested target copy data is correctly stored locally. If so, proceed to step (b2); otherwise, proceed to step (b3);

[0028] (b2) Read the requested data from the stored target replica data and return it, and the challenge ends;

[0029] (b3) Determine whether other replica data is stored. If so, read the other stored replica data, calculate the scrambling matrix between the target replica data and the read replica data, and use the read replica data as the data to be encoded, perform the data scrambling step according to the calculated scrambling matrix to generate the target replica data, read the requested data from it and return it, or read the requested data from the read replica data according to the scrambling matrix and return it, and the challenge ends; otherwise, go to step (b4);

[0030] (b4) If no response is given to the challenge, the challenge ends.

[0031] Based on the above steps, the present invention can support data replication proof. Specifically, for an honest storage provider that correctly stores k (k is the number of replicas that meet the service availability and data reliability indicators) replicas, when a user or user agent challenges the storage provider and requests part of the target replica data, the storage provider that correctly stores the original data only needs to sequentially read a small amount of specified data from the locally stored original data, and can return the correct data to the user within the specified time, and the challenge is successful.

[0032] For a cheating storage provider that stores less than k copies, it is necessary to read other replica data stored locally, perform scrambling steps on it to obtain a copy, and then read the required data and return it to the user. This will result in it being unable to return the correct data to the user within the specified time, and the challenge will fail. For a cheating storage provider that stores less than k copies, it can also read the requested data from other replica data stored locally according to the scrambled matrix and return it to the user. This will cause the storage provider to bear a huge random I / O cost and be unable to complete the challenge within the specified time, therefore, the challenge will also fail.

[0033] In general, through the above steps, the present invention can support data replication proof, so that storage providers with cheating behavior will pay an unbearable I / O cost when running the proof protocol, the Nash equilibrium will be moved, and read amplification will be formed. Unless the storage provider pays an unbearable I / O cost, he cannot return the correct data within the specified time, and the challenge will eventually fail.

[0034] According to another aspect of the present invention, a computer-readable storage medium is provided, comprising a stored computer program. When the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the data copy encoding method for a distributed storage system provided by the present invention.

[0035] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0036] (1) The present invention uses a matrix that can cause sufficient read amplification and has a lower bound of randomness as a scrambling matrix, and implements data encoding through data scrambling based on the scrambling matrix. While ensuring data security and reliability, it can achieve rapid conversion between copies, ensure data access performance, and is not dependent on a reliable third party.

[0037] (2) The present invention uses Latin square as the scrambling matrix, which can provide a sufficiently large scrambling copy space and improve data reliability.

[0038] (3) When performing data scrambling, the present invention maintains the column order unchanged and performs parallel scrambling on multiple column elements in the matrix, which can further improve the encoding speed.

[0039] (4) The present invention provides steps to support data replication proof, so that when a cheater reads part of the data of a replica, he must access all the data of another replica or spend the same I / O bandwidth. This causes a large amount of additional I / O penalties to the cheater, and the Nash equilibrium of the system is moved, thereby effectively preventing storage providers from cheating and ensuring data security.

[0040] (5) The present invention has a large number of adjustable parameters, including replica size, scrambling granularity, challenge frequency, etc. Through these adjustable parameters, the specific I / O cost can be flexibly amplified for a specific attacker.

[0041] (6) The present invention utilizes a read amplification method to resist Sybil attacks in low-trust distributed storage systems. By performing fine-grained scrambling on replicas, the cost of cheating by storage providers can be further increased, thereby preventing them from cheating. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of data scrambling steps provided in an embodiment of the present invention;

[0043] Figure 2 A schematic diagram of the steps of data replication proof provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0045] In the present invention, the terms "first", "second", etc. (if any) in the present invention and the accompanying drawings are used to distinguish similar objects but not necessarily to describe a specific order or sequence.

[0046] Before explaining the technical solution of the present invention in detail, the related technologies in the field of distributed storage are briefly explained as follows:

[0047] Replica conversion: In distributed storage, after users upload original data, the storage provider needs to store the original data and then store multiple replicas as required. The replica is obtained by processing the original data. When users ask the storage provider to provide data, the provider needs to convert the stored replica into the original data after processing. The conversion between original data and replicas and between replicas is called replica conversion.

[0048] Fake copy: The storage provider does not store copies according to the user's request. For example, if a user requests to store 10GB of data, the service provider only provides 1GB of space for storage for its own benefit. This deceptive behavior is called fake storage, and the corresponding copy is called a fake copy.

[0049] Read amplification: In a storage system, the actual data required to be read is larger than the requested target data;

[0050] Initiate a challenge: In order to ensure that the storage provider has indeed stored the data as required, the user will periodically initiate a "challenge" to the provider, which is equivalent to an inquiry, randomly requesting to obtain part of the data. If the storage provider cannot return the correct data within the specified time, it means that the storage provider has not stored the data honestly and the challenge fails.

[0051] In order to solve the technical problems that data encoding in existing distributed storage systems either has too large computational overhead, resulting in poor data access performance, or relies on a reliable third party and cannot be decentralized, the present invention provides a data copy encoding method and storage medium for a distributed storage system, the overall idea of ​​which is to utilize the read amplification phenomenon of the storage layer, select a suitable scrambling matrix, and use data scrambling to encode data, so as to achieve fast copy conversion in the mobile game model while storing the Nash equilibrium of the storage provider and preventing the storage provider from cheating, thereby ensuring data access performance and not relying on a reliable third party.

[0052] A witch attack is a Nash equilibrium between users and storage providers. In a decentralized storage system, any behavior of a storage provider can be evaluated using a Nash equilibrium. The provider will evaluate its behavior to maximize its benefits, that is, to reach the Nash equilibrium point. From the perspective of storage space alone, the provider will try to pay the least amount of storage space to earn the most benefits. If an inverse correlation can be added between the size of the storage space used by the provider and the other costs he has to pay, then the Nash equilibrium can be controlled to move in the direction of paying more storage space. At the storage level, the performance gap between random reads and sequential reads of disks is very large, which also affects indicators such as bandwidth and IOPS.

[0053] The read amplification utilized by the present invention is a ubiquitous phenomenon in storage systems and is a suitable candidate for building a solution to the challenge of false copies (mainly copy conversion); a sufficiently large read amplification ratio will consume I / O bandwidth that is very valuable to storage devices, which will not only bring a heavy blow to QoS, but also greatly shorten the life of HDDs that are widely deployed as storage devices for distributed storage; read amplification only occurs at the storage layer, and in other layers, such as memory, computing, and network, the additional cost caused by read amplification is relatively small, which helps distributed storage run on low-end computers, making distributed storage more cheap and scalable. The present invention needs to select a suitable scrambling matrix for data scrambling, and it needs to consider whether the amplification rate is large enough and whether it has a lower bound of randomness: if the amplification rate is too small, it is not enough to move the Nash equilibrium point of the provider. In practical applications, it can be judged whether the read amplification rate caused by the selected scrambling matrix is ​​large enough according to the I / O cost that the attacker can bear. If the read amplification rate caused exceeds the I / O cost that the attacker can bear, it can be considered that the read amplification rate of the scrambling matrix is ​​large enough. At this time, the Nash equilibrium in read-write performance and storage performance will move to a suitable position; if the scrambling algorithm does not have a theoretical lower bound of randomness, it cannot provide security guarantees for the algorithm.

[0054] Latin square is a matrix that meets the above requirements. Its generation rules are public, and when the order is determined, there are many optional Latin squares. Therefore, Latin square is selected as the scrambling matrix. On the one hand, it can provide a sufficiently large scrambling copy space, which far exceeds the existing requirements for data reliability. On the other hand, it can ensure that anyone can encode and decode the data. Based on the above considerations, in the present invention, Latin square is preferably selected as the scrambling matrix for data scrambling, and Latin square is used as an example for explanation in the following embodiments.

[0055] In order to explain the present invention more clearly, the definition and related properties of Latin square are briefly introduced as follows:

[0056] The n-order Latin square is an n*n matrix, in which each row and column is a permutation of 1, 2, 3, ..., n;

[0057] if are two n*n Latin squares (1≤i,j≤n), and the matrix n 2 If the ordered pairs are different from each other, L1 and L2 are said to be orthogonal, or L1 and L2 are a set of orthogonal Latin squares.

[0058] There are some properties for Latin squares of different orders as follows: if the order n is a power of a prime number, then there are n-1 sets of mutually orthogonal Latin squares;

[0059] The size of data copies is often a power of 2. The above formula can be used to generate Latin squares of powers of 2. For example, for a commonly used 32GB copy, if the scrambling granularity is set to 2 bytes, 2 17 *2 17 Theoretically, a total of 2 Latin squares can be generated. 17 -1 set of mutually orthogonal Latin squares, which provides a large enough replica space. Any replica can select any Latin square to perform the scrambling process to generate a scrambled replica. At the same time, in this Latin square, any two mutually orthogonal Latin squares can also guarantee the lower bound of randomness and the uniform distribution of continuous data, which means that two different replicas generated from the same original data still have a fairly strong read amplification.

[0060] The above sufficiently large Latin square can be used as the Latin square for scrambling in the present invention. More Latin square examples will not be listed here one by one.

[0061] It should be noted that the Latin square is only a preferred embodiment of the present invention and should not be understood as the only limitation of the present invention. Other matrices that meet the above two requirements, can cause a sufficiently large read gain, and have a lower bound of randomness can be used as the scrambling matrix in the present invention.

[0062] The following are examples.

[0063] Embodiment 1:

[0064] A data replica encoding method for a distributed storage system, comprising:

[0065] After receiving the original data to be stored and the corresponding storage request (the storage request includes the user's storage requirement for the copy), the storage request is parsed to determine whether a copy of the original data needs to be stored. If so, the original data is used as the data to be encoded, and the data scrambling step is performed on it to generate a copy of the original data, and the copy is stored;

[0066] The data scrambling steps include:

[0067] (a1) After the data to be encoded is divided into scrambled blocks of size G, the scrambled blocks are used as elements in the matrix to construct the corresponding matrix D = (d ij ) n*n ; G is the preset scrambling granularity, n = 2 m , m is a positive integer; optionally, in this embodiment, the size of the data copy is 32GB, G=2, thereby fine-grained data scrambling can be achieved; referring to the above analysis, it can be seen that in this embodiment, n=2 17 ;

[0068] (a2) Using an n-order scrambling matrix to scramble the elements in the matrix D, a scrambled copy matrix is ​​obtained as a copy of the original data; the read magnification caused by the scrambled matrix is ​​greater than a preset threshold and has a lower bound of randomness, wherein each element value represents the position of the element at the corresponding position in the matrix D in the scrambled copy after scrambling; in this embodiment, the scrambled matrix used is specifically 2 17 A Latin square C, where each row is a traversal of 1,2,3,...n, and each column is also a traversal of 1,2,3,...n;

[0069] In practical applications, if the magnification between replicas is unstable or has continuous bits, the storage provider can store less data, which will still affect the reliability of the data. It can be proved that only by selecting two groups of exactly the same Latin squares can the two scrambled replicas have two or more continuous bits. Therefore, this embodiment uses Latin squares for data scrambling, which can ensure a more stable magnification between the original replica and the scrambled replica.

[0070] Considering that a complete Latin square generally takes up a large storage space, 17 For example, each data needs to be stored using 17 bits, while in actual storage systems, 2 x (x is a positive integer) bytes are used as units for data storage. Therefore, in actual storage, each data in the Latin square needs to be stored using 4 bytes. 17 The actual storage size occupied by the Latin square of order is 2 17 *2 17 *4 bytes. In order to reduce the internal and external memory overhead of the Latin square, the present embodiment optimizes the storage and generation of the Latin square. Specifically, since the generation process of the Latin square includes Galois field multiplication and Galois field addition, the Galois field multiplication is used to generate the first element of each row, that is, the first column element in the entire matrix, and the Galois field addition generates other elements of the corresponding row according to the first element of each row; based on the generation rule, the present embodiment pre-calculates the first element of each row in the Latin square through Galois field multiplication, that is, the first column element, and uses it as index data , stored in the memory; when performing data encoding, other elements in each row of the Latin square are calculated in real time through Galois field addition operations according to the index data pre-stored in the memory space; therefore, this embodiment optimizes index generation when generating a scrambled coordinate matrix, and uses index data to save the results of Galois field multiplication operations that take a long time, while the Galois field addition operations that take a short time are used to generate coordinate data in real time, so that the scrambled coordinate matrix that originally occupied dozens of GB of memory and external storage space becomes only a few hundred KB of index data, which reduces the internal and external memory overhead without affecting the running speed of the encoding.

[0071] In order to further speed up the encoding speed, when selecting the scrambling matrix, this embodiment also ensures that the column numbers of the elements in the matrix D remain unchanged before and after the scrambling, so that the scrambling operations of each column of data do not interfere with each other; based on this, in step (a2), this embodiment also uses multiple threads to perform the scrambling operations on multiple columns of elements in the matrix D in parallel; specifically, a fine-grained pipeline is set to allow data reading and processing to be performed simultaneously. The data pre-fetch thread continuously scrolls and reads the original data from the disk according to the window size, and multiple sub-threads perform data scrambling processing separately. The pre-fetch thread polls the sub-threads for data processing progress to adjust its own data reading speed. Since the column order of the data is not changed in the scrambling strategy of the present invention, the write operations between the threads do not interfere with each other, thereby realizing lock-free multi-threading technology at the same time.

[0072] Figure 1 The figure shows a simple data scrambling example, in which the original data is constructed into a 4-order matrix D = (d ij ) 4*4 , correspondingly, n = 4; from the above analysis, we can see that there are n-1 = 1 mutually orthogonal Latin squares L1; select the scrambling matrix C from the fourth-order orthogonal Latin square 4*4 , where each element represents the position of the element at the corresponding position in the matrix D in the scrambled copy matrix. For example, the element value of the first row and first column in the scrambled matrix C is 4. Since the column order remains unchanged before and after scrambling, the element of the first row and first column in the matrix D is moved to the fourth row and first column. Each element in D is scrambled and reorganized according to the scrambled coordinates shown in the scrambled matrix C to generate the scrambled copy matrix corresponding to the original data. Data recovery is the inverse process of scrambling, which is completed by calculating the inverse matrix of the transformation matrix. The algorithm complexity is the same as the scrambling change. If there are enough orthogonal Latin squares, different scrambled copies can be generated by selecting different Latin squares. It should be noted that Figure 1 What is shown is merely an exemplary description, and is only used to explain the scrambling strategy of the present invention. In practical applications, the size of the Latin square is often much larger than 4.

[0073] Based on the above description, it can be seen that any two scrambled copies or between the copy and the original data can be converted to each other; for example, the storage provider only stores B, and he can calculate the Latin square of A->B through the Latin square of the original data to A and the Latin square of the original data to B, and then convert B to A. This process requires reading the complete B data; the second method is to use the Latin square of A->B to directly find the locations where the requested data is scattered in B, and read the data accordingly. Since the scrambling granularity is very small, but the part of the data requested to initiate the challenge is relatively large, direct reading based on the location will result in a huge random I / O cost. Based on this, this embodiment also provides corresponding data replication proof steps to support data replication proof, specifically including:

[0074] (b1) After receiving the challenge request, determine whether the requested target copy data is correctly stored locally. If so, proceed to step (b2); otherwise, proceed to step (b3);

[0075] (b2) Read the requested data from the stored target replica data and return it, and the challenge ends;

[0076] (b3) Determine whether other replica data is stored. If so, read the other stored replica data, calculate the scrambling matrix between the target replica data and the read replica data, and use the read replica data as the data to be encoded, perform the data scrambling step according to the calculated scrambling matrix to generate the target replica data, read the requested data from it and return it, or read the requested data from the read replica data according to the scrambling matrix and return it, and the challenge ends; otherwise, go to step (b4);

[0077] (b4) If no response is given to the challenge, the challenge ends.

[0078] Based on the above steps, the present invention can support data replication proof. Specifically, for an honest storage provider that correctly stores k (k is the number of replicas that meet the service availability and data reliability indicators) replicas, when a user or user agent challenges the storage provider and requests part of the target replica data, the storage provider that correctly stores the original data only needs to sequentially read a small amount of specified data from the locally stored original data, and can return the correct data to the user within the specified time, and the challenge is successful.

[0079] For a cheating storage provider that stores less than k copies, it is necessary to read other replica data stored locally, perform scrambling steps on it to obtain a copy, and then read the required data and return it to the user. This will result in it being unable to return the correct data to the user within the specified time, and the challenge will fail. For a cheating storage provider that stores less than k copies, it can also read the requested data from other replica data stored locally according to the scrambled matrix and return it to the user. This will cause the storage provider to bear a huge random I / O cost and be unable to complete the challenge within the specified time, therefore, the challenge will also fail.

[0080] like Figure 2 As shown in the figure, when a user or user agent challenges a storage provider and requests part of the data in the replica data (assuming that the requested data size is 1MB), for an honest storage provider that has correctly stored k replicas, he only needs to sequentially read a small amount of data at the required location to return the correct data to the user within the specified time, and the challenge is successful; for a cheating storage provider that stores less than k replicas, there are two strategies to respond to the challenge: first, sequentially read out the stored 32GB replicas, and obtain the scrambled replicas by performing scrambling steps on the original data to respond to the challenge. The scrambling matrix is ​​composed of the scrambling matrix of the target replica data (i.e., Latin square) and the scrambling matrix of the read replica data ( The strategy is called sequential read cheating. At this time, the magnification ratio is the ratio of the I / O time for sequentially reading 32GB of data to the I / O time for reading 1MB of data. Secondly, in the stored copy data, the scrambled matrix obtained by conversion is used to determine the position of the requested data in the stored copy data, and 1MB of data is read out through random I / O at a granularity of 2 bytes, that is, 512*1024 random I / Os are performed, which is called random read cheating. At this time, the magnification ratio is the ratio of the time for performing more than 500,000 random I / Os to the time for executing one I / O. No matter which orthogonal Latin square is selected for scrambling, the magnification ratio will be stable at this order of magnitude.

[0081] It can be seen that storage providers that store less than k copies need to pay an unbearable I / O cost when running the proof protocol. The Nash equilibrium of the storage provider will be moved, and read amplification will be formed. Unless the storage provider is willing to pay an unbearable I / O cost, he cannot return the correct data within the specified time and the challenge is judged to have failed. A large amount of read amplification can be constructed as a penalty for responding to challenges of fake copies. Even under periodic minor challenges, this penalty will significantly consume I / O bandwidth and even consume the life cycle of the cheater's hard drive, so that storage providers are unwilling to perform witch attacks.

[0082] In general, through the above steps, the present invention can support data replication proof, so that storage providers with cheating behavior will pay an unbearable I / O cost when running the proof protocol, the Nash equilibrium will be moved, and read amplification will be formed. Unless the storage provider pays an unbearable I / O cost, he cannot return the correct data within the specified time, and the challenge will eventually fail.

[0083] Embodiment 2:

[0084] A computer-readable storage medium includes a stored computer program. When the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the data copy encoding method for a distributed storage system provided in the above-mentioned embodiment 1.

[0085] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A data replica encoding method for a distributed storage system, It is characterized in that include: After receiving the original data to be stored and the corresponding storage request, parsing the storage request to determine whether a copy of the original data needs to be stored, and if so, using the original data as the data to be encoded, performing a data scrambling step on it to generate a copy of the original data, and storing the copy; The data scrambling step comprises: (a1) After the data to be encoded is divided into scrambled blocks of size G, the scrambled blocks are used as elements in the matrix to construct the corresponding matrix D = (d ij ) n*n ; G is the preset scrambling granularity, n = 2 m , m is a positive integer; (a2) using an n-order scrambling matrix to scramble the elements in the matrix D to obtain a scrambled copy matrix as a copy of the data to be encoded; the read amplification caused by the scrambled matrix is ​​greater than a preset threshold and has a lower bound of randomness, wherein each element value represents the position of the element at the corresponding position in the matrix D in the scrambled copy after scrambling.

2. The data replica encoding method for a distributed storage system according to claim 1, It is characterized in that The scrambling matrix is ​​a Latin square.

3. The data replica encoding method for a distributed storage system according to claim 2, It is characterized in that The generation method of the scrambling matrix includes: By using Galois Field addition operations, the elements of the 2nd to nth columns in the scrambled matrix are calculated according to the index data pre-stored in the memory space to generate the scrambled matrix; The index data is the first column element calculated by Galois Field multiplication operation.

4. The data replica encoding method for a distributed storage system according to any one of claims 1 to 3, It is characterized in that The column numbers of the elements in the matrix D remain unchanged before and after scrambling.

5. The data replica encoding method for a distributed storage system according to claim 4, It is characterized in that In the step (a2), the scrambling of multiple columns of elements in the matrix D is performed in parallel.

6. The data replica encoding method for a distributed storage system according to any one of claims 1 to 3, It is characterized in that G=2。 7. The data replica encoding method for a distributed storage system according to any one of claims 1 to 3, It is characterized in that Also includes: (b1) After receiving the challenge request, determine whether the requested target copy data is correctly stored locally. If so, proceed to step (b2); Otherwise, go to step (b3); (b2) Read the requested data from the stored target replica data and return it, and the challenge ends; (b3) Determine whether other replica data is stored. If so, read the other stored replica data, calculate the scrambling matrix between the target replica data and the read replica data, and use the read replica data as the data to be encoded, perform the data scrambling step according to the calculated scrambling matrix to generate the target replica data, read the requested data from it and return it, or read the requested data from the read replica data according to the scrambling matrix and return it, and the challenge ends; Otherwise, go to step (b4); (b4) If no response is given to the challenge, the challenge ends.

8. A computer-readable storage medium, It is characterized in that It includes a stored computer program, which, when executed by a processor, controls the device where the computer-readable storage medium is located to execute the data copy encoding method for a distributed storage system as described in any one of claims 1 to 7.