Distributed data access method, device and storage node based on blockchain

By splitting and storing data files in the blockchain network and using parity check strategies, the security and space waste problems of data storage are solved, and a distributed data storage solution with high availability and fault tolerance is realized.

CN112131229BInactive Publication Date: 2024-10-15BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011051905.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-29
Publication Date
2024-10-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The centralized storage of data files in the existing technology poses security risks, while the repeated storage of each node in the blockchain wastes space and does not have fault tolerance.

Method used

By splitting the data files into multiple copies in the blockchain network and storing them dispersedly among multiple storage nodes, the parity check strategy is used to ensure the integrity and availability of the data. Even if some nodes fail, they can be calculated through other nodes. Source data.

Benefits of technology

It improves the security and availability of data storage, saves storage space, implements fault tolerance, and avoids data loss caused by single points of failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112131229B_ABST
    Figure CN112131229B_ABST
Patent Text Reader

Abstract

The present invention discloses a distributed data access method, device and storage node based on blockchain, N storage nodes constitute a blockchain network, each storage node is distributed in different computer rooms, and the write method includes: a client receives a write request and sends it to the blockchain network; the request includes a data file and a corresponding master file identifier; when the master storage node receives the request, the data file is split into N-1 sub-data files, and a sub-file identifier is assigned; according to a preset parity check strategy, it is determined that each sub-data file and the corresponding check data should be stored in the address of the storage node, and the sub-data file, the check data and their corresponding data directory are sent to the blockchain network; the data directory includes: a master file identifier, a sub-file identifier and a storage node address; each storage node receives a sub-data file and corresponding check data, a data directory and stores it. The present invention can improve the security of data storage and save data storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a distributed data access method, device and storage node based on blockchain. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] Currently, data files are usually stored centrally on each server or repeatedly stored on each blockchain node. Centralized storage poses security risks, and repeated storage on each blockchain node wastes space. Summary of the invention

[0004] The embodiment of the present invention provides a distributed data writing method based on blockchain, which is used to improve the security of data storage and save data storage space. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The method includes:

[0005] When the client receives a data write request from the user, it sends the write request to the blockchain network; the write request includes the data file to be written and the corresponding master file identifier;

[0006] The selected master storage node receives the write request sent through the blockchain network; splits the data file to be written into N-1 sub-data files, and assigns a sub-file identifier to each sub-data file; determines the node address information of the storage node where each sub-data file and the corresponding verification data should be stored according to the preset parity check strategy, and sends each sub-data file and the corresponding data directory, the verification data and the corresponding data directory to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information of the storage node to be stored;

[0007] Each sub-data storage node receives the sub-data files and corresponding data directories sent through the blockchain network, and stores and processes the sub-data files and corresponding data directories; the verification data storage node receives the verification data and corresponding data directories sent through the blockchain network, and stores and processes the verification data and corresponding data directories.

[0008] The embodiment of the present invention further provides a distributed data writing method based on blockchain, which is used to improve the security of data storage and save data storage space. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The method includes:

[0009] Receive write requests sent through the blockchain network;

[0010] Split the data file to be written into N-1 sub-data files, and assign a sub-file identifier to each sub-data file;

[0011] According to the preset parity check strategy, determine the node address information of the storage node where each sub-data file and the corresponding check data should be stored;

[0012] Each sub-data file and the corresponding data directory, the verification data and the corresponding data directory are sent to the blockchain network; the data directory includes: the main file identifier, the sub-file identifier and the node address information of the storage node to be stored.

[0013] The embodiment of the present invention further provides a distributed data reading method based on blockchain, which is used to improve the security of data storage and save data storage space. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The method includes:

[0014] When receiving a data read request from a user, the client sends the read request to the blockchain network; the read request includes a master file identifier corresponding to the data file to be read;

[0015] The selected master storage node receives the read request sent through the blockchain network, searches for the corresponding data directory according to the master file identifier, generates a sub-data file acquisition request according to the data directory, and sends the sub-data file acquisition request to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information;

[0016] Each sub-data storage node receives a sub-data file acquisition request sent through the blockchain network; when it is determined that the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node, the sub-data file is sent to the blockchain network;

[0017] The main storage node receives the sub-data files sent by all sub-data storage nodes through the blockchain network, merges all the sub-data files to obtain the data files to be read, and feeds the data files to be read back to the client.

[0018] The embodiment of the present invention also provides a distributed data reading method based on blockchain to improve the security of data storage and save data storage space. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The reading method includes:

[0019] Receive read requests sent via the blockchain network;

[0020] Find the corresponding data directory according to the main file identifier, and generate a sub-data file acquisition request according to the data directory;

[0021] Sending a sub-data file acquisition request to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier, and node address information;

[0022] Receive sub-data files sent by all storage nodes through the blockchain network;

[0023] All sub-data files are merged to obtain the data file to be read;

[0024] Feedback the data file to be read to the client.

[0025] The embodiment of the present invention further provides a distributed data writing device based on blockchain, which is used to improve the security of data storage and save data storage space. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The writing device includes:

[0026] The client is used to send a write request to the blockchain network upon receiving a data write request from the user; the write request includes the data file to be written and the corresponding master file identifier;

[0027] The selected master storage node is used to receive a write request sent through the blockchain network; split the data file to be written into N-1 sub-data files, and assign a sub-file identifier to each sub-data file; determine the node address information of the storage node where each sub-data file and the corresponding verification data should be stored according to the preset parity check strategy, and send each sub-data file and the corresponding data directory, the verification data and the corresponding data directory to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information of the storage node to be stored;

[0028] Each sub-data storage node is used to receive the sub-data files and corresponding data directories sent through the blockchain network, and to store and process the sub-data files and the corresponding data directories; the verification data storage node is used to receive the verification data and the corresponding data directory sent through the blockchain network, and to store and process the verification data and the corresponding data directory.

[0029] The embodiment of the present invention further provides a distributed data writing storage node based on blockchain, which is used to improve the security of data storage and save data storage space. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The writing storage node includes:

[0030] A first receiving unit, configured to receive a write request sent via a blockchain network;

[0031] A data splitting unit, used to split the data file to be written into N-1 sub-data files, and assign a sub-file identifier to each sub-data file;

