Movatterモバイル変換


[0]ホーム

URL:


CN112506671A - Transaction processing method and device in block chain and electronic equipment - Google Patents

Transaction processing method and device in block chain and electronic equipment
Download PDF

Info

Publication number
CN112506671A
CN112506671ACN202110146211.6ACN202110146211ACN112506671ACN 112506671 ACN112506671 ACN 112506671ACN 202110146211 ACN202110146211 ACN 202110146211ACN 112506671 ACN112506671 ACN 112506671A
Authority
CN
China
Prior art keywords
block
transaction
consensus
nth
blockchain
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
CN202110146211.6A
Other languages
Chinese (zh)
Other versions
CN112506671B (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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai 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 Alipay Hangzhou Information Technology Co Ltd, Ant Blockchain Technology Shanghai Co LtdfiledCriticalAlipay Hangzhou Information Technology Co Ltd
Priority to CN202110692124.0ApriorityCriticalpatent/CN113204432B/en
Priority to CN202110146211.6Aprioritypatent/CN112506671B/en
Publication of CN112506671ApublicationCriticalpatent/CN112506671A/en
Application grantedgrantedCritical
Publication of CN112506671BpublicationCriticalpatent/CN112506671B/en
Priority to PCT/CN2022/073652prioritypatent/WO2022166673A1/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The embodiment of the specification discloses a transaction processing method and device in a block chain and electronic equipment. The method comprises the following steps: the block chain node executes a transaction execution operation corresponding to the Nth block, wherein the transaction corresponding to the Nth block is agreed in the block chain system; and in the process that the block chain node executes the transaction execution operation corresponding to the Nth block, executing the consensus operation of the transaction corresponding to the (N + 1) th block in parallel.

Description

Transaction processing method and device in block chain and electronic equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and an apparatus for processing transactions in a blockchain, and an electronic device.
Background
In some blockchain systems, the flow of transaction processing may be as shown in fig. 1, including the following four stages: collect transaction → consensus → transaction execution → write block. Through the above process, a tile can be generated. After a block (e.g., the nth block in fig. 1) is generated, the transaction processing flow of the next block (e.g., the (N + 1) th block in fig. 1) is entered.
As mentioned above, the transaction processing flow of a tile in the blockchain system includes four stages. After the nth block is generated, the transaction processing flow of the (N + 1) th block is entered. In such a transaction processing manner, at any time point, the consensus node can only process one stage corresponding to one block. This approach does not make good use of the processing resources of the nodes, for example, the parallel computing characteristics of multiple cores are not made good use of, and the performance of the blockchain system is difficult to be improved.
Fig. 1 shows a general process for processing a transaction by a consensus node in a blockchain system. In some blockchain systems, not all of the common nodes perform the transaction collection operations in the four phases described above. For example, in some block chain systems using a main consensus algorithm (e.g., Practical Byzantine Fault Tolerance, PBFT), the consensus master node may perform the four phases of operations, and the consensus non-master node may perform the three phases of operations of consensus → transaction execution → block writing; or each common node may perform all the operations of the four phases. In some other blockchain systems that use an algorithm without main consensus (e.g., honeyy Badger Byzantine Fault Tolerant, HBBFT, Badger bazaltion Fault-Tolerant algorithm), the nodes with consensus do not distinguish between main nodes or non-main nodes, and each node with consensus can perform all the above four phases of operations.
Chinese patent application publication No. CN111522648A discloses a transaction processing method, in which block chain nodes execute block writing operation of the nth round of transaction and consensus execution operation of the N +1 th round of transaction in parallel. A representative embodiment may be as shown in fig. 2 (which is also fig. 2 of the patent application publication No. CN 111522648A). As shown in fig. 2, a first thread and a second thread may be executed in parallel, and during the execution of N rounds of consensus and transaction by the first thread, the second thread may perform a block writing operation for the N-1 st round of transaction in parallel; in the process that the first thread carries out N +1 rounds of consensus and transaction execution, the second thread can carry out block writing operation of Nth round of transaction in parallel; during the process of carrying out N +2 rounds of consensus and transaction execution by the first thread, the second thread can carry out block writing operation of N +1 round of transaction in parallel. The above example mainly aims at the situation that the occupation time of the consensus phase and the transaction execution phase is short and the occupation time of the block writing phase is long in the transaction processing process of the blockchain system. Thus, the coupling of the consensus operation and the transaction execution operation in the same round is maintained, while being decoupled from the write block operation of the round, so that two different threads can be used to execute (consensus + transaction execution) and write block, respectively. In this way, in the process of executing the block writing operation of the previous block, the operation of (consensus + transaction execution) of the next block can be executed in parallel, and the method is particularly suitable for processing by a computer adopting a multi-core CPU (central processing unit), so that the transaction processing efficiency can be improved, and the blockchain system can be suitable for application scenes with high business concurrence.
In fact, transactions collected in a certain round may include ordinary transfer transactions and transactions involving smart contracts. For ordinary transfer transactions, the processing time is generally relatively short, whereas for transactions involving smart contracts, the contract logic may be more complex, or transactions involving contracts may be more numerous, such that the processing time may be relatively long. Thus, for transactions involving a large number of transactions involving smart contracts, or for smart contracts involving complex logic, the transaction execution link may have a processing time that is longer than the processing time of the consensus link, closer to the processing time of the write block operation, or even longer than the processing time of the write block operation. Thus, only the (consensus + trade execution) and write blocks are decoupled in this example, and there is still further room for optimization.
Disclosure of Invention
The embodiment of the specification provides a transaction processing method and device in a block chain and electronic equipment.
A method of transaction processing in a blockchain, comprising:
the block chain node executes a transaction execution operation corresponding to the Nth block, wherein the transaction corresponding to the Nth block is agreed in the block chain system;
and in the process that the block chain node executes the transaction execution operation corresponding to the Nth block, executing the consensus operation of the transaction corresponding to the (N + 1) th block in parallel, wherein N is a positive integer.
A transaction processing device applied to a blockchain node comprises:
a transaction execution module for executing a transaction execution operation corresponding to an nth block, wherein the transaction corresponding to the nth block has agreed in a blockchain system;
and the consensus module is used for parallelly executing the consensus operation on the transaction corresponding to the (N + 1) th block in the process of executing the transaction execution operation corresponding to the Nth block by the transaction execution module.
An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
executing a transaction execution operation corresponding to an Nth block, wherein the transaction corresponding to the Nth block has reached a consensus in a blockchain system;
and in the process of executing the transaction execution operation corresponding to the Nth block, executing the consensus operation of the transaction corresponding to the (N + 1) th block in parallel, wherein N is a positive integer.
By adopting the transaction processing method provided by the embodiment of the specification, when the transaction in the blockchain system is processed, the blockchain link points can process different stages of the corresponding transaction of different blocks in parallel, the computing power of the multi-core CPU is utilized, the operation efficiency of the blockchain system is greatly improved, and the performance is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
FIG. 1 is a schematic diagram illustrating a process for processing transactions in a blockchain system provided in the prior art;
FIG. 2 is a process diagram of a transaction processing method provided by the prior art;
fig. 3 is a schematic flow chart of an implementation of a transaction processing method in a blockchain according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating an embodiment of a method for processing transactions in a blockchain according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a transaction processing device according to an embodiment of the present disclosure.
Detailed Description
In order to make the purpose, technical solutions and advantages of this document more clear, the technical solutions of this specification will be clearly and completely described below with reference to specific embodiments of this specification and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of this document, and not all embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step based on the embodiments in this description belong to the protection scope of this document.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
One or more embodiments of the present specification provide a method for processing a transaction in a blockchain, where an implementation flow diagram is shown in fig. 3, and the method includes:
instep 310, the block node performs a transaction execution operation corresponding to the nth block.
The transaction corresponding to the nth block may be a transaction that has agreed in the blockchain system. Further, instep 310, the block link point may execute the transaction corresponding to the nth block that has been agreed upon.
The transaction execution operation may be processed by a transaction execution thread in a blockchain node. The above consensus operation may be handled by a consensus thread in a blockchain node.
As described in the background, the transaction processing in blockchain systems typically includes four distinct operations, collecting transactions, transaction consensus, transaction execution, and writing blocks. As mentioned above, each consensus node may perform all the operations of the four phases, or some consensus nodes may perform the operations of the last three phases without performing the operation of collecting transactions. Thus, for a consensus node performing a collect transaction, this operation may also be performed by a separate thread in the consensus node, e.g., referred to as a transaction collect thread. Specifically, as shown in fig. 4, before the execution of the transaction execution operation corresponding to the nth block begins, the consensus node may query, through the transaction collection thread, whether the transactions collected in the transaction memory pool have satisfied the preset transaction collection condition. And if the preset transaction collection condition is met, the consensus node packs the transactions collected by the transaction memory pool through a transaction collection thread. In this way, the consensus node can get a proposal to be consensus. Further, the consensus node may perform the operation of the consensus phase through a consensus thread.
Specifically, when the consensus node is a consensus master node in the blockchain system adopting the master consensus algorithm, or the consensus node is a consensus node in the blockchain system adopting the masterless consensus algorithm, the consensus thread may obtain the transaction corresponding to the nth block from the collected transaction thread. Further, a consensus proposal may be initiated based on the transaction to perform a consensus phase operation, e.g., a consensus thread in a blockchain node may perform the consensus operation.
In addition, when the consensus node is a consensus non-master node in the blockchain system adopting the master consensus algorithm, the blockchain node responds to consensus proposals of transactions corresponding to the Nth block sent by other consensus nodes, and performs consensus operation based on the consensus proposals. The consensus operation may be performed, for example, by a consensus thread in a blockchain node. In this case, since the consensus node is in response to the sent consensus offer, and the sent consensus offer may include the transaction to be agreed upon, the consensus node may not perform the operation of collecting the transaction.
Since the consensus thread needs to acquire the transaction corresponding to the nth block from the collection transaction thread, the sequence of collection transaction → consensus can still be maintained for the processing flow of the transaction corresponding to the same block.
After the block link point completes the consensus operation on the transaction corresponding to the nth block, the transaction execution operation corresponding to the nth block instep 310 may be performed. The transaction execution operation may be performed, for example, by a transaction execution thread in a blockchain node.
Similarly, after the consensus operation of the nth block-corresponding transaction is completed, the consensus result is transmitted to the transaction execution thread of the block-linked node, so that the sequence of consensus → transaction execution can still be maintained for the processing flow of the same block-corresponding transaction.
Instep 320, during the process of executing the transaction execution operation corresponding to the nth block, the block nodes execute the consensus operation corresponding to the (N + 1) th block in parallel.
Similarly, before the consensus operation is performed on the transaction corresponding to the (N + 1) th block, the consensus node may query, through the transaction collection thread, whether the transaction collected in the transaction memory pool has satisfied the preset transaction collection condition. And if the preset transaction collection condition is met, the consensus node packs the transactions collected by the transaction memory pool through a transaction collection thread, so that the transaction corresponding to the (N + 1) th block is formed. In this way, the node can get a proposal to be agreed upon. Further, the consensus node may perform the operation of the consensus phase through the consensus thread, i.e., perform the consensus operation on the (N + 1) th block corresponding transaction instep 320.
Specifically, when the consensus node is a consensus master node in the blockchain system adopting the master consensus algorithm, or the consensus node is a consensus node in the blockchain system adopting the masterless consensus algorithm, the consensus thread may obtain the transaction corresponding to the (N + 1) th block from the collected transaction thread. Further, a consensus proposal may be initiated based on the transaction to enter into a consensus phase, e.g., a consensus thread in a blockchain node may perform the consensus operation.
When the consensus node is a consensus non-master node in the blockchain system using the master consensus algorithm, the blockchain node responds to consensus suggestions for the transaction corresponding to the (N + 1) th block from other consensus nodes, and performs consensus operations based on the consensus suggestions, for example, the consensus operations may be performed by a consensus thread in the blockchain node. In this case, since the consensus node is in response to the sent consensus offer, and the sent consensus offer may include the transaction to be agreed upon, the consensus node may not perform the operation of collecting the transaction.
Since the consensus thread needs to acquire the transaction corresponding to the (N + 1) th block from the collection transaction thread, the sequence of collection transaction → consensus can still be maintained for the processing flow of the transaction corresponding to the same block.
If the blockchain node performs the process of collecting the transaction corresponding to the nth block and performs the process of collecting the transaction corresponding to the (N + 1) th block, the blockchain node collects the transaction corresponding to the (N + 1) th block and then collects the transaction corresponding to the (N + 1) th block. This is particularly true where only one gather transaction thread is assigned to a blockchain node. And the blockchain node performs the operation of collecting the transaction corresponding to the (N + 1) th block in parallel in the process of identifying the transaction corresponding to the Nth block.
The consensus operation of the block link point on the transaction corresponding to the (N + 1) th block may be performed after the consensus on the transaction corresponding to the nth block is achieved. This is particularly true where only one consensus thread is assigned to a blockchain node.
It should be noted that the consensus proposal for the nth block and the consensus proposal for the (N + 1) th block may be initiated by the same consensus node or by different consensus nodes. For example, the consensus operation for the block-linked point for the nth block may be initiated by the block-linked point as the consensus master, while the consensus operation for the (N + 1) th block may be initiated by another block-linked point as the consensus master, or vice versa.
After the block link point completes the consensus operation on the transaction corresponding to the (N + 1) th block, the transaction corresponding to the (N + 1) th block may be executed. The transaction execution operation may be performed, for example, by a transaction execution thread in a blockchain node.
Similarly, after the consensus operation of the (N + 1) th block-corresponding transaction is performed by the consensus thread, the consensus result is transmitted to the transaction execution thread of the block link point, so that the sequence of consensus → transaction execution can still be maintained for the processing flow of the same block-corresponding transaction.
As shown in fig. 4, after the block link point completes the operation of executing the transaction corresponding to the nth block, the block link point may also write the result of executing the transaction into the nth block of the block chain book, i.e., a block writing operation. Similarly, during the block link point executing the block writing operation corresponding to the nth block, the transaction executing operation corresponding to the (N + 1) th block is executed in parallel.
The block link point may perform the operation on the transaction corresponding to the (N + 1) th block after performing the operation on the transaction corresponding to the nth block. This is particularly true where only one transaction execution thread is assigned to a blockchain node.
As shown in fig. 4, after the block link point completes the operation of executing the transaction corresponding to the (N + 1) th block, the block link point may also write the result of executing the transaction into the (N + 1) th block of the block chain ledger. Similarly, the block link point may perform a write block operation on the N +1 th block after the write block operation on the nth block. This is particularly true where the blockchain node has only one write block thread assigned.
When the block chain node completes the collection transaction operation corresponding to the (N + 1) th block, the consensus operation for the nth block may not be completed yet, and thus the consensus operation for the (N + 1) th block cannot be started yet. At this time, the block link point may store the collected transaction corresponding to the (N + 1) th block in the memory, extract the transaction corresponding to the (N + 1) th block from the memory after the corresponding consensus operation of the nth block is completed, and start the consensus operation on the transaction corresponding to the (N + 1) th block.
Similarly, when the block node completes the consensus operation corresponding to the (N + 1) th block, the transaction execution operation of the nth block may not be completed, and thus the transaction execution operation of the (N + 1) th block may not be started. At this time, the block link point may store the consensus result corresponding to the (N + 1) th block in the memory, and after the transaction execution operation corresponding to the nth block is completed, extract the consensus result corresponding to the (N + 1) th block from the memory, and start to execute the transaction execution operation corresponding to the (N + 1) th block.
Similarly, when the transaction execution operation corresponding to the (N + 1) th block is completed, the block writing operation for the nth block may not be completed, and thus the block writing operation for the (N + 1) th block may not be started. At this time, the block chain node may store the transaction execution result corresponding to the (N + 1) th block in the memory, and after the block writing operation corresponding to the nth block is completed, extract the transaction execution result corresponding to the (N + 1) th block from the memory, and start to execute the block writing operation corresponding to the (N + 1) th block.
By adopting the transaction processing method provided by the embodiment of the specification, when the transaction in the blockchain system is processed, the blockchain link points can process different stages of the corresponding transaction of different blocks in parallel, the computing power of the multi-core CPU is utilized, the operation efficiency of the blockchain system is greatly improved, and the performance is improved.
Fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification. Referring to fig. 5, 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. 5, but this 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 the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the transaction processing 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:
executing a transaction execution operation corresponding to an Nth block, wherein the transaction corresponding to the Nth block has reached a consensus in a blockchain system;
and in the process of executing the transaction execution operation corresponding to the Nth block, executing the consensus operation of the transaction corresponding to the (N + 1) th block in parallel, wherein N is a positive integer.
Based on the electronic device shown in fig. 5, it can be known that, in the scheme of the embodiment of the present specification, when the transaction in the blockchain system is processed, the blockchain link points can process different stages of the transaction corresponding to different blocks in parallel, and the computing power of the multi-core CPU is utilized, so that the operating efficiency of the blockchain system is greatly improved, and the performance is improved.
The transaction processing method in the blockchain disclosed in the embodiments of fig. 3 to 4 of the present specification can be applied to a processor, or can be 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 Gate or transistor logic devices, discrete hardware components. The various 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 transaction processing method in the block chain shown in fig. 3 to 4, which is not described herein again.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices 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 logic devices.
Embodiments of the present specification also provide a computer-readable storage medium storing one or more programs, where the one or more programs include instructions, which when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to perform the method of the embodiments shown in fig. 3 to 4, and are specifically configured to:
executing a transaction execution operation corresponding to an Nth block, wherein the transaction corresponding to the Nth block has reached a consensus in a blockchain system;
and in the process of executing the transaction execution operation corresponding to the Nth block, executing the consensus operation of the transaction corresponding to the (N + 1) th block in parallel, wherein N is a positive integer.
Fig. 6 is a schematic structural diagram of atransaction processing device 600 provided in an embodiment of the present specification. In a particular application, thetransaction processing device 600 may be a blockchain node, or the transaction processing device may be deployed on a blockchain node. Referring to fig. 6, in one embodiment, thetransaction processing device 600 includes:
atransaction executing module 603 configured to execute a transaction executing operation corresponding to an nth block, wherein the transaction corresponding to the nth block has been agreed in the blockchain system;
theconsensus module 602, during the transaction execution module executing the transaction execution operation corresponding to the nth block, concurrently executes the consensus operation corresponding to the (N + 1) th block.
Optionally, before thetransaction executing module 603 executes the transaction executing operation of the nth block, theconsensus module 602 performs consensus on the transaction corresponding to the nth block in the blockchain system.
Optionally, thetransaction processing apparatus 600 further includes atransaction collection module 601, and before theconsensus module 602 performs consensus on the transaction corresponding to the nth block in the blockchain system, thetransaction collection module 601 collects the transaction corresponding to the nth block.
Optionally, thetransaction processing apparatus 600 further includes ablock writing module 604, and after thetransaction executing module 603 completes the transaction executing operation corresponding to the nth block, theblock writing module 604 writes the result of the transaction executing operation into the nth block of the block chain ledger.
Optionally, theconsensus module 602 performs a consensus operation on the transaction corresponding to the (N + 1) th block after agreeing on the transaction corresponding to the nth block.
Optionally, in the process that theconsensus module 602 performs consensus on the transaction corresponding to the nth block, thetransaction collection module 601 performs an operation of collecting transactions corresponding to the (N + 1) th block in parallel.
Optionally, thetransaction collection module 601 performs an operation of collecting transactions corresponding to the (N + 1) th block after collecting transactions corresponding to the nth block.
Optionally, during the process that thewrite block module 604 performs the write block operation corresponding to the nth block, thetransaction execution module 603 performs the transaction execution operation corresponding to the (N + 1) th block in parallel.
Optionally, thetransaction executing module 603 executes the transaction executing operation corresponding to the (N + 1) th block after executing the transaction executing operation corresponding to the nth block.
Optionally, after thetransaction executing module 603 completes the transaction executing operation corresponding to the (N + 1) th block, thewriting block module 604 writes the result of the transaction executing operation into the (N + 1) th block of the block chain ledger.
Optionally, thewrite block module 604 performs a write block operation corresponding to the N +1 th block after performing the write block operation corresponding to the nth block.
Optionally, if thetransaction collection module 601 finishes the operation of collecting the transaction corresponding to the nth +1 block, and the process of theconsensus module 602 for the consensus corresponding to the nth block is not finished yet, the transaction collection module further stores the collected transaction corresponding to the nth +1 block in the memory.
Optionally, if thetransaction execution module 603 has not finished executing the transaction corresponding to the nth block after the consensus operation corresponding to the (N + 1) th block is finished by theconsensus module 602, the consensus module further stores the consensus result of the (N + 1) th block in the memory.
Optionally, if thetransaction executing module 603 finishes executing the transaction executing operation corresponding to the (N + 1) th block, theblock writing module 604 does not finish the block writing process corresponding to the nth block, and the transaction executing module further stores the transaction executing result corresponding to the (N + 1) th block in the memory.
Based on thetransaction processing device 600 shown in fig. 6, it can be known that, in the scheme of the embodiment of the present specification, when a transaction in a blockchain system is processed, the blockchain link points where thetransaction processing device 600 is deployed can process different stages of the transaction corresponding to different blocks in parallel by using the computing power of the multi-core CPU, so that the operation efficiency of the blockchain system is greatly improved, and the performance is 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, etc. made within the spirit and principle of one or more embodiments of the present disclosure should be included in the scope of protection of one or more embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. 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.

Claims (16)

Translated fromChinese
1.一种区块链中的交易处理方法,包括:1. A transaction processing method in a blockchain, comprising:区块链节点执行第N个区块对应的交易执行操作,其中所述第N个区块对应的交易已在区块链系统中达成共识;The blockchain node executes the transaction execution operation corresponding to the Nth block, wherein the transaction corresponding to the Nth block has reached a consensus in the blockchain system;所述区块链节点执行所述第N个区块对应的交易执行操作的过程中,并行地执行对第N+1个区块对应交易的共识操作,其中,N为正整数。In the process of executing the transaction execution operation corresponding to the Nth block, the blockchain node executes the consensus operation on the transaction corresponding to the N+1th block in parallel, where N is a positive integer.2.如权利要求1所述的方法,所述区块链节点执行第N个区块的交易执行操作之前,所述方法还包括:2. The method according to claim 1, before the block chain node executes the transaction execution operation of the Nth block, the method further comprises:所述区块链节点对所述第N个区块对应的交易在区块链系统中进行共识。The blockchain node performs consensus on the transaction corresponding to the Nth block in the blockchain system.3.如权利要求2所述的方法,所述区块链节点对所述第N个区块对应的交易在区块链系统中进行共识之前,所述方法还包括:3. The method according to claim 2, before the blockchain node performs consensus on the transaction corresponding to the Nth block in the blockchain system, the method further comprises:所述区块链节点收集所述第N个区块对应的交易。The blockchain node collects the transaction corresponding to the Nth block.4.如权利要求1所述的方法,所述区块链节点完成对所述第N个区块对应的交易执行操作后,所述方法还包括:4. The method according to claim 1, after the blockchain node completes the operation on the transaction corresponding to the Nth block, the method further comprises:所述区块链节点将所述交易执行的结果写入区块链账本的第N个区块中。The blockchain node writes the result of the transaction execution into the Nth block of the blockchain ledger.5.如权利要求1所述的方法,所述对第N+1个区块对应交易的共识操作,在对第N个区块对应的交易达成共识之后执行。5. The method of claim 1, wherein the consensus operation on the transaction corresponding to the N+1th block is performed after a consensus is reached on the transaction corresponding to the Nth block.6.如权利要求2所述的方法,所述方法还包括:6. The method of claim 2, further comprising:所述区块链节点在对所述第N个区块对应的交易进行共识的过程中,并行地执行收集第N+1个区块对应交易的操作。During the process of consensus on the transaction corresponding to the Nth block, the blockchain node performs an operation of collecting transactions corresponding to the N+1th block in parallel.7.如权利要求6所述的方法,所述区块链节点执行收集第N+1个区块对应交易的操作,在执行收集第N个区块对应交易的操作之后执行。7. The method of claim 6, wherein the block chain node performs the operation of collecting the transactions corresponding to the N+1th block, and executes the operation after performing the operation of collecting the transactions corresponding to the Nth block.8.如权利要求7所述的方法,所述区块链节点执行所述第N个区块对应的写块操作的过程中,并行地执行对第N+1个区块对应的交易执行操作。8. The method according to claim 7, wherein in the process of executing the block write operation corresponding to the Nth block, the block chain node executes the transaction execution operation corresponding to the N+1th block in parallel .9.如权利要求8所述的方法,所述区块链节点对第N+1个区块对应的交易执行操作,在对第N个区块对应的交易执行操作之后执行。9 . The method of claim 8 , wherein the blockchain node performs an operation on the transaction corresponding to the N+1th block, and performs the operation after performing the operation on the transaction corresponding to the Nth block. 10 .10.如权利要求8所述的方法,所述区块链节点完成对所述第N+1个区块对应的交易执行操作后,所述方法还包括:10. The method according to claim 8, after the blockchain node completes the operation on the transaction corresponding to the N+1th block, the method further comprises:所述区块链节点将所述交易执行的结果写入区块链账本的第N+1个区块中。The blockchain node writes the result of the transaction execution into the N+1th block of the blockchain ledger.11.如权利要求10所述的方法,所述区块链节点对第N+1个区块对应的写块操作,在对第N个区块对应的写块操作之后执行。11. The method of claim 10, wherein the block chain node performs the block write operation corresponding to the N+1th block after the block write operation corresponding to the Nth block.12.如权利要求6所述的方法,如果所述区块链节点在执行收集第N+1个区块对应交易的操作结束之后,对所述第N个区块对应的共识的过程尚未结束,该方法还包括:12. The method of claim 6, if the process of consensus on the Nth block corresponding to the block chain node has not ended after the operation of collecting the transactions corresponding to the N+1th block is completed. , the method also includes:所述区块链节点将收集的第N+1个区块对应的交易存储到内存中。The blockchain node stores the collected transaction corresponding to the N+1th block in the memory.13.如权利要求8所述的方法,如果所述区块链节点在执行第N+1个区块对应的共识操作结束之后,对所述第N个区块对应的交易执行过程尚未结束,该方法还包括:13. The method according to claim 8, if the execution process of the transaction corresponding to the Nth block has not ended after the block chain node has finished executing the consensus operation corresponding to the N+1th block, The method also includes:所述区块链节点将第N+1个区块对应的共识结果存储到内存中。The blockchain node stores the consensus result corresponding to the N+1th block in the memory.14.如权利要求10所述的方法,如果所述区块链节点在执行第N+1个区块对应的交易执行操作结束之后,对所述第N个区块对应的写块过程尚未结束,该方法还包括:14. The method according to claim 10, if the block-writing process corresponding to the Nth block has not ended after the block chain node has finished executing the transaction execution operation corresponding to the N+1th block , the method also includes:所述区块链节点将第N+1个区块对应的交易执行结果存储到内存中。The blockchain node stores the transaction execution result corresponding to the N+1th block in the memory.15.一种交易处理装置,应用于区块链节点,包括:15. A transaction processing device, applied to a blockchain node, comprising:交易执行模块,执行第N个区块对应的交易执行操作,其中所述第N个区块对应的交易已在区块链系统中达成共识;The transaction execution module executes the transaction execution operation corresponding to the Nth block, wherein the transaction corresponding to the Nth block has reached a consensus in the blockchain system;共识模块,在交易执行模块执行所述第N个区块对应的交易执行操作的过程中,并行地执行对第N+1个区块对应交易的共识操作。The consensus module, in the process of the transaction execution module executing the transaction execution operation corresponding to the Nth block, executes the consensus operation on the transaction corresponding to the N+1th block in parallel.16.一种电子设备,包括:16. An electronic device comprising:处理器;以及processor; and被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行以下操作:memory arranged to store computer-executable instructions which, when executed, cause the processor to:执行第N个区块对应的交易执行操作,其中所述第N个区块对应的交易已在区块链系统中达成共识;Execute the transaction execution operation corresponding to the Nth block, wherein the transaction corresponding to the Nth block has reached a consensus in the blockchain system;执行所述第N个区块对应的交易执行操作的过程中,并行地执行对第N+1个区块对应交易的共识操作,其中,N为正整数。In the process of executing the transaction execution operation corresponding to the Nth block, the consensus operation on the transaction corresponding to the N+1th block is performed in parallel, wherein N is a positive integer.
CN202110146211.6A2021-02-032021-02-03 Transaction processing method, device and electronic device in blockchainActiveCN112506671B (en)

Priority Applications (3)

Application NumberPriority DateFiling DateTitle
CN202110692124.0ACN113204432B (en)2021-02-032021-02-03Transaction processing method and device in blockchain and electronic equipment
CN202110146211.6ACN112506671B (en)2021-02-032021-02-03 Transaction processing method, device and electronic device in blockchain
PCT/CN2022/073652WO2022166673A1 (en)2021-02-032022-01-25Transaction processing method and apparatus in blockchain, and electronic device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110146211.6ACN112506671B (en)2021-02-032021-02-03 Transaction processing method, device and electronic device in blockchain

Related Child Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110692124.0ADivisionCN113204432B (en)2021-02-032021-02-03Transaction processing method and device in blockchain and electronic equipment

Publications (2)

Publication NumberPublication Date
CN112506671Atrue CN112506671A (en)2021-03-16
CN112506671B CN112506671B (en)2021-05-07

Family

ID=74952910

Family Applications (2)

Application NumberTitlePriority DateFiling Date
CN202110692124.0AActiveCN113204432B (en)2021-02-032021-02-03Transaction processing method and device in blockchain and electronic equipment
CN202110146211.6AActiveCN112506671B (en)2021-02-032021-02-03 Transaction processing method, device and electronic device in blockchain

Family Applications Before (1)

Application NumberTitlePriority DateFiling Date
CN202110692124.0AActiveCN113204432B (en)2021-02-032021-02-03Transaction processing method and device in blockchain and electronic equipment

Country Status (2)

CountryLink
CN (2)CN113204432B (en)
WO (1)WO2022166673A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112884588A (en)*2021-04-302021-06-01支付宝(杭州)信息技术有限公司Block chain transaction execution method, block chain node and control device
CN113744063A (en)*2021-11-042021-12-03支付宝(杭州)信息技术有限公司Method and device for executing transaction in block chain
CN114529413A (en)*2022-02-242022-05-24蚂蚁区块链科技(上海)有限公司Processing method of block chain transaction, block chain node and electronic equipment
CN114547201A (en)*2022-02-242022-05-27蚂蚁区块链科技(上海)有限公司 A method for processing a blockchain transaction, a blockchain node and an electronic device
WO2022166673A1 (en)*2021-02-032022-08-11支付宝(杭州)信息技术有限公司Transaction processing method and apparatus in blockchain, and electronic device
WO2023056967A1 (en)*2021-10-092023-04-13支付宝(杭州)信息技术有限公司Consensus method, blockchain system and consensus nodes

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115829731A (en)*2021-09-152023-03-21华为技术有限公司 A transaction information processing method and device
CN114553434B (en)*2021-10-092024-03-12支付宝(杭州)信息技术有限公司Consensus method, block chain system and consensus node

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107402824A (en)*2017-05-312017-11-28阿里巴巴集团控股有限公司A kind of method and device of data processing
CN110517141A (en)*2019-08-272019-11-29深圳前海微众银行股份有限公司 A consensus method and device based on blockchain system
CN110659988A (en)*2019-09-102020-01-07杭州秘猿科技有限公司Parallel processing method and device for block chain consensus and execution and electronic equipment
CN111522648A (en)*2020-07-032020-08-11支付宝(杭州)信息技术有限公司Transaction processing method and device for block chain and electronic equipment
US20200409941A1 (en)*2019-06-262020-12-31Indian Institute Of Technology BombayMethod for scaling computation in blockchain by delaying transaction execution

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN100454343C (en)*2006-01-182009-01-21成都前锋电子电器集团股份有限公司 Tax control cash register data storage system
CN112804349B (en)*2017-07-142023-07-04创新先进技术有限公司Method and device for processing consensus request in block chain consensus network and electronic equipment
KR20190009958A (en)*2017-07-202019-01-30주식회사 더블체인Extendable block chain system and block chain extending method
CN107688999B (en)*2017-08-112020-11-13杭州溪塔科技有限公司Block chain-based parallel transaction execution method
CN109213790B (en)*2018-08-102021-04-20南京一目智能科技有限公司 A method and system for data circulation analysis based on blockchain
CN110020859B (en)*2019-03-282022-03-11杭州秘猿科技有限公司Parallel execution block chain consensus method and device and electronic equipment
CN110648136B (en)*2019-09-102022-06-03杭州秘猿科技有限公司Consensus and transaction synchronous parallel processing method and device and electronic equipment
CN110728578A (en)*2019-09-292020-01-24南京金宁汇科技有限公司Parallel execution method, system and storage medium for block chain transaction
CN111475501B (en)*2020-06-242020-10-30支付宝(杭州)信息技术有限公司Data cleaning method and device for block chain network
CN113204432B (en)*2021-02-032024-08-16支付宝(杭州)信息技术有限公司Transaction processing method and device in blockchain and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107402824A (en)*2017-05-312017-11-28阿里巴巴集团控股有限公司A kind of method and device of data processing
US20200409941A1 (en)*2019-06-262020-12-31Indian Institute Of Technology BombayMethod for scaling computation in blockchain by delaying transaction execution
CN110517141A (en)*2019-08-272019-11-29深圳前海微众银行股份有限公司 A consensus method and device based on blockchain system
CN110659988A (en)*2019-09-102020-01-07杭州秘猿科技有限公司Parallel processing method and device for block chain consensus and execution and electronic equipment
CN111522648A (en)*2020-07-032020-08-11支付宝(杭州)信息技术有限公司Transaction processing method and device for block chain and electronic equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2022166673A1 (en)*2021-02-032022-08-11支付宝(杭州)信息技术有限公司Transaction processing method and apparatus in blockchain, and electronic device
CN112884588A (en)*2021-04-302021-06-01支付宝(杭州)信息技术有限公司Block chain transaction execution method, block chain node and control device
WO2023056967A1 (en)*2021-10-092023-04-13支付宝(杭州)信息技术有限公司Consensus method, blockchain system and consensus nodes
CN113744063A (en)*2021-11-042021-12-03支付宝(杭州)信息技术有限公司Method and device for executing transaction in block chain
CN114529413A (en)*2022-02-242022-05-24蚂蚁区块链科技(上海)有限公司Processing method of block chain transaction, block chain node and electronic equipment
CN114547201A (en)*2022-02-242022-05-27蚂蚁区块链科技(上海)有限公司 A method for processing a blockchain transaction, a blockchain node and an electronic device

Also Published As

Publication numberPublication date
CN113204432B (en)2024-08-16
CN112506671B (en)2021-05-07
WO2022166673A1 (en)2022-08-11
CN113204432A (en)2021-08-03

Similar Documents

PublicationPublication DateTitle
CN112506671B (en) Transaction processing method, device and electronic device in blockchain
US11626972B2 (en)Data processing method and apparatus
CN108648078B (en)Transaction preprocessing method and device and electronic equipment
CN107450979B (en) A blockchain consensus method and device
CN113743941B (en)Method for executing transaction in block chain, block chain and main node
CN108846749B (en)Partitioned transaction execution system and method based on block chain technology
EP3652691A1 (en)Method, apparatus, and electronic device for processing consensus requests in a blockchain consensus network
CN110648136B (en)Consensus and transaction synchronous parallel processing method and device and electronic equipment
CN110020859B (en)Parallel execution block chain consensus method and device and electronic equipment
CN112887436B (en)Consensus method, consensus node and block chain system of pipeline mode
CN113486109A (en)Data synchronization method and device of heterogeneous database and electronic equipment
CN109582398B (en)State processing method and device and electronic equipment
CN114663235B (en)Method and device for executing transaction in blockchain
EP3933639B1 (en)Transaction processing method, apparatus, and electronic device for blockchain
EP3640813B1 (en)Cluster-based random walk method and apparatus
CN115098594A (en) Method, blockchain system and node for executing transactions in a blockchain system
CN113706146B (en)Processing method, device and system for executing batch transactions based on blockchain
CN111369358A (en)Block chain consensus method and device and electronic equipment
CN115760405A (en) Transaction execution method, device, computer equipment and medium
CN115098483A (en) A pre-execution cache data cleaning method and blockchain node
CN107451204B (en)Data query method, device and equipment
CN109345081B (en)Data acquisition method and device and electronic equipment
CN109376988B (en)Service data processing method and device
CN113744062B (en)Method for performing transactions in a blockchain, blockchain node and blockchain
CN112784312A (en)Method and device for executing multiple deposit certificate transactions in combined mode and electronic equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
REGReference to a national code

Ref country code:HK

Ref legal event code:DE

Ref document number:40049163

Country of ref document:HK

TR01Transfer of patent right
TR01Transfer of patent right

Effective date of registration:20240919

Address after:Room 803, floor 8, No. 618 Wai Road, Huangpu District, Shanghai 200010

Patentee after:Ant blockchain Technology (Shanghai) Co.,Ltd.

Country or region after:China

Address before:310000 801-11 section B, 8th floor, 556 Xixi Road, Xihu District, Hangzhou City, Zhejiang Province

Patentee before:Alipay (Hangzhou) Information Technology Co.,Ltd.

Country or region before:China

Patentee before:Ant blockchain Technology (Shanghai) Co.,Ltd.


[8]ページ先頭

©2009-2025 Movatter.jp