WO2020135094A1 - 区块数据归档方法及相关设备 - Google Patents
区块数据归档方法及相关设备 Download PDFInfo
- Publication number
- WO2020135094A1 WO2020135094A1 PCT/CN2019/125052 CN2019125052W WO2020135094A1 WO 2020135094 A1 WO2020135094 A1 WO 2020135094A1 CN 2019125052 W CN2019125052 W CN 2019125052W WO 2020135094 A1 WO2020135094 A1 WO 2020135094A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- consensus
- block
- blockchain node
- blockchain
- block data
- 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/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/113—Details of archiving
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
-
- 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/23—Updating
- G06F16/2365—Ensuring data consistency and integrity
Definitions
- This application relates to the field of blockchain technology, in particular, to a block data archiving method and related equipment.
- Blockchain is a distributed ledger. By maintaining the chain structure of data blocks, it can maintain continuously growing, sharable, and non-tamperable data records.
- Data archiving refers to clearing, reorganizing or packaging and storing obsolete or redundant data to other blockchain nodes to achieve the purpose of reclaiming disk space and reducing storage overhead.
- blockchain data archiving technology based on blockchain has gradually developed.
- the existing blockchain data archiving method is: first, periodically check the block height value and access frequency of the blockchain block chain node data, when the number of locally stored block data exceeds the preset value, it is regarded as Eligible for archiving. Then, compress and copy the block data that meets the archiving conditions from the local blockchain node. Finally, the file hash and auxiliary information of the compressed package are inserted into the archive file hash table for data query.
- each blockchain node in the blockchain system needs to back up the archive data of the local blockchain node.
- the resulting backup redundancy will not only consume network and storage resources, but also increase Operating costs also reduce the efficiency of data archiving.
- the archiving conditions are limited to the block height and access frequency, it also leads to a reduction in the flexibility of data archiving.
- embodiments of the present application provide a block data archiving method and related equipment, which are used to solve the problem of low efficiency and flexibility of blockchain data archiving.
- a first aspect of an embodiment of the present application discloses a method for archiving block data.
- the method includes:
- the first blockchain node determines the block data to be archived when it detects that its stored block resources meet the block data archiving conditions
- the first blockchain node sends an archive request to other blockchain nodes
- the first blockchain node negotiates consensus with the other blockchain nodes based on the received consensus response information fed back by the other blockchain nodes;
- the first blockchain node sends the block data to be archived to a third-party storage server for archiving
- the consensus result is used to determine whether any of the first blockchain node or other blockchain nodes is a consensus blockchain node.
- any blockchain node when any blockchain node detects that its stored block resources meet the conditions for archiving of block data, it determines the block data to be archived, and sends an archive request to other blockchain nodes and receives other blocks
- the consensus is determined and the consensus result of the current blockchain node is obtained as the consensus blockchain node, the current zone
- the block chain node sends the block data to be archived to a third-party storage server for archiving.
- the consensus result is used to determine any block chain node in the current block chain node or other block chain nodes as a consensus block chain node.
- the first block chain node determines that the block data to be archived when it detects that the block resources it stores meet the block data archiving conditions includes:
- the first blockchain node monitors whether the number of blocks stored by itself is greater than the preset number of blocks
- the first blockchain node monitors whether the block resource occupancy stored by itself is greater than the preset occupancy, and the block resource occupancy is the absolute value of the disk space occupied by the stored block;
- the first blockchain node monitors whether the block resource occupancy rate stored by itself is greater than a preset occupancy rate, and the block resource occupancy rate is the relative value of the stored block occupies disk space;
- the first blockchain node monitors the block creation time stored by itself to determine whether there is a block with a block creation time greater than a preset time;
- the first blockchain node sends an archive request to other blockchain nodes, including:
- the first blockchain node sends an archive request to the same group of blockchain nodes, or the first blockchain node sends to the same group of blockchain nodes and other groups of blockchain nodes on the blockchain Send an archive request.
- the first blockchain node negotiates consensus with the same group of blockchain nodes based on the received consensus response information fed back by the blockchain node, including:
- the first blockchain node obtains the negotiated consensus information in the consensus response information and compares it with its own negotiated consensus information.
- the negotiated consensus information includes block data to be archived and whether the block data to be archived Consistent information and designated consensus blockchain nodes;
- the first blockchain node receives the archive result fed back by the third-party storage server
- the first blockchain node sends the archive result to the other blockchain nodes.
- the method includes:
- the second blockchain node receives the archive request sent by the first blockchain node, and the second blockchain node and the first blockchain node belong to the blockchain node on the same blockchain;
- the second block chain node determines the block data to be archived when querying that the block resource stored by itself meets the block data archiving condition based on the archive request;
- the second blockchain node feeds back consensus response information to the first blockchain node, and negotiates consensus with other blockchain nodes based on the consensus response information;
- the second blockchain node sends the block data to be archived to a third-party storage server for archiving,
- the consensus result is used to determine that any one of the first blockchain node or other blockchain nodes is a consensus blockchain node.
- the step of determining the block data to be archived when querying itself based on the archive request to satisfy the block data archiving condition includes:
- the second blockchain node After receiving the archiving request, the second blockchain node queries whether the number of blocks stored by itself is greater than the preset number of blocks;
- the second blockchain node After receiving the archiving request, the second blockchain node queries whether the occupancy of the block resource stored by itself is greater than the preset occupancy, and the occupancy of the block resource is the disk space occupied by the stored block Absolute value
- the second blockchain node After receiving the archiving request, the second blockchain node queries whether the occupancy rate of the block resource stored by itself is greater than the preset occupancy rate, and the occupancy rate of the block resource is the disk space occupied by the stored block relative value;
- the second blockchain node After receiving the archive request, the second blockchain node queries the block creation time stored by itself to determine whether there is a block with a block creation time greater than a preset time;
- the second blockchain node feeds back consensus response information to the first blockchain node, and negotiates consensus with other blockchain nodes based on the consensus response information, including:
- the second blockchain node feeds back consensus response information to the first blockchain node, the consensus response information includes negotiated consensus information, the negotiated consensus information includes block data to be archived, and block to be archived Information about whether the data is consistent and the designated consensus blockchain node;
- the second blockchain node compares the negotiated consensus information with the negotiated consensus information of the other blockchain nodes
- the second blockchain node receives the archive result fed back by the third-party storage server
- the second blockchain node sends the archive result to the other blockchain node.
- the second aspect of the embodiments of the present application discloses a block data archiving method.
- the method includes:
- the client sends an archive request to the blockchain nodes in the blockchain
- the client receives feedback information from a consensus blockchain node.
- the consensus blockchain node is a blockchain node that performs consensus determination among the third blockchain nodes that receive the archive request.
- the third Block chain nodes are the block chain nodes whose block resources they store meet the conditions of block data archiving;
- the client uploads the block data to be archived in the consensus blockchain node to a third-party storage server for archiving.
- the client sends an archive request to a blockchain node in the blockchain, including:
- the client monitors whether the block resources stored by the block chain nodes in the block chain meet the block data archiving conditions
- the client determines a third blockchain node that satisfies the archiving conditions of the block data, and sends an archiving request to the third blockchain node; or,
- the client sends an archive request to any blockchain node in the blockchain, so that the blockchain node that receives the archive request confirms whether the block resources it stores meet the block data archiving conditions.
- the third blockchain node The third blockchain node.
- the client uploads the block data to be archived in the consensus blockchain node to a third-party storage server for archiving, including:
- the client obtains the block data to be archived in the consensus blockchain node based on the feedback information, and uploads the block data to be archived to a third-party storage server for archiving; or,
- the client Based on the feedback information, the client sends an upload block request to the consensus blockchain node, so that the consensus blockchain node uploads the block data to be archived to the first based on the upload block request Three-party storage server for archiving.
- the client receives the archive success result fed back by the third-party storage server, and generates an archive transaction
- the client sends the archived transaction to the third blockchain node, so that the third blockchain node checks whether the archived transaction is an archived transaction of the same group of blockchain nodes, and if so, deletes Block data corresponding to the archive transaction; or, check whether the archive transaction is an archive transaction of other blockchain nodes in the blockchain, and if so, delete the block data corresponding to the archive transaction.
- a third aspect of the embodiments of the present application discloses a block data archiving method.
- the method includes:
- the consensus negotiation node sends feedback information to the client.
- the consensus negotiation node is a third blockchain node that receives the archive request sent by the client to negotiate a consensus blockchain node, and the third blockchain node stores for itself Blockchain nodes whose block resources meet the conditions for block data archiving;
- the consensus negotiation node uploads the block data to be archived to a third-party storage server for archiving.
- the consensus negotiation node uploads the block data to be archived to a third-party storage server for archiving based on the request of the client, including:
- the consensus negotiation node receives the acquisition request sent by the client, and sends the determined block data to be archived to the client, so that the client uploads the block data to be archived to a third party storage Server for archiving; or,
- the consensus negotiation node receives the upload block request sent by the client, and uploads the determined block data to be archived to a third-party storage server for archiving.
- the fourth aspect of the embodiments of the present application discloses a first blockchain node, including:
- the event center is used to determine the block data to be archived when it detects that its stored block resources meet the block data archiving conditions
- Consensus unit used to send archive requests to other blockchain nodes, and negotiate consensus with the other blockchain nodes based on the received consensus response information fed back by the other blockchain nodes, if the consensus is determined, and all
- the first blockchain node is a consensus result of a consensus blockchain node, and the consensus result is used to determine that any one of the first blockchain node or other blockchain nodes is a consensus block Chain node, execute block management unit;
- the block management unit is used to send the block data to be archived to a third-party storage server for archiving.
- the event center is used to monitor whether the number of blocks stored by itself is greater than the preset number of blocks, if it is greater, determine that the block data archiving conditions are met, and obtain the block data to be archived; or ,
- the event center is used to monitor whether the block resource occupancy stored by itself is greater than the preset occupancy, and the block resource occupancy is the absolute value of the disk space occupied by the stored block. Data archiving conditions to obtain block data to be archived; or,
- the event center is used to monitor whether the block resource occupancy rate stored by itself is greater than a preset occupancy rate, and the block resource occupancy rate is a relative value of the stored block occupied disk space. Data archiving conditions to obtain block data to be archived; or,
- the event center is used to monitor the self-stored block creation time to determine whether there is a block with a block creation time greater than a preset time, if it exists, to determine that the block data archiving conditions are met, and to obtain a block creation time greater than a preset Time block data.
- the consensus unit based on the received consensus response information fed back by the other blockchain nodes to negotiate consensus with the other blockchain nodes is used to obtain the negotiation in the consensus response information Consensus information and compare it with its own consensus information. If the comparison results are consistent, determine the consensus and obtain the consensus result determined by the consensus blockchain node specified based on the negotiation consensus information.
- the negotiation consensus information includes to be archived Block data, whether the block data to be archived is consistent with the designated consensus blockchain node.
- the archive management unit is configured to receive the archive result fed back by the third-party storage server and send the archive result to the other blockchain nodes.
- the fifth aspect of the embodiments of the present application discloses a second blockchain node, including:
- the event center is used to receive the archive request sent by the first blockchain node, and determine the block data to be archived when querying the self-stored block resources based on the archive request to meet the block data archiving conditions;
- a consensus unit used to feed back consensus response information to the first blockchain node, and negotiate consensus with the same group of blockchain nodes based on the consensus response information, if a consensus is determined, and the second blockchain is obtained
- the node is the consensus result of the consensus blockchain node, and the consensus result is used to determine any one of the first blockchain node or other blockchain nodes as a consensus blockchain node, and execute the block Management unit
- the block management unit is used to send the block data to be archived to a third-party storage server for archiving.
- the event center is used to receive the archive request sent by the first blockchain node, and query whether the number of blocks stored by itself is greater than the preset number of blocks, and if it is greater, it is determined that the block data is satisfied Archiving conditions, to obtain block data to be archived; or,
- the event center is used to receive the archive request sent by the first blockchain node, and query whether the block resource occupation amount stored by itself is greater than a preset occupation amount, and the block resource occupation amount is the stored block occupation disk If the absolute value of the space is greater than that, it is determined that the conditions for archiving the block data are met, and the block data to be archived is obtained; or,
- the event center is used to receive the archive request sent by the first blockchain node, and query whether the occupancy rate of the block resource stored by itself is greater than the preset occupancy rate, and the occupancy rate of the block resource is the occupied disk of the stored block If the relative value of the space is greater than that, it is determined that the conditions for archiving the block data are met, and the block data to be archived is obtained; or,
- the event center is used to receive the archive request sent by the first blockchain node, query the block creation time stored by itself, and determine whether there is a block with a block creation time greater than a preset time, if it exists, it is determined that the block is satisfied Data archiving conditions, to obtain block data whose block creation time is greater than the preset time.
- the archive management unit is configured to receive the archive result fed back by the third-party storage server and send the archive result to the other blockchain nodes.
- the consensus response information is fed back to the first blockchain node, and a consensus unit that negotiates consensus with other blockchain nodes based on the consensus response information is used to report to the first area Blockchain nodes feedback consensus response information.
- the consensus response information includes negotiated consensus information.
- the negotiated consensus information includes block data to be archived. Whether the block data to be archived is consistent with the designated consensus blockchain node.
- the negotiation consensus information is compared with the negotiation consensus information of the other blockchain nodes. If the comparison result is consistent, a consensus is determined, and a consensus result determined by the consensus blockchain node specified based on the negotiation consensus information is obtained.
- a sixth aspect of the embodiments of the present application discloses a client, including:
- the sending unit is used to send an archive request to the blockchain nodes in the blockchain
- the receiving unit is used to receive feedback information from a consensus blockchain node.
- the consensus blockchain node is a blockchain node that performs consensus determination among the third blockchain nodes that receive the archive request.
- Three blockchain nodes are blockchain nodes whose self-stored block resources meet the conditions of the block data archiving;
- the processing unit is configured to upload the block data to be archived in the consensus blockchain node to a third-party storage server for archiving based on the feedback information.
- the seventh aspect of the embodiments of the present application discloses a consensus negotiation node.
- the consensus negotiation node is a third blockchain node that receives an archive request sent by a client and negotiates a consensus blockchain node.
- the chain node is a block chain node whose stored block resources meet the conditions for block data archiving.
- the consensus negotiation node includes:
- the transceiver unit is used to send feedback information to the client and receive requests from the client;
- the processing unit is used to upload the block data to be archived to the third-party storage server for archiving based on the request of the client.
- An eighth aspect of an embodiment of the present application discloses a blockchain system, including a first blockchain node disclosed in the fourth aspect of the embodiment of the present application and the second blockchain disclosed in the fifth aspect of the embodiment of the present application node.
- a ninth aspect of an embodiment of the present application discloses a blockchain system, including:
- the client is used to send an archive request to the blockchain node in the blockchain and receive feedback information from the third blockchain node.
- Blockchain nodes and send requests to blockchain nodes;
- the blockchain node is used to satisfy the block data archiving conditions when the block resources it stores and to negotiate consensus with other blockchain nodes that satisfy the block data archiving conditions, and to determine itself as a consensus negotiation node.
- the client sends feedback information, and based on the request of the client, the block data to be archived is uploaded to a third-party storage server for archiving.
- a tenth aspect of an embodiment of the present application discloses a computer-readable storage medium, including instructions that, when run on a computer, cause the computer to perform the first, second, third, and fourth aspects of the embodiments of the present application Block data archiving method disclosed in any aspect.
- FIG. 1 is a schematic diagram of a blockchain node architecture in a blockchain system disclosed in an embodiment of this application;
- FIG. 2 is a schematic flowchart of a block data archiving method provided by an embodiment of the present application
- FIG. 3 is a schematic diagram of the division of blockchain nodes on a blockchain provided by an embodiment of this application.
- FIG. 4 is a schematic diagram of a process of reaching consensus between blockchain nodes provided by an embodiment of the present application.
- FIG. 5 is a schematic structural diagram of a blockchain node provided by an embodiment of this application.
- FIG. 6 is a schematic flowchart of a block data archiving method provided by an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of a blockchain node provided by an embodiment of this application.
- FIG. 8 is a schematic structural diagram of a client provided by an embodiment of the present application.
- 9 is a schematic structural diagram of a consensus negotiation node provided by an embodiment of this application.
- the words “first” and “second” are used to distinguish the same or similar items whose functions and functions are basically the same. Those skilled in the art may understand that the words “first” and “second” do not limit the number and execution order, and the words “first” and “second” do not necessarily mean different.
- Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and so on.
- blockchain is essentially a disintermediation database.
- the blockchain is a non-tamperable and unforgeable distributed ledger guaranteed by cryptography.
- the blockchain is specifically composed of multiple independent blockchain nodes. Each blockchain node has an independent ledger, which is managed and maintained by the blockchain node itself. Specifically, each blockchain node is used to verify the validity of its own information and generate the next block.
- a block is a data storage structure, and is an object processed by the blockchain system.
- the blockchain node that received the block will save the transactions contained in the block and the block itself to the local ledger. It should be noted that every generation of a block requires the consensus of participating blockchain nodes, that is to say, there is a consensus mechanism between blockchain nodes.
- the consensus mechanism is a mathematical algorithm in the blockchain system to achieve trust and acquire rights between different blockchain nodes.
- each blockchain node 100 internally includes an event center 101, a consensus unit 102, a block management module 103, and an archive management module 104.
- the event center 101 is used to monitor the progress and status of the local blockchain node where the event center is located, and at the same time receive and process archive requests from other blockchain nodes.
- the event center 101 When the event center 101 detects that the local blockchain node satisfies the block data archiving conditions, it notifies the local blockchain node that the consensus unit 102 can currently archive the block data, and at the same time sends information such as the block data that needs to be archived. And the consensus unit 102 sends an archive request to other blockchain nodes.
- the event center 101 When the event center 101 receives a request from a local blockchain node to query whether it satisfies the block data archiving conditions, it will determine whether the current state of the local blockchain node requires block data archiving and return the result to The consensus unit 102 of the local blockchain node.
- the consensus unit 102 is responsible for negotiating whether or not to archive block data among multiple blockchain nodes, so as to achieve consensus among the blockchain nodes for archiving.
- the consensus unit 102 When the consensus unit 102 receives a notification from the event center 101 of the local blockchain node, prompting the local blockchain node to meet the conditions of the block data archiving, the block data can be archived. The consensus unit 102 sends the archive to other blockchain nodes request.
- the consensus unit 102 of the local blockchain node When the consensus unit 102 of the local blockchain node receives the archive request sent by other blockchain nodes, it sends an inquiry request to the event center 101 of the local blockchain node, asking whether the local blockchain node needs to be archived and based on the event
- the center 101 returns the result of monitoring whether the progress and status of the local blockchain node is archived, and uses this result as a response to the archive request sent by other blockchain nodes.
- the block management module 103 is responsible for managing and maintaining the block information and storage status of the local blockchain nodes and the blocks that have been archived and uploaded.
- the block management module 103 When the local blockchain node generates a new block, the block management module 103 records the basic information of the block. For example, basic information such as summary information, creation time, block size, storage method and storage location of the block. When a block is uploaded on the local blockchain node, or when the storage status of the block changes, the block management module 103 will modify the block information on the local blockchain node that needs to be maintained accordingly.
- the archive management module 104 is used to manage and maintain the archive strategy of local blockchain nodes.
- the archive strategy is preset in the archive management module 104. Further, the archive management module 104 also supports technicians or users to submit custom archive strategies.
- N blockchain nodes is used as an example to illustrate the block data archiving scheme disclosed in the embodiments of the present application.
- the value of N is a positive integer greater than 2.
- FIG. 2 it is a schematic flowchart of a block data archiving method disclosed in an embodiment of the present application, which mainly includes the following steps:
- the first blockchain node monitors whether its stored block resources meet the block data archiving conditions, and if so, determines the block data to be archived, and executes step S202, and if not, does not perform archiving.
- the specific architecture of the first blockchain node is the same as the blockchain node disclosed in FIG. 1.
- the event center of the first blockchain node monitors the progress and status of the first blockchain node.
- the event center of the first blockchain node hears that the first blockchain node meets the archiving conditions, the event center notifies the consensus unit of the first blockchain node of information such as block data that needs to be archived.
- the unit initiates an archive request.
- the block data archiving conditions include the following four conditions:
- the blockchain node monitors that the number of blocks stored by itself is greater than the preset number of blocks, and determines that the conditions for archiving the block data are met.
- the blockchain node monitors that the occupancy of the block resources stored by itself is greater than the preset occupancy, and the occupancy of the block resources is the absolute value of the disk space occupied by the stored blocks, and determines that the conditions for archiving the block data are met.
- the blockchain node monitors that the block resource occupancy rate stored by itself is greater than the preset occupancy rate, and the block resource occupancy rate is the relative value of the stored block occupancy disk space, and determines that the block data archiving conditions are met.
- the blockchain node monitors the block creation time stored by itself, determines that there is a block with a block creation time greater than a preset time, and determines that the block data archiving conditions are met.
- block data archiving conditions are only a part of all the block data archiving conditions.
- the block data archiving conditions support user customization, and technicians can customize the block data archiving conditions according to specific circumstances. .
- S202 The first blockchain node sends an archive request to other blockchain nodes.
- the consensus unit of the first blockchain node receives the notification sent by the event center, prompting that the first blockchain node meets the block data archiving conditions.
- the consensus unit of the first blockchain node can send an archive request to other blockchain nodes located in the same group.
- the consensus unit of the first blockchain node may also send an archive request to other blockchain nodes located on the blockchain.
- the archive request can be initiated by the blockchain node itself, or triggered by the blockchain node's event center after listening to a specific event, thereby avoiding the resource overhead caused by periodic detection.
- FIG. 3 it is a schematic diagram of the division of blockchain nodes in the blockchain system disclosed in the embodiment of the present application, which is used to explain the group relationship between the blockchain nodes.
- blockchain node 301, blockchain node 302, blockchain node 303, blockchain node 304, blockchain node 305, and blockchain node 306 belong to three different categories: A, B, and C. Chain (Chain).
- the blockchain node 301, the blockchain node 303, the blockchain node 304, and the blockchain node 305 are grouped into a group (Group 1) on Chain A.
- the blockchain node 301, the blockchain node 302, the blockchain node 303, and the blockchain node 305 are grouped into a group (Group 2).
- the blockchain node 302 On Chain C, the blockchain node 302, the blockchain node 303, the blockchain node 304, and the blockchain node 305 are grouped into a group (Group 3).
- each blockchain node may belong to the same chain or may belong to different chains.
- the blockchain nodes need to be grouped according to the chain in which they are located.
- blockchain node can independently choose which group to join.
- the first blockchain node when the first blockchain node satisfies the block data archiving conditions, the first blockchain node can also send the archiving request to other blockchain nodes in other groups.
- step S203 The other blockchain nodes receive the archiving request sent by the first blockchain node, and query whether the stored block resources meet the conditions for archiving the block data. If so, step S204 is performed, and if not, archiving is not performed.
- the consensus units of other blockchain nodes based on the received archive request sent by the consensus unit of the first blockchain node, ask whether their own event center meets the conditions for archiving the block data.
- the block data archiving conditions include the four conditions disclosed above, but not limited to this.
- the second blockchain node may be in the same group as the first blockchain node, or may not be in the same group.
- this is a flowchart of the processing of the archive request of the second blockchain node disclosed in the embodiment of the present application, which includes the following steps:
- the second blockchain node receives the archive request sent by the first blockchain node.
- the specific architecture of the second blockchain node is the same as the blockchain node disclosed in FIG. 1.
- the event center of the second blockchain node receives the archive request sent by the consensus unit of the first blockchain node.
- the second blockchain node Based on the archive request, the second blockchain node queries whether its stored block resources meet the conditions for archiving the block data. If it is, then execute S403, if not, then do not perform archiving, that is, do not respond to the first blockchain node Archive request sent.
- the event center of the second blockchain node may also be considered to have heard the archive request and inquire whether the block resources stored by the second blockchain node meet the conditions for archiving the block data.
- the event center notifies the consensus unit of the second blockchain node of the information such as the block data that needs to be archived.
- S403 The second blockchain node feeds back the consensus response information to the first blockchain node.
- the consensus unit of the second blockchain node receives a notification containing information such as archived block data sent by its own event center, generates a consensus response message based on the notification, and feeds back the consensus response message to the first area Blockchain node consensus unit.
- the first blockchain node negotiates consensus with other blockchain nodes based on the received consensus response information received from other blockchain nodes. If consensus is reached, the consensus blockchain node is determined, and step S206 is executed, if not reached Consensus will not perform archiving.
- S501 The second blockchain node feeds back the consensus response information to the first blockchain node.
- the consensus response information fed back by the second blockchain node to the first blockchain node includes negotiation consensus information.
- the negotiation consensus information includes the block data to be archived, whether the block data to be archived are consistent, and the designated consensus blockchain node.
- the content contained in the negotiation consensus information is the content that needs to be negotiated between each blockchain node.
- negotiation consensus information includes but is not limited to the above-mentioned content that needs to be negotiated.
- the first blockchain node obtains the negotiation consensus information in the consensus response information fed back by the second blockchain node.
- S504 The first blockchain node and the second blockchain node determine to reach consensus, and determine the consensus blockchain node
- either the first blockchain node or the second blockchain node can be negotiated and determined to be a consensus blockchain node.
- the consensus blockchain node is not limited to the above-mentioned first blockchain node or second blockchain node, but can also be the Nth blockchain node shown in FIG. 2 or other blocks in the same group
- N is a positive integer.
- the consensus blockchain node sends the block data to be archived to a third-party storage server for archiving.
- the third-party storage system may specifically be a distributed storage system.
- the consensus blockchain node when the consensus blockchain node is the first blockchain node, as shown by the solid line in FIG. 2, the first blockchain node sends the block data to be archived to a third-party storage server for archiving .
- the second blockchain node When the consensus blockchain node is the second blockchain node, as shown by the dotted line in FIG. 2, the second blockchain node sends the block data to be archived to a third-party storage server for archiving.
- consensus blockchain node is not limited to the above-mentioned first blockchain node or second blockchain node, but may be the Nth blockchain node shown in FIG. 2 or other areas in the same group Blockchain nodes.
- S207 The third-party server or consensus blockchain node returns the archive results to each blockchain node.
- the first blockchain node when the consensus blockchain node is the first blockchain node, the first blockchain node receives the archive result fed back by the third-party server, and the first blockchain node or third-party server will archive the result Send to other blockchain nodes.
- the second blockchain node receives the archive result fed back by the third-party server, and the second blockchain node or third-party server will send the archive result to each other area Blockchain nodes.
- consensus blockchain node is not limited to the above-mentioned first blockchain node or second blockchain node, but may be the third blockchain node, the fourth blockchain node in FIG. 2, or Other blockchain nodes in the same group.
- Each blockchain node verifies the archive result, and judges whether the archived block data is the block data agreed by each blockchain node. If yes, the archive is completed, if not, it returns to step S201.
- each blockchain node verifies whether the archived block data is the block data for archiving consensus after the above steps, and whether the data content of the archived block data is correct.
- each block chain node completes the archive.
- the block data archiving method disclosed in the embodiment of the present application by grouping the blockchain nodes in the blockchain system according to the chain in which they are located, the same group of blockchain nodes achieves the sharing of archived data between blockchain nodes by consensus , To avoid redundant backup and ensure the correctness of archived data. It adopts an archiving condition judgment mechanism based on event triggering, and supports user-defined archiving conditions, which effectively improves the implementation efficiency, operability and flexibility of archiving.
- the first blockchain node is the party that initiates the archiving request, and in fact the second blockchain node can also serve as the party that initiates the archiving request.
- the first block chain node or other block chain nodes determine the block data to be archived when they detect that their stored block resources meet the block data archiving conditions The process of archiving based on block data is different.
- the first blockchain node or another blockchain node monitors whether the number of blocks stored by itself is greater than the preset number of blocks; if it is greater, it determines that the conditions for archiving the block data are satisfied and obtains the block data to be archived.
- the first blockchain node or another blockchain node monitors whether the block resource occupancy stored by itself is greater than the preset occupancy, and the block resource occupancy is the absolute value of the disk space occupied by the stored block ; If it is greater, it is determined that the conditions for archiving the block data are met and the block data to be archived is obtained.
- the first blockchain node or other blockchain nodes monitor whether the block resource occupancy rate stored by themselves is greater than the preset occupancy rate, and the block resource occupancy rate is the relative value of the stored block occupied disk space ; If it is greater, it is determined that the conditions for archiving the block data are met and the block data to be archived is obtained.
- the first blockchain node or other blockchain node monitors the block creation time stored by itself to determine whether there is a block with a block creation time greater than a preset time; if it exists, it determines that the block data archiving conditions are met To obtain the block data whose block creation time is greater than the preset time.
- the block data archiving method and related equipment disclosed in the embodiments of the present application determine that the block data to be archived is determined by any block chain node when it detects that the block resources stored by itself meet the block data archiving conditions, and submits to the same group
- the blockchain node sends an archive request, and receives the consensus response information fed back by the same group of blockchain nodes, and negotiates consensus with the same group of blockchain nodes based on the consensus response information, confirms the consensus, and obtains the current blockchain node
- the current blockchain node sends the block data to be archived to a third-party storage server for archiving, and the consensus result is used to determine the current blockchain node or the same group of blockchain Any blockchain node in the node is a consensus blockchain node.
- an embodiment of the present application further discloses a flowchart of a block data archiving method.
- the block data archiving method includes the following steps:
- S601 The client sends an archive request to the blockchain nodes in the blockchain.
- the client can monitor the progress and status of the blockchain nodes in the blockchain, that is, the client monitors the block resources stored by the blockchain nodes in the blockchain Whether the block data archiving conditions are met, determine the third blockchain node that meets the block data archiving conditions, send an archiving request to the third blockchain node, the third blockchain node receives the archiving request, and the other Go to the third blockchain node of the filing request to negotiate consensus and determine the consensus negotiation node.
- the client can also send an archive request to any blockchain node in the blockchain, and any blockchain node that receives the archive request confirms whether the block resources it stores meet the block data archiving conditions. Satisfy, as the third blockchain node, negotiate consensus with other third blockchain nodes that meet the conditions of the block data archiving, and determine the consensus negotiation node.
- S602 The consensus negotiation node sends feedback information to the client.
- the consensus negotiation node is a blockchain node determined by consensus among the third blockchain nodes that have received the filing request.
- the third block chain node is a block chain node whose block resources stored by it satisfy the block data archiving conditions.
- the feedback information is the response information of the blockchain node in the blockchain to the client's archive request.
- block data archiving conditions involved in the embodiments of the present application are consistent with the block data archiving conditions disclosed in the above embodiments of the present application, and will not be repeated here.
- S603 The client receives feedback information of the consensus negotiation node.
- S604 The client sends a request to the consensus negotiation node based on the feedback information.
- the consensus negotiation node receives the request sent by the client, and based on the request, the block data to be archived in the consensus negotiation node is uploaded to a third-party storage server for archiving.
- S604 and S605 are different according to the request sent by the client, and specifically have the following execution methods:
- the client sends an acquisition request to the consensus negotiation node based on the feedback information.
- the consensus negotiation node sends the determined block data to be archived to the client.
- the client obtains the block data to be archived in the consensus negotiation node, and uploads the block data to be archived to a third-party storage server for archiving.
- the client sends a block upload request to the consensus negotiation node.
- the consensus negotiation node uploads the determined block data to be archived to a third-party storage server for archiving.
- the client receives the archive success result fed back by the third-party storage server, generates an archive transaction, and sends the archive transaction to the third blockchain node.
- the third blockchain node After receiving the archive transaction sent by the client, the third blockchain node checks whether the archive transaction is an archive transaction of the same group of blockchain nodes, and if so, deletes the block data corresponding to the archive transaction, if not , The delete operation is not performed.
- the third blockchain node After receiving the archive transaction sent by the client, the third blockchain node checks whether the archive transaction is an archive transaction of other blockchain nodes in the blockchain, and if so, deletes the block data corresponding to the archive transaction, If not, the delete operation is not performed.
- the block data archiving method disclosed in the embodiment of the present application sends a filing request to the blockchain node through the client, so that the blockchain data archiving conditions are met in the blockchain, and the consensus negotiation node in the consensus negotiation node to be archived Block data can be uploaded to a third-party storage server for archiving, which achieves the sharing of the same archive data among multiple blockchain nodes, avoids redundant backups, and effectively improves the implementation efficiency, operability and flexibility of data archiving the goal of.
- FIG. 7 it is a schematic structural diagram of a blockchain node disclosed in an embodiment of the present application.
- the blockchain node includes the event center, consensus unit, block management module, and archive management module mentioned in Figure 1 above.
- the structure of the first block chain node, the second block chain node and other block chain nodes mentioned in the block data archiving method shown in FIG. 2 of the above embodiment of the present application is the same as the block chain node.
- the structure of the blockchain node 700 includes: an event center 701, a consensus unit 702, and a block management unit 703.
- Event unit 701 when a blockchain node sends an archiving request, event unit 701 is used to determine the block data to be archived when it detects that the block resources it stores meet the block data archiving conditions.
- the event unit 701 is used to receive an archive request sent by another blockchain node, and when it is inquired based on the archive request that its stored block resources meet the block data archiving conditions, determine the Block data.
- Consensus unit 702 when a blockchain node sends an archive request, the consensus unit 702 is used to send an archive request to other blockchain nodes, and negotiate with other blockchain nodes based on the received consensus response information fed back by other blockchain nodes Consensus, if a consensus is determined, and the consensus result obtained by the blockchain node is a consensus blockchain node, the consensus result is used to determine any blockchain node in the blockchain node or other blockchain nodes in the same group As a consensus blockchain node, a block management unit 703 is executed.
- the consensus unit 702 is used to feed back consensus response information to other blockchain nodes, and negotiate consensus with other blockchain nodes in the same group based on the consensus response information.
- the blockchain node is the consensus result of the consensus blockchain node.
- the consensus result is used to determine that any of the blockchain nodes or other blockchain nodes is a consensus blockchain node and execute the block Management unit 703.
- the block management unit 703 is used to send the block data to be archived to a third-party storage server for archiving.
- the archive management unit 704 when the blockchain node is a consensus blockchain node, the archive management unit 704 is used to receive the archive result fed back by the third-party storage server and send the archive result to other blockchain nodes. When the blockchain node is not a consensus blockchain node, the archive management unit 704 is used to receive the archive result sent by the third-party storage server or the consensus blockchain node.
- the event center 701 is used to monitor whether the number of blocks stored by itself is greater than the preset number of blocks, if it is greater, it is determined that the block data archiving conditions are met, and the area to be archived is obtained Block data.
- the event center 701 is used to receive archiving requests sent by other blockchain nodes, to query whether the number of blocks stored by itself is greater than the preset number of blocks, and if it is greater, it is determined that the block data archiving is satisfied Conditions, to obtain the block data to be archived.
- the event center 701 is used to monitor whether the block resource occupation it stores is greater than the preset occupation amount, and the block resource occupation amount is the disk space occupied by the stored block The absolute value, if greater than, determines that the block data archiving conditions are met, and obtains the block data to be archived.
- the event center 701 is used to receive archiving requests sent by other blockchain nodes, and query whether the block resource occupancy it stores is greater than the preset occupancy, and the block resource occupancy is the stored The absolute value of the block occupied by disk space is greater than that, it is determined that the block data archiving conditions are met, and the block data to be archived is obtained.
- the event center 701 is used to monitor whether the block resource occupancy rate stored by itself is greater than the preset occupancy rate, and the block resource occupancy rate is the amount of disk space occupied by the stored block If the relative value is greater than this, it is determined that the block data archiving conditions are met, and the block data to be archived is obtained.
- the event center 701 is used to receive the archive request sent by other blockchain nodes in the same group, and query whether the occupancy rate of the block resource stored by itself is greater than the preset occupancy rate, and the occupancy rate of the block resource If the stored block occupies the relative value of the disk space, if it is greater, it is determined that the block data archiving conditions are met, and the block data to be archived is obtained.
- the event center 701 is used to monitor the block creation time stored by itself, to determine whether there is a block with a block creation time greater than a preset time, and if it exists, to determine that the block is satisfied Data archiving conditions, to obtain block data whose block creation time is greater than the preset time.
- the event center 701 is used to receive archive requests sent by other blockchain nodes, query the block creation time stored by itself, and determine whether there is a block with a block creation time greater than a preset time, If it exists, it is determined that the block data archiving conditions are met, and block data whose block creation time is greater than the preset time is acquired.
- the consensus unit 702 for consulting consensus with other blockchain nodes based on the received consensus response information fed back by other blockchain nodes is used to obtain the consensus in the consensus response information Information, and compare it with its own negotiated consensus information. If the comparison results are consistent, determine the consensus and obtain the consensus result determined by the consensus blockchain node specified based on the negotiated consensus information.
- the negotiated consensus information includes the block to be archived Data, information on whether the block data to be archived is consistent and the designated consensus blockchain node.
- the blockchain node When the blockchain node receives the archiving request, it feedbacks the consensus response information to other blockchain nodes in the same group. Based on the consensus response information, it negotiates the consensus unit 702 with other blockchain nodes, and is used to send other blockchain nodes to the same group. Feedback consensus response information.
- the consensus response information includes negotiation consensus information.
- the negotiation consensus information includes block data to be archived, information on whether the block data to be archived is consistent with the designated consensus blockchain node, and will negotiate the negotiation consensus information with the blockchain node Compare the consensus information. If the comparison results are consistent, determine the consensus and obtain the consensus result determined by the consensus blockchain node specified based on the consensus information.
- the block chain nodes disclosed in the embodiments of the present application determine the block data to be archived by monitoring the block resources stored by themselves to meet the block data archiving conditions, and send archiving requests to and receive from other block chain nodes Consensus response information fed back by other blockchain nodes, and based on the consensus response information, negotiate consensus with other blockchain nodes.
- the current blockchain node sends the block data to be archived to a third-party storage server for archiving, and the consensus result is used to determine whether any of the current blockchain node or other blockchain nodes is a consensus block Chain node. It achieves the purpose of sharing the same archived data among multiple blockchain nodes, avoiding redundant backups, and effectively improving the implementation efficiency, operability and flexibility of data archiving.
- An embodiment of the present application provides a blockchain system, including the above-mentioned blockchain node disclosed in FIG. 7 of the present application.
- the corresponding embodiment of the present application also correspondingly discloses the structural schematic diagram of the client and the blockchain node that specifically execute the block data archiving method.
- the client 800 includes:
- the sending unit 801 is used to send an archive request to the blockchain nodes in the blockchain;
- the receiving unit 802 is used to receive feedback information of the consensus blockchain node.
- the consensus blockchain node is a blockchain node that performs consensus determination among the third blockchain nodes that have received the archive request.
- the third block chain node is a block chain node whose block resources stored by it satisfy the block data archiving conditions.
- the processing unit 803 is used to upload the block data to be archived in the consensus blockchain node to the third-party storage server for archiving based on the feedback information.
- the processing unit 803 is also used to monitor whether the block resources stored by the block chain nodes in the block chain meet the block data archiving conditions, and determine the third block chain node that meets the block data archiving conditions After that, the sending unit 801 sends an archive request to the third blockchain node.
- the sending unit 801 is used to send an archive request to any blockchain node in the blockchain.
- the receiving unit 802 is used to obtain the block data to be archived in the consensus blockchain node based on the feedback information, and correspondingly, the sending unit 801 is used to upload the block data to be archived to a third party Storage server for archiving.
- the sending unit 801 is used to send an upload block request to the consensus blockchain node based on the feedback information.
- the receiving unit 802 is configured to receive the archive success result fed back by the third-party storage server.
- the processing unit 803 is configured to generate an archive transaction based on the archive success result.
- the sending unit 801 is used to send the archive transaction to the third blockchain node, so that the third blockchain node checks whether the archive transaction is an archive transaction of the same group of blockchain nodes, and if so, deletes the area corresponding to the archive transaction Block data, if not, do not delete; or, check whether the archive transaction is an archive transaction of other blockchain nodes in the blockchain, if yes, delete the block data corresponding to the archive transaction, if not, do not delete .
- the consensus negotiation node is a third blockchain node that receives the archive request sent by the client, and determines the consensus of the blockchain node.
- the third blockchain node is an area where the stored block resources of the third party meet the conditions of the block data archiving.
- Blockchain nodes It should be noted that in the specific implementation, the structure of each blockchain node in the blockchain is the same, and from the result of consensus negotiation, it is possible to become a consensus negotiation node.
- the consensus negotiation node 900 includes:
- the transceiver unit 901 is used to send feedback information to the client and receive requests from the client.
- the processing unit 902 is used to upload the block data to be archived to a third-party storage server for archiving based on the client's request.
- the transceiver unit 901 is used to receive the acquisition request sent by the client, send the determined block data to be archived to the client, so that the client uploads the block data to be archived to a third-party storage server for archiving .
- the transceiver unit 901 is configured to receive an upload block request sent by a client, and upload the determined block data to be archived to a third-party storage server for archiving.
- the transceiver unit 901 is also used to receive the archived transaction sent by the client.
- the processing unit 902 is used to check whether the archived transaction is an archived transaction of the same group of blockchain nodes. If it is, delete the block data corresponding to the archived transaction. Or, check whether the archived transaction is an archived transaction of other blockchain nodes in the blockchain, if so, delete the block data corresponding to the archived transaction, and if not, do not delete it.
- An embodiment of the present application also provides a blockchain system corresponding to the above client and blockchain node, including the client disclosed in FIG. 8 of the present application, and blocks having the same structure of the consensus negotiation node disclosed in FIG. 9 Chain node.
- the client is used to send an archive request to a blockchain node in the blockchain and receive feedback information from a third blockchain node.
- the third blockchain node meets the conditions for the archiving of the block data for its stored block resources Blockchain nodes and send requests to blockchain nodes;
- the blockchain node is used to satisfy the block data archiving conditions when the block resources it stores and to negotiate consensus with other blockchain nodes that meet the block data archiving conditions.
- Send feedback information based on the request of the client, upload the block data to be archived to a third-party storage server for archiving.
- the client and the blockchain node that implement the block data archiving method disclosed in the embodiments of the present application send an archiving request to the blockchain node through the client, so that the blockchain data archiving conditions are met in the blockchain, and the consensus is determined through negotiation
- the block data to be archived in the consensus negotiation nodes can be uploaded to a third-party storage server for archiving, which realizes the sharing of the same archived data among multiple blockchain nodes, avoids redundant backups, and effectively improves the data archiving
- embodiments of the present application provide a computer-readable storage medium, including instructions for causing a computer to execute the block data archiving method disclosed in FIG. 2 of the present application, or for the computer to execute the block data archiving disclosed in FIG. 6 of the present application. Method instructions.
- the data archiving method and related equipment disclosed in the embodiments of the present application when any block node detects that the block resources stored by itself meet the conditions of the block data archiving, determine the block data to be archived, and submit Other blockchain nodes send archive requests, and receive consensus response information fed back by other blockchain nodes, and negotiate consensus with other blockchain nodes based on the consensus response information, determine the consensus, and obtain the current blockchain node as In the case of a consensus result of a consensus blockchain node, the current blockchain node sends the block data to be archived to a third-party storage server for archiving, and the consensus result is used to determine the current blockchain node or other blockchain nodes Any of the blockchain nodes is a consensus blockchain node.
- the computer program product includes one or more computer instructions.
- the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
- the computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions can be transmitted from a website site, computer, server, or data center via wire (e.g.
- the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. Available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, Solid State Disk (SSD)), and so on.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种区块数据归档方法及相关设备。该方法包括:第一区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据。第一区块链节点向同组区块链节点发送归档请求。第一区块链节点基于接收的同组区块链节点反馈的共识响应信息与同组区块链节点协商共识。若确定共识,且获取到第一区块链节点为共识区块链节点的共识结果,第一区块链节点将待归档的区块数据发送至第三方存储服务器进行归档,共识结果用于确定第一区块链节点或同组区块链节点中的任一区块链节点为共识区块链节点。通过上述过程,实现了在多个区块链节点间共享同一份归档数据,避免了冗余备份并有效提升了数据归档的实施效率、可操作性和灵活性。
Description
本申请要求于2018年12月29日提交中国专利局、申请号为201811639788.5、发明名称为“区块数据归档方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及区块链技术领域,尤其是,涉及一种区块数据归档方法及相关设备。
区块链是一种分布式账本,其通过维护数据块的链式结构,可以维护持续增长的、可共享的、不可篡改的数据记录。数据归档是指通过将过时或冗余的数据进行清空、重组或打包转存储至其他区块链节点,以达到回收磁盘空间,减少存储开销的目的。随着区块链技术的普及和推广,基于区块链的区块链数据归档技术也逐渐发展起来。
现有的区块链数据归档方式为:首先,周期性地检测区块链区块链节点数据的区块高度值和访问频率,当本地存储区块数据个数超过预设值,则视为符合归档条件。然后,从本地区块链节点压缩并拷贝满足归档条件的区块数据。最后,将压缩包的文件哈希及附属信息插入到归档文件哈希表中,供数据查询时使用。
但是,采用上述方式进行数据归档,区块链系统中的每个区块链节点都需要对本地区块链节点的归档数据进行备份,所造成的备份冗余,不仅会消耗网络和存储资源,增加运营成本,还降低了数据归档效率。并且,由于归档条件局限于区块高度和访问频率,还导致数据归档的灵活性降低。
发明内容
有鉴于此,本申请实施例提供一种区块数据归档方法及相关设备,用于解决区块链数据归档的效率和灵活性低的问题。
本申请实施例提供如下技术方案:
本申请实施例第一方面公开了一种区块数据归档方法,所述方法包括:
第一区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据;
所述第一区块链节点向其他区块链节点发送归档请求;
所述第一区块链节点基于接收的所述其他区块链节点反馈的共识响应信息与所述其他区块链节点协商共识;
若确定共识,且获取到所述第一区块链节点为共识区块链节点的共识结果,所述第一区块链节点将所述待归档的区块数据发送至第三方存储服务器进行归档,所述共识结果用于确定所述第一区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点。
上述方案,通过任意区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据,并向其他区块链节点发送归档请求,以及接收其他区块链节点反馈的共识响应信息,并基于该共识响应信息与其他区块链节点协商共识,在确定共识,且获取到当前区块链节点为共识区块链节点的共识结果的情况下,当前区块链节点将待归档的区块数据发送至第三方存储服务器进行归档,共识结果用于确定当前区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点。通过上述过程,实现了在多个区块 链节点间共享同一份归档数据,避免冗余备份,并有效提升了数据归档的实施效率、可操作性和灵活性的目的。
在一种可能的设计中,所述第一区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据,包括:
所述第一区块链节点监测自身存储的区块数量是否大于预设区块数量;
若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述第一区块链节点监测自身存储的区块资源占用量是否大于预设占用量,所述区块资源占用量为所存储的区块占用磁盘空间的绝对值;
若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述第一区块链节点监测自身存储的区块资源占用率是否大于预设占用率,所述区块资源占用率为所存储的区块占用磁盘空间的相对值;
若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述第一区块链节点监测自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块;
若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
在一种可能的设计中,所述第一区块链节点向其他区块链节点发送归档请求,包括:
所述第一区块链节点向同组区块链节点发送归档请求,或者,所述第一区块链节点向同组区块链节点和所述区块链上的其他组区块链节点发送归档请求。
在一种可能的设计中,所述第一区块链节点基于接收的所述区块链节点反馈的共识响应信息与所述同组区块链节点协商共识,包括:
所述第一区块链节点获取所述共识响应信息中的协商共识信息,并与自身的协商共识信息进行比较,所述协商共识信息包括待归档的区块数据,待归档的区块数据是否一致的信息和指定的共识区块链节点;
若比较结果一致,确定共识,并确定基于所述协商共识信息指定的共识区块链节点。
在一种可能的设计中,还包括:
所述第一区块链节点接收所述第三方存储服务器反馈的归档结果;
所述第一区块链节点将所述归档结果发送给所述其他区块链节点。
在一种可能的设计中,所述方法包括:
第二区块链节点接收第一区块链节点发送的归档请求,所述第二区块链节点与所述第一区块链节点属于同一区块链上的区块链节点;
所述第二区块链节点在基于所述归档请求查询到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据;
所述第二区块链节点向所述第一区块链节点反馈共识响应信息,并基于所述共识响应信息与其他区块链节点协商共识;
若确定共识,且获取所述第二区块链节点为共识区块链节点的共识结果,所述第二区块链节点将所述待归档的区块数据发送至第三方存储服务器进行归档,所述共识结果用于确定所述第一区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点。
在一种可能的设计中,所述当基于所述归档请求查询自身满足区块数据归档条件时,确定待归档的区块数据,包括:
所述第二区块链节点在接收到所述归档请求后,查询自身存储的区块数量是否大于预设区块数量;
若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述第二区块链节点在接收到所述归档请求后,查询自身存储的区块资源占用量是否大于预设占用量,所述区块资源占用量为所存储的区块占用磁盘空间的绝对值;
若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述第二区块链节点在接收到所述归档请求后,查询自身存储的区块资源占用率是否大于预设占用率,所述区块资源占用率为所存储的区块占用磁盘空间的相对值;
若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述第二区块链节点在接收到所述归档请求后,查询自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块;
若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
在一种可能的设计中,所述第二区块链节点向所述第一区块链节点反馈共识响应信息,基于所述共识响应信息与其他区块链节点协商共识,包括:
所述第二区块链节点向所述第一区块链节点反馈共识响应信息,所述共识响应信息包括协商共识信息,所述协商共识信息包括待归档的区块数据,待归档的区块数据是否一致的信息和指定的共识区块链节点;
所述第二区块链节点将所述协商共识信息与所述其他区块链节点的协商共识信息进行比较;
若比较结果一致,确定共识,并确定基于所述协商共识信息指定的共识区块链节点。
在一种可能的设计中,还包括:
所述第二区块链节点接收所述第三方存储服务器反馈的归档结果;
所述第二区块链节点将所述归档结果发送给所述其他区块链节点。
本申请实施例第二方面公开了一种区块数据归档方法,所述方法包括:
客户端向区块链中的区块链节点发送归档请求;
所述客户端接收共识区块链节点的反馈信息,所述共识区块链节点为接收到所述归档请求的第三区块链节点之间进行共识确定的区块链节点,所述第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点;
所述客户端基于所述反馈信息使所述共识区块链节点中的待归档的区块数据上传至第三方存储服务器进行归档。
在一种可能的设计中,所述客户端向区块链中的区块链节点发送归档请求,包括:
所述客户端监测区块链中的区块链节点存储的区块资源是否满足区块数据归档条件;
所述客户端确定满足所述区块数据归档条件的第三区块链节点,向所述第三区块链节点发送归档请求;或者,
所述客户端向区块链中的任意区块链节点发送归档请求,使接收所述归档请求的区块 链节点确认自身存储的区块资源是否满足区块数据归档条件,若满足,则作为第三区块链节点。
在一种可能的设计中,所述客户端基于所述反馈信息使所述共识区块链节点中的待归档的区块数据上传至第三方存储服务器进行归档,包括:
所述客户端基于所述反馈信息获取所述共识区块链节点中的待归档的区块数据,将所述待归档的区块数据上传至第三方存储服务器进行归档;或者,
所述客户端基于所述反馈信息,向所述共识区块链节点发送上传区块请求,使所述共识区块链节点基于所述上传区块请求,将待归档的区块数据上传至第三方存储服务器进行归档。
在一种可能的设计中,还包括:
所述客户端接收所述第三方存储服务器反馈的归档成功结果,生成归档交易;
所述客户端将所述归档交易发送至所述第三区块链节点,使所述第三区块链节点检查所述归档交易是否为同组区块链节点的归档交易,若是,则删除所述归档交易对应的区块数据;或者,检查所述归档交易是否为区块链中其他区块链节点的归档交易,若是,则删除所述归档交易对应的区块数据。
本申请实施例第三方面公开了一种区块数据归档方法,所述方法包括:
共识协商节点向客户端发送反馈信息,所述共识协商节点为接收客户端发送的归档请求的第三区块链节点协商共识确定的区块链节点,所述第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点;
所述共识协商节点基于所述客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档。
在一种可能的设计中,所述共识协商节点基于所述客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档,包括:
所述共识协商节点接收所述客户端发送的获取请求,将确定的待归档的区块数据发送至所述客户端,使所述客户端将所述待归档的区块数据上传至第三方存储服务器进行归档;或者,
所述共识协商节点接收所述客户端发送的上传区块请求,将确定的待归档的区块数据上传至第三方存储服务器进行归档。
本申请实施例第四方面公开了一种第一区块链节点,包括:
事件中心,用于在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据;
共识单元,用于向其他区块链节点发送归档请求,并基于接收的所述其他区块链节点反馈的共识响应信息与所述其他区块链节点协商共识,若确定共识,且获取到所述第一区块链节点为共识区块链节点的共识结果,所述共识结果用于确定所述第一区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点,执行区块管理单元;
区块管理单元,用于将所述待归档的区块数据发送至第三方存储服务器进行归档。
在一种可能的设计中,所述事件中心,用于监测自身存储的区块数量是否大于预设区 块数量,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述事件中心,用于监测自身存储的区块资源占用量是否大于预设占用量,所述区块资源占用量为所存储的区块占用磁盘空间的绝对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述事件中心,用于监测自身存储的区块资源占用率是否大于预设占用率,所述区块资源占用率为所存储的区块占用磁盘空间的相对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述事件中心,用于监测自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块,若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
在一种可能的设计中,所述基于接收的所述其他区块链节点反馈的共识响应信息与所述其他区块链节点协商共识的共识单元,用于获取所述共识响应信息中的协商共识信息,并与自身的协商共识信息进行比较,若比较结果一致,确定共识,并获得基于所述协商共识信息指定的共识区块链节点所确定的共识结果,所述协商共识信息包括待归档的区块数据,待归档的区块数据是否一致和指定的共识区块链节点。
在一种可能的设计中,还包括:
归档管理单元,用于接收所述第三方存储服务器反馈的归档结果,将所述归档结果发送给所述其他区块链节点。
本申请实施例第五方面公开了一种第二区块链节点,包括:
事件中心,用于接收第一区块链节点发送的归档请求,在基于所述归档请求查询到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据;
共识单元,用于向所述第一区块链节点反馈共识响应信息,并基于所述共识响应信息与同组区块链节点协商共识,若确定共识,且获取到所述第二区块链节点为共识区块链节点的共识结果,所述共识结果用于确定所述第一区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点,执行区块管理单元;
区块管理单元,用于将所述待归档的区块数据发送至第三方存储服务器进行归档。
在一种可能的设计中,所述事件中心,用于接收第一区块链节点发送的归档请求,查询自身存储的区块数量是否大于预设区块数量,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述事件中心,用于接收第一区块链节点发送的归档请求,查询自身存储的区块资源占用量是否大于预设占用量,所述区块资源占用量为所存储的区块占用磁盘空间的绝对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述事件中心,用于接收第一区块链节点发送的归档请求,查询自身存储的区块资源占用率是否大于预设占用率,所述区块资源占用率为所存储的区块占用磁盘空间的相对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,
所述事件中心,用于接收第一区块链节点发送的归档请求,查询自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块,若存在,确定满足区块数据归档 条件,获取区块创建时间大于预设时间的区块数据。
在一种可能的设计中,还包括:
归档管理单元,用于接收所述第三方存储服务器反馈的归档结果,将所述归档结果发送给所述其他区块链节点。
在一种可能的设计中,所述向所述第一区块链节点反馈共识响应信息,基于所述共识响应信息与其他区块链节点协商共识的共识单元,用于向所述第一区块链节点反馈共识响应信息,所述共识响应信息包括协商共识信息,所述协商共识信息包括待归档的区块数据,待归档的区块数据是否一致和指定的共识区块链节点,将所述协商共识信息与所述其他区块链节点的协商共识信息进行比较,若比较结果一致,确定共识,并获得基于所述协商共识信息指定的共识区块链节点所确定的共识结果。
本申请实施例第六方面公开了一种客户端,包括:
发送单元,用于向区块链中的区块链节点发送归档请求;
接收单元,用于接收共识区块链节点的反馈信息,所述共识区块链节点为接收到所述归档请求的第三区块链节点之间进行共识确定的区块链节点,所述第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点;
处理单元,用于基于所述反馈信息使所述共识区块链节点中待归档的区块数据上传至第三方存储服务器进行归档。
本申请实施例第七方面公开了一种共识协商节点,所述共识协商节点为接收客户端发送的归档请求的第三区块链节点协商共识确定的区块链节点,所述第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点,所述共识协商节点包括:
收发单元,用于向客户端发送反馈信息,以及接收所述客户端的请求;
处理单元,用于基于所述客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档。
本申请实施例第八方面公开了一种区块链系统,包括本申请实施例第四方面公开的第一区块链节点和本申请实施例第五方面公开的所述的第二区块链节点。
本申请实施例第九方面公开了一种区块链系统,包括:
客户端,用于向区块链中的区块链节点发送归档请求,接收第三区块链节点的反馈信息,第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点,以及向区块链节点发送请求;
所述区块链节点,用于在自身存储的区块资源满足区块数据归档条件,且与其他满足区块数据归档条件的区块链节点协商共识,确定自身为共识协商节点时,向所述客户端发送反馈信息,基于所述客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档。
本申请实施例第十方面公开了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行本申请实施例第一方面、第二方面、第三方面和第四方面任一方面公开的区块数据归档方法。
图1为本申请实施例公开的区块链系统中的区块链节点架构示意图;
图2为本申请实施例提供的一种区块数据归档方法的流程示意图;
图3为本申请实施例提供的区块链上区块链节点划分示意图;
图4为本申请实施例提供的区块链节点之间达成共识的流程示意图;
图5为本申请实施例提供的一种区块链节点的结构示意图;
图6为本申请实施例提供的一种区块数据归档方法的流程示意图;
图7为本申请实施例提供的一种区块链节点的结构示意图;
图8为本申请实施例提供的一种客户端的结构示意图;
图9为本申请实施例提供的一种共识协商节点的结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。并且,在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
此外,本申请实施例和权利要求书及附图中的术语“包括”和“具有”不是排他的。例如,包括了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,还可以包括没有列出的步骤或模块。
区块链是一种分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链作为比特币的一个重要概念,本质是一个去中介化的数据库。
同时,作为比特币的底层技术,区块链是一种以密码学方式保证的不可篡改和不可伪造的分布式账本。区块链具体由多个独立的区块链节点构成。每个区块链节点上都存有一份独立的账本,由区块链节点自身进行管理维护。具体的,每一区块链节点用于验证自身信息的有效性和生成下一个区块。区块是一种数据存储结构,是被区块链系统处理的对象。
在区块链系统运行的过程中,每隔一段时间都会由某个区块链节点将近期收到的交易打包成区块,并将区块广播到区块链系统中的所有区块链节点,收到区块的区块链节点会将区块中包含的交易和区块本身保存到本地的账本中。需要说明的是,每生成一个区块都需要经过参与区块链节点的共识,也就是说区块链节点之间具有共识机制。
共识机制是区块链系统中实现不同区块链节点之间建立信任、获取权益的数学算法。
如图1所示,在本申请实施例中所涉及的区块链系统中,每个区块链节点100内部都包含事件中心101、共识单元102、区块管理模块103和归档管理模块104。
事件中心101,用于监听事件中心所在的本地区块链节点的进程和状态,同时接收和处 理来自其它区块链节点的归档请求。
当事件中心101监测到本地区块链节点满足区块数据归档条件时,通知本地区块链节点的共识单元102当前可以进行区块数据归档,同时发送需要进行归档的区块数据等信息。并由共识单元102向其他区块链节点发送归档请求。
当事件中心101接收到来自本地区块链节点的查询自身是否满足区块数据归档条件的请求时,会判定本地区块链节点的当前状态是否需要进行区块数据归档,并将该结果返回给本地区块链节点的共识单元102。
共识单元102,用于负责多个区块链节点之间对区块数据是否归档进行协商,促成区块链节点之间对归档达成共识。
当共识单元102从本地区块链节点的事件中心101收到通知,提示本地区块链节点满足区块数据归档条件,可以进行区块数据归档,该共识单元102向其他区块链节点发送归档请求。
当本地区块链节点的共识单元102接收到其他区块链节点发送的归档请求,向本地区块链节点的事件中心101发送询问请求,询问本地区块链节点是否需要进行归档,并基于事件中心101对本地区块链节点的进程和状态的监测所反馈的是否进行归档的结果,以该结果作为对其他区块链节点发送的归档请求的响应。
区块管理模块103,用于负责管理和维护本地区块链节点和已经归档上传的区块的区块信息和存储状态等。
当本地区块链节点产生一个新的区块时,该区块管理模块103会记录该区块的基本信息。例如,该区块的摘要信息、创建时间、区块大小、存储方式及存储位置等基本信息。当本地区块链节点上有区块被上传、或当区块的存储状态发生变更时,该区块管理模块103会对本地区块链节点上需要进行维护的区块信息进行相应的修改。
归档管理模块104,用于管理和维护本地区块链节点的归档策略。该归档策略预置于该归档管理模块104中。进一步的,归档管理模块104也支持技术人员或用户提交自定义的归档策略。
基于上述本申请实施例公开的区块链系统中的区块链节点的架构,以包含N个区块链节点的区块链系统举例说明本申请实施例公开的区块数据归档的方案。其中,N的取值为大于2的正整数。
如图2所示,为本申请实施例公开了一种区块数据归档方法的流程示意图,主要包括以下步骤:
S201:第一区块链节点监测自身存储的区块资源是否满足区块数据归档条件,若是,则确定待归档的区块数据,并执行步骤S202,若否,则不执行归档。
在S201中,第一区块链节点的具体架构与图1中公开的区块链节点相同。
该第一区块链节点的事件中心对第一区块链节点的进程和状态进行监听。当第一区块链节点的事件中心监听到该第一区块链节点满足归档条件时,该事件中心将需要进行归档的区块数据等信息通知第一区块链节点的共识单元,由共识单元发起归档请求。
在具体实现中,区块数据归档条件包括以下4种条件:
第一、区块链节点监测到自身存储的区块数量大于预设区块数量,确定满足区块数据归档条件。
第二、区块链节点监测自身存储的区块资源占用量大于预设占用量,区块资源占用量为所存储的区块占有磁盘空间的绝对值,确定满足区块数据归档条件。
第三、区块链节点监测自身存储的区块资源占有率大于预设占用率,区块资源占用率为所存储的区块占有磁盘空间的相对值,确定满足区块数据归档条件。
第四、区块链节点监测自身存储的区块创建时间,确定存在区块创建时间大于预设时间的区块,确定满足区块数据归档条件。
需要说明的是,上述4种区块数据归档条件只是所有区块数据归档条件中的一部分,区块数据归档条件支持用户自定义,以及技术人员可以根据具体情况对区块数据归档条件进行自定义。
在执行S201的过程中,若第一区块链节点的事件中心监测到自身存储的区块资源不满足区块数据归档条件时,第一区块链节点不进行归档,归档失败。
S202:第一区块链节点向其它区块链节点发送归档请求。
在S202中,第一区块链节点的共识单元接收到事件中心发送的通知,提示该第一区块链节点满足区块数据归档条件。优选的,该第一区块链节点的共识单元可以向位于同组的其它区块链节点发送归档请求。该第一区块链节点的共识单元也可以向位于区块链上的其他区块链节点发送归档请求。
需要说明的是,归档请求可以由区块链节点自身主动发起,也可以由区块链节点的事件中心监听到特定事件后触发,从而避免周期性检测造成的资源开销。
进一步需要说明的是,第一区块链节点满足区块数据归档条件时,第一区块链节点会将归档请求发送至同组的其他区块链节点。如图3所示,为本申请实施例公开的区块链系统中的区块链节点划分示意图,用于说明区块链节点之间的组别关系。
如图3所示,区块链节点301、区块链节点302、区块链节点303、区块链节点304、区块链节点305和区块链节点306分属A、B、C三条不同的链(Chain)。
在进行分组时,在Chain A上将区块链节点301、区块链节点303、区块链节点304和区块链节点305划为一组(Group 1)。
在Chain B上将区块链节点301、区块链节点302、区块链节点303和区块链节点305划为一组(Group 2)。
在Chain C上将区块链节点302、区块链节点303、区块链节点304和区块链节点305划为一组(Group 3)。
由附图3可知,各个区块链节点可以属于同一条链,也可以分属不同的链,在划分区块链节点时,需要将区块链节点按照其所处的链进行分组。
需要说明的是,区块链节点可以自主选择加入哪个分组。
基于上述分组,第一区块链节点满足区块数据归档条件时,第一区块链节点也可以将归档请求发送至其他组的其他区块链节点。
S203:其它区块链节点接收到第一区块链节点发送的归档请求,查询自身存储的区块 资源是否满足区块数据归档条件,若是,则执行步骤S204,若否,则不执行归档。
在执行S203的过程中,其他区块链节点的共识单元基于接收的到的第一区块链节点的共识单元发送的归档请求,询问自身的事件中心是否满足区块数据归档条件。
在具体实现中,区块数据归档条件包括如上述公开的4种条件,但不仅限于此。
S204:满足区块数据归档条件的其他区块链节点生成共识响应信息,并反馈给第一区块链节点。
在执行S203和S204的过程中,其他区块链节点接收第一区块链节点发送的归档请求之后的处理过程,以图2中示出的第二区块链节点的处理过程进行详细说明。该第二区块链节点可以与第一区块链节点处于同一组,也可以不在同一组。
如图4所示,为本申请实施例公开的第二区块链节点进行归档请求的处理流程图,包括如下步骤:
S401:第二区块链节点接收第一区块链节点发送的归档请求。
该第二区块链节点的具体架构与图1中公开的区块链节点相同。在S401中,第二区块链节点的事件中心接收到第一区块链节点的共识单元发送的归档请求。
S402:第二区块链节点基于该归档请求查询自身存储的区块资源是否满足区块数据归档条件,若是,则执行S403,若否,则不执行归档,即不响应第一区块链节点发送的归档请求。
在S402中,第二区块链节点的事件中心基于接收到的归档请求,也可以认为是监听到该归档请求,查询第二区块链节点存储的区块资源是否满足区块数据归档条件。在第二区块链节点满足区块数据归档条件的情况下,该事件中心将需要进行归档的区块数据等信息通知第二区块链节点的共识单元。
S403:第二区块链节点向第一区块链节点反馈共识响应信息。
在S403中,第二区块链节点的共识单元接收自身的事件中心发送的包含进行归档区块数据等信息的通知,并基于该通知生成共识响应消息,将该共识响应消息反馈给第一区块链节点的共识单元。
S205:第一区块链节点基于接收的其他区块链节点反馈的共识响应信息与其他区块链节点协商共识,若达成共识,则确定共识区块链节点,并执行步骤S206,若没有达成共识,则不执行归档。
在具体实现中,第一区块链节点和其他区块链节点协商共识的过程,仍以第一区块链节点和第二区块链节点协商共识的过程进行说明,如图5所示,主要包括以下步骤:
S501:第二区块链节点向第一区块链节点反馈共识响应信息。
在S501中,第二区块链节点向第一区块链节点反馈的共识响应信息中包括协商共识信息。该协商共识信息包括待归档的区块数据,待归档的区块数据是否一致信息和指定的共识区块链节点。
也就是说,该协商共识信息中包含的内容为各个区块链节点之间需要协商的内容。
需要说明的是,该协商共识信息中包括但不限于上述需要进行协商的内容。
S502:第一区块链节点获取第二区块链节点反馈的共识响应信息中的协商共识信息。
S503:第一区块链节点和第二区块链节点基于共识响应信息中的协商共识信息,与自身的协商共识信息进行比较,若比较结果一致,则执行S504;若比较结果不一致,则未达成共识,不执行归档。
在S503中,基于S501中各个区块链节点之间需要协商共识的内容,第一区块链节点和第二区块链节点对于哪些区块进行归档,各自区块链节点上需要进行归档的区块数据是否一致,以及由那个区块链节点对区块进行归档,也就是谁作为共识区块链节点进行协商。
S504:第一区块链节点和第二区块链节点确定达成共识,并确定共识区块链节点
在具体实现中,第一区块链节点或第二区块链节点均可被协商确定为共识区块链节点。
需要说明的是,共识区块链节点不仅限于上述的第一区块链节点或第二区块链节点,也可以是图2中示出的第N区块链节点或者同组的其它区块链节点,N的取值为正整数。
S206:共识区块链节点将待归档的区块数据发送至第三方存储服务器进行归档。
通过上述共识,可以确认区块链节点之间已经对要上传的归档数据达成一致,作为共识区块链节点的一方则可以将共识确认的数据,打包并上传至第三方存储系统。该第三方存储系统具体可以为分布式存储系统。
在具体实现中,当共识区块链节点为第一区块链节点时,如图2中实线所示,第一区块链节点将待归档的区块数据发送至第三方存储服务器进行归档。
当共识区块链节点为第二区块链节点时,如图2中虚线所示,第二区块链节点将待归档的区块数据发送至第三方存储服务器进行归档。
需要说明的是,共识区块链节点不局限于上述的第一区块链节点或第二区块链节点,可以是图2中示出的第N区块链节点,或者同组的其它区块链节点。
S207:第三方服务器或共识区块链节点向各个区块链节点返回归档结果。
在具体实现中,当共识区块链节点为第一区块链节点时,第一区块链节点接收到第三方服务器反馈的归档结果,第一区块链节点或第三方服务器会将归档结果发送给其它各个区块链节点。
当共识区块链节点为第二区块链节点时,第二区块链节点接收到第三方服务器反馈的归档结果,第二区块链节点或第三方服务器会将归档结果发送给其它各个区块链节点。
需要说明的是,共识区块链节点不局限于上述的第一区块链节点或第二区块链节点,可以是图2中的第三区块链节点、第四区块链节点、或者同组的其它区块链节点。
S208:各个区块链节点对归档结果进行验证,判断归档的区块数据是否是经过各个区块链节点共识的区块数据,若是,则完成归档,若否,返回执行步骤S201。
在具体实现中,各个区块链节点基于归档结果,检验归档的区块数据是否是经过上述步骤进行归档共识的区块数据,以及检验该归档的区块数据的数据内容是否正确。
若归档的区块数据是经过上述步骤进行归档共识的区块数据,以及数据内容正确,各个区块链节点完成归档。
本申请实施例公开的区块数据归档方法,通过将区块链系统中的区块链节点按照所在的链进行分组,同组区块链节点通过共识实现了区块链节点间的归档数据共享,避免了冗余备份,保证了归档数据了正确性。采用基于事件触发的归档条件判断机制,并支持用户 自定义归档条件,有效提升归档的实施效率、可操作性和灵活性。
在上述本申请实施例公开的区块数据归档方法中,第一区块链节点为发起归档请求的一方,实际上第二区块链节点也可以作为发起归档请求的一方。
基于上述本申请实施例公开的区块数据归档方法,第一区块链节点或其他区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据的过程基于区块数据归档条件有所不同。
可选的,第一区块链节点或其他区块链节点监测自身存储的区块数量是否大于预设区块数量;若大于,确定满足区块数据归档条件,获取待归档的区块数据。
可选的,第一区块链节点或其他区块链节点监测自身存储的区块资源占用量是否大于预设占用量,该区块资源占用量为所存储的区块占用磁盘空间的绝对值;若大于,确定满足区块数据归档条件,获取待归档的区块数据。
可选的,第一区块链节点或其他区块链节点监测自身存储的区块资源占用率是否大于预设占用率,该区块资源占用率为所存储的区块占用磁盘空间的相对值;若大于,确定满足区块数据归档条件,获取待归档的区块数据。
可选的,第一区块链节点或其他区块链节点监测自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块;若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
本申请实施例公开的区块数据归档方法及相关设备,通过任意区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据,并向同组区块链节点发送归档请求,以及接收同组区块链节点反馈的共识响应信息,并基于该共识响应信息与同组区块链节点协商共识,在确定共识,且获取到当前区块链节点为共识区块链节点的共识结果的情况下,当前区块链节点将待归档的区块数据发送至第三方存储服务器进行归档,共识结果用于确定当前区块链节点或同组区块链节点中的任一区块链节点为共识区块链节点。通过上述过程,实现了在多个区块链节点间共享同一份归档数据,避免冗余备份,并有效提升了数据归档的实施效率、可操作性和灵活性的目的。
如图6所示,本申请实施例还公开了一种区块数据归档方法的流程图,该区块数据归档方法包括如下步骤:
S601:客户端向区块链中的区块链节点发送归档请求。
在具体实现中,可选的,客户端可以对区块链中的区块链节点的进程和状态进行监听,也就是说由客户端监测区块链中的区块链节点存储的区块资源是否满足区块数据归档条件,确定满足区块数据归档条件的第三区块链节点,向第三区块链节点发送归档请求,该第三区块链节点接收到该归档请求,与其他接收到该归档请求的第三区块链节点协商共识,确定共识协商节点。
可选的,客户端也可以向区块链中的任意区块链节点发送归档请求,接收到该归档请求的任意区块链节点确认自身存储的区块资源是否满足区块数据归档条件,若满足,则作为第三区块链节点与其他满足区块数据归档条件的第三区块链节点协商共识,确定共识协 商节点。
S602:共识协商节点向客户端发送反馈信息。
在具体实现中,共识协商节点为接收到归档请求的第三区块链节点之间协商共识确定的区块链节点。第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点。也就是说,该反馈信息为区块链中的区块链节点对客户端的归档请求的响应信息。
本申请实施例中所涉及的区块数据归档条件与上述本申请实施例公开的区块数据归档条件一致,这里不再进行赘述。
S603:客户端接收共识协商节点的反馈信息。
S604:客户端基于反馈信息向该共识协商节点发送请求。
S605:共识协商节点接收客户端发送的请求,并基于该请求,使共识协商节点中的待归档的区块数据上传至第三方存储服务器进行归档。
在具体实现中,S604和S605根据客户端所发送的请求不同,具体有以下执行方式:
第一种方式:
首先,客户端基于反馈信息向共识协商节点发送获取请求。
其次,共识协商节点基于该获取请求,将确定的待归档的区块数据发送至客户端。
最后,客户端获取共识协商节点中待归档的区块数据,将待归档的区块数据上传至第三方存储服务器进行归档。
第二种方式:
首先,客户端基于反馈信息,向共识协商节点发送上传区块请求。
其次,该共识协商节点基于该上传区块请求,将确定的待归档的区块数据上传至第三方存储服务器进行归档。
优选的,在执行上述数据归档成功之后,客户端接收第三方存储服务器反馈的归档成功结果,生成归档交易,并将该归档交易发送至第三区块链节点。
可选的,该第三区块链节点接收客户端发送的归档交易之后,检查归档交易是否为同组区块链节点的归档交易,若是,则删除该归档交易对应的区块数据,若否,则不执行删除操作。
可选的,该第三区块链节点接收客户端发送的归档交易之后,检查归档交易是否为区块链中其他区块链节点的归档交易,若是,则删除归档交易对应的区块数据,若否,则不执行删除操作。
本申请实施例所公开的区块数据归档方法,通过客户端向区块链节点发送归档请求,使区块链中满足区块数据归档条件,且协商共识确定的共识协商节点中的待归档的区块数据可以上传至第三方存储服务器进行归档,实现了在多个区块链节点间共享同一份归档数据,避免冗余备份,并有效提升了数据归档的实施效率、可操作性和灵活性的目的。
基于上述本申请实施例公开的一种区块数据归档方法,相对应本申请实施例还对应公开了具体执行该区块数据归档方法的区块链节点的结构示意图。
如图7所示,为本申请实施例公开了一种区块链节点的结构示意图。该区块链节点包含 上述图1涉及到的事件中心、共识单元、区块管理模块和归档管理模块。上述本申请实施例图2示出的一种区块数据归档方法提及的第一区块链节点、第二区块链节点和其它区块链节点的结构与所述区块链节点相同。所述区块链节点700的结构包括:事件中心701、共识单元702和区块管理单元703。
事件单元701,当区块链节点发送归档请求时,事件单元701用于在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据。
当区块链节点接收归档请求时,事件单元701用于接收其它区块链节点发送的归档请求,在基于归档请求查询到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据。
共识单元702,当区块链节点发送归档请求时,共识单元702用于向其它区块链节点发送归档请求,并基于接收的其它区块链节点反馈的共识响应信息与其它区块链节点协商共识,若确定共识,且获取到所述区块链节点为共识区块链节点的共识结果,共识结果用于确定区块链节点或同组其它区块链节点中的任一区块链节点为共识区块链节点,执行区块管理单元703。
当区块链节点接收归档请求时,共识单元702用于向其它区块链节点反馈共识响应信息,并基于共识响应信息与同组其它区块链节点协商共识,若确定共识,且获取到所述区块链节点为共识区块链节点的共识结果,共识结果用于确定所述区块链节点或其它区块链节点中的任一区块链节点为共识区块链节点,执行区块管理单元703。
区块管理单元703,用于将待归档的区块数据发送至第三方存储服务器进行归档。
归档管理单元704,当区块链节点为共识区块链节点时,归档管理单元704用于接收第三方存储服务器反馈的归档结果,将归档结果发送给其它区块链节点。当区块链节点不是共识区块链节点时,归档管理单元704用于接收第三方存储服务器或共识区块链节点发送的归档结果。
可选的,当区块链节点发送归档请求时,事件中心701用于监测自身存储的区块数量是否大于预设区块数量,若大于,确定满足区块数据归档条件,获取待归档的区块数据。当区块链节点接收归档请求时,事件中心701用于接收其它区块链节点发送的归档请求,查询自身存储的区块数量是否大于预设区块数量,若大于,确定满足区块数据归档条件,获取待归档的区块数据。
可选的,当区块链节点发送归档请求时,事件中心701用于监测自身存储的区块资源占用量是否大于预设占用量,区块资源占用量为所存储的区块占用磁盘空间的绝对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据。
当区块链节点接收归档请求时,事件中心701用于接收其它区块链节点发送的归档请求,查询自身存储的区块资源占用量是否大于预设占用量,区块资源占用量为所存储的区块占用磁盘空间的绝对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据。
可选的,当区块链节点发送归档请求时,事件中心701用于监测自身存储的区块资源占用率是否大于预设占用率,区块资源占用率为所存储的区块占用磁盘空间的相对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据。
当区块链节点接收归档请求时,事件中心701用于接收同组其它区块链节点发送的归档请求,查询自身存储的区块资源占用率是否大于预设占用率,区块资源占用率为所存储的区块占用磁盘空间的相对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据。
可选的,当区块链节点发送归档请求时,事件中心701用于监测自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块,若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
当区块链节点接收归档请求时,事件中心701用于接收其它区块链节点发送的归档请求,查询自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块,若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
可选的,当区块链节点发送归档请求时,基于接收的其它区块链节点反馈的共识响应信息与其它区块链节点协商共识的共识单元702,用于获取共识响应信息中的协商共识信息,并与自身的协商共识信息进行比较,若比较结果一致,确定共识,并获得基于所述协商共识信息指定的共识区块链节点所确定的共识结果,协商共识信息包括待归档的区块数据,待归档的区块数据是否一致的信息和指定的共识区块链节点。
当区块链节点接收归档请求时,向同组其它区块链节点反馈共识响应信息,基于共识响应信息与其它区块链节点协商共识的共识单元702,用于向同组其它区块链节点反馈共识响应信息。该共识响应信息包括协商共识信息,协商共识信息包括待归档的区块数据,待归档的区块数据是否一致的信息和指定的共识区块链节点,将协商共识信息与区块链节点的协商共识信息进行比较,若比较结果一致,确定共识,并获得基于协商共识信息指定的共识区块链节点所确定的共识结果。
本申请实施例所公开的区块链节点,通过监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据,并向其他区块链节点发送归档请求,以及接收其他区块链节点反馈的共识响应信息,并基于该共识响应信息与其他区块链节点协商共识,在确定共识,且获取到当前区块链节点为共识区块链节点的共识结果的情况下,当前区块链节点将待归档的区块数据发送至第三方存储服务器进行归档,共识结果用于确定当前区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点。实现了在多个区块链节点间共享同一份归档数据,避免冗余备份,并有效提升了数据归档的实施效率、可操作性和灵活性的目的。
本申请实施例提供了一种区块链系统,包括上述本申请图7公开的区块链节点。
基于上述图6本申请实施例公开的一种区块数据归档方法,相对应的本申请实施例还对应公开了具体执行该区块数据归档方法的客户端和区块链节点的结构示意图。
如图8所示,为本申请实施例公开的一种客户端的结构示意图。该客户端800包括:
发送单元801,用于向区块链中的区块链节点发送归档请求;
接收单元802,用于接收共识区块链节点的反馈信息。
该共识区块链节点为接收到归档请求的第三区块链节点之间进行共识确定的区块链节点。第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点。
处理单元803,用于基于反馈信息使共识区块链节点中待归档的区块数据上传至第三方存储服务器进行归档。
可选的,该处理单元803,还用于监测区块链中的区块链节点存储的区块资源是否满足区块数据归档条件,在确定满足区块数据归档条件的第三区块链节点之后,该发送单元801向第三区块链节点发送归档请求。
可选的,该发送单元801,用于向区块链中的任意区块链节点发送归档请求。
可选的,该接收单元802,用于基于反馈信息获取共识区块链节点中的待归档的区块数据,相应的,该发送单元801,用于将待归档的区块数据上传至第三方存储服务器进行归档。
可选的,该发送单元801,用于基于反馈信息,向共识区块链节点发送上传区块请求。
可选的,该接收单元802,用于接收第三方存储服务器反馈的归档成功结果。
该处理单元803,用于基于该归档成功结果生成归档交易。
该发送单元801,用于将归档交易发送至第三区块链节点,使第三区块链节点检查归档交易是否为同组区块链节点的归档交易,若是,则删除归档交易对应的区块数据,若否,则不执行删除;或者,检查归档交易是否为区块链中其他区块链节点的归档交易,若是,则删除归档交易对应的区块数据,若否,则不执行删除。
如图9所示,为本申请实施例公开的一种共识协商节点的结构示意图。该共识协商节点为接收客户端发送的归档请求的第三区块链节点协商共识确定的区块链节点,该第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点。需要说明的是,在具体实现中,区块链中的各个区块链节点的结构相同,从协商共识的结果上来看,均有可能成为共识协商节点。该共识协商节点900包括:
收发单元901,用于向客户端发送反馈信息,以及接收该客户端的请求。
处理单元902,用于基于客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档。
可选的,收发单元901,用于接收客户端发送的获取请求,将确定的待归档的区块数据发送至客户端,使客户端将待归档的区块数据上传至第三方存储服务器进行归档。
可选的,收发单元901,用于接收客户端发送的上传区块请求,将确定的待归档的区块数据上传至第三方存储服务器进行归档。
可选的,收发单元901,还用于接收客户端发送的归档交易。
该处理单元902,用于检查归档交易是否为同组区块链节点的归档交易,若是,则删除归档交易对应的区块数据,若否,则不执行删除。或者,检查归档交易是否为区块链中其他区块链节点的归档交易,若是,则删除归档交易对应的区块数据,若否,则不执行删除。
本申请实施例还对应上述的客户端和区块链节点提供了一种区块链系统,包括上述本申请图8公开的客户端,以及具有图9所公开的共识协商节点相同结构的区块链节点。
该客户端,用于向区块链中的区块链节点发送归档请求,接收第三区块链节点的反馈信息,第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点,以及向区块链节点发送请求;
该区块链节点,用于在自身存储的区块资源满足区块数据归档条件,且与其他满足区 块数据归档条件的区块链节点协商共识,确定自身为共识协商节点时,向客户端发送反馈信息,基于客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档。
本申请实施例所公开的实现区块数据归档方法的客户端和区块链节点,通过客户端向区块链节点发送归档请求,使区块链中满足区块数据归档条件,且协商共识确定的共识协商节点中的待归档的区块数据可以上传至第三方存储服务器进行归档,实现了在多个区块链节点间共享同一份归档数据,避免冗余备份,并有效提升了数据归档的实施效率、可操作性和灵活性的目的。
另外,本申请实施例提供了一种计算机可读存储介质,包括使计算机运行上述本申请图2公开的区块数据归档方法的指令,或者使计算机运行上述本申请图6公开的区块数据归档方法的指令。
综上所述本申请实施例公开的数据归档方法及相关设备,通过任意区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据,并向其他区块链节点发送归档请求,以及接收其他区块链节点反馈的共识响应信息,并基于该共识响应信息与其他区块链节点协商共识,在确定共识,且获取到当前区块链节点为共识区块链节点的共识结果的情况下,当前区块链节点将待归档的区块数据发送至第三方存储服务器进行归档,共识结果用于确定当前区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点。通过上述过程,实现了在多个区块链节点间共享同一份归档数据,避免冗余备份,并有效提升了数据归档的实施效率、可操作性和灵活性的目的。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
最后应说明的是:以上实施例仅用以示例性说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请及本申请带来的有益效果进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请权利要求的范围。
Claims (28)
- 一种区块数据归档方法,其特征在于,所述方法包括:第一区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据;所述第一区块链节点向其他区块链节点发送归档请求;所述第一区块链节点基于接收的所述其他区块链节点反馈的共识响应信息与所述其他区块链节点协商共识;若确定共识,且获取到所述第一区块链节点为共识区块链节点的共识结果,所述第一区块链节点将所述待归档的区块数据发送至第三方存储服务器进行归档,所述共识结果用于确定所述第一区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点。
- 根据权利要求1所述的方法,其特征在于,所述第一区块链节点在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据,包括:所述第一区块链节点监测自身存储的区块数量是否大于预设区块数量;若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述第一区块链节点监测自身存储的区块资源占用量是否大于预设占用量,所述区块资源占用量为所存储的区块占用磁盘空间的绝对值;若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述第一区块链节点监测自身存储的区块资源占用率是否大于预设占用率,所述区块资源占用率为所存储的区块占用磁盘空间的相对值;若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述第一区块链节点监测自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块;若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
- 根据权利要求1或2所述的方法,其特征在于,所述第一区块链节点向其他区块链节点发送归档请求,包括:所述第一区块链节点向同组区块链节点发送归档请求,或者,所述第一区块链节点向同组区块链节点和所述区块链上的其他组区块链节点发送归档请求。
- 根据权利要求1或2所述的方法,其特征在于,所述第一区块链节点基于接收的所述区块链节点反馈的共识响应信息与所述同组区块链节点协商共识,包括:所述第一区块链节点获取所述共识响应信息中的协商共识信息,并与自身的协商共识信息进行比较,所述协商共识信息包括待归档的区块数据,待归档的区块数据是否一致的信息和指定的共识区块链节点;若比较结果一致,确定共识,并确定基于所述协商共识信息指定的共识区块链节点。
- 根据权利要求1-4中任一项所述的方法,其特征在于,还包括:所述第一区块链节点接收所述第三方存储服务器反馈的归档结果;所述第一区块链节点将所述归档结果发送给所述其他区块链节点。
- 一种区块数据归档方法,其特征在于,所述方法包括:第二区块链节点接收第一区块链节点发送的归档请求,所述第二区块链节点与所述第一区块链节点属于同一区块链上的区块链节点;所述第二区块链节点在基于所述归档请求查询到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据;所述第二区块链节点向所述第一区块链节点反馈共识响应信息,并基于所述共识响应信息与其他区块链节点协商共识;若确定共识,且获取所述第二区块链节点为共识区块链节点的共识结果,所述第二区块链节点将所述待归档的区块数据发送至第三方存储服务器进行归档,所述共识结果用于确定所述第一区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点。
- 根据权利要求6所述的方法,其特征在于,所述当基于所述归档请求查询自身满足区块数据归档条件时,确定待归档的区块数据,包括:所述第二区块链节点在接收到所述归档请求后,查询自身存储的区块数量是否大于预设区块数量;若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述第二区块链节点在接收到所述归档请求后,查询自身存储的区块资源占用量是否大于预设占用量,所述区块资源占用量为所存储的区块占用磁盘空间的绝对值;若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述第二区块链节点在接收到所述归档请求后,查询自身存储的区块资源占用率是否大于预设占用率,所述区块资源占用率为所存储的区块占用磁盘空间的相对值;若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述第二区块链节点在接收到所述归档请求后,查询自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块;若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
- 根据权利要求6或7所述的方法,其特征在于,所述第二区块链节点向所述第一区块链节点反馈共识响应信息,基于所述共识响应信息与其他区块链节点协商共识,包括:所述第二区块链节点向所述第一区块链节点反馈共识响应信息,所述共识响应信息包括协商共识信息,所述协商共识信息包括待归档的区块数据,待归档的区块数据是否一致的信息和指定的共识区块链节点;所述第二区块链节点将所述协商共识信息与所述其他区块链节点的协商共识信息进行比较;若比较结果一致,确定共识,并确定基于所述协商共识信息指定的共识区块链节点。
- 根据权利要求6-8中任一项所述的方法,其特征在于,还包括:所述第二区块链节点接收所述第三方存储服务器反馈的归档结果;所述第二区块链节点将所述归档结果发送给所述其他区块链节点。
- 一种区块数据归档方法,其特征在于,所述方法包括:客户端向区块链中的区块链节点发送归档请求;所述客户端接收共识区块链节点的反馈信息,所述共识区块链节点为接收到所述归档 请求的第三区块链节点之间进行共识确定的区块链节点,所述第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点;所述客户端基于所述反馈信息使所述共识区块链节点中的待归档的区块数据上传至第三方存储服务器进行归档。
- 根据权利要求10所述的方法,其特征在于,所述客户端向区块链中的区块链节点发送归档请求,包括:所述客户端监测区块链中的区块链节点存储的区块资源是否满足区块数据归档条件;所述客户端确定满足所述区块数据归档条件的第三区块链节点,向所述第三区块链节点发送归档请求;或者,所述客户端向区块链中的任意区块链节点发送归档请求,使接收所述归档请求的区块链节点确认自身存储的区块资源是否满足区块数据归档条件,若满足,则作为第三区块链节点。
- 根据权利要求10所述的方法,其特征在于,所述客户端基于所述反馈信息使所述共识区块链节点中的待归档的区块数据上传至第三方存储服务器进行归档,包括:所述客户端基于所述反馈信息获取所述共识区块链节点中的待归档的区块数据,将所述待归档的区块数据上传至第三方存储服务器进行归档;或者,所述客户端基于所述反馈信息,向所述共识区块链节点发送上传区块请求,使所述共识区块链节点基于所述上传区块请求,将待归档的区块数据上传至第三方存储服务器进行归档。
- 根据权利要求10-12中任一项所述的方法,其特征在于,还包括:所述客户端接收所述第三方存储服务器反馈的归档成功结果,生成归档交易;所述客户端将所述归档交易发送至所述第三区块链节点,使所述第三区块链节点检查所述归档交易是否为同组区块链节点的归档交易,若是,则删除所述归档交易对应的区块数据;或者,检查所述归档交易是否为区块链中其他区块链节点的归档交易,若是,则删除所述归档交易对应的区块数据。
- 一种区块数据归档方法,其特征在于,所述方法包括:共识协商节点向客户端发送反馈信息,所述共识协商节点为接收客户端发送的归档请求的第三区块链节点协商共识确定的区块链节点,所述第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点;所述共识协商节点基于所述客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档。
- 根据权利要求14所述的方法,其特征在于,所述共识协商节点基于所述客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档,包括:所述共识协商节点接收所述客户端发送的获取请求,将确定的待归档的区块数据发送至所述客户端,使所述客户端将所述待归档的区块数据上传至第三方存储服务器进行归档;或者,所述共识协商节点接收所述客户端发送的上传区块请求,将确定的待归档的区块数据 上传至第三方存储服务器进行归档。
- 一种第一区块链节点,其特征在于,包括:事件中心,用于在监测到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据;共识单元,用于向其他区块链节点发送归档请求,并基于接收的所述其他区块链节点反馈的共识响应信息与所述其他区块链节点协商共识,若确定共识,且获取到所述第一区块链节点为共识区块链节点的共识结果,所述共识结果用于确定所述第一区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点,执行区块管理单元;区块管理单元,用于将所述待归档的区块数据发送至第三方存储服务器进行归档。
- 根据权利要求16所述的区块链节点,其特征在于,所述事件中心,用于监测自身存储的区块数量是否大于预设区块数量,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述事件中心,用于监测自身存储的区块资源占用量是否大于预设占用量,所述区块资源占用量为所存储的区块占用磁盘空间的绝对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述事件中心,用于监测自身存储的区块资源占用率是否大于预设占用率,所述区块资源占用率为所存储的区块占用磁盘空间的相对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述事件中心,用于监测自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块,若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
- 根据权利要求16或17所述的区块链节点,其特征在于,所述基于接收的所述其他区块链节点反馈的共识响应信息与所述其他区块链节点协商共识的共识单元,用于获取所述共识响应信息中的协商共识信息,并与自身的协商共识信息进行比较,若比较结果一致,确定共识,并获得基于所述协商共识信息指定的共识区块链节点所确定的共识结果,所述协商共识信息包括待归档的区块数据,待归档的区块数据是否一致和指定的共识区块链节点。
- 根据权利要求16-18中任一项所述的区块链节点,其特征在于,还包括:归档管理单元,用于接收所述第三方存储服务器反馈的归档结果,将所述归档结果发送给所述其他区块链节点。
- 一种第二区块链节点,其特征在于,包括:事件中心,用于接收第一区块链节点发送的归档请求,在基于所述归档请求查询到自身存储的区块资源满足区块数据归档条件时,确定待归档的区块数据;共识单元,用于向所述第一区块链节点反馈共识响应信息,并基于所述共识响应信息与同组区块链节点协商共识,若确定共识,且获取到所述第二区块链节点为共识区块链节点的共识结果,所述共识结果用于确定所述第一区块链节点或其他区块链节点中的任一区块链节点为共识区块链节点,执行区块管理单元;区块管理单元,用于将所述待归档的区块数据发送至第三方存储服务器进行归档。
- 根据权利要求20所述的区块链节点,其特征在于,所述事件中心,用于接收第一区块链节点发送的归档请求,查询自身存储的区块数量是否大于预设区块数量,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述事件中心,用于接收第一区块链节点发送的归档请求,查询自身存储的区块资源占用量是否大于预设占用量,所述区块资源占用量为所存储的区块占用磁盘空间的绝对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述事件中心,用于接收第一区块链节点发送的归档请求,查询自身存储的区块资源占用率是否大于预设占用率,所述区块资源占用率为所存储的区块占用磁盘空间的相对值,若大于,确定满足区块数据归档条件,获取待归档的区块数据;或者,所述事件中心,用于接收第一区块链节点发送的归档请求,查询自身存储的区块创建时间,确定是否存在区块创建时间大于预设时间的区块,若存在,确定满足区块数据归档条件,获取区块创建时间大于预设时间的区块数据。
- 根据权利要求20或21所述的区块链节点,其特征在于,还包括:归档管理单元,用于接收所述第三方存储服务器反馈的归档结果,将所述归档结果发送给所述其他区块链节点。
- 根据权利要求20-22中任一项所述的区块链节点,其特征在于,所述向所述第一区块链节点反馈共识响应信息,基于所述共识响应信息与其他区块链节点协商共识的共识单元,用于向所述第一区块链节点反馈共识响应信息,所述共识响应信息包括协商共识信息,所述协商共识信息包括待归档的区块数据,待归档的区块数据是否一致和指定的共识区块链节点,将所述协商共识信息与所述其他区块链节点的协商共识信息进行比较,若比较结果一致,确定共识,并获得基于所述协商共识信息指定的共识区块链节点所确定的共识结果。
- 一种客户端,其特征在于,包括:发送单元,用于向区块链中的区块链节点发送归档请求;接收单元,用于接收共识区块链节点的反馈信息,所述共识区块链节点为接收到所述归档请求的第三区块链节点之间进行共识确定的区块链节点,所述第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点;处理单元,用于基于所述反馈信息使所述共识区块链节点中待归档的区块数据上传至第三方存储服务器进行归档。
- 一种共识协商节点,其特征在于,所述共识协商节点为接收客户端发送的归档请求的第三区块链节点协商共识确定的区块链节点,所述第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点,所述共识协商节点包括:收发单元,用于向客户端发送反馈信息,以及接收所述客户端的请求;处理单元,用于基于所述客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档。
- 一种区块链系统,其特征在于,包括权利要求17-20中任一项所述的第一区块链节 点和权利要求21-24中任一项所述的第二区块链节点。
- 一种区块链系统,其特征在于,包括:客户端,用于向区块链中的区块链节点发送归档请求,接收第三区块链节点的反馈信息,第三区块链节点为自身存储的区块资源满足区块数据归档条件的区块链节点,以及向区块链节点发送请求;所述区块链节点,用于在自身存储的区块资源满足区块数据归档条件,且与其他满足区块数据归档条件的区块链节点协商共识,确定自身为共识协商节点时,向所述客户端发送反馈信息,基于所述客户端的请求,使待归档的区块数据上传至第三方存储服务器进行归档。
- 一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行如权利要求1-15任意一项所述的方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP19905625.0A EP3846044A4 (en) | 2018-12-29 | 2019-12-13 | METHOD AND DEVICE FOR ARCHIVING BLOCK DATA AND THE APPROPRIATE DEVICE |
US17/360,947 US20210326300A1 (en) | 2018-12-29 | 2021-06-28 | Block data archiving method and related device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811639788.5A CN111382119B (zh) | 2018-12-29 | 2018-12-29 | 区块数据归档方法及相关设备 |
CN201811639788.5 | 2018-12-29 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/360,947 Continuation US20210326300A1 (en) | 2018-12-29 | 2021-06-28 | Block data archiving method and related device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020135094A1 true WO2020135094A1 (zh) | 2020-07-02 |
Family
ID=71127503
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/125052 WO2020135094A1 (zh) | 2018-12-29 | 2019-12-13 | 区块数据归档方法及相关设备 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20210326300A1 (zh) |
EP (1) | EP3846044A4 (zh) |
CN (1) | CN111382119B (zh) |
WO (1) | WO2020135094A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113259487A (zh) * | 2021-06-24 | 2021-08-13 | 中国电力科学研究院有限公司 | 一种调控数据存证共享方法及系统 |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11973857B2 (en) * | 2020-04-29 | 2024-04-30 | Kyndryl, Inc. | Data archive |
CN111984735A (zh) * | 2020-09-03 | 2020-11-24 | 深圳壹账通智能科技有限公司 | 一种数据归档方法、装置、电子设备和存储介质 |
CN112380166B (zh) * | 2020-11-12 | 2024-10-01 | 上海保险交易所股份有限公司 | 区块链数据归档方法和装置 |
CN112948438B (zh) * | 2021-03-05 | 2022-06-24 | 杭州复杂美科技有限公司 | 数据查询方法、计算机设备和存储介质 |
US20220311595A1 (en) * | 2021-03-24 | 2022-09-29 | International Business Machines Corporation | Reducing transaction aborts in execute-order-validate blockchain models |
CN113238996A (zh) * | 2021-05-18 | 2021-08-10 | 中国信息通信研究院 | 基于dht的区块链数据归档方法、电子设备及存储介质 |
CN113220665B (zh) * | 2021-05-20 | 2023-10-20 | 成都质数斯达克科技有限公司 | 一种区块链数据归档方法、装置、电子设备及可读存储介质 |
CN114218304A (zh) * | 2021-12-30 | 2022-03-22 | 杭州趣链科技有限公司 | 一种数据归档方法、装置、计算设备及介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107423426A (zh) * | 2017-08-02 | 2017-12-01 | 众安信息技术服务有限公司 | 一种区块链块数据的数据归档方法及电子设备 |
US20180268944A1 (en) * | 2017-03-20 | 2018-09-20 | Ramkrishna Prakash | System, apparatus and method for management of health and wellness information, and management of transactions using same |
CN108874512A (zh) * | 2018-07-10 | 2018-11-23 | 佛山伊苏巨森科技有限公司 | 一种提升区块链网络访问速度的方法 |
Family Cites Families (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160019224A1 (en) * | 2014-07-18 | 2016-01-21 | Commvault Systems, Inc. | File system content archiving based on third-party application archiving rules and metadata |
US11941588B2 (en) * | 2015-11-06 | 2024-03-26 | Cable Television Laboratories, Inc. | Systems and methods for blockchain virtualization and scalability |
US10360191B2 (en) * | 2016-10-07 | 2019-07-23 | International Business Machines Corporation | Establishing overlay trust consensus for blockchain trust validation system |
CN106686087A (zh) * | 2016-12-30 | 2017-05-17 | 先锋支付有限公司 | 一种区块链截断方法及分布式节点 |
CN107395557B (zh) * | 2017-03-28 | 2020-05-15 | 创新先进技术有限公司 | 一种业务请求的处理方法及装置 |
US10896165B2 (en) * | 2017-05-03 | 2021-01-19 | International Business Machines Corporation | Management of snapshot in blockchain |
CN107395665B (zh) * | 2017-05-22 | 2020-04-24 | 创新先进技术有限公司 | 一种区块链业务受理及业务共识方法及装置 |
US11055703B2 (en) * | 2017-06-19 | 2021-07-06 | Hitachi, Ltd. | Smart contract lifecycle management |
CN107566337B (zh) * | 2017-07-26 | 2019-08-09 | 阿里巴巴集团控股有限公司 | 一种区块链节点间的通信方法及装置 |
CN107833052B (zh) * | 2017-10-27 | 2021-02-02 | 南京物联传感技术有限公司 | 一种基于区块链的聚合支付系统及工作方法 |
CN108009811B (zh) * | 2017-11-30 | 2021-06-04 | 中国人民解放军国防科技大学 | 一种面向云际计算环境价值交换的跨链通信方法 |
CN108491291A (zh) * | 2018-02-09 | 2018-09-04 | 厦门快商通信息技术有限公司 | 一种基于区块链的公安系统档案管理方法 |
CN108416577B (zh) * | 2018-03-02 | 2021-03-05 | 上海汉得信息技术股份有限公司 | 一种区块链服务系统 |
CN108629588B (zh) * | 2018-05-09 | 2021-06-08 | 合肥达朴汇联科技有限公司 | 一种用于区块链共识达成的计算机可读介质 |
CN110400142B (zh) * | 2018-06-01 | 2021-06-25 | 腾讯科技(深圳)有限公司 | 数据处理方法、装置及存储介质 |
CN108876370B (zh) * | 2018-06-12 | 2021-12-17 | 北京航空航天大学 | 一种异构多链架构下跨区块链共享开放数据的体系架构 |
CN109040014A (zh) * | 2018-06-13 | 2018-12-18 | 湖南搜云网络科技股份有限公司 | 区块链处理方法及装置、区块链节点及存储介质 |
CN108768665B (zh) * | 2018-07-02 | 2021-06-08 | 上海达家迎信息科技有限公司 | 区块链生成方法、装置、计算机设备以及存储介质 |
-
2018
- 2018-12-29 CN CN201811639788.5A patent/CN111382119B/zh active Active
-
2019
- 2019-12-13 WO PCT/CN2019/125052 patent/WO2020135094A1/zh unknown
- 2019-12-13 EP EP19905625.0A patent/EP3846044A4/en not_active Withdrawn
-
2021
- 2021-06-28 US US17/360,947 patent/US20210326300A1/en not_active Abandoned
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180268944A1 (en) * | 2017-03-20 | 2018-09-20 | Ramkrishna Prakash | System, apparatus and method for management of health and wellness information, and management of transactions using same |
CN107423426A (zh) * | 2017-08-02 | 2017-12-01 | 众安信息技术服务有限公司 | 一种区块链块数据的数据归档方法及电子设备 |
CN108874512A (zh) * | 2018-07-10 | 2018-11-23 | 佛山伊苏巨森科技有限公司 | 一种提升区块链网络访问速度的方法 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113259487A (zh) * | 2021-06-24 | 2021-08-13 | 中国电力科学研究院有限公司 | 一种调控数据存证共享方法及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN111382119A (zh) | 2020-07-07 |
EP3846044A1 (en) | 2021-07-07 |
EP3846044A4 (en) | 2021-10-13 |
CN111382119B (zh) | 2023-08-22 |
US20210326300A1 (en) | 2021-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020135094A1 (zh) | 区块数据归档方法及相关设备 | |
US9652469B2 (en) | Clustered file service | |
US10635543B2 (en) | Multi stream deduplicated backup of collaboration server data | |
US7610383B2 (en) | Data-object-related-request routing in a dynamic, distributed data-storage system | |
CN102541990B (zh) | 利用虚拟分区的数据库重新分布方法和系统 | |
US8938507B2 (en) | Integrated two-way communications between database client users and administrators | |
US10313452B2 (en) | Migrating a chat message service provided by a chat server to a new chat server | |
CN105025053A (zh) | 基于云存储技术的分布式文件的上传方法及其系统 | |
WO2008048558A2 (en) | Method and system for efficient and dynamically adaptable digitally-encoded-information distribution | |
US20100011364A1 (en) | Data Storage in Distributed Systems | |
EP3285186A1 (en) | Methods and procedures for timestamp-based indexing of items in real-time storage | |
US9390101B1 (en) | Social deduplication using trust networks | |
CN110198346A (zh) | 数据读取方法、装置、电子设备及可读存储介质 | |
US11860896B2 (en) | Data object replication using a replication sequence | |
US20230185931A1 (en) | Account replication including security configurations | |
JP2007193793A (ja) | データベース・クライアント・ユーザとの通信のためのシステム、方法、およびプログラム | |
US10848559B2 (en) | Malware scan status determination for network-attached storage systems | |
CN108566421A (zh) | 一种基于网络附属存储器的网络式分布方法及系统 | |
US8725789B2 (en) | Method and apparatus for processing distributed data | |
KR20190133404A (ko) | 마이크로 서비스 아키텍처 기반의 서비스 시스템 및 상기 시스템에서의 멀티 테넌트 설정 관리 방법 | |
US20240330124A1 (en) | Automated failsafe data recovery | |
US11921876B1 (en) | Organization-level global data object on data platform | |
US11863617B1 (en) | Dynamic decentralized hierarchical Holon network system | |
US20230297591A1 (en) | Replication of share across deployments in database system | |
US20240201887A1 (en) | Storage array aware dynamic slicing of a file system |
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: 19905625 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2019905625 Country of ref document: EP Effective date: 20210331 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |