Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a data storage system based on a block chain, wherein data is input by multiple data users of a data layer together, chain structured storage is further carried out after data judgment, redundant data can be effectively processed, mutual management is carried out together, the data storage efficiency is effectively improved, and meanwhile, only reading is carried out through a one-way encryption chain, so that the safety of user information can be ensured, random tampering is avoided, the safety and stability of data storage are ensured, and the use is facilitated.
In order to solve the above problems, the present invention adopts the following technical solutions.
A data storage system based on a block chain comprises a data layer, a consensus layer, a P2P network layer and a storage layer, wherein the data layer comprises a first data user, a second data user and a third data user, the consensus layer comprises a data judgment node and a data reading node, the storage layer comprises a first block chain storage node, a second block chain storage node and a unidirectional encryption chain, the first data user, the second data user and the third data user are connected with the data judgment node, the data judgment node is connected to the first block chain storage node and the second block chain storage node through the P2P network layer, and the first block chain storage node and the second block chain storage node are connected into a serial chain framework;
the storage mode of the storage system comprises the following steps:
a1, a user inputs data storage requirements on a data layer, the data storage requirements are connected to a data judgment node, data repeatability and goodness of fit are judged, data are not included when the data are repeated, and a few majority-obeying principles are adopted for inclusion when the data goodness of fit is low;
a2, the recorded data are transmitted to a storage layer through a P2P network layer to form a first storage node of a block chain;
a3, sequentially judging that a second storage node of the block chain is formed after the data are input again, and repeating the steps;
and A4, when a user reads data, the data reading node is connected with the P2P network layer, and the serial unidirectional encryption chain encrypts user information and the unidirectional read-only storage layer.
Furthermore, the first data user, the second data user and the third data user are connected to a data reading node, the data reading node is connected to the unidirectional encryption chain through a P2P network layer, and the information security of the data users can be ensured by connecting the unidirectional encryption chain.
Furthermore, the unidirectional encryption chain is connected to the storage layer in parallel, is connected to the middle point of the chain framework of the first storage node of the block chain and the second storage node of the block chain in series, and is connected to the storage layer through the unidirectional encryption chain, so that read-only can be performed on stored data, tampering is avoided, and data security and openness are guaranteed.
Furthermore, the first data user, the second data user and the third data user comprise financial data, social data, virtual currency data and public service data of the users, and various data can be stored, so that safety management is facilitated.
Furthermore, when the user accesses the data stored in the block chain in the data layer, different users have different read-write authorities.
Compared with the prior art, the invention has the advantages that:
(1) According to the scheme, multiple data users on the data layer input data together, and then chain structured storage is carried out after data judgment, redundant and miscellaneous data can be effectively processed, mutual management is carried out, data storage efficiency is effectively improved, meanwhile, only reading is carried out through the one-way encryption chain, user information safety can be guaranteed, random tampering is avoided, and safety and stability of data storage are guaranteed.
(2) By connecting the unidirectional encryption chain, the information security of the data user can be ensured.
(3) The storage layer is connected through the one-way encryption chain, so that read-only can be performed on the stored data, tampering is avoided, and the data security and openness are guaranteed.
(4) And various data can be stored, and safety management is facilitated.
(5) And the data are subjected to coincidence judgment, so that the high efficiency of data interaction and management is ensured.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention; it is to be understood that the embodiments described are merely exemplary embodiments, rather than exemplary embodiments, and that all other embodiments may be devised by those skilled in the art without departing from the scope of the present invention.
Referring to fig. 1, a block chain-based data storage system includes a data layer 1, a consensus layer 2, a P2P network layer 3, and a storage layer 4, where the data layer 1 includes a first data user 11, a second data user 12, and a third data user 13, but is not limited to three data users, the first data user 11, the second data user 12, and the third data user 13 include financial data, social data, virtual currency data, and common service data of users, the consensus layer 2 includes a data decision node 21 and a data reading node 22, the data decision node 22 is a data repeatability decision module, and adopts a minority-obeyed majority mode, the storage layer 4 includes a block chain first storage node 41, a block chain second storage node 42, and a unidirectional encryption chain 43, the first data user 1, the second data user 12, and the third data user 13 are connected to the data decision node 21, and the data decision node 21 is connected to the block chain first storage node 41 and the block chain second storage node 42 through the P2P network layer 3, and the block chain first storage node 41 and the block chain 42 are connected to the block chain.
The first data user 11, the second data user 12 and the third data user 13 are connected to a data reading node 22, the data reading node 22 is connected to a unidirectional encryption chain 43 through a P2P network layer, the unidirectional encryption chain 43 is in a unidirectional read-only mode, and the unidirectional encryption chain 43 is connected to the storage layer 4 in parallel and in series at the middle point of a chain structure of the first storage node 41 and the second storage node 42 of the block chain.
The storage mode of the storage system comprises the following steps:
a1, a user inputs data storage requirements on a data layer, the data storage requirements are connected to a data judgment node, data repeatability and goodness of fit judgment are carried out, data are not included when the data are repeated, and a small number of data are included by following a majority principle when the goodness of fit is low;
a2, the recorded data are transmitted to a storage layer through a P2P network layer to form a first storage node of a block chain;
a3, sequentially judging that a second storage node of the block chain is formed after the data are input again, and repeating the steps;
and A4, when a user reads data, the data reading node is connected with the P2P network layer, and the serial unidirectional encryption chain encrypts user information and the unidirectional read-only storage layer.
The foregoing is only a preferred embodiment of the present invention; the scope of the invention is not limited thereto. Any person skilled in the art should be able to cover the technical scope of the present invention by equivalent or modified solutions and modifications within the technical scope of the present invention.