CN110516006A - Parallel chain block generation method, equipment and storage medium - Google Patents

Parallel chain block generation method, equipment and storage medium Download PDF

Info

Publication number
CN110516006A
CN110516006A CN201910788998.9A CN201910788998A CN110516006A CN 110516006 A CN110516006 A CN 110516006A CN 201910788998 A CN201910788998 A CN 201910788998A CN 110516006 A CN110516006 A CN 110516006A
Authority
CN
China
Prior art keywords
block
chain block
parallel chain
interim
parallel
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
CN201910788998.9A
Other languages
Chinese (zh)
Other versions
CN110516006B (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.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology 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 Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201910788998.9A priority Critical patent/CN110516006B/en
Publication of CN110516006A publication Critical patent/CN110516006A/en
Application granted granted Critical
Publication of CN110516006B publication Critical patent/CN110516006B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The present invention provides a kind of parallel chain block generation method, equipment and storage medium, this method includes, it is parallel to execute following two step: to receive the first block data of the first main chain block that main chain node is sent, interim parallel chain block queue is updated according to the first block data and is stored in local data base;Wherein, the first block data includes the first block head information of the first main chain block, and the first block head information includes first father's Hash of the first main chain block;The interim parallel chain block of interim parallel chain block queue is read from local data base to generate parallel chain block and execute.The application strengthens flexibility, scalability and the robustness of block catenary system.

Description

Parallel chain block generation method, equipment and storage medium
Technical field
This application involves block chain technical fields, and in particular to a kind of parallel chain block generation method, equipment and storage are situated between Matter.
Background technique
(the applied every parallel chain patent text of applicant is specifically referred in the parallel chain mechanism that applicant is proposed This) in, the execution that parallel chain node must be serial receives block data and executes parallel chain block, that is, parallel chain receives one After the block data of a main chain block (assuming that the parallel chain that the main chain block includes current parallel chain is traded), screening is current parallel The parallel chain transaction of chain generates parallel chain block, after executing parallel chain block generated, then receives next main chain block Block data so recycles.
In the scene of the parallel chain node processing main chain bifurcated rollback of above-mentioned mechanism, current main chain-parallel chain mechanism, Parallel chain node needs the rollback scene of reproduction main chain node completely, and block catenary system is inflexible, is not easy to extend.
Summary of the invention
In view of drawbacks described above in the prior art or deficiency, a kind of be intended to provide strong flexibility, be easy to extend parallel chain Block generation method, equipment and storage medium.
In a first aspect, the present invention provides a kind of parallel chain block generation method suitable for parallel chain node, the above method Including parallel to execute following two step:
The first block data for receiving the first main chain block that main chain node is sent updates interim according to the first block data The queue of parallel chain block is simultaneously stored in local data base;Wherein, the first block data includes the first block head of the first main chain block Information, the first block head information include first father's Hash of the first main chain block;
The interim parallel chain block of interim parallel chain block queue is read from local data base to generate parallel chain block simultaneously It executes.
Second aspect, the present invention also provides a kind of equipment, including one or more processors and memory, wherein memory Comprising can by instruction that the one or more processors execute so that the one or more processors execute it is each according to the present invention The parallel chain block generation method that embodiment provides.
The third aspect, the present invention also provides a kind of storage medium for being stored with computer program, which makes to count Calculation machine executes the parallel chain block generation method that each embodiment provides according to the present invention.
Parallel chain block generation method, equipment and the storage medium that many embodiments of the present invention provide by execute parallel with Lower two steps: receiving the first block data of the first main chain block that main chain node is sent, and is updated according to the first block data Interim parallel chain block queue is simultaneously stored in local data base;Wherein, the first block data includes the firstth area of the first main chain block Build information, the first block head information include first father's Hash of the first main chain block;It is read from local data base interim parallel The interim parallel chain block of chain block queue strengthens the flexible of block catenary system in the method for generating parallel chain block and executing Property, scalability and robustness;
Parallel chain block generation method, equipment and the storage medium that some embodiments of the invention provide further pass through acquisition First parallel chain block height of current parallel chain;Judge the remainder of the first threshold of the first parallel chain block height and pre-configuration Whether it is 0: is, then the difference for calculating the first threshold of the first parallel chain block height and pre-configuration obtains the second parallel chain block height Degree;And the method for deleting the interim parallel chain block in interim parallel chain block queue before the second parallel chain block height, The interim parallel chain block in part in local data base is deleted, the search efficiency of local data base is improved.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is a kind of flow chart for parallel chain block generation method that one embodiment of the invention provides.
Fig. 2 is the flow chart of step S12 in a kind of preferred embodiment of method shown in Fig. 1.
Fig. 3 is a kind of flow chart of preferred embodiment of method shown in Fig. 1.
Fig. 4 is the flow chart of step S12 in another preferred embodiment of method shown in Fig. 1.
Fig. 5 is the flow chart of step S13 in a kind of preferred embodiment of method shown in Fig. 1.
Fig. 6 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is a kind of flow chart for parallel chain block generation method that one embodiment of the invention provides.As shown in Figure 1, In In the present embodiment, the present invention provides a kind of parallel chain block generation method suitable for parallel chain node, and the above method includes, and Row executes following two step:
S12: receiving the first block data of the first main chain block that main chain node is sent, and is updated according to the first block data Interim parallel chain block queue is simultaneously stored in local data base;Wherein, the first block data includes the firstth area of the first main chain block Build information, the first block head information include first father's Hash of the first main chain block;
S13: the interim parallel chain block of interim parallel chain block queue is read to generate parallel sequence from local data base Block simultaneously executes.
(the applied every parallel chain patent text of applicant is specifically referred in the parallel chain mechanism that applicant is proposed This) in, parallel chain receives the area of a main chain block (assuming that the parallel chain that the main chain block includes current parallel chain is traded) For block number after, the parallel chain transaction for screening current parallel chain generates parallel chain block, after executing parallel chain block generated, then Receive next main chain block.
The reasons why originally applicant designs in this way is that the execution that parallel chain node must be serial receives block data and execution Parallel chain block (assuming that there are the transaction of the parallel chain of the affiliated parallel chain of parallel chain node in each main chain block), that is, parallel The block data for the main chain block (block (100)) that chain node must be first 100 according to block height generates parallel chain block simultaneously It executes, generate parallel chain block further according to block height for the block data of 101 main chain block (block (101)) and executes;
If parallel chain node first reads block (101), parallel sequence is generated according to the block data of block (101) Block simultaneously executes, and the parallel chain that will lead to parallel chain node generation in this way is different from the parallel chain that other parallel chain nodes generate; Parallel chain to guarantee different parallel chain nodes generations is identical, even if the parallel chain node first reads block (101), also only Can in completion " first generate parallel chain block according to the block data of block (100) and execute " after step, then execute " according to The block data of block (101) generates parallel chain block and executes " step;In this case, it is designed to execute parallel not only Cpu resource utilization will not be improved, also will cause the problem of wasting space goes to storage (101) block;
In view of the scene of parallel chain node processing main chain bifurcated rollback, current main chain-parallel chain mechanism, parallel chain link Point needs the rollback scene of reproduction main chain node completely, that is, main chain node generates block (100), generates block (101), returns It rolls block (101), generates block (101) ';Parallel chain node also will generate parallel chain block according to block (100), according to Block (101) generates parallel chain block, the corresponding parallel chain block generated of rollback block (101), according to block (101) ' Generate parallel chain block;
Applicant it is considered that if parallel chain node execute according to block (100) generate parallel chain block when, master link Point has executed " generating block (101), rollback block (101), generate block (101) ' " step, at this point, parallel chain link Rollback scene of the point without reproduction main chain node completely, directly generates parallel chain block, such mechanism according to block (101) ' More flexible and expansible, therefore, applicant provide the parallel chain block generation methods of the application executed parallel.
Specifically, thread one and thread two execute parallel;
Step S12 is executed in thread one, parallel chain node receives the first of the first main chain block that main chain node is sent Block data updates interim parallel chain block queue according to the first block data and is stored in local data base;Wherein, the first block Data include the first block head information of the first main chain block, and the first block head information includes that the first father of the first main chain block breathes out It is uncommon;
Step S13 is executed in thread two, parallel chain node reads interim parallel chain block queue from local data base Interim parallel chain block is to generate parallel chain block and execute.
In more embodiments, interim parallel chain block queue can also be stored in memory, improve parallel chain node From the reading efficiency of the interim parallel chain block read in memory in interim parallel chain block queue, still, interim parallel sequence Block queue still needs deposit local data base to lose internal storage data to prevent delay machine.
Above-described embodiment strengthens flexibility, robustness and the scalability of block catenary system.
Fig. 2 is the flow chart of step S12 in a kind of preferred embodiment of method shown in Fig. 1.As shown in Fig. 2, excellent one It selects in embodiment, step S12 includes:
S120: the first block data of the first main chain block that main chain node is sent is received, is judged in the first block data Whether the parallel chain comprising current parallel chain is traded:
It is to then follow the steps S121: the first interim parallel chain block is generated according to the first block data, it is interim according to first Parallel chain block and the interim parallel chain block queue of the first block head information update are simultaneously stored in local data base;
It is no, it thens follow the steps S122: according to the interim parallel chain block queue of the first block head information update and being stored in local Database.
First block data of above-described embodiment includes the All Activity of the first main chain block, therefore parallel chain node is connecing When receiving the first block data of the first main chain block that main chain node is sent, need by judging whether wrap in the first block data Parallel chain transaction containing current parallel chain is traded to filter out the parallel chain of current parallel chain;
In more embodiments, the parallel chain transaction of current parallel chain can also be filtered out at the very start by main chain node Come and is sent to current parallel chain node (that is, the first block data includes the parallel chain of current parallel chain in the first main chain block Transaction, and if do not have in the first main chain block current parallel chain parallel chain trade, the first block data be sky), at this point, in parallel Chain node need to only judge whether the first block data is empty: it is no, then the first interim parallel sequence is generated according to the first block data Block according to the first interim parallel chain block and the interim parallel chain block queue of the first block head information update and is stored in local data Library;It is then according to the interim parallel chain block queue of the first block head information update and to be stored in local data base;It can be achieved identical Technical effect.
Fig. 3 is a kind of flow chart of preferred embodiment of method shown in Fig. 1.As shown in figure 3, in a preferred embodiment In, the above method further include:
S14: the first parallel chain block height of current parallel chain is obtained;
S15: whether the remainder for judging the first threshold of the first parallel chain block height and pre-configuration is 0:
Be to then follow the steps S16: the difference for calculating the first threshold of the first parallel chain block height and pre-configuration obtains second Parallel chain block height;And
S17: the interim parallel chain block in interim parallel chain block queue before the second parallel chain block height is deleted.
Specifically, it is assumed that first threshold 1000, the first parallel chain block height of current parallel chain are 3000;
In step S14, parallel chain node obtains the first parallel chain block height of current parallel chain;
In step S15, parallel chain node judges the remainder of the first threshold of the first parallel chain block height and pre-configuration Whether it is 0:
Since the first parallel chain block height is 3000, the remainder that the first threshold of pre-configuration is 1000,3000 and 1000 Be 0, then follow the steps S16: the difference that parallel chain node calculates the first threshold of the first parallel chain block height and pre-configuration obtains Second parallel chain block height, that is, the second parallel chain block height is 2000;And
In step S17, facing before block height is 2000 in the interim parallel chain block queue of parallel chain knot removal When parallel chain block.
In more embodiments, other numerical value can also be configured by first threshold according to actual needs, for example, being configured to 500, it can be achieved that identical technical effect.
In more embodiments, other numerical value can also be configured by remainder according to actual needs, for example, it is configured to 1, That is, it is judged that whether the remainder of the first parallel chain block height and the first threshold of pre-configuration is 1, it can be achieved that identical technology is imitated Fruit.
In more embodiments, it can also configure according to actual needs and delete older interim parallel chain in local data base The method of block is, it can be achieved that identical technical effect.Such as it is configured that the first parallel chain block for obtaining current parallel chain is high Degree;The second parallel chain block height is calculated according to the first parallel chain block height and the first threshold of pre-configuration;It deletes interim flat All interim parallel chain blocks in row chain block queue before the second parallel chain block height.
The memory space of local data base can be saved by deleting older interim parallel chain block in local data base, but Parallel chain node switches connected main chain node, the area of the newest parallel chain block of parallel chain node by load-balanced server The difference of the block height of newest interim parallel chain block is super in the interim parallel chain block queue of block height and new main chain node It crosses under the scene of first threshold;Or, parallel chain node can not in the case where main chain rollback is more than the scene of first threshold quantity block Interim parallel chain block is read from interim parallel chain block queue to generate parallel chain block.At this point, parallel chain node is forward Main chain block is traversed, until finding third main chain block;Wherein, the third father Hash of third main chain block and interim parallel chain The block Hash of the corresponding main chain block of the interim parallel chain block of third in block queue is identical, and parallel chain knot removal is interim All interim parallel chain blocks in parallel chain block queue after the interim parallel chain block of third;And according to third main chain area The block data of block updates interim parallel chain block queue, and is stored in local data base.
Above-described embodiment deletes the interim parallel chain block in part in local data base, improves the inquiry effect of local data base Rate.
Fig. 4 is the flow chart of step S12 in another preferred embodiment of method shown in Fig. 1.As shown in figure 4, another In one preferred embodiment, step S12 includes:
S123: the first block data of the first main chain block that main chain node is sent is received;
S124: the block for verifying the corresponding main chain block of newest interim parallel chain block in interim parallel chain block queue is breathed out It is uncommon whether identical as first father's Hash:
It is: thens follow the steps S125: interim parallel chain block is generated to update interim parallel chain according to the first block data Block queue is simultaneously stored in local data base;
It is no, it thens follow the steps S126: traversing main chain block forward, until finding the second main chain block;Wherein, second is main Second father's Hash of chain block main chain block corresponding with the second interim parallel chain block in interim parallel chain block queue Block Hash is identical;And
S127: all interim parallel sequences in interim parallel chain block queue after the second interim parallel chain block are deleted Block;And
S128: interim parallel chain block queue is updated according to the block data of the second main chain block, and is stored in local data Library.
Assuming that there is the first application scenarios, the first application scenarios are as follows:
When the main chain node A delay machine that parallel chain node a is connected, a is connected to new master by load-balanced server Chain node B, at this point, the corresponding main chain block of newest interim parallel chain block in the interim parallel chain block queue of parallel chain node Block Hash blockhash (100) may be with first father's Hash parenthash of the first main chain block of new main chain node (101) ' different;If a directly updates interim parallel chain block team according to the first block data of the first main chain block of B at this time Column, then the parallel chain block queue error updated;
The problem that for the first application scenarios, can be solved by step S123 to step S128;
Assuming that blockhash (100) is identical as parenthash (101) ':
In step S123, a receives the first block data of the first main chain block that B is sent;
In step S124, a verifies the corresponding main chain area of newest interim parallel chain block in interim parallel chain block queue Whether the block Hash blockhash (100) of block and first father's Hash parenthash (101) ' are identical:
Since blockhash (100) is identical as parenthash (101) ', S125 is thened follow the steps, a is according to the first block Data generate interim parallel chain block to update interim parallel chain block queue and be stored in local data base;
Assuming that blockhash (100) is different from parenthash (101) ':
In step S123, a receives the first block data of the first main chain block that B is sent;
In step S124, a verifies the corresponding main chain area of newest interim parallel chain block in interim parallel chain block queue Whether the block Hash blockhash (100) of block and first father's Hash parenthash (101) ' are identical:
Since blockhash (100) is different from parenthash (101) ', S126 is thened follow the steps, a traverses forward main chain Block, until finding the second main chain block;Wherein, second father's Hash of the second main chain block and interim parallel chain block queue In the corresponding main chain block of the second interim parallel chain block block Hash it is identical;And
In step S127, a deletes all interim after the second interim parallel chain block in interim parallel chain block queue Parallel chain block;And
In step S128, a updates interim parallel chain block queue according to the block data of the second main chain block, and is stored in Local data base.
Fig. 5 is the flow chart of step S13 in a kind of preferred embodiment of method shown in Fig. 1.As shown in figure 5, excellent one It selects in embodiment, step S13 includes:
S132: the third father Hash for verifying the interim parallel chain block of read third is newest parallel with current parallel chain Whether the block Hash of chain block is identical:
It is to then follow the steps S133: parallel chain block is generated according to the interim parallel chain block of third and is executed;
It is no, it thens follow the steps S134: traversing the interim parallel chain block in interim parallel chain block queue forward, until looking for To the 4th interim parallel chain block;Wherein, father's Hash of the 4th interim parallel chain block is parallel with first in current parallel chain The block Hash of chain block is identical;And
S135: it deletes according to all parallel chain blocks after the first parallel chain block;And
S136: parallel chain block is generated according to the 4th interim parallel chain block and is executed.
Assuming that there is the second application scenarios, the second application scenarios are as follows:
Parallel chain node a reads the interim parallel chain block of interim parallel chain block queue from local data base, when a is read Third father's Hash parenthash (21_ put down _ faces) of the interim parallel chain block of the third taken is newest parallel with current parallel chain When the block Hash blockhash (20_ is flat) of chain block is not identical, if directly being generated according to the interim parallel chain block of third parallel Chain block, then the parallel chain block error generated;
The problem that for the second application scenarios, can be solved by step S132 to step S136;
Assuming that parenthash (21_ put down _ faces) is identical as blockhash (20_ is flat);
In step S132, a verifies third father's Hash parenthash of the interim parallel chain block of read third Whether (21_ put down _ faces) be identical as the block Hash blockhash (20_ is flat) of the newest parallel chain block of current parallel chain:
Since parenthash (21_ put down _ faces) and blockhash (20_ is flat) is identical, S133 is thened follow the steps: according to the Three interim parallel chain blocks generate parallel chain block and execute;
Assuming that parenthash (21_ put down _ faces) is different from blockhash (20_ is flat);
In step S132, a verifies third father's Hash parenthash of the interim parallel chain block of read third Whether (21_ put down _ faces) be identical as the block Hash blockhash (20_ is flat) of the newest parallel chain block of current parallel chain:
Since parenthash (21_ put down _ faces) and blockhash (20_ is flat) is different, S134:a is thened follow the steps forward time The interim parallel chain block in interim parallel chain block queue is gone through, until finding the 4th interim parallel chain block;Wherein, the 4th faces When parallel chain block father's Hash it is identical as the block Hash of the first parallel chain block in current parallel chain;And
In step S135, a is deleted according to all parallel chain blocks after the first parallel chain block;
And
In step S136, a generates parallel chain block according to the 4th interim parallel chain block and executes.
Fig. 6 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
As shown in fig. 6, present invention also provides a kind of equipment 600, including one or more centres as on the other hand Unit (CPU) 601 is managed, can be added according to the program being stored in read-only memory (ROM) 602 or from storage section 608 The program that is downloaded in random access storage device (RAM) 603 and execute various movements appropriate and processing.In RAM603, also deposit It contains equipment 600 and operates required various programs and data.CPU601, ROM602 and RAM603 pass through the phase each other of bus 604 Even.Input/output (I/O) interface 605 is also connected to bus 604.
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.; And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 605 as needed.Detachable media 611, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon Computer program be mounted into storage section 608 as needed.
Particularly, in accordance with an embodiment of the present disclosure, the parallel chain block generation method of any of the above-described embodiment description can be with It is implemented as computer software programs.For example, embodiment of the disclosure includes a kind of computer program product comprising visibly Comprising computer program on a machine-readable medium, the computer program includes for executing parallel chain block generation method Program code.In such embodiments, which can be downloaded and be pacified from network by communications portion 609 Dress, and/or be mounted from detachable media 611.
As another aspect, present invention also provides a kind of computer readable storage medium, the computer-readable storage mediums Matter can be computer readable storage medium included in the device of above-described embodiment;It is also possible to individualism, it is unassembled Enter the computer readable storage medium in equipment.Computer-readable recording medium storage has one or more than one program, should Program is used to execute the parallel chain block generation method for being described in the application by one or more than one processor.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depending on related function.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yitong The dedicated hardware based system of functions or operations as defined in executing is crossed to realize, or by specialized hardware and can be calculated The combination of machine instruction is realized.
Being described in the embodiment of the present application involved unit or module can be realized by way of software, can also be with It is realized by way of hardware.Described unit or module also can be set in the processor, for example, each unit can To be the software program being arranged in computer or intelligent movable equipment, it is also possible to the hardware device being separately configured.Wherein, this The title of a little units or module does not constitute the restriction to the unit or module itself under certain conditions.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from the application design, appointed by above-mentioned technical characteristic or its equivalent feature Other technical solutions of meaning combination and formation.Such as features described above and (but being not limited to) disclosed herein have similar functions Technical characteristic replaced mutually and the technical solution that is formed.

Claims (7)

1. a kind of parallel chain block generation method, which is characterized in that be suitable for parallel chain node, the method includes holding parallel Row following two step:
The first block data for receiving the first main chain block that main chain node is sent updates interim according to first block data The queue of parallel chain block is simultaneously stored in local data base;Wherein, first block data includes the of the first main chain block One block head information, the first block head information include first father's Hash of the first main chain block;
The interim parallel chain block of the interim parallel chain block queue is read from the local data base to generate parallel sequence Block simultaneously executes.
2. the method according to claim 1, wherein the first main chain block for receiving main chain node and sending First block data, updates interim parallel chain block queue and is stored in local data base and include: according to first block data
The first block data for receiving the first main chain block that main chain node is sent, judges whether wrap in first block data Parallel chain transaction containing current parallel chain:
It is the first interim parallel chain block then to be generated according to first block data, according to the described first interim parallel sequence Block and the interim parallel chain block queue of the first block head information update are simultaneously stored in local data base;
It is no, then according to the interim parallel chain block queue of the first block head information update and it is stored in local data base.
3. method according to claim 1 or 2, which is characterized in that further include:
Obtain the first parallel chain block height of current parallel chain;
Whether the remainder for judging the first threshold of the first parallel chain block height and pre-configuration is 0:
It is difference acquisition the second parallel chain block height for the first threshold for then calculating the first parallel chain block height and pre-configuration Degree;And
Delete the interim parallel chain block before the second parallel chain block height described in the interim parallel chain block queue.
4. the method according to claim 1, wherein described interim parallel according to first block data update The queue of chain block is simultaneously stored in local data base and includes:
Verify the block Hash of the corresponding main chain block of newest interim parallel chain block in the interim parallel chain block queue with Whether the first father Hash is identical:
It is: interim parallel chain block is then generated to update interim parallel chain block queue and be stored according to first block data Local data base;
It is no, then main chain block is traversed forward, until finding the second main chain block;Wherein, the second of the second main chain block The block Hash of father's Hash main chain block corresponding with the second interim parallel chain block in the interim parallel chain block queue It is identical;And
All interim parallel chain blocks after deleting the second interim parallel chain block described in the interim parallel chain block queue; And
Interim parallel chain block queue is updated according to the block data of the second main chain block, and is stored in local data base.
5. the method according to claim 1, wherein described described interim parallel from local data base reading The interim parallel chain block of chain block queue with generate parallel chain block and execute include:
Verify the third father Hash of the interim parallel chain block of read third and the newest parallel chain block of current parallel chain Whether block Hash is identical:
It is, then parallel chain block is generated according to the interim parallel chain block of the third and executes;
It is no, then the interim parallel chain block in the interim parallel chain block queue is traversed forward, until it is interim flat to find the 4th Row chain block;Wherein, father's Hash of the described 4th interim parallel chain block and the first parallel chain block in current parallel chain Block Hash is identical;And
It deletes according to all parallel chain blocks after the first parallel chain block;And
Parallel chain block is generated according to the described 4th interim parallel chain block and is executed.
6. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Memory, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors Execute method according to any one of claims 1 to 5.
7. a kind of storage medium for being stored with computer program, which is characterized in that realize when the program is executed by processor as weighed Benefit requires method described in any one of 1-5.
CN201910788998.9A 2019-08-26 2019-08-26 Parallel chain block generation method, device and storage medium Active CN110516006B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910788998.9A CN110516006B (en) 2019-08-26 2019-08-26 Parallel chain block generation method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910788998.9A CN110516006B (en) 2019-08-26 2019-08-26 Parallel chain block generation method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110516006A true CN110516006A (en) 2019-11-29
CN110516006B CN110516006B (en) 2021-10-01

Family

ID=68626781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910788998.9A Active CN110516006B (en) 2019-08-26 2019-08-26 Parallel chain block generation method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110516006B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111475572A (en) * 2020-04-02 2020-07-31 百度国际科技(深圳)有限公司 Block generation method, device, equipment and medium
CN111796845A (en) * 2020-07-03 2020-10-20 杭州复杂美科技有限公司 Database upgrading method, state data query method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109410045A (en) * 2018-08-30 2019-03-01 杭州复杂美科技有限公司 A kind of parallel chain common recognition method, equipment and storage medium
US20190081793A1 (en) * 2017-09-12 2019-03-14 Kadena, LLC Parallel-chain architecture for blockchain systems
CN109587271A (en) * 2018-12-29 2019-04-05 杭州复杂美科技有限公司 Main chain parallel chain architecture system and block synchronous method, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190081793A1 (en) * 2017-09-12 2019-03-14 Kadena, LLC Parallel-chain architecture for blockchain systems
CN109410045A (en) * 2018-08-30 2019-03-01 杭州复杂美科技有限公司 A kind of parallel chain common recognition method, equipment and storage medium
CN109587271A (en) * 2018-12-29 2019-04-05 杭州复杂美科技有限公司 Main chain parallel chain architecture system and block synchronous method, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WEIXIN_43829193: "多链架构设计必读:平行链节点如何快速发现主链数据被篡改?", 《HTTPS://BLOG.CSDN.NET/WEIXIN_43829193/ARTICLE/DETAILS/93378447》 *
ZCSMY4: "什么是平行链,和主链之间又有什么关系?", 《HTTPS://WWW.CHAINNODE.COM/POST/250884》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111475572A (en) * 2020-04-02 2020-07-31 百度国际科技(深圳)有限公司 Block generation method, device, equipment and medium
CN111475572B (en) * 2020-04-02 2023-08-29 百度国际科技(深圳)有限公司 Block generation method, device, equipment and medium
CN111796845A (en) * 2020-07-03 2020-10-20 杭州复杂美科技有限公司 Database upgrading method, state data query method, device and storage medium
CN111796845B (en) * 2020-07-03 2022-05-24 杭州复杂美科技有限公司 Database upgrading method, state data query method, device and storage medium

Also Published As

Publication number Publication date
CN110516006B (en) 2021-10-01

Similar Documents

Publication Publication Date Title
CN109359222A (en) Date storage method and system, equipment and storage medium
CN109408551A (en) Data query method and system, common recognition method and system, equipment and storage medium
US9189270B2 (en) Realizing jumps in an executing process instance
EP2593881B1 (en) Sharing and deconflicting data changes in a multimaster database system
CN110392121A (en) Parallel chain block generation method, equipment and storage medium
CN109684333A (en) A kind of storage of data and method of cutting out, equipment and storage medium
CN110517140B (en) Block chain intelligent contract transaction concurrent execution method
CN109410045A (en) A kind of parallel chain common recognition method, equipment and storage medium
CN110287170A (en) Database upgrade method, status data call method, equipment and storage medium
CN109559234A (en) A kind of storage method, equipment and the storage medium of block chain status data
US11481440B2 (en) System and method for processing metadata to determine an object sequence
US9647927B2 (en) Computer-implemented K-shortest path finding method
CN110837505A (en) State data storage method, state data synchronization device and storage medium
CN110516006A (en) Parallel chain block generation method, equipment and storage medium
CN104809025A (en) Method and device for enabling programs to be online
US20230058148A1 (en) Detection and resolution of data synchronization conflicts
CN110599166A (en) Method and device for acquiring transaction dependency relationship in block chain
US11221943B2 (en) Creating an intelligent testing queue for improved quality assurance testing of microservices
CN112948039A (en) Page display method, device, equipment and storage medium
CN106708842A (en) Data loading method for application system, database and application system
CN111339191A (en) Data storage method, device, equipment and medium of block chain
CN112348420A (en) Storage position information acquisition method and system, storage medium and electronic equipment
CN110210972A (en) Common recognition transaction sending method, equipment and storage medium
CN109614411A (en) Date storage method, equipment and storage medium
CN111737369A (en) Relationship map updating method and device and storage medium

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
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20191129

Assignee: Hangzhou DUOLIAN Technology Co.,Ltd.

Assignor: HANGZHOU FUZAMEI TECHNOLOGY Co.,Ltd.

Contract record no.: X2022330000090

Denomination of invention: Parallel chain block generation method, device and storage medium

Granted publication date: 20211001

License type: Common License

Record date: 20220516

Application publication date: 20191129

Assignee: Hangzhou Kulian Technology Co.,Ltd.

Assignor: HANGZHOU FUZAMEI TECHNOLOGY Co.,Ltd.

Contract record no.: X2022330000091

Denomination of invention: Parallel chain block generation method, device and storage medium

Granted publication date: 20211001

License type: Common License

Record date: 20220516

Application publication date: 20191129

Assignee: Hangzhou left chain Technology Co.,Ltd.

Assignor: HANGZHOU FUZAMEI TECHNOLOGY Co.,Ltd.

Contract record no.: X2022330000092

Denomination of invention: Parallel chain block generation method, device and storage medium

Granted publication date: 20211001

License type: Common License

Record date: 20220516