CN109559226B - Block chain transaction execution method and system, electronic device and storage medium - Google Patents

Block chain transaction execution method and system, electronic device and storage medium Download PDF

Info

Publication number
CN109559226B
CN109559226B CN201811437041.1A CN201811437041A CN109559226B CN 109559226 B CN109559226 B CN 109559226B CN 201811437041 A CN201811437041 A CN 201811437041A CN 109559226 B CN109559226 B CN 109559226B
Authority
CN
China
Prior art keywords
transaction
group
transactions
execution
address
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.)
Active
Application number
CN201811437041.1A
Other languages
Chinese (zh)
Other versions
CN109559226A (en
Inventor
孙海涛
方芳
刘永安
潘国栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lianlian Yinjia Information Technology Co ltd
Original Assignee
Lianlian Yinjia Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lianlian Yinjia Information Technology Co ltd filed Critical Lianlian Yinjia Information Technology Co ltd
Priority to CN201811437041.1A priority Critical patent/CN109559226B/en
Publication of CN109559226A publication Critical patent/CN109559226A/en
Application granted granted Critical
Publication of CN109559226B publication Critical patent/CN109559226B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Economics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Development Economics (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses a block chain transaction execution method, a system, an electronic device and a medium, comprising: performing preliminary conflict detection and grouping on transaction addresses of all target transactions in the current block to obtain non-conflicting transaction groups, issuing the transaction groups to an execution process by taking the groups as units to obtain an execution result obtained after the execution process executes the transactions, performing deep conflict detection and grouping on the actual read-write address of each transaction according to the execution result, judging whether the transactions in each group in the grouping result are the same group in the current actual execution group, if not, issuing the groups different from the current actual execution group to the execution process for re-execution, and circulating until no conflict exists among the transaction groups. That is, the invention carries out parallel execution processing on the non-conflicted transactions, realizes the parallel processing of the transactions on the basis of ensuring the correctness of the transaction execution result, improves the performance of the block chain and can better meet the actual commercial requirements.

Description

Block chain transaction execution method and system, electronic device and storage medium
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method and a system for performing blockchain transactions, an electronic device, and a storage medium.
Background
The block chain has corresponding application value in many service scenes, such as evidence storage and the like. However, one of the problems in the prior art that restricts the large-scale commercial use of the blockchain is poor performance, for example, approximately 30 processing units in one second in etherhouse and approximately 8 processing units in bitcoin are used, and the performance is difficult to meet the performance requirement in the actual application scenario. In block chains, transactions are sequential and must be performed in order, resulting in poor performance. In view of this, the skilled person needs to pay attention to how to solve the above problems.
Disclosure of Invention
In view of the above, the present invention provides a method and a system for performing a blockchain transaction, an electronic device and a storage medium. The specific scheme is as follows:
in a first aspect, the present invention discloses a method for performing blockchain transactions, including:
acquiring all target transactions in a current block, and performing preliminary conflict detection on addresses of all the target transactions; wherein the address comprises a sender address and a recipient address;
dividing all the target transactions according to the result of the preliminary conflict detection to obtain a first type of transaction group which is not conflicted with each other, and taking the first type of transaction group as a transaction group to be executed;
issuing the transaction group to be executed to an execution process, and acquiring an execution result obtained by processing the transaction group to be executed by the execution process;
performing deep conflict detection on actual read-write addresses of all transactions in the transaction group to be executed by using the execution result, and dividing all transactions in the transaction group to be executed according to the result of the deep conflict detection to obtain second-class transaction groups which are not conflicted with each other;
judging whether the transactions in each group of the second type transaction group are in the same group in the first type transaction group; if the current block is the same group, writing the execution result into the current block, and ending the transaction execution; and if the transaction groups are different, taking the transaction group in the second type transaction group different from the first type transaction group as the transaction group to be executed, and returning to the step of issuing the transaction group to be executed to the execution process.
Optionally, the dividing all the target transactions according to the result of the preliminary conflict detection includes:
and merging the target transactions with the same address in the transaction into the same group according to the result of the preliminary conflict detection.
Optionally, after the dividing all the target transactions according to the result of the preliminary conflict detection to obtain a first type of transaction group that does not conflict with each other, the method further includes:
and adding an identifier for each transaction group in the first type transaction group.
Optionally, the performing deep conflict detection on the actual read-write addresses of all transactions in the executed transaction group by using the execution result includes:
judging whether common addresses exist in the actual read-write addresses of all transactions in the executed transaction group or not;
if not, determining that the conflict does not exist;
if yes, judging the type of the common address;
if the common address is the read address of the two transactions, determining that the two transactions are not in conflict;
and if the common address is the write address of two transactions, or the common address is the read address of one transaction and the write address of the other transaction, determining that the two transactions are in conflict.
In a second aspect, the present invention discloses a blockchain transaction execution system, including:
the initial detection module is used for acquiring all target transactions in the current block and carrying out initial conflict detection on the addresses of all the target transactions; wherein the address comprises a sender address and a recipient address;
the first grouping module is used for dividing all the target transactions according to the result of the primary conflict detection to obtain a first type of transaction group which does not conflict with each other and taking the first type of transaction group as a transaction group to be executed;
the transaction execution module is used for issuing the transaction group to be executed to an execution process and acquiring an execution result obtained by processing the transaction group to be executed by the execution process;
the second grouping module is used for carrying out depth conflict detection on actual read-write addresses of all transactions in the transaction group to be executed by utilizing the execution result and dividing all transactions in the transaction group to be executed according to the result of the depth conflict detection to obtain a second type of transaction group which does not conflict with each other;
the judging module is used for judging whether the transactions in each group of the second type transaction group are in the same group in the first type transaction group; the repeated execution module is used for writing the execution result into the current block if the execution result is the same group, and the transaction execution is finished; and if the transaction groups are different, taking the transaction group in the second type transaction group different from the first type transaction group as the transaction group to be executed, and starting the workflow of the transaction execution module.
Optionally, the first grouping module includes:
and merging the target transactions with the same address in the transaction into the same group according to the result of the preliminary conflict detection.
Optionally, the method further includes:
the identification module is used for adding an identification to each transaction group in the first type of transaction group after the first type of transaction group which is not mutually conflicted is obtained.
Optionally, the second grouping module includes:
the first judgment unit is used for judging whether the actual read-write addresses of all transactions in the executed transaction group have a common address or not;
a first determination unit configured to determine that no conflict exists if the common address does not exist;
a second judging unit, configured to judge a type of the common address if the common address exists;
the second judgment unit is used for judging that the common address is the read address of the two transactions and does not conflict;
and the third judging unit is used for judging the conflict if the common address is the writing address of two transactions, or the common address is the reading address of one transaction and the writing address of the other transaction.
In a third aspect, the present invention discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for realizing the block chain transaction execution method disclosed in the foregoing when executing the computer program.
In a fourth aspect, the present invention discloses a computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the blockchain transaction execution method disclosed in the foregoing.
Therefore, all target transactions in the current block are obtained, and preliminary conflict detection is carried out on the addresses of all the target transactions; wherein the address comprises a sender address and a recipient address; dividing all the target transactions according to the result of the preliminary conflict detection to obtain a first type of transaction group which is not conflicted with each other, and taking the first type of transaction group as a transaction group to be executed; issuing the transaction group to be executed to an execution process, and acquiring an execution result obtained by processing the transaction group to be executed by the execution process; performing deep conflict detection on actual read-write addresses of all transactions in the transaction group to be executed by using the execution result, and dividing all transactions in the transaction group to be executed according to the result of the deep conflict detection to obtain second-class transaction groups which are not conflicted with each other; judging whether the transactions in each group of the second type transaction group are in the same group in the first type transaction group; if the current block is the same group, writing the execution result into the current block, and ending the transaction execution; and if the transaction groups are different, taking the transaction group in the second type transaction group different from the first type transaction group as the transaction group to be executed, and returning to the step of issuing the transaction group to be executed to the execution process. That is, the invention performs conflict detection on the address of the transaction in the block to obtain non-conflicting transaction groups, further issues the transaction to the execution process for execution in units of groups, realizes parallel processing of the transaction on the basis of ensuring the correctness of the transaction execution result, improves the performance of the block chain, and can better meet the actual commercial requirements.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a method for performing blockchain transactions according to the present invention;
FIG. 2 is a flow chart illustrating a method for performing blockchain transactions according to the present invention;
FIG. 3 is a schematic diagram illustrating issue of a transaction group in the block chain transaction execution method according to the present invention;
FIG. 4 is a flow chart of a deep collision detection process in the method for performing blockchain transactions according to the present invention;
FIG. 5 is a block diagram of a blockchain transaction execution system according to the present invention;
fig. 6 is a hardware structure diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
One of the problems in the prior art that restricts large-scale commercialization of the blockchain is poor performance, for example, approximately 30 processing units in one second in etherhouse and approximately 8 processing units in bitcoin are used, and the performance is difficult to meet the performance requirement in the actual application scenario. In block chains, transactions are sequential and must be performed in order, resulting in poor performance.
The embodiment of the invention discloses a block chain transaction execution method, which is shown in figures 1 and 2 and comprises the following steps:
step S101: acquiring all target transactions in a current block, and performing preliminary conflict detection on addresses of all the target transactions; wherein the address comprises a sender address and a recipient address;
in this embodiment, all target transactions in the current block are acquired, and whether a common address exists in the sending address and the receiving address related to all the target transactions is detected. If yes, the conflict is determined, otherwise, the conflict is not determined.
Step S102: dividing all the target transactions according to the result of the preliminary conflict detection to obtain a first type of transaction group which is not conflicted with each other, and taking the first type of transaction group as a transaction group to be executed;
further, the present embodiment merges all transactions involving a common address into the same group according to the result of the preliminary collision detection.
Specifically, if any address in two transactions is the same, the two transactions are merged to obtain a plurality of transaction groups. And if at least one common address exists in the two transaction groups, combining the two transaction groups into one transaction group until no conflicting common address exists between any two groups, obtaining a first type of transaction group corresponding to the preliminary conflict detection result, and taking the first type of transaction group as a to-be-executed transaction group.
Step S103: issuing the transaction group to be executed to an execution process, and acquiring an execution result obtained by processing the transaction group to be executed by the execution process;
referring to fig. 3, in the embodiment, the scheduling module is used to issue the to-be-executed transaction group to different execution processes for concurrent execution, so as to obtain an execution result corresponding to the to-be-executed transaction group after being processed by the execution processes.
Step S104: performing deep conflict detection on actual read-write addresses of all transactions in the transaction group to be executed by using the execution result, and dividing all transactions in the transaction group to be executed according to the result of the deep conflict detection to obtain second-class transaction groups which are not conflicted with each other;
it should be noted that, in this embodiment, deep conflict detection is further performed on the read/write addresses actually related to all transactions in the transaction group to be executed by using the execution result, and the transactions are grouped, so as to obtain a second type of transaction group in which the read/write addresses do not conflict with each other.
Step S105: judging whether the transactions in each group of the second type transaction group are in the same group in the first type transaction group;
in this embodiment, after the execution result is used for grouping again, the obtained grouping results of the second-class transaction group and the first-class transaction group are compared, a new group formed after grouping the actually involved addresses is checked, and whether each transaction in the new group is the same group in the currently actually executed group is determined.
It can be understood that, after the first type transaction groups that do not conflict with each other are obtained, an identifier may be further added to each transaction group in the first type transaction groups. Correspondingly, when the transaction group to be executed is issued to the execution process, the transaction group to be executed can be issued by using the identifier, and after the second type of transaction group is obtained, the transaction groups are distinguished by using the identifier.
Step S106: if the current block is the same group, writing the execution result into the current block, and ending the transaction execution; and if the transaction groups are different, taking the transaction group in the second type transaction group different from the first type transaction group as the transaction group to be executed, and returning to the step of issuing the transaction group to be executed to the execution process.
In this embodiment, if the transactions in each group of the second type transaction group are the same group in the first type transaction group, which indicates that no new conflict occurs, the execution result is written into the block, and the current block transaction is executed; if the transaction groups are different groups and indicate that new conflicts appear, the transaction groups needing to be merged in the second transaction group obtained by deep conflict detection, namely the transaction groups different from the first transaction group are taken as transaction groups to be executed again and sent to the execution process, all the transaction groups are not required to be executed again, and only the transaction groups which are discovered to have conflicts at this time need to be executed.
For example, if the conflict between group i and group j in the transaction group N is found in the transaction group of the second type, the group i and the group j are merged and then issued to the execution process for execution. The execution only needs to execute the group i and the group j transaction groups with conflicts, and other transaction groups do not need to be executed, so that the execution performance is improved.
It should be noted that the reason why the present embodiment performs multiple iterations to detect whether there is a collision between addresses is that the execution of a new packet may involve reading a new address, which may be one of the addresses in a packet that has not collided before, possibly resulting in a new collision. In order to strictly ensure that the transactions must be executed in sequence, multiple iterative conflict detections are required to ensure the accuracy of transaction results.
Therefore, all target transactions in the current block are obtained, and preliminary conflict detection is carried out on the addresses of all the target transactions; wherein the address comprises a sender address and a recipient address; dividing all the target transactions according to the result of the preliminary conflict detection to obtain a first type of transaction group which is not conflicted with each other, and taking the first type of transaction group as a transaction group to be executed; issuing the transaction group to be executed to an execution process, and acquiring an execution result obtained by processing the transaction group to be executed by the execution process; performing deep conflict detection on actual read-write addresses of all transactions in the transaction group to be executed by using the execution result, and dividing all transactions in the transaction group to be executed according to the result of the deep conflict detection to obtain second-class transaction groups which are not conflicted with each other; whether the transactions in each group of the second type transaction group are in the same group in the first type transaction group; if the current block is the same group, writing the execution result into the current block, and ending the transaction execution; and if the transaction groups are different, taking the transaction group in the second type transaction group different from the first type transaction group as the transaction group to be executed, and returning to the step of issuing the transaction group to be executed to the execution process. That is, the invention performs conflict detection on the address of the transaction in the block to obtain non-conflicting transaction groups, further issues the transaction to the execution process for execution in units of groups, realizes parallel processing of the transaction on the basis of ensuring the correctness of the transaction execution result, improves the performance of the block chain, and can better meet the actual commercial requirements.
In a specific implementation manner of the block chain transaction execution method provided in the embodiment of the present invention, a process of performing deep collision detection on actual read/write addresses of all transactions by using an execution result is further described, as shown in fig. 4, the process includes:
step S201: judging whether common addresses exist in the actual read-write addresses of all transactions in the executed transaction group or not;
step S202: if not, determining that the conflict does not exist;
step S203: if yes, judging the type of the common address;
step S204: if the common address is the read address of the two transactions, determining that the two transactions are not in conflict;
step S205: and if the common address is the write address of two transactions, or the common address is the read address of one transaction and the write address of the other transaction, determining that the two transactions are in conflict.
In this embodiment, after the execution result is obtained, further collision detection is required because a read of a new address may be involved. Specifically, it is determined whether a common address exists in the actual read/write addresses of all transactions, where all transactions involved in deep collision detection include a transaction group for which a collision has not been detected before, that is, deep collision detection detects all transactions including previously executed transactions in a current block.
For example, if the conflict between group i and group j in the transaction group N is found in the transaction group of the second type, the group i and the group j are merged and then issued to the execution process for execution. After the execution returns, performing depth conflict detection on other transaction groups of all transaction groups including group 1 and group 2. Assuming that group ij and group k collide, group ij and group k are further merged and re-executed.
It will be appreciated that if a common address is involved, the type of common address is further determined. If the common address is the read address of the two transactions, the execution of the transactions is not influenced, and no conflict exists; if the common address is the write address of two transactions, or the read address of one transaction and the write address of the other transaction, the execution result of the transactions may be affected, and it is determined that a conflict exists.
In the following, the blockchain transaction execution system provided by the embodiment of the present invention is introduced, and the blockchain transaction execution system described below and the blockchain transaction execution method described above may be referred to correspondingly.
Fig. 5 is a block diagram of a blockchain transaction execution system according to an embodiment of the present invention, and referring to fig. 5, the blockchain transaction execution system includes:
an initial detection module 100, configured to obtain all target transactions in a current block, and perform initial collision detection on addresses of all the target transactions; wherein the address comprises a sender address and a recipient address;
the first grouping module 200 is used for dividing all the target transactions according to the result of the preliminary conflict detection to obtain mutually non-conflicting first-class transaction groups, and using the first-class transaction groups as transaction groups to be executed;
the transaction executing module 300 is configured to issue the to-be-executed transaction group to an executing process, and obtain an executing result obtained by processing the to-be-executed transaction group by the executing process;
a second grouping module 400, configured to perform deep conflict detection on actual read/write addresses of all transactions in the to-be-executed transaction group by using the execution result, and divide all transactions in the to-be-executed transaction group according to the result of the deep conflict detection, so as to obtain second type transaction groups that do not conflict with each other;
a judging module 500, configured to determine whether the transactions in each group of the second type transaction group are in the same group in the first type transaction group;
a repeat execution module 600, configured to, if the two blocks are the same group, write the execution result into the current block, and end the transaction execution; and if the transaction groups are different, taking the transaction group in the second type transaction group different from the first type transaction group as the transaction group to be executed, and starting the workflow of the transaction execution module.
Specifically, the first grouping module includes:
and merging the target transactions with the same address in the transaction into the same group according to the result of the preliminary conflict detection.
Further, the method can also comprise the following steps: the identification module is used for adding an identification to each transaction group in the first type of transaction group after the first type of transaction group which is not mutually conflicted is obtained.
It is understood that, in this embodiment, the second packet module may include:
the first judgment unit is used for judging whether the actual read-write addresses of all transactions in the executed transaction group have a common address or not;
a first determination unit configured to determine that no conflict exists if the common address does not exist;
a second judging unit, configured to judge a type of the common address if the common address exists;
the second judgment unit is used for judging that the common address is the read address of the two transactions and does not conflict;
and the third judging unit is used for judging the conflict if the common address is the writing address of two transactions, or the common address is the reading address of one transaction and the writing address of the other transaction.
Further, the embodiment of the present invention discloses an electronic device, which includes a memory 11 and a processor 12, wherein the memory 11 is used for storing a computer program, and the processor 12 is used for implementing the block chain transaction execution method disclosed in the foregoing when executing the computer program.
Further, referring to fig. 6, the electronic device in this embodiment may further include:
the input interface 13 is configured to obtain a computer program imported from the outside, store the obtained computer program in the memory 11, and also be configured to obtain various instructions and parameters transmitted by an external terminal device, and transmit the instructions and parameters to the processor 12, so that the processor 12 performs corresponding processing by using the instructions and parameters. In this embodiment, the input interface 13 may specifically include, but is not limited to, a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, and the like.
And the output interface 14 is used for outputting various data generated by the processor 12 to the terminal equipment connected with the output interface 14, so that other terminal equipment connected with the output interface 14 can acquire various data generated by the processor 12. In this embodiment, the output interface 14 may specifically include, but is not limited to, a USB interface, a serial interface, and the like.
And a display unit 15 for displaying the data sent by the processor 12.
The communication unit 16 is configured to establish a remote communication connection with an external server, acquire data sent by an external terminal, and send the data to the processor 12 for processing and analysis, and in addition, the processor 12 may also send various results obtained after processing to preset various data receiving ends through the communication unit 16. In this embodiment, the communication technology adopted by the communication unit 16 may be a wired communication technology or a wireless communication technology, such as a Universal Serial Bus (USB), a wireless fidelity technology (WiFi), a bluetooth communication technology, a low-power bluetooth communication technology (BLE), and the like. Additionally, the communication unit 16 may embody a cellular radio transceiver operating in accordance with wideband code division multiple access (W-CDMA), Long Term Evolution (LTE), and similar standards.
Further, an embodiment of the present invention discloses a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk. The storage medium stores a computer program, and when the computer program is executed by the processor, the method for performing blockchain transaction disclosed in the foregoing disclosure is implemented.
The invention carries out conflict detection on the address of the transaction in the block to obtain non-conflicting transaction groups, further issues the transaction to the execution process for execution by taking the group as a unit, realizes parallel processing of the transaction on the basis of ensuring the correctness of the transaction execution result, improves the performance of the block chain, and can better meet the actual commercial requirements.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method, system, electronic device and storage medium for performing blockchain transaction provided by the present invention are described in detail above, and the principle and implementation of the present invention are explained herein by applying specific examples, and the description of the above embodiments is only used to help understanding the method and core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1. A method for performing a blockchain transaction, comprising:
acquiring all target transactions in a current block, and performing preliminary conflict detection on addresses of all the target transactions; wherein the address comprises a sender address and a recipient address;
merging the target transactions with the same address in the transaction into the same group according to the result of the preliminary conflict detection to obtain a first type of transaction group which does not conflict with each other, and taking the first type of transaction group as a transaction group to be executed;
issuing the transaction group to be executed to an execution process, and acquiring an execution result obtained by processing the transaction group to be executed by the execution process;
performing deep conflict detection on actual read-write addresses of all transactions in the transaction group to be executed by using the execution result, and dividing all transactions in the transaction group to be executed according to the result of the deep conflict detection to obtain second-class transaction groups which are not conflicted with each other; wherein, the performing the deep conflict detection on the actual read-write addresses of all the transactions in the to-be-performed transaction group by using the execution result comprises: judging whether common addresses exist in the actual read-write addresses of all transactions in the executed transaction group or not;
judging whether the transactions in each group of the second type transaction group are in the same group in the first type transaction group; if the current block is the same group, writing the execution result into the current block, and ending the transaction execution; and if the transaction groups are different, taking the transaction group in the second type transaction group different from the first type transaction group as the transaction group to be executed, and returning to the step of issuing the transaction group to be executed to the execution process.
2. The method for performing blockchain transactions according to claim 1, wherein said dividing all target transactions according to the result of the preliminary conflict detection to obtain the non-conflicting first transaction groups further comprises:
and adding an identifier for each transaction group in the first type transaction group.
3. The blockchain transaction execution method according to claim 1 or 2, wherein the performing deep collision detection on the actual read/write addresses of all the transactions in the executed transaction group by using the execution result includes:
judging whether common addresses exist in the actual read-write addresses of all transactions in the executed transaction group or not;
if not, determining that the conflict does not exist;
if yes, judging the type of the common address;
if the common address is the read address of the two transactions, determining that the two transactions are not in conflict;
and if the common address is the write address of two transactions, or the common address is the read address of one transaction and the write address of the other transaction, determining that the two transactions are in conflict.
4. A blockchain transaction execution system, comprising:
the initial detection module is used for acquiring all target transactions in the current block and carrying out initial conflict detection on the addresses of all the target transactions; wherein the address comprises a sender address and a recipient address;
the first grouping module is used for combining the target transactions with the same address in the transaction into the same group according to the result of the primary conflict detection to obtain a first type of transaction group which does not conflict with each other, and taking the first type of transaction group as a transaction group to be executed;
the transaction execution module is used for issuing the transaction group to be executed to an execution process and acquiring an execution result obtained by processing the transaction group to be executed by the execution process;
the second grouping module is used for carrying out depth conflict detection on actual read-write addresses of all transactions in the transaction group to be executed by utilizing the execution result and dividing all transactions in the transaction group to be executed according to the result of the depth conflict detection to obtain a second type of transaction group which does not conflict with each other; wherein, the performing the deep conflict detection on the actual read-write addresses of all the transactions in the to-be-performed transaction group by using the execution result comprises: judging whether common addresses exist in the actual read-write addresses of all transactions in the executed transaction group or not;
the judging module is used for judging whether the transactions in each group of the second type transaction group are in the same group in the first type transaction group;
the repeated execution module is used for writing the execution result into the current block if the execution result is the same group, and the transaction execution is finished; and if the transaction groups are different, taking the transaction group in the second type transaction group different from the first type transaction group as the transaction group to be executed, and starting the workflow of the transaction execution module.
5. The blockchain transaction execution system of claim 4, further comprising:
the identification module is used for adding an identification to each transaction group in the first type of transaction group after the first type of transaction group which is not mutually conflicted is obtained.
6. The blockchain transaction execution system of claim 4 or 5, wherein the second grouping module comprises:
the first judgment unit is used for judging whether the actual read-write addresses of all transactions in the executed transaction group have a common address or not;
a first determination unit configured to determine that no conflict exists if the common address does not exist;
a second judging unit, configured to judge a type of the common address if the common address exists;
the second judgment unit is used for judging that the common address is the read address of the two transactions and does not conflict;
and the third judging unit is used for judging the conflict if the common address is the writing address of two transactions, or the common address is the reading address of one transaction and the writing address of the other transaction.
7. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the blockchain transaction execution method of any one of claims 1 to 3 when executing the computer program.
8. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the blockchain transaction execution method of any one of claims 1 to 3.
CN201811437041.1A 2018-11-28 2018-11-28 Block chain transaction execution method and system, electronic device and storage medium Active CN109559226B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811437041.1A CN109559226B (en) 2018-11-28 2018-11-28 Block chain transaction execution method and system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811437041.1A CN109559226B (en) 2018-11-28 2018-11-28 Block chain transaction execution method and system, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN109559226A CN109559226A (en) 2019-04-02
CN109559226B true CN109559226B (en) 2021-03-02

Family

ID=65867709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811437041.1A Active CN109559226B (en) 2018-11-28 2018-11-28 Block chain transaction execution method and system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN109559226B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110135985B (en) * 2019-04-04 2021-07-27 杭州抖音科技有限公司 Parallel execution method and system for transactions on block chain
SG11201910057QA (en) 2019-04-12 2019-11-28 Alibaba Group Holding Ltd Performing parallel execution of transactions in a distributed ledger system
JP6827564B2 (en) 2019-04-12 2021-02-10 アドバンスド ニュー テクノロジーズ カンパニー リミテッド Performing parallel execution of transactions in a distributed ledger system
CN113570460A (en) * 2019-08-30 2021-10-29 创新先进技术有限公司 Method and apparatus for concurrently executing transactions in a blockchain
CN111340482B (en) * 2020-02-10 2021-06-01 腾讯科技(深圳)有限公司 Conflict detection method, device, node equipment and storage medium
CN111563093B (en) * 2020-05-15 2023-04-25 电子科技大学 Method for detecting and avoiding system based on alliance blockchain conflict transaction
CN112037058B (en) * 2020-08-28 2024-03-26 平安科技(深圳)有限公司 Data verification method, device and storage medium
CN112887437B (en) * 2021-04-28 2021-08-03 支付宝(杭州)信息技术有限公司 Block chain transaction processing method, block chain node and block chain system
CN112988819B (en) * 2021-04-30 2021-08-20 支付宝(杭州)信息技术有限公司 Block chain transaction execution method, block chain node and control device
CN113064730A (en) * 2021-04-30 2021-07-02 支付宝(杭州)信息技术有限公司 Block chain transaction execution method, block chain node and control device
CN112883067A (en) * 2021-04-30 2021-06-01 支付宝(杭州)信息技术有限公司 Block chain transaction execution method, block chain node and control device
CN114049118A (en) * 2021-11-04 2022-02-15 深圳前海微众银行股份有限公司 Block chain attack interception method and device
CN114328133A (en) * 2022-03-16 2022-04-12 北京微芯感知科技有限公司 Single-mechanism distributed conflict detection method and system and deposit separation framework
CN114546884B (en) * 2022-04-21 2022-07-22 北京微芯感知科技有限公司 Block chain batch transaction conflict detection method and system
CN115796874B (en) * 2023-01-09 2023-05-09 杭州安节科技有限公司 Concurrent execution method for blockchain transaction at operation level

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107688999B (en) * 2017-08-11 2020-11-13 杭州溪塔科技有限公司 Block chain-based parallel transaction execution method

Also Published As

Publication number Publication date
CN109559226A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
CN109559226B (en) Block chain transaction execution method and system, electronic device and storage medium
CN106936441B (en) Data compression method and device
CN110727608B (en) Log data storage method, electronic equipment and storage medium
CN110750433A (en) Interface test method and device
CN114595040A (en) Processing method and device of process node, storage medium and electronic equipment
CN110175833B (en) Computer device, method, system and medium for binding bank card information
CN108776665B (en) Data processing method and device
CN105469783A (en) Audis identification method and device
CN110727691A (en) Data analysis and verification method and device
CN106033551A (en) Data parsing method, apparatus and system thereof
CN110535962B (en) Data synchronization method, device, equipment and storage medium based on authentication equipment
CN111125168A (en) Data processing method and device, electronic equipment and storage medium
CN106294104B (en) Test case execution method and mobile terminal
CN109614359B (en) AXI bus-based data transmission method, device and storage medium
CN109800273A (en) A kind of method, apparatus of data processing, computer storage medium and terminal
CN109299948A (en) A kind of red packet sending method, device, wearable device and storage medium
CN111782684B (en) Distribution network electronic handover information matching method and device
CN107249177A (en) The reminding method and system of children's wrist-watch position in terminal
CN113986747A (en) Data generation method and device, electronic equipment and storage medium
CN110119337B (en) Data analysis method and device and server
CN108243180B (en) Bank policy data docking method and policy data server
CN112035432A (en) Data replacement and migration method, device and computer equipment
CN104378207A (en) Information verification handling method and device
CN106126539B (en) User behavior data processing method and device
CN103905391A (en) Botnet command and control protocol acquisition method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20191231

Address after: 310000 Room 203, floor 2, building 1, No.79 Yueda lane, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Lianlian Yinjia Information Technology Co., Ltd

Address before: 310000, Hangzhou, Zhejiang, Binjiang District C space building 6

Applicant before: Hangzhou Shield Network Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant