Blockchain-based concurrent transaction processing method and application thereof

By analyzing the semantic legality of transactions and using dynamic programming, the transaction order was optimized, resolving the concurrency conflict problem in the Fabric blockchain system, improving transaction success rate and system performance, and reducing resource consumption.

CN115018648BActive Publication Date: 2026-04-28UNIV OF SCI & TECH OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UNIV OF SCI & TECH OF CHINA
Filing Date
2022-07-11
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

The Fabric blockchain system suffers from concurrency conflicts during concurrent transaction processing, resulting in low transaction success rates and high resource consumption. Existing technologies struggle to effectively resolve transaction conflicts among multiple clients, and cache queues may become performance bottlenecks.

Method used

By analyzing the semantic legitimacy of transactions, utilizing the positional relationship between read and write transactions, and combining dynamic programming, read-only transactions and invalid transactions are filtered out. The maximum set of mergeable transaction sequences is constructed, the positions of read and write transactions are adjusted to reduce the scale of conflicts, and a merge transaction selection algorithm with low time complexity is adopted to optimize the transaction order.

Benefits of technology

It improves the success rate of transaction submissions, reduces computational resource consumption, and enhances the concurrency performance of Fabric systems, especially when transaction access data is highly skewed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115018648B_ABST
    Figure CN115018648B_ABST
Patent Text Reader

Abstract

The application discloses a concurrent transaction processing method based on a block chain and application thereof, and the steps of the method comprise the following steps: 1. updating a maintenance state database to the latest value, 2. block data preprocessing, 3. solving a maximum combinable sequence set, and 4. merging transactions. When concurrent transactions in the block chain are processed, the method can screen out read-only transactions and transactions that are bound to be invalid, and can merge valid and semantically legal transactions, so that the possibility of transaction conflict in a block is reduced, and the concurrent performance of the block chain system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, specifically a method for concurrent transaction processing based on blockchain and its application. Background Technology

[0002] Consortium blockchains, as a branch of blockchain technology, represent an important direction for my country's blockchain development. Fabric, a highly regarded consortium blockchain platform, employs a pluggable and configurable highly modular architecture, offering flexibility, customizability, and scalability, making it applicable to diverse business scenarios. Traditional blockchain systems typically use a two-stage "sorting-execution" transaction processing model, which requires serialized transaction processing, limiting performance improvements. Fabric addresses this by proposing a three-stage "execution-sorting-verification" transaction processing model. Nodes can execute transactions in any order, then package transactions that result in state transitions into blocks, enabling concurrent transaction execution and improving system throughput. Nevertheless, compared to traditional distributed systems, Fabric's performance still lags significantly, failing to meet commercial-grade application standards, severely hindering its further development and application.

[0003] In the Fabric system, transactions can be executed concurrently, thus leading to concurrency conflicts. There are two main solutions to this problem. One approach is to identify and resolve conflicts at the client level. The paper "[A solution for the risk of non-deterministic transactions in hyperledger fabric]" addresses transaction concurrency conflicts and uncertainties caused by relative order by proposing to maintain a cache queue on the client side to determine conflict relationships between transactions. It only submits conflict-free transactions to the sorting node and listens for transaction submission events, checking transactions in the queue; if no conflict messages are found, the transaction is re-initiated. However, this method only resolves transaction conflicts initiated by a single client; it cannot handle conflicts from multiple clients, and the cache queue may become a performance bottleneck. The paper "[Solutions for concurrency conflict problem on hyperledger fabric]" proposes a locking mechanism to detect conflicts at the beginning of the transaction process, creating a temporary database index for the conflicting transaction, and merging the newly created index with the original index after transaction verification. However, in asynchronous blockchain systems, a locking service is needed to enable nodes to synchronously create and merge database indexes, which incurs additional communication costs.