[0032] A first determination unit is used to determine, according to a preset parity check strategy, node address information of a storage node where each sub-data file and corresponding check data should be stored;

[0033] The first sending unit is used to send each sub-data file and the corresponding data directory, the verification data and the corresponding data directory to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier and a node address information of a storage node to be stored.

[0034] The embodiment of the present invention further provides a distributed data reading device based on blockchain, which is used to improve the security of data storage and save data storage space. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The reading device includes:

[0035] The client is used to send a read request to the blockchain network upon receiving a data read request from a user; the read request includes a master file identifier corresponding to the data file to be read;

[0036] The selected master storage node is used to receive a read request sent through the blockchain network, search for a corresponding data directory according to the master file identifier, generate a sub-data file acquisition request according to the data directory, and send the sub-data file acquisition request to the blockchain network; the data directory includes: a master file identifier, a sub-file identifier, and node address information;

[0037] Each sub-data storage node is used to receive a sub-data file acquisition request sent through the blockchain network; when it is determined that the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node, the sub-data file is sent to the blockchain network;

[0038] The main storage node is used to receive the sub-data files sent by all sub-data storage nodes through the blockchain network, merge all the sub-data files to obtain the data files to be read; and feed back the data files to be read to the client.

[0039] The embodiment of the present invention further provides a distributed data reading storage node based on blockchain, which is used to improve the security of data storage and save data storage space. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The reading storage node includes:

[0040] A second receiving unit is used to receive a read request sent through the blockchain network; receive sub-data files sent by all storage nodes through the blockchain network;

[0041] A generating unit, used for searching a corresponding data directory according to a main file identifier, and generating a sub-data file acquisition request according to the data directory;

[0042] The second sending unit is used to send a sub-data file acquisition request to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier and a node address information; and feed back the data file to be read to the client;

[0043] The merging processing unit is used to merge all the sub-data files to obtain the data file to be read.

[0044] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned distributed data writing and reading method based on blockchain when executing the computer program.

[0045] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for executing the above-mentioned blockchain-based distributed data writing and reading method.

[0046] In the embodiment of the present invention, in the distributed data access scheme based on blockchain, N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. Compared with the technical scheme in the prior art in which centralized storage has security risks and each node of the blockchain has repeated storage and wastes space, the present invention adopts the following method: when writing data, the writing device is used: when the client receives the data writing request from the user, the writing request is sent to the blockchain network; the writing request includes the data file to be written and the corresponding master file identifier; the selected master storage node receives the writing request sent through the blockchain network; the data file to be written is split into N-1 sub-data files, and a sub-data file is assigned to each sub-data file. Sub-file identification; according to the preset parity check strategy, determine the node address information of the storage node where each sub-data file and the corresponding verification data should be stored, and send each sub-data file and the corresponding data directory, the verification data and the corresponding data directory to the blockchain network; the data directory includes: the main file identification, the sub-file identification and the node address information of the storage node to be stored; each sub-data data storage node receives the sub-data file and the corresponding data directory sent through the blockchain network, and stores and processes the sub-data file and the corresponding data directory; the verification data storage node receives the verification data and the corresponding data directory sent through the blockchain network, and stores and processes the verification data and the corresponding data directory. In the reading device during data reading: when the client receives the user's data reading request, the client sends the reading request to the blockchain network; the reading request includes the main file identifier corresponding to the data file to be read; the selected main storage node receives the reading request sent through the blockchain network, searches the corresponding data directory according to the main file identifier, generates a sub-data file acquisition request according to the data directory, and sends the sub-data file acquisition request to the blockchain network; the data directory includes: the main file identifier, the sub-file identifier and the node address information; each sub-data storage node receives the sub-data file acquisition request sent through the blockchain network; when it is determined that the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in this storage node, the sub-data file is sent to the blockchain network; the main storage node receives the sub-data files sent by all the sub-data storage nodes through the blockchain network, merges all the sub-data files, and obtains the data file to be read; the data file to be read is fed back to the client, which improves the security of data storage and saves data storage space. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0048] Figure 1 This is a schematic diagram of the structure of a distributed data access system based on blockchain in an embodiment of the present invention;

[0049] Figure 2 Schematic diagram of the process of a distributed data writing method based on blockchain applied to a writing device in an embodiment of the present invention;

[0050] Figure 3 It is a flowchart of a distributed data writing method based on blockchain applied to writing to a storage node in an embodiment of the present invention;

[0051] Figure 4 Schematic diagram of a process of a distributed data reading method based on blockchain applied to a reading device in an embodiment of the present invention;

[0052] Figure 5 Schematic diagram of a flow chart of a distributed data reading method based on blockchain for reading storage nodes in an embodiment of the present invention;

[0053] Fig. 6A Schematic diagram of a blockchain network in an embodiment of the present invention Figure 1 ;

[0054] Figure 6B Schematic diagram of a blockchain network in an embodiment of the present invention Figure 1 ;

[0055] Figure 6C This is a schematic diagram of the principle of distributed data access based on blockchain in an embodiment of the present invention;

[0056] Figure 7 This is a schematic diagram of the structure of a distributed data writing device or reading device based on blockchain in an embodiment of the present invention;

[0057] Figure 8 This is a schematic diagram of the structure of a distributed data storage node written based on blockchain in an embodiment of the present invention;

[0058] Fig. 9 This is a schematic diagram of the structure of a distributed data reading and storage node based on blockchain in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0060] Currently, hard disk arrays are usually stored in the same cabinet and the same computer room. If the cabinet fails (such as power outage), the hard disk will fail as a whole and storage services will not be provided. Therefore, a space-saving and fault-tolerant solution is needed.

[0061] Taking into account the problems existing in the prior art, the inventor proposes a distributed data access solution based on blockchain, which is a new blockchain distributed storage method to solve the above problems.

[0062] The embodiment of the present invention establishes a blockchain network, uses the hash of file data as the file name through the blockchain, avoids duplicate file storage, splits the file into multiple copies, distributes them to multiple nodes for storage, and verifies each other, that is, splits the data into multiple nodes, each node is distributed in a different computer room, and storage services are provided across computer rooms. If a node fails, the source data can be inferred through parity check, and storage services can continue to be provided, providing a fault-tolerant distributed file service. Specifically, the scheme generally includes the following steps:

[0063] 1. Blockchain network, connecting multiple storage nodes;

[0064] 2. Data writing, data splitting, and parity storage are distributed to each storage node for storage;

[0065] 3. Data reading: read data from multiple storage nodes and merge the bytes and return them;

[0066] 4. If any storage node fails, the parity data of other storage nodes can be used to infer the source data and provide normal data return.

[0067] Figure 1 Schematic diagram of the structure of a distributed data access system based on blockchain in an embodiment of the present invention. Figure 1The system comprises: a writing device 10 and a reading device 20. When working, in the writing device when writing data: when receiving a data writing request from a user, the client sends the writing request to the blockchain network; the writing request includes the data file to be written and the corresponding master file identifier; the selected master storage node receives the writing request sent through the blockchain network; the data file to be written is split into N-1 sub-data files, and a sub-file identifier is assigned to each sub-data file; according to a preset parity check strategy, the node address information of the storage node where each sub-data file and the corresponding verification data should be stored is determined, and each sub-data file and the corresponding data directory, the verification data and the corresponding data directory are sent to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information to be stored in the storage node; each sub-data storage node receives the sub-data file and the corresponding data directory sent through the blockchain network, and performs storage processing on the sub-data file and the corresponding data directory; the verification data storage node receives the verification data and the corresponding data directory sent through the blockchain network, and performs storage processing on the verification data and the corresponding data directory. In the reading device during data reading: when the client receives the user's data reading request, the client sends the reading request to the blockchain network; the reading request includes the main file identifier corresponding to the data file to be read; the selected main storage node receives the reading request sent through the blockchain network, searches the corresponding data directory according to the main file identifier, generates a sub-data file acquisition request according to the data directory, and sends the sub-data file acquisition request to the blockchain network; the data directory includes: the main file identifier, the sub-file identifier and the node address information; each sub-data storage node receives the sub-data file acquisition request sent through the blockchain network; when it is determined that the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in this storage node, the sub-data file is sent to the blockchain network; the main storage node receives the sub-data files sent by all the sub-data storage nodes through the blockchain network, merges all the sub-data files, and obtains the data file to be read; the data file to be read is fed back to the client, which improves the security of data storage and saves data storage space.

[0068] The distributed data access system based on blockchain is introduced in detail below. First, a distributed data writing method based on blockchain applied to a writing device is introduced.

[0069] Figure 2 : is a flow chart of a distributed data writing method based on blockchain applied to a writing device in an embodiment of the present invention. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room, such as Figure 2 As shown, the method comprises the following steps:

[0070] Step 101: When receiving a data write request from a user, the client sends the write request to the blockchain network; the write request includes the data file to be written and the corresponding master file identifier;

[0071] Step 102: The selected master storage node receives a write request sent through the blockchain network; splits the data file to be written into N-1 sub-data files, and assigns a sub-file identifier to each sub-data file; according to a preset parity check strategy, determines the node address information of the storage node where each sub-data file and the corresponding check data should be stored, and sends each sub-data file and the corresponding data directory, the check data and the corresponding data directory to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information of the storage node to be stored;

[0072] Step 103: Each sub-data storage node receives the sub-data file and the corresponding data directory sent through the blockchain network, and stores and processes the sub-data file and the corresponding data directory; the verification data storage node receives the verification data and the corresponding data directory sent through the blockchain network, and stores and processes the verification data and the corresponding data directory.

[0073] During specific implementation, the main storage node may be a storage node selected by voting of the storage nodes, or may be pre-set.

[0074] In one embodiment, when the client receives a data write request from the user, the client sends the write request to the blockchain network, which may include:

[0075] When the client receives a data write request from the user, it generates a hash value based on the data file to be written; adds the hash value as the primary file identifier to the write request, and sends the write request to the blockchain network.

[0076] In specific implementation, the hash value of the data file is used as the main file identifier to avoid duplicate storage, save storage space, and further improve the security and efficiency of distributed data access.

[0077] In specific implementation, in the above step 102, each of the first N-1 storage nodes stores data to be stored in the node, and the Nth storage node stores verification data of other nodes (the first N-1 storage nodes). The data directory corresponding to the verification data includes all sub-file identifiers.

[0078] The embodiment of the present invention also provides a distributed data writing method based on blockchain applied to write storage nodes, as described in the following embodiments. Since the principle of solving the problem by the distributed data writing method based on blockchain applied to write storage nodes is similar to that of the distributed data writing method based on blockchain applied to the writing device, the implementation of the distributed data writing method based on blockchain applied to write storage nodes can refer to the implementation of the distributed data writing method based on blockchain applied to the writing device, and the repeated parts will not be repeated.

[0079] Figure 3 : is a flow chart of a distributed data writing method based on blockchain applied to writing storage nodes in an embodiment of the present invention. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room, such as Figure 3 As shown, the method comprises the following steps:

[0080] Step 201: receiving a write request sent via a blockchain network;

[0081] Step 202: Split the data file to be written into N-1 sub-data files, and assign a sub-file identifier to each sub-data file;

[0082] Step 203: According to a preset parity check strategy, determine the node address information of the storage node where each sub-data file and the corresponding check data should be stored;

[0083] Step 204: Send each sub-data file and the corresponding data directory, the verification data and the corresponding data directory to the blockchain network; the data directory includes: the main file identifier, the sub-file identifier and the node address information of the storage node to be stored.

[0084] In one embodiment, the distributed data writing method based on blockchain may further include:

[0085] Receive the sub-data files and corresponding data directories sent through the blockchain network;

[0086] Perform storage processing on the sub-data files and the corresponding data directories.

[0087] In one embodiment, the distributed data writing method based on blockchain may further include:

[0088] Receive verification data and corresponding data directory sent through the blockchain network;

[0089] The verification data and the corresponding data directory are stored and processed.

[0090] In one embodiment, the master file identifier may be a hash value of the data file to be written.

[0091] The embodiment of the present invention also provides a distributed data reading method based on blockchain applied to a reading device, as described in the following embodiment. Since the principle of solving the problem by the distributed data reading method based on blockchain applied to a reading device is similar to that of the distributed data writing method based on blockchain applied to a writing device, the implementation of the distributed data reading method based on blockchain applied to a reading device can refer to the implementation of the distributed data writing method based on blockchain applied to a writing device, and the repeated parts will not be repeated.

[0092] Figure 4 : is a flow chart of a distributed data reading method based on blockchain applied to a reading device in an embodiment of the present invention. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room, such as Figure 4 As shown, the reading method includes the following steps:

[0093] Step 301: When receiving a data read request from a user, the client sends the read request to the blockchain network; the read request includes a master file identifier corresponding to the data file to be read;

[0094] Step 302: The selected master storage node receives the read request sent through the blockchain network, searches for the corresponding data directory according to the master file identifier, generates a sub-data file acquisition request according to the data directory, and sends the sub-data file acquisition request to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information;

[0095] Step 303: Each sub-data storage node receives a sub-data file acquisition request sent through the blockchain network; when it is determined that the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node, the sub-data file is sent to the blockchain network;

[0096] Step 304: The main storage node receives the sub-data files sent by all sub-data storage nodes through the blockchain network, merges all the sub-data files, and obtains the data file to be read; and feeds back the data file to be read to the client.

[0097] In one embodiment, the above-mentioned distributed data reading method based on blockchain may also include:

[0098] When each sub-data storage node determines that the sub-data storage node does not have a sub-data file corresponding to the data file to be read according to the data directory stored in the sub-data storage node, it determines that the sub-data storage node is a faulty storage node and sends the faulty storage node information to the blockchain network;

[0099] When the main storage node receives the information of the faulty storage node, it performs parity check and fault tolerance processing according to the preset fault tolerance processing strategy, the sub-data files of other sub-data storage nodes, and the verification data of the verification data storage node to obtain the sub-data file corresponding to the faulty storage node;

[0100] All sub-data files are merged to obtain the data file to be read, including: the sub-data files corresponding to the failed storage node and the sub-data files corresponding to other sub-data storage nodes are merged to obtain the data file to be read.

[0101] In specific implementation, when data loss is found in any storage node, the source data, that is, the sub-data file of the failed storage node, can be inferred through the verification data stored in other storage nodes, thereby achieving: improving the security of data storage while saving data storage space.

[0102] In one embodiment, the master file identifier may be a hash value of the data file to be read.

[0103] In an embodiment of the present invention, a distributed data reading method based on blockchain for reading storage nodes is also provided, as described in the following embodiments. Since the principle of solving the problem by the distributed data reading method based on blockchain for reading storage nodes is similar to that of the distributed data writing method based on blockchain for writing devices, the implementation of the distributed data reading method based on blockchain for reading storage nodes can refer to the implementation of the distributed data writing method based on blockchain for writing devices, and the repeated parts will not be repeated.

[0104] Figure 5 : is a flow chart of a distributed data reading method based on blockchain for reading storage nodes in an embodiment of the present invention. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room, such as Figure 5 As shown, the reading method includes the following steps:

[0105] Step 401: receiving a read request sent via a blockchain network;

[0106] Step 402: searching for a corresponding data directory according to the main file identifier, and generating a sub-data file acquisition request according to the data directory;

[0107] Step 403: Send a sub-data file acquisition request to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier, and node address information;

[0108] Step 404: receiving sub-data files sent by all storage nodes through the blockchain network;

[0109] Step 405: All sub-data files are merged to obtain a data file to be read;

[0110] Step 406: Feedback the data file to be read to the client.

[0111] In one embodiment, the above-mentioned distributed data reading method based on blockchain may also include:

[0112] Receiving a sub-data file acquisition request sent via the blockchain network;

[0113] Determine whether the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node;

[0114] When it is determined that the storage node has a sub-data file corresponding to the data file to be read, the sub-data file is sent to the blockchain network based on the data directory stored in the storage node.

[0115] In one embodiment, the above-mentioned distributed data reading method based on blockchain may also include:

[0116] When it is determined, based on the data directory stored in the present storage node, that the present sub-data storage node does not have a sub-data file corresponding to the data file to be read, the present sub-data storage node is determined to be a faulty storage node;

[0117] Send the faulty storage node information to the blockchain network;

[0118] When receiving the faulty storage node information, according to the preset fault-tolerant processing strategy, the sub-data files of other sub-data storage nodes and the check data of the check data storage node are subjected to parity check and fault-tolerant processing to obtain the sub-data file corresponding to the faulty storage node;

[0119] All sub-data files are merged to obtain the data file to be read, including: the sub-data files corresponding to the failed storage node and the sub-data files corresponding to other sub-data storage nodes are merged to obtain the data file to be read.

[0120] In order to facilitate understanding of how the present invention is implemented, the following FIG. 6A to FIG. 6C , the overall solution of distributed data access based on blockchain in the embodiment of the invention is introduced in detail.

[0121] The process of the distributed data access (writing and reading) method based on blockchain provided by the embodiment of the present invention is:

[0122] 1) Build a public blockchain distributed storage network, where each storage node is connected to the blockchain through a computer network, such as Fig. 6A and Figure 6B shown.

[0123] 2) When writing data, upload the data file and digital signature to the blockchain distributed storage network.

[0124] 3) Blockchain distributed storage nodes split data files, for example, store each bit of each byte in different nodes, calculate the parity bit for every 4 bits, store it in another node, store each byte in 5 nodes, and publish it to each blockchain node for storage. You can also use byte splitting, and the verification strategy is as follows:

[0125] 5-node solution: 4 bytes are placed in 4 blockchain nodes respectively, and parity check is placed in the 5th blockchain node. Then, if any one of the 5 blockchain nodes is broken, the data can be kept intact.

[0126] Parity check: Each bit in the 4 nodes corresponds to a group, count how many 1s there are, if there are 1 or 3, store 1 in the 5th node, otherwise store 0.

[0127] D5 can be calculated using the xor operation (different 2 bits are 1, same 2 bits are 0):

[0128] D5 = D1 xor D2 xor D3 xor D4, as shown in Table 1 below.

