CN117808466A - Transaction pre-execution method and device based on blockchain - Google Patents

Transaction pre-execution method and device based on blockchain Download PDF

Info

Publication number
CN117808466A
CN117808466A CN202410223720.8A CN202410223720A CN117808466A CN 117808466 A CN117808466 A CN 117808466A CN 202410223720 A CN202410223720 A CN 202410223720A CN 117808466 A CN117808466 A CN 117808466A
Authority
CN
China
Prior art keywords
transaction
node
target
transaction requests
sequencing
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.)
Pending
Application number
CN202410223720.8A
Other languages
Chinese (zh)
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.)
Peking University
China Academy of Information and Communications Technology CAICT
Original Assignee
Peking University
China Academy of Information and Communications Technology CAICT
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 Peking University, China Academy of Information and Communications Technology CAICT filed Critical Peking University
Priority to CN202410223720.8A priority Critical patent/CN117808466A/en
Publication of CN117808466A publication Critical patent/CN117808466A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure discloses a transaction pre-execution method and device based on a blockchain, wherein the blockchain comprises a consensus node, a management node and a common node, and the method comprises the following steps: responding to the management node to receive a plurality of transaction requests through the common node, and performing aggregation sequencing and signature on the plurality of transaction requests to obtain a target aggregation sequencing result; the management node sends the target aggregate sequencing result to the common node and the common node so that the common node generates a block according to the aggregate sequencing results, and the common node pre-executes the transaction requests to the first transaction result based on the target aggregate sequencing result; the management node receives the consensus node sending block and sends the consensus node sending block to the common node so that the common node verifies whether the sequence of the plurality of transaction requests in the block is consistent with the sequence of the plurality of transaction requests in the target aggregate sequencing result, and provides a first transaction result when the sequence is consistent. The embodiment of the disclosure can greatly improve the transaction processing speed of the blockchain.

Description

Transaction pre-execution method and device based on blockchain
Technical Field
The disclosure relates to the technical field of blockchains, in particular to a transaction pre-execution method and device based on a blockchain.
Background
The narrow blockchain is a chain data structure formed by combining data blocks in a sequential connection manner according to a time sequence, and is a distributed ledger which is not tamperable and not falsified and ensured in a cryptographic manner. The generalized blockchain technology is a brand new distributed infrastructure and calculation paradigm for verifying and storing data by utilizing a block chain data structure, generating and updating the data by utilizing a distributed node consensus algorithm, ensuring the safety of data transmission and access by utilizing a cryptography mode, and programming and operating the data by utilizing an intelligent contract consisting of an automatic script code.
Blockchains are commonly maintained by multiple organizations or enterprises and are divided into different business domains according to business scope. In order to enhance protection of private data, peer-to-Peer (P2P) message isolation is implemented between different service domains, so as to realize data isolation. There may be a large number of nodes from different institutions and enterprises in the same business domain, if these common nodes are directly connected to the consensus nodes, the consensus nodes not only need to spend extra resources to maintain a large number of P2P connections, but also need to filter and screen a large number of transactions from these nodes, which reduces the computing resources that the consensus nodes can use for the consensus process, and greatly affects the transaction processing speed of the blockchain.
Disclosure of Invention
The embodiment of the disclosure provides a transaction pre-execution method and device based on a blockchain to solve the problems.
In a first aspect of embodiments of the present disclosure, there is provided a blockchain-based transaction pre-execution method, the blockchain including a consensus node, a management node, and a common node, the method comprising:
responding to the management node to receive a plurality of transaction requests through the common node, performing aggregation sequencing on the transaction requests to obtain a target transaction sequence, and signing the target transaction sequence to obtain a target aggregation sequencing result;
the management node sends the target aggregation sequencing result to the consensus node so that the consensus node generates a block according to a plurality of aggregation sequencing results, and the management node sends the target aggregation sequencing result to the common node so that the common node pre-executes the plurality of transaction requests based on the target aggregation sequencing result to obtain a first transaction result corresponding to the plurality of transaction requests, wherein the plurality of aggregation sequencing results comprise the target aggregation sequencing result;
the management node receives the block sent by the consensus node and sends the block to the common node, so that the common node verifies whether the sequence of the transaction requests in the block is consistent with the sequence of the transaction requests in the target aggregate sequencing result, and the common node provides the first transaction result when the sequence of the transaction requests in the block is consistent with the sequence of the transaction requests in the target aggregate sequencing result.
In some embodiments of the present disclosure, after the step of verifying, by the common node, whether the order of the plurality of transaction requests in the block is consistent with the order of the plurality of transaction requests in the target aggregate sequencing result, further comprising:
and when the sequence of the transaction requests in the block is inconsistent with the sequence of the transaction requests in the target aggregate sequencing result, the common node is enabled to determine a second transaction result corresponding to the transaction requests based on the sequence of the transaction requests in the block, and the common node is enabled to provide the second transaction result.
In some embodiments of the present disclosure, the aggregating and sequencing the plurality of transaction requests to obtain a target transaction sequence includes:
performing validity verification processing on a plurality of transaction requests, and filtering illegal transactions and redundant transactions from the plurality of transaction requests based on the result of the validity verification processing;
and aggregating and sequencing the transaction requests after filtering the illegal transaction and the redundant transaction to obtain the target transaction sequence.
In some embodiments of the present disclosure, the management node sends the target aggregate sequencing result to the consensus node and the common node in parallel.
In some embodiments of the present disclosure, the signing the target transaction sequence results in a target aggregate sequencing result, comprising:
and signing the target transaction sequence by using a preset abstract generating method by using a private key of the management node to obtain the target aggregation sequencing result.
In some embodiments of the present disclosure, the network of the management node and the normal node includes at least one of a cluster network and a tree network.
In a second aspect of embodiments of the present disclosure, there is provided a blockchain-based transaction pre-execution device, the blockchain including a consensus node, a management node, and a common node, the device comprising:
the aggregation sequencing module is used for responding to the plurality of transaction requests received by the management node through the common node, aggregating and sequencing the plurality of transaction requests to obtain a target transaction sequence, and signing the target transaction sequence to obtain a target aggregation sequencing result;
the communication module is used for sending the target aggregation sequencing result to the consensus node by the management node so that the consensus node generates a block according to a plurality of aggregation sequencing results, and sending the target aggregation sequencing result to the common node by the management node so that the common node pre-executes the plurality of transaction requests based on the target aggregation sequencing result to obtain a first transaction result corresponding to the plurality of transaction requests, wherein the plurality of aggregation sequencing results comprise the target aggregation sequencing result;
the communication module is further configured to receive the block sent by the consensus node and send the block to the common node, so that the common node verifies whether the order of the plurality of transaction requests in the block is consistent with the order of the plurality of transaction requests in the target aggregate sequencing result, and so that the common node provides the first transaction result when the order of the plurality of transaction requests in the block is consistent with the order of the plurality of transaction requests in the target aggregate sequencing result.
In some embodiments of the disclosure, the communication module is further configured to, after the block is sent to the ordinary node, facilitate the ordinary node to determine a second transaction result corresponding to the plurality of transaction requests based on the order of the plurality of transaction requests in the block, and facilitate the ordinary node to provide the second transaction result, when the order of the plurality of transaction requests in the block is inconsistent with the order of the plurality of transaction requests in the target aggregate sequencing result.
In some embodiments of the present disclosure, the aggregate sequencing module is configured to perform a validity verification process on a plurality of transaction requests, and filter illegal transactions and redundant transactions from the plurality of transaction requests based on a result of the validity verification process; the aggregation sequencing module is also used for aggregating and sequencing a plurality of transaction requests after illegal transaction and redundant transaction filtering to obtain the target transaction sequence.
In some embodiments of the disclosure, the communication module is configured to send the target aggregate sequencing result to the consensus node and the common node in parallel by the management node.
In some embodiments of the disclosure, the aggregation sequencing module is configured to sign the target transaction sequence using a preset digest generation method to obtain the target aggregation sequencing result by using a private key of the management node.
In some embodiments of the present disclosure, the network of the management node and the normal node includes at least one of a cluster network and a tree network.
In a third aspect of the disclosed embodiments, there is provided an electronic device, including:
a memory for storing a computer program product;
a processor for executing the computer program product stored in the memory, and when the computer program product is executed, implementing the method according to the first aspect.
In a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the method of the first aspect described above.
According to the blockchain-based transaction pre-execution method and device, aiming at the blockchain consisting of a consensus node, a management node and a common node, the common node receives a plurality of transaction requests and then sends the transaction requests to the management node, and the management node performs aggregation sequencing and signature on the transaction requests to generate a target aggregation sequencing result. The management node respectively sends the target aggregation sequencing result to the common node and the common node, the common node performs common identification and packaging on a plurality of aggregation sequencing results including the target aggregation sequencing result to generate a block, and the common node pre-executes a plurality of transaction requests according to the target aggregation sequencing result to obtain a first transaction result. And after receiving the block sent by the consensus node, the management node sends the block to the common node. The common node verifies whether the sequence of the transaction requests in the block is consistent with the sequence of the transaction requests in the target aggregate sequencing result, and because the common node pre-executes the transaction requests, when the common node verifies that the sequence is consistent, the first transaction result can be directly submitted, and the transaction processing speed of the blockchain is greatly improved. The embodiment of the disclosure can be applied to a scene of the blockchain, namely, the transaction of the blockchain can be subjected to pre-execution processing.
The technical scheme of the present disclosure is described in further detail below through the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The disclosure may be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart of a blockchain-based transaction pre-execution method in some embodiments of the present disclosure;
FIG. 2 is a schematic diagram of a blockchain in some examples of the present disclosure;
FIG. 3 is a schematic diagram of a tree network composed of management nodes and common nodes in further examples of the present disclosure;
FIG. 4 is a schematic diagram of a related art blockchain transaction;
FIG. 5 is a block diagram of a blockchain-based transaction pre-execution device in some embodiments of the present disclosure;
fig. 6 is a block diagram of an electronic device in some embodiments of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
It will be appreciated by those of skill in the art that the terms "first," "second," etc. in embodiments of the present disclosure are used merely to distinguish between different steps, devices or modules, etc., and do not represent any particular technical meaning nor necessarily logical order between them.
It should also be understood that in embodiments of the present disclosure, "plurality" may refer to two or more, and "at least one" may refer to one, two or more.
It should also be appreciated that any component, data, or structure referred to in the presently disclosed embodiments may be generally understood as one or more without explicit limitation or the contrary in the context.
In addition, the term "and/or" in this disclosure is merely an association relationship describing an association object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the front and rear association objects are an or relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and that the same or similar features may be referred to each other, and for brevity, will not be described in detail.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
Embodiments of the present disclosure may be applicable to electronic devices such as terminal devices, computer systems, servers, etc., which may operate with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with the terminal device, computer system, server, or other electronic device include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments that include any of the foregoing, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types. The computer system/server may be implemented in a distributed cloud computing environment in which tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including memory storage devices.
FIG. 1 is a flow chart of a blockchain-based transaction pre-execution method in some embodiments of the present disclosure. The embodiment of the disclosure can be applied to a scene of the blockchain, namely, the transaction of the blockchain can be subjected to pre-execution processing. As shown in fig. 1, in the transaction pre-execution method based on the blockchain, the blockchain includes: an identification node, a management node and a common node.
Fig. 2 is a schematic diagram of a blockchain in some examples of the present disclosure. As shown in fig. 2, in the blockchain, network nodes are divided into consensus nodes, management nodes, and normal nodes. Wherein the consensus node is the root of the whole blockchain operation and is responsible for consensus transactions from different business domains. The management node is a core supporting the efficient operation of a single service domain and promoting the stability of a blockchain system, and is responsible for summarizing and filtering transactions from common nodes in the current service domain, submitting summarized transaction results to consensus nodes for consensus, and distributing the consensus results from the consensus nodes in the current service domain. The common node is a basic unit forming the blockchain, provides services for clients in the blockchain, and is an entrance of the whole network transaction.
In the embodiment of the present disclosure, for each service domain, a corresponding consensus node, a management node, and a common node may be provided. Because of the data isolation of privacy protection among different service domains, each service domain only needs to synchronize and maintain the data and the state under the service domain.
The transaction pre-execution method based on the blockchain in the embodiment comprises the following steps:
s1: and responding to the management node to receive a plurality of transaction requests through the common node, performing aggregation sequencing on the plurality of transaction requests to obtain a target transaction sequence, and signing the target transaction sequence to obtain a target aggregation sequencing result.
Because the common node bears the function of the whole network transaction portal, the common node needs to trade from the client sideTX 1 ,TX 2 , …,TX n ) And then, forwarding the service data to the management node of the current service domain along the logic route in the overlay network. Wherein the method comprises the steps ofnRepresenting the maximum length of the allowed transaction sequence in the current blockchain.
When the management node receives the trade from the common node in the current service domainTX 1 ,TX 2 ,…,TX n ) At this time, the transactions are aggregated and sequenced to form a target transaction sequence S =<TX 1 ,TX 2 ,…,TX n >. Then the management node signs the target transaction sequence by using the private key to obtain a target aggregation sequencing resultM 1 =<<TX 1 ,TX 2 ,…,TX n >,Sig(D(S))>. Wherein,Sig(D(S) A signature of the management node on the target transaction sequence.
S2: the management node sends the target aggregate sequencing result to the consensus node so that the consensus node generates a block according to the plurality of aggregate sequencing results, and the management node sends the target aggregate sequencing result to the common node so that the common node pre-executes the plurality of transaction requests based on the target aggregate sequencing result to obtain a first transaction result corresponding to the plurality of transaction requests. Wherein the plurality of aggregate sequencing results includes a target aggregate sequencing result.
The management node can aggregate the target into the sequence resultM 1 =<<TX 1 ,TX 2 ,…,TX n >,Sig(D(S))>Respectively sent to the consensus node on the upper layer and all the common nodes on the lower layer.
The consensus node continuously receives a plurality of transaction aggregation sequencing results from the management nodes of different service domains at the lower layerM 1 ,M 2 ,…,Mz). Wherein,M 1 i.e., target aggregate sequencing resultsM 1 =<<TX 1 ,TX 2 ,…,TX n >,Sig(D(S))>,zIs an integer greater than 2.
The consensus node aggregates a plurality of transaction sequencing resultsM 1 ,M 2 ,…,Mz) Packing is performed to obtain a block w=<M 1 ,M 2 ,…,Mz>And then the block W is sent to other consensus nodes for consensus.
Since this embodiment is based on optimization by the network layer, the content of the consensus nodes of the consensus layer are orthogonal. The consensus layer may select a consensus method such as bayer fault tolerance (Practical Byzantine Fault Tolerance, PBFT).
The common node receives the target aggregation sequencing resultM 1 =<<TX 1 ,TX 2 ,…,TX n >,Sig(D(S))>If the signature isSig(D(S) Through verification, sequencing results according to target aggregationM 1 =<<TX 1 ,TX 2 ,…,TX n >,Sig(D(S))>Pre-execution s=<TX 1 ,TX 2 ,…,TX n >And obtaining a first transaction result.
S3: the management node receives the consensus node and sends the block to the common node so that the common node verifies whether the sequence of the plurality of transaction requests in the block is consistent with the sequence of the plurality of transaction requests in the target aggregate sequencing result, and the common node provides the first transaction result when the sequence of the plurality of transaction requests in the block is consistent with the sequence of the plurality of transaction requests in the target aggregate sequencing result.
After the consensus node completes the consensus of the block W, the block W containing the consensus result is sent to the management node of the lower layer. After receiving the block W, the management node distributes the block W containing the consensus result to the common node in the current service domain.
After receiving the block W containing the consensus result, the common node of the current service domain verifies the sequence of a plurality of transaction requests containing the current service domain in the block W and the target transaction sequencing resultM 1 Transaction sequence s=<TX 1 ,TX 2 ,…,TX n >Whether the order of the plurality of transaction requests is consistent. If so, the common node of the current service domain submits a first transaction result.
In this embodiment, for a blockchain composed of a consensus node, a management node, and a common node, the common node receives a plurality of transaction requests and then sends the transaction requests to the management node, and the management node performs aggregation sequencing and signature on the transaction requests to generate a target aggregation sequencing result. The management node respectively sends the target aggregation sequencing result to the common node and the common node, the common node performs common identification and packaging on a plurality of aggregation sequencing results including the target aggregation sequencing result to generate a block, and the common node pre-executes a plurality of transaction requests according to the target aggregation sequencing result to obtain a first transaction result. And after receiving the block sent by the consensus node, the management node sends the block to the common node. The common node verifies whether the sequence of the transaction requests in the block is consistent with the sequence of the transaction requests in the target aggregate sequencing result, and because the common node pre-executes the transaction requests, when the common node verifies that the sequence is consistent, the first transaction result can be directly submitted, and the transaction processing speed of the blockchain is greatly improved.
In some embodiments of the present disclosure, after verifying, by the ordinary node in step S3, whether the order of the plurality of transaction requests in the block is consistent with the order of the plurality of transaction requests in the target aggregate sequencing result, the method may further include:
s4: when the sequence of the plurality of transaction requests in the block is inconsistent with the sequence of the plurality of transaction requests in the target aggregate sequencing result, the common node is enabled to determine a second transaction result corresponding to the plurality of transaction requests based on the sequence of the plurality of transaction requests in the block, and the common node is enabled to provide the second transaction result.
In this embodiment, when the common node detects that the sequence of the plurality of transaction requests in the block is inconsistent with the sequence of the plurality of transaction requests in the target aggregate sequencing result, the plurality of transaction requests are executed based on the sequence of the plurality of transaction requests in the block to obtain a second transaction result, and the second transaction result is provided through the common node, so that accuracy of the transaction result is ensured.
In some embodiments of the present disclosure, aggregating and sequencing the plurality of transaction requests in step S1 to obtain the target transaction sequence may include:
s1-1: and performing validity verification processing on the plurality of transaction requests, and filtering illegal transactions and redundant transactions from the plurality of transaction requests based on the result of the validity verification processing.
The management node can perform validity verification through the identity information of the common node which sends the transaction requests, and the illegal transaction is filtered from the transaction requests according to the validity verification result.
The management node may also detect whether the same transaction exists among the plurality of transaction requests. When the same transaction exists in a plurality of transaction requests, one transaction is reserved, and other redundant transactions are filtered.
S1-2: and aggregating and sequencing the transaction requests after filtering the illegal transaction and the redundant transaction to obtain a target transaction sequence.
In this embodiment, the management node performs validity verification processing on the plurality of transaction requests, so that illegal transactions and redundant transactions can be filtered, and the accuracy of transaction processing of the blockchain can be improved.
In some embodiments of the present disclosure, in step S2, the management node sends the target aggregate sequencing result to the consensus node and the regular node in parallel. For example, the parallel execution strategy of the transaction at the execution layer can be obtained by a read-write set or DAG ((Database Availability Group, database availability group) mode, so that the transaction execution efficiency of the common node is improved.
In this embodiment, the management node sends the target aggregate sequencing result to the consensus node and the common node in a parallel manner, so that the transaction execution efficiency of the common node can be improved.
In some embodiments of the present disclosure, in step S1, the target transaction sequence is signed using a preset digest generation method with a private key of the management node to obtain a target aggregate sequencing result. The target transaction sequence is signed, for example, using a hash method such as SHA-256.
In an embodiment, the source authenticity and security of the target aggregate sequencing result may be determined by signing the target transaction sequence using a digest generation method using the private key of the management node.
In some embodiments of the present disclosure, the network of management nodes and regular nodes comprises at least one of a cluster network and a tree network.
Fig. 3 is a schematic diagram of a tree network composed of management nodes and normal nodes in other examples of the present disclosure. As shown in fig. 3, the management node and the general node may constitute a tree network in addition to a cluster network.
FIG. 4 is a block chain transaction diagram of the related art. As shown in fig. 4, the related art performs transactions in a serial order of "transmission-consensus-execution". Assuming that the average delay of message transmission between nodes isMillisecond, common node needs to go through from sending out transaction to receiving transaction from management node>Millisecond(s), wherein->Is the number of logical route hops in the overlay network between the normal node and the management node. Assuming that the transaction consensus algorithm used by the blockchain system is PBFT, the consensus node receives a transaction aggregation sequencing result from a lower management node to a management nodeConsensus results from upper consensus nodes are at least requiredMillisecond.
Thus, transactions are performed in a serial order of "transmit-consensus-execute", with the common node waiting for execution of a transaction blockT 1 The method comprises the following steps:in milliseconds.
Latency of a generic node after pre-execution of policies using embodiments of the present disclosureT 2 The method comprises the following steps:in milliseconds. It follows that, in accordance with the pre-execution strategy, the disclosed embodiments can save consensus time for common nodes (i.e.)>Millisecond).
Depending on the particular network layer design used by the blockchain,the values of (2) may be different. Taking common cluster type network and tree type network as examples, the optimization performance improvement of the invention is analyzed.
For a clustered network,. Based on the above assumption, transactions are performed in serial order of "transmission-consensus-execution", and the latency of the normal node is +.>Millisecond. According to the pre-execution strategy of the embodiment, after the pre-execution strategy of the embodiment of the disclosure is adopted, the waiting time of the common node is +.>Millisecond, performance improvement is over 70%.
For a tree-type network,. Wherein the method comprises the steps ofcIs the number of branches in the tree network,Nis the number of nodes in the current traffic domain. Taking the most common c=3 and n=100 as an example, performance is improved by more than 38% after the embodiments of the present disclosure and the implementation strategy are adopted.
In this embodiment, the pre-execution policy of the embodiment of the present disclosure is adopted for a cluster network or a tree network including a management node and a common node, so that the transaction execution efficiency of the blockchain network can be greatly improved.
Fig. 5 is a block diagram of a blockchain-based transaction pre-execution device in some embodiments of the present disclosure. As shown in fig. 5, the blockchain includes a consensus node, a management node, and a normal node, and the blockchain-based transaction pre-execution device includes:
the aggregation sequencing module 100 is configured to aggregate and sequence the plurality of transaction requests to obtain a target transaction sequence in response to the management node receiving the plurality of transaction requests through the common node, and sign the target transaction sequence to obtain a target aggregation sequencing result;
the communication module 200 is configured to send a target aggregate sequencing result to the consensus node by using the management node, so that the consensus node generates a block according to the multiple aggregate sequencing results, and send the target aggregate sequencing result to the common node, so that the common node pre-executes multiple transaction requests based on the target aggregate sequencing result to obtain a first transaction result corresponding to the multiple transaction requests, where the multiple aggregate sequencing results include the target aggregate sequencing result;
the communication module 200 is further configured to receive the common node sending block and send the block to the common node, so that the common node verifies whether the order of the plurality of transaction requests in the block is consistent with the order of the plurality of transaction requests in the target aggregate sequencing result, and so that the common node provides the first transaction result when the order of the plurality of transaction requests in the block is consistent with the order of the plurality of transaction requests in the target aggregate sequencing result.
In some embodiments of the present disclosure, the communication module 200 is further configured to, after sending the chunk to the ordinary node, facilitate the ordinary node to determine a second transaction result corresponding to the plurality of transaction requests based on the order of the plurality of transaction requests in the chunk, and facilitate the ordinary node to provide the second transaction result when the order of the plurality of transaction requests in the chunk is not consistent with the order of the plurality of transaction requests in the target aggregate sequencing result.
In some embodiments of the present disclosure, the aggregate sequencing module 100 is configured to perform a validity verification process on a plurality of transaction requests, and filter illegal transactions and redundant transactions from the plurality of transaction requests based on a result of the validity verification process; the aggregation sequencing module 100 is further configured to aggregate and sequence the plurality of transaction requests after filtering the illegal transaction and the redundant transaction, so as to obtain a target transaction sequence.
In some embodiments of the present disclosure, the communication module 200 is configured to send the target aggregate sequencing result to the consensus node and the regular node in parallel by the management node.
In some embodiments of the present disclosure, the aggregation sequencing module 100 is configured to sign the target transaction sequence using a preset digest generation method with a private key of the management node to obtain a target aggregation sequencing result.
In some embodiments of the present disclosure, the network of management nodes and regular nodes comprises at least one of a cluster network and a tree network.
It should be noted that, the detailed implementation of the transaction pre-execution device based on the blockchain in the embodiments of the present disclosure is similar to the detailed implementation of the transaction pre-execution method based on the blockchain in the embodiments of the present disclosure, and specific reference is made to the description of the block chain-based transaction pre-execution method section, so that redundancy is reduced and redundant description is omitted.
In addition, the embodiment of the disclosure also provides an electronic device, which comprises:
a memory for storing a computer program;
a processor for executing the computer program stored in the memory, and when the computer program is executed, implementing the blockchain-based transaction pre-execution method of any of the above embodiments of the disclosure.
Fig. 6 is a block diagram of an electronic device in some embodiments of the present disclosure. As shown in fig. 6, the electronic device includes one or more processors and memory.
The processor may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, and may control other components in the electronic device to perform the desired functions.
The memory may store one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or nonvolatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program products may be stored on the computer readable storage medium that can be run by a processor to implement the blockchain-based transaction pre-execution methods and/or other desired functions of the various embodiments of the present disclosure as described above.
In one example, the electronic device may further include: input devices and output devices, which are interconnected by a bus system and/or other forms of connection mechanisms (not shown).
In addition, the input device may include, for example, a keyboard, a mouse, and the like.
The output device may output various information including the determined distance information, direction information, etc., to the outside. The output device may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, etc.
Of course, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 6, with components such as buses, input/output interfaces, etc. omitted for simplicity. In addition, the electronic device may include any other suitable components depending on the particular application.
In addition to the methods and apparatus described above, embodiments of the present disclosure may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform steps in a blockchain-based transaction pre-execution method according to various embodiments of the present disclosure described in the above section of the present description.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Further, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform steps in a blockchain-based transaction pre-execution method according to various embodiments of the present disclosure described in the above section of the present description.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present disclosure have been described above in connection with specific embodiments, however, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are merely examples and not limiting, and these advantages, benefits, effects, etc. are not to be considered as necessarily possessed by the various embodiments of the present disclosure. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, since the disclosure is not necessarily limited to practice with the specific details described.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different manner from other embodiments, so that the same or similar parts between the embodiments are mutually referred to. For system embodiments, the description is relatively simple as it essentially corresponds to method embodiments, and reference should be made to the description of method embodiments for relevant points.
The block diagrams of the devices, apparatuses, devices, systems referred to in this disclosure are merely illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above-described sequence of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the sequence specifically described above unless specifically stated otherwise. Furthermore, in some embodiments, the present disclosure may also be implemented as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the apparatus, devices and methods of the present disclosure, components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered equivalent to the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the disclosure to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims (14)

1. A blockchain-based transaction pre-execution method, wherein the blockchain includes a consensus node, a management node, and a common node, the method comprising:
responding to the management node to receive a plurality of transaction requests through the common node, performing aggregation sequencing on the transaction requests to obtain a target transaction sequence, and signing the target transaction sequence to obtain a target aggregation sequencing result;
the management node sends the target aggregation sequencing result to the consensus node so that the consensus node generates a block according to a plurality of aggregation sequencing results, and the management node sends the target aggregation sequencing result to the common node so that the common node pre-executes the plurality of transaction requests based on the target aggregation sequencing result to obtain a first transaction result corresponding to the plurality of transaction requests, wherein the plurality of aggregation sequencing results comprise the target aggregation sequencing result;
the management node receives the block sent by the consensus node and sends the block to the common node, so that the common node verifies whether the sequence of the transaction requests in the block is consistent with the sequence of the transaction requests in the target aggregate sequencing result, and the common node provides the first transaction result when the sequence of the transaction requests in the block is consistent with the sequence of the transaction requests in the target aggregate sequencing result.
2. The method of claim 1, further comprising, after said facilitating said common node verifying that an order of said plurality of transaction requests in said chunk is consistent with an order of said plurality of transaction requests in said target aggregate sequencing result:
and when the sequence of the transaction requests in the block is inconsistent with the sequence of the transaction requests in the target aggregate sequencing result, the common node determines a second transaction result corresponding to the transaction requests based on the sequence of the transaction requests in the block, and provides the second transaction result through the common node.
3. The method of claim 1, wherein the aggregate sequencing of the plurality of transaction requests results in a target transaction sequence, comprising:
performing validity verification processing on a plurality of transaction requests, and filtering illegal transactions and redundant transactions from the plurality of transaction requests based on the result of the validity verification processing;
and aggregating and sequencing the transaction requests after filtering the illegal transaction and the redundant transaction to obtain the target transaction sequence.
4. A method according to any of claims 1-3, wherein the management node sends the target aggregate sequencing result to the consensus node and the generic node in parallel.
5. A method according to any of claims 1-3, wherein signing the target transaction sequence yields a target aggregate sequencing result, comprising:
and signing the target transaction sequence by using a preset abstract generating method by using a private key of the management node to obtain the target aggregation sequencing result.
6. A method according to any of claims 1-3, characterized in that the network of management nodes and regular nodes comprises at least one of a cluster network and a tree network.
7. A blockchain-based transaction pre-execution device, wherein the blockchain includes a consensus node, a management node, and a common node, the device comprising:
the aggregation sequencing module is used for responding to the plurality of transaction requests received by the management node through the common node, aggregating and sequencing the plurality of transaction requests to obtain a target transaction sequence, and signing the target transaction sequence to obtain a target aggregation sequencing result;
the communication module is used for sending the target aggregation sequencing result to the consensus node by the management node so that the consensus node generates a block according to a plurality of aggregation sequencing results, and sending the target aggregation sequencing result to the common node by the management node so that the common node pre-executes the plurality of transaction requests based on the target aggregation sequencing result to obtain a first transaction result corresponding to the plurality of transaction requests, wherein the plurality of aggregation sequencing results comprise the target aggregation sequencing result;
the communication module is further configured to receive the block sent by the consensus node and send the block to the common node, so that the common node verifies whether the order of the plurality of transaction requests in the block is consistent with the order of the plurality of transaction requests in the target aggregate sequencing result, and so that the common node provides the first transaction result when the order of the plurality of transaction requests in the block is consistent with the order of the plurality of transaction requests in the target aggregate sequencing result.
8. The apparatus of claim 7, wherein the communication module is further configured to, after the chunk is sent to the regular node, cause the regular node to determine a second transaction result corresponding to the plurality of transaction requests based on the order of the plurality of transaction requests in the chunk and cause the regular node to provide the second transaction result when the order of the plurality of transaction requests in the chunk is not consistent with the order of the plurality of transaction requests in the target aggregate sequencing result.
9. The apparatus of claim 8, wherein the aggregate sequencing module is to perform a validity verification process on a plurality of transaction requests, filtering illegal and redundant transactions from the plurality of transaction requests based on a result of the validity verification process; the aggregation sequencing module is also used for aggregating and sequencing a plurality of transaction requests after illegal transaction and redundant transaction filtering to obtain the target transaction sequence.
10. The apparatus of any of claims 7-9, wherein the communication module is to send the target aggregate sequencing result to the consensus node and the generic node in parallel by the management node.
11. The apparatus of any of claims 7-9, wherein the aggregation sequencing module is configured to sign the target transaction sequence using a preset digest generation method with a private key of the management node to obtain the target aggregation sequencing result.
12. The apparatus according to any of claims 7-9, wherein the network of management nodes and the generic node comprises at least one of a clustered network and a tree network.
13. An electronic device, comprising:
a memory for storing a computer program product;
a processor for executing a computer program product stored in said memory, which, when executed, implements the method of any of the preceding claims 1-6.
14. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of the preceding claims 1-6.
CN202410223720.8A 2024-02-28 2024-02-28 Transaction pre-execution method and device based on blockchain Pending CN117808466A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410223720.8A CN117808466A (en) 2024-02-28 2024-02-28 Transaction pre-execution method and device based on blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410223720.8A CN117808466A (en) 2024-02-28 2024-02-28 Transaction pre-execution method and device based on blockchain

Publications (1)

Publication Number Publication Date
CN117808466A true CN117808466A (en) 2024-04-02

Family

ID=90434848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410223720.8A Pending CN117808466A (en) 2024-02-28 2024-02-28 Transaction pre-execution method and device based on blockchain

Country Status (1)

Country Link
CN (1) CN117808466A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448694A (en) * 2021-06-11 2021-09-28 电子科技大学 Block chain consensus method for improving transaction processing capability
CN114463008A (en) * 2022-03-22 2022-05-10 湖南天河国云科技有限公司 Block chain transaction execution method and device based on parallel computing model
CN114677222A (en) * 2022-04-22 2022-06-28 湖南天河国云科技有限公司 Parallel transaction processing method, system and computer storage medium for block chain
CN115640356A (en) * 2022-09-30 2023-01-24 蚂蚁区块链科技(上海)有限公司 Transaction execution method in blockchain system, consensus node and blockchain system
WO2023040453A1 (en) * 2021-09-15 2023-03-23 华为技术有限公司 Transaction information processing method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448694A (en) * 2021-06-11 2021-09-28 电子科技大学 Block chain consensus method for improving transaction processing capability
WO2023040453A1 (en) * 2021-09-15 2023-03-23 华为技术有限公司 Transaction information processing method and apparatus
CN114463008A (en) * 2022-03-22 2022-05-10 湖南天河国云科技有限公司 Block chain transaction execution method and device based on parallel computing model
CN114677222A (en) * 2022-04-22 2022-06-28 湖南天河国云科技有限公司 Parallel transaction processing method, system and computer storage medium for block chain
CN115640356A (en) * 2022-09-30 2023-01-24 蚂蚁区块链科技(上海)有限公司 Transaction execution method in blockchain system, consensus node and blockchain system

Similar Documents

Publication Publication Date Title
CN113711536B (en) Extracting data from a blockchain network
KR102566892B1 (en) Blockchain consensus method, device and system
CN109242685B (en) Block chain-based consensus and verification method and device
US11954095B2 (en) High performance distributed system of record with extended transaction processing capability
WO2020063820A1 (en) Asset transaction method, storage medium and computer device
US11023314B2 (en) Prioritizing shared blockchain data storage
US11604608B2 (en) Blockchain transaction processing systems and methods
US20230074102A1 (en) Method and apparatus for processing data based on block chain, device and readable storage medium
US20210044422A1 (en) Data security of shared blockchain data storage based on error correction code
WO2020098820A2 (en) Performing map iterations in a blockchain-based system
EP3769233B1 (en) Performing map iterations in a blockchain-based system
CN113657900A (en) Cross-chain transaction verification method and system and cross-chain transaction system
US20240005025A1 (en) Methods for verifying database query results and devices thereof
US11720453B2 (en) High performance distributed system of record with unspent transaction output (UTXO) database snapshot integrity
US11500845B2 (en) Blockchain transaction processing systems and methods
CN117808466A (en) Transaction pre-execution method and device based on blockchain
CN111510306B (en) Offline signature method and device based on block chain
CN117808467A (en) Cross-fragment transaction method, device, equipment and medium based on blockchain network
CN117909406A (en) Hierarchical blockchain-based data processing method and device and readable storage medium

Legal Events

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