WO2022141711A1 - Procédé d'exécution asynchrone de transaction dans une chaîne de blocs, système et dispositif associé - Google Patents

Procédé d'exécution asynchrone de transaction dans une chaîne de blocs, système et dispositif associé Download PDF

Info

Publication number
WO2022141711A1
WO2022141711A1 PCT/CN2021/073905 CN2021073905W WO2022141711A1 WO 2022141711 A1 WO2022141711 A1 WO 2022141711A1 CN 2021073905 W CN2021073905 W CN 2021073905W WO 2022141711 A1 WO2022141711 A1 WO 2022141711A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
block
transaction block
sent
layer
Prior art date
Application number
PCT/CN2021/073905
Other languages
English (en)
Chinese (zh)
Inventor
邱炜伟
李伟
张珂杰
黄方蕾
郭威
Original Assignee
杭州趣链科技有限公司
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 杭州趣链科技有限公司 filed Critical 杭州趣链科技有限公司
Publication of WO2022141711A1 publication Critical patent/WO2022141711A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing

Definitions

  • the present application relates to the field of blockchain technology, and in particular, to a method, system and related equipment for asynchronously executing transactions in a blockchain.
  • sharding is used to break transactions into shards and distribute them across the network so that each network node does not have to download and save the entire blockchain state.
  • sharding technology can significantly increase transaction processing speed.
  • each sharding chain produces its own blocks, and then anchors to the main chain to realize the execution of the main chain block and the sharded block. Decoupling.
  • the block-producing module controls multiple sharding executors.
  • the general execution implementation scheme of this architecture will be constrained by the concept of blocks, that is, the block-producing module will package the transactions in the block according to the correlation. It is distributed to each shard executor, and after receiving all the execution results, a block is generated, and then the next block is executed.
  • the inventor found that the existing sharding method has at least the following problems: using the master-slave chain architecture, although the blocks generated on each sharding chain do not affect each other, this will lead to sharding.
  • the block generation on the chain and the final confirmation of its blocks are asynchronous, and the blocks on the shard chain are at risk of rollback.
  • the block-producing module controls multiple shard executors.
  • Embodiments of the present application provide a method, device, computer equipment and storage medium for asynchronously executing transactions in a blockchain, so as to improve the efficiency of current blockchain transactions.
  • the embodiments of the present application provide a method for asynchronously executing transactions in a blockchain, including the following steps performed by an upper-layer block generation module:
  • the transaction block included in the execution result is acquired as the second transaction block, and the buffer queue to be received has the same sequence number as the second transaction block.
  • the first transaction block of execute deletion processing
  • An acknowledgment character ACK of the execution result is delivered to the lower executor.
  • an embodiment of the present application provides a method for asynchronously executing transactions in a blockchain, including the following steps performed by a lower-layer executor:
  • a transaction block sent by the upper-layer block-producing module If a transaction block sent by the upper-layer block-producing module is received, a confirmation message containing an acknowledgment character ACK is returned to the upper-layer block-producing module, and the received transaction block is cached in the transaction block buffer queue;
  • an embodiment of the present application provides an asynchronous execution system for transactions in a blockchain.
  • the asynchronous execution system for transactions in a blockchain includes an upper-layer block generation module and at least two lower-layer executors.
  • the block module and the underlying executor implement the following steps:
  • the upper-layer block generating module sends the transaction block in the buffer queue to be sent to each lower-layer executor based on a preset trigger mechanism
  • Each of the lower-layer executors when receiving the transaction block sent by the upper-layer block-producing module, returns an acknowledgement message containing an acknowledgment character ACK to the upper-layer block-producing module, and buffers the received transaction block in the transaction block buffer queue;
  • the transaction block corresponding to the confirmation character ACK is regarded as the first transaction block, and all the blocks in the buffer queue to be sent are sent. moving the first transaction block to the to-be-received buffer queue;
  • Each of the lower-level executors executes the transaction blocks in the transaction block buffer queue
  • each of the lower-level executors After each transaction block is executed, each of the lower-level executors sends the execution result of the transaction block to the upper-level block generating module;
  • the upper-layer block generating module receives the execution result sent by the lower-layer executor, it acquires the transaction block included in the execution result as the second transaction block, and stores it in the to-be-received buffer queue with the second transaction block.
  • the first transaction block with the same sequence number in the transaction block is deleted;
  • the upper-layer block generating module transmits the confirmation character ACK of the execution result to the lower-layer executor
  • the lower-layer executor When the lower-layer executor receives the confirmation character ACK of the execution result sent by the upper-layer block generating module, it confirms that the execution of the transaction block corresponding to the confirmation character ACK of the execution result is completed, and removes the execution completion from the transaction block buffer queue. transaction block.
  • the embodiment of the present application also provides an asynchronous execution device for transactions in a blockchain, including an upper-layer block generation module, and the upper-layer block generation module includes:
  • the transaction block sending sub-module is used to send the transaction block in the buffer queue to be sent to each lower-level executor based on the preset trigger mechanism;
  • the cache update sub-module is configured to use the transaction block corresponding to the confirmation character ACK as the first transaction block when receiving the confirmation character ACK sent by the lower-level executor for the transaction block, and to send the buffer queue to be sent.
  • the first transaction block is moved to the to-be-received buffer queue;
  • the result receiving sub-module is configured to acquire the transaction block contained in the execution result as the second transaction block if the execution result sent by the lower-layer executor is received, and store it in the to-be-received buffer queue with the first transaction block.
  • the first transaction block of the second transaction block with the same sequence number is deleted;
  • the result confirmation sub-module is used to transmit the confirmation character ACK of the execution result to the lower-layer executor.
  • the embodiments of the present application also provide an asynchronous transaction execution device in a blockchain, including a lower-layer executor for execution, and the lower-layer executor for execution includes:
  • the transaction block receiving sub-module is used to return a confirmation message containing the confirmation character ACK to the upper-layer block-producing module if the transaction block sent by the upper-layer block-producing module is received, and buffer the received transaction block in the transaction block buffer queue ;
  • a transaction execution sub-module for executing the transaction blocks in the transaction block buffer queue
  • the result feedback sub-module is used to send the execution result for the transaction block to the upper-layer block generating module after each transaction block is executed;
  • the status update sub-module is used to confirm that the transaction block corresponding to the confirmation character ACK of the execution result has been executed after receiving the confirmation character ACK of the execution result sent by the upper block generating module, and remove it from the transaction block buffer queue The completed transaction block.
  • an embodiment of the present application further provides a computer device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor executes the
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor executes the
  • an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the above-mentioned blockchain is implemented The steps in the transaction to execute the method asynchronously.
  • the upper-layer block generation module sends the transaction block in the buffer queue to be sent to each lower-layer executor based on the preset trigger mechanism, and the lower-layer executor receives the transaction block sent by the upper-layer block generation module.
  • the layer block generation module returns a confirmation message containing the confirmation character ACK, and caches the received transaction block in the transaction block buffer queue, and then executes it.
  • the feedback information of the lower-layer executor changes the status of the transaction block, and the upper-layer block-producing module controls the block-producing logic. Multiple lower-layer executors independently execute the transaction block, which is beneficial to improve the efficiency of asynchronous transaction execution.
  • FIG. 1 is an exemplary system architecture diagram to which the present application can be applied;
  • FIG. 2 is a flowchart of an embodiment of the method for asynchronously executing transactions in the blockchain of the present application
  • FIG. 3 is a schematic structural diagram of an embodiment of an apparatus for asynchronously executing transactions in a blockchain according to the present application
  • FIG. 4 is a schematic structural diagram of an embodiment of a computer device according to the present application.
  • the system architecture 100 may include terminal devices 101 , 102 , and 103 , a network 104 and a server 105 .
  • the network 104 is a medium used to provide a communication link between the terminal devices 101 , 102 , 103 and the server 105 .
  • the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • the user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and the like.
  • the terminal devices 101, 102, 103 can be various electronic devices with display screens and support web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture E interface display perts Group Audio Layer). III, Motion Picture Expert Compression Standard Audio Layer 3), MP4 (Moving Picture The E interface shows the perts Group Audio Layer IV, the standard audio layer for video expert compression 4) Players, Laptops and Desktops, etc.
  • MP3 players Motion Picture Expert Compression Standard Audio Layer 3
  • MP4 Motion Picture The Compression Picture The E interface shows the perts Group Audio Layer IV, the standard audio layer for video expert compression 4
  • Players Laptops and Desktops, etc.
  • the server 105 may be a server that provides various services, such as a background server that provides support for the pages displayed on the terminal devices 101 , 102 , and 103 .
  • the method for asynchronously executing transactions in the blockchain provided by the embodiments of the present application is executed by the server, and correspondingly, the system and device for executing asynchronous transactions in the blockchain are set in the server.
  • terminal devices, networks and servers in FIG. 1 are merely illustrative. According to implementation requirements, there may be any number of terminal devices, networks, and servers, and the terminal devices 101 , 102 , and 103 in the embodiments of the present application may specifically correspond to application systems in actual production.
  • FIG. 2 shows a method for asynchronously executing transactions in a blockchain provided by an embodiment of the present application.
  • the method is applied to the server in FIG. 1 as an example for description.
  • the details are as follows:
  • the upper-layer block generation module sends the transaction block in the buffer queue to be sent to each lower-layer executor based on a preset trigger mechanism.
  • the preset trigger mechanism may specifically be triggered by judging the number of transaction blocks stored in the to-be-sent buffer queue, or may be other custom methods, which are not specifically limited here.
  • this embodiment performs fragmentation processing on transaction blocks, and stores the transaction blocks obtained after fragmentation processing in the buffer queue to be sent, so as to avoid the influence of the block number of the transaction block on subsequent distribution to multiple lower-layer executors , to realize the control of the block-producing logic by the upper-level block-producing module.
  • fragmentation processing on transaction blocks, and stores the transaction blocks obtained after fragmentation processing in the buffer queue to be sent, so as to avoid the influence of the block number of the transaction block on subsequent distribution to multiple lower-layer executors , to realize the control of the block-producing logic by the upper-level block-producing module.
  • the content to be maintained by the upper-layer block generating module includes but is not limited to: the buffer queue sendBuffer to be sent, the buffer queue receiveBuffer to be received, and block-related information blockInfos.
  • blockInfos This is a map structure that maintains the block number and the execution progress of each shard for the entire block. Its value is a BlockInfo structure, which includes: the transaction hash list, the shard identifiers participating in the execution, and the execution result of the shard.
  • the buffer queue sendBuffer to be sent is a map structure, the key is the identifier of the fragment, and the value is the batch queue of transactions to be sent for the entire fragment.
  • the receiveBuffer queue to be received is a map structure, the key is the identifier of the shard, and the value is the entire queue of block numbers to be received and executed.
  • each lower-level executor When each lower-level executor receives the transaction block sent by the upper-level block-generating module, it returns an acknowledgement message containing an acknowledgment character ACK to the upper-level block-generating module, and buffers the received transaction block in the transaction block buffer queue.
  • the lower-layer executor and the upper-layer block-producing module determine the distribution status of the message through a predetermined message handshake protocol, and when receiving the transaction block sent by the upper-layer block-producing module, return an acknowledgement containing the confirmation character ACK to the upper-layer block-producing module message, and then buffer the received transaction block to the transaction block buffer queue.
  • the transaction block buffer queue is a queue-type buffer.
  • the buffer queue receives transaction block events delivered by the upper-level block-producing module.
  • the lower-level executor includes a transaction result cache queue txBatchExecBuffer, which is a map structure and is responsible for caching the execution results of the lower-level executor, wherein the cached content includes all execution results after the latest checkpoint point given by the upper-level module. .
  • txBatchExecBuffer is a map structure and is responsible for caching the execution results of the lower-level executor, wherein the cached content includes all execution results after the latest checkpoint point given by the upper-level module.
  • each lower-level executor has an independent and independent ledger space for maintenance, and the transactions of each transaction group can be executed in the ledger space maintained by one shard. Independent ledger space, so each lower-level executor can independently execute transactions related to its own ledger space. , At the same time, since the lower-level executor does not directly participate in the block generation, and its execution behavior is completely controlled by the upper-level block generation module, the lower-level executor can continue to execute without idle, which is conducive to improving the efficiency of transaction execution.
  • the confirmation character ACK (Acknowledge character) is a type of transmission control character sent by the receiving station to the sending station in data communication, indicating that the sent data has been confirmed to be received without error.
  • the acknowledgment character ACK is preset with a fixed format and length, and the receiver replies to the sender.
  • each lower-level executor has an independent and independent ledger space for maintenance.
  • the transaction blocks stored in the transaction block buffer queue are executed.
  • the specific execution process please refer to the following embodiments. The description is not repeated here in order to avoid repetition.
  • each lower-level executor After each transaction block is executed, each lower-level executor sends the execution result of the transaction block to the upper-level block generating module.
  • the lower-layer executor after executing each transaction block, sends the execution result of the transaction block to the upper-layer block generation module, so that the upper-layer block generation module collects and stores the execution results of each lower-layer executor.
  • the lower-layer executor sends the execution result of the transaction block to the upper-layer block-producing module, but the upper-layer block-producing module fails to receive the execution result.
  • this implementation For example, the state of the transaction block is detected in a timed manner to ensure that each execution result is successfully received by the upper-layer block generating module.
  • the specific detection process refer to the description of the subsequent embodiments. To avoid repetition, it will not be repeated here.
  • the upper-layer block generation module receives the execution result sent by the lower-layer executor, it obtains the transaction block included in the execution result as the second transaction block, and treats the transaction block that has the same sequence number as the second transaction block in the receiving cache queue. For the first transaction block, delete processing is performed.
  • the upper-level block generation module When the upper-level block generation module receives the execution result sent by the lower-level executor, it obtains the transaction block sequence number contained in the execution result from the execution result, and matches the transaction block sequence number stored in the buffer queue to be received, The transaction corresponding to the sequence number of the transaction block included in the execution result is deleted, so as to avoid repeatedly sending the processed transaction block to the lower-level executor, which is beneficial to improve the execution efficiency.
  • the upper-layer block generating module transmits the confirmation character ACK of the execution result to the lower-layer executor.
  • the upper-layer block generation module sends the transaction block in the buffer queue to be sent to each lower-layer executor based on a preset trigger mechanism, and the lower-layer executor receives the transaction block sent by the upper-layer block generation module.
  • the layer block generation module returns a confirmation message containing the confirmation character ACK, and caches the received transaction block in the transaction block buffer queue, and then executes it.
  • the feedback information of the lower-layer executor changes the status of the transaction block, and the upper-layer block-producing module controls the block-producing logic. Multiple lower-layer executors independently execute the transaction block, which is beneficial to improve the efficiency of asynchronous transaction execution.
  • the method for asynchronously executing transactions in the blockchain further includes:
  • the initial transaction block is fragmented to obtain M transaction groups, where M is a positive integer not greater than the number of the lower-layer executors, and each transaction group includes at least one transaction block;
  • the consensus module sends the transaction block with successful consensus to the upper-layer block-producing module, and the upper-layer block-producing module receives the transaction block, and performs fragmentation processing on the transaction block according to the preset fragmentation method to obtain M transaction groups. , and distribute the transaction blocks in each transaction group to different buffer queues to be sent to realize the fragmented processing of the received transaction blocks.
  • the number M of transaction groups does not exceed the number of lower-level executors, ensuring that the transaction blocks in each transaction group can be quickly sent to the lower-level executors for processing when the preset trigger conditions are met, which is conducive to improving transaction performance. effectiveness.
  • the transaction group is distributed as a unit, that is, the transaction blocks of the same group are distributed to the to-be-sent buffer queue at the same time.
  • the upper-layer block generation module can ignore the block number restriction, and the consensus module generates
  • the transaction block is divided into multiple transaction blocks and grouped, and then directly distributed to the lower-level executors, so that the distribution and execution process is not restricted by the concept of blocks, so that subsequent execution can be performed through multiple lower-level executors.
  • the asynchronous parallel processing of the processor is beneficial to improve the efficiency of subsequent transaction execution.
  • step S201 based on a preset trigger mechanism, sending the transaction block in the buffer queue to be sent to each lower-layer executor includes:
  • the first quantity is compared with the preset trigger quantity threshold, and if the first quantity is greater than or equal to the preset trigger quantity threshold, the transaction block in the buffer queue to be sent is triggered to be sent to each lower-layer executor.
  • the buffer queue to be sent has a map structure
  • the key is the identifier of the queue
  • the value is the transaction block to be sent of the entire fragment.
  • the preset trigger number threshold can be set according to actual needs, for example, the trigger number threshold is preset as 10, which is not specifically limited here.
  • the transaction block in the buffer queue to be sent is triggered to be sent to each lower-layer executor, so as to ensure the transmission
  • the frequency and number of transaction blocks sent are controllable.
  • sending the transaction block in the buffer queue to be sent to each lower-level executor further includes:
  • the timing is started to obtain the timing duration
  • timing is greater than or equal to the preset trigger time interval, it will trigger to send the transaction block in the buffer queue to be sent to each lower-level executor, and reset the timing.
  • the preset trigger time interval can be set according to actual needs, for example, set to 500 milliseconds, and the specific value is not limited here.
  • the judgment of the preset trigger time interval is used as the preset trigger mechanism
  • the judgment of the preset trigger quantity threshold is used as the preset trigger mechanism
  • a timer is used to count the time after each transaction block is sent to the lower-level executor, and when the duration reaches a preset trigger time interval and the transaction block has not been sent to the lower-level executor, the buffer to be sent is triggered.
  • the transaction block in the queue is sent to each lower-level executor, and the timing is reset to avoid idleness caused by the lower-level executor not receiving the transaction block for a long time, which is beneficial to improve transaction efficiency.
  • the method for asynchronously executing transactions in the blockchain further includes:
  • the status of the transaction block in the buffer queue to be sent is periodically detected, and the first detection result is obtained;
  • the transaction block is used as the second transaction block;
  • the state of the transaction block in the buffer queue to be sent is detected by matching the sequence number of the transaction block that has been sent to the lower-level executor with the transaction block of the received confirmation character ACK.
  • the first detection result includes normal detection, and there is a transaction block that has been sent to the lower-layer executor and has not received an acknowledgement character ACK returned by the lower-layer executor.
  • the transaction block that has been sent to the lower-layer executor but has not received the confirmation character ACK returned by the lower-layer executor is regarded as the second transaction block, and
  • the second transaction block is sent to the lower-level executor, so as to avoid the abnormality caused by the loss of the transaction block data sent to the lower-level executor in the transaction block, and improve the security of transaction execution.
  • step S204 executing the transaction blocks in the transaction block buffer queue includes:
  • the first transaction block is obtained from the transaction block buffer queue for execution.
  • the transaction block is cached through the transaction block buffer queue, and before executing the transaction block, the number of transaction blocks stored in the transaction block buffer queue is read first. That is, when the number of transaction blocks stored in the transaction block buffer queue is not empty, the first transaction block is obtained from the transaction block buffer queue by means of stack popping for execution, so as to ensure the continuous and normal execution of the transaction block.
  • the transaction block buffer queue used in this embodiment is a queue-type buffer txBatchBuffer, and the transaction buffer queue receives and stores the transaction blocks transmitted by the upper-layer block generation module.
  • the transaction asynchronous execution method further includes:
  • the transaction block is regarded as the third transaction block;
  • the execution result corresponding to the third transaction block is resent to the upper-layer block producing module.
  • the transaction block buffer queue used in this embodiment is a queue-type buffer txBatchBuffer
  • the transaction buffer queue receives and stores the transaction blocks transmitted by the upper-layer block generating module, and stores the execution result of transaction execution. After each execution result is generated, try to send the execution result back to the upper-level module, and start the timer corresponding to the sequence number of the transaction block, so as to periodically detect the transaction block status in the transaction block buffer queue. If the timer expires Before receiving the confirmation character ACK from the upper-layer block-producing module, the execution result will be resent.
  • the execution result for the transaction block will be sent to the upper-layer block-producing module, but the transaction block for which the upper-layer block-producing module returns the confirmation character ACK is not received, Re-send the execution result to ensure the synchronization of the execution state and avoid exceptions caused by asynchrony, which is beneficial to improve the efficiency of transaction execution.
  • the method for asynchronously executing transactions in the blockchain further includes:
  • the upper-layer block generation module receives the block-cutting scene status sent by the consensus module, it will confirm the rollback target height according to the block-cutting scene status;
  • the upper-layer block generation module sends the block-cutting scene state and target height to each lower-layer executor
  • the lower-layer executor receives the block-cutting scene status and target height sent by the upper-layer block-producing module, it will clear the transaction block of the transaction block buffer queue;
  • the lower executor performs rollback processing based on the target height
  • the lower-level executor After the rollback is successful, the lower-level executor sends a rollback success message to the upper-level block producing module.
  • the upper-level block generation module receives the rollback success message returned by each lower-level executor, it rolls back the cached data to the target height, and updates the memory information according to the status after rollback.
  • a specific state value is preset in this embodiment.
  • the upper-layer block-producing module and the lower-layer executor will perform a rollback operation, and during the rollback operation, other times will be rejected to ensure that Quick response to block chopping scenarios.
  • the upper-layer block generating module determines the target height of the rollback, and sends it to each lower-layer executor, and the lower-layer executor executes the rollback process according to the target height , and return the rollback result to the upper-level block-producing module.
  • the rollback results include rollback success and rollback failure.
  • a transaction asynchronous execution system in a blockchain corresponding to an asynchronous transaction execution method in a blockchain provided by an embodiment of the present application, the asynchronous transaction execution system in the blockchain includes an upper-layer block generation module and at least two lower-layer executors, The upper block output module and the lower executor implement the following steps:
  • the upper-layer block generation module sends the transaction blocks in the buffer queue to be sent to each lower-layer executor;
  • each lower-level executor When each lower-level executor receives a transaction block sent by the upper-level block-producing module, it returns an acknowledgement message containing the confirmation character ACK to the upper-level block-producing module, and caches the received transaction block in the transaction block buffer queue;
  • the upper-layer block generation module When the upper-layer block generation module receives the confirmation character ACK for the transaction block sent by the lower-layer executor, it takes the transaction block corresponding to the confirmation character ACK as the first transaction block, and moves the first transaction block in the buffer queue to be sent to the waiting block. Receive buffer queue;
  • Each lower-level executor executes the transaction blocks in the transaction block buffer queue
  • each lower-level executor After each transaction block is executed, each lower-level executor sends the execution result of the transaction block to the upper-level block generation module;
  • the upper-layer block generation module receives the execution result sent by the lower-layer executor, it obtains the transaction block contained in the execution result as the second transaction block, and treats the first transaction block with the same sequence number as the second transaction block in the receiving cache queue. Transaction block, perform deletion processing;
  • the upper-layer block-producing module transmits the confirmation character ACK of the execution result to the lower-layer executor
  • the lower-layer executor When the lower-layer executor receives the confirmation character ACK of the execution result sent by the upper-layer block generating module, it confirms that the transaction block corresponding to the confirmation character ACK of the execution result is executed, and removes the executed transaction block from the transaction block buffer queue.
  • FIG. 3 shows a principle block diagram of an asynchronous transaction execution device in a blockchain that corresponds one-to-one with the asynchronous transaction execution method in the blockchain in the above-mentioned embodiment.
  • the transaction asynchronous execution device in the blockchain includes an upper-layer block generation module, which includes: a transaction block sending sub-module 31 , a cache updating sub-module 32 , a result receiving sub-module 33 and a result confirming sub-module module 34.
  • an upper-layer block generation module which includes: a transaction block sending sub-module 31 , a cache updating sub-module 32 , a result receiving sub-module 33 and a result confirming sub-module module 34.
  • the transaction block sending sub-module 31 is used to send the transaction block in the buffer queue to be sent to each lower-level executor based on a preset trigger mechanism;
  • the cache update sub-module 32 is configured to use the transaction block corresponding to the confirmation character ACK as the first transaction block when receiving the confirmation character ACK sent by the lower-level executor for the transaction block, and to send the first transaction in the buffer queue to be sent The block is moved to the to-be-received buffer queue;
  • the result receiving sub-module 33 is configured to acquire the transaction block included in the execution result if the execution result sent by the lower-level executor is received, as the second transaction block, and treat it in the receiving buffer queue, which has the same sequence as the second transaction block The first transaction block of the number, execute the deletion process;
  • the result confirmation sub-module 34 is used to transmit the confirmation character ACK of the execution result to the lower-level executor.
  • the device for asynchronously executing transactions in the blockchain further includes:
  • the transaction block receiving sub-module is used to receive the transaction block transmitted by the consensus module as the initial transaction block;
  • the transaction block sharding sub-module is used to shard the initial transaction block according to the preset sharding method to obtain M transaction groups, wherein M is a positive integer not greater than the number of the lower-level executors, and each transaction The group includes at least one transaction block;
  • the shard cache sub-module is used to distribute the transaction blocks in each transaction group to the to-be-sent cache queue.
  • the transaction block sending submodule 31 includes:
  • the quantity monitoring unit is used to monitor the number of transaction blocks in the buffer queue to be sent in real time, as the first quantity
  • a threshold acquisition unit used to acquire a preset trigger quantity threshold
  • a numerical comparison unit used to compare the first number with a preset trigger number threshold, and if the first number is greater than or equal to the preset trigger number threshold, triggering to send the transaction blocks in the buffer queue to be sent to each lower layer Actuator.
  • the transaction block sending submodule 31 further includes:
  • a time interval obtaining unit used to obtain a preset trigger time interval
  • the timing unit is used to start the timing every time the transaction block in the buffer queue to be sent is sent to each lower-level executor to obtain the timing duration;
  • the duration comparison unit is used to trigger sending the transaction block in the buffer queue to be sent to each lower executor if the timing duration is greater than or equal to the preset trigger time interval, and reset the timing duration.
  • the device for asynchronously executing transactions in the blockchain further includes:
  • the first detection submodule is used to periodically detect the status of the transaction blocks in the buffer queue to be sent, and obtain the first detection result
  • the second transaction block determination sub-module is configured to use the transaction block as the second transaction block if the first detection result is that there is a transaction block that has been sent to the lower-layer executor and has not received the confirmation character ACK returned by the lower-layer executor;
  • the second transaction block sending submodule is configured to send the second transaction block to the lower-layer executor.
  • the device for asynchronously executing transactions in the blockchain further includes:
  • the target height determination sub-module is used to confirm the rollback target height according to the status of the chopping scene if it receives the status of the chopping scene sent by the consensus module;
  • the target height sending sub-module is used to send the block cutting scene state and target height to each lower executor
  • the rollback result receiving sub-module is used to roll back the cached data to the target height when receiving the rollback success message returned by each lower-level executor, and update the memory information according to the status after rollback.
  • the transaction asynchronous execution device in the blockchain also includes a lower-level executor, and the lower-level executor includes: a transaction block receiving submodule 35 , a transaction execution submodule 36 , a result feedback submodule 37 and a state update submodule 38 .
  • the lower-level executor includes: a transaction block receiving submodule 35 , a transaction execution submodule 36 , a result feedback submodule 37 and a state update submodule 38 .
  • the transaction block receiving sub-module 35 is configured to return a confirmation message containing an acknowledgment character ACK to the upper-layer block-producing module if the transaction block sent by the upper-layer block-producing module is received, and buffer the received transaction block in the transaction block buffer queue;
  • the transaction execution sub-module 36 is used to execute the transaction blocks in the transaction block buffer queue
  • the result feedback sub-module 37 is used to send the execution result for the transaction block to the upper-layer block generating module after each transaction block is executed;
  • the status update sub-module 38 is used to confirm that the transaction block corresponding to the confirmation character ACK of the execution result has been executed after receiving the confirmation character ACK of the execution result sent by the upper block generating module, and remove the execution completed from the transaction block buffer queue. transaction block.
  • the transaction execution sub-module 36 includes:
  • a quantity reading unit used to read the number of transaction blocks in the transaction block buffer queue as the second quantity
  • the target selection unit is used to obtain the first transaction block from the transaction block buffer queue for execution if the second quantity is not 0.
  • the transaction asynchronous execution device further includes:
  • the second detection submodule is used to periodically detect the transaction block status in the transaction block buffer queue to obtain a second detection result
  • the third transaction block determination sub-module is used for, if the second detection result is that there is an execution result for the transaction block sent to the upper-layer block-producing module, and no transaction block for which the upper-layer block-producing module returns an acknowledgment character ACK is received, the transaction block as the third transaction block;
  • the execution result resending sub-module is used to resend the execution result corresponding to the third transaction block to the upper-layer block generating module.
  • the device for asynchronously executing transactions in the blockchain further includes:
  • the cache cleaning sub-module is used to clear the transaction block of the transaction block buffer queue if the block cutting scene status and target height sent by the upper block generation module are received;
  • the rollback processing submodule is used to perform rollback processing based on the target height
  • the rollback message feedback sub-module is used to send a rollback success message to the upper-level block producing module after the rollback is successful.
  • the device for asynchronously executing transactions in the blockchain can be implemented in whole or in part by software, hardware, and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • FIG. 4 is a block diagram of a basic structure of a computer device according to this embodiment.
  • the computer device 4 includes a memory 41, a processor 42, and a network interface 43 that communicate with each other through a system bus. It should be pointed out that the figure only shows the computer device 4 having the components connected to the memory 41, the processor 42, and the network interface 43, but it should be understood that it is not required to implement all the components shown, and alternative implementations of more More or fewer components.
  • the computer device here is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, special-purpose Integrated circuit (Application Specific Integrated Circuit, ASIC), Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Signal Processor (Digital Signal Processor, DSP), embedded devices, etc.
  • ASIC Application Specific Integrated Circuit
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Signal Processor
  • embedded devices etc.
  • the computer equipment may be a desktop computer, a notebook computer, a palmtop computer, a cloud server and other computing equipment.
  • the computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touch pad or a voice control device.
  • the memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D interface display memory, etc.), random access memory (RAM) , Static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc.
  • the memory 41 may be an internal storage unit of the computer device 4 , such as a hard disk or a memory of the computer device 4 .
  • the memory 41 may also be an external storage device of the computer device 4 , such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc.
  • the memory 41 may also include both the internal storage unit of the computer device 4 and its external storage device.
  • the memory 41 is generally used to store the operating system and various application software installed in the computer device 4 , such as program codes for controlling electronic files.
  • the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 42 may be a central processing unit (Central Processing Unit) in some embodiments. Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip. This processor 42 is typically used to control the overall operation of the computer device 4 . In this embodiment, the processor 42 is configured to run the program code or process data stored in the memory 41 , for example, run the program code for controlling the electronic file.
  • CPU Central Processing Unit
  • controller microcontroller
  • microprocessor microprocessor
  • This processor 42 is typically used to control the overall operation of the computer device 4 .
  • the processor 42 is configured to run the program code or process data stored in the memory 41 , for example, run the program code for controlling the electronic file.
  • the network interface 43 may include a wireless network interface or a wired network interface, and the network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
  • the present application also provides another implementation manner, which is to provide a computer-readable storage medium, where an interface display program is stored in the computer-readable storage medium, and the interface display program can be executed by at least one processor, so that all The at least one processor executes the steps of the above-mentioned method for asynchronously executing transactions in the blockchain.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Retry When Errors Occur (AREA)

Abstract

La présente demande concerne le domaine de la technologie de chaîne de blocs et divulgue un procédé d'exécution asynchrone de transactions dans une chaîne de blocs, un système et un dispositif associé. Ledit procédé consiste : à envoyer, sur la base d'un mécanisme de déclenchement prédéfini, des blocs de transaction dans une file d'attente de mémoire tampon à envoyer, à chaque exécuteur de couche inférieure, lors de la réception d'un caractère d'accusé de réception ACK pour le bloc de transaction envoyé par l'exécuteur de couche inférieure, à prendre le bloc de transaction correspondant au caractère d'accusé de réception ACK en tant que premier bloc de transaction, et à déplacer le premier bloc de transaction dans la file d'attente de mémoire tampon à envoyer vers une file d'attente de mémoire tampon à recevoir, si un résultat d'exécution envoyé par l'exécuteur de couche inférieure est reçu, à acquérir un bloc de transaction contenu dans le résultat d'exécution et à le prendre en tant que second bloc de transaction, et à effectuer un traitement de suppression sur le premier bloc de transaction ayant le même numéro de série que le second bloc de transaction dans la file d'attente de mémoire tampon à recevoir, et à transmettre le caractère d'accusé de réception ACK du résultat d'exécution à l'exécuteur de couche inférieure. La présente demande améliore l'efficience de l'exécution asynchrone de transactions.
PCT/CN2021/073905 2020-12-31 2021-01-27 Procédé d'exécution asynchrone de transaction dans une chaîne de blocs, système et dispositif associé WO2022141711A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011640101.7 2020-12-31
CN202011640101.7A CN112883107B (zh) 2020-12-31 2020-12-31 区块链中交易异步执行方法、***及相关设备

