WO2022078012A1 - 区块链存储的数据持续保存的方法、系统、设备及介质 - Google Patents
区块链存储的数据持续保存的方法、系统、设备及介质 Download PDFInfo
- Publication number
- WO2022078012A1 WO2022078012A1 PCT/CN2021/109509 CN2021109509W WO2022078012A1 WO 2022078012 A1 WO2022078012 A1 WO 2022078012A1 CN 2021109509 W CN2021109509 W CN 2021109509W WO 2022078012 A1 WO2022078012 A1 WO 2022078012A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- distributed
- sub
- distributed node
- blockchain
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
Definitions
- the present invention relates to the field of data backup, and more particularly, to a method, system, computer equipment and readable medium for continuous storage of data stored in a blockchain.
- block distributed storage of each network node, holding Part or all of the data blocks, in addition to the concept of decentralization, can also avoid the bottleneck caused by the Client (client)/Server (server) architecture and the busy server itself.
- client Client
- server Server
- the distributed storage architecture of blocks may cause some data to fail to be recovered when a node is not operating normally.
- Filecoin provides rewards at the application layer. Nodes (or miners) provide hard drives and other hardware to combine to win storage transactions. Filecoin rewards are obtained by storing data. The more storage, the more rewards. In theory, in the presence of enough nodes, the data will continue to be perfectly preserved. However, there is still a possibility that a node holding a certain data block is not functioning properly at a certain time, while other nodes do not have the data block, and the result is that a certain data cannot be obtained at this time.
- the purpose of the embodiments of the present invention is to propose a method, system, computer equipment and computer-readable storage medium for the continuous storage of data stored in the blockchain, using the distributed storage of the block as the bottom layer to build a large-scale public Cloud or small-scale private cloud, but does not rely on additional nodes to achieve high data storage reliability, and does not change the block distributed network transmission and reception of data between nodes, that is, the method and process are in a certain Although the moment or action is additionally communicated with sideband (Sideband) signal, the transmission and reception of data still use the architecture and protocol of the block distributed network. It also improves the reliability of data storage.
- Sideband Sideband
- one aspect of the embodiments of the present invention provides a method for continuous storage of data stored in a blockchain, including the following steps: dividing the data of the first distributed node into sub-data, and distributing the sub-data into the blockchain distributed network, and generate a representative index according to the sub-data; determine whether the first distributed node needs to back up the data; in response to the first distributed node need to back up the data performing a backup, transmitting a backup request including the representative index to a plurality of second distributed nodes; and in response to receiving the backup request, a plurality of the second distributed nodes in the block according to the representative index Find all sub-data in the chain distributed network, splicing and backing up all sub-data.
- the judging whether the first distributed node needs to back up the data includes: judging whether the data does not exist in any of the second distributed nodes.
- the method further includes: judging whether the second distributed node where the data exists is unique every predetermined time; and in response to the second distributed node where the data exists being unique, transmitting the data to other distributed nodes the second distributed node.
- the method further includes: in response to the second distributed node where the data exists is unique and the first distributed node requests the data, determining whether there are other distributed nodes other than the second distributed node The distributed node has the data; and in response to no other distributed node having the data other than the second distributed node, the data is split again and distributed into the blockchain distributed network.
- the generating the representative index according to the sub-data includes: assigning a unique serial number to each of the sub-data.
- the method further includes: judging whether the storage space of the second distributed node is less than a threshold.
- the method further includes: in response to the storage space of the second distributed node being less than a threshold, querying the number of second distributed nodes where each backup data in the second distributed node exists, and Transfer the backup data with the largest number.
- Another aspect of the embodiments of the present invention further provides a system for persistent data storage stored in a blockchain, including: a segmentation module, configured to segment the data of the first distributed node into sub-data, and to segment the data into sub-data.
- the sub-data is distributed in the blockchain distributed network, and a representative index is generated according to the sub-data;
- the judgment module is configured to judge whether the first distributed node needs to back up the data;
- the request module is configured to use in response to the first distributed node needing to back up the data, transmitting a backup request including the representative index to a plurality of second distributed nodes; and a backup module configured to respond to receiving the backup Request to make a plurality of the second distributed nodes search for all sub-data in the blockchain distributed network according to the representative index, and splicing and backing up all the sub-data.
- a computer device comprising: at least one processor; and a memory, where the memory stores computer instructions that can be executed on the processor, and the instructions are executed by the processor.
- the processor implements the steps of the above method when executed.
- a computer-readable storage medium stores a computer program that implements the above method steps when executed by a processor.
- the invention has the following beneficial technical effects: using block distributed storage as the bottom layer to build a large-scale public cloud or a small-scale private cloud, but does not rely on additional nodes to achieve high data storage reliability, and does not change
- the block distributed network transmission and reception method of data between nodes that is, although the method and process use sideband signal communication at a certain time or action, the data transmission and reception still use block distributed network It can get the benefits of distributed storage of blocks and improve the reliability of data storage at a small additional cost.
- FIG. 1 is a schematic diagram of an embodiment of a method for continuous storage of data stored in a blockchain provided by the present invention
- FIG. 2 is a schematic diagram of an embodiment of a system for continuous storage of data stored in a blockchain provided by the present invention
- FIG. 3 is a schematic diagram of the hardware structure of an embodiment of a computer device for continuous storage of data stored in a blockchain provided by the present invention
- FIG. 4 is a schematic diagram of an embodiment of a computer-readable storage medium for persistent storage of data stored in a blockchain provided by the present invention.
- FIG. 1 shows a schematic diagram of an embodiment of a method for persistent storage of data stored in a blockchain provided by the present invention.
- the embodiment of the present invention includes the following steps:
- the plurality of second distributed nodes search for all sub-data in the blockchain distributed network according to the representative index, and splicing and backing up all the sub-data.
- IPFS InterPlanetary File System
- IPFS InterPlanetary File System
- the IPFS protocol combines the advantages of blockchain technology and various network protocols to store immutable data. Remove duplicate files on the network, and obtain the address information of storage nodes to search for files on the network. IPFS divides files into fixed-size blocks, each block is indexed with a unique set of serial numbers (CID) and the block content is stored in the distributed file system. All blocks can be read in the distributed file system with the CID and stored in the distributed file system. Restore to original file.
- CID serial numbers
- Each distributed node divides the data of the first distributed node into sub-data, distribute the sub-data in the blockchain distributed network, and generate a representative index according to the sub-data.
- Each distributed node distributes a certain data to be saved to the block distributed network, and at the same time obtains the representative index of the data.
- the generating the representative index according to the sub-data includes: assigning a unique serial number to each of the sub-data.
- a certain amount such as 256KB
- CID unique serial number
- the second distributed node is a Bootstrap (a front-end framework for rapidly developing web applications and websites) node, but this is not a limitation on the second distributed node, and the second distributed node may also be It is an IPFS node, but preferably, the second distributed node selects an IPFS node with strong computing power and large storage space.
- the judging whether the first distributed node needs to back up the data includes: judging whether the data does not exist in any second distributed node. If the data does not exist in any second distributed node, the data needs to be backed up.
- a backup request including the representative index is transmitted to the plurality of second distributed nodes.
- the first distributed node needs to back up data, it can send a backup request to the second distributed node.
- the backup request can only include the representative index of the data.
- Other control signals are not necessary, but can be added according to application requirements.
- the first distributed node and the second distributed node use a sideband (Sideband) signal to transmit a backup request, and the backup request can use a currently known protocol such as TCP (Transmission Control Protocol, Transmission Control Protocol) handshake or UDP (User Datagram Protocol) handshake , User Datagram Protocol) multicast/broadcast or other transmission protocols, but the second distributed node still uses the block distributed network architecture and protocol to receive data.
- TCP Transmission Control Protocol
- Transmission Control Protocol Transmission Control Protocol
- UDP User Datagram Protocol
- User Datagram Protocol User Datagram Protocol
- the plurality of second distributed nodes search for all sub-data in the blockchain distributed network according to the representative index, and splicing and backing up all the sub-data.
- the second distributed node can use the representative index of the data, use the block distributed network architecture and protocol to query and receive all data blocks, and completely back up the data.
- the method further includes: judging whether the second distributed node where the data exists is unique every predetermined time; and in response to the second distributed node where the data exists being unique, transmitting the data to other distributed nodes the second distributed node.
- the method further includes: in response to the second distributed node where the data exists is unique and the first distributed node requests the data, determining whether there are other distributed nodes other than the second distributed node The distributed node has the data; and in response to no other distributed node having the data other than the second distributed node, the data is split again and distributed into the blockchain distributed network.
- the method further includes: judging whether the storage space of the second distributed node is less than a threshold.
- the method further includes: in response to the storage space of the second distributed node being less than a threshold, querying the number of second distributed nodes where each backup data in the second distributed node exists, and Transfer the backup data with the largest number.
- the second distributed node includes backup data A, B, C and D
- the backup data A exists in five second distributed nodes
- the backup data B exists In 4 second distributed nodes
- backup data C exists in 6 second distributed nodes
- backup data D exists in 2 second distributed nodes
- the backup data can be stored in the order of C, A, B, and D. Transfer to other second distributed nodes.
- FIG. 2 is a schematic diagram of an embodiment of a system for continuous storage of data stored in a blockchain provided by the present invention.
- the system includes: a segmentation module 201, configured to segment the data of the first distributed node into sub-data, and distribute the sub-data to the blockchain distribution In the network, and generate a representative index according to the sub-data; the judgment module 202 is configured to judge whether the first distributed node needs to back up the data; the request module 203 is configured to respond to the first distributed node.
- a distributed node needs to back up the data, and transmits a backup request including the representative index to a plurality of second distributed nodes; and the backup module 204 is configured to, in response to receiving the backup request, make a plurality of The second distributed node searches for all sub-data in the blockchain distributed network according to the representative index, and splices and backs up all the sub-data.
- the judging module 202 is configured to: judge whether the data does not exist in any second distributed node.
- the system further includes: a second judgment module configured to judge whether the second distributed node where the data exists is unique every predetermined time; and in response to the second distributed node where the data exists is unique , and transmit the data to other second distributed nodes.
- a second judgment module configured to judge whether the second distributed node where the data exists is unique every predetermined time; and in response to the second distributed node where the data exists is unique , and transmit the data to other second distributed nodes.
- the system further includes: a third judgment module, configured to judge that the second distributed node in which the data exists is unique and the first distributed node requests the data, to judge that the data is not included in the second distributed node. Whether there are other distributed nodes other than the distributed node that have the data; and in response to no other distributed nodes having the data except the second distributed node, the data is split again and distributed to Blockchain distributed network.
- a third judgment module configured to judge that the second distributed node in which the data exists is unique and the first distributed node requests the data, to judge that the data is not included in the second distributed node.
- the segmentation module 201 is configured to: assign a unique sequence number to each of the sub-data.
- system further includes: a fourth judgment module, configured to judge whether the storage space of the second distributed node is less than a threshold.
- system further includes: a transfer module configured to, in response to the storage space of the second distributed node being less than a threshold, query the second distribution of the existence of each backup data in the second distributed node number of nodes, and transfer the backup data with the largest corresponding number.
- a transfer module configured to, in response to the storage space of the second distributed node being less than a threshold, query the second distribution of the existence of each backup data in the second distributed node number of nodes, and transfer the backup data with the largest corresponding number.
- a computer device including: at least one processor; and a memory, where the memory stores computer instructions that can be executed on the processor, and the instructions are executed by the processor to The following steps are implemented: S1, dividing the data of the first distributed node into sub-data, distributing the sub-data in the blockchain distributed network, and generating a representative index according to the sub-data; S2, judging whether the first distributed node is Data needs to be backed up; S3, in response to the first distributed node needing to back up the data, transmitting a backup request including a representative index to a plurality of second distributed nodes; and S4, in response to receiving the backup request, a plurality of first The second distributed node searches for all sub-data in the blockchain distributed network according to the representative index, and splices and backs up all the sub-data.
- the judging whether the first distributed node needs to back up the data includes: judging whether the data does not exist in any of the second distributed nodes.
- the steps further include: judging whether the second distributed node where the data exists is unique every predetermined time; and in response to the uniqueness of the second distributed node where the data exists, transmitting the data to other distributed nodes the second distributed node.
- the step further includes: in response to the second distributed node where the data exists is unique and the first distributed node requests the data, determining whether there are other distributed nodes except the second distributed node The distributed node has the data; and in response to no other distributed node having the data other than the second distributed node, the data is split again and distributed into the blockchain distributed network.
- the generating the representative index according to the sub-data includes: assigning a unique serial number to each of the sub-data.
- the step further includes: judging whether the storage space of the second distributed node is less than a threshold.
- the step further includes: in response to the storage space of the second distributed node being less than a threshold, querying the number of second distributed nodes where each backup data in the second distributed node exists, and Transfer the backup data with the largest number.
- FIG. 3 it is a schematic diagram of the hardware structure of an embodiment of a computer device for continuously saving the data stored in the blockchain provided by the present invention.
- the device includes a processor 301 and a memory 302 , and may also include an input device 303 and an output device 304 .
- the processor 301 , the memory 302 , the input device 303 and the output device 304 may be connected by a bus or in other ways, and the connection by a bus is taken as an example in FIG. 3 .
- the memory 302 can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
- the data stored in the blockchain in the embodiments of the present application persists.
- the processor 301 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 302, that is, to realize the continuous preservation of the data stored in the blockchain of the above method embodiments. method.
- the memory 302 may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required by at least one function; created data, etc. Additionally, memory 302 may include high speed random access memory, and may also include nonvolatile memory, such as at least one magnetic disk storage device, flash memory device, or other nonvolatile solid state storage device. In some embodiments, memory 302 may optionally include memory located remotely from processor 301, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
- the input device 303 can receive input information such as user name and password.
- the output device 304 may include a display device such as a display screen.
- the program instructions/modules corresponding to the method for continuous storage of data stored in one or more blockchains are stored in the memory 302. When executed by the processor 301, the data stored in the blockchain in any of the above method embodiments are continuously stored. Methods.
- Any embodiment of the computer device that executes the above-mentioned method for persistently storing data stored in a blockchain can achieve the same or similar effects as any of the foregoing method embodiments corresponding to it.
- FIG. 4 is a schematic diagram of an embodiment of a computer-readable storage medium for continuously storing data stored in a blockchain provided by the present invention.
- the computer-readable storage medium 401 stores a computer program 410 that, when executed by a processor, executes the above method.
- the storage medium can be a read-only memory, a magnetic disk or an optical disk, and the like.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
提供了一种区块链存储的数据持续保存的方法、系统、设备和存储介质,方法包括:将第一分布式节点的数据切分成子数据,并将子数据散布到区块链分布式网络中,并根据子数据生成代表索引(S1);判断第一分布式节点是否需要对数据进行备份(S2);响应于第一分布式节点需要对数据进行备份,传送包括代表索引的备份请求到多个第二分布式节点(S3);以及响应于接收到备份请求,多个第二分布式节点根据代表索引在区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份(S4)。不额外增加节点个数,也不改变节点之间数据的区块分布式网络传送与接收方式,在付出额外较小代价的情况下,提高数据的保存可靠度。
Description
本申请要求于2020年10月16日提交中国国家知识产权局,申请号为202011109732.6,发明名称为“区块链存储的数据持续保存的方法、系统、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及数据备份领域,更具体地,特别是指一种区块链存储的数据持续保存的方法、系统、计算机设备及可读介质。
区块链技术及应用在近几年十分流行,其底层架构所使用的技术则是区块分布式存储,区块分布式存储主要的想法是:区块分布式存储每一个网络节点,持有部份或全部的数据区块,除了去中心化的理念之外,更可以避免Client(客户端)/Server(服务器)架构,Server本身忙碌而造成的瓶颈。持有数据区块的所有节点正常运行的情况下,该数据可持续保存,然而,区块分布式存储的架构,本身是有可能在某节点不正常运行情况下,造成某些数据无法回复。
以现行的技术来说,大部份保存区块分布式数据的方式,主要是在区块分布式存储的架构层上,加上应用层以提供奖励机制。以Filecoin(文件币)为例,Filecoin在应用层提供奖励,节点(或叫矿工)提供硬盘和其他硬件组合在一起来赢得存储交易,通过存储数据来获得Filecoin奖励,存储 越多奖励越多。理论上,在足够多的节点存在下,数据将持续被完善地保存。然而,仍然存在可能性:持有某数据区块的某节点在某个时刻不正常运行,而其他的节点并没有该数据区块,结果就是某数据在此时是无法取得的。而如果持有某数据区块的某节点因故障或其他不可抗力,永远无法正常运行,则该数据将永远无法回复。像Filecoin或类似的协议或应用层,通常会用统计的方式,计算区块分布式存储网在多少个数的节点正常运行时的机率及数据的可回复率。但其问题是,数据的可回复率目前大多是依靠足够个数的节点正常运行的这个假设。如果使用者因为区块分布式存储的好处,要使用区块分布式存储架设一个系统,不论是作为大规模的公有云或小规模的私有云,都会遇到上述问题而需要额外增加节点个数以达到数据的保存可靠度。
发明内容
有鉴于此,本发明实施例的目的在于提出一种区块链存储的数据持续保存的方法、系统、计算机设备及计算机可读存储介质,使用区块分布式存储作为底层架设一个大规模的公有云或小规模的私有云,但不依靠额外增加节点个数以达到数据的高保存可靠度,也不改变节点之间数据的区块分布式网络传送与接收方式,即是方法与流程在某个时刻或动作虽额外采用边带(Sideband)讯号沟通,数据的传送与接收仍是使用区块分布式网络的架构与协议,在付出额外较小代价的情况下,得到区块分布式存储的好处,又提高数据的保存可靠度。
基于上述目的,本发明实施例的一方面提供了一种区块链存储的数据持续保存的方法,包括如下步骤:将第一分布式节点的数据切分成子数据,并将所述子数据散布到区块链分布式网络中,并根据所述子数据生成代表索引;判断所述第一分布式节点是否需要对所述数据进行备份;响应于所 述第一分布式节点需要对所述数据进行备份,传送包括所述代表索引的备份请求到多个第二分布式节点;以及响应于接收到所述备份请求,多个所述第二分布式节点根据所述代表索引在所述区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份。
在一些实施方式中,所述判断所述第一分布式节点是否需要对所述数据进行备份包括:判断所述数据是否在任意一个第二分布式节点中均不存在。
在一些实施方式中,方法还包括:每隔预定时间判断存在所述数据的第二分布式节点是否唯一;以及响应于存在所述数据的第二分布式节点唯一,将所述数据传送到其他的第二分布式节点。
在一些实施方式中,方法还包括:响应于存在所述数据的第二分布式节点唯一且所述第一分布式节点请求所述数据,判断除了所述第二分布式节点之外是否存在其他分布式节点有所述数据;以及响应于除了所述第二分布式节点之外不存在其他分布式节点有所述数据,将所述数据再次切分并散布到区块链分布式网络中。
在一些实施方式中,所述根据所述子数据生成代表索引包括:给每个所述子数据分配一个唯一的序号。
在一些实施方式中,方法还包括:判断第二分布式节点的存储空间是否小于阈值。
在一些实施方式中,方法还包括:响应于所述第二分布式节点的存储空间小于阈值,查询所述第二分布式节点中的每个备份数据存在的第二分布式节点的数量,并将对应数量最多的若干个备份数据进行转移。
本发明实施例的另一方面,还提供了一种区块链存储的数据持续保存系统,包括:切分模块,配置用于将第一分布式节点的数据切分成子数据, 并将所述子数据散布到区块链分布式网络中,并根据所述子数据生成代表索引;判断模块,配置用于判断所述第一分布式节点是否需要对所述数据进行备份;请求模块,配置用于响应于所述第一分布式节点需要对所述数据进行备份,传送包括所述代表索引的备份请求到多个第二分布式节点;以及备份模块,配置用于响应于接收到所述备份请求,使多个所述第二分布式节点根据所述代表索引在所述区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份。
本发明实施例的又一方面,还提供了一种计算机设备,包括:至少一个处理器;以及存储器,所述存储器存储有可在所述处理器上运行的计算机指令,所述指令由所述处理器执行时实现如上方法的步骤。
本发明实施例的再一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有被处理器执行时实现如上方法步骤的计算机程序。
本发明具有以下有益技术效果:使用区块分布式存储作为底层架设一个大规模的公有云或小规模的私有云,但不依靠额外增加节点个数以达到数据的高保存可靠度,也不改变节点之间数据的区块分布式网络传送与接收方式,即是方法与流程在某个时刻或动作虽额外采用边带(Sideband)讯号沟通,数据的传送与接收仍是使用区块分布式网络的架构与协议,在付出额外较小代价的情况下,得到区块分布式存储的好处,又提高数据的保存可靠度。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实 施例。
图1为本发明提供的区块链存储的数据持续保存的方法的实施例的示意图;
图2为本发明提供的区块链存储的数据持续保存的系统的实施例的示意图;
图3为本发明提供的区块链存储的数据持续保存的计算机设备的实施例的硬件结构示意图;
图4为本发明提供的区块链存储的数据持续保存的计算机可读存储介质的实施例的示意图。
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。
需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。
基于上述目的,本发明实施例的第一个方面,提出了一种区块链存储的数据持续保存的方法的实施例。图1示出的是本发明提供的区块链存储的数据持续保存的方法的实施例的示意图。如图1所示,本发明实施例包括如下步骤:
S1、将第一分布式节点的数据切分成子数据,并将子数据散布到区块链分布式网络中,并根据子数据生成代表索引;
S2、判断第一分布式节点是否需要对数据进行备份;
S3、响应于第一分布式节点需要对数据进行备份,传送包括代表索引的备份请求到多个第二分布式节点;以及
S4、响应于接收到备份请求,多个第二分布式节点根据代表索引在区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份。
IPFS(InterPlanetary File System,星际文件系统)是一个分布式文件系统,它尝试为所有计算装置连接同一个文件系统,IPFS协议结合区块链技术与各种网络协议的优势来储存不可更改的数据,移除网络上的重复档案,以及取得储存节点的地址信息,用以搜寻网络中的档案。IPFS将文件分割为固定大小区块,每个区块以唯一的一组序号(CID)为索引与区块内容存储在分布式文件系统,以CID可于分布式文件系统读取所有区块并还原为原文件。
将第一分布式节点的数据切分成子数据,并将子数据散布到区块链分布式网络中,并根据子数据生成代表索引。每个分布式节点将要保存的某数据散布到区块分布式网络,同时得到数据的代表索引。
在一些实施方式中,所述根据所述子数据生成代表索引包括:给每个所述子数据分配一个唯一的序号。在IPFS系统中,数据大于一定量(例如256KB)时,会将它们分解为更小的区块,以便所有区块都等于或小于该值,然后给每个区块赋予一个唯一的序号(CID),区块内容则被以IPFS分布式地储存在各个不同节点。
判断第一分布式节点是否需要对数据进行备份。在本实施例中第二分布式节点是Bootstrap(一种用于快速开发Web应用程序和网站的前端框架)节点,但这并不是对第二分布式节点的限制,第二分布式节点也可以是IPFS节点,但是优选的,第二分布式节点选择计算能力强、存储空间大的IPFS节点。在一些实施方式中,所述判断所述第一分布式节点是否需要对所述数据进行备份包括:判断所述数据是否在任意一个第二分布式节点中均不 存在。如果数据在任意一个第二分布式节点中均不存在,则需要对该数据进行备份。
在一些实施方式中,还可以判断存在所述数据的第二分布式节点是否唯一,如果存在该数据的第二分布式节点只有一个,为了避免该第二分布式节点出现故障,也需要对数据进行备份。
响应于第一分布式节点需要对数据进行备份,传送包括代表索引的备份请求到多个第二分布式节点。当第一分布式节点需要对数据进行备份,可以向第二分布式节点发送备份请求,备份请求可以只包括数据的代表索引,其他的控制讯号不是必要的,但可以视应用需求而加入。
第一分布式节点与第二分布式节点利用边带(Sideband)信号传输备份请求,备份请求可以使用目前已知的协议如TCP(Transmission Control Protocol,传输控制协议)交握或UDP(User Datagram Protocol,用户数据报协议)多播/广播或其他传输协议,但第二分布式节点接收数据仍是使用区块分布式网络架构及协议。
响应于接收到备份请求,多个第二分布式节点根据代表索引在区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份。第二分布式节点可以利用数据的代表索引,使用区块分布式网络架构及协议查询并接收所有数据区块,完整备份该数据。
在一些实施方式中,方法还包括:每隔预定时间判断存在所述数据的第二分布式节点是否唯一;以及响应于存在所述数据的第二分布式节点唯一,将所述数据传送到其他的第二分布式节点。
在一些实施方式中,方法还包括:响应于存在所述数据的第二分布式节点唯一且所述第一分布式节点请求所述数据,判断除了所述第二分布式节点之外是否存在其他分布式节点有所述数据;以及响应于除了所述第二 分布式节点之外不存在其他分布式节点有所述数据,将所述数据再次切分并散布到区块链分布式网络中。
在一些实施方式中,方法还包括:判断第二分布式节点的存储空间是否小于阈值。
在一些实施方式中,方法还包括:响应于所述第二分布式节点的存储空间小于阈值,查询所述第二分布式节点中的每个备份数据存在的第二分布式节点的数量,并将对应数量最多的若干个备份数据进行转移。例如,当第二分布式接节点的存储空间小于阈值,该第二分布式节点中包括备份数据A、B、C和D,备份数据A存在于5个第二分布式节点,备份数据B存在于4个第二分布式节点,备份数据C存在于6个第二分布式节点,备份数据D存在于2个第二分布式节点,那么可以按照C、A、B和D的顺序将备份数据转移到其他的第二分布式节点。
需要特别指出的是,上述区块链存储的数据持续保存的方法的各个实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于区块链存储的数据持续保存的方法也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在实施例之上。
基于上述目的,本发明实施例的第二个方面,提出了一种区块链存储的数据持续保存的系统。图2为本发明提供的区块链存储的数据持续保存的系统的实施例的示意图。以如图2所示的系统为例,在该系统中包括:切分模块201,配置用于将第一分布式节点的数据切分成子数据,并将所述子数据散布到区块链分布式网络中,并根据所述子数据生成代表索引;判断模块202,配置用于判断所述第一分布式节点是否需要对所述数据进行备份;请求模块203,配置用于响应于所述第一分布式节点需要对所述数据进行备份,传送包括所述代表索引的备份请求到多个第二分布式节点;以及备份模块204,配置用于响应于接收到所述备份请求,使多个所述第二分布 式节点根据所述代表索引在所述区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份。
在一些实施方式中,所述判断模块202配置用于:判断所述数据是否在任意一个第二分布式节点中均不存在。
在一些实施方式中,系统还包括:第二判断模块,配置用于每隔预定时间判断存在所述数据的第二分布式节点是否唯一;以及响应于存在所述数据的第二分布式节点唯一,将所述数据传送到其他的第二分布式节点。
在一些实施方式中,系统还包括:第三判断模块,配置用于响应于存在所述数据的第二分布式节点唯一且所述第一分布式节点请求所述数据,判断除了所述第二分布式节点之外是否存在其他分布式节点有所述数据;以及响应于除了所述第二分布式节点之外不存在其他分布式节点有所述数据,将所述数据再次切分并散布到区块链分布式网络中。
在一些实施方式中,所述切分模块201配置用于:给每个所述子数据分配一个唯一的序号。
在一些实施方式中,系统还包括:第四判断模块,配置用于判断第二分布式节点的存储空间是否小于阈值。
在一些实施方式中,系统还包括:转移模块,配置用于响应于所述第二分布式节点的存储空间小于阈值,查询所述第二分布式节点中的每个备份数据存在的第二分布式节点的数量,并将对应数量最多的若干个备份数据进行转移。
基于上述目的,本发明实施例的第三个方面,提出了一种计算机设备,包括:至少一个处理器;以及存储器,存储器存储有可在处理器上运行的计算机指令,指令由处理器执行以实现如下步骤:S1、将第一分布式节点的数据切分成子数据,并将子数据散布到区块链分布式网络中,并根据子 数据生成代表索引;S2、判断第一分布式节点是否需要对数据进行备份;S3、响应于第一分布式节点需要对数据进行备份,传送包括代表索引的备份请求到多个第二分布式节点;以及S4、响应于接收到备份请求,多个第二分布式节点根据代表索引在区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份。
在一些实施方式中,所述判断所述第一分布式节点是否需要对所述数据进行备份包括:判断所述数据是否在任意一个第二分布式节点中均不存在。
在一些实施方式中,步骤还包括:每隔预定时间判断存在所述数据的第二分布式节点是否唯一;以及响应于存在所述数据的第二分布式节点唯一,将所述数据传送到其他的第二分布式节点。
在一些实施方式中,步骤还包括:响应于存在所述数据的第二分布式节点唯一且所述第一分布式节点请求所述数据,判断除了所述第二分布式节点之外是否存在其他分布式节点有所述数据;以及响应于除了所述第二分布式节点之外不存在其他分布式节点有所述数据,将所述数据再次切分并散布到区块链分布式网络中。
在一些实施方式中,所述根据所述子数据生成代表索引包括:给每个所述子数据分配一个唯一的序号。
在一些实施方式中,步骤还包括:判断第二分布式节点的存储空间是否小于阈值。
在一些实施方式中,步骤还包括:响应于所述第二分布式节点的存储空间小于阈值,查询所述第二分布式节点中的每个备份数据存在的第二分布式节点的数量,并将对应数量最多的若干个备份数据进行转移。
如图3所示,为本发明提供的上述区块链存储的数据持续保存的计算 机设备的一个实施例的硬件结构示意图。
以如图3所示的装置为例,在该装置中包括一个处理器301以及一个存储器302,并还可以包括:输入装置303和输出装置304。
处理器301、存储器302、输入装置303和输出装置304可以通过总线或者其他方式连接,图3中以通过总线连接为例。
存储器302作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的区块链存储的数据持续保存的方法对应的程序指令/模块。处理器301通过运行存储在存储器302中的非易失性软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例的区块链存储的数据持续保存的方法。
存储器302可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据区块链存储的数据持续保存的方法的使用所创建的数据等。此外,存储器302可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器302可选包括相对于处理器301远程设置的存储器,这些远程存储器可以通过网络连接至本地模块。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置303可接收输入的用户名和密码等信息。输出装置304可包括显示屏等显示设备。
一个或者多个区块链存储的数据持续保存的方法对应的程序指令/模块存储在存储器302中,当被处理器301执行时,执行上述任意方法实施例中的区块链存储的数据持续保存的方法。
执行上述区块链存储的数据持续保存的方法的计算机设备的任何一个实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。
本发明还提供了一种计算机可读存储介质,具体的,图4本发明提供的区块链存储的数据持续保存的计算机可读存储介质的实施例的示意图。如图4所示,计算机可读存储介质401存储有被处理器执行时执行如上方法的计算机程序410。
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,区块链存储的数据持续保存的方法的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,程序的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。
以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。
上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其他变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。
Claims (10)
- 一种区块链存储的数据持续保存的方法,其特征在于,包括以下步骤:将第一分布式节点的数据切分成子数据,并将所述子数据散布到区块链分布式网络中,并根据所述子数据生成代表索引;判断所述第一分布式节点是否需要对所述数据进行备份;响应于所述第一分布式节点需要对所述数据进行备份,传送包括所述代表索引的备份请求到多个第二分布式节点;以及响应于接收到所述备份请求,多个所述第二分布式节点根据所述代表索引在所述区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份。
- 根据权利要求1所述的方法,其特征在于,所述判断所述第一分布式节点是否需要对所述数据进行备份包括:判断所述数据是否在任意一个第二分布式节点中均不存在。
- 根据权利要求1所述的方法,其特征在于,还包括:每隔预定时间判断存在所述数据的第二分布式节点是否唯一;以及响应于存在所述数据的第二分布式节点唯一,将所述数据传送到其他的第二分布式节点。
- 根据权利要求3所述的方法,其特征在于,还包括:响应于存在所述数据的第二分布式节点唯一且所述第一分布式节点请求所述数据,判断除了所述第二分布式节点之外是否存在其他分布式节点有所述数据;以及响应于除了所述第二分布式节点之外不存在其他分布式节点有所述数据,将所述数据再次切分并散布到区块链分布式网络中。
- 根据权利要求1所述的方法,其特征在于,所述根据所述子数据生成代表索引包括:给每个所述子数据分配一个唯一的序号。
- 根据权利要求1所述的方法,其特征在于,还包括:判断第二分布式节点的存储空间是否小于阈值。
- 根据权利要求6所述的方法,其特征在于,还包括:响应于所述第二分布式节点的存储空间小于阈值,查询所述第二分布式节点中的每个备份数据存在的第二分布式节点的数量,并将对应数量最多的若干个备份数据进行转移。
- 一种区块链存储的数据持续保存的系统,其特征在于,包括:切分模块,配置用于将第一分布式节点的数据切分成子数据,并将所述子数据散布到区块链分布式网络中,并根据所述子数据生成代表索引;判断模块,配置用于判断所述第一分布式节点是否需要对所述数据进行备份;请求模块,配置用于响应于所述第一分布式节点需要对所述数据进行备份,传送包括所述代表索引的备份请求到多个第二分布式节点;以及备份模块,配置用于响应于接收到所述备份请求,使多个所述第二分布式节点根据所述代表索引在所述区块链分布式网络中查找所有的子数据,并将所有的子数据进行拼接并备份。
- 一种计算机设备,其特征在于,包括:至少一个处理器;以及存储器,所述存储器存储有可在所述处理器上运行的计算机指令,所述指令由所述处理器执行时实现权利要求1-7任意一项所述方法的步骤。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-7任意一项所述方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011109732.6 | 2020-10-16 | ||
CN202011109732.6A CN112434105A (zh) | 2020-10-16 | 2020-10-16 | 区块链存储的数据持续保存的方法、系统、设备及介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022078012A1 true WO2022078012A1 (zh) | 2022-04-21 |
Family
ID=74694952
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/109509 WO2022078012A1 (zh) | 2020-10-16 | 2021-07-30 | 区块链存储的数据持续保存的方法、系统、设备及介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112434105A (zh) |
WO (1) | WO2022078012A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112434105A (zh) * | 2020-10-16 | 2021-03-02 | 苏州浪潮智能科技有限公司 | 区块链存储的数据持续保存的方法、系统、设备及介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109271283A (zh) * | 2018-09-06 | 2019-01-25 | 北京云测信息技术有限公司 | 一种基于区块链的数据备份方法 |
CN110597824A (zh) * | 2019-09-20 | 2019-12-20 | 腾讯科技(深圳)有限公司 | 一种基于区块链网络的数据存储方法以及装置 |
US20200117550A1 (en) * | 2018-10-12 | 2020-04-16 | EMC IP Holding Company LLC | Method, device and computer program product for backing up data |
CN111104386A (zh) * | 2019-11-04 | 2020-05-05 | 北京海益同展信息科技有限公司 | 一种文件存储方法、终端及存储介质 |
CN111475538A (zh) * | 2019-01-24 | 2020-07-31 | 北京京东尚科信息技术有限公司 | 一种数据处理方法、装置及存储介质 |
CN112434105A (zh) * | 2020-10-16 | 2021-03-02 | 苏州浪潮智能科技有限公司 | 区块链存储的数据持续保存的方法、系统、设备及介质 |
-
2020
- 2020-10-16 CN CN202011109732.6A patent/CN112434105A/zh not_active Withdrawn
-
2021
- 2021-07-30 WO PCT/CN2021/109509 patent/WO2022078012A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109271283A (zh) * | 2018-09-06 | 2019-01-25 | 北京云测信息技术有限公司 | 一种基于区块链的数据备份方法 |
US20200117550A1 (en) * | 2018-10-12 | 2020-04-16 | EMC IP Holding Company LLC | Method, device and computer program product for backing up data |
CN111475538A (zh) * | 2019-01-24 | 2020-07-31 | 北京京东尚科信息技术有限公司 | 一种数据处理方法、装置及存储介质 |
CN110597824A (zh) * | 2019-09-20 | 2019-12-20 | 腾讯科技(深圳)有限公司 | 一种基于区块链网络的数据存储方法以及装置 |
CN111104386A (zh) * | 2019-11-04 | 2020-05-05 | 北京海益同展信息科技有限公司 | 一种文件存储方法、终端及存储介质 |
CN112434105A (zh) * | 2020-10-16 | 2021-03-02 | 苏州浪潮智能科技有限公司 | 区块链存储的数据持续保存的方法、系统、设备及介质 |
Also Published As
Publication number | Publication date |
---|---|
CN112434105A (zh) | 2021-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200228394A1 (en) | Virtual network health checker | |
US10491523B2 (en) | Load distribution in data networks | |
CN107078974B (zh) | 网络交换机、由网络交换机执行的方法以及存储器资源 | |
WO2022083690A1 (zh) | 数据管理方法、装置、设备、计算机存储介质和程序 | |
US20140149981A1 (en) | Sharing memory between virtual appliances | |
US20110317700A1 (en) | Method for real-time synchronization of arp record in rsmlt cluster | |
KR20120018178A (ko) | 객체 저장부들의 네트워크상의 스웜-기반의 동기화 | |
US9736279B2 (en) | Highly resilient protocol servicing in network-attached storage | |
US9407687B2 (en) | Method, apparatus, and network system for acquiring content | |
WO2023011254A1 (zh) | 基于远程直接数据存储的热迁移方法、装置及设备 | |
CN111338806B (zh) | 一种业务控制方法及装置 | |
US20180248820A1 (en) | Data storage systems and methods using a real-time messaging system | |
EP4221233A1 (en) | Data download method and apparatus, computer device and storage medium | |
TWI530147B (zh) | 一種基於層之自動調整同級媒體串流之裝置和方法 | |
CN110633168A (zh) | 一种分布式存储系统的数据备份方法和系统 | |
US20020078461A1 (en) | Incasting for downloading files on distributed networks | |
WO2022078012A1 (zh) | 区块链存储的数据持续保存的方法、系统、设备及介质 | |
Do et al. | Robust video-on-demand streaming in peer-to-peer environments | |
CN108540510A (zh) | 一种云主机创建方法、装置及云服务系统 | |
WO2016201992A1 (zh) | 云存储服务器的视频存储及检索方法、视频云存储系统 | |
CN114731297B (zh) | 用于计算设备对等方匹配的消息限制的自组织网络组 | |
Yu et al. | Granary: A sharing oriented distributed storage system | |
CN115004665A (zh) | 文件分享方法、装置及系统 | |
US11748131B2 (en) | Network updates for virtual machine migration | |
WO2020151337A1 (zh) | 分布式文件处理方法、装置、计算机设备以及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21879059 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21879059 Country of ref document: EP Kind code of ref document: A1 |