CN110457123A - A kind of control method and device of block processes task - Google Patents

A kind of control method and device of block processes task Download PDF

Info

Publication number
CN110457123A
CN110457123A CN201910711607.3A CN201910711607A CN110457123A CN 110457123 A CN110457123 A CN 110457123A CN 201910711607 A CN201910711607 A CN 201910711607A CN 110457123 A CN110457123 A CN 110457123A
Authority
CN
China
Prior art keywords
block
subtask
execution module
task
currently pending
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
CN201910711607.3A
Other languages
Chinese (zh)
Other versions
CN110457123B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910711607.3A priority Critical patent/CN110457123B/en
Publication of CN110457123A publication Critical patent/CN110457123A/en
Application granted granted Critical
Publication of CN110457123B publication Critical patent/CN110457123B/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/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • 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/2365Ensuring data consistency and integrity
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The invention discloses the control methods and device of a kind of block processes task, belong to block chain technical field, in method and device provided by the invention, by the way that block processes task is divided into continuous multistep treatment subtask, and the execution module of at least one corresponding level is configured for every coagulation subtask, and after each non-most end level-one execution module handles subtask to currently pending onblock executing the same level, the block processes task of currently pending block is added in the intermediate task queue configured between next stage execution module, after each non-first order execution module handles subtask to currently pending onblock executing the same level, using the corresponding block of being extracted in intermediate task queue for task as next block to be processed, processing result is synchronized in database by most end level-one execution module, it is multiple to be processed to realize parallel processing The block processes task of block, and then accelerate the processing speed of block processes task between block.

Description