Publications (1)

Publication Number Publication Date
WO2022141711A1 true WO2022141711A1 (fr) 2022-07-07

Family

ID=76046651

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/073905 WO2022141711A1 (fr) 2020-12-31 2021-01-27 Procédé d'exécution asynchrone de transaction dans une chaîne de blocs, système et dispositif associé

Country Status (2)

Country Link
CN (1) CN112883107B (fr)
WO (1) WO2022141711A1 (fr)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568981B (zh) * 2021-09-24 2022-01-07 腾讯科技(深圳)有限公司 一种交易数据处理方法、装置、设备以及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180300382A1 (en) * 2017-04-12 2018-10-18 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability for Fast and Low-Cost Payment and Transaction Processing
CN108804112A (zh) * 2018-05-22 2018-11-13 上海分布信息科技有限公司 一种区块链落账处理方法及***
CN108846749A (zh) * 2018-05-31 2018-11-20 杭州秘猿科技有限公司 一种基于区块链技术的分片化的交易执行***及方法
CN110868434A (zh) * 2018-08-27 2020-03-06 深圳金刚链计算技术有限公司 一种多层分片架构的区块链共识方法及***
CN111026511A (zh) * 2019-11-20 2020-04-17 中国科学院计算技术研究所 基于事务数据分区-链间融合的区块链并行***及方法
CN111680050A (zh) * 2020-05-25 2020-09-18 杭州趣链科技有限公司 一种联盟链数据的分片处理方法、设备和存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427601A (zh) * 2017-02-13 2018-08-21 北京航空航天大学 一种私有链节点的集***易处理方法
CN108764906A (zh) * 2018-05-30 2018-11-06 深圳市元征科技股份有限公司 一种服务器及其区块链交易确认方法、装置、存储介质
CN108776897B (zh) * 2018-06-05 2020-04-21 腾讯科技(深圳)有限公司 数据处理方法、装置、服务器及计算机可读存储介质
CN109064328B (zh) * 2018-07-09 2022-04-15 夸克链科技(深圳)有限公司 一种区块链的共识方法
EP3598365A1 (fr) * 2018-07-17 2020-01-22 Siemens Aktiengesellschaft Mise en forme du trafic pour les transactions d'un système de base de données réparti
CN110543788B (zh) * 2019-09-11 2024-05-03 腾讯科技(深圳)有限公司 数据存储方法、装置、计算机可读存储介质和计算机设备
CN111383031B (zh) * 2020-05-29 2020-09-22 支付宝(杭州)信息技术有限公司 一种区块链中的智能合约执行方法、***和电子设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180300382A1 (en) * 2017-04-12 2018-10-18 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability for Fast and Low-Cost Payment and Transaction Processing
CN108804112A (zh) * 2018-05-22 2018-11-13 上海分布信息科技有限公司 一种区块链落账处理方法及***
CN108846749A (zh) * 2018-05-31 2018-11-20 杭州秘猿科技有限公司 一种基于区块链技术的分片化的交易执行***及方法
CN110868434A (zh) * 2018-08-27 2020-03-06 深圳金刚链计算技术有限公司 一种多层分片架构的区块链共识方法及***
CN111026511A (zh) * 2019-11-20 2020-04-17 中国科学院计算技术研究所 基于事务数据分区-链间融合的区块链并行***及方法
CN111680050A (zh) * 2020-05-25 2020-09-18 杭州趣链科技有限公司 一种联盟链数据的分片处理方法、设备和存储介质

Also Published As

Publication number Publication date
CN112883107A (zh) 2021-06-01
CN112883107B (zh) 2022-05-17

Similar Documents

Publication Publication Date Title
WO2018076760A1 (fr) Procédé et système de traitement de transaction basé sur une chaîne de blocs, dispositif électronique et support de stockage
CN104168081B (zh) 一种文件传输方法及装置
CN104168093B (zh) 一种文件传输方法及装置
CN115004673B (zh) 消息推送方法、装置、电子设备及计算机可读介质
CN110401711B (zh) 数据处理方法、装置、***及存储介质
CN112671760A (zh) 基于Socket的客户端跨平台网络通信方法及其相关设备
CN110502364A (zh) 一种OpenStack平台下大数据沙箱集群的跨云备份恢复方法
CN113515320A (zh) 一种硬件加速处理方法、装置以及服务器
WO2022141711A1 (fr) Procédé d'exécution asynchrone de transaction dans une chaîne de blocs, système et dispositif associé
US9332071B2 (en) Data stage-in for network nodes
CN106550021B (zh) 推送消息的推送方法及装置
US9219673B2 (en) Crisscross cancellation protocol
CN103888283A (zh) 一种sctp通信方法及装置
CN116366634A (zh) 一种文件下载方法、装置、终端、源服务器及介质
EP3293924B1 (fr) Procédé et dispositif de traitement de message
CN114756356A (zh) 任务处理方法、工作节点设备、主节点设备及存储介质
CN114048059A (zh) 接口的超时时间调整方法、装置、计算机设备及存储介质
CN112866133A (zh) 用于获取共用最大分段大小mss的方法及装置
CN110392104A (zh) 数据同步方法、***、服务器及存储介质
CN114760219B (zh) 多终端的通信方法、装置、电子设备及存储介质
WO2023173816A1 (fr) Procédé et appareil de traitement de données, et dispositif, support de stockage et produit-programme
CN114584556B (zh) 文件传输方法和装置
CN117692111A (zh) 数据传输方法、装置、电子设备和存储介质
CN118041998A (zh) 数据处理方法、装置、设备以及介质
CN115914380A (zh) 基于Zlib压缩算法的云计算资源管理器通信延迟优化方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21912491

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21912491

Country of ref document: EP

Kind code of ref document: A1