CN109165229A - Local the block synchronous method of inspection, device, equipment and storage medium - Google Patents

Local the block synchronous method of inspection, device, equipment and storage medium Download PDF

Info

Publication number
CN109165229A
CN109165229A CN201810965979.4A CN201810965979A CN109165229A CN 109165229 A CN109165229 A CN 109165229A CN 201810965979 A CN201810965979 A CN 201810965979A CN 109165229 A CN109165229 A CN 109165229A
Authority
CN
China
Prior art keywords
block
height
local
block chain
chain
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.)
Granted
Application number
CN201810965979.4A
Other languages
Chinese (zh)
Other versions
CN109165229B (en
Inventor
温泉
张晴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JD Digital Technology Holdings Co Ltd
Jingdong Technology Holding Co Ltd
Original Assignee
Beijing Jingdong Financial Technology Holding Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Financial Technology Holding Co Ltd filed Critical Beijing Jingdong Financial Technology Holding Co Ltd
Priority to CN201810965979.4A priority Critical patent/CN109165229B/en
Publication of CN109165229A publication Critical patent/CN109165229A/en
Application granted granted Critical
Publication of CN109165229B publication Critical patent/CN109165229B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of method of inspection, device, equipment and storage medium that local block is synchronous, by the current block chain block height and detection starting point height that obtain block chain;It successively traverses in local block from detection starting point height to the block current block chain block height;If detecting the presence of loss block, the loss block is obtained from block chain, and is stored at the corresponding block height of local block.The embodiment of the present invention is compensated by traversing local block to detect loss block, and to block is lost, so that local block data is consistent with data on block chain, guarantees the integrality of local block data.

Description

Local the block synchronous method of inspection, device, equipment and storage medium
Technical field
The present invention relates to field of communication technology more particularly to a kind of method of inspection that local block is synchronous, device, equipment and Storage medium.
Background technique
With the continuous development of internet, block chain technology is come into being, it is a kind of internet database technology, is had Decentralization, open and clear feature.Specifically, the essence of block chain technology is decentralization and the number for residing in distributed frame According to the method for storage, transmission and proof, replace dependence of the current internet to central server with data block, so that all numbers According to change or trading item be all recorded among a public account book.Due to the distribution equity of not no central control point Network, and use the method for distributed collective's running, it may be said that block chain is disclosed account book on network.It exists many Node, each node can observe entire account book, and participate in maintenance jointly, and individual node can not modify database, from And it ensure that the safe and reliable of account book data.
In block chain node, block and Transaction Information are generally stored with document form, are not easy to inquire, therefore practical application In generally require more part and parcel in block chain data is synchronized to local data base with facilitate inquiry.Area in the prior art Block synchronizes generally by the way of event monitoring, when block chain generates block, notifies to answer to local in a manner of block event With locally applied that block is parsed and stored according to block event.And designated blocks event notice be generate in real time, and And only generate it is primary, when occurring being connected to the network or when database connectivity problem, will lead to block data loss, to make local number It is inconsistent according to the block data in library and data on block chain.
Summary of the invention
The present invention provides a kind of method of inspection, device, equipment and storage medium that local block is synchronous, to detect local number It according to the block data in library, is compensated to block is lost, to keep the integrality of local block data.
In a first aspect, the embodiment of the present invention provides a kind of method of inspection that the local block based on block chain is synchronous, comprising:
Obtain the current block chain block height and detection starting point height of block chain;
It successively traverses in the local block stored in local data base from the detection starting point height to the current block Block between chain block height;
If detecting the presence of loss block, the loss block is obtained from the block chain, and be stored in local block phase At the block height answered.
Further, the current block chain block height for obtaining block chain and detection starting point height are specific to wrap It includes:
The current block chain block height of the block chain is periodically acquired with the first prefixed time interval;
The above cycle detection terminal height is as the detection starting point height;Wherein with first area in the period 1 Block is as the detection starting point height.
Further, it is described successively traverse in local data base in the local block that stores from the detection starting point height to Block between the current block chain block height, specifically includes:
Block corresponding with the detection starting point height in the local block is detected;
By the detection starting point height, count is incremented if detection block is not lost;
Circulation executes until detection starting point height reaches the current block chain block height.
Further, it is described successively traverse in local data base in the local block that stores from the detection starting point height to Block between the current block chain block height, comprising:
In successively ergodic process, parses and correspond to block in the either block and block chain of local block and compared It is right, it is judged as loss block if comparison result is inconsistent.
Further, the method also includes:
The synchronization notice that the block chain is sent in newly-increased block is received, newly-increased block is synchronized to the local data In library;Or
The current block chain block height and local block of the block chain are periodically acquired with the second prefixed time interval Highly, if local block height is less than current block chain block height, it is high that the block chain is obtained into current block chain block Block between degree and local block height is synchronized in the local data base.
Further, in block synchronizing process further include:
It is that each local block establishes unique index in the local data base, to identify in its area in local block Block height.
Second aspect, the embodiment of the present invention provide a kind of verifying attachment that the local block based on block chain is synchronous, comprising:
Module is obtained, for obtaining the current block chain block height and detection starting point height of block chain;
Processing module, for successively traverse in the local block stored in local data base from the detection starting point height to Block between the current block chain block height;
Synchronization module, if obtaining the loss block from the block chain, and store for detecting the presence of loss block At the corresponding block height of local block.
Further, the acquisition module is used for:
The current block chain block height of the block chain is periodically acquired with the first prefixed time interval;
The above cycle detection terminal height is as the detection starting point height;Wherein with first area in the period 1 Block is as the detection starting point height.
Further, the processing module is specifically used for:
Block corresponding with the detection starting point height in the local block is detected;
By the detection starting point height, count is incremented if detection block is not lost;
Circulation executes until detection starting point height reaches the current block chain block height.
Further, the processing module is used for:
In successively ergodic process, parses and correspond to block in the either block and block chain of local block and compared It is right, it is judged as loss block if comparison result is inconsistent.
Further, the synchronization module is also used to:
The synchronization notice that the block chain is sent in newly-increased block is received, newly-increased block is synchronized to the local data In library;Or
The current block chain block height and local block of the block chain are periodically acquired with the second prefixed time interval Highly, if local block height is less than current block chain block height, it is high that the block chain is obtained into current block chain block Block between degree and local block height is synchronized in the local data base.
Further, the synchronization module is also used to,
In block synchronizing process, it is that each local block establishes unique index in the local data base, is existed with mark Its block height in local block.
The third aspect, the embodiment of the present invention provide a kind of inspection equipment that the local block based on block chain is synchronous, comprising:
Memory;
Processor;And
Computer program;
Wherein, the computer program stores in the memory, and is configured as being executed by the processor with reality Now method as described in relation to the first aspect.
Fourth aspect, the embodiment of the present invention provide a kind of computer readable storage medium, are stored thereon with computer program;
The computer program realizes method according to any one of claims 1 to 5 when being executed by processor.
Local the block provided in an embodiment of the present invention synchronous method of inspection, device, equipment and storage medium, pass through acquisition The current block chain block height and detection starting point height of block chain;It successively traverses in local block from detection starting point height Block between current block chain block height;If detecting the presence of loss block, the loss block is obtained from block chain, And it is stored at the corresponding block height of local block.The embodiment of the present invention loses area by traversing local block to detect Block, and compensated to block is lost, so that local block data is consistent with data on block chain, guarantee local block counts According to integrality.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention without any creative labor, may be used also for those of ordinary skill in the art To obtain other drawings based on these drawings.
Fig. 1 is the synchronous method of inspection flow chart of the local block provided in an embodiment of the present invention based on block chain;
Fig. 2 be another embodiment of the present invention provides the synchronous method of inspection flow chart of local block based on block chain;
Fig. 3 a is the schematic diagram of local data base and block chain before examining;
Fig. 3 b is the schematic diagram of local data base and block chain after executing process shown in Fig. 2;
Fig. 4 is the structure chart of the synchronous verifying attachment of the local block provided in an embodiment of the present invention based on block chain;
Fig. 5 is the structure chart of the synchronous inspection equipment of the local block provided in an embodiment of the present invention based on block chain.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Fig. 1 is the synchronous method of inspection flow chart of the local block provided in an embodiment of the present invention based on block chain.This reality It applies example and provides a kind of method of inspection that the local block based on block chain is synchronous, specific step is as follows for this method:
S101, the current block chain block height for obtaining block chain and detection starting point height.
In the present embodiment, block height is the serial number for the block being connected on block chain, can be used as the unique of block Identifier indicates position of the block in block chain, and block height is since 0.And the block chain that the present embodiment obtains is current The block height of current most newly generated block in block chain block height namely block chain.In addition, also being needed in the present embodiment Detection starting point height is obtained, namely local block is detected since detecting starting point height, until detecting described current Until block chain block height namely current block chain block height is detection terminal height.Wherein detection starting point height can be with It is set, for example, if desired block all on block chain is synchronized by local data base, is then detected as needed Point height is the corresponding block height of first block;If local data base only synchronize block chain on newest several blocks or Newest several blocks are only needed to detect that with the presence or absence of losing, then the range setting detection starting point height detected as needed;It is right In periodic Detection task, the detection starting point height in this period can be the detection terminal height in a upper period, can will be every The detection starting point height and detection terminal height in one period are stored in local data base, when the starting of this period from local data base The detection terminal height in a period in middle reading;In addition, in periodic Detection task, it can also every detection in ergodic process One block updates one-time detection starting point height, arrives current block chain block height until updating, at this time newest detection starting point Height is detection terminal height, can be used as the detection starting point height in next period.It furthermore it should be noted that can not also be to work as Preceding block sequence block height is as detection terminal, but separately setting detection terminal height, namely only detects among local block Certain blocks are with the presence or absence of loss.It needs constantly to carry out since block is synchronous under normal conditions, the present embodiment is preferably Using current block chain block height as detection terminal.
S102, successively traverse in local data base in the local block that stores from the detection starting point height to it is described currently Block between block chain block height.
In the present embodiment, for local block, each block is successively traversed since detecting starting point height up to current Until block chain block height, wherein ergodic process can be local no in the presence of area corresponding with block height for only detection Whether block namely block are lost, and can also more specifically detect in a certain block whether have loss of data.
If S103, detecting the presence of loss block, the loss block is obtained from the block chain, and be stored in this area At the corresponding block height of block.
In the present embodiment, when detecting the presence of the case where losing block, then re-synchronization loss block, namely from area Block chain reacquires the corresponding block of loss block, and is stored at the corresponding block height of local block.It needs to illustrate The case where being, block is lost shown in the present embodiment, including entire block are lost, and may include losing number in some block According to the case where.
The synchronous method of inspection of local block provided in this embodiment based on block chain, by obtaining the current of block chain Block chain block height and detection starting point height;It successively traverses in local block from detection starting point height to current block chain Block between block height;If detecting the presence of loss block, the loss block is obtained from block chain, and be stored in local At the corresponding block height of block.The present embodiment detects loss block by traversing local block, and to lose block into Row compensation guarantees the integrality of local block data so that local block data is consistent with data on block chain.
On the basis of the above embodiments, the current block chain block height and detection of block chain are obtained described in S101 Starting point height, specifically can include:
The current block chain block height of the block chain is periodically acquired with the first prefixed time interval;
The above cycle detection terminal height is as the detection starting point height;Wherein with first area in the period 1 Block is as the detection starting point height.
It, can be by setting the first prefixed time interval, to realize step shown in above-mentioned S101-S103 in the present embodiment Periodic cycle executes.Specifically, the current block chain block height of block chain is obtained when the first detection cycle starts, and Using first block as detection starting point height, to successively traverse in local block from first block to current block sequence Block between block height is lost block if it exists and is then compensated to loss block;When the second detection cycle starts, obtain The current block chain block height of block chain at this time, due to having had detected a part of local block in the period 1, Second round only needs the detection terminal height of then period 1 to continue to test, and also will detect terminal height the period 1 Spend detection starting point height as second round, such as a upper cycle detection to third block, then this period is with third block Starting point height is detected, the 4th block, the 5th block and subsequent block are successively traversed.Periodic cycle through this embodiment, The newest local block for being synchronized to local data base is constantly detected to realize, guarantees timely to compensate loss block, Guarantee the integrality of local block data.
In the present embodiment, ergodic process is specifically as follows:
Block corresponding with the detection starting point height in the local block is detected;
By the detection starting point height, count is incremented if detection block is not lost;If detecting certainly, block is lost, By the detection starting point height, count is incremented after the re-synchronization loss block;
Circulation executes until detection starting point height reaches the current block chain block height.
In the present embodiment, when detection starting point height reaches the current block chain block height in this period, that is, reach this The detection terminal in period can be used as the detection starting point height of next detection cycle.
Further, it is successively traversed described in S102 in the local block stored in local data base from the detection starting point Height arrives the block between the current block chain block height, comprising:
In successively ergodic process, parses and correspond to block in the either block and block chain of local block and compared It is right, it is judged as loss block if comparison result is inconsistent.
In the present embodiment, in order to guarantee that local block internal data also can be with the inside number that corresponds to block on block chain According to consistent, therefore local block can be parsed in ergodic process, while parsing and corresponding to block on block chain, compare parsing As a result, judging that the block internal data goes out active, therefore be also judged as loss block, the area Bing Duigai if result is inconsistent Block carries out re-synchronization.In the present embodiment, ergodic process specifically can first detect whether a certain block height is sky, if it is empty then Directly it is judged as that block is lost, carries out re-synchronization;If not empty, then further progress block analysis and comparison, and if block The parsing result of block on chain is inconsistent, then judges to lose data inside the block, carry out re-synchronization;If not empty, and Parsing result is consistent, then updates the detection that detection starting point height carries out block height.In the present embodiment, parsing can be solved only The important information in block, such as Transaction Information are analysed, to improve resolution speed, and then shortens duration used in ergodic process, mentions High detection efficiency.
Further, the detection process in the present embodiment and the synchronizing process of block do not clash, and can parallel may be used Serially.Wherein the synchronizing process of block may include the following two kinds scheme:
Scheme one: receiving the synchronization notice that the block chain is sent in newly-increased block, newly-increased block is synchronized to described In local data base.
In scheme one, using the passively method of synchronization, namely when block chain increases block newly, sent out to local device Synchronization notice is sent, wherein may include that information, the local devices such as the block height of newly-increased block are logical according to synchronizing in synchronization notice Know and obtain newly-increased block from block chain, and store into local data base, to realize the synchronization of local block.
Scheme two: the current block chain block height and sheet of the block chain are periodically acquired with the second prefixed time interval The block chain is obtained current block chain if local block height is less than current block chain block height by ground block height Block between block height and local block height is synchronized in the local data base.
In scheme two, the synchronizing process of block is realized by timed task, namely at predetermined intervals periodically The current block chain block height and local block height of block chain are obtained, and judges the current block chain block height of block chain Size between local block height illustrates if local block height is less than current block chain block height upper one Secondary completion synchronizes rear block chain and increases block newly, then local device obtains newly-increased block namely block chain obtains current block sequence Block between block height and local block height, and store into local data base, to realize the synchronization of local block.It needs It is noted that the second prefixed time interval can it is identical as the first prefixed time interval can also be different, can be according to actual needs It is set.
Fig. 2 is the synchronous method of inspection flow chart of the local block provided in an embodiment of the present invention based on block chain, Fig. 3 a For the schematic diagram for examining preceding local data base and block chain, Fig. 3 b is local data base and block chain after executing process shown in Fig. 2 Schematic diagram.As shown in Fig. 2, the method for inspection synchronous another embodiment of the present invention provides a kind of local block of block chain, inspection Survey process and the synchronizing process of block serially execute, and first carry out the synchronization of block, then carry out detection process.This method specifically flows Journey is as follows:
S201, first setting check starting point height (checkpoint is denoted as cp), and initial value is -1;
S202, starting timed task;
S203, setting i=cp+1, namely detected block 0 since Fig. 3 a;
S204, current block chain block height H is obtained;
S205, local block height h is obtained;
S206, judge whether h is less than H, if so then execute S207, if otherwise executing S208;
Block between S207, synchronous h to H;
S208, judge to detect whether i is greater than H, if then terminating, illustrate block before i after testing, if it is not, then Execute S209;
S209, local block i is checked;
S2010, judge whether local block i is empty, if so, illustrating that block i loses, S2011 is executed, if it is not, then saying Area pellucida block i does not lose, executes S2013;
S2011, synchronous block i;
S2012, judge whether block i synchronizes success, if so then execute S2013, if otherwise re-executing S2011;
S2013, update cp are i;
S2014, update i are i+1, and return to 8.
It should be noted that cp does not need to reset after the completion of this timed task, in order to the starting of next timed task When, continue from cp current value.
The synchronous method of inspection of local block provided in an embodiment of the present invention based on block chain, is the one of above-described embodiment The achievable scheme of kind, concrete function and effect are same as the previously described embodiments, and details are not described herein again.
The synchronous method of inspection of local block provided in this embodiment based on block chain, carries out after synchronizing local block The inspection of block by traversing local block to detect loss block, and is compensated to block is lost, so that local block Data are consistent with data on block chain, guarantee the integrality of local block data.
Fig. 4 is the structure chart of the synchronous verifying attachment of the local block provided in an embodiment of the present invention based on block chain.This It is same that the synchronous verifying attachment of the local block based on block chain that embodiment provides can execute the local block based on block chain The process flow that the method for inspection embodiment of step provides, as shown in figure 4, the inspection that the local block based on block chain is synchronous Device 30 includes obtaining module 31, processing module 32 and synchronization module 33.
Wherein, module 31 is obtained, for obtaining current block chain block height and detection starting point height;
Processing module 32, for successively traversing in the local block stored in local data base from the detection starting point height Block between the current block chain block height;
Synchronization module 33, if obtaining the loss block from the block chain, and deposit for detecting the presence of loss block Storage is at the corresponding block height of local block.
Further, the acquisition module 31 is used for:
The current block chain block height of the block chain is periodically acquired with the first prefixed time interval;
The above cycle detection terminal height is as the detection starting point height;Wherein with first area in the period 1 Block is as the detection starting point height.
Further, the processing module 32 is specifically used for:
Block corresponding with the detection starting point height in the local block is detected;
By the detection starting point height, count is incremented if detection block is not lost;
Circulation executes until detection starting point height reaches the current block chain block height.
Further, the processing module 32 is used for:
In successively ergodic process, parses and correspond to block in the either block and block chain of local block and compared It is right, it is judged as loss block if comparison result is inconsistent.
Further, the synchronization module 33 is also used to:
The synchronization notice that the block chain is sent in newly-increased block is received, newly-increased block is synchronized to the local data In library;Or
The current block chain block height and local block of the block chain are periodically acquired with the second prefixed time interval Highly, if local block height is less than current block chain block height, it is high that the block chain is obtained into current block chain block Block between degree and local block height is synchronized in the local data base.
Further, the synchronization module 33 is also used to,
In block synchronizing process, it is that each local block establishes unique index in the local data base, is existed with mark Its block height in local block.
The synchronous verifying attachment of local block provided in an embodiment of the present invention based on block chain can be specifically used for executing Embodiment of the method provided by above-mentioned Fig. 1 and Fig. 2, details are not described herein again for concrete function.
The synchronous verifying attachment of local block provided in an embodiment of the present invention based on block chain, by obtaining current block Chain block height and detection starting point height;It successively traverses in the local block stored in local data base from detection high starting point Spend the block between current block chain block height;If detecting the presence of loss block, the loss area is obtained from block chain Block, and be stored at the corresponding block height of local block.The present embodiment by traversing local block to detect loss block, And compensated to block is lost, so that local block data is consistent with data on block chain, guarantee local block data Integrality.
Fig. 5 be another embodiment of the present invention provides the synchronous inspection equipment of local block based on block chain structure Figure.As shown in figure 5, the inspection equipment 40 that the local block that the present embodiment provides a kind of based on block chain is synchronous, the equipment 40 It include: processor 41;Memory 42;And computer program.
Wherein, the computer program is stored in the memory 42, and is configured as being executed by the processor 41 To realize the process flow of the offer of the embodiment of the method as provided by Fig. 1 or Fig. 2, details are not described herein again for concrete function.
More specifically, the equipment 40 further includes receiver 43 and transmitter 44, receiver 43 and transmitter 44, processor 41 are connected with memory 42 by bus.
In addition, the present embodiment also provides a kind of computer readable storage medium, it is stored thereon with computer program, the meter Calculation machine program is executed by processor the method for inspection to realize the local block synchronization described in above-described embodiment based on block chain.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.Another point, it is shown or discussed Mutual coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or logical of device or unit Letter connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read- Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various It can store the medium of program code.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each functional module Division progress for example, in practical application, can according to need and above-mentioned function distribution is complete by different functional modules At the internal structure of device being divided into different functional modules, to complete all or part of the functions described above.On The specific work process for stating the device of description, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (14)

1. a kind of method of inspection that the local block based on block chain is synchronous characterized by comprising
Obtain current block chain block height and detection starting point height;
It successively traverses in the local block stored in local data base from the detection starting point height to the current block sequence Block between block height;
If detecting the presence of loss block, the loss block is obtained from the block chain, and it is corresponding to be stored in local block At block height.
2. the method according to claim 1, wherein the acquisition current block chain block height and detection Starting point height, specifically includes:
The current block chain block height of the block chain is periodically acquired with the first prefixed time interval;
The above cycle detection terminal height is as the detection starting point height;Wherein made in the period 1 with first block For the detection starting point height.
3. according to the method described in claim 2, it is characterized in that, described successively traverse this area stored in local data base From the detection starting point height to the block the current block chain block height in block, specifically include:
Block corresponding with the detection starting point height in the local block is detected;
By the detection starting point height, count is incremented if detection block is not lost;
Circulation executes until detection starting point height reaches the current block chain block height.
4. the method according to claim 1, wherein described successively traverse this area stored in local data base From the detection starting point height to the block the current block chain block height in block, comprising:
In successively ergodic process, parses and correspond to block in the either block and block chain of local block and be compared, if Comparison result is inconsistent, is judged as loss block.
5. method according to claim 1-4, which is characterized in that further include:
The synchronization notice that the block chain is sent in newly-increased block is received, newly-increased block is synchronized to the local data base In;Or
The current block chain block height and local block height of the block chain are periodically acquired with the second prefixed time interval, If local block height is less than current block chain block height, the block chain is obtained into current block chain block height and this Block between ground block height is synchronized in the local data base.
6. according to the method described in claim 5, it is characterized in that, in block synchronizing process further include:
It is that each local block establishes unique index in the local data base, to identify the block height at it in local block Degree.
7. a kind of verifying attachment that the local block based on block chain is synchronous characterized by comprising
Module is obtained, for obtaining current block chain block height and detection starting point height;
Processing module, for successively traversing in the local block stored in local data base from the detection starting point height to described Block between current block chain block height;
Synchronization module if obtaining the loss block from the block chain for detecting the presence of loss block, and is stored in this At the corresponding block height of ground block.
8. device according to claim 7, which is characterized in that the acquisition module is used for:
The current block chain block height of the block chain is periodically acquired with the first prefixed time interval;
The above cycle detection terminal height is as the detection starting point height;Wherein made in the period 1 with first block For the detection starting point height.
9. device according to claim 8, which is characterized in that the processing module is specifically used for:
Block corresponding with the detection starting point height in the local block is detected;
By the detection starting point height, count is incremented if detection block is not lost;
Circulation executes until detection starting point height reaches the current block chain block height.
10. device according to claim 7, which is characterized in that the processing module is used for:
In successively ergodic process, parses and correspond to block in the either block and block chain of local block and be compared, if Comparison result is inconsistent, is judged as loss block.
11. according to the described in any item devices of claim 7-10, which is characterized in that the synchronization module is also used to:
The synchronization notice that the block chain is sent in newly-increased block is received, newly-increased block is synchronized to the local data base In;Or
The current block chain block height and local block height of the block chain are periodically acquired with the second prefixed time interval, If local block height is less than current block chain block height, the block chain is obtained into current block chain block height and this Block between ground block height is synchronized in the local data base.
12. device according to claim 10, which is characterized in that the synchronization module is also used to,
Be that each local block establishes unique index in the local data base in block synchronizing process, with mark its Block height in local block.
13. a kind of inspection equipment that the local block based on block chain is synchronous characterized by comprising
Memory;
Processor;And
Computer program;
Wherein, the computer program stores in the memory, and is configured as being executed by the processor to realize such as Method of any of claims 1-6.
14. a kind of computer readable storage medium, which is characterized in that be stored thereon with computer program;
Such as method of any of claims 1-6 is realized when the computer program is executed by processor.
CN201810965979.4A 2018-08-23 2018-08-23 Method, device, equipment and storage medium for checking local block synchronization Active CN109165229B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810965979.4A CN109165229B (en) 2018-08-23 2018-08-23 Method, device, equipment and storage medium for checking local block synchronization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810965979.4A CN109165229B (en) 2018-08-23 2018-08-23 Method, device, equipment and storage medium for checking local block synchronization

Publications (2)

Publication Number Publication Date
CN109165229A true CN109165229A (en) 2019-01-08
CN109165229B CN109165229B (en) 2020-06-05

Family

ID=64896438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810965979.4A Active CN109165229B (en) 2018-08-23 2018-08-23 Method, device, equipment and storage medium for checking local block synchronization

Country Status (1)

Country Link
CN (1) CN109165229B (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109992624A (en) * 2019-03-15 2019-07-09 深圳前海微众银行股份有限公司 A kind of synchronous storage method, device and the computer equipment of block chain Block chain
CN110008206A (en) * 2019-03-22 2019-07-12 深圳前海微众银行股份有限公司 A kind of data processing method and device based on block catenary system
CN110113408A (en) * 2019-04-30 2019-08-09 杭州复杂美科技有限公司 A kind of block synchronous method, equipment and storage medium
CN110309173A (en) * 2019-06-14 2019-10-08 深圳前海达闼云端智能科技有限公司 Contract data recording method and device, block chain node and storage medium
CN110910883A (en) * 2019-12-03 2020-03-24 杭州龙纪科技有限公司 Method for acquiring block chain height based on intelligent sound box
CN111062811A (en) * 2019-12-02 2020-04-24 远光软件股份有限公司 Block chain consensus method, system and storage medium
CN111078790A (en) * 2019-12-04 2020-04-28 福州博泉网络科技有限公司 Method and system for synchronizing isolated block data in block chain and storage medium
CN111078700A (en) * 2019-12-13 2020-04-28 山东众阳健康科技集团有限公司 Data synchronization method and system based on block chain
CN111475575A (en) * 2020-04-09 2020-07-31 腾讯科技(深圳)有限公司 Data synchronization method and device based on block chain and computer readable storage medium
CN111694852A (en) * 2020-05-28 2020-09-22 平安科技(深圳)有限公司 Data processing method, device, terminal and storage medium based on distributed transaction
CN112003701A (en) * 2020-04-16 2020-11-27 成都质数斯达克科技有限公司 Block self-checking and synchronizing method and device
CN112163004A (en) * 2020-10-14 2021-01-01 上海万向区块链股份公司 List processing and updating display system and method based on multi-chain data fusion
CN113326165A (en) * 2021-08-04 2021-08-31 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and computer readable storage medium
CN114422526A (en) * 2021-12-31 2022-04-29 支付宝(杭州)信息技术有限公司 Block synchronization method and device, electronic equipment and storage medium
EP4033374A4 (en) * 2019-09-20 2023-10-11 Jingdong Technology Information Technology Co., Ltd. Method and device for synchronizing node data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1780201A (en) * 2004-11-17 2006-05-31 中兴通讯股份有限公司 Method for realizing synchronous information between multiple nodes
CN103237075A (en) * 2013-04-24 2013-08-07 广州市动景计算机科技有限公司 Data synchronizing method, device and system
CN106302642A (en) * 2016-07-27 2017-01-04 乐视控股(北京)有限公司 A kind of method and apparatus of synchrodata
CN107317842A (en) * 2017-05-31 2017-11-03 北京大学深圳研究生院 Block chain synchronous method and device based on NDN
US20180198626A1 (en) * 2015-02-27 2018-07-12 Guardtime Ip Holdings Limited Blockchain-supported, fail-safe synchronization in a data authentication infrastructure

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1780201A (en) * 2004-11-17 2006-05-31 中兴通讯股份有限公司 Method for realizing synchronous information between multiple nodes
CN103237075A (en) * 2013-04-24 2013-08-07 广州市动景计算机科技有限公司 Data synchronizing method, device and system
US20180198626A1 (en) * 2015-02-27 2018-07-12 Guardtime Ip Holdings Limited Blockchain-supported, fail-safe synchronization in a data authentication infrastructure
CN106302642A (en) * 2016-07-27 2017-01-04 乐视控股(北京)有限公司 A kind of method and apparatus of synchrodata
CN107317842A (en) * 2017-05-31 2017-11-03 北京大学深圳研究生院 Block chain synchronous method and device based on NDN

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109992624B (en) * 2019-03-15 2024-03-22 深圳前海微众银行股份有限公司 Synchronous storage method and device for Block chain and computer equipment
CN109992624A (en) * 2019-03-15 2019-07-09 深圳前海微众银行股份有限公司 A kind of synchronous storage method, device and the computer equipment of block chain Block chain
CN110008206A (en) * 2019-03-22 2019-07-12 深圳前海微众银行股份有限公司 A kind of data processing method and device based on block catenary system
CN110008206B (en) * 2019-03-22 2024-07-16 深圳前海微众银行股份有限公司 Data processing method and device based on block chain system
CN110113408A (en) * 2019-04-30 2019-08-09 杭州复杂美科技有限公司 A kind of block synchronous method, equipment and storage medium
CN110309173B (en) * 2019-06-14 2021-08-13 达闼机器人有限公司 Contract data recording method and device, block chain node and storage medium
CN110309173A (en) * 2019-06-14 2019-10-08 深圳前海达闼云端智能科技有限公司 Contract data recording method and device, block chain node and storage medium
EP4033374A4 (en) * 2019-09-20 2023-10-11 Jingdong Technology Information Technology Co., Ltd. Method and device for synchronizing node data
US12019652B2 (en) 2019-09-20 2024-06-25 Jingdong Technology Information Technology Co., Ltd. Method and device for synchronizing node data
CN111062811A (en) * 2019-12-02 2020-04-24 远光软件股份有限公司 Block chain consensus method, system and storage medium
CN111062811B (en) * 2019-12-02 2024-01-12 远光软件股份有限公司 Block chain consensus method, system and storage medium
CN110910883A (en) * 2019-12-03 2020-03-24 杭州龙纪科技有限公司 Method for acquiring block chain height based on intelligent sound box
CN110910883B (en) * 2019-12-03 2022-08-30 杭州龙纪科技有限公司 Method for acquiring block chain height based on intelligent sound box
CN111078790B (en) * 2019-12-04 2022-05-24 福州博泉网络科技有限公司 Method and system for synchronizing isolated block data in block chain and storage medium
CN111078790A (en) * 2019-12-04 2020-04-28 福州博泉网络科技有限公司 Method and system for synchronizing isolated block data in block chain and storage medium
CN111078700A (en) * 2019-12-13 2020-04-28 山东众阳健康科技集团有限公司 Data synchronization method and system based on block chain
US11899689B2 (en) 2020-04-09 2024-02-13 Tencent Technology (Shenzhen) Company Limited Blockchain-based data synchronization method, apparatus, and computer-readable storage medium
CN111475575A (en) * 2020-04-09 2020-07-31 腾讯科技(深圳)有限公司 Data synchronization method and device based on block chain and computer readable storage medium
CN112003701B (en) * 2020-04-16 2021-03-19 成都质数斯达克科技有限公司 Block self-checking and synchronizing method and device
CN112003701A (en) * 2020-04-16 2020-11-27 成都质数斯达克科技有限公司 Block self-checking and synchronizing method and device
WO2021114627A1 (en) * 2020-05-28 2021-06-17 平安科技(深圳)有限公司 Distributed transaction-based data processing method, device, terminal, and storage medium
CN111694852A (en) * 2020-05-28 2020-09-22 平安科技(深圳)有限公司 Data processing method, device, terminal and storage medium based on distributed transaction
CN112163004A (en) * 2020-10-14 2021-01-01 上海万向区块链股份公司 List processing and updating display system and method based on multi-chain data fusion
CN113326165B (en) * 2021-08-04 2021-11-16 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and computer readable storage medium
CN113326165A (en) * 2021-08-04 2021-08-31 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and computer readable storage medium
WO2023011022A1 (en) * 2021-08-04 2023-02-09 腾讯科技(深圳)有限公司 Blockchain-based data processing method, and device and computer-readable storage medium
CN114422526A (en) * 2021-12-31 2022-04-29 支付宝(杭州)信息技术有限公司 Block synchronization method and device, electronic equipment and storage medium
CN114422526B (en) * 2021-12-31 2024-03-15 支付宝(杭州)信息技术有限公司 Block synchronization method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109165229B (en) 2020-06-05

Similar Documents

Publication Publication Date Title
CN109165229A (en) Local the block synchronous method of inspection, device, equipment and storage medium
CN100461708C (en) Alarm synchronization method
CN106610854A (en) Model update method and device
CN103595807A (en) Data synchronous updating method and device
CN105635066B (en) A kind of management method and device of client application
CN108965003A (en) A kind of dispositions method of distributed type assemblies, device, system and storage medium
CN109152005A (en) A kind of uplink beam indicating means, UE, base station and storage medium
CN105635017B (en) A kind of transmission method and equipment of targeting signal
CN108508477B (en) Seismic data acquisition system and method
CN109062786A (en) Operation method, device and the terminal of test case
CN102857333B (en) Device and method for synchronizing data packet from sensor network
CN106055697A (en) Unstructured event log data classification and storage method and device
CN106844233A (en) A kind of router service data caching method and system based on Hash table
CN109062820A (en) A kind of software performance testing method and device
CN109802735A (en) The measurement method and device of Radio Link, terminal, base station, storage medium
CN104639399B (en) More primary time server detection methods and device
CN106202461B (en) A kind of synchronous method and device
CN113596107A (en) Data synchronization method and device based on block chain
CN116915791A (en) Block chain transaction conflict detection method, sequencing node and endorsement node
CN104468569B (en) The integrality detection method and device of distributed data
CN108243208A (en) A kind of method of data synchronization and device
CN110429558A (en) A kind of three-phase recording, which synchronizes, looks for point methods, device and equipment
CN110161552A (en) A kind of data processing method of detector, device and equipment
CN116405552A (en) Segmented pushing method and system in low-power-consumption network
CN109005246A (en) A kind of synchronous method of data, apparatus and system

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Applicant after: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone, 100176

Applicant before: BEIJING JINGDONG FINANCIAL TECHNOLOGY HOLDING Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee before: Jingdong Digital Technology Holding Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Patentee before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.