[0129] Node 1 Node 2 Node 3 Node 4 Node 5 check digit 0 0 0 0 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0

[0130] Table 1

[0131] 4-node solution: If 3 bytes are placed in 3 blockchain nodes respectively, and parity check is placed in the 4th blockchain node, then if any one of the 4 nodes is broken, the data can be kept intact.

[0132] Parity check: For each bit in the three nodes, count how many 1s there are. If there are 1 or 3, store 1 in the fourth node, otherwise store 0, as shown in Table 2 below.

[0133]

[0134]

[0135] Table 2

[0136] 4) When reading data, the bit data is read from each node, combined into bytes and returned to the application.

[0137] 5) Fault-tolerance processing: If any node fails and cannot be read, the parity data of the other four nodes can be used to infer the source data and return it to the application to keep the system's fault-tolerance processing normal.

[0138] For example: Assume that node D3 fails and cannot be read:

[0139] The 5-node solution can calculate each bit of D3 by xor with the corresponding data of the other 4 nodes:

[0140] D3=D1 xor D2 xor D4 xor D5;

[0141] The 4-node solution can calculate each bit of D3 by xor with the corresponding data of the other 3 nodes:

[0142] D3 = D1 xor D2 xor D4.

[0143] Let's take another example. As shown in Table 3 below, the data is divided into four parts: D1, D2, D3, and D4. One part is placed in each node. Then, each bit of the four parts is grouped together, and the parity of each bit is calculated to generate D5, which is then stored in the fifth node.

[0144] Table 3

[0145]

[0146]

[0147] like Figure 6C As shown, when the distributed data access system based on blockchain provided by the embodiment of the present invention works:

[0148] 1) The writing module (the module included in the client) receives the user's writing request and sends it to a selected or preset master storage node among multiple storage nodes of the blockchain network through the blockchain network. The master storage node generates a hash value for the file data as the file name (master file identifier), splits the file data to obtain multiple sub-data files, and generates verification data, which is submitted to the blockchain network.

[0149] 2) The blockchain network automatically finds the appropriate node (finds the node based on the address information that should be stored in the node), stores the split data in a distributed manner, and registers the data directory (file hash value, data label, node address).

[0150] 3) The blockchain node receives the corresponding split data (sub-data files) and saves them.

[0151] 4) The reading module (a module included in the client) receives the user's reading request (the reading request includes the master file identifier corresponding to the data file to be read, i.e., the hash value). The user provides the file hash value, and the reading module sends a hash file reading request to the blockchain.

[0152] 5) The blockchain network issues a sub-data file acquisition request based on the data directory (file hash value, data label, node address), obtains the sub-data file from the storage node of each blockchain, performs parity check, and returns it to the reading module after fault tolerance processing.

[0153] 6) The blockchain node (each storage node) reads the saved sub-data files and returns them to the blockchain network (the main storage node). The main storage node merges all the sub-data files to obtain the data to be read and provides it to the client's reading module.

[0154] Among them, any blockchain node (storage node) can undertake functions such as data splitting, merging, verification, and forwarding in the blockchain network.

[0155] In summary, the distributed data access method based on blockchain provided in the embodiment of the present invention realizes:

[0156] 1) The file hash value is used as the file name. The same file has the same hash value and does not need to be stored repeatedly.

[0157] 2) Through cross-node distributed storage, even if a single blockchain node’s computer room fails, the data can still be recovered.

[0158] Therefore, the distributed data access solution based on blockchain provided in the embodiment of the present invention not only saves the space for data storage, but also improves the security of data storage.

[0159] The embodiment of the present invention also provides a distributed data writing device based on blockchain, as described in the following embodiment. Since the principle of solving the problem by the device is similar to the distributed data writing method based on blockchain applied to writing storage nodes, the implementation of the device can refer to the implementation of the distributed data writing method based on blockchain applied to writing storage nodes, and the repeated parts will not be repeated.

[0160] Figure 7 Schematic diagram of the structure of a distributed data writing device based on blockchain in an embodiment of the present invention. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room, such as Figure 7 As shown, the writing device includes:

[0161] The client is used to send a write request to the blockchain network upon receiving a data write request from the user; the write request includes the data file to be written and the corresponding master file identifier;

[0162] The selected master storage node is used to receive a write request sent through the blockchain network; split the data file to be written into N-1 sub-data files, and assign a sub-file identifier to each sub-data file; determine the node address information of the storage node where each sub-data file and the corresponding verification data should be stored according to the preset parity check strategy, and send each sub-data file and the corresponding data directory, the verification data and the corresponding data directory to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information of the storage node to be stored;

[0163] Each sub-data storage node is used to receive the sub-data files and corresponding data directories sent through the blockchain network, and to store and process the sub-data files and the corresponding data directories; the verification data storage node is used to receive the verification data and the corresponding data directory sent through the blockchain network, and to store and process the verification data and the corresponding data directory.

[0164] In one embodiment, the client can be specifically used to: upon receiving a data write request from a user, generate a hash value according to the data file to be written; add the hash value as a master file identifier to the write request, and send the write request to the blockchain network.

[0165] The embodiment of the present invention also provides a distributed data writing device based on blockchain, as described in the following embodiment. Since the principle of solving the problem by the device is similar to the distributed data writing method based on blockchain applied to writing storage nodes, the implementation of the device can refer to the implementation of the distributed data writing method based on blockchain applied to writing storage nodes, and the repeated parts will not be repeated.

[0166] Figure 8 Schematic diagram of the structure of the distributed data written into the storage node based on the blockchain in an embodiment of the present invention. Figure 8 As shown, N storage nodes constitute a blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in a different computer room. The write storage node includes:

[0167] A first receiving unit 111 is used to receive a write request sent through a blockchain network;

[0168] The data splitting unit 112 is used to split the data file to be written into N-1 sub-data files and assign a sub-file identifier to each sub-data file;

[0169] A first determining unit 113 is used to determine the node address information of the storage node where each sub-data file and the corresponding check data should be stored according to a preset parity check strategy;

[0170] The first sending unit 114 is used to send each sub-data file and the corresponding data directory, the verification data and the corresponding data directory to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier and a node address information of a storage node to be stored.

[0171] In one embodiment, the first receiving unit may also be used to: receive a sub-data file and a corresponding data directory sent via a blockchain network;

[0172] The distributed data writing storage node based on blockchain may also include: a storage processing unit, which is used to store and process the sub-data files and the corresponding data directories.

[0173] In one embodiment, the first receiving unit may also be used to: receive verification data and a corresponding data directory sent via a blockchain network;

[0174] The distributed data writing storage node based on blockchain may also include: a storage processing unit, which is used to store and process the verification data and the corresponding data directory.

[0175] The present invention also provides a distributed data reading device based on blockchain, as described in the following embodiments. Since the principle of solving the problem by the device is similar to the distributed data reading method based on blockchain applied to write storage nodes, the implementation of the device can refer to the implementation of the distributed data reading method based on blockchain applied to write storage nodes, and the repeated parts will not be repeated.

[0176] Figure 7 Schematic diagram of the structure of a distributed data reading device based on blockchain in an embodiment of the present invention. Figure 7 As shown, N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room. The distributed data reading device based on blockchain includes:

[0177] The client is used to send a read request to the blockchain network upon receiving a data read request from a user; the read request includes a master file identifier corresponding to the data file to be read;

[0178] The selected master storage node is used to receive a read request sent through the blockchain network, search for a corresponding data directory according to the master file identifier, generate a sub-data file acquisition request according to the data directory, and send the sub-data file acquisition request to the blockchain network; the data directory includes: a master file identifier, a sub-file identifier, and node address information;

[0179] Each sub-data storage node is used to receive a sub-data file acquisition request sent through the blockchain network; when it is determined that the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node, the sub-data file is sent to the blockchain network;

[0180] The main storage node is used to receive the sub-data files sent by all sub-data storage nodes through the blockchain network, merge all the sub-data files to obtain the data files to be read; and feed back the data files to be read to the client.

[0181] In one embodiment, each storage node may also be used to determine that the sub-data storage node is a faulty storage node when it is determined that the sub-data storage node does not have a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node, and send the faulty storage node information to the blockchain network;

[0182] The primary storage node is specifically used for:

[0183] When receiving the faulty storage node information, according to the preset fault-tolerant processing strategy, the sub-data files of other sub-data storage nodes and the check data of the check data storage node are subjected to parity check and fault-tolerant processing to obtain the sub-data file corresponding to the faulty storage node;

[0184] All sub-data files are merged to obtain the data file to be read, including: the sub-data files corresponding to the failed storage node and the sub-data files corresponding to other sub-data storage nodes are merged to obtain the data file to be read.

[0185] Fig. 9 Schematic diagram of the structure of distributed data reading storage nodes based on blockchain in an embodiment of the present invention. N storage nodes constitute a blockchain network, N is a positive integer greater than 2, and each storage node is distributed in a different computer room, such as Fig. 9 As shown, the read storage node includes:

[0186] The second receiving unit 211 is used to receive a read request sent through the blockchain network; receive sub-data files sent by all storage nodes through the blockchain network;

[0187] A generating unit 212 is used to search for a corresponding data directory according to the main file identifier, and generate a sub-data file acquisition request according to the data directory;

[0188] The second sending unit 213 is used to send a sub-data file acquisition request to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier and node address information; and feed back the data file to be read to the client;

[0189] The merging processing unit 214 is used to merge all the sub-data files to obtain the data file to be read.

[0190] In one embodiment, the second receiving unit may also be used to receive a sub-data file acquisition request sent via the blockchain network;

[0191] The distributed data reading storage node based on blockchain may also include: a second determination unit, configured to determine whether the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node;

[0192] The second sending unit can also be used to send the sub-data file to the blockchain network when it is determined that the storage node has a sub-data file corresponding to the data file to be read based on the data directory stored in the storage node.

[0193] In one embodiment, the second determining unit may also be used to: determine that the storage node is a faulty storage node when it is determined that the sub-data file corresponding to the data file to be read does not exist in the sub-data storage node according to the data directory stored in the sub-data storage node;

[0194] The second sending unit may also be used to send the faulty storage node information to the blockchain network;

[0195] The above-mentioned read storage node may also include: a verification fault-tolerant processing unit, which is used to perform parity verification and fault-tolerant processing according to a preset fault-tolerant processing strategy, sub-data files of other sub-data storage nodes, and verification data of the verification data storage node when receiving the fault storage node information, so as to obtain the sub-data file corresponding to the fault storage node;

[0196] The merging processing unit may also be used to merge the sub-data files corresponding to the failed storage node and the sub-data files corresponding to other sub-data storage nodes to obtain the data file to be read.

[0197] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned distributed data writing and reading method based on blockchain when executing the computer program.

[0198] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for executing the above-mentioned blockchain-based distributed data writing and reading method.

[0199] In the embodiments of the present invention, the distributed data access solution based on blockchain improves the security of data storage and saves data storage space, compared with the technical solution in the prior art where centralized storage has security risks and repeated storage at each blockchain node wastes space.

[0200] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0201] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0202] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0203] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0204] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A distributed data writing method based on blockchain, It is characterized in that The method is applied to a writing device. N storage nodes constitute a blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in a different computer room to provide storage services across computer rooms. If any storage node fails, the source data is calculated by using the parity check of other storage nodes to continue to provide storage services. The distributed data writing method based on blockchain includes: When the client receives a data write request from the user, it sends the write request to the blockchain network; the write request includes the data file to be written and the corresponding master file identifier; The selected master storage node receives the write request sent through the blockchain network; splits the data file to be written into N-1 sub-data files, and assigns a sub-file identifier to each sub-data file; according to the preset parity check strategy, determines the node address information of the storage node where each sub-data file and the corresponding check data should be stored, and sends each sub-data file and the corresponding data directory, check data and the corresponding data directory to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information of the storage node to be stored; each of the first N-1 storage nodes stores the data to be stored in this node, and the Nth storage node stores the check data of the first N-1 storage nodes; Each sub-data storage node receives the sub-data file and the corresponding data directory sent through the blockchain network, and stores and processes the sub-data file and the corresponding data directory; the verification data storage node receives the verification data and the corresponding data directory sent through the blockchain network, and stores and processes the verification data and the corresponding data directory; The primary storage node is a storage node selected by voting of the storage nodes, or is preset.

2. The distributed data writing method based on blockchain as claimed in claim 1, It is characterized in that When the client receives a data write request from the user, it sends the write request to the blockchain network, including: When the client receives a data write request from the user, it generates a hash value based on the data file to be written; adds the hash value as the primary file identifier to the write request, and sends the write request to the blockchain network.

3. A distributed data writing method based on blockchain, It is characterized in that The method is applied to write storage nodes. N storage nodes constitute a blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in a different computer room. The distributed data writing method based on blockchain includes: Receiving a write request sent through the blockchain network; the write request is a write request sent by the client to the blockchain network when receiving a data write request from the user; Split the data file to be written into N-1 sub-data files, and assign a sub-file identifier to each sub-data file; According to the preset parity check strategy, determine the node address information of the storage node where each sub-data file and the corresponding check data should be stored; Send each sub-data file and the corresponding data directory, verification data and the corresponding data directory to the blockchain network; the data directory includes: the main file identifier, the sub-file identifier and the node address information of the storage node to be stored; each of the first N-1 storage nodes stores the data to be stored in this node, and the Nth storage node stores the verification data of the first N-1 storage nodes; Receive the sub-data files and corresponding data directories sent through the blockchain network; Perform storage processing on the sub-data files and the corresponding data directories; Receive verification data and corresponding data directory sent through the blockchain network; The verification data and the corresponding data directory are stored and processed.

4. A distributed data reading method based on blockchain, It is characterized in that The method is applied to a reading device. N storage nodes constitute a blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in a different computer room to provide storage services across computer rooms. If any storage node fails, the source data is calculated by using the parity check of other storage nodes to continue to provide storage services. The distributed data reading method based on blockchain includes: When receiving a data read request from a user, the client sends the read request to the blockchain network; the read request includes a master file identifier corresponding to the data file to be read; The selected master storage node receives the read request sent through the blockchain network, searches for the corresponding data directory according to the master file identifier, generates a sub-data file acquisition request according to the data directory, and sends the sub-data file acquisition request to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information; each of the first N-1 storage nodes stores the data to be stored in this node, and the Nth storage node stores the verification data of the first N-1 storage nodes; Each sub-data storage node receives a sub-data file acquisition request sent through the blockchain network; when it is determined that the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node, the sub-data file is sent to the blockchain network; The main storage node receives the sub-data files sent by all sub-data storage nodes through the blockchain network, merges all the sub-data files, and obtains the data files to be read; and feeds the data files to be read back to the client; The primary storage node is a storage node selected by voting of the storage nodes, or is preset.

5. The distributed data reading method based on blockchain as claimed in claim 4, It is characterized in that Also includes: When each sub-data storage node determines that the sub-data storage node does not have a sub-data file corresponding to the data file to be read according to the data directory stored in the sub-data storage node, it determines that the sub-data storage node is a faulty storage node and sends the faulty storage node information to the blockchain network; When the main storage node receives the information of the faulty storage node, it performs parity check and fault tolerance processing according to the preset fault tolerance processing strategy, the sub-data files of other sub-data storage nodes, and the verification data of the verification data storage node to obtain the sub-data file corresponding to the faulty storage node; All sub-data files are merged to obtain the data file to be read, including: the sub-data files corresponding to the failed storage node and the sub-data files corresponding to other sub-data storage nodes are merged to obtain the data file to be read.

6. The distributed data reading method based on blockchain as claimed in claim 4, It is characterized in that The master file identifier is the hash value of the data file to be read.

7. A distributed data reading method based on blockchain, It is characterized in that The method is applied to read storage nodes. N storage nodes constitute a blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in a different computer room to provide storage services across computer rooms. If any storage node fails, the source data can be inferred by using the parity check of other storage nodes to continue to provide storage services. The distributed data reading method based on blockchain includes: Receive read requests sent via the blockchain network; Find the corresponding data directory according to the main file identifier, and generate a sub-data file acquisition request according to the data directory; Send a sub-data file acquisition request to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier, and node address information; each of the first N-1 storage nodes stores data that should be stored in this node, and the Nth storage node stores verification data of the first N-1 storage nodes; Receiving a sub-data file acquisition request sent via the blockchain network; Determine whether the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node; When it is determined that the storage node has a sub-data file corresponding to the data file to be read, the sub-data file is sent to the blockchain network according to the data directory stored in the storage node; Receive sub-data files sent by all storage nodes through the blockchain network; All sub-data files are merged to obtain the data file to be read; Feedback the data file to be read to the client.

8. The distributed data reading method based on blockchain as claimed in claim 7, It is characterized in that Also includes: When it is determined, based on the data directory stored in the present storage node, that the present sub-data storage node does not have a sub-data file corresponding to the data file to be read, the present sub-data storage node is determined to be a faulty storage node; Send the faulty storage node information to the blockchain network; When receiving the faulty storage node information, according to the preset fault-tolerant processing strategy, the sub-data files of other sub-data storage nodes and the check data of the check data storage node are subjected to parity check and fault-tolerant processing to obtain the sub-data file corresponding to the faulty storage node; All sub-data files are merged to obtain the data file to be read, including: the sub-data files corresponding to the failed storage node and the sub-data files corresponding to other sub-data storage nodes are merged to obtain the data file to be read.

9. A distributed data writing device based on blockchain, It is characterized in that N storage nodes constitute a blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in different computer rooms to provide storage services across computer rooms. If any storage node fails, the source data can be inferred by using the parity check of other storage nodes to continue providing storage services. The distributed data writing device based on blockchain includes: The client is used to send a write request to the blockchain network upon receiving a data write request from the user; the write request includes the data file to be written and the corresponding master file identifier; The selected master storage node is used to receive write requests sent through the blockchain network; split the data file to be written into N-1 sub-data files, and assign a sub-file identifier to each sub-data file; determine the node address information of the storage node where each sub-data file and the corresponding verification data should be stored according to the preset parity check strategy, and send each sub-data file and the corresponding data directory, verification data and the corresponding data directory to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information of the storage node to be stored; each of the first N-1 storage nodes stores the data to be stored in this node, and the Nth storage node stores the verification data of the first N-1 storage nodes; Each sub-data storage node is used to receive the sub-data files and corresponding data directories sent through the blockchain network, and store and process the sub-data files and corresponding data directories; the verification data storage node is used to receive the verification data and corresponding data directories sent through the blockchain network, and store and process the verification data and corresponding data directories; The primary storage node is a storage node selected by voting of the storage nodes, or is preset.

10. The distributed data writing device based on blockchain as claimed in claim 9, It is characterized in that The client is specifically used to: upon receiving a data write request from a user, generate a hash value according to the data file to be written; add the hash value as a master file identifier to the write request, and send the write request to the blockchain network.

11. A distributed data writing storage node based on blockchain, It is characterized in that N storage nodes constitute the blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in different computer rooms to provide storage services across computer rooms. If any storage node fails, the source data can be inferred by using the parity check of other storage nodes to continue providing storage services. Distributed data written to storage nodes based on blockchain includes: A first receiving unit is used to receive a write request sent through the blockchain network; the write request is a write request sent by the client to the blockchain network when receiving a data write request from the user; A data splitting unit, used to split the data file to be written into N-1 sub-data files, and assign a sub-file identifier to each sub-data file; A first determination unit is used to determine, according to a preset parity check strategy, node address information of a storage node where each sub-data file and corresponding check data should be stored; A first sending unit is used to send each sub-data file and the corresponding data directory, verification data and the corresponding data directory to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier and node address information of a storage node to be stored; each of the first N-1 storage nodes stores data to be stored in the node, and the Nth storage node stores verification data of the first N-1 storage nodes; The first receiving unit is further used to: receive a sub-data file and a corresponding data directory sent through the blockchain network, and receive verification data and a corresponding data directory sent through the blockchain network; The distributed data writing storage node based on blockchain also includes: a storage processing unit, which is used to store and process the sub-data files and the corresponding data directories, and to store and process the verification data and the corresponding data directories.

12. A distributed data reading device based on blockchain, It is characterized in that N storage nodes constitute a blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in different computer rooms to provide storage services across computer rooms. If any storage node fails, the source data can be inferred by using the parity check of other storage nodes to continue providing storage services. The distributed data reading device based on blockchain includes: The client is used to send a read request to the blockchain network upon receiving a data read request from a user; the read request includes a master file identifier corresponding to the data file to be read; The selected master storage node is used to receive a read request sent through the blockchain network, search for the corresponding data directory according to the master file identifier, generate a sub-data file acquisition request according to the data directory, and send the sub-data file acquisition request to the blockchain network; the data directory includes: the master file identifier, the sub-file identifier and the node address information; each of the first N-1 storage nodes stores the data to be stored in this node, and the Nth storage node stores the verification data of the first N-1 storage nodes; Each sub-data storage node is used to receive a sub-data file acquisition request sent through the blockchain network; when it is determined that the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node, the sub-data file is sent to the blockchain network; The main storage node is used to receive the sub-data files sent by all sub-data storage nodes through the blockchain network, merge all the sub-data files to obtain the data files to be read; and feed back the data files to be read to the client.

13. The distributed data reading device based on blockchain as claimed in claim 12, It is characterized in that Each sub-data storage node is further used to determine that the sub-data storage node is a faulty storage node when it is determined that the sub-data file corresponding to the data file to be read does not exist in the storage node according to the data directory stored in the storage node, and send the faulty storage node information to the blockchain network; The primary storage node is specifically used for: When receiving the faulty storage node information, according to the preset fault-tolerant processing strategy, the sub-data files of other sub-data storage nodes and the check data of the check data storage node are subjected to parity check and fault-tolerant processing to obtain the sub-data file corresponding to the faulty storage node; All sub-data files are merged to obtain the data file to be read, including: the sub-data files corresponding to the failed storage node and the sub-data files corresponding to other sub-data storage nodes are merged to obtain the data file to be read.

14. A distributed data reading and storage node based on blockchain, It is characterized in that N storage nodes constitute the blockchain network, where N is a positive integer greater than 2. Each storage node is distributed in different computer rooms to provide storage services across computer rooms. If any storage node fails, the source data can be inferred by using the parity check of other storage nodes to continue providing storage services. The distributed data reading storage nodes based on blockchain include: A second receiving unit is used to receive a read request sent through the blockchain network; receive sub-data files sent by all storage nodes through the blockchain network; A generating unit, used for searching a corresponding data directory according to a main file identifier, and generating a sub-data file acquisition request according to the data directory; The second sending unit is used to send a sub-data file acquisition request to the blockchain network; the data directory includes: a main file identifier, a sub-file identifier and node address information; the data file to be read is fed back to the client; each of the first N-1 storage nodes stores data that should be stored in this node, and the Nth storage node stores verification data of the first N-1 storage nodes; A merging processing unit, used for merging all sub-data files to obtain a data file to be read; The second receiving unit is also used to receive a sub-data file acquisition request sent through the blockchain network; The distributed data reading storage node based on blockchain also includes: a second determination unit, configured to determine whether the storage node has a sub-data file corresponding to the data file to be read according to the data directory stored in the storage node; The second sending unit is also used to send the sub-data file to the blockchain network when it is determined that the storage node has a sub-data file corresponding to the data file to be read based on the data directory stored in the storage node.

15. The distributed data reading and storage node based on blockchain as claimed in claim 14, It is characterized in that The second determining unit is further configured to: determine that the sub-data storage node is a faulty storage node when it is determined, based on the data directory stored in the storage node, that the sub-data storage node does not have a sub-data file corresponding to the data file to be read; The second sending unit is also used to send the fault storage node information to the blockchain network; The distributed data reading storage node based on blockchain also includes: a verification fault-tolerant processing unit, which is used to perform parity verification and fault-tolerant processing on the sub-data files of other sub-data storage nodes and the verification data of the verification data storage node when receiving the fault storage node information, so as to obtain the sub-data file corresponding to the fault storage node; The merging processing unit is further used to merge the sub-data files corresponding to the failed storage node and the sub-data files corresponding to other sub-data storage nodes to obtain the data file to be read.

16. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.

17. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 8.