CN112463310A - Transaction data processing method, system, device and medium based on node fragmentation - Google Patents

Transaction data processing method, system, device and medium based on node fragmentation Download PDF

Info

Publication number
CN112463310A
CN112463310A CN202011424745.2A CN202011424745A CN112463310A CN 112463310 A CN112463310 A CN 112463310A CN 202011424745 A CN202011424745 A CN 202011424745A CN 112463310 A CN112463310 A CN 112463310A
Authority
CN
China
Prior art keywords
transaction
fragment
account
committee
node
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.)
Granted
Application number
CN202011424745.2A
Other languages
Chinese (zh)
Other versions
CN112463310B (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.)
Beijing Peersafe Technology Co ltd
Original Assignee
Beijing Peersafe 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 Beijing Peersafe Technology Co ltd filed Critical Beijing Peersafe Technology Co ltd
Priority to CN202011424745.2A priority Critical patent/CN112463310B/en
Publication of CN112463310A publication Critical patent/CN112463310A/en
Application granted granted Critical
Publication of CN112463310B publication Critical patent/CN112463310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/465Distributed object oriented systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a transaction data processing method, a system, equipment and a medium based on node fragmentation. The method comprises the following steps: receiving transaction data sent by at least one client by the gateway fragment; the gateway fragment sends a corresponding transaction data packet to each transaction fragment according to a preset period; processing at least one effective transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment; each transaction fragment sends an account variable value set to a committee fragment; the committee fragment updates account data corresponding to the at least one account address in the committee fragment, the gateway fragment, and each transaction fragment based on the set of valid account variable values. The method solves the problems of high development difficulty and high maintenance cost of the block chain network with high data throughput.

Description

