CN114253920A - Transaction reordering method, device, equipment and readable storage medium - Google Patents

Transaction reordering method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN114253920A
CN114253920A CN202111483958.7A CN202111483958A CN114253920A CN 114253920 A CN114253920 A CN 114253920A CN 202111483958 A CN202111483958 A CN 202111483958A CN 114253920 A CN114253920 A CN 114253920A
Authority
CN
China
Prior art keywords
transaction
conflict
read
transactions
write data
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
CN202111483958.7A
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.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp 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 China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202111483958.7A priority Critical patent/CN114253920A/en
Publication of CN114253920A publication Critical patent/CN114253920A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to the technical field of networks, in particular to a transaction reordering method, a device, equipment and a readable storage medium, wherein the method comprises the following steps: acquiring a read-write data set of a transaction; sending the read-write data set of the transaction to a consensus module for processing to obtain conflict transactions in the read-write data set; generating a transaction conflict graph according to the conflict transaction, inputting the transaction conflict graph into a calculation module for calculation and identification to obtain a transaction conflict ring of the transaction conflict graph, wherein the transaction conflict graph is a relational graph of writing sets and modifying reading sets among the conflict transactions, and the transaction conflict ring is a conflict cycle in the transaction conflict graph; and re-determining the execution sequence of the transaction according to the transaction conflict ring. The invention reduces the number of the abandoned transactions of the Fabric due to the conflict of reading and writing transactions in the transaction verification stage, improves the concurrent number of the transactions, and confirms the abandoned transactions in the transaction sequencing stage in advance, thereby saving network resources.

Description

Transaction reordering method, device, equipment and readable storage medium
Technical Field
The invention relates to the technical field of networks, in particular to a transaction reordering method, a transaction reordering device and a readable storage medium.
Background
A Fabric network is a network formed by interconnecting a plurality of switches based on Fibre Channel (FC) protocol. The main function of the Fabric network is to provide data transmission service, and the server can send commands and data to the disk device or read data from the disk device through a switch (hereinafter referred to as FC switch) in the Fabric network.
The original transaction ordering mechanism in the Fabric is ordered according to the submission time of the transaction by default, so that read-write set conflicts of a plurality of transactions are caused, wherein the problem of cyclic dependence of part of transactions cannot be solved by the single transaction ordering mechanism, and the Fabric can determine whether one transaction is reserved in the verification stage, so that the whole network resources are wasted.
Disclosure of Invention
The present invention is directed to a transaction reordering method, apparatus, device and readable storage medium to improve the above-mentioned problems. In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
in one aspect, the present application provides a transaction reordering method, the method comprising: acquiring a read-write data set of a transaction; sending the read-write data set of the transaction to a consensus module for processing to obtain conflict transactions in the read-write data set; generating a transaction conflict graph according to the conflict transaction, inputting the transaction conflict graph into a calculation module for calculation and identification to obtain a transaction conflict ring of the transaction conflict graph, wherein the transaction conflict graph is a relational graph of writing sets and modifying reading sets among the conflict transactions, and the transaction conflict ring is a conflict cycle in the transaction conflict graph; and re-determining the execution sequence of the transaction according to the transaction conflict ring.
Optionally, the acquiring a read-write data set of a transaction includes:
acquiring a transaction proposal created by a client, and sending the transaction proposal created by the client to an endorsement node;
and receiving the transaction execution data simulated by the endorsement node, wherein the transaction execution data comprises a read key value and a write key value, and generating a read-write data set based on the read key value and the write key value.
Optionally, the sending the read-write data set of the transaction to a consensus module for processing to obtain a conflict transaction in the read-write data set includes:
regarding the read set and the write set of each key in the read-write data set as bit vectors to obtain a read vector and a write vector of each transaction;
performing bitwise AND operation on the read vector and the write vector of each transaction to obtain a result value of the bitwise AND operation;
and judging whether read-write conflict exists in the transaction of the read-write data set of the transaction according to the result value of the bitwise sum operation to obtain conflict transaction in the read-write data set of the transaction.
Optionally, the generating a transaction conflict graph according to the conflict transaction, inputting the transaction conflict graph into a calculation module for calculation and identification, and obtaining a transaction conflict ring of the transaction conflict graph includes:
summarizing the conflict transactions of the read-write data sets of the transactions to obtain a transaction conflict table of the read-write data sets of the transactions, and generating a transaction conflict graph according to conflict relations in the transaction conflict table;
finding out strong connected subgraphs existing in the transaction conflict graph according to a Tarjan algorithm, then independently placing each strong connected subgraph, and identifying transaction conflict loops existing in each strong connected subgraph according to a Johnson algorithm.
Optionally, said re-determining the execution order of the transactions according to the transaction conflict ring includes:
deleting the transaction with the largest number of the transaction conflict rings to obtain a transaction subset;
and sending the transaction subset to a reordering module for processing to obtain a new transaction execution sequence.
Optionally, the re-determining the execution order of the transactions according to the transaction conflict ring further includes:
packaging the reordered transactions into a new block and sending the block to a main node of each organization;
and receiving a verification result of the master node on the block, and writing the verification result into a local account book for storage.
In a second aspect, an embodiment of the present application provides a transaction reordering apparatus, including:
the first acquisition unit is used for acquiring a read-write data set of the transaction;
the first processing unit is used for sending the read-write data set of the transaction to a consensus module for processing to obtain conflict transactions in the read-write data set;
the second processing unit is used for generating a transaction conflict graph according to the conflict transaction, inputting the transaction conflict graph into a calculation module for calculation and identification to obtain a transaction conflict ring of the transaction conflict graph, wherein the transaction conflict graph is a relation graph of a writing set and a modified reading set among the conflict transactions, and the transaction conflict ring is a conflict cycle in the transaction conflict graph;
and the third processing unit is used for re-determining the execution sequence of the transaction according to the transaction conflict ring.
Optionally, the apparatus comprises:
the system comprises a first acquisition subunit, a second acquisition subunit and an endorsement node, wherein the first acquisition subunit is used for acquiring a transaction proposal created by a client and sending the transaction proposal created by the client to the endorsement node;
the first receiving subunit is configured to receive transaction execution data simulated by the endorsement node, where the transaction execution data includes a read key value and a write key value, and generate a read-write data set based on the read key value and the write key value.
Optionally, the apparatus comprises:
the first processing subunit is used for regarding the read set and the write set of each key in the read-write data set as bit vectors to obtain read vectors and write vectors of each transaction;
the second processing subunit is used for carrying out bitwise AND operation on the read vector and the write vector of each transaction to obtain a result value of the bitwise AND operation;
and the first judgment subunit is used for judging whether the transaction of the read-write data set of the transaction has read-write conflict according to the result value of the bitwise sum operation to obtain conflict transaction in the read-write data set of the transaction.
Optionally, the apparatus comprises:
the third processing subunit is used for summarizing the conflict transactions of the read-write data sets of the transactions to obtain a transaction conflict table of the read-write data sets of the transactions, and generating a transaction conflict graph according to conflict relations in the transaction conflict table;
and the fourth processing subunit is used for finding out strong connected subgraphs existing in the transaction conflict graph according to a Tarjan algorithm, then independently placing each strong connected subgraph, and identifying the transaction conflict ring existing in each strong connected subgraph according to a Johnson algorithm.
Optionally, the apparatus comprises:
the fifth processing subunit is used for deleting the transaction with the largest number of the transaction conflict rings to obtain a transaction subset;
and the sixth processing subunit is used for sending the transaction subset to the reordering module for processing to obtain a new transaction execution sequence.
Optionally, the apparatus further comprises:
the fourth processing unit is used for packaging the reordered transactions into a new block and sending the block to the main node of each organization;
and the first receiving unit is used for receiving the verification result of the main node on the block, and writing the verification result into a local account book for storage.
In a third aspect, an embodiment of the present application provides a transaction reordering device, including:
a memory for storing a computer program;
a processor for implementing the steps of the transaction re-ordering method as claimed in any one of claims 1 to 6 when executing the computer program.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the steps of the transaction reordering method according to any one of claims 1 to 6.
The invention has the beneficial effects that:
the invention reduces the number of the abandoned transactions of the Fabric due to the conflict of reading and writing transactions in the transaction verification stage, improves the concurrent number of the transactions, and confirms the abandoned transactions in the transaction sequencing stage in advance, thereby saving network resources.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flow chart illustrating a transaction reordering method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a transaction reordering device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a transaction reordering device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. Other embodiments, which can be derived by one of ordinary skill in the art from the embodiments given herein without any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
As shown in fig. 1, the present embodiment provides a transaction reordering method, which includes step S1, step S2, step S3 and step S4.
Step S1, acquiring a read-write data set of the transaction;
step S2, sending the read-write data set of the transaction to a consensus module for processing to obtain conflict transactions in the read-write data set;
step S3, generating a transaction conflict graph according to the conflict transaction, inputting the transaction conflict graph into a calculation module for calculation and identification to obtain a transaction conflict ring of the transaction conflict graph, wherein the transaction conflict graph is a relation graph of writing sets and modifying reading sets among the conflict transactions, and the transaction conflict ring is a conflict cycle in the transaction conflict graph;
and step S4, re-determining the execution sequence of the transaction according to the transaction conflict ring.
It can be understood that the invention reduces the number of the transactions abandoned by the Fabric due to the conflict between reading and writing of the transactions in the transaction verification stage, improves the number of concurrent transactions, and identifies the abandoned transactions in the transaction sequencing stage in advance by re-determining the execution sequence of the transactions, thereby saving network resources.
It is understood that the consensus module is a module that performs a consensus mechanism that verifies and confirms the transaction within a short time by voting by a particular node; for a transaction, if several nodes with irrelevant benefits can achieve consensus, we can consider that the whole network can achieve consensus for the node.
It is to be understood that the endorsement node refers to a node that undertakes the endorsement task in the blockchain, and can be simply understood as an endorsement node in the chain that verifies the transaction and declares that the transaction is legitimate (or illegitimate).
In a specific embodiment of the present disclosure, the step S1 includes steps S11 and S12.
Step S11, acquiring a transaction proposal created by the client, and sending the transaction proposal created by the client to an endorsement node;
step S12, receiving transaction execution data simulated by the endorsement node, where the transaction execution data includes a read key value and a write key value, and generating a read-write data set based on the read key value and the write key value.
The method and the system can create a transaction proposal through the client and send the transaction proposal to endorsement nodes of various organizations, each endorsement node simulates and executes transactions and generates a read-write operation set based on read key values and written key values, and then each endorsement node returns a proposal result to the client.
In a specific embodiment of the present disclosure, the step S2 includes steps S21, S22 and S23.
Step S21, regarding the read set and the write set of each key in the read-write data set as bit vectors to obtain the read vector and the write vector of each transaction;
step S22, performing bitwise AND operation on the read vector and the write vector of each transaction to obtain a result value of the bitwise AND operation;
and step S23, judging whether the transaction of the read-write data set of the transaction has read-write conflict according to the result value of the bitwise sum operation, and obtaining conflict transaction in the read-write data set of the transaction.
The client side can be understood to collect the endorsement results returned by enough endorsement nodes and then submit the transactions to the consensus module, wherein the transaction contents comprise read-write operation sets from proposal results; the consensus module identifies all transactions in the transaction set for which a conflict exists and calculates the value of the "bitwise AND" operation of the read vector and the write vector for each transaction. If the calculation result is not zero, it indicates that there is a read-write set conflict between the two transactions.
In a specific embodiment of the present disclosure, the step S3 includes steps S31 and S32.
Step S31, summarizing the conflict transactions of the read-write data sets of the transactions to obtain a transaction conflict table of the read-write data sets of the transactions, and generating a transaction conflict graph according to conflict relations in the transaction conflict table;
and step S32, finding out strong connected subgraphs existing in the transaction conflict graph according to a Tarjan algorithm, then independently placing each strong connected subgraph, and identifying the transaction conflict ring existing in each strong connected subgraph according to a Johnson algorithm.
It is understood that the Tarjan algorithm is an algorithm proposed by Robert Tarjan to solve the linear time of strongly connected components of a directed graph. The Johnson algorithm, also known as the Johnson rule, is one of the ranking methods in job ranking.
It can be understood that the existence of the ring in the transaction conflict graph is to illustrate that the conflict problem of circular dependence exists in the transaction set, find out the strongly connected subgraphs in the transaction conflict graph according to the algorithm Tarjan algorithm, and then identify the ring existing in each strongly connected subgraph according to the Johnson algorithm.
In a specific embodiment of the present disclosure, the step S4 includes steps S41 and S42.
Step S41, deleting the transaction with the largest number of the transaction conflict rings to obtain a transaction subset;
and step S42, sending the transaction subset to a reordering module for processing to obtain a new transaction execution sequence.
It can be understood that after all transaction conflict rings existing in the transaction conflict graph are identified, part of transactions in the transaction conflict rings are abandoned, a transaction sub-graph is generated according to the rest transactions, all transactions in the transaction sub-graph are obtained, and the execution sequence is rearranged.
In a specific embodiment of the present disclosure, the step S4 is followed by a step S5 and a step S6.
Step S5, packaging the reordered transaction into a new block, and sending the block to a main node of each organization;
and step S6, receiving the verification result of the master node on the block, and writing the verification result into a local account book for storage.
It will be appreciated that transactions discarded by the present invention are placed in new blocks and the reordering is repeated until the transaction is executed.
Example 2
As shown in fig. 2, the present embodiment provides a vehicle control apparatus including a first acquisition unit 701, a first processing unit 702, a second processing unit 703, and a third processing unit 704.
A first obtaining unit 701, configured to obtain a read-write data set of a transaction;
a first processing unit 702, configured to send the read-write data set of the transaction to a consensus module for processing, so as to obtain a conflict transaction in the read-write data set;
the second processing unit 703 is configured to generate a transaction conflict graph according to the conflict transaction, and input the transaction conflict graph into a calculation module for calculation and identification to obtain a transaction conflict ring of the transaction conflict graph, where the transaction conflict graph is a relation graph of a writing set and a modified reading set between the conflict transactions, and the transaction conflict ring is a conflict cycle in the transaction conflict graph;
a third processing unit 704, configured to re-determine an execution order of the transactions according to the transaction conflict ring.
In a specific embodiment of the present disclosure, the first obtaining unit 701 includes a first obtaining subunit 7011 and a first receiving subunit 7012.
A first obtaining subunit 7011, configured to obtain a transaction proposal created by a client, and send the transaction proposal created by the client to an endorsement node;
a first receiving subunit 7012, configured to receive transaction execution data simulated by the endorsement node, where the transaction execution data includes a read key value and a write key value, and a read-write data set is generated based on the read key value and the write key value.
In a specific embodiment of the present disclosure, the first processing unit 702 includes a first processing subunit 7021, a second processing subunit 7022, and a first determining subunit 7023.
A first processing subunit 7021, configured to regard the read set and the write set of each key in the read-write data set as bit vectors, so as to obtain a read vector and a write vector of each transaction;
a second processing subunit 7022, configured to perform a bitwise and operation on the read vector and the write vector of each transaction to obtain a result value of the bitwise and operation;
a first determining subunit 7023, configured to determine, according to the bitwise and result value of the operation, whether a read-write conflict exists in the transaction of the read-write data set of the transaction, to obtain a conflict transaction in the read-write data set of the transaction.
In a specific embodiment of the present disclosure, the second processing unit 703 includes a third processing subunit 7031 and a fourth processing subunit 7032.
A third processing subunit 7031, configured to summarize conflict transactions of the read-write data set of the transaction, obtain a transaction conflict table of the read-write data set of the transaction, and generate a transaction conflict graph according to a conflict relationship in the transaction conflict table;
a fourth processing subunit 7032, configured to find strong connected subgraphs existing in the transaction conflict graph according to the Tarjan algorithm, then place each strong connected subgraph independently, and identify a transaction conflict ring existing in each strong connected subgraph according to the Johnson algorithm.
In a specific embodiment of the present disclosure, the third processing unit 704 includes a fifth processing subunit 7041 and a sixth processing subunit 7042.
A fifth processing subunit 7041, configured to delete the transaction with the largest number of transaction conflict rings, so as to obtain a transaction subset;
a sixth processing subunit 7042, configured to send the transaction subset to the reordering module for processing, so as to obtain a new transaction execution sequence.
In a specific embodiment of the present disclosure, the third processing unit 704 further includes a fourth processing unit 705 and a first receiving unit 706.
A fourth processing unit 705, configured to encapsulate the reordered transactions into a new block, and send the block to a master node of each organization;
a first receiving unit 706, configured to receive a verification result of the master node for the block, and write the verification result into a local ledger for storage.
It should be noted that, regarding the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated herein.
Example 3
Corresponding to the above method embodiment, the present disclosure further provides a transaction reordering device, and a transaction reordering device described below and a transaction reordering method described above may be referred to in correspondence with each other:
FIG. 3 is a block diagram illustrating a transaction re-ordering apparatus 800 according to an example embodiment. As shown in fig. 3, the transaction re-ordering apparatus 800 may include: a processor 801, a memory 802. The transaction re-ordering apparatus 800 may also include one or more of a multimedia component 803, an input/output (I/O) interface 804, and a communication component 805.
The processor 801 is configured to control the overall operation of the transaction reordering apparatus 800, so as to complete all or part of the steps of the transaction reordering method. The memory 802 is used to store various types of data to support operation of the transaction re-ordering apparatus 800, such data may include, for example, instructions for any application or method operating on the transaction re-ordering apparatus 800, as well as application-related data, such as contact data, messaging, pictures, audio, video, and so forth. The Memory 802 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 803 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 802 or transmitted through the communication component 805. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 804 provides an interface between the processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the transaction re-ordering apparatus 800 and other devices. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so that the corresponding communication component 805 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the transaction reordering Device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing one of the transaction reordering methods described above.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the transaction reordering method described above is also provided. For example, the computer readable storage medium may be the memory 802 described above including program instructions that are executable by the processor 801 of the transaction re-ordering apparatus 800 to perform the transaction re-ordering method described above.
Example 4
Corresponding to the above method embodiment, the disclosed embodiment also provides a readable storage medium, and a readable storage medium described below and a transaction reordering method described above can be correspondingly referred to each other.
A readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the transaction reordering method of the above-described method embodiments.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (14)

1. A transaction reordering method, comprising:
acquiring a read-write data set of a transaction;
sending the read-write data set of the transaction to a consensus module for processing to obtain conflict transactions in the read-write data set;
generating a transaction conflict graph according to the conflict transaction, inputting the transaction conflict graph into a calculation module for calculation and identification to obtain a transaction conflict ring of the transaction conflict graph, wherein the transaction conflict graph is a relational graph of writing sets and modifying reading sets among the conflict transactions, and the transaction conflict ring is a conflict cycle in the transaction conflict graph;
and re-determining the execution sequence of the transaction according to the transaction conflict ring.
2. The transaction reordering method of claim 1 wherein said obtaining a read-write data set for a transaction comprises:
acquiring a transaction proposal created by a client, and sending the transaction proposal created by the client to an endorsement node;
and receiving the transaction execution data simulated by the endorsement node, wherein the transaction execution data comprises a read key value and a write key value, and generating a read-write data set based on the read key value and the write key value.
3. The transaction reordering method of claim 1 wherein sending the read-write data set of the transaction to a consensus module for processing to obtain a conflicting transaction in the read-write data set comprises:
regarding the read set and the write set of each key in the read-write data set as bit vectors to obtain a read vector and a write vector of each transaction;
performing bitwise AND operation on the read vector and the write vector of each transaction to obtain a result value of the bitwise AND operation;
and judging whether read-write conflict exists in the transaction of the read-write data set of the transaction according to the result value of the bitwise sum operation to obtain conflict transaction in the read-write data set of the transaction.
4. The transaction reordering method of claim 1 wherein said generating a transaction conflict graph according to said conflicting transactions, inputting said transaction conflict graph into a computation module for computation and identification to obtain a transaction conflict ring of said transaction conflict graph comprises:
summarizing the conflict transactions of the read-write data sets of the transactions to obtain a transaction conflict table of the read-write data sets of the transactions, and generating a transaction conflict graph according to conflict relations in the transaction conflict table;
finding out strong connected subgraphs existing in the transaction conflict graph according to a Tarjan algorithm, then independently placing each strong connected subgraph, and identifying transaction conflict loops existing in each strong connected subgraph according to a Johnson algorithm.
5. The transaction reordering method of claim 1 wherein said re-determining an order of execution of transactions according to said transaction conflict ring comprises:
deleting the transaction with the largest number of the transaction conflict rings to obtain a transaction subset;
and sending the transaction subset to a reordering module for processing to obtain a new transaction execution sequence.
6. The transaction reordering method of claim 1 wherein said re-determining an order of execution of transactions according to said transaction conflict ring further comprises:
packaging the reordered transactions into a new block and sending the block to a main node of each organization;
and receiving a verification result of the master node on the block, and writing the verification result into a local account book for storage.
7. A transaction reordering apparatus, comprising:
the first acquisition unit is used for acquiring a read-write data set of the transaction;
the first processing unit is used for sending the read-write data set of the transaction to a consensus module for processing to obtain conflict transactions in the read-write data set;
the second processing unit is used for generating a transaction conflict graph according to the conflict transaction, inputting the transaction conflict graph into a calculation module for calculation and identification to obtain a transaction conflict ring of the transaction conflict graph, wherein the transaction conflict graph is a relation graph of a writing set and a modified reading set among the conflict transactions, and the transaction conflict ring is a conflict cycle in the transaction conflict graph;
and the third processing unit is used for re-determining the execution sequence of the transaction according to the transaction conflict ring.
8. The transaction re-ordering apparatus according to claim 7, wherein said apparatus comprises:
the system comprises a first acquisition subunit, a second acquisition subunit and an endorsement node, wherein the first acquisition subunit is used for acquiring a transaction proposal created by a client and sending the transaction proposal created by the client to the endorsement node;
the first receiving subunit is configured to receive transaction execution data simulated by the endorsement node, where the transaction execution data includes a read key value and a write key value, and generate a read-write data set based on the read key value and the write key value.
9. The transaction re-ordering apparatus according to claim 7, wherein said apparatus comprises:
the first processing subunit is used for regarding the read set and the write set of each key in the read-write data set as bit vectors to obtain read vectors and write vectors of each transaction;
the second processing subunit is used for carrying out bitwise AND operation on the read vector and the write vector of each transaction to obtain a result value of the bitwise AND operation;
and the first judgment subunit is used for judging whether the transaction of the read-write data set of the transaction has read-write conflict according to the result value of the bitwise sum operation to obtain conflict transaction in the read-write data set of the transaction.
10. The transaction re-ordering apparatus according to claim 7, wherein said apparatus comprises:
the third processing subunit is used for summarizing the conflict transactions of the read-write data sets of the transactions to obtain a transaction conflict table of the read-write data sets of the transactions, and generating a transaction conflict graph according to conflict relations in the transaction conflict table;
and the fourth processing subunit is used for finding out strong connected subgraphs existing in the transaction conflict graph according to a Tarjan algorithm, then independently placing each strong connected subgraph, and identifying the transaction conflict ring existing in each strong connected subgraph according to a Johnson algorithm.
11. The transaction re-ordering apparatus according to claim 7, wherein said apparatus comprises:
the fifth processing subunit is used for deleting the transaction with the largest number of the transaction conflict rings to obtain a transaction subset;
and the sixth processing subunit is used for sending the transaction subset to the reordering module for processing to obtain a new transaction execution sequence.
12. The transaction re-ordering apparatus according to claim 7, wherein said apparatus further comprises:
the fourth processing unit is used for packaging the reordered transactions into a new block and sending the block to the main node of each organization;
and the first receiving unit is used for receiving the verification result of the main node on the block, and writing the verification result into a local account book for storage.
13. A transaction re-ordering apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the transaction re-ordering method as claimed in any one of claims 1 to 6 when executing the computer program.
14. A readable storage medium, characterized by: the readable storage medium has stored thereon a computer program which, when executed by a processor, carries out the steps of the transaction re-ordering method as claimed in any one of claims 1 to 6.
CN202111483958.7A 2021-12-07 2021-12-07 Transaction reordering method, device, equipment and readable storage medium Pending CN114253920A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111483958.7A CN114253920A (en) 2021-12-07 2021-12-07 Transaction reordering method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111483958.7A CN114253920A (en) 2021-12-07 2021-12-07 Transaction reordering method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114253920A true CN114253920A (en) 2022-03-29

Family

ID=80791752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111483958.7A Pending CN114253920A (en) 2021-12-07 2021-12-07 Transaction reordering method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114253920A (en)

Similar Documents

Publication Publication Date Title
US10237295B2 (en) Automated event ID field analysis on heterogeneous logs
RU2488166C2 (en) Service-oriented conveyor-based architecture
CN106126410B (en) The reminding method and device of code conflicts
CN104834599A (en) WEB security detection method and device
CN109993524A (en) Card certificate management method, device, equipment and computer readable storage medium
CN111352935B (en) Index creating method, device and equipment in block chain type account book
WO2021129379A1 (en) Information sharing chain generation method and apparatus, electronic device, and storage medium
JP2013077124A (en) Software test case generation device
CN114253920A (en) Transaction reordering method, device, equipment and readable storage medium
CN108287708B (en) Data processing method and device, server and computer readable storage medium
CN110334103A (en) The update method of recommendation service provides device, access mechanism and recommender system
JP2019144873A (en) Block diagram analyzer
CN109614271A (en) Control method, device, equipment and the storage medium of multiple company-data consistency
CN109614312A (en) Method for generating test case, device, electronic equipment and storage medium
CN111368013B (en) Unified identification method, system, equipment and storage medium based on multiple accounts
CN111444197B (en) Verification method, device and equipment for data records in block chain type account book
CN113537954B (en) Project milestone processing method and device, storage medium and electronic equipment
US10387554B1 (en) Applying matching data transformation information based on a user's editing of data within a document
CN112181242B (en) Page display method and device
US10998004B1 (en) Method and apparatus for generating a video based on a process
CN106934555B (en) Workflow organization method and device, computer equipment and storage medium
CN111210279A (en) Target user prediction method and device and electronic equipment
CN114416835A (en) Common sequence number processing method, device, equipment, storage medium and computer program
CN112445790A (en) Report data storage method, device, equipment and medium
CN112988600A (en) Service scene testing method and device, electronic equipment and 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