CN110221938A - The method and storage medium of electronic device, block chain common recognition - Google Patents
The method and storage medium of electronic device, block chain common recognition Download PDFInfo
- Publication number
- CN110221938A CN110221938A CN201910371485.8A CN201910371485A CN110221938A CN 110221938 A CN110221938 A CN 110221938A CN 201910371485 A CN201910371485 A CN 201910371485A CN 110221938 A CN110221938 A CN 110221938A
- Authority
- CN
- China
- Prior art keywords
- common recognition
- recognition node
- cluster
- node
- main common
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000012790 confirmation Methods 0.000 claims abstract description 62
- 230000001360 synchronised effect Effects 0.000 claims abstract description 26
- 238000011084 recovery Methods 0.000 claims abstract description 20
- 230000004044 response Effects 0.000 claims abstract description 13
- 230000005540 biological transmission Effects 0.000 claims description 18
- 238000005516 engineering process Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup restoration techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/20—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
- G06F11/2053—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
- G06F11/2089—Redundant storage control functionality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- General Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Development Economics (AREA)
- General Business, Economics & Management (AREA)
- Technology Law (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- Hardware Redundancy (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to a kind of block chain technologies, disclose a kind of electronic device, the method and storage medium of block chain common recognition, this method comprises: when the main common recognition node in cluster completes block in common recognition, after sending the confirmation request for completing the block of whether knowing together respectively, if not receiving confirmation message within scheduled first time, then heartbeat request is sent to the main common recognition node of corresponding cluster, if not receiving heartbeat response within scheduled second time, then computer room delay machine occurs for the cluster for not carrying out heartbeat response, the spare common recognition node enabled in this cluster carries out common recognition service as its main common recognition node;After receiving the recovery message of delay machine computer room, the common recognition service of the spare common recognition node of the main common recognition node as the cluster to resume operation is closed, and controls the spare common recognition node increment block data synchronous with the main common recognition node of the cluster to resume operation.The present invention, which can be realized, rescues the calamity next choice of alliance's chain multimachine room strange land deployment.
Description
Technical field
The present invention relates to block chain technical field more particularly to the methods and storage of a kind of electronic device, block chain common recognition
Medium.
Background technique
Block chain is generally understood as a distributed account book, its essence is also a distributed database.Alliance
The difference of block chain and normal block chain is can to provide more efficient transaction performance, and it is also relatively fewer to participate in number of nodes.Generally
For, alliance's block chain needs to participate in mechanism and carries out the deployment of multimachine room strange land.Currently, in the deployment scenario of alliance's chain, if
There is a situation where computer room breaking-up or delay machines, then the transaction data of the computer room can not know together to be synchronized to remote room, are easy in this way
The loss for leading to transaction data, causes the bifurcated of chain, and the transaction of alliance's block chain can not be executed normally.
Summary of the invention
The method and storage medium known together the purpose of the present invention is to provide a kind of electronic device, block chain, it is intended to realize
The calamity next choice of alliance's chain multimachine room strange land deployment is rescued.
To achieve the above object, the present invention provides a kind of electronic device, the electronic device include memory and with it is described
The processor of memory connection, is stored with the processing system that can be run on the processor, the processing in the memory
System realizes following steps when being executed by the processor:
When the main common recognition node in cluster completes block in common recognition, the main common recognition node into other clusters, which is sent, respectively is
After no common recognition completes the confirmation request of the block, if not received within scheduled first time corresponding based on the confirmation request
Confirmation message then sends heartbeat request to the main common recognition node for not receiving the corresponding cluster of confirmation message, wherein save common recognition
Point is divided according to computer room, is same cluster, one main common recognition of each cluster configuration by the common recognition node division of same computer room
Node and at least one spare common recognition node;
If not receiving the cluster within scheduled second time to respond based on the heartbeat of the heartbeat request, this is not carried out
Computer room delay machine occurs for the cluster of heartbeat response, enables the spare common recognition node in this cluster as the cluster that computer room delay machine occurs
Main common recognition node carries out common recognition service, to know together to block;
After receiving the recovery message resumed operation that the collection pocket transmission of computer room delay machine occurs, closes and transported as the recovery
The common recognition service of the spare common recognition node of the main common recognition node of capable cluster, and control the spare common recognition node and resume operation with this
Cluster the synchronous increment block data of main common recognition node.
Preferably, when the processing system is executed by the processor, following steps are also realized:
When there is main common recognition node in cluster that delay machine occurs, will be total to based on a spare common recognition node setting in the cluster
Node is known, to carry out common recognition service;
After the main common recognition node of the generation delay machine resumes operation, is sent to the spare common recognition node and restore message, so as to
The spare common recognition node is based on the recovery message and closes common recognition service, and controls the spare common recognition node and the master resumed operation
The synchronous increment block data of node of knowing together.
Preferably, when the processing system is executed by the processor, following steps are also realized:
After the main common recognition node in cluster synchronizes increment block data, the main common recognition node into other clusters is sent out respectively
It send whether to know together and completes the confirmation request of the increment block data;
If the confirmation message that the main common recognition node in other clusters is sent based on the confirmation request is received, by the increasing
Amount block data is synchronized to the back end in block chain.
Preferably, when the processing system is executed by the processor, following steps are also realized:
When the main common recognition node in cluster receive the main common recognition node in other clusters transmission whether common recognition complete one
After the confirmation request of block, the newest block number and the main common recognition section in other clusters of analyzing the main common recognition node in this cluster
Whether the newest block number of point is consistent;
If the newest block number of the main common recognition node in this cluster is less than the newest of the main common recognition node in other clusters
Block number, then the main common recognition node into other clusters requests increment block data.
To achieve the above object, the present invention also provides a kind of method of block chain common recognition, the methods of the block chain common recognition
Include:
S1, when the main common recognition node in cluster completes block in common recognition, the main common recognition node into other clusters is sent out respectively
After sending the confirmation request for completing the block of whether knowing together, if not receiving within scheduled first time based on the confirmation request pair
The confirmation message answered then sends heartbeat request to the main common recognition node for not receiving the corresponding cluster of confirmation message, wherein will be total to
Know node to be divided according to computer room, is same cluster, one master of each cluster configuration by the common recognition node division of same computer room
Common recognition node and at least one spare common recognition node;
S2 is responded if not receiving the cluster within scheduled second time based on the heartbeat of the heartbeat request, this is not
Computer room delay machine occurs for the cluster for carrying out heartbeat response, enables the spare common recognition node in this cluster as the collection that computer room delay machine occurs
The main common recognition node of group carries out common recognition service, to know together to block;
S3 is closed extensive as this after receiving the recovery message resumed operation that the collection pocket transmission of computer room delay machine occurs
The common recognition service of the spare common recognition node of the main common recognition node of the cluster run again, and control the spare common recognition node and the recovery
The synchronous increment block data of the main common recognition node of the cluster of operation.
Preferably, after the step S1, further includes:
When there is main common recognition node in cluster that delay machine occurs, will be total to based on a spare common recognition node setting in the cluster
Node is known, to carry out common recognition service;
After the main common recognition node of the generation delay machine resumes operation, is sent to the spare common recognition node and restore message, so as to
The spare common recognition node is based on the recovery message and closes common recognition service, and controls the spare common recognition node and the master resumed operation
The synchronous increment block data of node of knowing together.
Preferably, after the step S1, further includes:
After the main common recognition node in cluster synchronizes increment block data, the main common recognition node into other clusters is sent out respectively
It send whether to know together and completes the confirmation request of the increment block data;
If the confirmation message that the main common recognition node in other clusters is sent based on the confirmation request is received, by the increasing
Amount block data is synchronized to the back end in block chain.
Preferably, the method for block chain common recognition, further includes:
When the main common recognition node in cluster receive the main common recognition node in other clusters transmission whether common recognition complete one
After the confirmation request of block, the newest block number and the main common recognition section in other clusters of analyzing the main common recognition node in this cluster
Whether the newest block number of point is consistent;
If the newest block number of the main common recognition node in this cluster is less than the newest of the main common recognition node in other clusters
Block number, then the main common recognition node into other clusters requests increment block data.
Preferably, the method for block chain common recognition, further includes: if the newest block number of the main common recognition node in this cluster
Greater than the newest block number of the main common recognition node in other clusters, then the main common recognition node into other clusters sends confirmation and asks
It asks, so that the main common recognition node in other clusters requests increment block data to the main common recognition node in this cluster.
The present invention also provides a kind of computer readable storage medium, processing is stored on the computer readable storage medium
The step of system, the processing system realizes the method for above-mentioned block chain common recognition when being executed by processor.
The beneficial effects of the present invention are: the present invention is under the scene that alliance's chain multimachine room strange land is disposed, by same computer room
Common recognition node division is same cluster, is equipped with a main common recognition node and at least one spare common recognition node in each computer room,
When can not be known together with other computer rooms after computer room delay machine, the spare common recognition node conduct in the computer room of normal operation can be enabled
The temporary main common recognition node of delay machine computer room carries out common recognition service, and after delay machine computer room resumes operation, which is total to
The common recognition service for knowing node is closed, then the temporary main common recognition node and the main common recognition node in the computer room to resume operation
Synchronous increment block data in the case where there is computer room that the offline situation of delay machine occurs, passes through the machine of other normal operations in this way
Room replaces the delay machine computer room to carry out common recognition service, and after delay machine computer room resumes operation, the increment block data that period is known together
It is synchronized to the main common recognition node of the delay machine computer room, so that data will not lose, guarantees the integrality of data, realizes more to alliance's chain
The calamity next choice of computer room strange land deployment is rescued.
Detailed description of the invention
Fig. 1 is the optional application environment schematic diagram of each embodiment one of the invention;
Fig. 2 is the schematic diagram of the hardware structure of one embodiment of electronic device in Fig. 1;
Fig. 3 is the Program modual graph that processing system unifies embodiment in Fig. 2;
Fig. 4 is the flow diagram of one embodiment of method of block chain of the present invention common recognition.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not
For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work
Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot
It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the
One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment
Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution
Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims
Protection scope within.
As shown in fig.1, being the application environment schematic diagram of presently preferred embodiments of the present invention.In this embodiment, multimachine room
For the scene of strange land deployment, under the scene, the node that needs to know together is divided according to computer room, by the common recognition section of same computer room
Point is divided into same cluster, the main common recognition node of each cluster configuration one and at least one spare common recognition node.In Fig. 1, often
A computer room is configured with a main common recognition node and two standby common recognition nodes.It is arrived due to needing to update the data moment for node of knowing together
Newest, network transmission can be main time loss, and therefore, it is necessary to use private line network to connect each computer room or contract as far as possible
Physical distance between short each computer room.Equipment based on electronic device where common recognition node.
The electronic device be it is a kind of can according to the instruction for being previously set or store, it is automatic carry out numerical value calculate with/
Or the equipment of information processing.The electronic device can be computer, be also possible to single network server, multiple network services
The server group that device forms or the cloud being made of a large amount of hosts or network server based on cloud computing, wherein cloud computing are
One kind of distributed computing, a super virtual computer consisting of a loosely coupled set of computers.
Referring to shown in Fig. 2, in the present embodiment, electronic device 1 may include, but be not limited only to, and can pass through system bus phase
Memory 11, the processor 12, network interface 13 of mutual communication connection, memory 11 are stored with the place that can be run on the processor 12
Reason system 10.It should be pointed out that Fig. 2 illustrates only the electronic device 1 with component 11-13, it should be understood that not
It is required that implement all components shown, the implementation that can be substituted is more or less component.
Wherein, memory 11 includes the readable storage medium storing program for executing of memory and at least one type.Inside save as the fortune of electronic device 1
Row provides caching;Readable storage medium storing program for executing can be for if flash memory, hard disk, multimedia card, card-type memory are (for example, SD or DX memory
Deng), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), electric erasable can compile
Journey read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, CD etc. it is non-volatile
Storage medium.In some embodiments, readable storage medium storing program for executing can be the internal storage unit of electronic device 1, such as the electronics
The hard disk of device 1;In further embodiments, the external storage which is also possible to electronic device 1 is set
Plug-in type hard disk that is standby, such as being equipped on electronic device 1, intelligent memory card (Smart Media Card, SMC), secure digital
(Secure Digital, SD) card, flash card (Flash Card) etc..In the present embodiment, the readable storage medium storing program for executing of memory 11
Commonly used in storing in the operating system and types of applications software that are installed on electronic device 1, such as storage one embodiment of the invention
Processing system 10 program code etc..In addition, memory 11 can be also used for temporarily storing and export or will be defeated
Various types of data out.
The processor 12 can be in some embodiments central processing unit (Central Processing Unit,
CPU), controller, microcontroller, microprocessor or other data processing chips store in the memory 11 for running
Program code or processing data, such as operation processing system 10 etc..
The network interface 13 may include the radio network interface of standard, wired network interface, and the network interface 13 is usual
For establishing communication connection between the electronic device 1 and other electronic equipments.
The processing system 10 is stored in memory 11, can including at least one computer being stored in memory 11
Reading instruction, at least one computer-readable instruction can be executed by processor device 12, the method to realize each embodiment of the application;
And the function that at least one computer-readable instruction is realized according to its each section is different, can be divided into different logics
Module.
In one embodiment, following steps are realized when above-mentioned processing system 10 is executed by the processor 12:
When the main common recognition node in cluster completes block in common recognition, the main common recognition node into other clusters, which is sent, respectively is
After no common recognition completes the confirmation request of the block, if not received within scheduled first time corresponding based on the confirmation request
Confirmation message then sends heartbeat request to the main common recognition node for not receiving the corresponding cluster of confirmation message, wherein save common recognition
Point is divided according to computer room, is same cluster, one main common recognition of each cluster configuration by the common recognition node division of same computer room
Node and at least one spare common recognition node;
If not receiving the cluster within scheduled second time to respond based on the heartbeat of the heartbeat request, this is not carried out
Computer room delay machine occurs for the cluster of heartbeat response, enables the spare common recognition node in this cluster as the cluster that computer room delay machine occurs
Main common recognition node carries out common recognition service, to know together to block;
After receiving the recovery message resumed operation that the collection pocket transmission of computer room delay machine occurs, closes and transported as the recovery
The common recognition service of the spare common recognition node of the main common recognition node of capable cluster, and control the spare common recognition node and resume operation with this
Cluster the synchronous increment block data of main common recognition node.
Concrete principle please refers to Program modual graph and Fig. 4 process about this method of following Fig. 3 about processing system 10
The introduction of figure.
It is the Program modual graph of processing system 10 in Fig. 2 referring to shown in Fig. 3.The processing system 10 is divided into multiple
Module, multiple module are stored in memory 12, and are executed by processor 13, to complete the present invention.The present invention is so-called
Module is the series of computation machine program instruction section for referring to complete specific function.
The processing system 10 can be divided into: sending module 101 enables module 102 and common recognition module 103.
The sending module 101, for completing block in common recognition when the main common recognition node in cluster, respectively to other clusters
In the transmission of main common recognition node whether know together after the confirmation request for completing the block, if not received within scheduled first time
Based on the corresponding confirmation message of the confirmation request, then the heart is sent to the main common recognition node for not receiving the corresponding cluster of confirmation message
Jump request;
Wherein, common recognition node is divided according to computer room, is same cluster by the common recognition node division of same computer room, often
The main common recognition node of one cluster configuration one and at least one spare common recognition node.
Wherein, if not receiving what the main common recognition node of at least one of other clusters was sent within scheduled first time
It is abnormal then to illustrate that the computer room occurs for confirmation message, which may be that main common recognition node delay machine is also likely to be entire computer room delay machine.
It, then can be again to not receiving confirmation message pair in order to confirm that the exception is main common recognition node delay machine or entire computer room delay machine
The main common recognition node for the cluster answered sends heartbeat request, for example, every the heartbeat request of transmission in 10 seconds to these clusters
Main common recognition node, if there is heartbeat response, main common recognition node is worked normally, can be in limiting time if main common recognition node delay machine
Interior (for example, 1 minute) elects a certain spare common recognition node in this cluster as main common recognition node, during this, can not receive the heart
After jump responds, but the spare common recognition node of follow-up election is as temporary main common recognition node, it is able to carry out heartbeat response, can be confirmed
The main common recognition node delay machine of the cluster.
The enabling module 102, if for not received within scheduled second time (i.e. more than election time threshold)
The cluster is responded based on the heartbeat of the heartbeat request, then computer room delay machine occurs for the cluster for not carrying out heartbeat response, enables this collection
Spare common recognition node in group carries out common recognition service as the main common recognition node for the cluster that computer room delay machine occurs, to carry out to block
Common recognition;
The common recognition module 103, for disappearing when the recovery resumed operation for receiving the collection pocket transmission that computer room delay machine occurs
After breath, the common recognition service of the spare common recognition node of the main common recognition node as the cluster to resume operation is closed, and it is standby to control this
With common recognition node increment block data synchronous with the main common recognition node of the cluster to resume operation.
Wherein, total as the temporary master for the cluster that computer room delay machine occurs for enabling the spare common recognition node in this cluster
The computer room for knowing node, after receiving recovery message, due to no longer needing the common recognition service of the main common recognition node temporarily,
The common recognition service of the temporary main common recognition node is closed.Then, the temporary main common recognition node and the collection to resume operation
The synchronous increment block data of the main common recognition node of group.After synchronously completing, the main common recognition node of the cluster to resume operation is online total
Know service.
As shown in figure 4, Fig. 4 is the flow diagram of one embodiment of the method for the present invention, the processor 13 of electronic device 1 is executed
The following steps of this method are realized when the processing system 10 stored in memory 12:
Step S1, when the main common recognition node in cluster completes block, the respectively main common recognition section into other clusters in common recognition
After point sends the confirmation request for completing the block of whether knowing together, asked if not received within scheduled first time based on the confirmation
Corresponding confirmation message is sought, then sends heartbeat request to the main common recognition node for not receiving the corresponding cluster of confirmation message;
Wherein, common recognition node is divided according to computer room, is same cluster by the common recognition node division of same computer room, often
The main common recognition node of one cluster configuration one and at least one spare common recognition node.
Wherein it is possible to carry out the common recognition of block using Paxos, Raft or PBFT scheduling algorithm.
If (for example, 5 minutes) receive the transmission of the main common recognition node in other clusters within scheduled first time
Confirmation message, illustrate this block common recognition success, block data after common recognition can be committed to back end.If pre-
The confirmation message that the main common recognition node of at least one of other clusters is sent is not received in fixed first time, then illustrates the computer room
There is exception, which may be that main common recognition node delay machine is also likely to be entire computer room delay machine.In order to confirm that the exception is main total
Know node delay machine or entire computer room delay machine, then it can be again to the main common recognition node for not receiving the corresponding cluster of confirmation message
Heartbeat request is sent, for example, sending a heartbeat request every 10 seconds to the main common recognition node of these clusters, if there is heartbeat to ring
It answers, then main common recognition node works normally, if main common recognition node delay machine, (for example, 1 minute) can elect this collection within a limited period of time
A certain spare common recognition node in group is as main common recognition node, during this, can not receive heartbeat and respond, but follow-up election is spare total
After knowing node as temporary main common recognition node, it is able to carry out heartbeat response, the main common recognition node delay machine of the cluster can be confirmed.
Step S2 is responded if not receiving the cluster within scheduled second time based on the heartbeat of the heartbeat request,
Computer room delay machine occurs for the cluster for not carrying out heartbeat response, enables the spare common recognition node in this cluster as generation computer room delay machine
The main common recognition node of cluster carry out common recognition service, to know together to block;
If (such as 3 minutes) are not received the cluster and are rung based on the heartbeat of the heartbeat request within scheduled second time
It answers, that is, is more than election time threshold, it is believed that computer room delay machine, i.e. this computer room all devices are damaged, such as earthquake, fire occurs
Entire computer room damages when calamity, then enables the spare common recognition node in this cluster as the cluster that computer room delay machine occurs
Temporary main common recognition node, carries out common recognition service.
Step S3 closes conduct after receiving the recovery message resumed operation that the collection pocket transmission of computer room delay machine occurs
The common recognition service of the spare common recognition node of the main common recognition node of the cluster to resume operation, and control the spare common recognition node and be somebody's turn to do
The synchronous increment block data of the main common recognition node of the cluster to resume operation.
Wherein, it after delay machine computer room restores to operate normally, sends restore to the main common recognition node of other each computer rooms respectively
After the main common recognition node of other each computer rooms receives the recovery message, the recovered normal fortune of the computer room is can be confirmed in message
Row.For enabling machine of the spare common recognition node in this cluster as the temporary main common recognition node for the cluster that computer room delay machine occurs
Room, after receiving recovery message, due to the common recognition service for the main common recognition node for no longer needing this temporary, this is temporary
The common recognition service of main common recognition node is closed.Then, the cluster by controlling the temporary main common recognition node with resuming operation
The synchronous increment block data of main common recognition node, the block data of the main common recognition node of the cluster to resume operation is updated to most
The state of new block data.After synchronously completing, the online common recognition service of the main common recognition node of the cluster to resume operation.
Wherein, in synchronous increment block data, the data synchronizing function of Kafka can be used, by Kafka to computer room
(rack) it completes to synchronize with the configuration of the node of synchronous increment block data (insync replica).
It further,, should after the main common recognition node in cluster synchronizes increment block data after above-mentioned step S3
Method further include: whether main common recognition node into other clusters sends to know together and complete the confirmation of the increment block data and ask respectively
It asks;If the confirmation message that the main common recognition node in other clusters is sent based on the confirmation request is received, by the increment area
Block number is according to the back end being synchronized in block chain.
Further, when the main common recognition node in cluster receives the whether total of the transmission of the main common recognition node in other clusters
After knowing the confirmation request for completing a block, analyze in the newest block number and other clusters of the main common recognition node in this cluster
Whether the newest block number of main common recognition node is consistent;
If the newest block number of the main common recognition node in this cluster is less than the newest of the main common recognition node in other clusters
Block number, then the main common recognition node into other clusters requests increment block data;
If the newest block number of the main common recognition node in this cluster is greater than the newest of the main common recognition node in other clusters
Block number, then main common recognition node into other clusters sends confirmation request, for the main common recognition node in other clusters to
Main common recognition node in this cluster requests increment block data.
Wherein, if the block number of the newest block of the main common recognition node in each cluster is consistent, i.e., it is believed that each
Block in a cluster is synchronized to last state.For example, if the newest block number of the main common recognition node in this cluster is
100, the newest block number of the main common recognition node in other clusters is 103, then the main common recognition node in this cluster is needed to it
The corresponding increment block data of block number that main common recognition node request block number in his cluster is 101 to 103;If this
The newest block number of main common recognition node in cluster is 103, and the newest block number of the main common recognition node in other clusters is
100, then the main common recognition node in this cluster needs the main common recognition node into other clusters to send confirmation request, for other collection
It is 101 to 103 block number that main common recognition node in group, which requests the block block number to the main common recognition node in this cluster,
Corresponding increment block data.
In one embodiment, on the basis of the above embodiments, after above-mentioned steps S1, this method further include: when having
Delay machine occurs for main common recognition node in cluster, by a spare common recognition node in the cluster be arranged based on know together node, with into
Row common recognition service;After the main common recognition node of the generation delay machine resumes operation, is sent to the spare common recognition node and restore message, with
Just the spare common recognition node is based on the recovery message and closes common recognition service, and controls the spare common recognition node and resume operation with this
The synchronous increment block data of main common recognition node.
Wherein, as described above, being based on being somebody's turn to do when the main common recognition node in this cluster does not receive within scheduled first time
The corresponding confirmation message of confirmation request illustrates to have computer room to occur abnormal, need again heartbeat request to not receiving confirmation message
The corresponding main common recognition node of cluster, if main common recognition node delay machine, elect it is spare common recognition node as temporarily main common recognition node,
Common recognition service is carried out, and carries out heartbeat response.After the main common recognition node of delay machine resumes operation, first to total as temporary master
Know node spare common recognition node send restore message, this as temporarily main common recognition node spare common recognition node receive it is extensive
Common recognition service is closed after message again, then as the spare common recognition node of temporary main common recognition node and the main common recognition resumed operation
Node synchronizes increment block data, after synchronously completing, the online common recognition service of the main common recognition node to resume operation.
As can be seen that, if only there are two computer rooms, allowing one under alliance's block chain scene that multimachine room strange land is disposed
The common recognition service of computer room delay machine, node remains to be normally carried out, and the calamity suitable for the deployment of offsite active standby room strange land is for situation, certainly,
The calamity of more than two computer room strange land deployment is also applied for for situation, serious forgiveness is high.
Compared with prior art, the present invention is under the scene that alliance's chain multimachine room strange land is disposed, by the common recognition of same computer room
Node division is same cluster, a main common recognition node and at least one spare common recognition node is equipped in each computer room, in computer room
When can not be known together with other computer rooms after delay machine, the spare common recognition node in the computer room of normal operation can be enabled as delay machine
The temporary main common recognition node of computer room carries out common recognition service, and after delay machine computer room resumes operation, by the temporary main common recognition section
The common recognition service of point is closed, and then the temporary main common recognition node is synchronous with the main common recognition node in the computer room to resume operation
Increment block data in the case where there is computer room that the offline situation of delay machine occurs, passes through the computer room generation of other normal operations in this way
Common recognition service is carried out for the delay machine computer room, and after delay machine computer room resumes operation, the increment block data of period common recognition is synchronous
To the main common recognition node of the delay machine computer room, so that data will not lose, guarantees the integrality of data, realize to alliance's chain multimachine room
The calamity next choice of strange land deployment is rescued.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium
It can be hard disk, multimedia card, SD card, flash card, SMC, read-only memory (ROM), Erasable Programmable Read Only Memory EPROM
(EPROM), any one in portable compact disc read-only memory (CD-ROM), USB storage etc. or several timess
Meaning combination.It include processing system, the function which realizes when being executed by processor in the computer readable storage medium
Can, the above-mentioned introduction about Fig. 3 and Fig. 4 is please referred to, details are not described herein.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, device, article or the method that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, device, article or method institute it is intrinsic
Element.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of electronic device, which is characterized in that the electronic device includes memory and the processing that connect with the memory
Device is stored with the processing system that can be run on the processor in the memory, and the processing system is by the processor
Following steps are realized when execution:
When the main common recognition node in cluster completes block in common recognition, altogether whether the main common recognition node into other clusters sent respectively
After knowing the confirmation request for completing the block, if not received within scheduled first time based on the corresponding confirmation of the confirmation request
Message then sends heartbeat request to the main common recognition node for not receiving the corresponding cluster of confirmation message, wherein presses common recognition node
It is divided according to computer room, is same cluster, the main common recognition node of each cluster configuration one by the common recognition node division of same computer room
And at least one spare common recognition node;
If not receiving the cluster within scheduled second time to respond based on the heartbeat of the heartbeat request, this does not carry out heartbeat
Computer room delay machine occurs for the cluster of response, and the spare common recognition node enabled in this cluster is total as the master for the cluster that computer room delay machine occurs
Know node and carry out common recognition service, to know together to block;
After receiving the recovery message resumed operation that the collection pocket transmission of computer room delay machine occurs, what closing was resumed operation as this
The common recognition service of the spare common recognition node of the main common recognition node of cluster, and control the spare common recognition node and the collection to resume operation
The synchronous increment block data of the main common recognition node of group.
2. electronic device according to claim 1, which is characterized in that when the processing system is executed by the processor,
Also realize following steps:
When there is main common recognition node in cluster that delay machine occurs, by common recognition section based on a spare common recognition node setting in the cluster
Point, to carry out common recognition service;
After the main common recognition node of the generation delay machine resumes operation, is sent to the spare common recognition node and restore message, so that this is standby
The recovery message is based on common recognition node and closes common recognition service, and controls the spare common recognition node and the main common recognition resumed operation
Node synchronizes increment block data.
3. electronic device according to claim 1 or 2, which is characterized in that the processing system is executed by the processor
When, also realize following steps:
After the main common recognition node in cluster synchronizes increment block data, the main common recognition node transmission into other clusters is respectively
No common recognition completes the confirmation request of the increment block data;
If the confirmation message that the main common recognition node in other clusters is sent based on the confirmation request is received, by the increment area
Block number is according to the back end being synchronized in block chain.
4. electronic device according to claim 3, which is characterized in that when the processing system is executed by the processor,
Also realize following steps:
When the main common recognition node in cluster receive the main common recognition node in other clusters transmission whether common recognition complete a block
Confirmation request after, the newest block number and the main common recognition node in other clusters of analyzing main common recognition node in this cluster
Whether newest block number is consistent;
If the newest block number of the main common recognition node in this cluster is less than the newest block of the main common recognition node in other clusters
Number, then the main common recognition node into other clusters requests increment block data.
5. a kind of method of block chain common recognition, which is characterized in that the method for the block chain common recognition includes:
S1, when the main common recognition node in cluster completes block in common recognition, the main common recognition node into other clusters, which is sent, respectively is
After no common recognition completes the confirmation request of the block, if not received within scheduled first time corresponding based on the confirmation request
Confirmation message then sends heartbeat request to the main common recognition node for not receiving the corresponding cluster of confirmation message, wherein save common recognition
Point is divided according to computer room, is same cluster, one main common recognition of each cluster configuration by the common recognition node division of same computer room
Node and at least one spare common recognition node;
S2 is responded if not receiving the cluster within scheduled second time based on the heartbeat of the heartbeat request, this is not carried out
Computer room delay machine occurs for the cluster of heartbeat response, enables the spare common recognition node in this cluster as the cluster that computer room delay machine occurs
Main common recognition node carries out common recognition service, to know together to block;
S3 is closed and is transported as the recovery after receiving the recovery message resumed operation that the collection pocket transmission of computer room delay machine occurs
The common recognition service of the spare common recognition node of the main common recognition node of capable cluster, and control the spare common recognition node and resume operation with this
Cluster the synchronous increment block data of main common recognition node.
6. the method for block chain common recognition according to claim 5, which is characterized in that after the step S1, further includes:
When there is main common recognition node in cluster that delay machine occurs, by common recognition section based on a spare common recognition node setting in the cluster
Point, to carry out common recognition service;
After the main common recognition node of the generation delay machine resumes operation, is sent to the spare common recognition node and restore message, so that this is standby
The recovery message is based on common recognition node and closes common recognition service, and controls the spare common recognition node and the main common recognition resumed operation
Node synchronizes increment block data.
7. the method for block chain common recognition according to claim 5 or 6, which is characterized in that after the step S3, also wrap
It includes:
After the main common recognition node in cluster synchronizes increment block data, the main common recognition node transmission into other clusters is respectively
No common recognition completes the confirmation request of the increment block data;
If the confirmation message that the main common recognition node in other clusters is sent based on the confirmation request is received, by the increment area
Block number is according to the back end being synchronized in block chain.
8. the method for block chain common recognition according to claim 7, which is characterized in that the method for block chain common recognition is also wrapped
It includes:
When the main common recognition node in cluster receive the main common recognition node in other clusters transmission whether common recognition complete a block
Confirmation request after, the newest block number and the main common recognition node in other clusters of analyzing main common recognition node in this cluster
Whether newest block number is consistent;
If the newest block number of the main common recognition node in this cluster is less than the newest block of the main common recognition node in other clusters
Number, then the main common recognition node into other clusters requests increment block data.
9. the method for block chain common recognition according to claim 8, which is characterized in that the method for block chain common recognition is also wrapped
It includes: if the newest block that the newest block number of the main common recognition node in this cluster is greater than the main common recognition node in other clusters is compiled
Number, then main common recognition node into other clusters sends confirmation request, so that the main common recognition node in other clusters is to this cluster
In main common recognition node request increment block data.
10. a kind of computer readable storage medium, which is characterized in that be stored with processing system on the computer readable storage medium
System realizes the method for the block chain common recognition as described in any one of claim 5 to 9 when the processing system is executed by processor
The step of.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910371485.8A CN110221938A (en) | 2019-05-06 | 2019-05-06 | The method and storage medium of electronic device, block chain common recognition |
PCT/CN2019/120627 WO2020224237A1 (en) | 2019-05-06 | 2019-11-25 | Blockchain consensus method, apparatus, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910371485.8A CN110221938A (en) | 2019-05-06 | 2019-05-06 | The method and storage medium of electronic device, block chain common recognition |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110221938A true CN110221938A (en) | 2019-09-10 |
Family
ID=67820458
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910371485.8A Pending CN110221938A (en) | 2019-05-06 | 2019-05-06 | The method and storage medium of electronic device, block chain common recognition |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110221938A (en) |
WO (1) | WO2020224237A1 (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110572468A (en) * | 2019-09-17 | 2019-12-13 | 平安科技(深圳)有限公司 | server cluster file synchronization method and device, electronic equipment and storage medium |
CN111104282A (en) * | 2019-11-26 | 2020-05-05 | 众安信息技术服务有限公司 | Node processing method and device based on block chain |
WO2020224237A1 (en) * | 2019-05-06 | 2020-11-12 | 深圳壹账通智能科技有限公司 | Blockchain consensus method, apparatus, device and storage medium |
CN111984422A (en) * | 2020-09-03 | 2020-11-24 | 深圳壹账通智能科技有限公司 | Data processing method and device based on block chain and storage medium |
CN112511337A (en) * | 2020-11-09 | 2021-03-16 | 迅鳐成都科技有限公司 | Block chain consensus network self-recovery method, electronic device, system and storage medium |
CN112511338A (en) * | 2020-11-09 | 2021-03-16 | 迅鳐成都科技有限公司 | Block chain consensus network dynamic recovery method, electronic device, system and medium |
CN112767152A (en) * | 2021-01-18 | 2021-05-07 | 中国工商银行股份有限公司 | Double-park disaster recovery system and method applied to alliance chain |
CN113783947A (en) * | 2021-08-26 | 2021-12-10 | 浙商银行股份有限公司 | Adaptive block link point fault tolerance improving method, equipment and storage medium |
CN114218331A (en) * | 2021-12-30 | 2022-03-22 | 杭州趣链科技有限公司 | Data synchronization method, alliance block chain system, electronic device and storage medium |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116260707B (en) * | 2023-05-15 | 2023-10-10 | 安徽中科晶格技术有限公司 | Block chain node disaster recovery method, device and equipment based on consensus and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107368507A (en) * | 2017-03-28 | 2017-11-21 | 阿里巴巴集团控股有限公司 | A kind of common recognition method and device based on block chain |
WO2017220165A1 (en) * | 2016-06-24 | 2017-12-28 | Rwe International Se | Augmented reality system |
WO2018112805A1 (en) * | 2016-12-21 | 2018-06-28 | 深圳前海达闼云端智能科技有限公司 | Blockchain storage method and device, and node device |
CN108459929A (en) * | 2018-03-28 | 2018-08-28 | 成都汇智远景科技有限公司 | A kind of data back up method based on cloud computing |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108111604B (en) * | 2017-12-21 | 2020-08-14 | 广州广电运通金融电子股份有限公司 | Block chain consensus method, device and system, and identification information processing method and device |
CN108681963B (en) * | 2018-03-29 | 2020-07-31 | 深圳市网心科技有限公司 | Multi-block chain integration control method, system, electronic device and storage medium |
CN109685504B (en) * | 2018-12-20 | 2020-08-28 | 雄安新区智能城市创新联合会 | Block chain-based shared economy accounting method |
CN109688012B (en) * | 2018-12-29 | 2020-07-17 | 杭州趣链科技有限公司 | Method for hot standby switching of alliance link nodes |
CN110221938A (en) * | 2019-05-06 | 2019-09-10 | 深圳壹账通智能科技有限公司 | The method and storage medium of electronic device, block chain common recognition |
-
2019
- 2019-05-06 CN CN201910371485.8A patent/CN110221938A/en active Pending
- 2019-11-25 WO PCT/CN2019/120627 patent/WO2020224237A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017220165A1 (en) * | 2016-06-24 | 2017-12-28 | Rwe International Se | Augmented reality system |
WO2018112805A1 (en) * | 2016-12-21 | 2018-06-28 | 深圳前海达闼云端智能科技有限公司 | Blockchain storage method and device, and node device |
CN107368507A (en) * | 2017-03-28 | 2017-11-21 | 阿里巴巴集团控股有限公司 | A kind of common recognition method and device based on block chain |
CN108459929A (en) * | 2018-03-28 | 2018-08-28 | 成都汇智远景科技有限公司 | A kind of data back up method based on cloud computing |
Non-Patent Citations (2)
Title |
---|
曹兆磊;: "一种适用于联盟链的共识机制", 网络空间安全, no. 01 * |
王缵;田有亮;李秋贤;杨新欢;: "基于信用模型的工作量证明算法", 通信学报, no. 08 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020224237A1 (en) * | 2019-05-06 | 2020-11-12 | 深圳壹账通智能科技有限公司 | Blockchain consensus method, apparatus, device and storage medium |
CN110572468B (en) * | 2019-09-17 | 2022-11-04 | 平安科技(深圳)有限公司 | Server cluster file synchronization method and device, electronic equipment and storage medium |
CN110572468A (en) * | 2019-09-17 | 2019-12-13 | 平安科技(深圳)有限公司 | server cluster file synchronization method and device, electronic equipment and storage medium |
CN111104282A (en) * | 2019-11-26 | 2020-05-05 | 众安信息技术服务有限公司 | Node processing method and device based on block chain |
CN111104282B (en) * | 2019-11-26 | 2024-01-16 | 众安信息技术服务有限公司 | Node processing method and device based on block chain |
CN111984422A (en) * | 2020-09-03 | 2020-11-24 | 深圳壹账通智能科技有限公司 | Data processing method and device based on block chain and storage medium |
WO2022048361A1 (en) * | 2020-09-03 | 2022-03-10 | 深圳壹账通智能科技有限公司 | Blockchain-based data processing method and apparatus, and storage medium |
CN112511337A (en) * | 2020-11-09 | 2021-03-16 | 迅鳐成都科技有限公司 | Block chain consensus network self-recovery method, electronic device, system and storage medium |
CN112511338A (en) * | 2020-11-09 | 2021-03-16 | 迅鳐成都科技有限公司 | Block chain consensus network dynamic recovery method, electronic device, system and medium |
CN112511337B (en) * | 2020-11-09 | 2023-03-14 | 迅鳐成都科技有限公司 | Block chain consensus network self-recovery method, electronic device, system and storage medium |
CN112767152A (en) * | 2021-01-18 | 2021-05-07 | 中国工商银行股份有限公司 | Double-park disaster recovery system and method applied to alliance chain |
CN112767152B (en) * | 2021-01-18 | 2024-02-09 | 中国工商银行股份有限公司 | Double-park disaster recovery system and method applied to alliance chain |
CN113783947A (en) * | 2021-08-26 | 2021-12-10 | 浙商银行股份有限公司 | Adaptive block link point fault tolerance improving method, equipment and storage medium |
CN113783947B (en) * | 2021-08-26 | 2024-05-31 | 浙商银行股份有限公司 | Adaptive block chain link point fault tolerance lifting method, device and storage medium |
CN114218331A (en) * | 2021-12-30 | 2022-03-22 | 杭州趣链科技有限公司 | Data synchronization method, alliance block chain system, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2020224237A1 (en) | 2020-11-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110221938A (en) | The method and storage medium of electronic device, block chain common recognition | |
CN103136073B (en) | The snapshot that the application of shared volume is consistent | |
US5923832A (en) | Method and apparatus for checkpointing in computer system | |
CN102411639B (en) | Multi-copy storage management method and system of metadata | |
CN111314479B (en) | Data processing method and equipment | |
CN108337303A (en) | A kind of method of data synchronization and distributed system | |
CN102142006A (en) | File processing method and device of distributed file system | |
CN111698315B (en) | Data processing method and device for block and computer equipment | |
CN110232094A (en) | Device, method and storage medium across chain transaction | |
CN111046109A (en) | Cross-chain task processing method, device and equipment and readable storage medium | |
CN110222535A (en) | Processing unit, method and the storage medium of block chain configuration file | |
CN110348826B (en) | Method, system, equipment and readable storage medium for disaster recovery of multiple living things in different places | |
CN109361542A (en) | The fault handling method of client, device, system, terminal and server | |
CN111506649A (en) | Transaction data disaster tolerance switching method and device, computing device and storage medium | |
CN111414241A (en) | Batch data processing method, device and system, computer equipment and computer readable storage medium | |
EP3660679B1 (en) | Data backup method, device and system | |
CN112087497B (en) | Data synchronization method and device, electronic equipment and readable storage medium | |
EP4060514A1 (en) | Distributed database system and data disaster backup drilling method | |
CN114422331A (en) | Disaster tolerance switching method, device and system | |
CN116860527A (en) | Migration method for container using local storage in Kubernetes environment | |
CN111400023A (en) | Resource pool redundancy rate adjusting method, device, medium and equipment | |
CN115291891A (en) | Cluster management method and device and electronic equipment | |
CN102929746A (en) | Quick backup and recovery method for lottery sale system | |
CN114138408A (en) | Method, device, computer equipment and storage medium for creating clone volume | |
CN111752911A (en) | Data transmission method, system, terminal and storage medium based on Flume |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
AD01 | Patent right deemed abandoned | ||
AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20240621 |