Adaptive encoding storage method and device based on erasure code, readable storage medium
By classifying nodes into honest, risky, and malicious nodes, and utilizing an adaptive encoding storage method based on RS(nfk, f+k) codes and Byzantine fault-tolerant protocols, the problem of high storage overhead is solved, achieving more efficient storage and write performance.
Patent Information
- Application Number
- CN202310013094.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-05
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-01-05
AI Technical Summary
Existing full-replica-based storage solutions cannot detect the number of malicious nodes, resulting in high storage overhead. Methods based on static erasure coding for storing blocks cannot adaptively detect the number of malicious nodes in the current system, leading to unnecessary storage waste.
The system classifies nodes into honest nodes, risky nodes, and malicious nodes. Blocks are encoded using RS(nfk, f+k) codes, and fragments are distributed between honest and risky nodes through a Byzantine fault-tolerant protocol to achieve consensus.
It reduced storage overhead by 97.5%, compared to static erasure coding storage, it reduced storage overhead by 23.8%, reduced write latency by 25.4%, and increased write throughput by 45.6%.
Smart Images

Figure CN116166192B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain storage technology, and in particular to an adaptive encoding storage method, apparatus, and readable storage medium based on erasure coding. Background Technology
[0002] The full-replica storage strategy leads to extremely high storage overhead. In this storage model, each block on the consortium blockchain needs to be stored as a copy on every node participating in the blockchain. When the number of participating nodes is large, this results in significant storage overhead, leading to poor system scalability.
[0003] The method of storing blocks based on static erasure coding cannot adaptively detect the number of malicious nodes in the current system, and can only select RS(n-2f, 2f) code storage blocks with a fixed encoding pattern. In addition, when the number of real malicious nodes in the system is much smaller than f, the RS(n-2f, 2f) code storage blocks require too many check blocks, which will also lead to unnecessary storage overhead waste in the system.
[0004] Therefore, a solution that can reduce storage overhead is needed.
[0005] It should be noted that the information disclosed in the background section of this application is intended only to enhance the understanding of the general background of this application, and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide an adaptive encoding storage method, apparatus, and readable storage medium based on erasure coding, which solves the problems of existing full-copy strategy storage schemes being unable to detect the number of malicious nodes and having large storage overhead.
[0007] To address the above technical problems, this application proposes an adaptive encoding and storage method based on erasure coding, comprising:
[0008] Each node in the system is classified into honest nodes, risky nodes, and malicious nodes according to its past performance. The total number of honest nodes and risky nodes is n, and the number of risky nodes is k. Malicious nodes indicate nodes with very low credit scores, risky nodes indicate nodes with low credit scores but within the system's tolerance range, and honest nodes indicate nodes with high credit scores.
[0009] The number of malicious nodes to be tolerated is set to f. The blocks are encoded using RS(nfk, f+k) codes. The block header, checksum, and each fragment are assembled and stored in the honest node and the 5 risk nodes.
[0010] The Byzantine fault tolerance protocol is used to distribute all the fragments to the honest nodes and the risky nodes, and a consensus is reached between the honest nodes and the risky nodes.
[0011] Optionally, the process of classifying nodes in the system into honest nodes and risk nodes based on their past performance can be described as follows:
[0012] Nodes and malicious nodes, including: 0. Obtaining the global credit score of each node in the system, the global credit score is used to reflect the past performance of each node, and the credit value is determined by the global credit score.
[0013] Optionally, obtaining the global credit score of each node in the system includes:
[0014] Each node maintains a credit value list, which represents the credit value rating of the node for other nodes in the system;
[0015] 5. In a consortium blockchain, nodes periodically broadcast their respective node credit value lists to other nodes in the system;
[0016] Whenever a node receives a list of credit values from other nodes in the system, it will calculate a global credit value list based on its own credit value list and the received credit value list. The global credit value score is determined through the global credit value list.
[0017] Optionally, when a node is identified as a malicious node, the system forcibly removes that node.
[0018] Optionally, the segment includes a verification segment and a data segment.
[0019] Optionally, the step of encoding the block using RS(nfk, f+k) codes includes:
[0020] Extract the block body from the block and divide the block body into nfk data fragments;
[0021] Encode the nfk data segments to generate f+k check segments;
[0022] Calculate the hash values of the data segments and the check segments, and concatenate these hash values into a single 5-bit string to obtain the check value for the block body. Finally, assemble the block header, check value, and each segment together.
[0023] Stored on the honest node and the risk node.
[0024] Optionally, each node stores a separate copy of the block header, checksum, and a unique fragment.
[0025] Optionally, it also includes:
[0026] During the block writing process, if the number of malicious nodes is greater than k, an unacknowledged fragment is added to each correct node.
[0027] Based on the same inventive concept, this application also proposes an adaptive coding storage device based on erasure coding, comprising:
[0028] The node classification unit is configured to classify each node in the system into honest nodes, risky nodes, and malicious nodes according to their past performance. The total number of honest nodes and risky nodes is n, and the number of risky nodes is k. Malicious nodes indicate nodes with excessively low credit scores, risky nodes indicate nodes with low credit scores but within the system's tolerable range, and honest nodes indicate nodes with high credit scores.
[0029] The encoding unit is configured to set the number of malicious nodes to be tolerated to f, encode the block using RS(nfk, f+k) code, assemble the block header, check value and each fragment respectively, and store them in the honest node and the risk node.
[0030] The storage unit is configured to distribute all the fragments to the honest nodes and the risky nodes using a Byzantine fault-tolerant protocol, and to reach a consensus between the honest nodes and the risky nodes.
[0031] Based on the same inventive concept, this application also proposes a readable storage medium storing a computer program thereon, which, when executed by a processor, can implement the adaptive coding storage method based on erasure coding as described in any of the above-described features.
[0032] Compared with the prior art, this application has the following beneficial effects:
[0033] The adaptive encoding and storage method based on erasure coding proposed in this application first classifies the nodes in the system into honest nodes, risky nodes, and malicious nodes according to their past performance. The total number of honest nodes and risky nodes is n, and the number of risky nodes is k. Malicious nodes represent nodes with excessively low credit scores, risky nodes represent nodes with low credit scores but within the system's tolerable range, and honest nodes represent nodes with high credit scores. The tolerance limit for malicious nodes is set to f. Blocks are encoded using RS(nfk, f+k) codes, assembling the block header, checksum, and individual fragments, and storing them in the honest nodes and risky nodes respectively. A Byzantine fault tolerance protocol is used to distribute all fragments to the honest nodes and risky nodes, and consensus is reached between them. Using this scheme, the number of malicious nodes in the system can be effectively obtained, and compared to the full-copy storage method, this scheme reduces storage overhead by 97.5%. Compared to storage methods based on static erasure coding, the solution proposed in this application reduces storage overhead by 23.8%, reduces write latency by 25.4%, and increases write throughput by 45.6%.
[0034] This application proposes an adaptive coding storage device and a readable storage medium based on erasure coding, which belong to the same inventive concept as the adaptive coding storage method based on erasure coding, and therefore have the same beneficial effects, which will not be elaborated here. Attached Figure Description
[0035] Figure 1 This is a flowchart illustrating the adaptive encoding and storage method based on erasure coding proposed in an embodiment of the present invention.
[0036] Figure 2 This is a schematic diagram illustrating a specific implementation in an embodiment of the present invention;
[0037] Figure 3 This is a schematic diagram illustrating the dynamic erasure coding process in an embodiment of the present invention;
[0038] Figure 4 This is a schematic diagram of adaptive fragment distribution in an embodiment of the present invention;
[0039] Figure 5 This is a schematic diagram of the structure of the adaptive coding storage device based on erasure coding proposed in an embodiment of the present invention. Detailed Implementation
[0040] The specific embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. The advantages and features of the present invention will become clearer from the following description and claims. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the present invention.
[0041] In the description of this invention, it should be understood that the terms "center", "upper", "lower", "left", "right", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0042] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0043] In the current blockchain industry, there are two main storage models for consortium blockchains: one is the widely used full-replica storage method, and the other is the erasure coding-based storage method proposed by Jin Cheqing et al. In the full-replica storage method, every block is stored as a copy on every node in the system; in other words, every node participating in the consortium blockchain needs to store all the data on the blockchain. Jin Cheqing et al. proposed a method for storing blocks based on static erasure coding. Erasure coding is an information redundancy method. Taking the widely used Reed-Solomon (RS) code as an example, it divides the original data into k data blocks, then encodes these k data blocks to generate m check blocks. Any k of these k+m blocks can be decoded to recover the original data. This erasure coding is denoted as RS(k,m) code. A system storing data based on this erasure coding can tolerate the loss of any m copies of data. Jin Cheqing et al. applied static erasure coding technology to consortium blockchain storage. With n nodes, their method stores data based on RS(n-2f, 2f) codes, proving that data security can be guaranteed when the number of malicious nodes in the system does not exceed f. To address the extremely high storage overhead of existing full-replica-based storage methods and the inability of static erasure coding-based block storage methods to adaptively detect the number of malicious nodes in the current system, this embodiment proposes the following solution:
[0044] For details, please refer to Figure 1This application proposes an adaptive encoding and storage method based on erasure coding, comprising:
[0045] S100: Classify each node in the system into honest nodes, risky nodes, and malicious nodes according to their past performance. The total number of honest nodes and risky nodes is n, and the number of risky nodes is k. Malicious nodes indicate that the credit value is too low, risky nodes indicate that the credit value is low but within the system's tolerance range, and honest nodes indicate that the node has a high credit value.
[0046] S200: Set the number of malicious nodes to be tolerated to f, encode the block using RS(nfk, f+k) code, assemble the block header, check value and each fragment respectively, and store them in the honest node and the risk node;
[0047] S300: Use the Byzantine fault tolerance protocol to distribute all the fragments to the honest nodes and the risky nodes, and reach a consensus between the honest nodes and the risky nodes.
[0048] Unlike existing technologies, the adaptive encoding and storage method based on erasure coding proposed in this embodiment first classifies the nodes in the system into honest nodes, risky nodes, and malicious nodes according to their past performance. The total number of honest nodes and risky nodes is n, and the number of risky nodes is k. A malicious node represents a node with a very low credit value, a risky node represents a node with a low credit value but within the system's tolerance range, and an honest node represents a node with a high credit value. The tolerance limit for malicious nodes is set to f. Blocks are encoded using RS(nfk, f+k) codes, assembling the block header, checksum, and individual fragments, and storing them in the honest nodes and risky nodes respectively. A Byzantine fault tolerance protocol is used to distribute all fragments to the honest nodes and risky nodes, and consensus is reached between them. This embodiment effectively obtains the number of malicious nodes in the system, and compared to the full-copy storage method, it reduces storage overhead by 97.5%. Compared to storage methods based on static erasure coding, the solution proposed in this application reduces storage overhead by 23.8%, reduces write latency by 25.4%, and increases write throughput by 45.6%.
[0049] Specifically, in this embodiment, classifying the nodes in the system into honest nodes, risky nodes, and malicious nodes based on their past performance includes:
[0050] Obtain the global credit score for each node in the system. The global credit score is used to reflect the past performance of each node, and the credit value is determined by the global credit score.
[0051] Specifically, in this embodiment, obtaining the global credit score of each node in the system includes:
[0052] Each node maintains a credit value list, which represents the credit value rating of the node for other nodes in the system;
[0053] In a consortium blockchain, nodes periodically broadcast their respective node credit value lists to other nodes in the system.
[0054] Whenever a node receives a list of credit values from other nodes in the system, it will calculate a global credit value list based on its own credit value list and the received credit value list. The global credit value score is determined through the global credit value list.
[0055] Specifically, in this embodiment, when a node is determined to be a malicious node, the system forcibly removes the node.
[0056] Specifically, in this embodiment, the fragment includes a verification fragment and a data fragment.
[0057] Specifically, in this embodiment, the encoding of the block using RS(nfk, f+k) code includes:
[0058] Extract the block body from the block and divide the block body into nfk data fragments;
[0059] Encode the nfk data segments to generate f+k check segments;
[0060] Calculate the hash value of the data segment and the verification segment, and concatenate the hash values of these segments to use as the verification value of the block body. Finally, assemble the block header, the verification value and each segment separately, and store them in the honest node and the risk node.
[0061] Specifically, in this embodiment, each node stores a separate block header, checksum, and unique fragment.
[0062] Specifically, in this embodiment, the adaptive encoding and storage method based on erasure coding further includes:
[0063] During the block writing process, if the number of malicious nodes is greater than k, an unacknowledged fragment is added to each correct node.
[0064] In summary, the scheme in this embodiment can be divided into three stages: node credit value evaluation, dynamic erasure coding, and adaptive fragment distribution. Please refer to [link / reference needed]. Figure 2 The solution implemented here is used to select a suitable erasure coding scheme to encode blocks and store them in the system. Specifically:
[0065] 1) Node Credit Rating Assessment: First, each node maintains a credit rating list, representing its credit score for other nodes in the system. Then, nodes in the consortium blockchain periodically broadcast their respective credit rating lists to other nodes. Whenever a node receives a credit rating list from other nodes, it calculates a global credit rating list based on its own and the received lists. This global credit rating list serves as the global credit rating for all nodes in the system. Based on this global credit rating, nodes are then categorized into three types: honest nodes, risky nodes, and malicious nodes. Malicious nodes, due to their low credit ratings (indicating poor past performance), are forcibly removed from the system. Risky nodes have low credit ratings, but are still within the system's tolerance range and are temporarily retained for observation. Honest nodes have high credit ratings, meaning they have performed exceptionally well in the past and are trustworthy. The total number of honest and risky nodes (n) and the number of risky nodes (k) in the current system are calculated.
[0066] 2) Dynamic Erasure Coding: During the node credit assessment phase, the system can adaptively sense the number of nodes *n* and the number of risky nodes *k* in the current system. When the threshold for the number of malicious nodes the system needs to tolerate is *f*, the system uses RS(nfk, f+k) codes to encode the block. The specific encoding is as follows: First, the block body is extracted from the block and divided into *nfk* data fragments. Then, these data fragments are encoded to generate *f+k* checksum fragments. Next, the hash values of these data fragments and checksum fragments are calculated, and the hash values of these fragments are concatenated as the checksum of the block body. Finally, the block header, checksum, and each fragment are assembled and stored on *n* nodes in the system. Each node stores a separate copy of the block header, checksum, and a unique fragment. For details, please refer to [link / reference]. Figure 3 , Figure 3 A schematic diagram illustrating the process of encoding dynamic erasure codes.
[0067] 3) Adaptive Fragment Distribution: After the block is encoded, the system uses a modified Byzantine fault-tolerant protocol to distribute these fragments to n nodes in the system and reach consensus among these nodes. Since the block is encoded using RS(nfk, f+k) code, at least nfk fragments are needed to reconstruct the original block. Because the maximum number of potentially malicious nodes in the system is f, commit messages from at least nf-k+f = nk nodes must be collected during the block writing process to ensure the block has been securely written to the system. If the block is attacked by more than k malicious nodes during the writing process, the system may not receive commit messages from nk nodes. In this case, we propose a method to supplement fragments on the correct nodes to ensure the block is correctly written to the system. For example... Figure 4 As shown, Figure 4 This diagram illustrates the adaptive fragment distribution in this embodiment. Assume there are n = 7 nodes in the current system, with a maximum tolerable number of malicious nodes of f = 2, and a current number of risky nodes of k = 1. Therefore, each block writing process requires at least nk = 6 commit responses from nodes. When writing block B0, the system was not attacked by malicious nodes and received responses from seven nodes, so block B0 was correctly written to the system. When writing block B1, the system was attacked by malicious node N6 and received commit responses from 6 nodes, so the block was also safely written to the system. When writing block B2, the system was attacked by malicious nodes N5 and N6 and only received commit responses from 5 nodes. In this case, the system adds an unconfirmed fragment to each correct node, allowing the block to be safely written to the system. The original block can then be recovered by decoding the fragments.
[0068] Please refer to Figure 5 Based on the same inventive concept, embodiments of this application also propose an adaptive coding storage device based on erasure coding, comprising:
[0069] The node classification unit 100 is configured to classify each node in the system into honest nodes, risky nodes, and malicious nodes according to their past performance. The total number of honest nodes and risky nodes is n, and the number of risky nodes is k. Malicious nodes indicate that the credit value is too low, risky nodes indicate that the credit value is low but within the system's tolerable range, and honest nodes indicate that the node has a high credit value.
[0070] The encoding unit 200 is configured to set the number of malicious nodes to be tolerated to f, encode the block using RS(nfk, f+k) code, assemble the block header, check value and each fragment respectively, and store them in the honest node and the risk node.
[0071] Storage unit 300 is configured to distribute all the fragments to the honest node and the risky node using a Byzantine fault-tolerant protocol, and to reach a consensus between the honest node and the risky node.
[0072] It is understood that the node classification unit 100, the encoding unit 200, and the storage unit 300 can be implemented in a single device, or any one of these modules can be split into multiple sub-modules. Alternatively, at least some of the functions of one or more modules of the node classification unit 100, the encoding unit 200, and the storage unit 300 can be combined with at least some of the functions of other modules and implemented in a single functional module. According to embodiments of the present invention, at least one of the node classification unit 100, the encoding unit 200, and the storage unit 300 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or can be implemented in hardware or firmware in any other reasonable manner by integrating or packaging the circuitry, or in a suitable combination of software, hardware, and firmware implementations. Alternatively, at least one of the node classification unit 100, the encoding unit 200, and the storage unit 300 may be implemented at least partially as a computer program module, which can perform the functions of the corresponding module when the program is run by a computer.
[0073] Based on the same inventive concept, this application also proposes a readable storage medium storing a computer program thereon, which, when executed by a processor, can implement the adaptive coding storage method based on erasure coding as described in any of the above-described features.
[0074] The readable storage medium can be a tangible device capable of holding and storing instructions for use by an instruction execution device, such as, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer programs described herein can be downloaded from the readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. Each computing / processing device's network adapter card or network interface receives the computer program from the network and forwards it for storage in a readable storage medium within the respective computing / processing device. The computer program used to perform the operations of this invention can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" or similar languages. The computer program can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from a computer program. These electronic circuits can execute computer-readable program instructions, thereby realizing various aspects of the present invention.
[0075] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, systems, and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by a computer program. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. These computer programs can also be stored in a readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the readable storage medium storing the computer program comprises an article of manufacture including instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams.
[0076] A computer program may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the computer program executing on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0077] In summary, this application has the following beneficial effects:
[0078] The adaptive encoding and storage method based on erasure coding proposed in this application first classifies the nodes in the system into honest nodes, risky nodes, and malicious nodes according to their past performance. The total number of honest and risky nodes is n, and the number of risky nodes is k. Malicious nodes represent nodes with excessively low credit scores, risky nodes represent nodes with low credit scores but within the system's tolerable range, and honest nodes represent nodes with high credit scores. The tolerance limit for malicious nodes is set to f. Blocks are encoded using RS(nfk, f+k) codes, assembling the block header, checksum, and individual fragments, and storing them in the honest and risky nodes respectively. A Byzantine fault-tolerant protocol is used to distribute all fragments to the honest and risky nodes, and consensus is reached among the honest and risky nodes.
[0079] This application proposes an adaptive coding storage device and a readable storage medium based on erasure coding, which belong to the same inventive concept as the adaptive coding storage method based on erasure coding, and therefore have the same beneficial effects, which will not be elaborated here.
[0080] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," or "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.
[0081] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.
Claims
1. An adaptive encoding and storage method based on erasure coding, characterized in that, include: Each node in the system is classified into honest nodes, risky nodes, and malicious nodes according to its past performance. The total number of honest nodes and risky nodes is n, and the number of risky nodes is k. Malicious nodes indicate nodes with very low credit scores, risky nodes indicate nodes with low credit scores but within the system's tolerance range, and honest nodes indicate nodes with high credit scores. The number of malicious nodes to be tolerated is set to f. The blocks are encoded using RS(nfk, f+k) codes. The block header, checksum, and each fragment are assembled and stored in the honest node and the risk node respectively. The Byzantine fault tolerance protocol is used to distribute all the fragments to the honest nodes and the risky nodes, and a consensus is reached between the honest nodes and the risky nodes.
2. The adaptive encoding and storage method based on erasure coding as described in claim 1, characterized in that, The classification of nodes in the system into honest nodes, risky nodes, and malicious nodes based on their past performance includes: Obtain the global credit score for each node in the system. The global credit score is used to reflect the past performance of each node, and the credit value is determined by the global credit score.
3. The adaptive encoding and storage method based on erasure coding as described in claim 2, characterized in that, The process of obtaining the global credit score for each node in the system includes: Each node maintains a credit value list, which represents the credit value rating of the node for other nodes in the system; In a consortium blockchain, nodes periodically broadcast their respective node credit value lists to other nodes in the system. Whenever a node receives a list of credit values from other nodes in the system, it will calculate a global credit value list based on its own credit value list and the received credit value list. The global credit value score is determined through the global credit value list.
4. The adaptive encoding and storage method based on erasure coding as described in claim 1, characterized in that, When a node is identified as a malicious node, the system forcibly removes that node.
5. The adaptive encoding and storage method based on erasure coding as described in claim 1, characterized in that, The fragment includes a verification fragment and a data fragment.
6. The adaptive encoding and storage method based on erasure coding as described in claim 1, characterized in that, The method of encoding the block using RS(nfk, f+k) codes includes: Extract the block body from the block and divide the block body into nfk data fragments; Encode the nfk data segments to generate f+k check segments; Calculate the hash value of the data segment and the verification segment, and concatenate the hash values of these segments to use as the verification value of the block body. Finally, assemble the block header, the verification value and each segment separately, and store them in the honest node and the risk node.
7. The adaptive encoding and storage method based on erasure coding as described in claim 6, characterized in that, Each node stores a separate copy of the block header, checksum, and a unique fragment.
8. The adaptive encoding and storage method based on erasure coding as described in claim 1, characterized in that, Also includes: During the block writing process, if the number of malicious nodes is greater than k, an unacknowledged fragment is added to each correct node.
9. An adaptive coding storage device based on erasure coding, characterized in that, include: The node classification unit is configured to classify each node in the system into honest nodes, risky nodes, and malicious nodes according to their past performance. The total number of honest nodes and risky nodes is n, and the number of risky nodes is k. Malicious nodes indicate nodes with excessively low credit scores, risky nodes indicate nodes with low credit scores but within the system's tolerable range, and honest nodes indicate nodes with high credit scores. The encoding unit is configured to set the number of malicious nodes to be tolerated to f, encode the block using RS(nfk, f+k) code, assemble the block header, check value and each fragment respectively, and store them in the honest node and the risk node. The storage unit is configured to distribute all the fragments to the honest nodes and the risky nodes using a Byzantine fault-tolerant protocol, and to reach a consensus between the honest nodes and the risky nodes.
10. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it can implement the adaptive encoding and storage method based on erasure codes as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Byzantine fault tolerance method of data block chain authorization participation consensus based on reward and punishment and reward and punishment method thereof
CN107423962A
Block chain fragment storage and query method based on erasure codes
CN109871366A