A kind of control method and device of block processes task
The present patent application be the applying date be on 09 13rd, 2018, it is entitled application No. is 201811069813.0 The divisional application of the patent application of " a kind of control method and device of block processes task ".
Technical field
The present invention relates to block chain technical field more particularly to a kind of control methods and device of block processes task.
Background technique
The problem of the generally existing transaction performance difference of current block chain technology, lower performance are unable to satisfy in reality scene Application demand.Performance issue is mainly reflected in two aspects: (1) process complexity of knowing together is tediously long;(2) chained record serial process Efficiency is lower.
Block chain, such as super account book (Hyperledger could be added in user in alliance's chain only by license Fabric), common recognition process is simpler with respect to the publicly-owned chain such as bit coin and ether mill efficiently, therefore in the alliances such as Fabric chain The low efficiency problem of middle chained record serial process shows especially prominent.In block chain technology, due to the chain type between block according to Rely, the mode that the prior art is executed during handling the submission of block using single-threaded serial, it may be assumed that multiple areas on a chain The submission of block must comply with stringent sequence, and the latter block has to wait for submit after the completion of previous block is submitted, together When the latter area must link previous block fastly and form orderly chain, whole process serially executes.However this serial process Mode obviously cannot give full play to the multicore performance of modern central processing unit (CPU), and block submits process, and time-consuming, and transaction is handled up Rate is low, the application demand being unable to satisfy in reality scene.
Therefore, how to accelerate the treatment process of block submission, the treatment effeciency for improving block processes task is overriding concern One of the problem of.
Summary of the invention
The embodiment of the present invention provides the control method and device of a kind of block processes task, to improve block processes task Treatment effeciency.
In a first aspect, the embodiment of the present invention provides a kind of control method of block processes task, by block processes task point At continuous multistep treatment subtask, corresponding every grade of processing subtask configures the execution module of at least one corresponding level;And The described method includes:
At least one non-most end level-one execution module continues pair after handling subtask to currently pending onblock executing the same level Next onblock executing the same level to be processed handles subtask, in which:
Most end level-one execution module is and same by processing result to currently pending onblock executing most end coagulation subtask It walks in database.
By using the above method, the parallel processing of block is effectively realized, not only increases the treatment effeciency of block, and And the transaction throughput of block catenary system is also improved, meet more application to the performance requirement of block chain.
Second aspect, the embodiment of the present invention provide a kind of control device of block processes task, comprising:
Module is split, for block processes task to be divided into continuous multistep treatment subtask, corresponding every grade of processing is appointed Business configures the execution module of at least one corresponding level;
At least one non-most end level-one execution module, for subsequent to currently pending onblock executing the same level processing subtask It is continuous that subtask is handled to next onblock executing the same level to be processed;
Most end level-one execution module is used for currently pending onblock executing most end coagulation subtask, and will processing As a result it is synchronized in database.
On the one hand, the embodiment of the present invention provides a kind of control method of block processes task, and block processes task is divided into Continuous multistep treatment subtask, corresponding every grade of processing subtask configures the execution module of at least one corresponding level, adjacent to hold Intermediate task queue is each equipped between row module, and first order execution module is configured with block task queue, block task team Task in column is to be written according to the reception sequence of block to be processed according to the principle of first in, first out;And method includes:
It, will be according to first in, first out principle after first order execution module handles subtask to currently pending onblock executing the same level The corresponding block of extracting from block task queue for task is as next block to be processed;
After each non-most end level-one execution module handles subtask to currently pending onblock executing the same level, according to first entering elder generation The block processes task of currently pending block is added to the centre configured between next stage execution module and appointed by principle out It is engaged in queue;And
After each non-first order execution module handles subtask to currently pending onblock executing the same level, it will be held with upper level The corresponding block of task extracted in the intermediate task queue configured between row module according to the principle of first in, first out is as next A block to be processed;After most end level-one execution module is to currently pending onblock executing most end coagulation subtask, and will place Reason result is synchronized in database.
On the one hand, the embodiment of the present invention provides a kind of control device of block processes task, comprising:
Module is split, for block processes task to be divided into continuous multistep treatment subtask;
Configuration module for configuring the execution module of at least one corresponding level for every grade of processing subtask, and is directed to Intermediate task queue is configured between adjacent execution module, and configures block task queue, area for first order execution module Task in block task queue is to be written according to the reception sequence of block to be processed according to the principle of first in, first out;
First order execution module will be according to first entering elder generation after handling subtask to currently pending onblock executing the same level The corresponding block of task that principle is extracted from block task queue out is as next block to be processed;
Each non-most end level-one execution module, after handling subtask to currently pending onblock executing the same level, according to The block processes task of currently pending block is added to by the principle of first in, first out to be configured between next stage execution module In intermediate task queue;And
Each non-first order execution module, for currently pending onblock executing the same level handle subtask after, will with it is upper The corresponding block of extracting in the intermediate task queue configuring between level-one execution module according to the principle of first in, first out for task is made For next block to be processed;Most end level-one execution module, for appointing to currently pending onblock executing most end coagulation After business, and processing result is synchronized in database.
The third aspect, the embodiment of the present invention provide a kind of computer-readable medium, are stored with computer executable instructions, institute Computer executable instructions are stated for executing the control method of block processes task provided by the present application.
Fourth aspect, the embodiment of the present invention provide a kind of electronic equipment, comprising:
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one A processor executes, so that at least one described processor is able to carry out the controlling party of block processes task provided by the present application Method.
The invention has the advantages that:
The control method and device of block processes task provided in an embodiment of the present invention, by the way that block processes task to be divided into Continuous multistep treatment subtask, and be the execution module that every coagulation subtask configures at least one corresponding level, and Every grade of execution module continues after handling subtask to currently pending onblock executing the same level to next onblock executing sheet to be processed Grade processing subtask.So, on the one hand every coagulation subtask can be executed by execution module sequences at different levels;Another party Face, every level-one execution module continue to execute next pending district after the same level for having executed currently pending block handles subtask The same level of block handles subtask, realizes the block processes task of the multiple blocks to be processed of parallel processing, and then accelerate block Between block processes task processing speed.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by written explanation Specifically noted structure is achieved and obtained in book, claims and attached drawing.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes a part of the invention, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the structural representation of the computing device of the control method provided in an embodiment of the present invention for implementing block processes task Figure;
Fig. 2 is one of the flow diagram of control method of block processes task provided in an embodiment of the present invention;
Fig. 3 a is the effect diagram of the corresponding execution module in every coagulation subtask provided in an embodiment of the present invention;
Fig. 3 b is the effect diagram that execution modules at different levels provided in an embodiment of the present invention handle each block to be processed;
Fig. 4 is the effect signal for being written or reading block processes task in block task queue provided in an embodiment of the present invention Figure;
Fig. 5 is intermediate effect diagram task queue task write-in and read provided in an embodiment of the present invention;
Fig. 6 a handles the execution time diagram that may be present of the version number of data D1 between block;
Fig. 6 b handles the execution time diagram of the version number of data D1 between block provided in an embodiment of the present invention;
Fig. 7 is the two of the flow diagram of the control method of block processes task provided in an embodiment of the present invention;
Fig. 8 a be it is provided in an embodiment of the present invention by configure it is pre- submit caching after execute account version verifying effect show One of be intended to;
Fig. 8 b be it is provided in an embodiment of the present invention by configure it is pre- submit caching after execute account version verifying effect show The two of intention;
Fig. 8 c be it is provided in an embodiment of the present invention by configure it is pre- submit caching after execute account version verifying effect show The three of intention;
Fig. 9 a is the flow diagram of the control method of the submission task of block provided in an embodiment of the present invention;
Fig. 9 b is the effect diagram that execution modules at different levels provided in an embodiment of the present invention execute above-mentioned five subtasks;
Figure 10 is that the pre- effect diagram for submitting caching is arranged in the submission of block provided in an embodiment of the present invention in the process;
Figure 11 is the structural schematic diagram of the control device of block processes task provided in an embodiment of the present invention.
Specific embodiment
The control method and device of block processes task provided in an embodiment of the present invention, to improve block processes task Treatment effeciency.
Below in conjunction with Figure of description, preferred embodiment of the present invention will be described, it should be understood that described herein Preferred embodiment only for the purpose of illustrating and explaining the present invention and is not intended to limit the present invention, and in the absence of conflict, this hair The feature in embodiment and embodiment in bright can be combined with each other.
To facilitate the understanding of the present invention, in technical term of the present invention:
1, block is submitted: it includes following several stages that block, which is submitted, in super account book: verifying legitimacy, the account number of block According to Multi version concurrency control (Multi-Version ConcurrencyControl, MVCC), block account book file write-in, account The update etc. for the status data traded in this document, in which: the legitimacy for verifying block is for judging every transaction in block Signing messages, transaction permission control and transaction whether meet endorsement strategy etc.;The MVCC verifying of account data is for testing Whether the version number for demonstrate,proving the readset of each transaction in block is consistent with the version number in local account book;Account book file contains friendship Involved whole read-write collection in easily;The update for the status data traded in account book file refer to block index data and Database is written in account historical change record and account data (world state) updates and arrives database.
2, token bucket is a kind of common flow control technique, and the method for token bucket refers in the present invention, sends data packet When need according to several tokens of the attributes such as data package size application, while needing to delete several tokens from token bucket;Such as There is no enough tokens in fruit token bucket, namely send data packet without enough tokens, it is pending that this data packet just needs etc. It send until there is enough tokens in token bucket, can control the transmission speed of data packet in this way;The method of token bucket is applied to In the present invention, the speed of execution module processing subtask can control, and then can satisfy the data in block that are connected in block chain Consistency.
3, multistep treatment subtask is not to say that block processes task, which is divided into processing with multiple ranks, appoints Business is relationship arranged side by side between processing subtasks at different levels, is not the relationship of subordinate, it is of the invention in multistep treatment subtask be only for Restriction executes sequence, that is, first carries out first order processing task, is then successively second level processing subtask, third level processing Task, fourth stage processing subtask etc..
4, collection is write, refer to all modifications data composition that the transaction in block is related to writes data acquisition system, repairs due to above-mentioned Change data to need to be written in database, therefore data acquisition system will be write in the present invention and referred to as write collection.This writes the modification data of concentration It can be with are as follows: transaction in block passes through the status data and its content that call the simulation implementation procedure of intelligence contract to modify.Example Such as, A transfers accounts 50 yuan to B, then modifying data can be the remaining sum of A account and remaining sum of B account etc..
5, readset refers in block account version verification process, needs to read number from database or pre- submit in caching It is verified according to the account version for the transaction being related to block, therefore the data of reading is constituted and read data acquisition system, abbreviation readset.It should Data in readset can be with are as follows: transaction in block passes through the status data that calls the simulation implementation procedure of intelligence contract to read And its version number.
Since the chain type between block relies on, the prior art is often used single-threaded serial execution in the submission of processing block Mode, therefore the multicore performance of modern CPU cannot be given full play to, block submits process to take a long time, throughput of trading in block Application demand that is low, being unable to satisfy in reality scene.
It is taken a long time to solve the treatment process of prior art block submission, the lower problem of block processes efficiency, this Inventive embodiments give solution, propose a kind of computing device 10, are implemented by computing device 10 provided by the invention The control method of block processes task, the computing device can be showed in the form of universal computing device, the universal computing device It can be terminal or server etc..Computing device 10 according to the present invention is described referring to Fig. 1.The calculating dress that Fig. 1 is shown Setting 10 is only an example, should not function to the embodiment of the present invention and use scope bring any restrictions.
As shown in Figure 1, computing device 10 is showed in the form of universal computing device.The component of computing device 10 may include But be not limited to: at least one above-mentioned processing unit 11, at least one above-mentioned storage unit 12, the different system components of connection (including Storage unit 12 and processing unit 11) bus 13.
Bus 13 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller, Peripheral bus, processor or the local bus using any bus structures in a variety of bus structures.
Storage unit 12 may include the readable medium of form of volatile memory, such as random access memory (RAM) 121 and/or cache memory 122, it can further include read-only memory (ROM) 123.
Storage unit 12 can also include program/utility 125 with one group of (at least one) program module 124, Such program module 124 includes but is not limited to: operating system, one or more application program, other program modules and It may include the realization of network environment in program data, each of these examples or certain combination.
Computing device 10 can also be communicated with one or more external equipments 14 (such as keyboard, sensing equipment etc.), may be used also Enable a user to the equipment interacted with computing device 10 communication with one or more, and/or with enable the computing device 10 Any equipment (such as router, modem etc.) communicated with one or more of the other calculating equipment communicates.This Kind communication can be carried out by input/output (I/O) interface 15.Also, computing device 10 can also pass through network adapter 16 With one or more network (such as local area network (LAN), wide area network (WAN) and/or public network, such as internet) communication. As shown, network adapter 16 is communicated by bus 13 with other modules for computing device 10.It will be appreciated that though figure In be not shown, can in conjunction with computing device 10 use other hardware and/or software module, including but not limited to: microcode, equipment Driver, redundant processing unit, external disk drive array, RAID system, tape drive and data backup storage system Deng.
The application scenarios of the control method of block processes task provided in an embodiment of the present invention are to implement block in the present invention The computing device 10 of the control method of processing task can be a node in block chain, when computing device 10 receives other When the block that node is sent with the forms of broadcasting, the block processes task of the block can be divided at continuous multistage by computing device 10 Reason task, and corresponding every grade of processing subtask creates the execution module of at least one corresponding level, then every grade of execution module pair Continue behind currently pending onblock executing the same level processing subtask to next onblock executing the same level processing to be processed subtask, In: processing result is synchronized to currently pending onblock executing most end coagulation subtask by most end level-one execution module In database.On the one hand can using method provided by the invention by configuring multiple execution modules for multistep treatment subtask The processing subtasks at different levels of each block to be processed are executed by execution module sequences at different levels, on the other hand, each execution module exists Executed currently pending block the same level processing subtask after continue to execute next block to be processed the same level processing subtask, The block processes task of the multiple blocks to be processed of parallel processing is realized, and then accelerates the processing of block processes task between block Speed.Multiple respective stages can be created for executing time longer processing subtask according to the execution time of processing subtask Other execution module can further speed up processing speed by multiple execution module parallel processings.
Below with reference to the application scenarios of Fig. 1 and foregoing description, exemplary reality according to the present invention is described with reference to Fig. 2-Figure 11 The control method for the block processes task that the mode of applying provides.It should be noted that above-mentioned application scenarios are merely for convenience of understanding Spirit and principles of the present invention and show, embodiments of the present invention are not limited in this respect.On the contrary, reality of the invention The mode of applying can be applied to applicable any scene.
As shown in Fig. 2, by taking every grade handles the execution module that subtask configures a corresponding level as an example, the embodiment of the present invention The process of the control method of the block processes task of offer may comprise steps of:
S11, block processes task is divided into continuous multistep treatment subtask.
Specifically, there are multiple nodes in block chain, be provided with computing device 10 in each node.When each node For computing device 10 after generating a block, the form that can broadcast the block is sent to other each nodes, in this way other On the one hand computing device 10 in node stores the transaction data in block after receiving block, on the other hand need to build Vertical one handles the block processes task of the block, to complete verifying and submission to the block, only verifies to the block logical Later, which could be linked on the block chain on own node.The controlling party of block processes task provided by the invention Method is only handled in the block processes task established to the block received, to complete the treatment process of the submission of block.
In this step, the execution module in the present invention be can be, but not limited to as thread or association's journey etc..It specifically, can be preparatory Establish multiple execution modules for handling block processes task is then according to the actual process of block processes task Execution module assigns different processing functions.In this way, when computing device 10 receives block processes task, it first will be at block Reason task is divided into multistep treatment subtask, is then directed to every coagulation subtask, configures the execution mould an of corresponding level Block.So, for every coagulation subtask, have its corresponding execution module execute this grade processing subtask, from And it ensure that processing subtasks at different levels can be processed.
It should be noted that, when being divided to block processes task, can increase according to the actual situation in the present invention Add, delete or replace processing subtask.And the present invention to division processing subtask quantity without limit.
S12, at least one non-most end level-one execution module are subsequent to currently pending onblock executing the same level processing subtask It is continuous that subtask is handled to next onblock executing the same level to be processed.
In this step, in order to improve the treatment effeciency of block processes task, propose execution module to current in the present invention Behind onblock executing the same level processing to be processed subtask, continue in this way may be used to next onblock executing the same level processing to be processed subtask To guarantee the parallel processing of each block to be processed, so as to accelerate the place of block processes task between block to a certain extent Manage speed.For example, the block processes task of each block to be processed is divided into n grades of processing subtasks, every coagulation is appointed It is engaged in corresponding at least one execution module.With reference to shown in Fig. 3 a, the corresponding execution in every coagulation subtask is given in Fig. 3 a The effect diagram of module, every level-one execution module have been executed for handling the same level processing subtask, execution modules at different levels in this way Behind corresponding processing subtasks at different levels, characterization has executed the block processes task of the block to be processed.Fig. 3 b gives at different levels hold The effect diagram of each block to be processed of row resume module realizes as can be seen from the figure by configuring execution module Multiple block parallel processings, improve block processes efficiency on the whole.
Preferably, most end level-one execution module is to currently pending onblock executing most end coagulation subtask, and will place Reason result is synchronized in database.
Specifically, most end level-one execution module is appointed to currently pending onblock executing most end coagulation in the present invention After business, the processing result that each execution module can be handled to the processing subtasks at different levels of currently pending block is synchronized to database In.
It should be noted that each execution module is in the block processes task for handling same block to be processed in the present invention When, it is the actual process sequential processes according to block processes task, that is to say, that the multistep treatment subtask of division is Orderly, first order execution module has been handled after first order processing subtask handled, and second level execution module could handle the Two stage treatment subtask, and so on.So, execution modules at different levels, which carry out communication, just can guarantee that processing at different levels are appointed Business is all performed.
For this purpose, the present invention proposes to communicate by way of task queue between each execution module.
It optionally, will be according to first entering after first order execution module handles subtask to currently pending onblock executing the same level First go out the corresponding block of task that principle is extracted as next block to be processed, the task in the block task queue is root It is written according to the reception sequence of block to be processed according to the principle of first in, first out.
Specifically, the present invention can also safeguard a block task queue, and computing device 10 is to receive other nodes wide After the block broadcast, which can be stored, on the other hand establish a block processes task for the block and be written to area In block task queue.Since in practical application, the block in block chain is generally stored with transaction record, and transaction record is that have elder generation Sequence afterwards, therefore, block processes task is also to have sequencing.Based on this situation, the present invention is receiving pending district After block, the block processes task established for these blocks to be processed is written to block task queue according to the sequence of first in, first out In, with reference to shown in Fig. 4.In this way, first order execution module is then extracted from block task queue according to the principle of first in, first out first Then the block processes task to be processed of write-in executes the first order processing subtask in above-mentioned block processes task.Work as place After having managed, then the block processes task of next block to be processed is extracted from block task queue, and execute next wait locate The first order managed in the block processes task of block handles subtask.
Optionally, it is communicated by the following method between execution modules at different levels:
After each non-most end level-one execution module handles subtask to currently pending onblock executing the same level, further includes: press It the block processes task of currently pending block is added to is configured between next stage execution module according to the principle of first in, first out Intermediate task queue in, wherein intermediate task queue is each equipped between adjacent execution module;And
After each non-first order execution module handles subtask to currently pending onblock executing the same level, further includes: will be with The corresponding block of extracting in the intermediate task queue configuring between upper level execution module according to first in, first out principle for task is made For next block to be processed.If some subtask is being handled by multiple execution modules, each execution module of the rank After complete currently pending block, next task is obtained from intermediate task queue respectively.
Specifically, refering to what is shown in Fig. 5, maintaining an intermediate task queue between execution module at different levels respectively, and it is each Intermediate task queue is also that task is written according to the principle of first in, first out.
Specifically, it is illustrated so that non-most end level-one execution module is second level execution module as an example, the second level executes mould After block handles subtask in the second level for having executed currently pending module, meeting will be currently pending according to the principle of first in, first out The block processes task of block is written to the intermediate task queue configured between second level execution module and third level execution module In.Such as the intermediate task queue in Fig. 5 arranges from left to right, and block processes task is written from the left side, reads block from the right The block processes task of currently pending block can be written to intermediate appoint from the left side by processing task, such second level execution module It is engaged in queue.
In addition, being illustrated so that non-first order execution module is the second execution module as an example, second herein in connection with shown in Fig. 5 Grade execution module in having executed currently pending block the second level handle subtask after, can also according to first in, first out principle from It extracts and goes out on missions in the intermediate task queue configured between second level execution module and first order execution module, and will extract Block processes task of the task as next block to be processed, and execute the second level in the block processes task and handle subtask.
Due to block chain technology itself have the characteristics that it is following: the submission of multiple blocks on a chain must comply with stringent Sequentially, the latter block has to wait for submit after the completion of previous block is submitted, while the latter block must be linked to Previous block forms orderly chain.And the present invention is due to being changed to parallel processing manner processing for the mode of serial process block The each block to be processed received, although improving the treatment effeciency of block, latter block is held relative to previous block Row time point can obtain it is a degree of in advance, the execution timing between block will appear uncertain difference in different nodes, It finally may result in the inconsistent problem of different internodal datas, with reference to shown in Fig. 6 a, by data D1 editions in block 1 in Fig. 6 a This from v1 is revised as v2, and needs to read data D1 version in block 2, but modified in block 1 at this time data D1 version this Operation is not synchronized in database, and block 2 has read the version of data D1 from database, so as to cause in block 2 The version of the data D1 of reading is v1, and so as to cause the generation of data inconsistence problems, however this phenomenon has violated block chain The principle of data consistency in system, in order to solve this problem, The present invention gives solutions, so that by utilizing this hair The method of bright offer enables the execution timing between block to achieve the effect that Fig. 6 b, and the present invention proposes to use the side of token bucket Method solves above-mentioned data inconsistence problems, it may be assumed that
First order execution module further includes shown in Fig. 7 before handling subtask to currently pending onblock executing the same level Process, comprising the following steps:
S21, first order execution module are currently pending block application according to the rank of data in currently pending block Execute the token of block processes required by task.
In this step, the data-level of block is different in block chain, some data will affect the execution of subsequent all blocks, Some then will not influence subsequent block.For example, it is related to the modification etc. of modification or the configuration of metadata in block transaction, these Modification will affect the execution of subsequent all blocks, and rank is relatively high, and corresponding such block belongs to special block.And some areas Data in block are generally smaller on the influence of subsequent block, and rank is lower, and such block belongs to normal block.
It should be noted that the rank of data can be preset in block in the present invention, rank is higher to represent the block Subsequent block is influenced higher.
In order to guarantee consistency between data, the present invention propose the first execution module be each block application to be processed execute to Handle the token of the block processes required by task of block.Specifically, computing device 10 can be the block chain on the node belonging to it A token bucket is configured, there are several tokens in the token bucket, such first order execution module is mentioned from block task queue It, can be according to the rank of the data in the block to be processed, for the block to be processed when taking the block processes of block to be processed any Application executes the token of the block processes required by task of block to be processed.
S22, first order execution module determine whether the token number of application is greater than remaining token number in token bucket;If it is not, Then follow the steps S23;If so, thening follow the steps S24.
Wherein, the sum of token is the sum of the execution module of configuration.
Specifically, initial phase, can be according to the quantity N of the execution module of configuration, the token that initialization token number is N Bucket.It can control the processing speed of each execution module by the way that token bucket is arranged, it is possible thereby to control block to a certain extent Between the processing time, and then guarantee to handle currently pending block using the latest data after previous block processes, in this way Also the consistency of data is ensured that.
S23, the first execution module handle subtask to the currently pending onblock executing first order.
S24, the pause of the first execution module execute the same level and handle subtask, and continue to execute step S22.
In step S22~S24, the first execution module judges the token of application after for block application token to be processed Whether number is greater than remaining token number in token bucket, if more than then show in token bucket token by block before, such the One execution module then wouldn't handle subtask to the first order of currently pending block and handle, and the second level~the n-th grade executes Module will not handle subtask to the second level~the n-th grade of above-mentioned block to be processed and handle.If the first execution module is sentenced Disconnected is out the token number of currently pending block application no more than remaining token number in token bucket, then starts to execute currently wait locate The first order for managing module handles subtask, while removal is the token of currently pending module application from token bucket.For example, the One execution module is that currently pending block needs to apply 3 tokens, and remaining token number is 4 in token bucket, and first executes Module easily show that the token number 3 of application is less than remaining token number 4 in token bucket, then executes the first order to currently pending module Subtask is handled, while deducting 3 tokens from token bucket, remaining token number is 1 in token bucket.
In practical application, for the first execution module when determining currently pending block is normal block, general is only to be somebody's turn to do 1 token of block application to be processed;It is only the block application to be processed when determining currently pending block is special block Whole token number N in token bucket.That is, at most can concurrently be executed N number of when for 1 token of generic tokens application Normal block;It can be the special block Shen in order to avoid itself and other normal blocks generate data collision for special block It please N number of token.
Using the method for token bucket, the quantity of the block concurrently executed can be flexibly controlled, it is only to can satisfy special block Account for the demand of execution, for example, in block transaction be related to metadata modification when, these data are affected to subsequent block, then All blocks in token bucket can be applied for walking, block subsequent in this way is then without available block, thus suspend the subsequent block of processing, It is also achieved that special block is exclusive in this way to execute.
In order to guarantee block parallel process duration, the controlling party of block processes task provided by the invention Method, further includes:
After most end level-one execution module is to currently pending onblock executing most end coagulation subtask, then it is released to current The token of the execution block processes required by task of block application to be processed is simultaneously added into token bucket.
Specifically, after most end level-one execution module has handled the most end coagulation subtask of currently pending block, It is then released to the token of currently pending block application, while the token of release being added into token bucket, so, first Grade execution module can be subsequent block application token to be processed, guarantee the duration of parallel processing.
It should be noted that using the method for above-mentioned token bucket, it is false since the token quantity of normal block application is smaller Such as, when there is N number of token in token bucket, when the first execution module determines that continuous m (m is less than N) blocks to be processed are common Block, and be 1 token of these normal block applications, then the first execution module is not deposited when handling this m blocks to be processed Suspending the case where executing, then may exist and rely on the same data item between normal block and generate data collision, if Pressure has the adjacent block of conflict serially to execute, and causes whole system to be degenerated to original next time there are hot spot account data the case where There is serial execution pattern, in order to avoid the generation of this case, The present invention gives solutions, that is, propose pre- submission caching Mode, it may be assumed that be directed to currently pending block, the data that any level execution module is traded in modifying currently pending block Afterwards, the storage of the data of modification is submitted in caching to pre- so that under treatment a block to be processed when, first submitted in caching from pre- The data for extracting modification, are handled next block to be processed using the data of the modification extracted, otherwise from database Data are extracted to handle next block to be processed.It should be noted that pre- submission caching proposed by the present invention can also be single Solely implement, i.e., the present invention can not implement token bucket methodology shown in Fig. 7, only with the pre- method for submitting caching it is also ensured that The consistency of data.
The pre- submission caching method provided for a better understanding of the present invention solves data inconsistence problems, in the present invention Processing subtask includes being illustrated for account version verifies subtask.
Preferably, the execution module for executing account verification subtask handles subtask to currently pending onblock executing the same level After continue to specifically include next onblock executing the same level to be processed processing subtask:
It, will be described in currently pending block after being verified to the account version for the transaction that currently pending block is related to What all data for modifying in transaction were constituted write collection and its version number are saved in during pre- submissions cache;And
When handling the account version verifying of next block to be processed, however, it is determined that go out the pre- version submitted and be stored with account in caching This number, then utilize the account for the transaction being related to from the pre- version number for submitting the account read in caching to next block to be processed Family version is verified;Otherwise the transaction that the version number of account is related to next block to be processed is read from database Account version is verified.
Specifically, with reference to shown in Fig. 8 a, the invention proposes configured in computing device 10 one it is pre- submit caching, this The execution module of sample, account version verifying subtask is verified in the account version for the transaction being related to currently pending block Afterwards, by all data of modification that above-mentioned transaction is related to constitute write collection and its version number is saved in during pre- submissions cache, in this way One, in conjunction with shown in Fig. 8 b, when the execution module of account version verifying subtask carries out the transaction in next block to be processed When account version is verified, the version number that account is first extracted from pre- submission caching is only needed, then using the version number extracted to upper State transaction in next block to be processed and carry out the verifying of account version, due to submit in advance the data stored in caching be it is newest, Therefore next block to be processed is carried out when account version is verified also with newest data, therefore can guarantees the consistent of data Property.In addition, showing that not carrying out data to the transaction in currently pending block repairs if pre- submit in caching does not have storing data Change, then only the verifying of account version need to be carried out to the transaction in above-mentioned next block to be processed from data are extracted in database.Therefore, By using the pre- method for submitting caching, the consistency of data between block ensure that.
Further, the processing subtask further includes that account updates subtask;And it executes account and updates subtask Execution module handles subtask to currently pending onblock executing the same level, specifically includes:
Pre- will submit the currently pending block stored in caching be related to described in write collection and its version number is updated to number After in library, remove it is pre- submit that the currently pending block stored in caching is related to described write collection and its version number.
Specifically, in practical application, need by block transaction be related to write collection and version number is synchronized in database, by Collection and version number's storage will first be write in method provided by the invention to submit in caching to pre-, therefore the present invention also needs to be implemented account Update subtask, specifically by account update the corresponding execution module in subtask by it is pre- submit cached in caching it is above-mentioned currently to What transaction was related in reason block writes collection and its version number's synchronized update into database, with reference to shown in Fig. 8 c;Further, since mentioning in advance Hand over memory space limitation in caching, account updates the corresponding execution module in subtask and also needs to remove pre- submit to be stored in caching Currently pending block be related to it is described write collection and its version number, tested to handle the account version traded in next block to be processed When card, the data for the modification being related to provide memory space.
For a better understanding of the present invention, it is carried out so that the block processes task in the present invention is the submission task of block as an example Illustrate, the multistep treatment subtask that the task that block is submitted in the present invention divides includes that block verifies subtask, account version is tested Demonstrate,prove subtask, block submits subtask, account updates subtask and synchronization and ending subtask, and handles the sequence of subtask Are as follows: it first handles block and verifies subtask, then successively execute account version verifying subtask, block submission subtask and account and update Subtask finally executes synchronous and ending subtask.Meanwhile first order execution module is appointed for carrying out processing block verifying Business, second level execution module submit son for executing block for executing account version verifying subtask, third level execution module Task, fourth stage execution module update subtask for executing account, and most end level-one execution module is for executing synchronous and ending Subtask.In conjunction with FIG. 1 to FIG. 8 c, it is illustrated by taking two blocks of parallel processing (respectively block n and n+1) as an example, with reference to figure Shown in 9a, be block provided in an embodiment of the present invention submission task control method flow diagram, introduce Fig. 9 a it Before, for convenience, the intermediate task queue that the present invention will configure between first order execution module and second level execution module It is denoted as the first intermediate task queue;The intermediate task queue configured between second level execution module and third level execution module is remembered For the second intermediate task queue;The intermediate task queue configured between third level execution module and fourth stage execution module is denoted as Task queue among third;Will be denoted as in the intermediate task team configured between fourth stage execution module and level V execution module Task queue among level Four.Fig. 9 b gives the effect diagram that execution modules at different levels execute above-mentioned five subtasks.Based on upper Description is stated, the control method of the submission task of block provided by the invention may comprise steps of:
The principle of S31, first order execution module from block task queue according to first in, first out extracts the block of block n Processing task, and according to the rank of data in block n, the token of block processes required by task is executed for block n application.
S32, first order execution module if it is determined that the token number of application no more than remaining token number in token bucket, then it is right The legitimacy of block n is verified.
In this step, first order execution module is used to control the permission of the signing messages of every transaction in block n, transaction Legitimate verification is carried out with whether transaction meets endorsement strategy etc..
In addition, first order execution module is if it is determined that the token number of application is then hung greater than remaining token number in token bucket It plays the same level and handles subtask, until determining that remaining token number meets the token number of application in token bucket.
When it is implemented, the first execution module is greater than token currently available in token bucket when the token number for determining application When number, then the same level processing subtask is hung up, that is, suspends the processing to the same level processing subtask, until determining remaining in token bucket Token number not less than application token number when, then execute the same level processing subtask.
S33, first order execution module add the block processes task of n block after the completion of the legitimate verification to block n It is added in the first intermediate task queue.
S34, first order execution module continue the block processes task that block n+1 is extracted from block task queue, then It is continued to execute according to step S31~S33.
S35, second level execution module are related to block n after the extracting block n in the first intermediate task queue of the task The account version of transaction is verified, and writes collection for what all data modified in transaction in block n were constituted after being verified And its version number is saved in pre- submission caching.
The block processes task of block n is continued to be added in the second intermediate task queue by S36, second level execution module.
S37, the second level execute the continuing that block n+1 is extracted from the first intermediate task queue of the task, are determining pre- mention The version number for being stored with account in caching is handed over, then utilizes and block n+1 is related to from the pre- version number for submitting the account read in caching And the account version of transaction verified, and will all data that modified in transaction in block n+1 constitute write collection and its version This number is saved in pre- submission caching, is further continued for executing according to step S36.
Refering to what is shown in Fig. 10, submitting caching by the way that setting is pre-, all nodes are when carrying out the verifying of account version to block n+1 From it is pre- submit the account data read in caching be all it is identical, in the case where not sacrificing concurrent processing mode, ensure that section The consistency of data between point.
It should be noted that the execution sequence of step S36 and S37 may be performed simultaneously, step S37 can also be first carried out again Step S36 is executed, depending on actual conditions.
S38, third level execution module execute after the block processes task for extracting block n in the second intermediate task queue The submission traded in block n, while the block processes task of block n being added among third in task queue.
S39, third level execution module continue to extract the block processes task of block n+1, referring again to step S38 to block n+ 1, which executes block, submits subtask.
S310, fourth stage execution module extract the block processes task of block n from task queue among third, will submit in advance What the currently pending block stored in caching was related to described writes collection and its version number is updated in database.
In step S310, refering to what is shown in Fig. 10, the 4th execution module submits data in caching to be updated to database for pre- Effect diagram.
S311, fourth stage execution module remove it is pre- submit that the currently pending block stored in caching is related to described write collection And its version number, and the block processes task of block n is added in the 4th intermediate task queue.
S312, fourth stage execution module continue the block processes task that block n+1 is extracted from task queue among third, and Account is executed to block n+1 according to step S310 and S311 and updates subtask.
S313, level V execution module extract the block processes task of block n from the 4th intermediate task queue, to area Behind the synchronous subtask with ending of block n execution, it is released to the token of the execution block processes required by task of block n application and will discharges Token be added into token bucket.
Specifically, for each block, the aforementioned son that the 5th execution module is generally used for monitoring for handling the block is appointed Whether business has been handled, and the token of the block application is then released to when having handled.
It in practical applications, may further include that other sons are appointed during the submission of block other than above-mentioned five subtasks Business, only above-mentioned five subtasks are most important subtask.Therefore, for other subtasks, the present invention can also be configured and be held Row module comes other subtasks of parallel processing, is determining in this way in level V execution module for handling holding for other subtasks After the completion of after row resume module is complete and aforementioned four subtasks are also handled, then holding for the execution module of other subtasks is synchronized Row as a result, be released to the token of block application simultaneously.It should be noted that other subtasks can be for by the time in the present invention The subtask of limitation, such as establish block index, account historical record update task.
It should be noted that since the submission task of block mainly includes 5 subtasks, and it is parallel by five execution modules Processing, therefore synchronization allows most 5 block parallel processings in the case.
Preferably, the consistency in order to preferably guarantee data, the present invention can also use other synchronization mechanisms, such as system Lock maintains data synchronous with semaphore etc..
By using the control method of block processes task provided by the invention, by the way that block processes task is divided into continuously Multistep treatment subtask, and for every coagulation subtask configure at least one corresponding level execution module and every grade Execution module continues after handling subtask to currently pending onblock executing the same level at next onblock executing the same level to be processed Manage subtask.So, the parallel processing for effectively realizing block, not only increases the treatment effeciency of block, but also mentions The transaction throughput of block catenary system has been risen, has met more application to the performance requirement of block chain.
Based on the same inventive concept, a kind of control device of block processes task is additionally provided in the embodiment of the present invention, by It is similar to the control method of block processes task in the principle that above-mentioned apparatus solves the problems, such as, therefore the implementation of above-mentioned apparatus can be joined The implementation of square method, overlaps will not be repeated.
It as shown in figure 11, is the structural schematic diagram of the control device of block processes task provided in an embodiment of the present invention, packet It includes:
Module 41 is split, for block processes task to be divided into continuous multistep treatment subtask;
Configuration module 42, for configuring the execution module of at least one corresponding level for every grade of processing subtask;
At least one non-most end level-one execution module 43i (i is not equal to n), for currently pending onblock executing the same level Continue behind processing subtask to next onblock executing the same level processing to be processed subtask;
Most end level-one execution module 43n is used for currently pending onblock executing most end coagulation subtask, and will place Reason result is synchronized in database.
Preferably, at least one described non-most end level-one execution module includes: first order execution module 431:
The first order execution module is specifically used for after handling subtask to currently pending onblock executing the same level, will be according to Task of the corresponding block of task that first in, first out principle is extracted as next block to be processed, in the block task queue It is to be written according to the reception sequence of block to be processed according to the principle of first in, first out.
Preferably, each non-most end level-one execution module i (i is not equal to n), is specifically used for currently pending onblock executing After the same level handles subtask, further includes: add the block processes task of currently pending block according to the principle of first in, first out Into the intermediate task queue configured between next stage execution module, wherein be each equipped with centre between adjacent execution module Task queue;
Each non-first order execution module 43i (i is not equal to 1), is specifically used for currently pending onblock executing the same level After managing subtask, further includes: by the original in the intermediate task queue configured between upper level execution module according to first in, first out The corresponding block of then extracting for task is as next block to be processed.
In a kind of possible embodiment, first order execution module 431 is specifically used for currently pending onblock executing sheet Before grade processing subtask, according to the rank of data in currently pending block, block is executed for currently pending block application Handle the token of required by task;Determine the token number of application no more than remaining token number in token bucket, the sum of the token For the sum of the execution module of configuration;
The first order execution module 431 is also used to if it is determined that the token number applied is greater than remaining order in token bucket Board number then hangs up the same level processing subtask, until determining that remaining token number meets the token number of application in token bucket.
Preferably, most end level-one execution module 43n is specifically used for currently pending onblock executing most end coagulation After task, then it is released to the token of the execution block processes required by task of currently pending block application and is added into token bucket In.
A kind of possible embodiment, in the control device of block processes task provided by the invention,
The processing subtask includes account version verifying subtask;Then
The execution module 43i for executing account verification subtask, specifically for the transaction that is related to currently pending block After account version is verified, collection and its version are write by what all data modified in transaction described in currently pending block were constituted This number is saved in pre- submission caching;And when handling the account version verifying of next block to be processed, however, it is determined that go out pre- submit It is stored with the version number of account in caching, then utilizes from the pre- version number for submitting the account read in caching to described next to from The account version for the transaction that reason block is related to is verified;Otherwise from database read account version number to it is described it is next to The account version for the transaction that processing block is related to is verified.
A kind of possible embodiment, in the control device of block processes task provided by the invention, processing is appointed Business further includes that account updates subtask;And
Execute the execution module 43i that account updates subtask, specifically for by it is pre- submit stored in caching it is current to Processing block be related to it is described write collection and its after version number is updated in database, remove it is pre- submit stored in caching it is current What block to be processed was related to described writes collection and its version number.
Preferably, the processing subtask further include: block verifies subtask, block submits subtask and synchronization and ending Subtask, wherein the sequence of processing subtask is successively are as follows: block verifies subtask, account version verifying subtask, block submission Subtask, account update subtask and synchronization and ending subtask.
For convenience of description, above each section is divided by function describes respectively for each module (or unit).Certainly, In Implement to realize the function of each module (or unit) in same or multiple softwares or hardware when the present invention.
In some possible embodiments, the various aspects of the control method of block processes task provided by the invention are also It can be implemented as a kind of form of program product comprising program code, when described program product is run on a computing device When, said program code is for making the computer equipment execute the various according to the present invention exemplary of this specification foregoing description Step in the control method of the block processes task of embodiment, for example, the computer equipment can execute as shown in Figure 2 Step S11~S12 in block processes task control flow.
Described program product can be using any combination of one or more readable mediums.Readable medium can be readable letter Number medium or readable storage medium storing program for executing.Readable storage medium storing program for executing for example may be-but not limited to-electricity, magnetic, optical, electromagnetic, red The system of outside line or semiconductor, device or device, or any above combination.The more specific example of readable storage medium storing program for executing (non exhaustive list) includes: the electrical connection with one or more conducting wires, portable disc, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc Read memory (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
The program product of the control method for block processes task of embodiments of the present invention can use portable Compact disk read-only memory (CD-ROM) and including program code, and can run on the computing device.However, journey of the invention Sequence product is without being limited thereto, and in this document, readable storage medium storing program for executing can be any tangible medium for including or store program, the journey Sequence can be commanded execution system, device or device use or in connection.
Readable signal medium may include in a base band or as the data-signal that carrier wave a part is propagated, wherein carrying Readable program code.The data-signal of this propagation can take various forms, including --- but being not limited to --- electromagnetism letter Number, optical signal or above-mentioned any appropriate combination.Readable signal medium can also be other than readable storage medium storing program for executing it is any can Read medium, the readable medium can send, propagate or transmit for by instruction execution system, device or device use or Program in connection.
The program code for including on readable medium can transmit with any suitable medium, including --- but being not limited to --- Wirelessly, wired, optical cable, RF etc. or above-mentioned any appropriate combination.
The program for executing operation of the present invention can be write with any combination of one or more programming languages Code, described program design language include object oriented program language-Java, C++ etc., further include conventional Procedural programming language-such as " C " language or similar programming language.Program code can be fully in user It calculates and executes in equipment, partly executes on a user device, being executed as an independent software package, partially in user's calculating Upper side point is executed on a remote computing or is executed in remote computing device or server completely.It is being related to far Journey calculates in the situation of equipment, and remote computing device can pass through the network of any kind --- including local area network (LAN) or extensively Domain net (WAN)-be connected to user calculating equipment, or, it may be connected to external computing device (such as utilize Internet service Provider is connected by internet).
It should be noted that although being referred to several unit or sub-units of device in the above detailed description, this stroke It point is only exemplary not enforceable.In fact, embodiment according to the present invention, it is above-described two or more The feature and function of unit can embody in a unit.Conversely, the feature and function of an above-described unit can It is to be embodied by multiple units with further division.
In addition, although describing the operation of the method for the present invention in the accompanying drawings with particular order, this do not require that or Hint must execute these operations in this particular order, or have to carry out shown in whole operation be just able to achieve it is desired As a result.Additionally or alternatively, it is convenient to omit multiple steps are merged into a step and executed by certain steps, and/or by one Step is decomposed into execution of multiple steps.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications can be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of control method of block processes task, which is characterized in that block processes task is divided into continuous multistep treatment Subtask, corresponding every grade of processing subtask configure the execution module of at least one corresponding level, match between adjacent execution module It is equipped with intermediate task queue, and first order execution module is configured with block task queue, the task in the block task queue It is to be written according to the reception sequence of block to be processed according to the principle of first in, first out;And the described method includes:
It, will be according to first in, first out principle from institute after first order execution module handles subtask to currently pending onblock executing the same level The corresponding block of extracting in block task queue for task is stated as next block to be processed;
After each non-most end level-one execution module handles subtask to currently pending onblock executing the same level, according to first in, first out The block processes task of currently pending block is added to the intermediate task team configured between next stage execution module by principle In column;And
After each non-first order execution module handles subtask to currently pending onblock executing the same level, mould will be executed with upper level In the intermediate task queue configured between block according to first in, first out principle extract the corresponding block of task as it is next to Handle block;After most end level-one execution module is to currently pending onblock executing most end coagulation subtask, and processing is tied Fruit is synchronized in database.
2. the method as described in claim 1, it is characterised in that:
First order execution module is handled currently pending onblock executing the same level before subtask, further includes:
First order execution module executes block according to the rank of data in currently pending block for currently pending block application Handle the token of required by task;
First order execution module determines the token number of application no more than remaining token number in token bucket, and the sum of the token is The sum of the execution module of configuration;And
First order execution module is if it is determined that the token number of application then hangs up the same level processing greater than remaining token number in token bucket Subtask, until determining that remaining token number meets the token number of application in token bucket.
3. method according to claim 2, which is characterized in that further include:
After most end level-one execution module is to currently pending onblock executing most end coagulation subtask, then it is released to currently wait locate It manages the token of the execution block processes required by task of block application and is added into token bucket.
4. the method according to claim 1, which is characterized in that the processing subtask includes the verifying of account version Subtask;The execution module for then executing account verification subtask handles subtask to currently pending onblock executing the same level, specifically Include:
After being verified to the account version for the transaction that currently pending block is related to, it will trade described in currently pending block What all data of middle modification were constituted write collection and its version number are saved in during pre- submissions cache.
5. method as claimed in claim 4, which is characterized in that in the institute that will be modified in transaction described in currently pending block Have that data constitute write collection and its version number be saved in pre- submissions cache in after, further includes:
When handling the account version verifying of next block to be processed, however, it is determined that go out the pre- version submitted and be stored with account in caching Number, then utilize the account for the transaction being related to from the pre- version number for submitting the account read in caching to next block to be processed Version is verified;Otherwise the account for the transaction that the version number of reading account is related to next block to be processed from database Family version is verified.
6. method as claimed in claim 5, which is characterized in that the processing subtask further includes that account updates subtask;With And the execution module for executing account update subtask specifically includes currently pending onblock executing the same level processing subtask:
Pre- will submit the currently pending block stored in caching be related to described in write collection and its version number is updated to database In after, remove it is pre- submit that the currently pending block stored in caching is related to described write collection and its version number.
7. method as claimed in claim 6, which is characterized in that the processing subtask further include: block verifies subtask, area Block submits subtask and synchronization and ending subtask, wherein the sequence of processing subtask is successively are as follows: block verifies subtask, account Version verifies subtask, block submits subtask, account updates subtask and synchronization and ending subtask.
8. a kind of control device of block processes task characterized by comprising
Module is split, for block processes task to be divided into continuous multistep treatment subtask;
Configuration module for configuring the execution module of at least one corresponding level for every grade of processing subtask, and is held adjacent It is each equipped with intermediate task queue between row module, and configures block task queue, the area for first order execution module Task in block task queue is to be written according to the reception sequence of block to be processed according to the principle of first in, first out;
First order execution module will be according to first in, first out original after handling subtask to currently pending onblock executing the same level The corresponding block of task then extracted from the block task queue is as next block to be processed;
Each non-most end level-one execution module, after handling subtask to currently pending onblock executing the same level, according to first entering The block processes task of currently pending block is added to the centre configured between next stage execution module by the principle first gone out In task queue;And
Each non-first order execution module will be with upper level after handling subtask to currently pending onblock executing the same level Under the corresponding block of extracting in the intermediate task queue configuring between execution module according to the principle of first in, first out for task is used as One block to be processed;Most end level-one execution module, after to currently pending onblock executing most end coagulation subtask, And processing result is synchronized in database.
9. a kind of computer-readable medium characterized by comprising
Computer executable instructions are stored with, the computer executable instructions are used for such as claim 1 to 7 any claim The method.
10. a kind of electronic equipment characterized by comprising
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one It manages device to execute, so that at least one described processor is able to carry out the method as described in claim 1 to 7 any claim.
CN201910711607.3A 2018-09-13 2018-09-13 Control method and device for block processing task Active CN110457123B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910711607.3A CN110457123B (en) 2018-09-13 2018-09-13 Control method and device for block processing task

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811069813.0A CN109271245B (en) 2018-09-13 2018-09-13 Control method and device for block processing task
CN201910711607.3A CN110457123B (en) 2018-09-13 2018-09-13 Control method and device for block processing task

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201811069813.0A Division CN109271245B (en) 2018-09-13 2018-09-13 Control method and device for block processing task

Publications (2)

Publication Number Publication Date
CN110457123A true CN110457123A (en) 2019-11-15
CN110457123B CN110457123B (en) 2021-06-15

Family

ID=65189376

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201910711607.3A Active CN110457123B (en) 2018-09-13 2018-09-13 Control method and device for block processing task
CN201811069813.0A Active CN109271245B (en) 2018-09-13 2018-09-13 Control method and device for block processing task

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201811069813.0A Active CN109271245B (en) 2018-09-13 2018-09-13 Control method and device for block processing task

Country Status (1)

Country Link
CN (2) CN110457123B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990157A (en) * 2019-12-09 2020-04-10 云南电网有限责任公司保山供电局 Wave recording master station communication transmission system and method adapting to micro-thread mechanism
CN111221639A (en) * 2020-01-09 2020-06-02 杭州趣链科技有限公司 Block pipeline execution method of block chain platform
CN112019350A (en) * 2020-08-31 2020-12-01 光大科技有限公司 Block verification method and device for block chain
CN113157710A (en) * 2021-02-01 2021-07-23 苏宁金融科技(南京)有限公司 Block chain data parallel writing method and device, computer equipment and storage medium

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109769032A (en) * 2019-02-20 2019-05-17 西安电子科技大学 A kind of distributed computing method, system and computer equipment
CN109995613B (en) * 2019-03-29 2021-02-05 北京乐蜜科技有限责任公司 Flow calculation method and device
US10999283B2 (en) 2019-04-15 2021-05-04 Advanced New Technologies Co., Ltd. Addressing transaction conflict in blockchain systems
CN110189121B (en) * 2019-04-15 2021-04-09 创新先进技术有限公司 Data processing method and device, block chain client and block chain link point
CN110046166B (en) * 2019-04-22 2021-06-18 网易(杭州)网络有限公司 Timing task scheduling method and device based on block chain
WO2019137567A2 (en) 2019-04-30 2019-07-18 Alibaba Group Holding Limited Method and device for avoiding double-spending problem in read-write set-model-based blockchain technology
CN110245006B (en) * 2019-05-07 2023-05-02 深圳壹账通智能科技有限公司 Method, device, equipment and storage medium for processing block chain transaction
CN110704112B (en) * 2019-08-30 2021-04-02 创新先进技术有限公司 Method and apparatus for concurrently executing transactions in a blockchain
CN110781196A (en) * 2019-09-06 2020-02-11 深圳壹账通智能科技有限公司 Block chain transaction processing method and device, computer equipment and storage medium
CN112734338B (en) * 2021-01-15 2022-07-12 苏州浪潮智能科技有限公司 First-in first-out warehouse-out control method, system and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046724A (en) * 2006-05-10 2007-10-03 华为技术有限公司 Dish interface processor and method of processing disk operation command
CN105528196A (en) * 2015-12-25 2016-04-27 大连陆海科技股份有限公司 Sea chart data processing and displaying system and method with multi-core assembly line work mode
CN106358003A (en) * 2016-08-31 2017-01-25 华中科技大学 Video analysis and accelerating method based on thread level flow line
US20170115976A1 (en) * 2015-10-23 2017-04-27 Oracle International Corporation Managing highly scalable continuous delivery pipelines
CN107402805A (en) * 2016-05-18 2017-11-28 中国科学院微电子研究所 A kind of way to play for time and system of multi-stage pipeline parallel computation
CN108011840A (en) * 2017-12-07 2018-05-08 中国银行股份有限公司 Control method, server and the system of transaction request

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888514A (en) * 2017-11-17 2018-04-06 北京东土军悦科技有限公司 Message transmission method, message transfer device and electronic equipment in a kind of equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046724A (en) * 2006-05-10 2007-10-03 华为技术有限公司 Dish interface processor and method of processing disk operation command
US20170115976A1 (en) * 2015-10-23 2017-04-27 Oracle International Corporation Managing highly scalable continuous delivery pipelines
CN105528196A (en) * 2015-12-25 2016-04-27 大连陆海科技股份有限公司 Sea chart data processing and displaying system and method with multi-core assembly line work mode
CN107402805A (en) * 2016-05-18 2017-11-28 中国科学院微电子研究所 A kind of way to play for time and system of multi-stage pipeline parallel computation
CN106358003A (en) * 2016-08-31 2017-01-25 华中科技大学 Video analysis and accelerating method based on thread level flow line
CN108011840A (en) * 2017-12-07 2018-05-08 中国银行股份有限公司 Control method, server and the system of transaction request

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990157A (en) * 2019-12-09 2020-04-10 云南电网有限责任公司保山供电局 Wave recording master station communication transmission system and method adapting to micro-thread mechanism
CN111221639A (en) * 2020-01-09 2020-06-02 杭州趣链科技有限公司 Block pipeline execution method of block chain platform
CN112019350A (en) * 2020-08-31 2020-12-01 光大科技有限公司 Block verification method and device for block chain
CN112019350B (en) * 2020-08-31 2024-02-02 光大科技有限公司 Block verification method and device for block chain
CN113157710A (en) * 2021-02-01 2021-07-23 苏宁金融科技(南京)有限公司 Block chain data parallel writing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110457123B (en) 2021-06-15
CN109271245A (en) 2019-01-25
CN109271245B (en) 2021-04-27

Similar Documents

Publication Publication Date Title
CN110457123A (en) A kind of control method and device of block processes task
US11973869B2 (en) Maintaining blocks of a blockchain in a partitioned blockchain network
CN111144883B (en) Processing performance analysis method and device for blockchain network
CN109831500A (en) The synchronous method of configuration file and Pod in Kubernetes cluster
CN108959621A (en) A kind of implementation method, device, equipment and the storage medium of block chain network
CN109522362A (en) Incomplete markets synchronous method, system and equipment based on block chain data
CN105701159B (en) A kind of data synchronization unit and method
CN104462497B (en) Inter-library transaction methods and system based on relevant database
CN110427385A (en) Block chain data-updating method, interdependent node and block chain
CN111080288A (en) Block chain consensus achieving method and device based on directed acyclic graph
CN106599018A (en) Inventory operation method and system
CN109063049A (en) A kind of account processing method, device, equipment and the storage medium of block chain network
CN110839056B (en) Data processing method and device based on block chain and node network
CN109447636A (en) A kind of assets transfer method and device
CN110535679A (en) Management method, framework, network slice sales platform and the management system of slice
CN110930152B (en) Data processing method based on block chain and related equipment
CN103634379A (en) Management method for distributed storage space and distributed storage system
CN110599166A (en) Method and device for acquiring transaction dependency relationship in block chain
CN106295326A (en) A kind of inline hook method and system for obtaining video card content
CN110599175A (en) Block processing method and related equipment
CN110210845A (en) For the method, apparatus of block chain Data Migration, medium and calculate equipment
CN110046638A (en) Fusion method, device and the equipment of multi-platform data
CN108829802A (en) It is associated with log back method and device
CN107947965A (en) Service chaining compiler
CN110766410A (en) Method and equipment for constructing and verifying credible cross-chain event based on Mercker tree

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40015608

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant