WO2020038291A1 - 基于区块链的数据处理方法、装置和设备 - Google Patents

基于区块链的数据处理方法、装置和设备 Download PDF

Info

Publication number
WO2020038291A1
WO2020038291A1 PCT/CN2019/100979 CN2019100979W WO2020038291A1 WO 2020038291 A1 WO2020038291 A1 WO 2020038291A1 CN 2019100979 W CN2019100979 W CN 2019100979W WO 2020038291 A1 WO2020038291 A1 WO 2020038291A1
Authority
WO
WIPO (PCT)
Prior art keywords
period
transaction
recording
user
node
Prior art date
Application number
PCT/CN2019/100979
Other languages
English (en)
French (fr)
Inventor
张晴
Original Assignee
京东数字科技控股有限公司
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 京东数字科技控股有限公司 filed Critical 京东数字科技控股有限公司
Publication of WO2020038291A1 publication Critical patent/WO2020038291A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the embodiments of the present application relate to the field of computers, and in particular, to a method, an apparatus, and a device for processing data based on a blockchain.
  • each transfer transaction recorded in a blockchain node will cause the account balance of the corresponding member to increase or decrease.
  • node A corresponding to alliance member A needs to read the current account balance 1 of alliance member A, and then according to the account balance 1 and the transfer member a's The transaction amount is obtained from the account balance 2 of alliance member A after the transfer transaction a occurred.
  • the transfer transaction a is confirmed (that is, the account balance 2 is effective). If 2s generates a block, the transfer transaction a may not be confirmed immediately. Therefore, if the transfer transaction a has not been confirmed, the alliance member A and the alliance member C have a transfer transaction b.
  • the current account balance of alliance member A read by node A corresponding to member A is still account balance 1, but it should actually be account balance 2, which causes a read-write conflict, and the transfer transaction b recorded in the blockchain node changes. Invalid transfer transaction.
  • the embodiments of the present application provide a method, a device, and a device for processing data based on a blockchain, which improves the effectiveness of a transfer transaction recorded by a blockchain node.
  • an embodiment of the present application provides a data processing method based on a blockchain, which is applied to any node constituting the blockchain and includes:
  • the transaction information includes: the first period of the first recording period, the transfer user ID and the transfer user ID corresponding to the transfer transaction;
  • For each user of the node determine the target transaction information of the user in the first recording period according to the first period number, and determine the user in the first recording period according to the target transaction information. First balance.
  • the embodiment in the above application has the following advantages or beneficial effects: since the transaction information of the node records the transfer transaction includes the number of periods of the recording cycle, so that after one recording period ends, the settlement can be performed according to the number of periods included in the transaction information.
  • the transfer transactions that occur during the corresponding recording cycle obtain the first balance of the user in the corresponding recording cycle, thereby effectively reducing the incidence of invalid transfer transactions due to read-write conflicts in the prior art, and improving the blockchain
  • the transaction recorded by the node is efficient.
  • the transaction information further includes a transfer-in amount and a transfer-out amount; for each user of the node, determining a target of the user in the first recording period according to the first period number Transaction information, and determining a first balance of the user in the first recording period according to the target transaction information includes:
  • Determining transaction information including the first number of periods and including an identification of the user, which is target transaction information of the user in the first recording cycle;
  • the method before the acquiring the first transaction from the terminal, the method further includes:
  • the embodiment in the above application has the following advantages or beneficial effects: enabling the terminal to know the number of periods of the recording cycle that should be carried in the first transaction.
  • it also includes:
  • a third period number and a third recording period are obtained, the third period number is a period number of the third recording period, and the first period number is less than the first period number Number of three periods.
  • the embodiments in the above application have the following advantages or beneficial effects: update the number of periods of the recording cycle, so that different periods mark the transaction information of the transfer transaction of different recording cycles, and clear the transfer transaction in batches; When clearing the transfer transaction, accurately determine the uncleared transfer transaction and the cleared transfer transaction.
  • it also includes:
  • a fourth period number and a fourth recording period are obtained, the fourth period number is the period number of the fourth recording period, and the third period number is less than the first period number. Number of four periods
  • obtaining the total balance corresponding to the user from the third recording period to the fourth recording period includes:
  • the total balance corresponding to the user from the third recording period to the fourth recording period is obtained according to the sum of the first balance of the user in each target recording period;
  • the target recording period is a recording period from the third recording period to the fourth recording period.
  • it also includes:
  • the terminal can supervise the transfer transaction of the node by the user's first balance in the first recording cycle.
  • the method before the acquiring the fifth transaction from the terminal, the method further includes:
  • the asset transfer function of the target user is cancelled.
  • the embodiments in the above application have the following advantages or beneficial effects: the function of restricting the transfer of assets of target users is guaranteed, and the interests of blockchain participants are guaranteed.
  • the method further includes:
  • the embodiment in the above application has the following advantages or beneficial effects: Since each time a transaction for obtaining the total balance is received, an off-chain clearing is performed according to the obtained total balance, so the assets of the target user are restored for transfer Function to ensure that the target user can conduct transactions normally after the off-chain clearing.
  • an embodiment of the present application provides a data processing method in a blockchain, which is applied to a terminal and includes:
  • the first number of periods is the number of periods of the first recording period for the node to record the transaction information of the transfer transaction, and the first transaction is used to instruct the node to obtain the user's First balance.
  • the node After the terminal sends the first transaction carrying the first period number, the node can clear the transaction information including the first period number of transaction information according to the first period number, and obtain the corresponding Record the first balance of the cycle, thereby effectively reducing the incidence of invalid transfer transactions due to read-write conflicts in the prior art, and improving the efficiency of transfer transactions recorded by blockchain nodes.
  • the method before the sending the first transaction to a node in the blockchain, the method further includes:
  • the embodiment in the above application has the following advantages or beneficial effects: enabling the terminal to know the number of periods of the recording cycle that should be carried in the first transaction.
  • it also includes:
  • the third transaction is used by the node to obtain a third period number according to the first period number, and the third period number is the period number of the third recording period, so The first period is less than the third period.
  • the embodiment in the above application has the following advantages or beneficial effects: sending a third transaction to the node, so that the node updates the number of periods of the recording period, so that different periods mark the transaction information of the transfer transaction of different recording periods, and can be batched. Clearing transfer transactions; and in batches of clearing transfer transactions, accurately determine uncleared transfer transactions and cleared transfer transactions.
  • it also includes:
  • the fourth transaction is used by the node to obtain a fourth period number according to the third period number, and the fourth period number is a period number of a fourth recording period;
  • the number of third issues is less than the number of fourth issues;
  • the fifth transaction includes the third period number and the fourth period number, and the fifth transaction is used by the node to obtain the user from the third recording period To the total balance corresponding to the fourth recording period.
  • it also includes:
  • the terminal can supervise the transfer transaction of the node by the user's first balance in the first recording cycle.
  • the method further includes:
  • a sixth transaction is sent to the node, and the sixth transaction is used to instruct the node to cancel the user's account.
  • Asset transfer function 1 ⁇ N ⁇ M, M ⁇ 1, M and N are integers;
  • the total balance corresponding to the first N recording periods is the total balance corresponding to the user from the first recording period in the previous N recording periods to the Nth recording period in the previous N recording periods.
  • the terminal can obtain that the total balance corresponding to the first N recording periods of the M recording periods is less than or equal to a preset threshold, the transfer transaction of the supervisory node, When it is low, a sixth transaction is sent to the node, so that the node cancels the asset transfer function of the user's account, ensuring the interests of other users.
  • an embodiment of the present application provides a data processing device based on a blockchain, including:
  • the recording module is configured to record transaction information of each transfer transaction during the first recording period, and the transaction information includes: the first period number of the first recording period, a transfer user ID corresponding to the transfer transaction, and a transfer Out user identification;
  • a receiving module configured to obtain a first transaction from a terminal, where the first transaction includes the first period number
  • a determining module configured to determine, for each user of the node, the target transaction information of the user in the first recording period according to the first period number, and determine the user's presence in all of the nodes according to the target transaction information; The first balance of the first recording cycle is described.
  • the transaction information further includes a transfer-in amount and a transfer-out amount;
  • the determination module is specifically configured to:
  • Determining transaction information including the first number of periods and including an identification of the user, which is target transaction information of the user in the first recording cycle;
  • the receiving module is further configured to obtain a second transaction from the terminal before obtaining the first transaction from the terminal;
  • the method further includes: an obtaining module, configured to obtain the second period number of the current second recording period according to the second transaction;
  • a sending module configured to send the second period number to the terminal; wherein the second period number is greater than the first period number.
  • the receiving module is further configured to obtain a third transaction from a terminal
  • the method further includes: an acquiring module, configured to obtain a third period number and a third recording period according to the third transaction and the first period number, where the third period number is a period number of the third recording period, The first period is less than the third period.
  • the receiving module is further configured to obtain a fourth transaction from a terminal
  • the obtaining module is further configured to obtain a fourth period number and a fourth recording period according to the fourth transaction and the third period number, and the fourth period number is a period number of the fourth recording period, The third period is less than the fourth period;
  • the receiving module is further configured to obtain a fifth transaction from a terminal, where the fifth transaction includes the third period number and the fourth period number;
  • the obtaining module is further configured to obtain, for each user of the node, a total balance corresponding to the user from the third recording period to the fourth recording period.
  • the obtaining module is specifically configured to:
  • the total balance corresponding to the user from the third recording period to the fourth recording period is obtained according to the sum of the first balance of the user in each target recording period;
  • the target recording period is a recording period from the third recording period to the fourth recording period.
  • the sending module is further configured to send the first balance of the user in the first recording period to the terminal.
  • the receiving module is further configured to obtain a sixth transaction from the terminal before the fifth transaction is obtained from the terminal, where the sixth transaction includes an identifier of a target user; the target user is Users among users of each node of the blockchain
  • the method further includes a cancellation module for canceling the asset transfer function of the target user according to the sixth transaction.
  • the method further includes: a recovery module, configured to recover an asset transfer function of the target user after the fifth transaction is obtained from the terminal.
  • an embodiment of the present application provides a data processing device in a blockchain, including:
  • a sending module configured to send a first transaction to a node in the blockchain, where the first transaction includes a first period number
  • the first number of periods is the number of periods of the first recording period for the node to record the transaction information of the transfer transaction, and the first transaction is used to instruct the node to obtain the user's First balance.
  • the sending module is further configured to send a second transaction to the node before sending the first transaction to a node in the blockchain, where the second transaction is used for the The node obtains the second period number of the current second recording period; the second period number is greater than the first period number;
  • the method further includes a receiving module, configured to obtain the second period number from the node.
  • the sending module is further configured to send a third transaction to the node; the third transaction is used by the node to obtain a third period number according to the first period number, and The third period number is the period number of the third recording period, and the first period number is less than the third period number.
  • the sending module is further configured to send and obtain a fourth transaction to the node; the fourth transaction is used by the node to obtain a fourth period number according to the third period number, so The fourth period is the number of periods in the fourth recording period, and the third period is less than the fourth period; and
  • the fifth transaction includes the third period number and the fourth period number, and the fifth transaction is used by the node to obtain the user from the third recording period To the total balance corresponding to the fourth recording period.
  • the method further includes: a receiving module;
  • a receiving module configured to obtain, from the node, a first balance of the user in the first recording period.
  • the sending module is further configured to: before sending the fifth transaction to the node,
  • a sixth transaction is sent to the node, and the sixth transaction is used to instruct the node to cancel the user's account.
  • Asset transfer function 1 ⁇ N ⁇ M, M ⁇ 1, M and N are integers;
  • the total balance corresponding to the first N recording periods is the total balance corresponding to the user from the first recording period in the previous N recording periods to the Nth recording period in the previous N recording periods.
  • An embodiment of the present application provides an electronic device, including: a processor, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program When implementing the method according to any one of the first aspect or the method according to any one of the second aspect.
  • An embodiment of the present application provides a readable storage medium on which a computer program or instruction is stored.
  • the program or instruction is run on a computer, the method according to any one of the first aspects or the second aspect One of the methods described is executed.
  • the transaction information of the node records the transfer transaction includes the number of periods of the recording cycle, so that after the end of a recording period, the transfer transactions that occurred in the corresponding recording period can be liquidated according to the number of periods included in the transaction information to obtain The first balance of the user in the corresponding recording cycle, thereby effectively reducing the incidence of invalid transfer transactions due to read-write conflicts in the prior art, and improving the efficiency of the transfer transactions recorded by the blockchain nodes.
  • FIG. 1 is a system architecture diagram provided by an embodiment of the present application
  • FIG. 2 is a signaling interaction diagram I of a data processing method for a blockchain provided by an embodiment of the present application
  • FIG. 3 is a second signaling interaction diagram of a data processing method for a blockchain provided by an embodiment of the present application
  • FIG. 4 is a third signaling interaction diagram of a data processing method for a blockchain provided by an embodiment of the present application.
  • FIG. 5 is a first schematic structural diagram of a blockchain-based data processing device according to an embodiment of the present application.
  • FIG. 6 is a second structural schematic diagram of a blockchain-based data processing device according to an embodiment of the present application.
  • FIG. 7 is a third structural schematic diagram of a blockchain-based data processing device according to an embodiment of the present application.
  • FIG. 8 is a fourth structural schematic diagram of a blockchain-based data processing device according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a blockchain node provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • the alliance chain in the embodiment of the present application is only directed to members of a specific group and a limited number of third parties. It internally designates multiple preselected nodes as bookkeepers, and the generation of each block is jointly determined by all preselected nodes.
  • FIG. 1 is a system architecture diagram provided by an embodiment of the present application.
  • the system architecture includes a blockchain node, a first terminal, and a second terminal.
  • the blockchain nodes are the nodes corresponding to the participants of the alliance chain.
  • Each node is a node with a smart contract installed.
  • the first terminal device is a third-party terminal used for supervision and the second terminal is a terminal that proposes transactions. .
  • FIG. 2 is a signaling interaction diagram 1 of a data processing method for a blockchain provided by an embodiment of the present application; referring to FIG. 2, the method in this embodiment includes:
  • Step S201 The node records the transaction information of each transfer transaction in the first recording period, and the transaction information includes: the first period number of the first recording period, a transfer-in user identifier and a transfer-out user identifier corresponding to the transfer transaction;
  • Step S202 The terminal sends a first transaction to the node; the first transaction includes a first period number, and the first period number is a period number of a first recording period;
  • Step S203 For each user of the node, the node determines the target transaction information of the user in the first recording period according to the first period number, and determines the first balance of the user in the first recording period according to the target transaction information.
  • the node in this embodiment is any node that constitutes a blockchain.
  • the blockchain in this embodiment may be an alliance chain. The method of the embodiment of the present application is described below using the alliance chain as an example.
  • the terminal in this embodiment may be a terminal of a third party used for supervision.
  • Each participant of the alliance chain has an account.
  • participant A transfers X assets to participant B
  • the total balance of participant A will decrease.
  • X the total balance of participant B will increase by X; among them, the assets can be points;
  • the terminal of participant A will propose a transaction to each node, and each node will confirm the transaction through a smart contract. After confirmation, record The transfer transaction. It can be understood that each node corresponds to a participant, or each node corresponds to a user.
  • the concept of a recording period is introduced, and different recording periods are identified by the number of periods; if the number of periods of the recording period from time xx to yy is 1, the recording period from time yy to zz The number of periods can be two, and the number of periods of the recording period from time zz to time aa can be three.
  • the length of time corresponding to each recording cycle is not necessarily the same.
  • the duration of a recording period with a period of 1 is 1 day: the time between 00:00 on May 23, 2018 and 00:00 on May 24, 2018 belongs to the time of a recording period with a period of 1
  • the duration of a recording cycle with a period of 2 is 2 days: the time between 00 o'clock on May 24, 2018 and 00 o'clock on May 26, 2018 belongs to the time of the recording cycle with a period of 2.
  • step S201 record the transaction information of each transfer transaction in the first recording period.
  • the transaction information includes: the first period of the first recording period, the transfer user ID and the transfer user ID corresponding to the transfer transaction, and the transfer amount and Transfer amount. That is, each transaction corresponds to a piece of transaction information.
  • the first recording period is any recording period, and the first period number is the period number of the first recording period.
  • the transfer transaction may include: the first period number 1, the identity of user A of the transferring party, the identity of user B of the transferring party, the transfer amount -X, and the transfer amount X.
  • the transaction information of the transfer transaction may be stored in the form of a key-value pair (Key-Value).
  • the Key value may include: the number of periods of the recording cycle, the ID of the transfer user, and the ID of the transfer user; further, the Key value may further include: the identification of the transfer transaction (such as a serial number identification).
  • the Value value can include: transfer amount, transfer amount; Further, the Value value can also include other data fields, such as the reason for the transfer transaction.
  • the first recording period should have ended, or the current recording period is no longer the first recording period, that is, the recording period Changes have been sent for the number of periods and recording periods.
  • the method in this embodiment further includes: the terminal sends a third transaction to the node, and the node
  • the three transactions and the first period number obtain the third period number and the third recording period.
  • the third period number is the period number of the third recording period, and the first period number is less than the third period number. Therefore, the third transaction can be considered as a transaction sent by the terminal for the period update, and it can be understood that the terminal sends a transaction for the period update multiple times.
  • the terminal sends the third transaction to the node.
  • the terminal “obtains the third period number and the third recording period based on the third transaction and the first period number” means that the first The number of periods is updated to a third number, and the corresponding first recording period is updated to a third recording period.
  • the node after the node receives the third transaction, the first recording period has not ended, and the current recording period is the first recording period; and after the node receives the third transaction, it will first obtain the number of periods of the current recording period, that is, The first number of periods, based on which the updated number of periods is obtained.
  • step S202 occurs when the terminal sends a third transaction to the node, and the node obtains the third period number and the third record according to the third transaction and the first period number Cycle ".
  • the node may also update the number of periods in the recording cycle from the first period to the third after the node has received L transactions for the period update (the first transaction received in the L times is the third transaction). The number of periods, corresponding to the third recording period.
  • L 2
  • the node updates the first period to the fifth period, and obtains the fifth recording period corresponding to the fifth period (that is, the fifth period is the fifth record)
  • the number of periods, that is, the current recording period becomes the fifth recording period.
  • the fifth period number is the above-mentioned updated period number.
  • the node receives the next transaction for the period number update
  • the node The number of five periods is updated to the number of third periods (that is, the number of third periods is the number of periods of the third recording period), and the current recording period becomes the third recording period corresponding to the number of third periods. That is, for the first recording period, after receiving two transactions for the period update, the third period and the third recording period are obtained according to each transaction for the period update and the first period.
  • the period number is updated, which means the end of one recording period and the beginning of another recording period.
  • the terminal will send a transaction for the period update to the node.
  • the node receives it once and obtains the period number of the current recording period.
  • the number of periods is updated once according to the number of periods of the current recording period, and the current recording period is also updated once.
  • the time interval between the two times when the terminal sends the transaction for the period update may be different.
  • the first time interval between the terminal sending the transaction for period number update for the nth time and the transaction for period number update for the n + 1th transmission can be The second time interval between the transaction and the n + 2th transaction sent for the period update is different.
  • the number of periods of the recording cycle is updated so that different periods mark the transaction information of the transfer transaction in different recording cycles and the clearing transfer transaction can be batched; and when the batch clearing transfer transaction is accurate, Identify cleared transfer transactions and uncleared transfer transactions.
  • steps S202 to S203 will be described below.
  • the first recording period should have ended, that is, the current recording period is no longer the first recording period, for example, it can be the second recording period.
  • the number of first periods is smaller than the number of second periods of the second recording period.
  • the number of the first period is 5, the number of the second period is at least 6.
  • the node After the node receives the first transaction, specifically, "For each node user, determine the target transaction information of the user in the first recording period according to the first period number, and determine that the user is in the The first balance of the first recording period "includes:
  • the transfer amount included in the first target transaction information is the first transfer amount corresponding to the user; the first target transaction information is that the transfer party identifier included is the user's identifier Target transaction information.
  • the first transfer amount corresponding to the user has n pieces, and n is an integer greater than or equal to zero.
  • the second target transaction information For each node user, determine that the transfer amount included in the second target transaction information is the user's first transfer amount; the second target transaction information is the target transaction information that includes the transfer-out party identification as the user's identification .
  • the first transfer amount corresponding to the user has l pieces, where l is an integer greater than or equal to zero.
  • each first transfer-in amount and each first transfer-out amount of each user can be obtained. It can be understood that each first transfer amount is a positive value, and each first transfer amount is a negative value.
  • a first sum of each first transfer amount corresponding to the user and a second sum of each first transfer amount corresponding to the user are obtained; the first sum and the second sum are determined.
  • the sum is the first balance of the user in the first recording period.
  • the first balance of the user in the first recording period is not the actual balance of the user's account at the end of the first recording period, and the actual balance of the user's account at the end of the first recording period is the user
  • the first balance in the first recording period is added to the initial balance of the account at the beginning of the first recording period.
  • the initial balance of the user's account at the beginning of the first recording period may be zero.
  • the above-mentioned first transaction is a transaction sent by a terminal to instruct a clearing user to record a transfer transaction recorded in a certain recording cycle, which is referred to as a clearing transaction.
  • the above-mentioned first transfer amount used to calculate the first sum should be included in the transaction information that forms the block; then, when obtaining the first sum, a certain transaction recorded in the first recording cycle The information has not yet formed a block, so it cannot be used for the calculation of the first sum. For this reason, if the node updates the first period number to the third period number after the node receives the third transaction, there should be a period between the terminal sending the first transaction carrying the first period number and the terminal phase sending the third transaction. A certain interval to ensure that the transaction information recorded in the first recording cycle forms a block.
  • the node updates the period 3 to the number 4 and then sends the time for the transaction with the number 3 for settlement and the time for sending the number for updating the period.
  • the time of transaction 1 should be at least the above interval.
  • the time to send a transaction for clearing with period 3 is later than the time to send transaction 1 for updating the period.
  • the transfer transactions occurring within the corresponding recording period can be liquidated according to the number of periods included in the transaction information
  • the transfer transactions occurring within the corresponding recording period can be liquidated according to the number of periods included in the transaction information
  • the terminal will send transactions for settlement to the node multiple times.
  • the interval between the two times when the terminal sends the transaction for settlement next to each other may be different.
  • the first time interval between the Nth sending of a transaction for clearing and the N + 1th sending of a transaction for clearing can be the same as the N + 1th sending of a transaction for clearing and the N + 2
  • the second time interval between transactions sent for clearing is different.
  • the data processing method of the blockchain of this embodiment records the number of periods in the recording cycle of the transfer transaction, and after the corresponding recording period ends, clears the transfer transaction recorded in the corresponding recording period to obtain the corresponding
  • the balance corresponding to the recording period improves the efficiency of the transfer transactions recorded by the blockchain nodes.
  • FIG. 3 is a signaling interaction diagram 2 of a data processing method for a blockchain provided by an embodiment of the present application;
  • Step S301 The node records the transaction information of each transfer transaction in the first recording period, and the transaction information includes: the first period of the first recording period, a transfer-in user identifier and a transfer-out user identifier corresponding to the transfer transaction;
  • Step S302 The terminal sends a second transaction to the node.
  • Step S303 The node obtains the second period number of the current second recording period according to the second transaction.
  • Step S304 The node sends the second period to the terminal.
  • Step S305 The terminal sends a first transaction to the node.
  • the first transaction includes a first period number, and the first period number is a period number of a first recording period.
  • step S306 for each user of the node, the target transaction information of the user in the first recording period is determined according to the first period number, and the first balance of the user in the first recording period is determined according to the target transaction information.
  • step S301 is referred to the description related to step S201 in the previous embodiment, which is not repeated in this embodiment.
  • the terminal sends a second transaction to the node.
  • the second transaction is used to instruct the node to obtain the second period of the current recording period.
  • the node obtains the second period of the current second recording period.
  • the node sends the second period number to the terminal.
  • the terminal After receiving the second period, the terminal learns that the current period of the second recording period is the second period, indicating that the recording period corresponding to the number of periods less than the second period can be liquidated. Steps in step S305: the terminal sends a first transaction to the node; the first transaction includes the first period number, and the first period number is the period number of the first recording period
  • step 306 For the description of step 306 with reference to step S203 in the previous embodiment, details are not described in this embodiment.
  • the method of this embodiment may enable the foregoing terminal to learn the number of first periods that a first transaction should carry.
  • FIG. 4 is a third signaling interaction diagram of a data processing method for a blockchain provided by an embodiment of the present application; referring to FIG. 4, the method of this embodiment includes:
  • Step S401 Record the transaction information of each transfer transaction in the first recording period.
  • the transaction information includes: the first period of the first recording period, the transfer user ID and the transfer user ID corresponding to the transfer transaction;
  • Step S402 The terminal sends a second transaction to the node.
  • Step S403 The node obtains the second period number of the current second recording period according to the second transaction.
  • Step S404 The node sends the second period to the terminal.
  • Step S405 The terminal sends a first transaction to the node.
  • the first transaction includes a first period number, and the first period number is a period number of a first recording period.
  • Step S406 For each user of the node, determine the target transaction information of the user in the first recording period according to the first period number, and determine the first balance of the user in the first recording period according to the target transaction information.
  • Step S407 The terminal sends a third transaction to the node.
  • Step S408 The node obtains the third period number and the third recording period according to the third transaction and the first period number.
  • the third period number is the period number of the third recording period, and the first period number is less than the third period number.
  • Step S409 The terminal sends a fourth transaction to the node.
  • Step S410 The node obtains a fourth period number and a fourth recording period according to the fourth transaction and the third period number.
  • the fourth period number is the period number of the fourth recording period, and the third period number is less than the fourth period number.
  • Step S411 The terminal sends a fifth transaction to the node.
  • the fifth transaction includes the third period number and the fourth period number.
  • Step S412 For a user of each node, the node obtains a total balance corresponding to the user from the third recording period to the fourth recording period.
  • steps S401 to S406 reference is made to the description in the previous embodiment, which is not repeated in this embodiment.
  • the third period number and the third recording period are obtained according to the third transaction and the first period number, and the third period number is the third record.
  • the number of periods of the cycle, the first number of periods is less than the third number of periods, and is not described in this embodiment.
  • the third period number and the third recording period are obtained according to the third transaction and the first period number, and the third period number is the third record
  • the number of periods of the cycle, the first number of periods is less than the third number of periods, and is not described in this embodiment.
  • the third period is updated from the first period
  • the fourth period is updated from the third period.
  • the first period may be updated to the third period after multiple updates.
  • the recording period may also be updated to obtain the third recording period corresponding to the third period.
  • the number of the first period is 1, the number of the third period is 6, and the number of the first period is first updated to the number 2 and then to 3, and then to 4, and 5 again. Then, the third period number 6 is updated, and the corresponding recording period is also updated multiple times to obtain the third recording period corresponding to the third period number 6.
  • steps S411 to S412 if each off-chain settlement is performed correspondingly once after each recording period ends, the settlement is too frequent. Therefore, the off-chain settlement can be performed once after several consecutive recording periods have ended. This requires obtaining the total balance corresponding to several consecutive recording cycles according to the balance corresponding to several consecutive recording cycles for off-chain settlement.
  • the terminal needs to send a fifth transaction to the node, and the fifth transaction includes the third period number and the fourth period number.
  • the node After the node receives the fifth transaction, for each user, the node obtains the total balance corresponding to the user from the third recording period to the fourth recording period.
  • the third period included in the fifth transaction is the number of initial periods corresponding to the process of obtaining the total balance
  • the fourth period is the number of termination periods corresponding to the process of obtaining the total balance.
  • obtaining the total balance of the user from the third recording period to the fourth recording period includes:
  • the total balance corresponding to the user from the third recording period to the fourth recording period is obtained according to the sum of the first balance of the user in each target recording period; the target recording period is from the first A recording period between three recording periods to a fourth recording period.
  • the recording period from the third recording period to the fourth recording period includes a third recording period and a fourth recording period.
  • the period number 6 is the third period number
  • the recording period of the period number 6 is the third recording period
  • the period number 9 is the fourth period number
  • the recording period of the period number 9 is the fourth recording period.
  • the first balance corresponding to the recording period of the period 6 of the user and the record of the period 7 of the user obtained according to the method in step S406
  • the first balance corresponding to the period, the user's first balance corresponding to the recording period of period 8 and the user's first balance corresponding to the recording period of period 9 are added to obtain the user's recording period from period 6
  • the total balance here is not the actual balance of the user's account.
  • a method of obtaining the actual balance refer to the description in the embodiment shown in FIG. 2.
  • the process of the node obtaining the user's total balance can be called a snapshot operation, and the storage method of the snapshot data obtained by the snapshot operation can be in the form of Key-Value.
  • the Key value may include: the number of periods of each recording cycle used to obtain the total balance, and the identity of each user; the Value value may include: the total balance of each user.
  • the fifth transaction described above is a transaction sent by the terminal for obtaining the total balance.
  • the terminal sends a transaction for obtaining the total balance to the node at a preset interval, and each time the transaction for obtaining the total balance is received.
  • the number of periods carried varies. That is, the number of termination periods carried by the transaction sent to obtain the total balance for the nth time plus a preset value is the number of starting periods carried by the transaction sent to obtain the total balance at the n + 1th time.
  • the number of periods carried by the transaction for obtaining the total balance sent at the nth time is 1, 5
  • the number of periods carried by the transaction for obtaining the total balance sent at the n + 1th time may be 6, 9
  • the number of periods carried by the transaction for obtaining the total balance sent n + 2 times may be 10, 12.
  • the preset value in this embodiment is the absolute value of the difference between two adjacent periods. If the total balance of each user in the corresponding month is obtained every one month, the first balance corresponding to each recorded period included in the corresponding month is summed to obtain the total balance of each user in the corresponding month.
  • the node may also send the transaction information of the transfer transaction recorded in the above-mentioned first recording cycle to the terminal, and / or, the above-mentioned users are in the first recording cycle First balance.
  • the terminal further includes: for each node, The user determines the target transaction information of the user in the first recording period according to the first period number, and determines the first balance of the user in the first recording period according to the target transaction information.
  • the method for obtaining the "determining the first balance of the user in the first recording cycle" by the terminal may be the same as the method of the node "determining the first balance of the user in the first recording cycle", and details are not described herein again.
  • the method further includes:
  • the total balance corresponding to the first N recording periods is the total balance corresponding to the user from the first recording period in the previous N recording periods to the Nth recording period in the previous N recording periods;
  • the preset threshold may be, for example, -10000.
  • the first recording period in the first N recording periods is the third recording period, and the number of periods in the Nth recording period in the previous N recording periods is less than or equal to the number of periods in the fourth recording period.
  • the terminal sends a seventh transaction to the node.
  • the seventh transaction includes a starting period number of 1 and a terminating period number of 5.
  • the node corresponds to the corresponding recording period of the user between the period number 1 and the period number 5.
  • the total balance corresponding to the recording period corresponding to the period number 1 to the recording period corresponding to the period number 5 is obtained.
  • a balance is less than a preset threshold; if so, the terminal sends a sixth transaction (a transaction sent by the terminal to cancel the account function) to the node, and the sixth transaction is used to instruct the node to cancel the transfer of assets of the user's account Function, if not, obtain the sum of the first balance corresponding to the recording period corresponding to period 6 and the first balance corresponding to the recording period corresponding to period 7 is called the first total balance; the terminal judges the first total Whether the balance is small A preset threshold. If it is, the terminal sends a transaction for canceling the account function to the node. If not, the user obtains the first balance corresponding to the recording period corresponding to period 6 and the first balance corresponding to the recording period corresponding to period 7.
  • the sum of a balance and the first balance corresponding to the recording period corresponding to period number 8 is called the second total balance.
  • the terminal determines whether the second total balance is less than a preset threshold. If so, the terminal sends the above to the node for cancellation.
  • the user obtains the first balance corresponding to the recording period corresponding to period 6, the first balance corresponding to the recording period corresponding to period 7 and the recording period corresponding to period 8
  • the sum of the first balance and the first balance corresponding to the recording period corresponding to period 9 is called the third total balance, and the third total balance; the terminal determines whether the third total balance is less than a preset threshold, and if so, the terminal sends The node sends a transaction to cancel the account function.
  • the period for the terminal to send transactions for clearing to the node is not fixed and flexible, so the time when the terminal receives the first balance from the node for the user in a certain recording period is more flexible, so that users can be found in time Whether the total balance of is below a preset threshold.
  • the method further includes: the node restores the asset transfer function of the user's account. That is, if the user's account asset transfer function is canceled, the node's account asset recovery function is restored after the node receives the transaction for obtaining the total balance again.
  • restricting the user's asset transfer function can ensure the interests of blockchain participants. Since each time a transaction for obtaining the total balance is received, an out-of-chain settlement is performed according to the obtained total balance. Therefore, restoring the user's asset transfer function can ensure that the user can normally proceed after the out-of-chain settlement. transaction.
  • the terminal may also separately send an eighth transaction to the node.
  • the eighth transaction includes a fifth period.
  • the node After receiving the eighth transaction, the node sends a fifth recording period corresponding to the fifth period to the terminal. Corresponding first balance.
  • the total balance corresponding to the user from the third recording period to the fourth recording period is obtained, thereby reducing the number of off-chain settlements.
  • FIG. 5 is a first schematic structural diagram of a blockchain-based data processing device according to an embodiment of the present application. As shown in FIG. 5, the device in this embodiment may include a recording module 51, a receiving module 52, and a determining module 53;
  • the recording module 51 is configured to record transaction information of each transfer transaction in a first recording period, where the transaction information includes: the first number of the first recording period, a transfer user identifier corresponding to the transfer transaction, and Transfer user ID;
  • the receiving module 52 is configured to obtain a first transaction from a terminal, where the first transaction includes the first period number;
  • a determining module 53 is configured to determine, for each user of the node, the target transaction information of the user in the first recording period according to the first period number, and determine that the user is in the first transaction period according to the target transaction information. A first balance of the first recording period.
  • the transaction information further includes a transfer-in amount and a transfer-out amount;
  • the determination module is specifically configured to:
  • Determining transaction information including the first number of periods and including an identification of the user, which is target transaction information of the user in the first recording cycle;
  • the apparatus in this embodiment may be used to execute the technical solution corresponding to the nodes in the foregoing method embodiments.
  • the implementation principles and technical effects are similar, and details are not described herein again.
  • FIG. 6 is a second schematic diagram of the structure of a blockchain-based data processing device according to an embodiment of the present application. As shown in FIG. 6, the device of this embodiment is based on the device structure shown in FIG. It includes: an obtaining module 54 and a sending module 55.
  • the receiving module 52 is further configured to obtain a second transaction from the terminal before obtaining the first transaction from the terminal;
  • the sending module 55 is configured to send the second period number to the terminal, where the second period number is greater than the first period number.
  • the receiving module 52 is further configured to obtain a third transaction from a terminal
  • the method further includes: an acquiring module, configured to obtain a third period number and a third recording period according to the third transaction and the first period number, where the third period number is a period number of the third recording period, The first period is less than the third period.
  • the receiving module 52 is further configured to obtain a fourth transaction from a terminal
  • the obtaining module 54 is further configured to obtain a fourth period number and a fourth recording period according to the fourth transaction and the third period number, and the fourth period number is a period number of the fourth recording period.
  • the third period is less than the fourth period;
  • the receiving module 52 is further configured to obtain a fifth transaction from a terminal, where the fifth transaction includes the third period number and the fourth period number;
  • the obtaining module 54 is further configured to obtain, for each user of the node, a total balance corresponding to the user from the third recording period to the fourth recording period.
  • the obtaining module 54 is specifically configured to:
  • the total balance corresponding to the user from the third recording period to the fourth recording period is obtained according to the sum of the first balance of the user in each target recording period;
  • the target recording period is a recording period from the third recording period to the fourth recording period.
  • the sending module 55 is further configured to send the first balance of the user in the first recording period to the terminal.
  • the apparatus in this embodiment may be used to execute the technical solution corresponding to the nodes in the foregoing method embodiments.
  • the implementation principles and technical effects are similar, and details are not described herein again.
  • FIG. 7 is a second schematic diagram of the structure of a blockchain-based data processing device according to an embodiment of the present application. As shown in FIG. 7, the device of this embodiment is based on the device structure shown in FIG. 6. Further, the device may further include: : Cancel module 57 and restore module 58.
  • the receiving module 52 is further configured to obtain a sixth transaction from the terminal before the fifth transaction is obtained from the terminal, where the sixth transaction includes an identifier of a target user; the target user is each of the blockchain. Users among the users of the node
  • a cancellation module 57 is configured to cancel the asset transfer function of the target user according to the sixth transaction.
  • the recovery module 58 is configured to recover the asset transfer function of the target user after the fifth transaction is obtained from the terminal.
  • the apparatus in this embodiment may be used to execute the technical solution corresponding to the nodes in the foregoing method embodiments.
  • the implementation principles and technical effects are similar, and details are not described herein again.
  • FIG. 8 is a first schematic structural diagram of a blockchain-based data processing device according to an embodiment of the present application. As shown in FIG. 8, the device in this embodiment may include: a sending module 61 and a receiving module 62;
  • a sending module 61 is configured to send a first transaction to a node in the blockchain, where the first transaction includes a first period number;
  • the first number of periods is the number of periods of the first recording period for the node to record the transaction information of the transfer transaction, and the first transaction is used to instruct the node to obtain the user's First balance.
  • the sending module 61 is further configured to send a second transaction to the node before sending the first transaction to a node in the blockchain, where the second transaction is used for all
  • the node obtains the second period number of the current second recording period; the second period number is greater than the first period number;
  • the receiving module 62 is configured to receive the second period number from the node.
  • the sending module 61 is further configured to send a third transaction to the node; the third transaction is used by the node to obtain a third period number according to the first period number, so The third period number is a period number of the third recording period, and the first period number is less than the third period number.
  • the sending module 61 is further configured to send and obtain a fourth transaction to the node; the fourth transaction is used by the node to obtain a fourth period number according to the third period number, The fourth period number is a period number of a fourth recording period, and the third period number is less than the fourth period number; and
  • the fifth transaction includes the third period number and the fourth period number, and the fifth transaction is used by the node to obtain the user from the third recording period To the total balance corresponding to the fourth recording period.
  • the receiving module 62 is configured to obtain a first balance of the user in the first recording period from the node.
  • the sending module 61 is further configured to send the fifth transaction to the node before ,
  • a sixth transaction is sent to the node, and the sixth transaction is used to instruct the node to cancel the user's account.
  • Asset transfer function 1 ⁇ N ⁇ M, M ⁇ 1, M and N are integers;
  • the total balance corresponding to the first N recording periods is the total balance corresponding to the user from the first recording period in the previous N recording periods to the Nth recording period in the previous N recording periods.
  • the apparatus in this embodiment may be used to execute the technical solution of the terminal in the foregoing method embodiments.
  • the implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 9 is a schematic structural diagram of a blockchain node provided in an embodiment of the present application.
  • the electronic device in this embodiment includes a processor 21, a memory 22, and a communication bus 23, where the communication bus 23 is used for each component the connection between;
  • a processor configured to execute the program stored in the memory, and when the program is executed, the processor is configured to execute a method corresponding to a node in the foregoing method embodiment.
  • FIG. 10 is a schematic structural diagram of a terminal provided in an embodiment of the present application.
  • the electronic device in this embodiment includes a processor 31, a memory 32, and a communication bus 33.
  • the communication bus 33 is used for communication between components. connection;
  • a processor configured to execute the program stored in the memory, and when the program is executed, the processor is configured to execute the method of the terminal in the foregoing method embodiment. .
  • a person of ordinary skill in the art may understand that all or part of the steps of implementing the foregoing method embodiments may be implemented by a program instructing related hardware.
  • the aforementioned program may be stored in a computer-readable storage medium.
  • the steps including the foregoing method embodiments are executed; and the foregoing storage medium includes: various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disc.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本申请实施例提供一种基于区块链的数据处理方法、装置和设备,该方法包括:记录第一记录周期内的每笔转账交易的交易信息,交易信息包括:第一记录周期的第一期数、转账交易对应的转入用户标识和转出用户标识;从终端获取第一交易,第一交易包括第一期数;对于每个节点的用户,根据第一期数确定用户在第一记录周期的目标交易信息,并根据目标交易信息确定用户在第一记录周期的第一余额。本申请实施例可以提高区块链节点记录的转账交易的有效性。

