CN111369358A - Block chain consensus method and device and electronic equipment - Google Patents

Block chain consensus method and device and electronic equipment Download PDF

Info

Publication number
CN111369358A
CN111369358A CN202010084776.1A CN202010084776A CN111369358A CN 111369358 A CN111369358 A CN 111369358A CN 202010084776 A CN202010084776 A CN 202010084776A CN 111369358 A CN111369358 A CN 111369358A
Authority
CN
China
Prior art keywords
consensus
nodes
transaction
main
new block
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
CN202010084776.1A
Other languages
Chinese (zh)
Other versions
CN111369358B (en
Inventor
王晓亮
张亚宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Rivtower Technology Co Ltd
Original Assignee
Hangzhou Rivtower Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Rivtower Technology Co Ltd filed Critical Hangzhou Rivtower Technology Co Ltd
Priority to CN202010084776.1A priority Critical patent/CN111369358B/en
Publication of CN111369358A publication Critical patent/CN111369358A/en
Application granted granted Critical
Publication of CN111369358B publication Critical patent/CN111369358B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Computing Systems (AREA)
  • Economics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Retry When Errors Occur (AREA)

Abstract

One or more embodiments of the present specification disclose a block chain consensus method, an apparatus and an electronic device, where the method includes: all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction; broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus; if the consensus is achieved, the consensus is successful; otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful. In the whole consensus process, all consensus nodes execute parallel packaging transaction to form a new block only when the first round of consensus starts, once the current consensus fails, the step of executing packaging transaction by spending time and resources again in the subsequent consensus process is not needed, and the consensus step is directly entered, so that the packaging transaction step is simplified and optimized, the packaging transaction time is reduced, further, the overall consensus duration is saved, and the consensus efficiency and performance are improved.

Description

Block chain consensus method and device and electronic equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a blockchain consensus method, an apparatus, and an electronic device.
Background
The blockchain is a decentralized and innovative solution for solving the multi-party trust problem by using a distributed book technology, and is a leading-edge technology of the current society.
In the blockchain technology, the common recognition protocol is generally divided into a federation chain and a public chain according to characteristics of the common recognition protocol, a byzantine BFT-type common recognition algorithm is generally adopted in the federation chain, and an overall flow of such a common recognition algorithm may include: selecting a master node Leader, packaging and trading the Leader to form a new block, broadcasting the new block by the Leader and carrying out consensus with other consensus nodes, and if the consensus is finally achieved, successfully completing the consensus; otherwise, entering a new round of consensus, reselecting the Leader, repackaging the transaction to form a new block, then performing consensus again, and if the consensus is not achieved in the round, repeating the process to enter the new round of consensus until the consensus is completed.
However, in the implementation process of the consensus algorithm, as shown in fig. 1, the packing and consensus are performed in series, and after the current round of consensus fails, packing and consensus still need to be performed again in a new round of consensus algorithm.
Disclosure of Invention
One or more embodiments of the present disclosure are directed to a blockchain consensus method, apparatus, and electronic device for optimizing a flow of a packed transaction and reducing an overall consensus time based on transaction implementation.
To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:
in a first aspect, a block chain consensus method is provided, including:
all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction;
broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus;
if the consensus is achieved, the consensus is successful;
otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful.
In a second aspect, an apparatus for block chain consensus is provided, including:
the packaging module is used for respectively packaging all the consensus nodes in the block chain in parallel to form a new block in the transaction;
the consensus module is used for performing consensus on the basis of broadcasting a new block formed by the packaged main nodes by the main nodes;
the judging module is used for judging whether the consensus is achieved or not, and if so, the consensus is successful;
otherwise, jumping to a consensus module, and performing consensus based on a new block formed by the packaged main node broadcast by the re-elected main node until the consensus is successful.
In a third aspect, an electronic device is provided, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform:
all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction;
broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus;
if the consensus is achieved, the consensus is successful;
otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful.
In a fourth aspect, a computer-readable storage medium is presented, storing one or more programs which, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform:
all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction;
broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus;
if the consensus is achieved, the consensus is successful;
otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful.
According to the technical scheme provided by one or more embodiments of the specification, in the consensus algorithm, all consensus nodes in a block chain are respectively packed in parallel to form a new block in the transaction; broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus; if the consensus is achieved, the consensus is successful; otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful. In the whole consensus process, all consensus nodes execute parallel packaging transaction to form a new block only when the first round of consensus starts, once the current consensus fails, the step of executing packaging transaction by spending time and resources again in the subsequent consensus process is not needed, and the consensus step is directly entered, so that the packaging transaction step is simplified and optimized, the packaging transaction time is reduced, further, the overall consensus duration is saved, and the consensus efficiency and performance are improved.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, reference will now be made briefly to the attached drawings, which are needed in the description of one or more embodiments or prior art, and it should be apparent that the drawings in the description below are only some of the embodiments described in the specification, and that other drawings may be obtained by those skilled in the art without inventive exercise.
FIG. 1 is a schematic diagram of the packing and consensus steps of the prior art consensus algorithm.
Fig. 2a is a schematic diagram illustrating a block chain consensus method according to an embodiment of the present disclosure.
FIG. 2b is a second schematic diagram illustrating a block chain consensus method according to an embodiment of the present disclosure
Fig. 3 is a schematic diagram of the packing and consensus steps of the consensus algorithm provided by an embodiment of the present specification.
Fig. 4 is a schematic diagram illustrating steps of a blockchain consensus algorithm according to an embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of a block chain consensus device according to an embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Detailed Description
In order to make the technical solutions in the present specification better understood, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present specification, and it is obvious that the one or more embodiments described are only a part of the embodiments of the present specification, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments described herein without making any inventive step shall fall within the scope of protection of this document.
Example one
Referring to fig. 2a, a schematic step diagram of a blockchain consensus method provided in an embodiment of the present disclosure is shown, it should be understood that the method is applied in a blockchain network, and an execution subject of the method may be a blockchain consensus device deployed in the blockchain network through an intelligent contract. The consensus method may comprise the steps of:
step 202: and all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction.
In other words, at the beginning of the first round of consensus of the consensus protocol, all consensus nodes in the blockchain network pack the transaction, and the operations of the packed transaction are executed in parallel, and finally each consensus node forms a new block.
An implementation scheme, when performing the operation of separately and concurrently packaging the transaction to form a new block based on all the consensus nodes in the block chain in step 202, may specifically include:
the first step is to select a common node from the common nodes of the block chain as a main node.
And secondly, respectively packaging the transaction in parallel by the main node and other consensus nodes except the main node in the block chain, and respectively forming new blocks.
In another implementation, after the step 202 is executed to pack the transaction into new blocks based on all common identification nodes in the block chain, and before the step 204 is executed to perform common identification based on the master node broadcasting the new blocks that have been packed into the master node, the method further includes:
and selecting one common node from the common nodes of the block chain as a main node.
Thus, in step 202, the master node Leader may be elected first, and then all the consensus nodes including the Leader respectively pack the contents of the transaction, each consensus node forms a new block, and the process of packing the new blocks is executed in parallel; or, the contents of the transaction may be packaged by all the consensus nodes, each consensus node forms a new block, and the process of packaging the new blocks by the consensus nodes is executed in parallel, and then a Leader is selected from the consensus nodes. No matter the Leader is elected first and then the transaction is packaged in parallel, or the Leader is elected first and then the transaction is packaged in parallel, the purpose of packaging the transaction of all the consensus nodes can be achieved in a parallel mode within the time length of one packaging transaction.
It should be understood that, in the embodiment of the present specification, the scheme related to the packaging transaction and the grouping of the new block may be implemented by referring to the existing scheme, and details are not described herein.
Step 204: and performing consensus based on the new blocks formed by the master nodes packaged by the master nodes.
The master node Leader broadcasts the new block formed by the master node packaged in the transaction in step 202 to other consensus nodes in the blockchain network for network consensus. The specific consensus operation can be implemented by referring to the existing scheme, which is not described herein.
If the consensus is achieved, the consensus is successful; otherwise, step 206 is executed and the process jumps to step 204 until the consensus is successful.
Step 206: and re-electing the master node.
Referring to FIG. 3, after the first round of consensus is not achieved, a second round of consensus is entered. Considering that other consensus nodes of the current transaction are packed in parallel and form a new block in step 202, the step of packing the transaction does not need to be executed again, but only the master node Leader needs to be reselected, and the consensus step is directly executed, namely, the step 204 is directly skipped to, the newly elected master node Leader broadcasts the new block formed by self packing to perform consensus, if the second round of consensus is not achieved, the third round of consensus … … is entered again, namely, the second round of consensus begins, and each subsequent round of consensus process only comprises the consensus step and does not comprise the packing process until the consensus is successful.
According to the technical scheme, in the consensus algorithm, all consensus nodes in a block chain are respectively packed in parallel to form a new block in the transaction; broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus; if the consensus is achieved, the consensus is successful; otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful. In the whole consensus process, all consensus nodes execute parallel packaging transaction to form a new block only when the first round of consensus starts, once the current consensus fails, the step of executing packaging transaction by spending time and resources again in the subsequent consensus process is not needed, and the consensus step is directly entered, so that the packaging transaction step is simplified and optimized, the packaging transaction time is reduced, further, the overall consensus duration is saved, and the consensus efficiency and performance are improved.
It should be noted that the consensus scheme of the present disclosure is mainly applied to the blockchain consensus scheme that may involve multiple rounds of consensus processes.
An implementation scenario, shown in fig. 2b, after the consensus is successful, the method further includes:
step 208: and deleting the new blocks formed by other common identification nodes based on the current transaction except the main node corresponding to the new block currently carrying out common identification.
Therefore, the new blocks on other common nodes corresponding to the transaction of the common block which is completed are deleted, and the resource space on the common node is recovered.
The consensus algorithm referred to in the present specification is detailed below by specific examples.
Referring to fig. 4, assume that N rounds of consensus may be performed based on the transaction, where the value of N is unknown. And the time of the packaging step (one packaging transaction constitutes a new block) is d, and the time of the consensus step is c. Then, the consensus algorithm may include:
step 402: and electing a master node Leader.
Step 404: and the master node Leader and other consensus nodes are packaged in parallel to form a new block in the transaction.
Step 406: and broadcasting a new block packaged by the master node Leader for consensus.
If the consensus is achieved, the consensus is successful; if consensus is not achieved, step 408 is performed.
Step 408: the master node Leader is reselected and jumps to step 406.
After N rounds of consensus are identified, the consensus is successful, and at the beginning of the first consensus, all consensus nodes are packaged and transacted in parallel to form a new block, and no additional packaging time is needed from the second round to each round, so that the original consensus total time N (d + c) can be reduced to d + N c, and the consensus performance can be obviously improved under the condition of multiple rounds of consensus.
Example two
Referring to fig. 5, for the block chain consensus apparatus provided in the embodiments of the present disclosure, the apparatus 500 may include:
a packing module 502, configured to pack all consensus nodes in the block chain in parallel to form a new block in the transaction;
a consensus module 504, configured to perform consensus on the basis of a new block formed by the master node by broadcasting the master node;
a determining module 506, configured to determine that the consensus is successful if the consensus is achieved;
otherwise, the user jumps to the consensus module 504, and performs consensus on the newly elected main node broadcast new blocks formed by self-packaging until the consensus is successful.
Optionally, as an embodiment, the apparatus further includes:
and the deleting module is used for deleting the new blocks formed by other common identification nodes based on the current transaction except the main node corresponding to the new block currently subjected to common identification after the common identification is successful.
In a specific implementation manner of the embodiment of this specification, when the packing module 602 packs the transaction in parallel to form a new block based on all consensus nodes in the block chain, the packing module is specifically configured to:
selecting a common node from the common nodes of the block chain as a main node;
and the main node and other common nodes except the main node in the block chain are respectively packaged in parallel for the transaction and respectively form a new block.
In another specific implementation manner of the embodiment of the present specification, the apparatus further includes:
and the selecting module is used for selecting one consensus node from the consensus nodes of the block chain as the main node after the packaging module respectively packages the transaction to form a new block based on all consensus nodes in the block chain and before the consensus module broadcasts the new block formed by the packaged main node to perform consensus based on the main node.
According to the technical scheme, in the consensus algorithm, all consensus nodes in a block chain are respectively packed in parallel to form a new block in the transaction; broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus; if the consensus is achieved, the consensus is successful; otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful. In the whole consensus process, all consensus nodes execute parallel packaging transaction to form a new block only when the first round of consensus starts, once the current consensus fails, the step of executing packaging transaction by spending time and resources again in the subsequent consensus process is not needed, and the consensus step is directly entered, so that the packaging transaction step is simplified and optimized, the packaging transaction time is reduced, further, the overall consensus duration is saved, and the consensus efficiency and performance are improved.
EXAMPLE III
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present specification. Referring to fig. 6, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (peripheral component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the block chain consensus device on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction;
broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus;
if the consensus is achieved, the consensus is successful;
otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful.
The method performed by the apparatus according to the embodiment shown in fig. 2a and fig. 2b in this specification can be implemented in a processor or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method shown in fig. 2a and fig. 2b, and implement the functions of the corresponding apparatus in the embodiments shown in fig. 2 and fig. 2b, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
According to the technical scheme, in the consensus algorithm, all consensus nodes in a block chain are respectively packed in parallel to form a new block in the transaction; broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus; if the consensus is achieved, the consensus is successful; otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful. In the whole consensus process, all consensus nodes execute parallel packaging transaction to form a new block only when the first round of consensus starts, once the current consensus fails, the step of executing packaging transaction by spending time and resources again in the subsequent consensus process is not needed, and the consensus step is directly entered, so that the packaging transaction step is simplified and optimized, the packaging transaction time is reduced, further, the overall consensus duration is saved, and the consensus efficiency and performance are improved.
Example four
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 2a and 2b, and in particular for performing the method of:
all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction;
broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus;
if the consensus is achieved, the consensus is successful;
otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful.
According to the technical scheme, in the consensus algorithm, all consensus nodes in a block chain are respectively packed in parallel to form a new block in the transaction; broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus; if the consensus is achieved, the consensus is successful; otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful. In the whole consensus process, all consensus nodes execute parallel packaging transaction to form a new block only when the first round of consensus starts, once the current consensus fails, the step of executing packaging transaction by spending time and resources again in the subsequent consensus process is not needed, and the consensus step is directly entered, so that the packaging transaction step is simplified and optimized, the packaging transaction time is reduced, further, the overall consensus duration is saved, and the consensus efficiency and performance are improved.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.
The system, apparatus, module or unit illustrated in one or more of the above embodiments may be implemented by a computer chip or an entity, or by an article of manufacture with a certain functionality. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

Claims (10)

1. A method of block chain consensus, comprising:
all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction;
broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus;
if the consensus is achieved, the consensus is successful;
otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful.
2. The method of claim 1, after the consensus is successful, the method further comprising:
and deleting the new blocks formed by other common identification nodes based on the current transaction except the main node corresponding to the new block currently carrying out common identification.
3. The method according to claim 1 or 2, wherein all the consensus nodes in the block chain are packed in parallel into the new block for the transaction, and the method specifically comprises:
selecting a common node from the common nodes of the block chain as a main node;
and the main node and other common nodes except the main node in the block chain are respectively packaged in parallel for the transaction and respectively form a new block.
4. The method of claim 1 or 2, after all the consensus nodes in the block chain pack the transaction to form a new block, and before performing consensus based on the master node broadcasting the new block formed by the master node by packaging, the method further comprises:
and selecting one common node from the common nodes of the block chain as a main node.
5. A blockchain consensus apparatus, comprising:
the packaging module is used for respectively packaging all the consensus nodes in the block chain in parallel to form a new block in the transaction;
the consensus module is used for performing consensus on the basis of broadcasting a new block formed by the packaged main nodes by the main nodes;
the judging module is used for judging whether the consensus is achieved or not, and if so, the consensus is successful;
otherwise, jumping to a consensus module, and performing consensus based on a new block formed by the packaged main node broadcast by the re-elected main node until the consensus is successful.
6. The apparatus of claim 5, further comprising:
and the deleting module is used for deleting the new blocks formed by other common identification nodes based on the current transaction except the main node corresponding to the new block currently subjected to common identification after the common identification is successful.
7. The apparatus according to claim 5 or 6, wherein the packing module, when packing the transaction in parallel to form a new block based on all the consensus nodes in the block chain, is specifically configured to:
selecting a common node from the common nodes of the block chain as a main node;
and the main node and other common nodes except the main node in the block chain are respectively packaged in parallel for the transaction and respectively form a new block.
8. The apparatus of claim 5 or 6, further comprising:
and the selecting module is used for selecting one consensus node from the consensus nodes of the block chain as the main node after the packaging module respectively packages the transaction to form a new block based on all consensus nodes in the block chain and before the consensus module broadcasts the new block formed by the packaged main node to perform consensus based on the main node.
9. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform:
all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction;
broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus;
if the consensus is achieved, the consensus is successful;
otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful.
10. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform:
all the consensus nodes in the block chain are respectively packed in parallel to form a new block in the transaction;
broadcasting a new block formed by the packaged main nodes based on the main nodes to perform consensus;
if the consensus is achieved, the consensus is successful;
otherwise, the consensus is carried out based on the re-elected main node broadcasting the new blocks formed by packaging the main node until the consensus is successful.
CN202010084776.1A 2020-02-10 2020-02-10 Block chain consensus method and device and electronic equipment Active CN111369358B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010084776.1A CN111369358B (en) 2020-02-10 2020-02-10 Block chain consensus method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010084776.1A CN111369358B (en) 2020-02-10 2020-02-10 Block chain consensus method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111369358A true CN111369358A (en) 2020-07-03
CN111369358B CN111369358B (en) 2023-09-12

Family

ID=71211437

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010084776.1A Active CN111369358B (en) 2020-02-10 2020-02-10 Block chain consensus method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111369358B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112232957A (en) * 2020-10-16 2021-01-15 网易(杭州)网络有限公司 Transaction consensus method and device and electronic equipment
CN112347193A (en) * 2020-11-27 2021-02-09 网易(杭州)网络有限公司 Transaction packaging method and device based on block chain and electronic equipment
CN113364871A (en) * 2021-06-07 2021-09-07 杭州溪塔科技有限公司 Node election method and device based on intelligent contract and electronic equipment
CN114090694A (en) * 2022-01-19 2022-02-25 安徽中科晶格技术有限公司 PoA consensus method, device, equipment and storage medium
CN114221961A (en) * 2021-12-14 2022-03-22 深圳前海微众银行股份有限公司 Hierarchical DAG block chain generation method, apparatus, medium, and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109242685A (en) * 2018-08-29 2019-01-18 众安信息技术服务有限公司 Common recognition and verification method and device based on block chain
CN109886681A (en) * 2019-01-31 2019-06-14 北京瑞卓喜投科技发展有限公司 Block chain common recognition method and common recognition system
US20190327097A1 (en) * 2017-05-22 2019-10-24 Alibaba Group Holding Limited Blockchain service acceptance and consensus method and devices
CN110517141A (en) * 2019-08-27 2019-11-29 深圳前海微众银行股份有限公司 A kind of common recognition method and device based on block catenary system
CN110659988A (en) * 2019-09-10 2020-01-07 杭州秘猿科技有限公司 Parallel processing method and device for block chain consensus and execution and electronic equipment
CN110727731A (en) * 2019-09-05 2020-01-24 阿里巴巴集团控股有限公司 Method for adding node in block chain network and block chain system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190327097A1 (en) * 2017-05-22 2019-10-24 Alibaba Group Holding Limited Blockchain service acceptance and consensus method and devices
CN109242685A (en) * 2018-08-29 2019-01-18 众安信息技术服务有限公司 Common recognition and verification method and device based on block chain
CN109886681A (en) * 2019-01-31 2019-06-14 北京瑞卓喜投科技发展有限公司 Block chain common recognition method and common recognition system
CN110517141A (en) * 2019-08-27 2019-11-29 深圳前海微众银行股份有限公司 A kind of common recognition method and device based on block catenary system
CN110727731A (en) * 2019-09-05 2020-01-24 阿里巴巴集团控股有限公司 Method for adding node in block chain network and block chain system
CN110659988A (en) * 2019-09-10 2020-01-07 杭州秘猿科技有限公司 Parallel processing method and device for block chain consensus and execution and electronic equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112232957A (en) * 2020-10-16 2021-01-15 网易(杭州)网络有限公司 Transaction consensus method and device and electronic equipment
CN112347193A (en) * 2020-11-27 2021-02-09 网易(杭州)网络有限公司 Transaction packaging method and device based on block chain and electronic equipment
CN113364871A (en) * 2021-06-07 2021-09-07 杭州溪塔科技有限公司 Node election method and device based on intelligent contract and electronic equipment
CN114221961A (en) * 2021-12-14 2022-03-22 深圳前海微众银行股份有限公司 Hierarchical DAG block chain generation method, apparatus, medium, and program product
CN114221961B (en) * 2021-12-14 2024-03-26 深圳前海微众银行股份有限公司 Hierarchical DAG blockchain generation method, apparatus, medium, and program product
CN114090694A (en) * 2022-01-19 2022-02-25 安徽中科晶格技术有限公司 PoA consensus method, device, equipment and storage medium
CN114090694B (en) * 2022-01-19 2022-04-15 安徽中科晶格技术有限公司 PoA consensus method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111369358B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
CN111369358A (en) Block chain consensus method and device and electronic equipment
CN110659988B (en) Parallel processing method and device for block chain consensus and execution and electronic equipment
US10999060B2 (en) Data processing method and apparatus
JP6876806B2 (en) Blockchain Consensus Formation Methods and Devices
CN108846749B (en) Partitioned transaction execution system and method based on block chain technology
CN111461887B (en) Block chain consensus processing method and device and electronic equipment
CN110020859B (en) Parallel execution block chain consensus method and device and electronic equipment
CN110648136B (en) Consensus and transaction synchronous parallel processing method and device and electronic equipment
CN110708163B (en) Block chain consensus method, device and system and electronic equipment
CN112506671B (en) Transaction processing method and device in block chain and electronic equipment
CN112153143A (en) Kubernetes cluster flow scheduling method and device and electronic equipment
CN111882322A (en) Method and device for packaging transactions in sequence and electronic equipment
CN110648125B (en) Packaging transaction method and device, electronic equipment and storage medium
CN111698244A (en) Method and device for rapidly participating in consensus of newly added nodes and electronic equipment
CN111523887A (en) Authority control method and device of intelligent contract read-only method and electronic equipment
CN109345081B (en) Data acquisition method and device and electronic equipment
CN111709748B (en) Transaction execution method and device with business attribute and electronic equipment
CN110599139B (en) Block output method and device in block chain consensus algorithm
CN108388982B (en) Task running method and device and electronic equipment
CN110750271B (en) Service aggregation, method and device for executing aggregated service and electronic equipment
CN113706146A (en) Processing method, device and system for executing batch transaction based on block chain
CN109903048B (en) Block output method, consensus method and device
CN110704134A (en) Method and device for performing function expansion on block chain
CN115630229A (en) Method and device for improving block chain consensus efficiency
CN108829732B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant