Search

CN-121981727-A - Execution method and device of blockchain transaction and terminal equipment

CN121981727ACN 121981727 ACN121981727 ACN 121981727ACN-121981727-A

Abstract

The application relates to a method, a device and terminal equipment for executing blockchain transaction, which comprise the steps of receiving a transaction request, acquiring an object type and a first object version of an on-chain entity from the transaction request, wherein the first object version indicates the number of times the on-chain entity is modified, detecting whether the first object version of the on-chain entity is consistent with a second object version of the on-chain entity recorded by a blockchain node, determining to execute the transaction request by using a first transaction path when the object type of the on-chain entity is not a shared object and the first object version is consistent with the second object version, and executing the transaction request when the number of blockchain nodes for signing the transaction request is greater than or equal to a preset threshold value, and updating the second object version after the execution of the transaction request is completed. The application solves the problem of higher transaction delay of the transaction execution method depending on block generation in the related technology.

Inventors

  • DUAN HAO
  • YUAN CHAO
  • CHEN WEITAO
  • CHEN YULIN
  • DING TIE
  • JIA XIANGJUAN

Assignees

  • 杭州高新区(滨江)区块链与数据安全研究院

Dates

Publication Date
20260505
Application Date
20251208

Claims (10)

  1. 1. A method of performing a blockchain transaction, applied to a blockchain node, the method comprising: receiving a transaction request; Obtaining an object type and a first object version of an on-chain entity contained in the transaction request from the transaction request, wherein the first object version indicates the number of times the on-chain entity is modified; Detecting whether the first object version of the entity on the chain is consistent with the second object version of the entity on the chain, which is recorded by the block link point; Determining to execute the transaction request using a first transaction path if the object type of the on-chain entity is not a shared object and the first object version is consistent with the second object version, the shared object representing that write operation rights to the on-chain entity are authorized by any account, the first transaction path including signing the transaction request and executing the transaction request if the number of blockchain nodes signing the transaction request is greater than or equal to a preset threshold; and updating the second object version after the transaction request is executed.
  2. 2. The method of claim 1, wherein after said detecting whether said first object version of said on-chain entity is consistent with said block link point record, said method further comprises: In the event that the object type of the on-chain entity is the shared object and the first object version of the on-chain entity is consistent with the second object version, determining to execute the transaction request using a second transaction path, the second transaction path comprising packaging the transaction request into chunks, executing the transaction request in chunks.
  3. 3. The method of claim 1 or 2, wherein after the determining to execute the transaction request using a first transaction path, the method further comprises: In the event that it is determined that at least two transaction requests are performed using the first transaction path and that the at least two transaction requests are associated with at least one on-chain entity, detecting whether a first version of an object of the at least one on-chain entity in the at least two transaction requests is consistent; Detecting whether the at least two transaction requests are boundary protection transactions or not under the condition that the versions of first objects in the at least two transaction requests are consistent by the at least one on-chain entity, wherein the boundary protection transactions represent that the resource value of the at least one on-chain entity contained in the transaction request is requested to be modified and the resource value has a boundary; in the event that the transaction types of the at least two transaction requests are both boundary-protected transactions and the resource value of the at least one on-chain entity with which the at least two transaction requests are associated is requested to be modified at least twice, detecting whether the at least two modifications would cause the resource value of the at least one on-chain entity to exceed the boundary; The at least two transaction requests are executed using the first transaction path, in case the at least two modifications do not cause the resource value of the at least one on-chain entity to exceed the boundary.
  4. 4. A method according to claim 3, wherein after said detecting whether said at least two transaction requests are both boundary-protected transactions, the method further comprises: And if the transaction types of the at least two transaction requests are not the boundary protection transaction, submitting the transaction request with the earliest sequence in the at least two transaction requests by using the first transaction path, and executing other transaction requests in the at least two transaction requests by using the second transaction path.
  5. 5. A method according to claim 3, wherein after said detecting whether said at least two modifications would cause the resource value of said at least one on-chain entity to exceed said boundary, the method further comprises: the at least two transaction requests are executed using the second transaction path if the at least two modifications would cause the resource value of the at least one on-chain entity to exceed the boundary.
  6. 6. The method of claim 5, wherein the executing the at least two transaction requests using the second transaction path comprises: locking the first object version of the at least one on-chain entity to reject other transaction requests from referencing the at least one on-chain entity at the first object version; Initiating an object unlocking vote based on the at least two transaction requests; And under the condition that the number of the blockchain nodes signing the object unlocking votes is larger than or equal to the preset threshold, packaging the at least two transaction requests into a block, sequentially executing the at least two transaction requests in the form of the block, and unlocking the first object version of the at least one on-chain entity.
  7. 7. The method according to claim 1 or 2, wherein after updating the second object version, the method further comprises: and sharing the execution result of the transaction request among all blockchain nodes of a blockchain network, and updating a second object version corresponding to the on-chain entity contained in the transaction request.
  8. 8. An apparatus for performing a blockchain transaction for a blockchain node, the apparatus comprising: The receiving module is used for receiving the transaction request; an obtaining module, configured to obtain, from the transaction request, an object type and a first object version of an on-chain entity included in the transaction request, where the first object version indicates a number of times the on-chain entity is modified; The detection module is used for detecting whether the first object version of the entity on the chain is consistent with the second object version of the entity on the chain, which is recorded by the block chain link point; A determining module, configured to determine to execute the transaction request using a first transaction path if the object type of the on-chain entity is not a shared object and the first object version is consistent with the second object version, where the shared object represents that write operation authority to the on-chain entity is authorized by an arbitrary account, and the first transaction path includes signing the transaction request and executing the transaction request if a number of blockchain nodes that sign the transaction request is greater than or equal to a preset threshold; and the updating module is used for updating the second object version after the transaction request is executed.
  9. 9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of executing a blockchain transaction as claimed in any of claims 1 to 7 when the computer program is executed.
  10. 10. A computer program product comprising a computer program which, when executed, causes the execution method of a blockchain transaction as in any of claims 1 to 7 to be performed.

Description

Execution method and device of blockchain transaction and terminal equipment Technical Field The application belongs to the technical field of blockchain, and particularly relates to a method and a device for executing blockchain transaction and terminal equipment. Background In a blockchain network, it is necessary to fully order all transactions by a consensus protocol and then execute a batch of transactions in the form of "blocks" to modify the data in the ledger. Thus, the blockchain must be forced to order in the order of the blocks when executing the transaction, which greatly limits the throughput of the transaction, and the time from commit to completion (i.e., transaction delay) is also entirely limited by the time of block generation (i.e., the consensus time of a single block). At present, no effective solution is proposed for the problem of higher transaction delay of the transaction execution method relying on block generation in the related art. Disclosure of Invention The embodiment of the application provides a method, a device and terminal equipment for executing a blockchain transaction, which at least solve the problem of higher transaction delay of a transaction execution method depending on block generation in the related technology. In a first aspect, the embodiment of the application provides an execution method of a blockchain transaction, which is applied to a blockchain node, and comprises the steps of receiving a transaction request, acquiring an object type and a first object version of an on-chain entity contained in the transaction request from the transaction request, wherein the first object version indicates the number of times the on-chain entity is modified, detecting whether the first object version of the on-chain entity is consistent with a second object version of the on-chain entity recorded by the blockchain node, determining to execute the transaction request by using a first transaction path when the object type of the on-chain entity is not a shared object and the first object version is consistent with the second object version, wherein the shared object represents write operation authority of any account authority to the on-chain entity, the first transaction path comprises signing the transaction request, executing the transaction request when the number of blockchain nodes signing the transaction request is greater than or equal to a preset threshold, and updating the second object after the execution of the transaction request is completed. In some embodiments, after the detecting whether the first object version of the on-chain entity is consistent with the second object version of the on-chain entity, the method further comprises determining to execute the transaction request using a second transaction path including packaging the transaction request into a block and executing the transaction request in the form of a block, if the object type of the on-chain entity is the shared object and the first object version of the on-chain entity is consistent with the second object version. In some embodiments, after the determining to execute the transaction request using the first transaction path, the method further includes, in the event that it is determined to execute at least two transaction requests using the first transaction path and the at least two transaction requests are associated with at least one on-chain entity, detecting whether a first object version of the at least one on-chain entity in the at least two transaction requests is consistent, in the event that the first object version of the at least one on-chain entity in the at least two transaction requests is consistent, detecting whether the at least two transaction requests are both boundary-protected transactions, the boundary-protected transactions indicating that, in the transaction requests, a resource value of at least one on-chain entity included in the transaction requests is requested to be modified and the resource value exists as a boundary, in the event that the at least two transaction request is of a boundary-protected transaction and the resource value of the at least one on-chain entity associated with the at least two transaction requests is requested to be modified at least twice, detecting whether the at least two modification of the at least one on-chain entity causes the at least one resource value of the at least two on-chain entity to exceed the at least one boundary, and the at least two transaction requests do not cause the at least two link resource values to be modified by the at least one boundary. In some embodiments, after the detecting whether the at least two transaction requests are both boundary-protected transactions, the method further includes, in the event that the transaction types of the at least two transaction requests are not both the boundary-protected transactions, executing the one of the at least two transaction requests using the first transacti