Description

基于区块链的数据处理方法、装置和设备
本申请要求于2018年8月21日提交中国专利局、申请号为201810956567.4、申请名称为“基于区块链的数据处理方法、装置和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及计算机领域,尤其涉及一种基于区块链的数据处理方法、装置和设备。
背景技术
联盟链中,会为联盟链的成员建立账户,用于完成通证的流通。
现有技术中,区块链节点中记录的每笔转账交易,都会造成相应成员的账户余额发生增减。比如若联盟成员A与联盟成员B发生了一笔转账交易a,联盟成员A对应的节点A需要读取联盟成员A当前的账户余额1,然后根据账户余额1和转账交易a中联盟成员A的交易额,得到转账交易a发生后联盟成员A的账户余额2。账户余额2被生成区块后,才相当于转账交易a被确认(即账户余额2生效)。若2s生成一个区块,则转账交易a可能不是立即被确认,因此,若在转账交易a还没被确认时,联盟成员A又与联盟成员C发生了一笔转账交易b,此时,联盟成员A对应的节点A读取的联盟成员A当前的账户余额仍然是账户余额1,但实际上应该是账户余额2,这样就产生了读写冲突,区块链节点中记录的转账交易b变成无效的转账交易。
因此,如何解决上述的读写冲突,提高区块链节点记录的转账交易的有效性是亟待解决的问题。
发明内容
本申请实施例提供一种基于区块链的数据处理方法、装置和设备,提高了区块链节点记录的转账交易的有效性。
第一方面,本申请实施例提供一种基于区块链的数据处理方法,应用于组成所述区块链的任一个节点,包括:
记录第一记录周期内的每笔转账交易的交易信息,所述交易信息包括:所述第一记录周期的第一期数、所述转账交易对应的转入用户标识和转出用户标识;
从终端获取第一交易,所述第一交易包括所述第一期数;
对于每个所述节点的用户,根据所述第一期数确定所述用户在所述第一记录周期的目标交易信息,并根据所述目标交易信息确定所述用户在所述第一记录周期的第一余额。
上述申请中的实施例具有如下优点或有益效果:由于在节点记录转账交易的交易 信息中包括了记录周期的期数,使得可在一个记录周期结束后,根据交易信息中包括的期数,清算相应记录周期内发生的转账交易,得到用户在相应记录周期的第一余额,从而有效降低了现有技术中由于读写冲突造成的部分转账交易无效的现象的发生率,提高了区块链节点记录的转账交易有效率。
在一种实施方式中,所述交易信息还包括转入额和转出额;所述对于每个节点的用户,根据所述第一期数确定所述用户在所述第一记录周期的目标交易信息,并根据所述目标交易信息确定所述用户在所述第一记录周期的第一余额,包括:
确定包括所述第一期数且包括所述用户的标识的交易信息,为所述用户在所述第一记录周期的目标交易信息;
根据所述目标交易信息包括的转入额,确定所述用户对应的第一转入额,并根据所述目标交易信息包括的转出额,确定所述用户对应的第一转出额;
根据所述用户的第一转出额和所述第一转入额,获取所述用户在所述第一记录周期的第一余额。
在一种可能的设计中,在所述从终端获取第一交易之前,还包括:
从所述终端获取第二交易;
根据所述第二交易,获取当前的第二记录周期的第二期数;
向所述终端发送所述第二期数;其中,所述第二期数大于所述第一期数。
上述申请中的实施例具有如下优点或有益效果:使得终端获知第一交易中应该携带的记录周期的期数。
在一种可能的设计中,还包括:
从终端获取第三交易;
根据所述第三交易和所述第一期数,得到第三期数和第三记录周期,所述第三期数为所述第三记录周期的期数,所述第一期数小于第三期数。
上述申请中的实施例具有如下优点或有益效果:更新记录周期的期数,使得不同的期数标记不同记录周期的转账交易的交易信息,以及可以分批的清算转账交易;并且在分批的清算转账交易时,准确的确定未清算的转账交易,以及已清算的转账交易。
在一种可能的设计中,还包括:
从终端获取第四交易;
根据所述第四交易和所述第三期数,得到第四期数和第四记录周期,所述第四期数为所述第四记录周期的期数,所述第三期数小于第四期数;
从终端获取第五交易,所述第五交易包括所述第三期数和所述第四期数;
对于每个所述节点的用户,获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额。
其中,对于所述节点的用户,获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额,包括:
对于每个所述节点的用户,根据所述用户在各目标记录周期的第一余额之和,得到所述用户从所述第三记录周期至所述第四记录周期对应的总余额;所述目标记录周期为从所述第三记录周期至所述第四记录周期之间的记录周期。
上述申请中的实施例具有如下优点或有益效果:减少链外结算的次数。
在一种可能的设计中,还包括:
向所述终端发送所述用户在所述第一记录周期的第一余额。
上述申请中的实施例具有如下优点或有益效果:终端可以通过所述用户在所述第一记录周期的第一余额,监管节点的转账交易。
在一种可能的设计中,在所述从终端获取第五交易之前,还包括:
从终端获取第六交易,所述第六交易包括目标用户的标识;所述目标用户为所述区块链的各节点的用户中的用户
根据所述第六交易,取消所述目标用户的资产转出功能。
上述申请中的实施例具有如下优点或有益效果:限制目标用户的资产转出功能,保证区块链参与方的利益。
在一种可能的设计中,在所述从终端获取第五交易之后,还包括:
恢复所述目标用户的资产转出功能。
上述申请中的实施例具有如下优点或有益效果:由于每次接收到用于获取总余额的交易后,会根据获取的总余额,进行一次链外的清算,因此,恢复目标用户的资产转出功能,保证了目标用户在链外的清算后正常的进行交易。
第二方面,本申请实施例提供一种区块链中的数据处理方法,应用于终端,包括:
向区块链中的节点发送第一交易,所述第一交易包括第一期数;
其中,所述第一期数为所述节点记录转账交易的交易信息的第一记录周期的期数,所述第一交易用于指示所述节点获取所述用户在所述第一记录周期的第一余额。
上述申请中的实施例具有如下优点或有益效果:终端发送携带第一期数的第一交易后,节点可根据第一期数清算交易信息中包括第一期数的交易信息,得到用户在相应记录周期的第一余额,从而有效降低了现有技术中由于读写冲突造成的部分转账交易无效的现象的发生率,提高了区块链节点记录的转账交易有效率。
在一种可能的设计中,在所述向区块链中的节点发送第一交易之前,还包括:
向所述节点发送第二交易,所述第二交易用于所述节点获取当前的第二记录周期的第二期数;所述第二期数大于所述第一期数;
从所述节点获取所述第二期数。
上述申请中的实施例具有如下优点或有益效果:使得终端获知第一交易中应该携带的记录周期的期数。
在一种可能的设计中,还包括:
向所述节点发送第三交易;所述第三交易用于所述节点根据所述第一期数得到第三期数,所述第三期数为所述第三记录周期的期数,所述第一期数小于第三期数。
上述申请中的实施例具有如下优点或有益效果:向节点发送第三交易,使得节点更新记录周期的期数,使得不同的期数标记不同记录周期的转账交易的交易信息,以及可以分批的清算转账交易;并且在分批的清算转账交易时,准确的确定未清算的转账交易,以及已清算的转账交易。
在一种可能的设计中,还包括:
向所述节点发送获取第四交易;所述第四交易用于所述节点根据所述第三期数得到第四期数,所述第四期数为第四记录周期的期数,所述第三期数小于第四期数;
向所述节点发送第五交易,所述第五交易包括所述第三期数和所述第四期数,所述第五交易用于所述节点获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额。
上述申请中的实施例具有如下优点或有益效果:降低链外结算的次数。
在一种可能的设计中,还包括:
从所述节点获取所述用户在所述第一记录周期的第一余额。
上述申请中的实施例具有如下优点或有益效果:终端可以通过所述用户在所述第一记录周期的第一余额,监管节点的转账交易。
在一种可能的设计中,若该第三记录周期至该第四记录周期之间具有M个记录周期,则在所述向所述节点发送第五交易之前,还包括:
若M个记录周期的前N个记录周期对应的总余额小于或等于预设阈值,则向所述节点发送第六交易,所述第六交易用于指示所述节点取消所述用户的账户的资产转出功能;1≤N≤M,M≥1,M和N为整数;
其中,前N个记录周期对应的总余额为所述用户从前N个记录周期中的第一个记录周期至前N个记录周期中的第N个记录周期对应的总余额。
上述申请中的实施例具有如下优点或有益效果:终端可以获取上述M个记录周期的前N个记录周期对应的总余额小于或等于预设阈值,监管节点的转账交易,在某一用户余额过低时,向节点发送第六交易,使得节点取消f该用户的账户的资产转出功能,保证了其它用户的利益。
第三方面,本申请实施例提供一种基于区块链的数据处理装置,包括:
记录模块,用于记录第一记录周期内的每笔转账交易的交易信息,所述交易信息包括:所述第一记录周期的第一期数、所述转账交易对应的转入用户标识和转出用户标识;
接收模块,用于从终端获取第一交易,所述第一交易包括所述第一期数;
确定模块,用于对于每个所述节点的用户,根据所述第一期数确定所述用户在所述第一记录周期的目标交易信息,并根据所述目标交易信息确定所述用户在所述第一记录周期的第一余额。
在一种实施方式中,所述交易信息还包括转入额和转出额;所述确定模块,具体用于:
确定包括所述第一期数且包括所述用户的标识的交易信息,为所述用户在所述第一记录周期的目标交易信息;
根据所述目标交易信息包括的转入额,确定所述用户对应的第一转入额,并根据所述目标交易信息包括的转出额,确定所述用户对应的第一转出额;
根据所述用户的第一转出额和所述第一转入额,获取所述用户在所述第一记录周期的第一余额。
在一种可能的设计中,所述接收模块还用于,在所述从终端获取第一交易之前,从所述终端获取第二交易;
还包括:获取模块,用于根据所述第二交易,获取当前的第二记录周期的第二期数;
发送模块,用于向所述终端发送所述第二期数;其中,所述第二期数大于所述第一期数。
在一种可能的设计中,所述接收模块还用于,从终端获取第三交易;
还包括:获取模块,用于根据所述第三交易和所述第一期数,得到第三期数和第三记录周期,所述第三期数为所述第三记录周期的期数,所述第一期数小于第三期数。
在一种可能的设计中,所述接收模块还用于,从终端获取第四交易;
所述获取模块,还用于根据所述第四交易和所述第三期数,得到第四期数和第四记录周期,所述第四期数为所述第四记录周期的期数,所述第三期数小于第四期数;
所述接收模块还用于,从终端获取第五交易,所述第五交易包括所述第三期数和所述第四期数;
所述获取模块,还用于对于每个所述节点的用户,获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额。
在一种可能的设计中,所述获取模块,具体用于:
对于每个所述节点的用户,根据所述用户在各目标记录周期的第一余额之和,得到所述用户从所述第三记录周期至所述第四记录周期对应的总余额;所述目标记录周期为从所述第三记录周期至所述第四记录周期之间的记录周期。
在一种可能的设计中,所述发送模块还用于,向所述终端发送所述用户在所述第一记录周期的第一余额。
在一种可能的设计中,所述接收模块还用于,在所述从终端获取第五交易之前,从终端获取第六交易,所述第六交易包括目标用户的标识;所述目标用户为所述区块链的各节点的用户中的用户
还包括:取消模块,用于根据所述第六交易,取消所述目标用户的资产转出功能。
在一种可能的设计中,还包括:恢复模块,所述恢复模块,用于在所述从终端获取第五交易之后,恢复所述目标用户的资产转出功能。
第四方面,本申请实施例提供一种区块链中的数据处理装置,包括:
发送模块,用于向区块链中的节点发送第一交易,所述第一交易包括第一期数;
其中,所述第一期数为所述节点记录转账交易的交易信息的第一记录周期的期数,所述第一交易用于指示所述节点获取所述用户在所述第一记录周期的第一余额。
在一种可能的设计中,所述发送模块,还用于在所述向区块链中的节点发送第一交易之前,向所述节点发送第二交易,所述第二交易用于所述节点获取当前的第二记录周期的第二期数;所述第二期数大于所述第一期数;
还包括:接收模块,用于从所述节点获取所述第二期数。
在一种可能的设计中,所述发送模块,还用于向所述节点发送第三交易;所述第三交易用于所述节点根据所述第一期数得到第三期数,所述第三期数为所述第三记录周期的期数,所述第一期数小于第三期数。
在一种可能的设计中,所述发送模块,还用于向所述节点发送获取第四交易;所述第四交易用于所述节点根据所述第三期数得到第四期数,所述第四期数为第四记录周期的期数,所述第三期数小于第四期数;以及,
向所述节点发送第五交易,所述第五交易包括所述第三期数和所述第四期数,所述第五交易用于所述节点获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额。
在一种可能的设计中,还包括:接收模块;
接收模块,用于从所述节点获取所述用户在所述第一记录周期的第一余额。
在一种可能的设计中,若该第三记录周期至该第四记录周期之间具有M个记录周期,则所述发送模块,还用于在所述向所述节点发送第五交易之前,
若M个记录周期的前N个记录周期对应的总余额小于或等于预设阈值,则向所述节点发送第六交易,所述第六交易用于指示所述节点取消所述用户的账户的资产转出功能;1≤N≤M,M≥1,M和N为整数;
其中,前N个记录周期对应的总余额为所述用户从前N个记录周期中的第一个记录周期至前N个记录周期中的第N个记录周期对应的总余额。
第五方面本申请实施例提供一种电子设备,包括:处理器,存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现第一方面任一所述的方法或者第二方面任一所述的方法。
第六方面本申请实施例提供一种可读存储介质,其上存储有计算机程序或指令,当所述程序或指令在计算机上运行时,第一方面任一所述的方法或者第二方面任一所述的方法被执行。
本申请中由于在节点记录转账交易的交易信息中包括了记录周期的期数,使得可在一个记录周期结束后,根据交易信息中包括的期数,清算相应记录周期内发生的转账交易,得到用户在相应记录周期的第一余额,从而有效降低了现有技术中由于读写冲突造成的部分转账交易无效的现象的发生率,提高了区块链节点记录的转账交易有效率。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的系统架构图;
图2为本申请实施例提供的区块链的数据处理方法的信令交互图一;
图3为本申请实施例提供的区块链的数据处理方法的信令交互图二;
图4为本申请实施例提供的区块链的数据处理方法的信令交互图三;
图5为本申请实施例提供的基于区块链的数据处理装置的结构示意图一;
图6为本申请实施例提供的基于区块链的数据处理装置的结构示意图二;
图7为本申请实施例提供的基于区块链的数据处理装置的结构示意图三;
图8为本申请实施例提供的基于区块链的数据处理装置的结构示意图四;
图9为本申请实施例提供的区块链节点的结构示意图;
图10为本申请实施例提供的终端的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例的联盟链,只针对某个特定群体的成员和有限的第三方,其内部指定多个预选节点为记账人,每个块的生成由所有的预选节点共同决定。
图1为本申请实施例提供的系统架构图。参照图1,该系统架构包括区块链节点、第一终端和第二终端。其中,区块链节点为联盟链的参与方对应的节点,每个节点均为安装有智能合约的节点,第一终端设备为用于监管的第三方的终端,第二终端为提案交易的终端。
可以理解的是,第一终端、第二终端均与各区块链节点之间通信连接,为了图示表达的清楚,没有完全示出第一终端与各区块链节点之间通信连接,也没有完全示出第二终端与各区块链节点之间通信连接。
下面,通过具体实施例对本申请所示的技术方案进行详细说明。需要说明的是,下面几个具体实施例可以相互结合,对于相同或相似的内容,在不同的实施例中不再进行重复说明。
图2为本申请实施例提供的区块链的数据处理方法的信令交互图一;参见图2,本实施例的方法,包括:
步骤S201、节点记录第一记录周期内每笔转账交易的交易信息,交易信息包括:第一记录周期的第一期数、转账交易对应的转入用户标识和转出用户标识;
步骤S202、终端向节点发送第一交易;第一交易包括的第一期数,第一期数为第一记录周期的期数;
步骤S203、对于每个节点的用户,节点根据第一期数确定该用户在第一记录周期的目标交易信息,并根据该目标交易信息确定该用户在该第一记录周期的第一余额。
具体地,本实施例的节点为组成区块链的任一个节点,可以理解的是,本实施例中的区块链可以为联盟链。下面以联盟链为例,说明本申请实施例的方法。本实施例中的终端可为用于监管的第三方的终端。
联盟链的每个参与方均对应有一个账户,当联盟链的某两个参与方发生了转账交易,比如,参与方A向参与方B转出X个资产,参与方A的总余额会减少X,参与方B的总余额会增加X;其中,资产可为积分;此时,参与方A的终端会向各节点提案交易,各节点会通过智能合约对该交易进行确认,确认后,记录该转账交易。可以理解的是,每个节点对应一个参与方,或者说每个节点对应一个用户。
具体地,对于转账交易的记录,引入记录周期的概念,不同的记录周期用期数标识;若从xx时刻到yy时刻的记录周期的期数为1,则从yy时刻到zz时刻的记录周期的期数可为2,从zz时刻到aa时刻的记录周期的期数可为3。
可以理解的是,每个记录周期对应的时长,并不一定相同。比如,期数为1的记 录周期持续的时长为1天:2018年5月23日00点至2018年5月24日00点之间时刻均属于期数为1的记录周期的时刻,又比如,期数为2的记录周期持续的时长为2天:2018年5月24日00点至2018年5月26日00点之间时刻均属于期数为2的记录周期的时刻。
对于步骤S201,记录第一记录周期内每笔转账交易的交易信息,交易信息包括:第一记录周期的第一期数、转账交易对应的转入用户标识和转出用户标识,转入额和转出额。即每次转账交易对应一条交易信息。
其中,第一记录周期为任一记录周期,第一期数为该第一记录周期的期数。
比如:用户A在2018年5月23日6:00点向用户B转出X个资产,2018年5月23日属于期数为第一期数1的第一记录周期,则该转账交易的交信息可包括:第一期数1、转出方用户A的标识、转入方用户B的标识,转出额-X,转入额X。
可选地,转账交易的交易信息可以通过键-值对(Key-Value)的形式存储。其中,Key值可包括:记录周期的期数、转入用户标识、转出用户标识;进一步地,Key值还可包括:该次转账交易的标识(比如序列号标识)。Value值可包括:转入额、转出额;进一步地,Value值还可以包括其它的数据字段,比如转账交易发生的原因。
对于步骤S202~步骤S203,在终端向节点发送携带第一期数的第一交易之前,第一记录周期应该已经结束,或者说当前的记录周期已不再是第一记录周期,即记录周期的期数和记录周期已经发送了变更。
在阐述步骤S202~步骤S203的具体实现之前,先对记录周期的期数和记录周期的变更进行说明。
如上所述,不同的记录周期对应不同的期数,因此,记录周期会随着期数变更而变更,因此,本实施例的方法还包括:终端向该节点发送第三交易,节点根据该第三交易和第一期数,得到第三期数和第三记录周期,该第三期数为该第三记录周期的期数,该第一期数小于该第三期数。因此,第三交易可以认为是终端发送的一次用于期数更新的交易,可以理解的是,终端会发送多次用于期数更新的交易。
具体地,该终端向节点发送该第三交易,该节点收到第三交易后,“根据第三交易和第一期数,得到第三期数和第三记录周期”,是指,第一期数更新成了第三期数,相应的第一记录周期更新成了第三记录周期。
其中,节点接收到第三交易后,第一记录周期还没有结束,当前的记录周期为第一记录周期;而节点接收到第三交易后,会先获取当前的记录周期的期数,也就是第一期数,根据第一期数得到更新后的期数。
可以理解的是,节点可以在接收到第三交易(一次用于期数更新的交易)后,节点将第一期数更新为第三期数(此时第三期数即为上述更新后的期数),相应地得到第三记录周期;此时,步骤S202发生在“终端向该节点发送第三交易,节点根据该第三交易和第一期数,得到第三期数和第三记录周期”之后。
节点还可以是在节点接收到L次用于期数更新的交易(L次中的第一次接收的为第三交易)后,节点将记录周期的期数由第一期数更新到第三期数,相应的得到第三记录周期。
示例性的,L=2,节点接收到第三交易后,将第一期数更新为第五期数,得到了 第五期数对应的第五记录周期(即第五期数为第五记录周期的期数,即当前的记录周期变成了第五记录周期,此时第五期数即为上述更新后的期数);节点下一次接收到用于期数更新的交易后,将第五期数更新为第三期数(即第三期数为第三记录周期的期数),当前的记录周期变成了第三期数对应的第三记录周期。即对于第一记录周期而言,经过接收两次用于期数更新的交易,根据各用于期数更新的交易和第一期数,得到第三期数和第三记录周期。
可以说期数被更新后,意味着一个记录周期的结束和另一个记录周期的开始。
由于第三交易用于期数更新的交易,因此,在每一次需要更新期数时,终端都会发送一次用于期数更新的交易至节点,节点接收到一次,获取一次当前记录周期的期数,根据当前记录周期的期数的次数更新一次期数,当前的记录周期也更新一次。
可选地,终端相邻两次发送用于期数更新的交易的时间的间隔可不相同。比如终端第n次发送用于期数更新的交易与第n+1次发送用于期数更新的交易之间的第一时间间隔,可以与终端第n+1次发送用于期数更新的交易与第n+2次发送用于期数更新的交易之间的第二时间间隔不相同。
本实施例中,更新记录周期的期数,使得不同的期数标记不同记录周期的转账交易的交易信息,以及可以分批的清算转账交易;并且在分批的清算转账交易时,可以准确的确定已清算的转账交易,以及未清算的转账交易。
下面对步骤S202~步骤S203的具体实现进行说明。
如上所述在终端向节点发送携带第一期数的第一交易之前,第一记录周期应该已经结束,也就是说当前的记录周期不再是第一记录周期,比如可为第二记录周期,显然地,第一期数小于第二记录周期的第二期数。
比如,若第一期数为5,则第二期数至少为6。
节点接收到第一交易后,具体地,“对于每个节点的用户,根据第一期数确定该用户在该第一记录周期的目标交易信息,并根据该目标交易信息确定所述用户在该第一记录周期的第一余额”,包括:
(1)对于每个节点的用户,确定包括所述第一期数且包括该用户的标识的交易信息,为该用户在该第一记录周期的目标交易信息;
(2)对于每个节点的用户,根据目标交易信息包括的转入额,确定该用户对应的第一转入额,并根据该目标交易信息包括的转出额,确定该用户对应的第一转出额;
具体地,对于每个节点的用户,确定第一目标交易信息中包括的转入额为该用户对应的第一转入额;第一目标交易信息为包括的转入方标识为该用户的标识的目标交易信息。
若具有n条第一目标交易信息,则该用户对应的第一转入额具有n个,n为大于等于0的整数。
对于每个节点的用户,确定第二目标交易信息中包括的转出额为该用户的第一转出额;第二目标交易信息为包括的转出方标识为该用户的标识的目标交易信息。
若具有l条第二目标交易信息,则该用户对应的第一转出额具有l条,l为大于等于0的整数。
通过上述方法,可以得到每个用户(也就是联盟链的参与方)的各第一转入额和 各第一转出额。可以理解的是,各第一转入额均为正值,各第一转出额均为负值。
(3)对于每个节点的用户,根据该用户的第一转出额和该第一转入额,获取该用户在该第一记录周期的第一余额。
具体地,对于每个节点的用户,获取该用户对应的各第一转入额的第一和,以及该用户对应的各第一转出额的第二和;确定第一和与第二和之和为该用户在第一记录周期的第一余额。
可以理解的是,该用户在第一记录周期的第一余额并不是该用户在第一记录周期结束时账户的实际余额,在第一记录周期结束时该用户的账户的实际余额为该用户在第一记录周期的第一余额加上在第一记录周期开始时账户的初始余额。其中,第一记录周期开始时用户的账户的初始余额可为0。
综上,上述的第一交易为终端发送的一次用于指示清算用户在某一记录周期记录的转账交易的交易,简称用于清算的交易。
可以理解的是,上述用于计算第一和的第一转入额应该包括在形成了区块的交易信息中;那么,若在获取第一和时,第一记录周期内记录的某一交易信息还未形成区块,则不能用于第一和的计算。基于该原因,若节点接收到第三交易后,节点将第一期数更新成了第三期数,则终端发送携带第一期数的第一交易与终端相发送第三交易之间应该具有一定的间隔,以保证第一记录周期内记录的交易信息均形成了区块。
比如,终端向节点发送用于更新期数的交易1后,节点将期数3更新成了期数4,则发送携带有期数3的用于清算的交易的时间与发送用于更新期数的交易1的时间应该至少具有上述的间隔。发送携带有期数3的用于清算的交易的时间晚于发送用于更新期数的交易1的时间。
本实施例中,由于在节点记录转账交易的交易信息中包括了记录周期的期数,使得可在一个记录周期结束后,根据交易信息中包括的期数,清算相应记录周期内发生的转账交易,得到用户在相应记录周期的第一余额,也就是无需每次转账交易被记录后,均读取一次当前账户的余额,以得到更新后的账户余额,从而有效降低了现有技术中由于读写冲突造成的部分转账交易无效的现象的发生率,提高了区块链节点记录的转账交易的有效率。
可以理解的是,终端会发多次发送用于清算的交易至节点。可选地,终端相邻两次发送用于清算的交易的时间的间隔可不相同。比如终端第N次发送用于清算的交易与第N+1次发送用于清算的交易之间的第一时间间隔,可以与终端第N+1次发送用于清算的交易与第N+2次发送用于清算的交易之间的第二时间间隔不相同。
本实施例的区块链的数据处理方法,通过记录转账交易所在的记录周期的期数,在相应的记录周期结束后,清算一次相应的记录周期内记录的转账交易,得到用户在相应的记录周期对应的余额,提高了区块链节点记录的转账交易的有效率。
应理解,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
为了使得上述终端获知第一交易应该携带的第一期数,本实施例在上一实施例的基础上作了进一步的改进。图3为本申请实施例提供的区块链的数据处理方法的信令 交互图二;
步骤S301、节点记录第一记录周期内每笔转账交易的交易信息,交易信息包括:第一记录周期的第一期数、转账交易对应的转入用户标识和转出用户标识;
步骤S302、终端向节点发送第二交易;
步骤S303、节点根据第二交易,获取当前的第二记录周期的第二期数;
步骤S304、节点发送第二期数至终端;
步骤S305、终端向节点发送第一交易;第一交易包括的第一期数,第一期数为第一记录周期的期数;
步骤S306、对于每个节点的用户,根据第一期数确定该用户在第一记录周期的目标交易信息,并根据该目标交易信息确定该用户在该第一记录周期的第一余额。
具体地,步骤S301参照上一实施例中的步骤S201相关的阐述,本实施例中不再赘述。
对于步骤S302~步骤S304、终端向节点发送第二交易,第二交易用于指示节点获取当前记录周期的第二期数,节点接收到第二交易后,获取当前第二记录周期的第二期数,节点将第二期数发送至终端。
终端接收到第二期数后,获知当前第二记录周期的期数为第二期数,说明小于第二期数的期数对应的记录周期可以清算,比如第一期数,则终端可以执行步骤S305中的步骤:终端向节点发送第一交易;第一交易包括的第一期数,第一期数为第一记录周期的期数
对于步骤306参照上一实施例中的步骤S203相关的阐述,本实施例中不再赘述。
本实施例的方法,可以使得上述终端获知第一交易应该携带的第一期数。
为了减少链外结算的次数,本实施例在上一实施例的基础上作了进一步的改进。图4为本申请实施例提供的区块链的数据处理方法的信令交互图三;参见图4,本实施例的方法,包括:
步骤S401、记录第一记录周期每笔转账交易的交易信息,交易信息包括:第一记录周期的第一期数、转账交易对应的转入用户标识和转出用户标识;
步骤S402、终端向节点发送第二交易;
步骤S403、节点根据第二交易,获取当前的第二记录周期的第二期数;
步骤S404、节点发送第二期数至终端;
步骤S405、终端向节点发送第一交易;第一交易包括的第一期数,第一期数为第一记录周期的期数;
步骤S406、对于每个节点的用户,根据第一期数确定该用户在第一记录周期的目标交易信息,并根据该目标交易信息确定该用户在该第一记录周期的第一余额。
步骤S407、终端向节点发送第三交易;
步骤S408、节点根据该第三交易和第一期数,得到第三期数和第三记录周期,该第三期数为该第三记录周期的期数,该第一期数小于该第三期数;
步骤S409、终端向节点发送第四交易;
步骤S410、节点根据该第四交易和该第三期数,得到第四期数和第四记录周期, 该四期数为该第四记录周期的期数,该第三期数小于该第四期数;
步骤S411、终端向节点发送第五交易,第五交易包括该第三期数和该第四期数;
步骤S412、对于每个节点的用户,节点获取该用户从该第三记录周期至该第四记录周期对应的总余额。
具体地,对于步骤S401~步骤S406参照上一实施例中的阐述,本实施例中不再赘述。
对于步骤S407~步骤S408、同图2所示的实施例中关于“根据该第三交易和第一期数,得到第三期数和第三记录周期,该第三期数为该第三记录周期的期数,该第一期数小于该第三期数”阐述,本实施例中不再赘述。
对于步骤S409~步骤S410、参照图2所示的实施例中关于“根据该第三交易和第一期数,得到第三期数和第三记录周期,该第三期数为该第三记录周期的期数,该第一期数小于该第三期数”阐述,本实施例中不再赘述。
即第三期数是从第一期数更新而来,第四期数是从第三期数更新而来。比如:第一期数中间可以经过了多次更新才更新到第三期数,相应地,记录周期也经过了多次更新得到了第三期数对应的第三记录周期。
示例性地,比如第一期数为1,则第三期数为6,则第一期数先更新成了期数2,又更新成了3,又更新成了4、又更新成了5,接着更新成了第三期数6,相应的记录周期也经过多次更新得到第三期数6对应的第三记录周期。
步骤S411~步骤S412,若每个记录周期结束后,均相应地进行一次链外结算,则结算过于频繁,因此,可以在连续几个记录周期结束后,统一进行一次链外结算。这就需要根据连续几个记录周期对应的余额,获取该连续几个记录周期对应的总余额,以用于链外结算。
因此,终端需要向节点发送第五交易,第五交易包括该第三期数和该第四期数。
节点接收到第五交易后,对于每个用户,节点获取该用户从该第三记录周期至该第四记录周期对应的总余额。
具体地,第五交易包括的第三期数为获取总余额的过程对应的起始期数,第四期数为获取总余额的过程对应的终止期数。
对于每个节点的用户,获取该用户从第三记录周期至第四记录周期对应的总余额,包括:
对于每个节点的用户,根据该用户在各目标记录周期的第一余额之和,得到该用户从该第三记录周期至该第四记录周期对应的总余额;该目标记录周期为从第三记录周期至第四记录周期之间的记录周期。其中,从第三记录周期至第四记录周期之间的记录周期包括第三记录周期和第四记录周期。
示例性地,若第三交易携带的期数为6、9,则说明需要获取从期数为6的记录周期至期数为9的记录周期对应的总余额。此时,期数6为第三期数,期数6的记录周期为第三记录周期,期数9为第四期数,期数9的记录周期为第四记录周期。
若相邻的记录周期的期数的差值的绝对值为1,则将按照步骤S406中的方法获取的用户在期数6的记录周期对应的第一余额、用户在期数7的记录周期对应的第一余额、用户在期数8的记录周期对应的第一余额和用户在期数9的记录周期对应的第一 余额相加,得到该用户从期数6的记录周期至期数9的记录周期对应的总余额。
可以理解的是,此处的总余额也不是用户的账户的实际余额。实际余额的获取方法参照图2所示的实施例中的阐述。
节点获取用户的总余额的过程可称为快照操作,快照操作得到的快照数据的存储方式可为Key-Value的形式。其中,Key值可包括:用于获取总余额的各记录周期的期数、各用户的标识;Value值可包括:各用户的总余额。
上述的第五交易为终端发送的一次用于获取总余额的交易,可选地,终端每隔预设间隔向节点发送一次用于获取总余额的交易,每次用于获取总余额的交易中携带的期数不相同。即第n次发送的用于获取总余额的交易携带的终止期数加上预设值为第n+1次发送的用于获取总余额的交易携带的起始期数。示例性地,若即第n次发送的用于获取总余额的交易携带的期数为1、5,则第n+1次发送的用于获取总余额的交易携带的期数可为6、9,则第n+2次发送的用于获取总余额的交易携带的期数可为10、12。
其中,本实施例中的预设值即相邻两个期数的差值的绝对值。若每间隔一个月获取一次相应月各用户的总余额,即将相应月包括的已经结束的各记录周期对应的第一余额求和,得到相应月各用户的总余额。
进一步地,步骤S405中终端在向节点发送第一交易后,节点还可以向终端发送上述的第一记录周期内记录的转账交易的交易信息,和/或,上述的各用户在第一记录周期的第一余额。
若节点向终端发送的是上述的第一记录周期内记录的转账交易的交易信息,则终端在从节点获取第一记录周期内记录的转账交易的交易信息之后,还包括:对于每个节点的用户,根据第一期数确定用户在第一记录周期的目标交易信息,并根据目标交易信息确定用户在第一记录周期的第一余额。
其中,终端获取“确定用户在第一记录周期的第一余额”的方法可以与节点“确定用户在第一记录周期的第一余额”的方法相同,此处不再赘述。
进一步地,若该第三记录周期至该第四记录周期之间具有M个记录周期,则在上述的向节点发送第五交易之前,还包括:
对于每个节点的用户,若该用户的M个记录周期的前N个记录周期对应的总余额小于或等于预设阈值,则向节点发送第六交易,第六交易用于指示节点取消该用户的账户的资产转出功能;1≤N≤M,M≥1,M和N为整数;
其中,前N个记录周期对应的总余额为该用户从前N个记录周期中的第一个记录周期至前N个记录周期中的第N个记录周期对应的总余额;预设阈值比如可为-10000。
可以理解的是,前N个记录周期中的第一个记录周期是第三记录周期,前N个记录周期中的第N个记录周期的期数小于或等于第四记录周期的期数。
其中,前N个记录周期对应的总余额的获取方法,参见步骤S412中节点获取所述用户从第三记录周期至第四记录周期对应的总余额的方法。
示例性地,终端向节点发送了第七交易,第七交易包括的起始期数为1,终止期数为5,则节点根据用户在期数1至期数5各自对应的记录周期所对应的第一余额之后,获取到了从期数1对应的记录周期至期数5对应的记录周期所对应的总余额,在 与发送第七交易的时刻1的间隔为预设间隔的时刻2发送第五交易,若第5交易包括起始期数为6,终止期数为9,则终端在时刻1与时刻之间,对于每个用户,终端先判断用户在期数6对应的记录周期对应的第一余额是否小于预设阈值,若是,则终端向节点发送第六交易(属于终端发送的一次用于取消账户功能的交易),第六交易用于指示节点取消该用户的账户的资产转出功能,若否,获取用户在期数6对应的记录周期对应的第一余额与期数7对应的记录周期对应的第一余额之和,称为第一总余额;终端判断第一总余额是否小于预设阈值,若是,则终端向节点发送用于取消账户功能的交易,若否,则获取用户在期数6对应的记录周期对应的第一余额、期数7对应的记录周期对应的第一余额与期数8对应的记录周期对应的第一余额之和,称为第二总余额,终端判断第二总余额是否小于预设阈值,若是,则终端向节点发送上述用于取消账户功能的交易,若否,则获取到用户在期数6对应的记录周期对应的第一余额、期数7对应的记录周期对应的第一余额、期数8对应的记录周期对应的第一余额与期数9对应的记录周期对应的第一余额之和,称为第三总余额,第三总余额;终端判断第三总余额是否小于预设阈值,若是,则终端向节点发送用于取消账户功能的交易。
因此,终端向节点发送用于清算的交易的周期不固定,比较灵活,那么终端从节点接收到用户在某一记录周期对应的第一余额的时间也就比较灵活,这样可以及时的发现用户的总余额是否低于预设阈值。
进一步地,若在发送第五交易之前,用户的账户的资产转出功能被取消,则在向节点发送该第五交易之后,还包括:节点恢复该用户的账户的资产转出功能。也就是说,若用户的账户的资产转出功能被取消,则在节点再次接收到用于获取总余额的交易后,恢复用户的账户的资产转出功能。
其中,限制用户的资产转出功能,可保证区块链参与方的利益。由于每次接收到用于获取总余额的交易后,会根据获取的总余额,进行一次链外的清算,因此,恢复用户的资产转出功能,可保证用户在链外的清算后正常的进行交易。
可选地,终端还可单独的发送第八交易至节点,该第八交易中包括记第五期数,节点在收到第八交易后,向终端发送第五期数对应的第五记录周期对应的第一余额。
本实施例中通过获取用户从第三记录周期至第四记录周期对应的总余额,减少了链外结算的次数。
应理解,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
图5为本申请实施例提供的基于区块链的数据处理装置的结构示意图一,如图5所示,本实施例的装置可以包括:记录模块51、接收模块52和确定模块53;
记录模块51,用于记录第一记录周期内的每笔转账交易的交易信息,所述交易信息包括:所述第一记录周期的第一期数、所述转账交易对应的转入用户标识和转出用户标识;
接收模块52,用于从终端获取第一交易,所述第一交易包括所述第一期数;
确定模块53,用于对于每个所述节点的用户,根据所述第一期数确定所述用户在所述第一记录周期的目标交易信息,并根据所述目标交易信息确定所述用户在所述第 一记录周期的第一余额。
在一种实施方式中,所述交易信息还包括转入额和转出额;所述确定模块,具体用于:
确定包括所述第一期数且包括所述用户的标识的交易信息,为所述用户在所述第一记录周期的目标交易信息;
根据所述目标交易信息包括的转入额,确定所述用户对应的第一转入额,并根据所述目标交易信息包括的转出额,确定所述用户对应的第一转出额;
根据所述用户的第一转出额和所述第一转入额,获取所述用户在所述第一记录周期的第一余额。
本实施例的装置,可以用于执行上述方法实施例节点对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
图6为本申请实施例提供的的基于区块链的数据处理装置的结构示意图二,如图6所示,本实施例的装置在图5所示装置结构的基础上,进一步地,还可以包括:获取模块54和发送模块55。
所述接收模块52还用于,在所述从终端获取第一交易之前,从所述终端获取第二交易;
获取模块54,用于根据所述第二交易,获取当前的第二记录周期的第二期数;
发送模块55,用于向所述终端发送所述第二期数;其中,所述第二期数大于所述第一期数。
在一种可能的设计中,所述接收模块52还用于,从终端获取第三交易;
还包括:获取模块,用于根据所述第三交易和所述第一期数,得到第三期数和第三记录周期,所述第三期数为所述第三记录周期的期数,所述第一期数小于第三期数。
在一种可能的设计中,所述接收模块52还用于,从终端获取第四交易;
所述获取模块54,还用于根据所述第四交易和所述第三期数,得到第四期数和第四记录周期,所述第四期数为所述第四记录周期的期数,所述第三期数小于第四期数;
所述接收模块52还用于,从终端获取第五交易,所述第五交易包括所述第三期数和所述第四期数;
所述获取模块54,还用于对于每个所述节点的用户,获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额。
在一种可能的设计中,所述获取模块54,具体用于:
对于每个所述节点的用户,根据所述用户在各目标记录周期的第一余额之和,得到所述用户从所述第三记录周期至所述第四记录周期对应的总余额;所述目标记录周期为从所述第三记录周期至所述第四记录周期之间的记录周期。
在一种可能的设计中,所述发送模块55还用于,向所述终端发送所述用户在所述第一记录周期的第一余额。
本实施例的装置,可以用于执行上述方法实施例节点对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
图7为本申请实施例提供的基于区块链的数据处理装置的结构示意图二,如图7所示,本实施例的装置在图6所示装置结构的基础上,进一步地,还可以包括:取消 模块57和恢复模块58。
所述接收模块52还用于,在所述从终端获取第五交易之前,从终端获取第六交易,所述第六交易包括目标用户的标识;所述目标用户为所述区块链的各节点的用户中的用户
取消模块57,用于根据所述第六交易,取消所述目标用户的资产转出功能。
在一种可能的设计中,所述恢复模块58,用于在所述从终端获取第五交易之后,恢复所述目标用户的资产转出功能。
本实施例的装置,可以用于执行上述方法实施例节点对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
图8为本申请实施例提供的基于区块链的数据处理装置的结构示意图一,如图8所示,本实施例的装置可以包括:发送模块61和接收模块62;
发送模块61,用于向区块链中的节点发送第一交易,所述第一交易包括第一期数;
其中,所述第一期数为所述节点记录转账交易的交易信息的第一记录周期的期数,所述第一交易用于指示所述节点获取所述用户在所述第一记录周期的第一余额。
在一种可能的设计中,所述发送模块61,还用于在所述向区块链中的节点发送第一交易之前,向所述节点发送第二交易,所述第二交易用于所述节点获取当前的第二记录周期的第二期数;所述第二期数大于所述第一期数;
接收模块62,用于从所述节点接收所述第二期数。
在一种可能的设计中,所述发送模块61,还用于向所述节点发送第三交易;所述第三交易用于所述节点根据所述第一期数得到第三期数,所述第三期数为所述第三记录周期的期数,所述第一期数小于第三期数。
在一种可能的设计中,所述发送模块61,还用于向所述节点发送获取第四交易;所述第四交易用于所述节点根据所述第三期数得到第四期数,所述第四期数为第四记录周期的期数,所述第三期数小于第四期数;以及,
向所述节点发送第五交易,所述第五交易包括所述第三期数和所述第四期数,所述第五交易用于所述节点获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额。
接收模块62,用于从所述节点获取所述用户在所述第一记录周期的第一余额。
在一种可能的设计中,若该第三记录周期至该第四记录周期之间具有M个记录周期,则所述发送模块61,还用于在所述向所述节点发送第五交易之前,
若M个记录周期的前N个记录周期对应的总余额小于或等于预设阈值,则向所述节点发送第六交易,所述第六交易用于指示所述节点取消所述用户的账户的资产转出功能;1≤N≤M,M≥1,M和N为整数;
其中,前N个记录周期对应的总余额为所述用户从前N个记录周期中的第一个记录周期至前N个记录周期中的第N个记录周期对应的总余额。
本实施例的装置,可以用于执行上述方法实施例中终端的技术方案,其实现原理和技术效果类似,此处不再赘述
图9为本申请实施例提供的区块链节点的结构示意图,参见图9,本实施例的电子设备,包括处理器21、存储器22和通信总线23,其中,通信总线23用于各元器件 之间的连接;
存储器,用于存储程序;
处理器,用于执行所述存储器存储的所述程序,当所述程序被执行时,所述处理器用于执行上述方法实施例中节点对应的方法。
图10为本申请实施例提供的终端的结构示意图,参见图10,本实施例的电子设备,包括处理器31、存储器32和通信总线33,其中,通信总线33用于各元器件之间的连接;
存储器,用于存储程序;
处理器,用于执行所述存储器存储的所述程序,当所述程序被执行时,所述处理器用于执行上述方法实施例中终端的方法。。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本申请实施例的技术方案,而非对其限制;尽管参照前述各实施例对本申请实施例进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请实施例方案的范围。

Claims (18)

  1. 一种基于区块链的数据处理方法,应用于组成所述区块链的任一个节点,其特征在于,包括:
    记录第一记录周期内的每笔转账交易的交易信息,所述交易信息包括:所述第一记录周期的第一期数、所述转账交易对应的转入用户标识和转出用户标识;
    从终端获取第一交易,所述第一交易包括所述第一期数;
    对于每个所述节点的用户,根据所述第一期数确定所述用户在所述第一记录周期的目标交易信息,并根据所述目标交易信息确定所述用户在所述第一记录周期的第一余额。
  2. 根据权利要求1所述的方法,其特征在于,在所述从终端获取第一交易之前,还包括:
    从所述终端获取第二交易;
    根据所述第二交易,获取当前的第二记录周期的第二期数;
    向所述终端发送所述第二期数;其中,所述第二期数大于所述第一期数。
  3. 根据权利要求1或2所述的方法,其特征在于,还包括:
    从终端获取第三交易;
    根据所述第三交易和所述第一期数,得到第三期数和第三记录周期,所述第三期数为所述第三记录周期的期数,所述第一期数小于第三期数。
  4. 根据权利要求3所述的方法,其特征在于,还包括:
    从终端获取第四交易;
    根据所述第四交易和所述第三期数,得到第四期数和第四记录周期,所述第四期数为所述第四记录周期的期数,所述第三期数小于第四期数;
    从终端获取第五交易,所述第五交易包括所述第三期数和所述第四期数;
    对于每个所述节点的用户,获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额。
  5. 根据权利要求4所述的方法,其特征在于,对于所述节点的用户,获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额,包括:
    对于每个所述节点的用户,根据所述用户在各目标记录周期的第一余额之和,得到所述用户从所述第三记录周期至所述第四记录周期对应的总余额;所述目标记录周期为从所述第三记录周期至所述第四记录周期之间的记录周期。
  6. 根据权利要求1~5任一项所述的方法,其特征在于,所述交易信息还包括转入额和转出额;所述对于每个节点的用户,根据所述第一期数确定所述用户在所述第一记录周期的目标交易信息,并根据所述目标交易信息确定所述用户在所述第一记录周期的第一余额,包括:
    确定包括所述第一期数且包括所述用户的标识的交易信息,为所述用户在所述第一记录周期的目标交易信息;
    根据所述目标交易信息包括的转入额,确定所述用户对应的第一转入额,并根据所述目标交易信息包括的转出额,确定所述用户对应的第一转出额;
    根据所述用户的第一转出额和所述第一转入额,获取所述用户在所述第一记录周 期的第一余额。
  7. 根据权利要求1~6任一项所述的方法,其特征在于,还包括:
    向所述终端发送所述用户在所述第一记录周期的第一余额。
  8. 根据权利要求4或5所述的方法,其特征在于,在所述从终端获取第五交易之前,还包括:
    从终端获取第六交易,所述第六交易包括目标用户的标识;所述目标用户为所述区块链的各节点的用户中的用户;
    根据所述第六交易,取消所述目标用户的资产转出功能。
  9. 根据权利要求8所述的方法,其特征在于,在所述从终端获取第五交易之后,还包括:
    恢复所述目标用户的资产转出功能。
  10. 一种区块链中的数据处理方法,应用于终端,其特征在于,包括:
    向区块链中的节点发送第一交易,所述第一交易包括第一期数;
    其中,所述第一期数为所述节点记录转账交易的交易信息的第一记录周期的期数,所述第一交易用于指示所述节点获取所述用户在所述第一记录周期的第一余额。
  11. 根据权利要求10所述的方法,其特征在于,在所述向区块链中的节点发送第一交易之前,还包括:
    向所述节点发送第二交易,所述第二交易用于所述节点获取当前的第二记录周期的第二期数;所述第二期数大于所述第一期数;
    从所述节点获取所述第二期数。
  12. 根据权利要求10或11所述的方法,其特征在于,还包括:
    向所述节点发送第三交易;所述第三交易用于所述节点根据所述第一期数得到第三期数,所述第三期数为所述第三记录周期的期数,所述第一期数小于第三期数。
  13. 根据权利要求12所述的方法,其特征在于,还包括:
    向所述节点发送获取第四交易;所述第四交易用于所述节点根据所述第三期数得到第四期数,所述第四期数为第四记录周期的期数,所述第三期数小于第四期数,所述第三期数小于第四期数;
    向所述节点发送第五交易,所述第五交易包括所述第三期数和所述第四期数,所述第五交易用于所述节点获取所述用户从所述第三记录周期至所述第四记录周期对应的总余额。
  14. 根据权利要求10~13任一项所述的方法,其特征在于,还包括:
    从所述节点获取所述用户在所述第一记录周期的第一余额。
  15. 根据权利要求13所述的方法,其特征在于,若该第三记录周期至该第四记录周期之间具有M个记录周期,则在所述向所述节点发送第五交易之前,还包括:
    若M个记录周期的前N个记录周期对应的总余额小于或等于预设阈值,则向所述节点发送第六交易,所述第六交易用于指示所述节点取消所述用户的账户的资产转出功能;1≤N≤M,M和N均为整数;
    其中,前N个记录周期对应的总余额为所述用户从前N个记录周期中的第一个记录周期至前N个记录周期中的第N个记录周期对应的总余额。
  16. 一种电子设备,其特征在于,包括:处理器,存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1~9任一所述的方法或者权利要求10~15任一所述的方法。
  17. 一种可读存储介质,其上存储有计算机程序或指令,其特征在于,当所述程序或指令在计算机上运行时,权利要求1~9任一所述的方法或者权利要求10~15任一所述的方法被执行。
  18. 一种区块链系统,其特征在于,包括用于实现权利要求1~9任一所述的方法的电子设备以及用于实现权利要求10~15任一所述的方法的电子设备。
PCT/CN2019/100979 2018-08-21 2019-08-16 基于区块链的数据处理方法、装置和设备 WO2020038291A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810956567.4 2018-08-21
CN201810956567.4A CN109242455A (zh) 2018-08-21 2018-08-21 基于区块链的数据处理方法、装置和设备

Publications (1)

Publication Number Publication Date
WO2020038291A1 true WO2020038291A1 (zh) 2020-02-27

Family

ID=65071054

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/100979 WO2020038291A1 (zh) 2018-08-21 2019-08-16 基于区块链的数据处理方法、装置和设备

Country Status (2)

Country Link
CN (1) CN109242455A (zh)
WO (1) WO2020038291A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109242455A (zh) * 2018-08-21 2019-01-18 北京京东金融科技控股有限公司 基于区块链的数据处理方法、装置和设备
CN111353888A (zh) * 2020-03-03 2020-06-30 杭州时戳信息科技有限公司 交易撮合系统及其链上撮合方法、区块链节点

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108053211A (zh) * 2017-12-27 2018-05-18 北京欧链科技有限公司 基于区块链的交易处理方法及装置
CN108229943A (zh) * 2018-01-19 2018-06-29 阿里巴巴集团控股有限公司 区块链余额的调整方法及装置、电子设备
EP3346633A1 (en) * 2015-09-03 2018-07-11 Nippon Telegraph And Telephone Corporation Permission information management system, user terminal, proprietor terminal, permission information management method, and permission information management program
CN109242455A (zh) * 2018-08-21 2019-01-18 北京京东金融科技控股有限公司 基于区块链的数据处理方法、装置和设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017139688A1 (en) * 2016-02-12 2017-08-17 D+H Usa Corporation Peer-to-peer financial transactions using a private distributed ledger
US10402796B2 (en) * 2016-08-29 2019-09-03 Bank Of America Corporation Application life-cycle transition record recreation system
WO2018145024A1 (en) * 2017-02-03 2018-08-09 Terry Aronson System and method for asset backed crypto-currency
CN106952158A (zh) * 2017-03-17 2017-07-14 证通股份有限公司 解决热点账户问题的记账方法及设备
CN107563880A (zh) * 2017-07-17 2018-01-09 招商银行股份有限公司 清算方法、系统及计算机可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3346633A1 (en) * 2015-09-03 2018-07-11 Nippon Telegraph And Telephone Corporation Permission information management system, user terminal, proprietor terminal, permission information management method, and permission information management program
CN108053211A (zh) * 2017-12-27 2018-05-18 北京欧链科技有限公司 基于区块链的交易处理方法及装置
CN108229943A (zh) * 2018-01-19 2018-06-29 阿里巴巴集团控股有限公司 区块链余额的调整方法及装置、电子设备
CN109242455A (zh) * 2018-08-21 2019-01-18 北京京东金融科技控股有限公司 基于区块链的数据处理方法、装置和设备

Also Published As

Publication number Publication date
CN109242455A (zh) 2019-01-18

Similar Documents

Publication Publication Date Title
TWI728418B (zh) 使用智慧型合約執行多方交易的方法和系統
CN110442652B (zh) 一种基于区块链的跨链数据处理方法及装置
CN108985742B (zh) 交易处理方法、装置及区块链系统
CN111062044B (zh) 基于区块链的模型联合训练方法及装置
CN110162470B (zh) 一种区块链的测试方法和装置
TW201935383A (zh) 資產管理方法及裝置、電子設備
WO2020038291A1 (zh) 基于区块链的数据处理方法、装置和设备
CN110060161B (zh) 用于区块链交易防重的客户端服务实现方法及服务组件
US10924587B1 (en) Live migration for highly available data stores
CN107193672B (zh) 一种跨区块异步调用合约系统
CN113326165B (zh) 基于区块链的数据处理方法、设备及计算机可读存储介质
CN113409145B (zh) 一种跨区块链的交易同步方法和装置
GB2594018A (en) Method, system, and computer readable medium for transferring cryptographic tokens
CN110018884A (zh) 分布式事务处理方法、协调装置、数据库及电子设备
CN108347350A (zh) 一种通信方法及装置
CN109739684A (zh) 基于向量时钟的分布式键值数据库的副本修复方法与装置
CN110490742B (zh) 一种区块链中的交易执行方法及装置
CN109714249A (zh) 一种小程序消息的推送方法及相关装置
CN110738502A (zh) 一种票据处理方法、装置及存储介质装置
CN112261164B (zh) 一种逻辑时钟同步方法、装置及一种中心授时集群
CN110381150B (zh) 区块链上的数据处理方法、装置、电子设备及存储介质
US11736299B2 (en) Data access control for edge devices using a cryptographic hash
CN106557522A (zh) 一种用于提供定时功能的方法与设备
CN116029825B (zh) 区块链的交易方法、装置、系统、电子设备及存储介质
WO2023061329A1 (zh) 应用于计算机集群的通信方法及通信装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19851584

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19851584

Country of ref document: EP

Kind code of ref document: A1