[0004] Another approach involves analyzing transaction conflicts during the sorting phase by constructing a transaction dependency graph and using reordering mechanisms and selectively discarding certain transactions to determine a conflict-free transaction order. The paper "[Blurring thelines between blockchains and database systems: the case of hyperledgerfabric]" first used this method, proposing Fabric++, which calculates irresolvable conflicts by identifying strongly connected components in the dependency graph; then, it discards the transactions involving the most connected components until there are no loops in the dependency graph, and finally generates blocks based on the conflict-free transaction order constructed by topological sorting. Fabric++ reduces the number of conflicting transactions in blocks to some extent. The paper "[A transactional perspective on execute-order-validate blockchains]" builds upon Fabric++ by considering cross-block transaction conflicts and conflict types, proposing FabricSharp, which handles transaction conflicts with finer granularity. However, this type of method has performance drawbacks; the algorithm may be a performance bottleneck when the dependency graph is complex. The paper [Parblockchain: Leveraging transaction parallelism in permitted blockchain systems] proposes an OXI computational paradigm for parallel execution in high-concurrency environments. Ordering nodes also generate transaction dependency graphs, sending transactions to a subset of nodes for execution based on conflicting dependencies, and sharing the execution results with other nodes in the blockchain network. However, inconsistent execution results among nodes can lead to significant resource consumption. Summary of the Invention

[0005] This invention addresses the shortcomings of existing technologies by proposing a blockchain-based concurrent transaction processing method and its application. The aim is to resolve conflicts between semantically valid transactions within a block when processing concurrent transactions on the blockchain, thereby improving the transaction success rate of the Fabric system and reducing system resource consumption, thus enhancing the concurrent performance of the Fabric system.

[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0007] The present invention discloses a concurrent transaction processing method based on blockchain, characterized by its application in a transaction environment composed of a blockchain and a state database S. The blockchain blocks store transaction information generated by users conducting commodity transactions, and the state database S records the latest values ​​of all data objects. The concurrent transaction processing method is performed according to the following steps:

[0008] Step 1: Update the maintenance status database S to the latest value;

[0009] Step 1.1: Define the state database S = {s1, s2, ..., s...} i ,...,s I}, where s i Represents the i-th data object a i State information, where I is the total number of state information entries; let the i-th data object a i Status information s i It is a triple Among them, key ai Represents the i-th data object a i The key, Represents the i-th data object a i The latest version number, Represents the i-th data object a i The current value;

[0010] Step 1.2: Construct the transaction information set of the block to be uploaded to the blockchain, denoted as TX = {tx1, tx2, ..., tx} p ,...,tx P}, where tx p This represents the p-th transaction information, where P is the total number of transaction information items; the p-th transaction information item tx p The included operational data is denoted as Where, d q,p This represents the p-th transaction information tx. p The q-th operation in Q p This represents the p-th transaction information tx. p The maximum number of operands included; let the p-th transaction information tx p The q-th operation data d in q,p Includes triples Among them, key q,p This represents the data d of the q-th operation. q,p Access the key of the data object, This represents the data d of the q-th operation. q,p Read the version number of the data object. This represents the data d of the q-th operation. q,p Write the value to the data object;

[0011] Step 1.3: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding transaction read set ,in, This is transaction p. pThe j-th key version information read, key j,p , Let tx represent the p-th transaction. p The key and version number of the j-th data object read, where J is the p-th transaction tx. p The total number of read operations;

[0012] Step 1.4: Traverse the transaction read set RS p The key version pair information, for the j-th key version pair information If the key does not exist in the state database S j,p The data object or the key is... j,p The version number of the data object is less than Then update the corresponding entry in S as follows: in, The key is represented as key j,p Version number is The value of the data object;

[0013] Step 2: Block data preprocessing;

[0014] Step 2.1: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding transaction write set ,in, This is transaction p. p The k-th key-value pair information written, key k,p , Let tx represent the p-th transaction. p The key and value of the k-th data object written, where K is the p-th transaction tx. p The total number of write operations;

[0015] Step 2.2: If the p-th transaction information tx p WS transaction writing set p If empty, it means the p-th transaction information tx p To read the transaction, and then read the p-th transaction information tx p Move it to the first position in the block; otherwise, it represents the p-th transaction information tx. p Write the trade and hold it.

[0016] Step 2.3: Traverse the transaction information set TX. If the p-th transaction information tx... p RS transaction read set p There exists a key version pair satisfy The key in the state database S is less than the key. l,pIf the version number of the data object is obtained, the corresponding transaction will be marked, and the marked transaction will not participate in steps 3 and 4.

[0017] Step 3: Find the maximum set of mergeable transaction sequences;

[0018] Step 3.1: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding value increment set ΔV p ={<key 1,p ,Δval 1,p >, <key 2,p ,Δval 2,p >,...,<key e,p ,Δval e,p >,...,<key E,p ,Δval E,p >}, where <key e,p ,Δval e,p > is the p-th transaction tx p The key and value of the e-th data object involved, where E is the p-th transaction tx. p The total number of data objects involved;

[0019] Step 3.2: Determine if the transaction is semantically valid:

[0020] For the p-th transaction information tx p traverse ΔV p And calculate the key according to equation (1). e,p Data object a e The new value val e,p :

[0021]

[0022] In equation (1), val ae The key is key e,p Data object a e The value recorded in the state database S, if the p-th transaction information tx p If the new values ​​of all data objects involved are greater than or equal to 0, then the p-th transaction information tx is determined. p If the semantics are valid, then mark the p-th transaction information tx. p The semantics are invalid;

[0023] Step 3.3: Define an array arr, for the p-th transaction information tx p Let arr[p] represent tx p As the length of the longest valid transaction sequence for the last transaction message, arr[p] is initialized to 0;

[0024] Step 3.4: Define the largest mergeable transaction sequence set as B;

[0025] Step 3.5: Record the execution of transaction p, tx. p The resulting state database is S p ; denote tx p Any transaction outside of tx g Record the execution of transaction tx in clause g. g The resulting state database is S g If based on the state database S p Execute transaction tx g If it is legal, then record it. It is safe;

[0026] Step 3.6: Based on the state database S and the transaction information set TX, update the element arr[p] in the array arr using equation (2), thereby updating all elements in the array arr:

[0027]

[0028] In equation (2), max(·) represents taking the maximum value, and ∧ represents that;

[0029] Step 3.6: Find the maximum value in the array arr and its corresponding index t, that is, arr[t] is the maximum value in the array arr. Let the transaction sequence corresponding to arr[t] be the longest valid transaction subsequence L = (tx′1, tx′2, ... tx′). i ,...,tx′ t ), i∈[1,t], where tx′ i Let tx represent any transaction contained in the transaction sequence L, such that |L| ≤ t contains a number of transactions, and a transaction tx can be found in the transaction information set TX. k , making tx′ t =tx k , k∈[1,t];

[0030] Step 3.8: Add the longest legal transaction subsequence L to the largest mergeable transaction sequence set B, and denot the state database obtained after executing the transactions in L as S′, and the remaining transaction information set TX′ is composed of all transactions except those in L.

[0031] Step 3.9: Based on the state database S′ and the remaining transaction information set TX′, repeat steps 3.6 to 3.8 until the maximum mergeable transaction sequence set B is no longer updated, thus obtaining the updated maximum mergeable transaction sequence set B′;

[0032] Step 4: Merge transactions;

[0033] Step 4.1: Based on the state database S and the updated maximum mergeable transaction sequence set B′, obtain the new state database S. B ;

[0034] Step 4.2: Create an empty read set RS′ and an empty write set WS′;

[0035] Step 4.3: Traverse the transaction information set TX, and access any data object b from any transaction in TX. h The key and its version number in the state database S The binary pair formed Add to the read set RS′;

[0036] Step 4.4: Traverse the transaction information set TX, and access any data object b from any transaction in TX. h The key and its state database S B The value in The binary pair formed Add to write set WS′;

[0037] Step 4.5: The processed merged transaction is formed by the transaction sequence in the read set RS′, write set WS′ and the maximum mergeable transaction sequence set B′.

[0038] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program that supports the processor in executing the blockchain-based concurrent transaction processing method, and the processor is configured to execute the program stored in the memory.

[0039] The present invention discloses a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the steps of the blockchain-based concurrent transaction processing method.

[0040] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0041] 1. This invention analyzes the semantic legitimacy of transactions and utilizes the relationship between read / write transaction positions and conflicts to reasonably reduce the problem scale and transaction conflicts. Based on this, it combines dynamic programming to solve for the maximum mergeable transaction sequence. By merging transactions, it maximizes the success rate of transaction submissions and effectively improves the concurrency performance of the Fabric system, especially when transaction access data is highly skewed.

[0042] 2. This invention, by preprocessing transactions within a block and filtering out read-only transactions and ultimately invalid transactions, can effectively reduce the size of transactions to be processed and, compared with existing technologies, reduce the consumption of computing resources. By adjusting the relative positions of read and write transactions, conflicts between read and write transactions can be effectively reduced, improving the success rate of transaction submission. This invention directly processes transactions within a block, and compared with existing technologies based on client buffer queues, it can handle conflicts between multiple clients and avoids the bottleneck problem of buffer queues.

[0043] 3. This invention combines the idea of ​​dynamic programming to design a merge transaction selection algorithm with low time complexity, which finds an approximate solution for the optimal merge transaction subset. This can reduce the number of conflicting transactions within a block and submit as many semantically valid transactions as possible. Compared with dependency graph-based techniques, the algorithm in this invention has lower time complexity. Attached Figure Description

[0044] Figure 1 This is a flowchart of the blockchain-based concurrent transaction processing method proposed in this invention;

[0045] Figure 2 This is a flowchart of the block transaction preprocessing in the blockchain-based concurrent transaction processing method proposed in this invention. Detailed Implementation

[0046] In this embodiment, a blockchain-based concurrent transaction processing method is applied to a transaction environment composed of a blockchain and a state database S. The blockchain blocks store transaction information generated by users trading goods, and the state database S records the latest values ​​of all data objects. The blockchain is a consortium blockchain employing a three-stage "execution-sorting-verification" model, and transactions are processed according to a method during the sorting stage. Figure 1 As shown, the input to this method is source block data, which typically includes the block number, current block hash, previous block hash, time, certificate, public key, and a list of transaction information. After four steps—updating and maintaining the state database to the latest values, preprocessing the block data, solving for the maximum mergeable transaction sequence set, and merging transactions—the merged block data is obtained. The concurrent transaction processing method proceeds as follows:

[0047] Step 1: Update the maintenance status database S to the latest value;

[0048] Step 1.1: Define the state database S = {s1, s2, ..., s...} i ,...,s I}, where s i Represents the i-th data object a iState information, where I is the total number of state information entries; let the i-th data object a i Status information s i It is a triple in, Represents the i-th data object a i The key, Represents the i-th data object a i The latest version number, Represents the i-th data object a i The current value;

[0049] Step 1.2: Construct a set of transaction information for the blocks to be added to the blockchain, filtering out irrelevant information such as the current block hash, the previous block hash, time, certificate, and public key. This set is denoted as TX = {tx1, tx2, ..., tx}. p ,...,tx P}, where tx p This represents the p-th transaction message, where P is the total number of transaction messages; the p-th transaction message tx p The included operational data is denoted as Where, d q,p This represents the p-th transaction information tx. p The q-th operation in Q p This represents the p-th transaction information tx. p The maximum number of operations included; let the p-th transaction information tx p The q-th operation data d in q,p Includes triples Among them, key q,p This represents the data d of the q-th operation. q,p Access the key of the data object, This represents the data d of the q-th operation. q,p Read the version number of the data object. This represents the data d of the q-th operation. q,p Write the value to the data object;

[0050] Step 1.3: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding transaction read set ,in, This is transaction p. p The j-th key version information read, key j,p , Let tx represent the p-th transaction. p The key and version number of the j-th data object read, where J is the p-th transaction tx. p The total number of read operations;

[0051] Step 1.4: Traverse the transaction read set RS p The key version pair information, for the j-th key version pair information If the key does not exist in the state database S j,p The data object or the key is... j,p The version number of the data object is less than This indicates that the version number in S is not the latest at this time, so the corresponding entry in S is updated. in, The key is represented as key j,p Version number is The value of the data object;

[0052] Step 2: Block data preprocessing;

[0053] Step 2.1: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding transaction write set ,in, This is transaction p. p The k-th key-value pair information written, key k,p , Let tx represent the p-th transaction. p The key and value of the k-th data object written, where K is the p-th transaction tx. p The total number of write operations;

[0054] Step 2.2, as follows Figure 2 As shown, the system first determines whether a transaction is a read or write transaction based on whether the transaction write set is empty, and then adjusts the transaction's position in the block. If the p-th transaction information tx p WS transaction writing set p If empty, it means the p-th transaction information tx p To read the transaction, and then read the p-th transaction information tx p Move it to the first position in the block; otherwise, it represents the p-th transaction information tx. p To write the transaction and remain unchanged, that is, Figure 2 Transactions with empty write sets, as indicated in the diagram, are prioritized. This results in read transactions appearing before write transactions in a block, ensuring that read transactions are verified first. This reduces the likelihood of conflicts between read and write transactions.

[0055] Step 2.3: Traverse the transaction information set TX. If the p-th transaction information tx... p RS transaction read set p There exists a key version pair l∈[1,J] satisfies The key in the state database S is less than the key.l,p If the version number corresponding to the data object is obtained, the corresponding transaction will be marked, and the marked transaction will not participate in steps 3 and 4. Figure 2 As shown, the purpose of doing this is to determine whether an old version number exists in the transaction read set. If an old version number exists, the transaction will definitely fail to be verified during the verification phase, so it should be marked and no further processing is needed.

[0056] Step 3: Find the maximum set of mergeable transaction sequences;

[0057] Step 3.1: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding value increment set ΔV p ={<key 1,p ,Δval 1,p >, <key 2,p ,Δval 2,p >,...,<key e,p ,Δval e,p >,...,<key E,p ,Δval E,p >}, where <key e,p ,Δval e,p > is the p-th transaction tx p The key and value of the e-th data object involved, where E is the p-th transaction tx. p The total number of data objects involved;

[0058] Step 3.2: Determine if the transaction is semantically valid:

[0059] For the p-th transaction information tx p traverse ΔV p And calculate the key according to equation (1). e,p Data object a e The new value val e,p :

[0060]

[0061] In equation (1), The key is key e,p Data object a e The value recorded in the state database S, if the p-th transaction information tx p If the new values ​​of all data objects involved are greater than or equal to 0, then the p-th transaction information tx is determined. p If the semantics are valid, then mark the p-th transaction information tx. p The semantics are invalid;

[0062] Step 3.3: Define an array arr, for the p-th transaction information tx p Let arr[p] represent tx p As the length of the longest valid transaction sequence for the last transaction message, arr[p] is initialized to 0;

[0063] Step 3.4: Define the largest mergeable transaction sequence set as B;

[0064] Step 3.5: Record the execution of transaction p, tx. p The resulting state database is S p ; denote tx p Any transaction outside of tx g Record the execution of transaction tx in clause g. g The resulting state database is S g If based on the state database S p Execute transaction tx g If it is legal, then record it. It is safe;

[0065] Step 3.6: Based on the state database S and the transaction information set TX, update the element arr[p] in the array arr using equation (2), thereby updating all elements in the array arr:

[0066]

[0067] In equation (2), max(·) represents taking the maximum value, and ∧ represents that;

[0068] Step 3.6: Find the maximum value in the array arr and its corresponding index t, that is, arr[t] is the maximum value in the array arr. Let the transaction sequence corresponding to arr[t] be the longest valid transaction subsequence L = (tx′1, tx′2, ... tx′). i ,...,tx′ t ), where tx′ i Let tx represent any transaction contained in the transaction sequence L, such that |L| ≤ t contains a number of transactions, and a transaction tx can be found in the transaction information set TX. k , making tx′ t =tx k , k∈[1,t];

[0069] Step 3.8: Add the longest legal transaction subsequence L to the largest mergeable transaction sequence set B, and denot the state database obtained after executing the transactions in L as S′, and the remaining transaction information set TX′ is composed of all transactions except those in L.

[0070] Step 3.9: Based on the state database S′ and the remaining transaction information set TX′, repeat steps 3.6 to 3.8 until the maximum mergeable transaction sequence set B is no longer updated, thus obtaining the updated maximum mergeable transaction sequence set B′;

[0071] Step 4: Merge transactions;

[0072] Step 4.1: Based on the state database S and the updated maximum mergeable transaction sequence set B′, obtain the new state database S. B The solution process in step 3 ensures that both the intermediate state database and the final state database obtained by sequentially executing the transactions of the subsequences in B′ are in a safe state.

[0073] Step 4.2: Create an empty read set RS′ and an empty write set WS′;

[0074] Step 4.3: Traverse the transaction information set TX, and access any data object b from any transaction in TX. h The key and its version number in the state database S The binary pair formed Add to the read set RS′;

[0075] Step 4.4: Traverse the transaction information set TX, and access any data object b from any transaction in TX. h The key and its state database S B The value in The binary pair formed Add to write set WS′;

[0076] Step 4.5: The merged transaction is formed by combining the transaction sequences in the read set RS′, write set WS′ and the maximum mergeable transaction sequence set B′ (which indicates which transactions make up the merged transaction).

[0077] In this embodiment, an electronic device includes a memory and a processor. The memory is used to store a program that supports the processor in executing a blockchain-based concurrent transaction processing method. The processor is configured to execute the program stored in the memory.

[0078] In this embodiment, a computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of a blockchain-based concurrent transaction processing method.

Claims

1. A blockchain-based concurrent transaction processing method, characterized by: Applied to a transaction environment consisting of a blockchain and a state database S, the blockchain blocks store transaction information generated by users trading goods, and the state database S records the latest values ​​of all data objects; the concurrent transaction processing method is performed according to the following steps: Step 1: Update the maintenance status database S to the latest value; Step 1.1: Define the state database S = {s1, s2, ..., s...} i ,...,s I }, where s i Represents the i-th data object a i State information, where I is the total number of state information entries; let the i-th data object a i Status information s i It is a triple in, Represents the i-th data object a i The key, Represents the i-th data object a i The latest version number, Represents the i-th data object a i The current value; Step 1.2: Construct the transaction information set of the block to be uploaded to the blockchain, denoted as TX = {tx1, tx2, ..., tx} p ,...,tx P }, where tx p This represents the p-th transaction information, where P is the total number of transaction information items; the p-th transaction information item tx p The included operational data is denoted as Where, d q,p This represents the p-th transaction information tx. p The q-th operation in Q p This represents the p-th transaction information tx. p The maximum number of operands included; let the p-th transaction information tx p The q-th operation data d in q,p Includes triples Among them, key q,p This represents the data d of the q-th operation. q,p Access the key of the data object, This represents the data d of the q-th operation. q,p Read the version number of the data object. This represents the data d of the q-th operation. q,p Write the value to the data object; Step 1.3: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding transaction read set ,in, This is transaction p. p The j-th key version information read, key j,p , Let tx represent the p-th transaction. p The key and version number of the j-th data object read, where J is the p-th transaction tx. p The total number of read operations; Step 1.4: Traverse the transaction read set RS p The key version pair information, for the j-th key version pair information If the key does not exist in the state database S j,p The data object or the key is... j,p The version number of the data object is less than Then update the corresponding entry in S as follows: in, The key is represented as key j,p Version number is The value of the data object; Step 2: Block data preprocessing; Step 2.1: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding transaction write set ,in, This is transaction p. p The k-th key-value pair information written, key k,p , Let tx represent the p-th transaction. p The key and value of the k-th data object written, where K is the p-th transaction tx. p The total number of write operations; Step 2.2: If the p-th transaction information tx p WS transaction writing set p If empty, it means the p-th transaction information tx p To read the transaction, and then read the p-th transaction information tx p Move it to the first position in the block; otherwise, it represents the p-th transaction information tx. p Write the trade and hold it. Step 2.3: Traverse the transaction information set TX. If the p-th transaction information tx... p RS transaction read set p There exists a key version pair satisfy The key in the state database S is less than the key. l,p If the version number of the data object is obtained, the corresponding transaction will be marked, and the marked transaction will not participate in steps 3 and 4. Step 3: Find the maximum set of mergeable transaction sequences; Step 3.1: Traverse the transaction information set TX, and for the p-th transaction information tx p Construct the corresponding value increment set ΔV p ={<key 1,p ,Δval 1,p >, <key 2,p ,Δval 2,p >,...,<key e,p ,Δval e,p >,...,<key E,p ,Δval E,p >}, where <key e,p ,Δval e,p > is the p-th transaction tx p The key and value of the e-th data object involved, where E is the p-th transaction tx. p The total number of data objects involved; Step 3.2: Determine if the transaction is semantically valid: For the p-th transaction information tx p traverse ΔV p And calculate the key according to equation (1). e,p Data object a e The new value val e,p : In equation (1), The key is key e,p Data object a e The value recorded in the state database S, if the p-th transaction information tx p If the new values ​​of all data objects involved are greater than or equal to 0, then the p-th transaction information tx is determined. p If the semantics are valid, then mark the p-th transaction information tx. p The semantics are invalid; Step 3.3: Define an array arr, for the p-th transaction information tx p Let arr[p] represent tx p As the length of the longest valid transaction sequence for the last transaction message, arr[p] is initialized to 0; Step 3.4: Define the largest mergeable transaction sequence set as B; Step 3.5: Record the execution of transaction p, tx. p The resulting state database is S p ; denote tx p Any transaction outside of tx g Record the execution of transaction tx in clause g. g The resulting state database is S g If based on the state database S p Execute transaction tx g If it is legal, then record it. It is safe; Step 3.6: Based on the state database S and the transaction information set TX, update the element arr[p] in the array arr using equation (2), thereby updating all elements in the array arr: In equation (2), max(·) represents taking the maximum value, and ∧ represents that; Step 3.6: Find the maximum value in the array arr and its corresponding index t, that is, arr[t] is the maximum value in the array arr. Let the transaction sequence corresponding to arr[t] be the longest valid transaction subsequence L = (tx′1, tx′2, ... tx′). i ,...,tx′ t ), i∈[1,t], where tx′ i Let tx represent any transaction contained in the transaction sequence L, such that |L| ≤ t contains a number of transactions, and a transaction tx can be found in the transaction information set TX. k , making tx′ t =tx k , k∈[1,t]; Step 3.8: Add the longest legal transaction subsequence L to the largest mergeable transaction sequence set B, and denot the state database obtained after executing the transactions in L as S′, and the remaining transaction information set TX′ is composed of all transactions except those in L. Step 3.9: Based on the state database S′ and the remaining transaction information set TX′, repeat steps 3.6 to 3.8 until the maximum mergeable transaction sequence set B is no longer updated, thus obtaining the updated maximum mergeable transaction sequence set B′; Step 4: Merge transactions; Step 4.1: Based on the state database S and the updated maximum mergeable transaction sequence set B′, obtain the new state database S. B ; Step 4.2: Create an empty read set RS′ and an empty write set WS′; Step 4.3: Traverse the transaction information set TX, and access any data object b from any transaction in TX. h The key and its version number in the state database S The binary pair formed Add to the read set RS′; Step 4.4: Traverse the transaction information set TX, and access any data object b from any transaction in TX. h The key and its state database S B The value in The binary pair formed Add to write set WS′; Step 4.5: The processed merged transaction is formed by the transaction sequence in the read set RS′, write set WS′ and the maximum mergeable transaction sequence set B′.

2. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports a processor in executing the method of claim 1, the processor being configured to execute the program stored in the memory.

3. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to perform the steps of the method of claim 1.

Citation Information

Patent Citations

  • Block chain dynamic planning-based sequence plot association rule mining method

    CN108549653A

  • Block chain transaction submitting, editing and querying method based on time sequence attributes

    CN113656504A

  • Fabric-based transaction concurrency control method and system

    CN114240434A