Transaction data processing method, system, device and medium based on node fragmentation
Technical Field
The present application relates generally to the field of blockchain network technologies, and in particular, to a method, a system, a device, and a medium for processing transaction data based on node fragmentation.
Background
The blockchain network is a decentralized (i.e. independent of third party) distributed internet data storage system, and can perform verification, transmission and storage of transaction data through distributed nodes.
In the blockchain network, each node is required to participate in the processing process of the transaction data, and as the number of nodes in the blockchain network is increased, the throughput of the transaction data is reduced, and the processing process of the transaction data is low in efficiency.
In the related art, in order to solve the problem, the nodes in the blockchain network are subjected to branch chain processing, each branch chain includes at least one node, and each branch chain can process transaction data in parallel.
Disclosure of Invention
In view of the above-mentioned drawbacks and deficiencies in the prior art, it is desirable to provide a method, system, device, and medium for node-sharded-based transactional data processing that can improve data throughput and reduce maintenance costs of blockchain networks.
In a first aspect, the present application provides a method for processing transaction data based on node fragmentation, including:
the method comprises the steps that a gateway fragment receives transaction data sent by at least one client, wherein the transaction data comprises an account address;
the gateway fragment sends a corresponding transaction data packet to each transaction fragment according to a preset period, wherein the transaction data packet comprises at least one transaction data;
processing at least one effective transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment;
each transaction fragment sends an account variable value set to a committee fragment;
updating account data corresponding to at least one account address in the committee fragment, the gateway fragment and each transaction fragment on the basis of the effective account variable value set;
in a second aspect, the present application provides a node fragmentation-based transaction data processing apparatus, including:
the receiving module is configured to receive transaction data sent by at least one client through the gateway fragment, wherein the transaction data comprises an account address;
the first sending module is configured to send a corresponding transaction data packet to each transaction fragment according to a preset period, wherein the transaction data packet comprises at least one transaction data;
the processing module is configured to process at least one effective transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment;
a second sending module configured to send an account variable value set to the committee fragment for each transaction fragment;
the updating module is configured to update account data corresponding to at least one account address in the committee fragment, the gateway fragment and each transaction processing fragment based on the effective account variable value set;
in a third aspect, the present application provides a computer device comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to execute the node fragment-based transaction data processing method according to the first aspect;
in a fourth aspect, the present application provides a computer-readable medium, in which a computer program is stored, and when the computer program is executed by a processor, the method for processing transaction data based on node fragmentation according to the first aspect is implemented.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the method, the system, the device and the medium for processing the transaction data based on the node fragments provided by the embodiment of the application can receive the transaction data sent by at least one client by the gateway fragments, wherein the transaction data comprises an account address; the gateway fragment sends a corresponding transaction data packet to each transaction fragment according to a preset period; processing at least one effective transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment; each transaction fragment sends an account variable value set to a committee fragment; the committee fragment updates account data corresponding to the at least one account address in the committee fragment, the gateway fragment, and each transaction fragment based on the set of valid account variable values. The data throughput and the transaction data processing efficiency can be improved, the system development difficulty is low, the maintenance cost is low, and the expandability is strong.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a schematic structural diagram of a transaction data processing system based on node fragmentation according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a transaction data processing method based on node fragmentation according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another transaction data processing method based on node fragmentation according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a transaction data processing apparatus based on node fragmentation according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a schematic structural diagram of a transaction data processing system based on node fragmentation according to an embodiment of the present application. As shown in fig. 1, the system includes: the system comprises a gateway segment 110, at least one transaction segment 120, a committee segment 130 and a client 140, wherein the client 140 is connected with the gateway segment 110, the gateway segment 110 is connected with each transaction segment 120, each transaction segment 120 is connected with the committee segment 130, and the gateway segment 110 is also connected with the committee segment 130, wherein the connection mode can be wired communication connection or wireless communication connection. The gateway segment 110 includes at least one gateway node 111, each transaction segment 120 includes at least one transaction node 121, and the committee segment 130 includes at least one committee node 131.
With continued reference to fig. 1, in the system, the gateway segment 110 is configured to receive at least one transaction data sent by at least one client 140, determine a transaction processing segment 120 corresponding to each transaction data based on an account address in the transaction data, package the at least one transaction data corresponding to each transaction processing segment 120 according to a preset period to obtain a transaction data packet, and send the transaction data packet to each transaction processing node 121 in the corresponding transaction processing segment 120. The preset period may be determined based on actual needs, which is not limited in the embodiment of the present application. It is to be understood that any one of the gateway nodes 111 in the gateway shard 110 may perform this process.
Each transaction fragment 120 is configured to receive a transaction data packet sent by the gateway fragment 110, a transaction node 121 in the transaction fragment 120 may validate at least one transaction data in the received transaction data packet, and if any transaction data fails to be validated, send a validation failure result message to the gateway fragment 110, and the gateway fragment 110 sends a transaction failure notification to a transaction request initiating client 140 corresponding to the transaction data; if any transaction data is successfully verified, determining the transaction data as valid transaction data, acquiring at least one valid transaction data, and processing each valid transaction data to obtain an account variable value set; and after the account variable value set is successfully identified, the account variable value set is sent to each committee node 131 in the committee fragment 130, otherwise, the transaction processing fragment 120 caches the at least one valid transaction data, waits for the next round of identification process, and identifies the at least one valid transaction data in the next round of identification process until the identification is successful.
The committee segment 130 is configured to receive the account variable value sets sent by each transaction segment 120, and the committee node 131 in the committee segment 130 may verify each received account variable value set, and if any account variable value set fails to be verified, send a verification failure result message to the transaction segment 120 that sent the account variable value set; if the account variable value set is successfully verified, the account variable value set is determined to be an effective variable value set, and each received account variable value set sent by each transaction fragment 120 is determined to be an effective account variable value set, the account data corresponding to at least one account address is updated based on the effective account variable value set corresponding to each transaction fragment, such as the committee fragment 140, the gateway fragment 110, and each transaction fragment 130.
It should be noted that, in the transaction data processing system based on node shards provided in the embodiment of the present application, the node device of a node may be a terminal device with data processing capability, such as a computer or a server. The segment to which the node belongs is determined based on node configuration information in a configuration file of the node device, where the node configuration information at least includes a node type of the node device, such as a gateway node, a transaction processing node, or a committee node, and for the transaction processing node, the node information also includes a segment identifier of a transaction processing segment corresponding to the transaction processing node. It will be appreciated that after the system is built, each node in the system may synchronize node configuration information for each node to other nodes.
An embodiment of the present application provides a method for processing transaction data based on node fragmentation, where the method is applied to a system for processing transaction data based on node fragmentation shown in fig. 1, and as shown in fig. 2, the method includes:
step 201, the gateway fragment receives transaction data sent by at least one client.
In this step, any gateway node in the gateway segment may receive transaction data sent by at least one client, where the transaction data includes an account address, and the account address includes an account address of a transaction request corresponding to the transaction data.
Step 202, the gateway fragment sends a corresponding transaction data packet to each transaction fragment according to a preset period.
In this embodiment of the present application, a gateway node in a gateway fragment usually receives multiple transaction data in a short time, and if the transaction data is sent to a transaction fragment corresponding to the transaction data one by one, network consumption is increased, and usually, each gateway node periodically sends multiple transaction data acquired in each period to the transaction fragment, so that network consumption is reduced, and network congestion is prevented.
In this step, the process that the gateway fragment sends the corresponding transaction data packet to each transaction fragment according to the preset period may include: determining transaction fragments corresponding to each transaction data, and packaging at least one transaction data corresponding to each transaction fragment in each period duration according to a preset period to obtain a transaction data packet corresponding to each transaction fragment; and signing the transaction data packet and then sending the transaction data packet to a transaction processing fragment corresponding to the transaction data packet. For example, each cycle duration of the preset cycle may be 500 milliseconds (ms).
It can be understood that, in the embodiment of the present application, the account address in each transaction data includes an initiating account address of the transaction request, and then the process of determining the transaction fragment corresponding to each transaction data may be: obtaining the fragment number of the transaction processing fragments based on the node configuration information; for each transaction data, determining a remainder of a ratio of an initiating account address corresponding to the transaction data to the fragment number; determining the sum of the remainder and the standard value as a target fragment identifier; and determining the transaction fragment corresponding to the target fragment identification as the transaction fragment corresponding to the transaction data. Wherein the standard value is a numerical value of 1. Preferably, the transaction processing fragment corresponding to each transaction data can be determined based on the 4 th bit after the account address, so that the data processing amount is reduced.
Step 203, each transaction fragment processes at least one valid transaction data to obtain an account variable value set corresponding to the transaction fragment.
In this embodiment of the present application, after receiving a transaction data packet, each transaction fragment first needs to verify the transaction data packet, where the verification process may include signature verification and validity verification, where the purpose of signature verification is to determine whether the transaction data packet is sent by a gateway node, and the signature verification process may be: acquiring a signature public key in the transaction data packet, verifying the signature transaction data packet by using the signature public key, and if the verification can be successful, passing the signature verification to acquire the transaction data packet; the purpose of validity verification is to determine whether a transaction request corresponding to transaction data is reasonable and executable, for example, for transaction data corresponding to a certain transfer transaction request, it needs to be determined whether an account balance corresponding to an originating account address of the transaction request is greater than or equal to a transfer amount, and if so, the transaction data is determined to be valid transaction data.
During the process of verifying the transaction data packet, signature verification is firstly carried out, and if the signature verification fails, a verification failure result message is sent to the corresponding transaction processing fragment; and if the signature verification is successful, performing validity verification, wherein the validity verification is usually performed on each transaction data one by one, and when the validity verification corresponding to the transaction data is successful, determining the transaction data as valid transaction data.
It can be understood that, in this embodiment of the present application, the account address in each transaction data further includes a target account address of the transaction request, and in this step, the process of processing at least one valid transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment is as follows: for each valid transaction data, determining an account variable value associated with the originating account address corresponding to the valid transaction data; determining account variable values associated with the target account address corresponding to valid transaction data; the set of account variable values associated with each originating account address and each target account address is determined as a set of account variable values corresponding to the transaction splits.
For example, suppose that the transaction fragment 1 receives two valid transaction data, where the transaction request corresponding to the first valid transaction data is: sending a transfer transaction to an account address B by an account address A, transferring the account amount X, wherein the transaction request corresponding to the second valid transaction data is that the account address B sends a transfer transaction to an account address C, transferring the account amount Y, and because the transaction fragment corresponding to the account address A and the account address B is a transaction fragment 1, the determined account variable value set corresponding to the transaction fragment 1 is changed from the account variable value delta1A=-X,△1B=X,△1B=-Y,△1CY.
It can be understood that, in the embodiment of the present application, each transaction node in each transaction fragment needs to perform consensus on the account variable value set corresponding to the transaction fragment, and after the consensus is successful, obtain a first consensus certification corresponding to the account variable value set, where the first consensus certification includes a signature of each normal transaction node in the transaction fragment on a consensus result. And executing the step 204, otherwise, caching the account variable value set, waiting for the next round of consensus process, and performing consensus on the account variable value set in the next round of consensus process. The algorithm used in the consensus process may be a Practical Byzantine Fault Tolerant (PBFT) consensus algorithm. The transaction data can be processed by a plurality of transaction processing fragments, so that the data throughput and the processing efficiency of the block chain network can be improved, and the performance of the block chain network can be improved.
And step 204, each transaction fragment sends an account variable value set to the committee fragment.
In this embodiment of the present application, in order to reduce the data transmission amount during the process that the transaction nodes in the transaction fragment transmit the account variable value sets to the committee fragments, and prevent network congestion, the transaction nodes in each transaction fragment may be grouped to obtain at least two first transaction node groups, meanwhile, the committee nodes in the committee fragment are divided into first committee node groups having the same number as the number of the transaction node groups, and a one-to-one correspondence relationship between at least two first transaction node groups and at least two first committee node groups is established, so that the transaction nodes in each first transaction node group transmit the valid account variable value sets to each committee node in the corresponding first committee node group.
In this step, the process of sending the account variable value set to the committee fragment by each transaction fragment may be: for each transaction fragment, determining the number of first transaction node groups and the number of transaction nodes corresponding to each first transaction node group based on the number of transaction nodes in the transaction fragment; allocating transaction processing nodes corresponding to the number of the transaction processing nodes to each first transaction processing node group; determining a first committee node group corresponding to each first transaction processing node group; each transaction node in each first set of transaction nodes sends a set of legal account variable values to each committee node in the first set of committee nodes corresponding to the first set of transaction nodes. It will be appreciated that in the process of each transaction node sending a set of legal account variable values to each committee node corresponding to the group of transaction nodes, a first proof of consensus corresponding to the set of legal account variable values is sent at the same time.
It should be noted that, in this embodiment of the present application, the process of determining the number of the first transaction node groups and the number of the transaction nodes corresponding to each first transaction node group based on the number of the transaction nodes in the transaction fragment may be determined based on a consensus algorithm adopted in a process of performing consensus on the account variable value set, and if the account variable value set in this embodiment of the present application is determined by using a PBFT consensus algorithm, the PBFT consensus algorithm needs to ensure that the number of the normal transaction nodes in the transaction fragment is equal to
Figure BDA0002824303910000081
The number of fault-tolerant nodes is
Figure BDA0002824303910000082
The first transaction processing node group number is
Figure BDA0002824303910000083
When the ratio of N to 3 has no remainder, the number of the first transaction processing node groups is 3, and when the ratio of N to 3 has remainder, the number of the first transaction processing node groups is 2, and the number of the transaction processing nodes in each first transaction processing node group is
Figure BDA0002824303910000084
Where N is the number of transaction processing nodes,
Figure BDA0002824303910000085
meaning that the log values are rounded down,
Figure BDA0002824303910000086
indicating that the log value is rounded up. It will be appreciated that when N is 3, the transactional nodes may be divided into two first groups of transactional nodes, wherein one first group of transactional nodes comprises one transactional node and the other first group of transactional nodes comprises two transactional nodes.
The process of allocating the transaction nodes corresponding to the number of the transaction nodes to each first transaction node group may be: for each first transaction processing node group, at least one transaction processing node corresponding to the number of transaction processing nodes is randomly selected from the at least one transaction processing node, and the at least one transaction processing node is determined to be the transaction processing node corresponding to the first transaction processing node group. It is to be understood that, in the embodiment of the present application, the transaction nodes in each first transaction node group are not the same.
Wherein the process of determining the first committee node group corresponding to each first transaction processing node group may be: determining the number of committee nodes based on the node configuration information, determining the ratio of the number of the committee nodes to the number of the transaction node groups, obtaining the number of first committee nodes corresponding to each first committee node group, selecting the committee nodes corresponding to the number of the first committee nodes for each first committee node group from the plurality of committee nodes, and establishing the matching relationship between the first committee node group and each transaction node group. It is to be understood that in the embodiments of the present application, the committee nodes in each first set of committee nodes are different.
Optionally, the process of establishing a matching relationship between each first committee node group and each first transaction processing node group may be: and allocating a node group identifier for each first transaction processing node group, allocating a node group identifier for each first committee node group, establishing a matching relationship between the first transaction processing node group with the same node group identifier and the first committee node group, and obtaining the matching relationship between the first committee node group and each transaction processing node group.
Step 205, the committee segment updates account data corresponding to at least one account address in the committee segment, the gateway segment and each transaction segment based on the valid account variable value sets.
In the embodiment of the application, after receiving the account variable value sets sent by each transaction fragment, the committee fragment verifies the account variable value sets, the verification process includes signature verification based on a first consensus certificate and validity verification of the account variable values in the account variable value sets, after the verification is successful, whether each account variable value set sent by each received transaction fragment is an effective account variable value set is determined, if yes, the account data corresponding to at least one account address in the committee fragment, the gateway fragment and each transaction fragment is updated based on the effective account variable value sets, otherwise, the obtained effective account variable value sets are cached, and the account variable value sets sent by each transaction fragment are continuously received until whether each received account variable value set sent by each transaction fragment is determined to be an effective account variable value set, updating account data corresponding to at least one account address in the committee fragment, the gateway fragment, and each transaction fragment based on the set of valid account variable values and the set of valid account variable values that have been obtained.
In this step, as shown in fig. 3, the updating of the committee fragment, the gateway fragment, and the account data corresponding to the valid account address in each transaction fragment based on at least one valid account variable value set by the committee fragment may include:
step 2051, traversing each valid account variable value set to obtain at least one account data variation and an account address corresponding to each account data variation.
Step 2052 determines a consolidated account variable value corresponding to each account address based on the at least one account data delta corresponding to each account address.
Step 2053 updates the account data corresponding to each account address in the committee fragment based on the merged account variable value corresponding to each account address.
In this step, the updating account data corresponding to each account address in the committee fragment based on the merged account variable value corresponding to each account address includes: the method includes the steps of obtaining original account data corresponding to each account address, determining the sum of the original account data and merged account variable values corresponding to the account addresses, and determining the sum as updated account data corresponding to the account addresses.
For example, assuming that traversing each set of valid account variable values results in an account data variance corresponding to account address D includes: account variation Δ1DAccount variation Δ2DAnd account variance Δ5DCombining the three account variable quantities to obtain a combined account variable value delta corresponding to the account addressD=△1D+△2D+△5D. Obtaining original account data Delta corresponding to the account address D5D’Original account data Δ5D’And merge account variable value deltaDSum value V ofDIs the updated account data corresponding to the account address D.
It is understood that, in the embodiment of the present application, the committee node in the committee segment needs to perform consensus on the updated account data corresponding to each account address, and after successful consensus, obtain a second consensus certificate corresponding to the account address, where the second consensus certificate includes a signature of each normal committee node on a consensus result. The algorithm adopted in the consensus process may be a PBFT consensus algorithm.
Step 2054, sending the merged account variable value corresponding to the at least one account address to the gateway segment and each transaction segment, so that the gateway segment and each transaction segment update the account data corresponding to the at least one account address.
In this step, the process of the committee fragment sending the merged account variable value corresponding to the at least one account address to the gateway fragment and each transaction fragment may include: determining a number of second committee node groups and a number of committee nodes corresponding to each second committee node group based on the number of committee nodes; assigning a number of committee nodes corresponding to the number of committee nodes to each second set of committee nodes.
For the gateway shards, determining a gateway node group corresponding to each second committee node group; each committee node in each second committee node group transmitting a consolidated account variable value to each gateway node in the gateway node group corresponding to the second committee node group;
or, for each transaction slice, determining a second transaction node group corresponding to each second committee node group; each committee node of each second committee node group transmits a merged account variable value to each transaction node of the second set of transaction nodes corresponding to the second committee node group.
It should be noted that, in this embodiment of the present application, a process of determining the number of the second committee node groups and the number of the committee nodes corresponding to each second committee node group based on the number of the committee nodes may refer to a process of determining the number of the first transaction node groups and the number of the transaction nodes corresponding to each first transaction node group based on the number of the transaction nodes in the transaction fragment in the foregoing embodiment, which is not described in detail in this embodiment of the present application.
For the process of allocating the committee nodes corresponding to the number of the committee nodes to each second committee node group, reference may be made to the process of allocating the transaction processing nodes corresponding to the number of the transaction processing nodes to each first transaction processing node group in the foregoing embodiment, which is not described in detail in this embodiment.
The process of determining the gateway node group corresponding to each second committee node group or determining the second transaction node group corresponding to each second committee node group may refer to the process of determining the first committee node group corresponding to each first transaction node group in the foregoing embodiment, which is not described in detail in this embodiment of the present application.
In this step, the process of updating the account data corresponding to the at least one account address by the gateway fragment and each transaction fragment may be: for the gateway fragment or each transaction fragment, after receiving a merged account variable value corresponding to at least one account address sent by a committee node in the committee fragment, verifying the merged account variable value, wherein the verification process includes signature verification on a second consensus certification and validity verification on the merged account variable value, and after the verification is successful, updating account data corresponding to at least one account address in the gateway fragment or each transaction fragment based on the method in the step 2053; if the verification fails, the received data is discarded.
Optionally, in this embodiment of the application, after the committee fragment updates the account data corresponding to at least one account address in the committee fragment, the gateway fragment, and each transaction fragment based on at least one valid account variable value set, the gateway fragment sends a result of successful transaction processing to the client corresponding to each account address. Such as a transfer success prompt.
To sum up, in the transaction data processing method based on the node fragments provided in the embodiment of the present application, the gateway fragment receives transaction data sent by at least one client, where the transaction data includes an account address; the gateway fragment sends a corresponding transaction data packet to each transaction fragment according to a preset period; processing at least one effective transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment; each transaction fragment sends an account variable value set to a committee fragment; the committee fragment updates account data corresponding to the at least one account address in the committee fragment, the gateway fragment, and each transaction fragment based on the set of valid account variable values. The data throughput and the transaction data processing efficiency can be improved, the system development difficulty is low, the maintenance cost is low, and the expandability is strong.
An embodiment of the present application provides a transaction data processing apparatus based on node fragmentation, as shown in fig. 4, the apparatus 30 includes:
the receiving module 301 is configured to receive, by the gateway segment, transaction data sent by at least one client, where the transaction data includes an account address;
a first sending module 302, configured to send, by the gateway segment, a corresponding transaction data packet to each transaction processing segment according to a preset period, where the transaction data packet includes at least one transaction data;
the processing module 303 is configured to process at least one valid transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment;
a second sending module 304 configured to send the account variable value set to the committee slice per transaction slice;
an update module 305 configured to update the account data corresponding to the at least one account address in the committee fragment, the gateway fragment, and each transaction fragment based on the set of valid account variable values.
Optionally, the first sending module 302 is configured to:
determining a transaction fragment corresponding to each transaction data;
packaging at least one transaction data corresponding to each transaction fragment according to a preset period to obtain a transaction data packet corresponding to the transaction fragment;
and sending the transaction data packet to the transaction processing fragment corresponding to the transaction data packet.
Optionally, the first sending module 302 is configured to:
determining the number of the transaction processing fragments;
for each transaction data, determining a remainder of a ratio of an initiating account address corresponding to the transaction data to the fragment number;
determining the sum of the remainder and the standard value as a target fragment identifier;
and determining the transaction fragment corresponding to the target fragment identification as the transaction fragment corresponding to the transaction data.
Optionally, the processing module 303 is configured to:
for each valid transaction data, determining an account variable value associated with the originating account address corresponding to the valid transaction data;
determining account variable values associated with the target account address corresponding to valid transaction data;
the set of account variable values associated with each originating account address and each target account address is determined as a set of account variable values corresponding to the transaction splits.
Optionally, the second sending module 304 is configured to:
for each transaction fragment, determining the number of first transaction node groups and the number of transaction nodes corresponding to each first transaction node group based on the number of transaction nodes in the transaction fragment;
allocating transaction processing nodes corresponding to the number of the transaction processing nodes to each first transaction processing node group;
determining a first committee node group corresponding to each first transaction processing node group;
each transaction node in each first set of transaction nodes sends a set of legal account variable values to each committee node in the first set of committee nodes corresponding to the first set of transaction nodes.
Optionally, the updating module 305 is configured to:
traversing each effective account variable value set to obtain at least one account data variable quantity and an account address corresponding to each account data variable quantity;
determining a merged account variable value corresponding to each account address based on at least one account data variation corresponding to each account address;
updating account data corresponding to each account address in the committee fragment based on the merged account variable value corresponding to each account address;
and sending a merged account variable value corresponding to at least one account address to the gateway fragment and each transaction fragment, so that the gateway fragment and each transaction fragment update the account data corresponding to at least one account address.
Optionally, the updating module 305 is configured to:
determining a number of second committee node groups and a number of committee nodes corresponding to each second committee node group based on the number of committee nodes;
assigning committee nodes corresponding to the number of the committee nodes to each second committee node group;
for the gateway shards, determining a gateway node group corresponding to each second committee node group;
each committee node in each second committee node group transmitting a consolidated account variable value to each gateway node in the gateway node group corresponding to the second committee node group;
or, for each transaction slice, determining a second transaction node group corresponding to each second committee node group;
each committee node of each second committee node group transmits a merged account variable value to each transaction node of the second set of transaction nodes corresponding to the second committee node group.
To sum up, in the transaction data processing apparatus based on node fragments provided in this embodiment of the present application, a gateway fragment receives transaction data sent by at least one client, where the transaction data includes an account address; the gateway fragment sends a corresponding transaction data packet to each transaction fragment according to a preset period; processing at least one effective transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment; each transaction fragment sends an account variable value set to a committee fragment; the committee fragment updates account data corresponding to the at least one account address in the committee fragment, the gateway fragment, and each transaction fragment based on the set of valid account variable values. The data throughput and the transaction data processing efficiency can be improved, the system development difficulty is low, the maintenance cost is low, and the expandability is strong.
Fig. 5 is a diagram illustrating a computer device according to an exemplary embodiment, which includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for system operation are also stored. The CPU401, ROM402, and RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. Drivers are also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, the processes described above in fig. 2-3 may be implemented as computer software programs, according to embodiments of the present application. For example, various embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section, and/or installed from a removable medium. The above-described functions defined in the system of the present application are executed when the computer program is executed by a Central Processing Unit (CPU) 401.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods, apparatus, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves. The described units or modules may also be provided in a processor, and may be described as: a processor includes a receiving module, a first sending module, a processing module, and an updating module. The names of these units or modules do not in some cases form a limitation to the units or modules themselves, for example, the receiving module may also be described as a "receiving module for receiving transaction data sent by at least one client by the gateway fragment".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which when executed by the electronic device, cause the electronic device to implement the method for processing transaction data based on node fragmentation as described in the above embodiments.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. A transaction data processing method based on node fragmentation is characterized by comprising the following steps:
the method comprises the steps that a gateway fragment receives transaction data sent by at least one client, wherein the transaction data comprises an account address;
the gateway fragment sends a corresponding transaction data packet to each transaction fragment according to a preset period, wherein the transaction data packet comprises at least one transaction data;
processing at least one effective transaction data by each transaction fragment to obtain an account variable value set corresponding to the transaction fragment;
each transaction fragment sends the account variable value set to a committee fragment;
the committee fragment updates account data corresponding to at least one account address in the committee fragment, the gateway fragment, and each of the transaction fragments based on a set of valid account variable values.
2. The method according to claim 1, wherein the sending the corresponding transaction data packet to each transaction fragment according to the preset period comprises:
determining a transaction fragment corresponding to each transaction data;
packaging at least one transaction data corresponding to each transaction fragment according to a preset period to obtain a transaction data packet corresponding to the transaction fragment;
and sending the transaction data packet to the transaction processing fragment corresponding to the transaction data packet.
3. The method of claim 2, wherein the account address comprises an originating account address of a transaction request, and wherein determining the transaction fragment corresponding to each transaction data comprises:
determining the number of the transaction processing fragments;
for each transaction data, determining a remainder of a ratio of the initiating account address corresponding to the transaction data to the fragmentation number;
determining the sum of the remainder and a standard value as a target fragment identifier;
and determining the transaction processing fragment corresponding to the target fragment identifier as a transaction processing fragment corresponding to the transaction data.
4. The method of claim 1, wherein the account address comprises a target account address of a transaction request, and wherein processing the at least one valid transaction datum to obtain a set of account variable values corresponding to the transaction fragment comprises:
for each valid transaction data, determining an account variable value associated with the originating account address corresponding to the valid transaction data;
determining an account variable value associated with the target account address corresponding to the valid transaction data;
and determining the set of account variable values associated with each initiating account address and the set of account variable values associated with each target account address as the set of account variable values corresponding to the transaction fragment.
5. The method of claim 1, wherein the committee fragment comprises at least one committee node, wherein the transaction fragment comprises at least one transaction node, wherein each of the transaction fragments sends the set of account variable values to a committee fragment, and wherein:
for each transaction fragment, determining the number of first transaction node groups and the number of transaction nodes corresponding to each first transaction node group based on the number of transaction nodes in the transaction fragment;
allocating the transaction processing nodes corresponding to the number of the transaction processing nodes for each first transaction processing node group;
determining a first committee node group corresponding to each first said transaction node group;
each of the transaction nodes in each of the first set of transaction nodes transmits the set of legal account variable values to each of the committee nodes in the first set of committee nodes corresponding to the first set of transaction nodes.
6. The method of claim 1, wherein updating the account data corresponding to at least one account address in the committee fragment, the gateway fragment, and each of the transaction fragments based on a set of valid account variable values comprises:
traversing each effective account variable value set to obtain at least one account data variable quantity and the account address corresponding to each account data variable quantity;
determining a merged account variable value corresponding to each account address based on at least one account data variation corresponding to each account address;
updating account data in the committee shard corresponding to each account address based on the merged account variable value corresponding to each account address;
and sending the merged account variable value corresponding to at least one account address to the gateway fragment and each transaction fragment, so that the gateway fragment and each transaction fragment update the account data corresponding to at least one account address.
7. The method of claim 6, wherein the gateway fragment comprises at least one gateway fragment, and wherein the sending a merged account variable value corresponding to at least one of the account addresses to the gateway fragment and each of the transaction fragments comprises:
determining a second number of committee node groups and a number of committee nodes corresponding to each second committee node group based on the number of committee nodes;
assigning each of the second set of committee nodes the committee node corresponding to the number of committee nodes;
for the gateway shard, determining a gateway node group corresponding to each of the second committee node groups;
each said committee node of each said second committee node group transmitting said consolidated account variable value to each said gateway node of said gateway node group corresponding to said second committee node group;
or, for each of the transaction slices, determining a second transaction node group corresponding to each of the second committee node groups;
each of the committee nodes in each of the second set of committee nodes transmits the merged account variable value to each of the transaction nodes in the second set of transaction nodes corresponding to the second set of committee nodes.
8. A transactional data processing system based on node sharding, comprising:
the gateway fragment is used for receiving transaction data sent by at least one client, and the transaction data comprises an account address;
the gateway fragment is used for sending a corresponding transaction data packet to each transaction fragment according to a preset period, and the transaction data packet comprises at least one transaction data;
each transaction processing fragment is used for processing at least one effective transaction data to obtain an account variable value set corresponding to the transaction processing fragment;
each transaction processing fragment is used for sending the account variable value set to a committee fragment;
the committee fragment is configured to update account data corresponding to at least one account address in the committee fragment, the gateway fragment, and each transaction fragment based on an effective account variable value set.
9. A computer device, characterized in that the computer device comprises:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to execute the node shard based transactional data processing method of any one of claims 1 to 7.
10. A computer-readable medium, in which a computer program is stored, which, when being executed by a processor, implements the node shard-based transaction data processing method according to any one of claims 1 to 7.
CN202011424745.2A 2020-12-08 2020-12-08 Transaction data processing method, system, equipment and medium based on node segmentation Active CN112463310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011424745.2A CN112463310B (en) 2020-12-08 2020-12-08 Transaction data processing method, system, equipment and medium based on node segmentation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011424745.2A CN112463310B (en) 2020-12-08 2020-12-08 Transaction data processing method, system, equipment and medium based on node segmentation

Publications (2)

Publication Number Publication Date
CN112463310A true CN112463310A (en) 2021-03-09
CN112463310B CN112463310B (en) 2024-04-23

Family

ID=74800261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011424745.2A Active CN112463310B (en) 2020-12-08 2020-12-08 Transaction data processing method, system, equipment and medium based on node segmentation

Country Status (1)

Country Link
CN (1) CN112463310B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114520812A (en) * 2021-08-16 2022-05-20 西安电子科技大学 Storage rotation method, system, equipment and application for block chain fragmentation system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107292735A (en) * 2017-05-27 2017-10-24 唐盛(北京)物联技术有限公司 A kind of mortgage finance method and system based on block chain technology
WO2019133621A2 (en) * 2017-12-26 2019-07-04 Akamai Technologies, Inc. High performance distributed system of record with distributed random oracle
US20200026699A1 (en) * 2018-07-20 2020-01-23 True Blockchain Technology Ltd. Highly Performant Decentralized Public Ledger with Hybrid Consensus
CN111736963A (en) * 2020-06-08 2020-10-02 中国科学院计算技术研究所 Transaction processing system and method for backbone-free multi-partition blockchain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107292735A (en) * 2017-05-27 2017-10-24 唐盛(北京)物联技术有限公司 A kind of mortgage finance method and system based on block chain technology
WO2019133621A2 (en) * 2017-12-26 2019-07-04 Akamai Technologies, Inc. High performance distributed system of record with distributed random oracle
US20200026699A1 (en) * 2018-07-20 2020-01-23 True Blockchain Technology Ltd. Highly Performant Decentralized Public Ledger with Hybrid Consensus
CN111736963A (en) * 2020-06-08 2020-10-02 中国科学院计算技术研究所 Transaction processing system and method for backbone-free multi-partition blockchain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张志威;王国仁;徐建良;杜小勇;: "区块链的数据管理技术综述", 软件学报, no. 09 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114520812A (en) * 2021-08-16 2022-05-20 西安电子科技大学 Storage rotation method, system, equipment and application for block chain fragmentation system
CN114520812B (en) * 2021-08-16 2023-02-14 西安电子科技大学 Memory rotation method, system, equipment and application for block chain fragmentation system

Also Published As

Publication number Publication date
CN112463310B (en) 2024-04-23

Similar Documents

Publication Publication Date Title
CN108683539B (en) Block chain network management method, block chain network management device, block chain network management medium and electronic equipment
CN109493050B (en) Transfer method based on block chain main chain and parallel multiple sub-chains
US20190074966A1 (en) Revocation of cryptographic keys in the absence of a trusted central authority
CN109472572B (en) Contract system based on block chain main chain and parallel multiple sub-chains
WO2019179192A1 (en) Blockchain transaction processing method and device and storage medium
CN108848148B (en) Transaction information confirmation method and device based on block chain
CN111683118B (en) Block chain-based consensus method and device, master node equipment and slave node equipment
US20190287099A1 (en) Distributed ledger update method
CN109005208B (en) Method and device for pushing information
CN110855792A (en) Message pushing method, device, equipment and medium
CN111275438A (en) Consensus method, device, equipment and storage medium for block chain network
CN112749968B (en) Service data recording method and device based on block chain
CN110930254A (en) Data processing method, device, terminal and medium based on block chain
CN110928880A (en) Data processing method, device, terminal and medium based on block chain
CN110990790B (en) Data processing method and equipment
CN112311779A (en) Data access control method and device applied to block chain system
CN112463310A (en) Transaction data processing method, system, device and medium based on node fragmentation
CN112181599B (en) Model training method, device and storage medium
CN112988738B (en) Data slicing method and device for block chain
CN112910643B (en) Method and device for generating random number in block chain
CN116961892A (en) Block chain-based key generation method, device, electronic equipment and readable medium
CN114372799A (en) Parallel chain system, consensus method and device thereof, and storage medium
CN111585940B (en) Resource management method and related equipment thereof
CN115118727B (en) Data transmission method, device, equipment and storage medium of distributed computing architecture
CN113741403B (en) Vehicle diagnosis method, diagnosis apparatus, and computer-readable storage medium

Legal Events

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