WO2020082893A1 - 基于区块链的交易处理方法及装置、电子设备 - Google Patents

基于区块链的交易处理方法及装置、电子设备 Download PDF

Info

Publication number
WO2020082893A1
WO2020082893A1 PCT/CN2019/103238 CN2019103238W WO2020082893A1 WO 2020082893 A1 WO2020082893 A1 WO 2020082893A1 CN 2019103238 W CN2019103238 W CN 2019103238W WO 2020082893 A1 WO2020082893 A1 WO 2020082893A1
Authority
WO
WIPO (PCT)
Prior art keywords
nonce
transactions
transaction
available
records
Prior art date
Application number
PCT/CN2019/103238
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 阿里巴巴集团控股有限公司
Priority to EP19874820.4A priority Critical patent/EP3816910B1/en
Priority to SG11202100309PA priority patent/SG11202100309PA/en
Publication of WO2020082893A1 publication Critical patent/WO2020082893A1/zh
Priority to US17/160,203 priority patent/US11481765B2/en

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/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • 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
    • G06Q20/0658Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash e-cash managed locally
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3821Electronic credentials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/386Payment protocols; Details thereof using messaging services or messaging apps
    • 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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0637Modes of operation, e.g. cipher block chaining [CBC], electronic codebook [ECB] or Galois/counter mode [GCM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/56Financial cryptography, e.g. electronic payment or e-cash
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • One or more embodiments of this specification relate to the field of blockchain technology, and in particular, to a blockchain-based transaction processing method and device, and electronic equipment.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database. Because blockchain technology is decentralized, open and transparent, each computing device can participate in database records, and data synchronization can be quickly performed between computing devices, using blockchain technology to build a decentralized system, and Various execution programs are included in the distributed database of the blockchain for automatic execution, which has been widely used in many fields.
  • This specification proposes a blockchain-based transaction processing method, which is applied to the client.
  • the blockchain maintains a Nonce list corresponding to the user account; where the Nonce list includes multiple Nonce records;
  • the Nonce record includes the group identification and Nonce value; the method includes:
  • the multiple transactions that need to be executed concurrently include multiple transactions of the same transaction type.
  • Optional also includes:
  • the method further includes:
  • the Nonce record in the Nonce list maintained locally by the client is marked as available by default;
  • the method also includes:
  • the available Nonce is recorded in the Nonce list The record is marked as unavailable.
  • Optional also includes:
  • the Nonce value in the available Nonce record is monotonically increased based on a preset amplitude, and after the Nonce value is monotonically increased, the available Nonce record is re-marked as available in the Nonce list.
  • the client is a multi-threaded client; the number of Nonce records in the Nonce list indicates the transaction concurrency capability of the user account.
  • the Nonce record further includes: an index identifier of the Nonce record.
  • This specification also proposes a blockchain-based transaction processing method that is applied to node devices in the blockchain.
  • the blockchain maintains a set of Nonce lists; the set of Nonce lists includes Nonce lists corresponding to several user accounts ; Wherein, the Nonce list includes multiple Nonce records; the Nonce records include group identification and Nonce values; the method includes:
  • the group identifier in the available Nonce record added by the client for the multiple groups of transactions indicates the The execution order of multiple groups of transactions;
  • the method also includes:
  • the multiple groups of transactions are executed sequentially according to the execution order indicated by the group identifiers of the multiple groups of transactions.
  • Optional also includes:
  • the Nonce record further includes: an index identifier of the Nonce record.
  • This specification also proposes a blockchain-based transaction processing device, which is applied to the client and maintains a Nonce list corresponding to the user account in the blockchain; where the Nonce list includes multiple Nonce records;
  • the Nonce record includes a group identification and a Nonce value; the method includes:
  • the obtaining module obtains the available Nonce records with the same group identifier from the Nonce list for multiple transactions initiated by the user through the user account and requiring concurrent execution;
  • a publishing module which publishes the multiple transactions to the blockchain, so that the node device in the blockchain publishes the available Nonce records in the transactions published by the client and the Nonce records in the Nonce list Matching is performed, and when the available Nonce record matches any target Nonce record in the Nonce list, the transaction is accepted, and multiple transactions with the same group identifier in the accepted transactions are concurrently executed.
  • the multiple transactions that need to be executed concurrently include multiple transactions of the same transaction type.
  • the acquisition module further:
  • the acquisition module further:
  • the Nonce record in the Nonce list maintained locally by the client is marked as available by default;
  • the acquisition module :
  • the available Nonce is recorded in the Nonce list The record is marked as unavailable.
  • the acquisition module further:
  • the Nonce value in the available Nonce record is monotonically increased based on a preset amplitude, and after the Nonce value is monotonically increased, the available Nonce record is re-marked as available in the Nonce list.
  • the client is a multi-threaded client; the number of Nonce records in the Nonce list indicates the transaction concurrency capability of the user account.
  • the Nonce record further includes: an index identifier of the Nonce record.
  • This specification also proposes a blockchain-based transaction processing device that is applied to node devices in the blockchain.
  • the blockchain maintains a set of Nonce lists; the set of Nonce lists includes Nonce lists corresponding to several user accounts ; Wherein, the Nonce list includes multiple Nonce records; the Nonce records include group identification and Nonce values; the method includes:
  • the receiving module receives the transaction initiated by the user through the user account sent by the client; wherein the transaction is added with the available Nonce records obtained from the Nonce list maintained in the blockchain corresponding to the user account;
  • the matching module matches the available Nonce records in the received transaction with the Nonce records in the Nonce list maintained in the blockchain corresponding to the user account;
  • the execution module if the available Nonce record matches any target Nonce record in the Nonce list, accepts the transaction; and concurrently executes multiple transactions with the same group ID in the accepted transactions.
  • the group identifier in the available Nonce record added by the client for the multiple groups of transactions indicates the The execution order of multiple groups of transactions;
  • the execution module further:
  • the multiple groups of transactions are executed sequentially according to the execution order indicated by the group identifiers of the multiple groups of transactions.
  • execution module further:
  • the Nonce record further includes: an index identifier of the Nonce record.
  • This specification also proposes an electronic device, including:
  • Memory for storing machine executable instructions
  • the Nonce list corresponding to the user account maintained in the blockchain, for the multiple transactions initiated by the user through the user account that need to be executed concurrently, obtain the available Nonce records with the same group ID respectively; wherein, the Nonce list includes Multiple Nonce records; the Nonce records include group identification and Nonce value;
  • This specification also proposes an electronic device, including:
  • Memory for storing machine executable instructions
  • the Nonce list includes multiple Nonce records; the Nonce records include group identification and Nonce values;
  • the technical solution of the transaction concurrency capability of the single account on the client can be further improved on the basis of avoiding replay attacks against transactions.
  • FIG. 1 is a schematic diagram of a replay attack detection on a transaction provided by an exemplary embodiment.
  • FIG. 2 is a flowchart of a blockchain-based transaction processing method provided by an exemplary embodiment.
  • FIG. 3 is a schematic structural diagram of a set of Nonce lists maintained in a blockchain provided by an exemplary embodiment.
  • FIG. 4 is a schematic diagram of another replay attack detection on a transaction provided by an exemplary embodiment.
  • FIG. 5 is a schematic structural diagram of a Nonce list maintained by a client according to an exemplary embodiment.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an exemplary embodiment.
  • FIG. 7 is a block diagram of a blockchain-based transaction processing device provided by an exemplary embodiment.
  • FIG. 8 is a block diagram of another blockchain-based transaction processing apparatus provided by an exemplary embodiment.
  • the replay attack in the field of blockchain refers to an attack that causes the same transaction to be executed multiple times and causes losses to users by publishing repeated transactions in the blockchain;
  • the classic “double spending” problem in the Bitcoin network is a typical replay attack.
  • the illegal node can initiate a replay attack based on the intercepted transaction after the transaction is completed. Repeated release and execution of the transaction resulted in a transfer transaction being executed multiple times, which in turn caused capital losses to the user.
  • a densely increasing Nonce value (a densely increasing integer) can be carried in the transaction to deal with the risk of replay attacks against the transaction;
  • FIG. 1 is a schematic diagram of replay attack detection on a transaction shown in this specification.
  • each transaction initiated by the user through the personal user account on the client can specify a Nonce value, and use the private key held by the user to perform the transaction on the transaction body and the specified Nonce value.
  • signature is the overall signature of [transaction body, Nonce value], which can ensure that the Nonce in the transaction cannot be tampered with.
  • the client can publish the transaction on the blockchain.
  • the node device in the blockchain needs to verify whether the signature of the transaction is legal, but also to check whether the Nonce value in the transaction is the same as the latest transaction that has been successfully accepted before.
  • the Nonce value in the transaction maintains a strict and dense increase; if the transaction keeps the dense increase in the Nonce value in the latest transaction that has been successfully accepted, the transaction can be accepted; otherwise, the comparison transaction can be deemed to be an illegal transaction .
  • the blockchain system will maintain the Nonce status of the user's personal user account.
  • the blockchain system will automatically increase the Nonce value of the user account by 1; the nodes in the blockchain
  • the device compares the Nonce value in the transaction with the Nonce value in the maintained Nonce state to determine whether the Nonce value in the transaction has been successfully accepted
  • the Nonce value in the latest transaction of is strictly incremented by 1; if it is, the transaction can be accepted.
  • a Nonce list set can be maintained in the blockchain, and the Nonce list set can include Nonce lists corresponding to several user accounts; and the above Nonce list can include several Nonce records; each The Nonce record is composed of the packet identification and Nonce value.
  • the client can obtain the available Nonce records with the same group ID for the multiple transactions from the above Nonce list, and the obtained available The Nonce record is added to the above multiple transactions, and then the multiple transactions of this item are posted to the blockchain.
  • the node device in the blockchain can perform the available Nonce record carried in the transaction with the Nonce record in the above Nonce list maintained in the blockchain corresponding to the user account Match, to perform replay attack detection on the transaction; if the above available Nonce record matches any target Nonce record in the Nonce list, the replay attack detection for the transaction passes, and the node device can accept the transaction ;
  • the node device can reconfirm whether there are multiple transactions with the same group identifier in the Nonce record carried in all accepted transactions; if it is, it indicates that the multiple transactions need to be executed concurrently, and the node device can be concurrent Execute the multiple transactions with the same group ID among the accepted transactions.
  • the technical solution of triggering the node devices in the blockchain to execute multiple transactions with the same group ID concurrently by adding the same group ID to multiple transactions is conducted with the detection of replay attacks against the transaction The combination can further improve the transaction concurrency capability of the single account on the client while avoiding replay attacks against the transaction.
  • FIG. 2 is a blockchain-based transaction processing method provided by an embodiment of the present specification
  • Step 202 From the Nonce list corresponding to the user account maintained in the blockchain, the client obtains the available Nonce records with the same group ID for multiple transactions initiated by the user through the user account and requiring concurrent execution; wherein, The Nonce list includes multiple Nonce records; the Nonce records include group identification and Nonce values;
  • Step 204 The client adds the obtained available nonce records to the multiple transactions, and publishes the multiple transactions to the blockchain;
  • Step 206 the node device in the blockchain matches the available Nonce record in the received transaction with the Nonce record in the Nonce list maintained in the blockchain corresponding to the user account; if the available The Nonce record matches any target Nonce record in the Nonce list and accepts the transaction; and concurrently executes multiple transactions with the same group identifier in the accepted transactions.
  • the blockchain described in this specification may specifically include private chains, shared chains, and alliance chains, etc., and is not particularly limited in this specification.
  • the above-mentioned blockchain may specifically be a consortium chain consisting of a server of a third-party payment platform, a domestic bank server, an overseas bank server, and several user node devices as member devices.
  • the operator of the alliance chain can rely on the alliance chain to deploy online services such as cross-border transfer and asset transfer based on the alliance chain.
  • Transaction refers to a piece of data that a user creates through a client of the blockchain and needs to be finally released to the distributed database of the blockchain.
  • a narrowly defined transaction refers to a value transfer issued by the user to the blockchain; for example, in the traditional Bitcoin blockchain network, the transaction can be a transfer initiated by the user in the blockchain.
  • the generalized transaction refers to a piece of business data with business intent that users release to the blockchain; for example, the operator can build an alliance chain based on actual business needs, relying on the alliance chain to deploy some other types that have nothing to do with value transfer Online services (for example, anti-counterfeiting verification services, rental services, vehicle scheduling services, insurance claims services, credit services, medical services, etc.), and in this type of alliance chain, transactions can be a sum of money posted by users in the alliance chain Business messages or business requests with business intent.
  • the client can be a multi-threaded client; that is, the client can enable multiple threads at the same time, and each thread can run independently, so that the user can call multiple threads of the client through personal To initiate multiple transactions at the same time.
  • the client When the client receives multiple transactions initiated by the user through the user account, it can determine whether there are multiple transactions that need to be executed concurrently among the transactions initiated by the user through the user account;
  • multiple transactions that need to be executed concurrently can include any type, there is no strict transaction execution order between transactions, and transactions that can be processed and executed concurrently;
  • multiple transactions that need to be executed concurrently can be designated by the user during the process of initiating the transaction through the user account;
  • the user can manually specify multiple transactions that need to be executed concurrently based on the requirements through the user interface provided by the client.
  • multiple transactions that need to be executed concurrently can also be dynamically confirmed by the client based on preset concurrent processing rules.
  • the above concurrent execution rule may be a rule of "concurrent execution for transactions of the same transaction type"
  • the client can further check the specific transaction types of these transactions; then, determine multiple transactions of the same transaction type as transactions that need to be executed concurrently; for example, if The types of transactions supported by the blockchain include the types of transactions used to create accounts, the types of transactions used to transfer funds, and the client can determine the types of transactions used to create accounts among the many transactions initiated by users, and The transaction type of the transfer, and then determine the multiple transactions corresponding to these two types of transactions as transactions that need to be executed concurrently.
  • concurrent processing rules can be other than the "concurrent execution for transactions of the same transaction type", or other forms of concurrent processing rules, which will not be enumerated in this specification. .
  • a Nonce list set may be maintained in the blockchain, and the Nonce list set may include Nonce lists corresponding to several user accounts.
  • each can include multiple Nonce records.
  • Each Nonce record can include auxiliary parameters and Nonce values.
  • the Nonce record may specifically be a composite structure composed of multiple fields including Nonce values.
  • the operator of the above-mentioned blockchain can pre-allocate the available Nonce value for each user account, and on the basis of the allocated available Nonce value, set the corresponding auxiliary field for each Nonce value, and then based on Each available Nonce value and corresponding auxiliary field to construct multiple Nonce records;
  • a Nonce list can be constructed for the user account based on the generated Nonce records; finally, the above Nonce list collection can be created based on the Nonce list constructed for each user account, and the above Nonce list collection can be published to the above blockchain,
  • the consensus processing is performed by the node devices in the above-mentioned blockchain, and after the consensus is passed, the above-mentioned Nonce list set is stored in the distributed data of the above-mentioned blockchain for storage and maintenance.
  • the specific parameter content of the above auxiliary parameters is not particularly limited in this specification; in practical applications, the above auxiliary parameters may specifically include the above-mentioned blockchain operators based on actual needs, in the user Any form of parameters extended based on the Nonce value available for the account; or a combination of parameters.
  • auxiliary parameters may not be fixed; any kind of parameters can be extended as auxiliary parameters based on the Nonce value; or based on the Nonce value
  • any kind of parameters can be extended as auxiliary parameters based on the Nonce value; or based on the Nonce value
  • a variety of parameters have been extended to be combined as auxiliary parameters.
  • the auxiliary parameters in the Nonce record in the above Nonce list may specifically include a group identifier; where the group identifier is specifically used to indicate the group where the exchange is located, and the transactions belonging to the same group are transactions that need to be executed concurrently ;
  • the Nonce list corresponding to each user account in the above Nonce list collection can include multiple Nonce records with the same group identification, so that when a user initiates multiple multiple concurrent executions through an individual user account In the case of a transaction, the client can obtain the Nonce record with the same group identifier for the multiple transactions from the Nonce list.
  • the auxiliary parameter in the Nonce record in the Nonce list may include the index identifier (such as an index number) of the Nonce record in addition to the group identifier.
  • the above-mentioned index mark is specifically used to indicate the order and position where Nonce is recorded in the Nonce list.
  • the Nonce record may specifically be a Group ID (group identification) , Index (index mark), Value (Nonce value) and other fields composed of composite structure.
  • group identification group identification
  • Index index mark
  • Value once value
  • the set of Nonce lists maintained in the blockchain can be expressed as shown in Figure 3.
  • the Nonce record and the Nonce value in the Nonce record and the specific byte length of the auxiliary parameter are not particularly limited in this specification; in practical applications, it can be based on the actual needs of the operator of the blockchain , To make flexible settings (for example, the operator can control the specific value range of the Nonce value and auxiliary parameters through the occupied byte length);
  • the above Nonce record may specifically be a 16-byte composite structure; where 4 bytes represent Group ID (group identification), 4 bytes represent Index (index identification), 8 bytes Value (Nonce value).
  • the client can correspond to the user account maintained from the blockchain In the above Nonce list, the available Nonce records with the same group ID are obtained for the multiple transactions (that is, the same group ID is added for multiple transactions).
  • the Nonce list includes multiple Nonce records
  • the multi-threads started by the client can obtain available Nonce records from the Nonce list for the initiated transaction, and then the user can use a personal user account to initiate multiple simultaneous through the client Pen transaction; therefore, in this specification, the number of Nonce records in the above Nonce list can actually be used to indicate the transaction concurrency capability of the user's personal user account.
  • the above Nonce list includes 4 Nonce records, then the user can initiate 4 transactions at the same time through the user account.
  • the operator of the blockchain can flexibly specify the number of Nonce records included in the above Nonce list based on the performance of the client itself; or, the client can submit to the blockchain system Actively report its own performance, and the operator of the blockchain can flexibly specify the number of Nonce records included in the above Nonce list;
  • the client can “download” the above Nonce list maintained on the blockchain to the local for maintenance in the initialization stage;
  • an initialization operation is required to pass.
  • the client when the client is up and running, or when the connection between the node device in the blockchain is disconnected and the connection needs to be reconnected, an initialization operation is required to pass.
  • an initialization instruction such as a startup instruction, a reconnect instruction, etc.
  • the client can respond to the initialization instruction and establish a connection with the node device in the blockchain.
  • the distributed database of the blockchain is accessed to obtain the above Nonce list maintained in the blockchain, and then the obtained Nonce list can be stored and maintained locally.
  • the client when the client needs to obtain the available Nonce records with the same group ID for the multiple transactions, the client can directly obtain the available Nonce records from the above-mentioned Nonce list maintained locally.
  • the client can further confirm the execution order of the multiple groups of transactions at this time;
  • the execution sequence of the multiple sets of transactions can be manually defined by the user, or can be dynamically confirmed by the client based on the actual business process, and is not specifically limited in this specification.
  • the client determines the execution order of the multiple sets of transactions, in addition to adding the same grouping identifier to the multiple transactions included in the multiple sets of transactions, it is also necessary to ensure that the multiple transactions included in the multiple sets of transactions
  • the group identifier added by the transaction can indicate the execution order of the multiple groups of transactions
  • the above Nonce list needs to include multiple groups of Nonce records with the same group ID and different group IDs of different transaction groups; that is, the group IDs of transactions in the same transaction group remain the same , And the transaction group identifiers in different transaction groups must maintain a certain difference in value; thus, to ensure that the group identifiers can be obtained from the above Nonce list for the transactions in the above multiple group transactions, and the group identifier Available Nonce records indicating the execution order of the multiple sets of transactions.
  • the group identifier is used to indicate the execution order of multiple groups of transactions, which can be specifically achieved by adding a group identifier that keeps monotonically increasing in value to the multiple groups of transactions;
  • the client can Obtain an available Nonce record containing the same group ID 1 for transactions A1, B1, C1 from the above Nonce list, and obtain an available Nonce record containing the same group ID 2 for transactions A2, B2, C2.
  • the client can record the Nonce in the Nonce list by adding a mark indicating “available” by default.
  • a 1-byte Available field can be extended for the Nonce record in the Nonce list; where, When the value of the Available field is T, it indicates that the Nonce record is "available"; when the value of the Available field is F, it indicates that the Nonce record is "unavailable”.
  • the mark carried by the available Nonce record can be modified and updated as The available Nonce record re-adds a mark indicating "unavailable" to mark the available Nonce record as unavailable.
  • the client obtains the available Nonce records for multiple transactions initiated by the user and requiring concurrent execution, the obtained available Nonce records can be added to the above multiple transactions;
  • the client can package the transaction body of the transaction and the above available Nonce record, and then prompt the user to package the [transaction Body, Nonce record] to sign the whole, so as to ensure that the Nonce record in the transaction cannot be tampered with.
  • the client can post the above multiple transactions to the blockchain;
  • the node device in the blockchain When the node device in the blockchain receives the transaction issued by the client, it can first initiate the consensus processing for the received transaction in the consensus algorithm adopted in the blockchain;
  • the node device in the above-mentioned blockchain can further initiate the legality detection of the received transaction.
  • the legality detection for the transaction may include at least, the legality detection for the signature carried by the transaction, and the replay attack detection for the transaction.
  • the node device in the blockchain can first verify the signature of the received transaction based on the public key corresponding to the private key held by the user; if the signature of the transaction fails, the transaction can be deemed illegal For the transaction, the above node device can directly return a prompt message of failed transaction execution to the user through the client.
  • the above node device can further re-target the transaction based on the available Nonce record carried in the target transaction and the Nonce list maintained in the blockchain corresponding to the user's personal user account Attack detection.
  • the above node device can match the Nonce records carried in the transaction one by one from the Nonce records in the Nonce list maintained on the blockchain corresponding to the user account; if the Nonce carried in the transaction The record, which matches any target Nonce record in the above Nonce list, can determine that the transaction passed the replay attack detection; in this case, the node device can accept the transaction.
  • the node device can monotonically increase the Nonce value in the target Nonce record based on the preset amplitude; where the preset amplitude can be customized based on actual needs;
  • the preset width may still be 1, and the node device may increase the Nonce value in the target Nonce record matched in the Nonce list by 1 after the transaction is accepted.
  • the notification message that the transaction is accepted can be returned to the client; and after the client publishes the transaction initiated by the user through the individual user account to the blockchain , You can determine whether the notification message that the transaction returned by the node device is accepted is received.
  • the Nonce value in the available Nonce record obtained for the initiated transaction from the Nonce list maintained locally by the client based on the preset amplitude; for example, the Nonce in the available Nonce record
  • the value is also incremented by 1 to keep the content synchronized with the above Nonce list maintained in the blockchain.
  • the Available field of the available Nonce record can be Is set to "T".
  • the node device in the blockchain at this time can further determine whether there are multiple group IDs in the accepted transactions sent by the client Transaction
  • the node device in the blockchain can execute the multiple transactions concurrently, and after the execution of the multiple transactions, the multiple transactions and The execution results of the multiple transactions are stored in the distributed database of the blockchain.
  • the node device in the blockchain receives the transaction sent by the client with the group identifier added, and determines that there are group identifiers of multiple transactions included in the transaction sent by the client After the same multiple transactions, the multiple groups of transactions can be executed sequentially according to the transaction sequence indicated by the transaction identifiers of the multiple transactions.
  • the client is the transaction A1, B1 , C1 adds an available Nonce record containing the same group ID 1, and adds an available Nonce record containing the same group ID 2 to transactions A2, B2, and C2 as an example; in this case, the The node device, after the above transactions A1, B1, C1, A2, B2, and C2 are all accepted, will execute the transactions A1, B1, C1 in the transaction group with the group ID of 1 concurrently, and then execute the group A Transactions A2, B2, C2 in the transaction group.
  • the technical scheme of triggering the node devices in the blockchain to execute multiple transactions with the same group identifier concurrently by adding the same group identifier to multiple transactions is combined with the detection of transaction replay attacks , On the basis of avoiding replay attacks against transactions, the transaction concurrency ability of the single account on the client can be further improved.
  • this specification also provides an embodiment of a blockchain-based transaction processing device.
  • the embodiments of the blockchain-based transaction processing apparatus of this specification can be applied to electronic devices.
  • the device embodiments may be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory through the processor of the electronic device where it is located.
  • this is a hardware structure diagram of the electronic equipment where the blockchain-based transaction processing device is located, except for the processor, memory, network interface, and non-
  • the electronic device in which the device is located in the embodiment usually may include other hardware according to the actual function of the electronic device, which will not be repeated here.
  • Fig. 7 is a block diagram of a blockchain-based transaction processing device shown in an exemplary embodiment of this specification.
  • the blockchain-based transaction processing device 70 can be applied to the aforementioned electronic device shown in FIG. 6, including: an acquisition module 701, an addition module 702 and a release module 703.
  • the obtaining module 701 obtains from the Nonce list maintained in the blockchain corresponding to the user account for multiple transactions initiated by the user account through the user account that need to be executed concurrently, respectively obtaining available Nonce records with the same group ID;
  • the Nonce list includes multiple Nonce records; the Nonce records include group identification and Nonce values;
  • the adding module 702 adds the obtained available Nonce records to the multiple transactions respectively;
  • the publishing module 703 publishes the multiple transactions to the blockchain, so that the node device in the blockchain can record the available nonces in the transactions published by the client and the nonces in the nonce list The records are matched, and when the available Nonce record matches any target Nonce record in the Nonce list, the transaction is accepted, and multiple transactions with the same group identifier in the accepted transactions are concurrently executed.
  • the multiple transactions that need to be executed concurrently include multiple transactions of the same transaction type.
  • the acquisition module 701 further:
  • the acquisition module 701 further:
  • the Nonce record in the Nonce list maintained locally by the client is marked as available by default;
  • the obtaining module 701 The obtaining module 701:
  • the available Nonce is recorded in the Nonce list The record is marked as unavailable.
  • the acquisition module 701 further:
  • the Nonce value in the available Nonce record is monotonically increased based on a preset amplitude, and after the Nonce value is monotonically increased, the available Nonce record is re-marked as available in the Nonce list.
  • the client is a multi-threaded client; the number of Nonce records in the Nonce list indicates the transaction concurrency capability of the user account.
  • the Nonce record further includes: an index identifier of the Nonce record.
  • FIG. 8 is a block diagram of another blockchain-based transaction processing device shown in an exemplary embodiment of this specification.
  • the blockchain-based transaction processing device 80 can also be applied to the aforementioned electronic device shown in FIG. 6, including: a receiving module 801, a second determining module 802 and an executing module 803.
  • the receiving module 801 receives the transaction initiated by the user through the user account sent by the client; wherein, the transaction is added with the available Nonce records obtained from the Nonce list corresponding to the user account maintained in the blockchain ;
  • the Nonce list includes multiple Nonce records;
  • the Nonce record includes a group identification and Nonce value;
  • the matching module 802 matches the available Nonce record in the received transaction with the Nonce record in the Nonce list maintained in the blockchain corresponding to the user account;
  • the execution module 803 if the available Nonce record matches any target Nonce record in the Nonce list, accepts the transaction; and concurrently executes multiple transactions with the same group identifier in the accepted transactions.
  • the execution module 803 further:
  • the multiple groups of transactions are executed sequentially according to the execution order indicated by the group identifiers of the multiple groups of transactions.
  • the execution module 803 further:
  • the Nonce record further includes: an index identifier of the Nonce record.
  • the relevant parts can be referred to the description of the method embodiments.
  • the device embodiments described above are only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, may be located in One place, or it can be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solution in this specification. Those of ordinary skill in the art can understand and implement without paying creative labor.
  • the system, device, module or module explained in the above embodiments may be implemented by a computer chip or entity, or by a product with a certain function.
  • a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.
  • the electronic device includes: a processor and a memory for storing machine-executable instructions; wherein the processor and the memory are usually connected to each other through an internal bus.
  • the device may also include an external interface to be able to communicate with other devices or components.
  • the Nonce list corresponding to the user account maintained in the blockchain, for the multiple transactions initiated by the user through the user account that need to be executed concurrently, obtain the available Nonce records with the same group ID respectively; wherein, the Nonce list includes Multiple Nonce records; the Nonce records include group identification and Nonce value;
  • the Nonce record in the Nonce list maintained locally by the client is marked as available by default;
  • the available Nonce is recorded in the Nonce list The record is marked as unavailable.
  • the Nonce value in the available Nonce record is monotonically increased based on a preset amplitude, and after the Nonce value is monotonically increased, the available Nonce record is re-marked as available in the Nonce list.
  • the electronic device includes: a processor and a memory for storing machine-executable instructions; wherein the processor and the memory are usually connected to each other through an internal bus.
  • the device may also include an external interface to be able to communicate with other devices or components.
  • the Nonce list includes multiple Nonce records; the Nonce records include group identification and Nonce values;
  • the multiple groups of transactions are executed sequentially according to the execution order indicated by the group identifiers of the multiple groups of transactions.

Landscapes

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

Abstract

公开一种基于区块链的交易处理方法,所述区块链中维护了与所述用户账户对应的Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可Nonce记录;将获取到的可用Nonce记录分别添加至所述多笔交易;将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。

Description

基于区块链的交易处理方法及装置、电子设备 技术领域
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种基于区块链的交易处理方法及装置、电子设备。
背景技术
区块链技术,也被称之为分布式账本技术,是一种由若干台计算设备共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,利用区块链技术来搭建去中心化系统,并在区块链的分布式数据库中收录各种执行程序进行自动执行,已在众多的领域中广泛的进行应用。
发明内容
本说明书提出一种基于区块链的交易处理方法,应用于客户端,所述区块链中维护了与所述用户账户对应的Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:
从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录;
将获取到的可用Nonce记录分别添加至所述多笔交易;
将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。
可选的,所述需要并发执行的多笔交易,包括交易类型相同的多笔交易。
可选的,还包括:
如果用户通过用户账户发起的交易中存在所包含的多笔交易需要并发执行的多组交 易,确定所述多组交易的执行顺序;
从所述Nonce列表中为所述多组交易分别获取分组标识相同,并且所述分组标识指示所述多组交易的执行顺序的可用Nonce记录。
可选的,从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之前,还包括:
响应于针对所述客户端的初始化指令,获取所述区块链中维护的所述Nonce列表,并将获取到的所述Nonce列表在所述客户端本地进行维护;
从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录,包括:
从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录。
可选的,所述客户端本地维护的所述Nonce列表中的Nonce记录默认被标记为可用;
所述方法还包括:
从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之后,在所述Nonce列表中将所述可用Nonce记录标记为不可用。
可选的,还包括:
确定是否接收到所述节点设备返回的所述交易被受理的通知消息;
如果是,基于预设幅度对所述可用Nonce记录中的Nonce值进行单调递增,并在所述Nonce值单调递增之后,在所述Nonce列表中将所述可用Nonce记录重新标记为可用。
可选的,所述客户端为多线程客户端;所述Nonce列表中的Nonce记录的数量,指示所述用户账户的交易并发能力。
可选的,所述Nonce记录还包括:所述Nonce记录的索引标识。
本说明书还提出一种基于区块链的交易处理方法,应用于区块链中的节点设备,所述区块链维护了Nonce列表集合;所述Nonce列表集合包括与若干用户账户对应的Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:
接收客户端发送的用户通过用户账户发起的交易;其中,所述交易被添加了从所述区块链中维护的与所述用户账户对应的Nonce列表中获取到的可用Nonce记录;
将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;
如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
可选的,所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易;所述客户端为所述多组交易添加的可用Nonce记录中的分组标识指示所述多组交易的执行顺序;
所述方法还包括:
如果所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易,按照所述多组交易的分组标识所指示的执行顺序,顺序执行所述多组交易。
可选的,还包括:
如果所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配,基于预设幅度对所述目标Nonce记录的Nonce值进行单调递增;以及,
向所述客户端返回所述交易被受理的通知消息。
可选的,所述Nonce记录还包括:所述Nonce记录的索引标识。
本说明书还提出一种基于区块链的交易处理装置,应用于客户端,所述区块链中维护了与所述用户账户对应的Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:
获取模块,从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录;
添加模块,将获取到的可用Nonce记录分别添加至所述多笔交易;
发布模块,将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。
可选的,所述需要并发执行的多笔交易,包括交易类型相同的多笔交易。
可选的,所述获取模块进一步:
如果用户通过用户账户发起的交易中存在所包含的多笔交易需要并发执行的多组交易,确定所述多组交易的执行顺序;
从所述Nonce列表中为所述多组交易分别获取分组标识相同,并且所述分组标识指示所述多组交易的执行顺序的可用Nonce记录。
可选的,所述获取模块进一步:
在从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之前,响应于针对所述客户端的初始化指令,获取所述区块链中维护的所述Nonce列表,并将获取到的所述Nonce列表在所述客户端本地进行维护;
从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录。
可选的,所述客户端本地维护的所述Nonce列表中的Nonce记录默认被标记为可用;
所述获取模块:
从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之后,在所述Nonce列表中将所述可用Nonce记录标记为不可用。
可选的,所述获取模块进一步:
确定是否接收到所述节点设备返回的所述交易被受理的通知消息;
如果是,基于预设幅度对所述可用Nonce记录中的Nonce值进行单调递增,并在所述Nonce值单调递增之后,在所述Nonce列表中将所述可用Nonce记录重新标记为可用。
可选的,所述客户端为多线程客户端;所述Nonce列表中的Nonce记录的数量,指示所述用户账户的交易并发能力。
可选的,所述Nonce记录还包括:所述Nonce记录的索引标识。
本说明书还提出一种基于区块链的交易处理装置,应用于区块链中的节点设备,所述区块链维护了Nonce列表集合;所述Nonce列表集合包括与若干用户账户对应的 Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:
接收模块,接收客户端发送的用户通过用户账户发起的交易;其中,所述交易被添加了从所述区块链中维护的与所述用户账户对应的Nonce列表中获取到的可用Nonce记录;
匹配模块,将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;
执行模块,如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
可选的,所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易;所述客户端为所述多组交易添加的可用Nonce记录中的分组标识指示所述多组交易的执行顺序;
所述执行模块进一步:
如果所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易,按照所述多组交易的分组标识所指示的执行顺序,顺序执行所述多组交易。
可选的,所述执行模块进一步:
如果所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配,基于预设幅度对所述目标Nonce记录的Nonce值进行单调递增;以及,
向所述客户端返回所述交易被受理的通知消息。
可选的,所述Nonce记录还包括:所述Nonce记录的索引标识。
本说明书还提出一种电子设备,包括:
处理器;
用于存储机器可执行指令的存储器;
其中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
从区块链中维护的与用户账户对应的Nonce列表中,为用户通过所述用户账户发起的需要并发执行的多笔交易,分别获取分组标识相同的可用Nonce记录;其中,所述 Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
将获取到的可用Nonce记录分别添加至所述多笔交易;
将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。
本说明书还提出一种电子设备,包括:
处理器;
用于存储机器可执行指令的存储器;
其中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
接收客户端发送的用户通过用户账户发起的交易;其中,所述交易被添加了从所述区块链中维护的与所述用户账户对应的Nonce列表中获取到的可用Nonce记录;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;
如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
通过以上实施例,可以在避免针对交易的重放攻击的基础上,来进一步提升客户端上的单账户的交易并发能力的技术方案。
附图说明
图1是一示例性实施例提供的一种对交易进行重放攻击检测的示意图。
图2是一示例性实施例提供的一种基于区块链的交易处理方法的流程图。
图3是一示例性实施例提供的一种在区块链中维护的Nonce列表集合的结构示意图。
图4是一示例性实施例提供的另一种对交易进行重放攻击检测的示意图。
图5是一示例性实施例提供的一种客户端维护的Nonce列表的结构示意图。
图6是一示例性实施例提供的一种电子设备的结构示意图。
图7是一示例性实施例提供的一种基于区块链的交易处理装置的框图。
图8是一示例性实施例提供的另一种基于区块链的交易处理装置的框图。
具体实施方式
区块链领域的重放攻击,是指通过在区块链中发布重复的交易,进而导致一笔相同的交易被执行多次,对用户造成损失的攻击行为;
例如,比特币网络中经典的“双花”(double spending)问题,就是一种较为典型的重放攻击行为。一笔转账交易在经过用户私钥的签名许可后,如果被非法节点截获,那么该非法节点可以在该笔交易执行完毕后,基于截获的该笔交易,发起重放攻击,在区块链中重复发布并执行该笔交易,造成一笔转账交易被执行多次,进而对用户造成资金损失。
在示出的一种实施方式中,通常可以在交易中携带一个致密递增的Nonce值(致密递增的整数)的方式,来应对针对该笔交易的重放攻击风险;
请参见图1,图1为本说明书示出的一种对交易进行重放攻击检测的示意图。
如图1所示,用户在客户端上通过个人的用户账户发起的每笔交易,都可以指定一个Nonce值,并使用用户持有的私钥对该笔交易的交易体和指定的Nonce值进行签名。其中,签名是对[交易体,Nonce值]的整体签名,这样可以保障该笔交易中的Nonce无法被篡改。
当签名完成后,客户端可以将该笔交易在区块链中进行发布。而区块链中的节点设备,在收到该笔交易后,除了需要验证该笔交易的签名是否合法以外,还需要检测该笔交易中的Nonce值,是否与之前已经成功受理的最近一笔交易中的Nonce值保持严格的致密递增;如果该笔交易与已经成功受理的最近一笔交易中的Nonce值保持致密递增,则可以受理该笔交易;反之,可以认定该比较交易为非法的交易。
例如,假设用户在客户端上通过个人的用户账户Account1发起了一笔Nonce值为1的交易,该笔交易在被区块链成功受理后,用户在客户端上通过Account1再次发起交易的时候,必须将该交易中的Nonce值指定为2,才会被区块链中的节点设备认定为一笔合法的交易进行受理。
相应的,区块链系统会维护用户个人的用户账户的Nonce状态,每成功受理Account1发起的一笔交易,区块链系统会将该用户账户的Nonce值自增1;区块链中的节点设备在收到客户端发布的一笔交易后,会将该笔交易中的Nonce值,与维护的Nonce状态中的Nonce值进行比较,来判断该笔交易中的Nonce值,是否与已经成功受理的最近一笔交易中的Nonce值严格递增1;如果是,则可以受理该笔交易。
通过以上方式,虽然在某种程度上可以避免交易的重放攻击风险,但对于用户账户而言,需要在前一笔交易被受理后,才可以继续发起下一笔交易,因此单账户的交易并发能力不足,无法在高并发的场景下进行应用。
基于此,在本说明书中,在以上示出的重放攻击防护方案的基础上,提出一种能够提升客户端上单账户的交易并发能力的技术方案。
在实现时,可以在区块链中维护一个Nonce列表集合,在该Nonce列表集合中,可以包括与若干用户账户对应的Nonce列表;而在上述Nonce列表中,可以包括若干条Nonce记录;每一条Nonce记录由分组标识和Nonce值构成。
当用户在客户端上通过个人的用户账户发起需要并发执行的多笔交易后,客户端可以从上述Nonce列表为该多笔交易,分别获取分组标识相同的可用Nonce记录,并将获取到的可用Nonce记录添加至上述多笔交易,然后再将该目多笔交易发布至区块链。
而区块链中的节点设备在收到客户端发送的交易之后,可以将该交易中携带的可用Nonce记录,与区块链中维护的与该用户账户对应的上述Nonce列表中的Nonce记录进行匹配,来对该交易进行重放攻击检测;如果上述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,针对该交易的重放攻击检测通过,此时节点设备可以受理该交易;
进一步的,节点设备可以再次确认所有已经受理的交易中,是否存在所携带的Nonce记录中的分组标识相同的多笔交易;如果是,表明该多笔交易需要并发执行,此时节点设备可以并发执行已受理的交易中具有相同分组标识的该多笔交易。在以上实施例中,通过将为多笔交易添加相同的分组标识,来触发区块链中的节点设备并发执行具有相同分组标识的多笔交易的技术方案,与针对交易的重放攻击检测进行结合,可以在避免针对交易的重放攻击的基础上,来进一步提升客户端上的单账户的交易并发能力。
下面通过具体实施例并结合具体的应用场景对本说明书进行描述。
请参考图2,图2是本说明书一实施例提供的一种基于区块链的交易处理方法; 所述方法执行以下步骤:
步骤202,客户端从区块链中维护的与用户账户对应的Nonce列表中,为用户通过所述用户账户发起的需要并发执行的多笔交易,分别获取分组标识相同的可用Nonce记录;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
步骤204,客户端将获取到的可用Nonce记录分别添加至所述多笔交易,并将所述多笔交易发布至所述区块链;
步骤206,区块链中的节点设备将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
在本说明书所描述的区块链,具体可以包括私有链、共有链以及联盟链等,在本说明书中不进行特别限定。
例如,在一个场景中,上述区块链具体可以是由第三方支付平台的服务器、境内银行服务器、境外银行服务器、以及若干用户节点设备作为成员设备组成的一个联盟链。该联盟链的运营方可以依托于该联盟链,来在线部署诸如基于联盟链的跨境转账、资产转移等在线业务。
其中,需要说明的是,在本说明书中所描述的交易(Transaction),是指用户通过区块链的客户端创建,并需要最终发布至区块链的分布式数据库中的一笔数据。
区块链中的交易,通常存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔具有业务意图的业务数据;例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些与价值转移无关的其它类型的在线业务(比如,防伪校验业务、租房业务、车辆调度业务、保险理赔业务、信用服务、医疗服务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求。
在本说明书中,上述客户端具体可以是一个多线程客户端;也即,客户端可以同时启用多个线程,每一个线程都可以独立运行,从而用户可以通过调用客户端的多个线程,通过个人的用户账户来同时发起多笔交易。
当客户端收到用户通过用户账户发起的多笔交易后,可以确定用户通过用户账户发起的交易中,是否存在需要并发执行的多笔交易;
其中,在本说明书中,需要并发执行的多笔交易,可以包括任意类型的,交易之间并不存在严格的交易执行顺序,能够进行并发处理和执行的交易;
例如,如果一笔交易的执行,需要将另一笔交易的执行结果作为输入,那么这两笔交易,将无法进行并发处理和执行;反之,如果两笔交易之间,并没有以上所描述的这种数据依赖关系,那么就可以进行并发处理和执行。
在实现时,需要并发执行的多笔交易,可以由用户在通过用户账户发起交易的过程中,来人为指定;
例如,在示出的一种实施方式中,用户在发起了众多笔交易后,可以通过客户端提供的用户界面来基于需求人工指定,需要并发执行的多笔交易。
在实际应用中,需要并发执行的多笔交易,也可以由客户端基于预设的并发处理规则,来进行动态确认。
其中,上述并发处理规则的具体内容,在本说明书中不进行特别限定,在实际应用中,本领域技术人员可以基于实际的并发处理需求,来灵活的定义;
例如,在示出的一种实施方式中,上述并发执行规则,可以是“针对交易类型相同的交易进行并发执行”的规则;
在这种情况下,客户端在收到用户发起的众多交易后,可以进一步检查这些交易的具体交易类型;然后,将交易类型相同的多笔交易,确定为需要并发执行的交易;比如,如果区块链所支持的交易类型,包括用于创建账户的交易类型、用于转账的交易类型,则客户端可以确定出用户所发起的众多交易中,用于创建账户的交易类型、和用于转账的交易类型,然后将与这两类交易类型对应的多笔交易,确定为需要并发执行的交易。
当然,在实际应用中,上述并发处理规则,除了可以是“针对交易类型相同的交易进行并发执行”的规则以外,也可以是其它形式的并发处理规则,在本说明书中不再进行一一列举。
在本说明书中,可以在区块链中维护一个Nonce列表集合,在该Nonce列表集合中,可以包括与若干用户账户对应的Nonce列表。在上述Nonce列表中,均可以包括 多条Nonce记录。而每一条Nonce记录可以包括辅助参数和Nonce值。
也即,在本说明书中,上述Nonce记录具体可以是一条由包含Nonce值在内的多个字段构成的复合结构。
在实现时,上述区块链的运营方,可以预先为每一个用户账户分配可用的Nonce值,并在分配的可用的Nonce值的基础上,为每一个Nonce值设置对应的辅助字段,再基于每一个可用的Nonce值和对应的辅助字段,来构造出多条Nonce记录;
然后,可以基于生成的多条Nonce记录为该用户账户构造Nonce列表;最后,可以基于为各个用户账户构造的Nonce列表,创建上述Nonce列表集合,并将上述Nonce列表集合发布至上述区块链,由上述区块链中的节点设备进行共识处理,并在共识通过后,将上述Nonce列表集合存储在上述区块链的分布式数据进行存储和维护。
其中,需要说明的是,上述辅助参数的具体参数内容,在本说明书中不进行特别限定;在实际应用中,上述辅助参数,具体可以包括上述区块链的运营方基于实际的需求,在用户账户可用的Nonce值的基础上扩展出的任意形式的参数;或者参数组合。
也即,在实际应用中,上述辅助参数中所能包含的参数数量以及类别,可以不固定;可以在Nonce值的基础上扩展出任意一种参数来作为辅助参数;也可以在Nonce值的基础上扩展出多种参数进行组合来作为辅助参数。
在本说明书中,上述Nonce列表中的Nonce记录中的辅助参数,具体可以包括分组标识;其中,该分组标识具体用于表示交易所在的分组,属于同一分组的交易则为需要并发执行的交易;其中,对于上述Nonce列表集合中的与各个用户账户对应的Nonce列表而言,均可以包括多条分组标识相同的Nonce记录,从而当用户通过个人的用户账户发起了多笔需要并发执行的多笔交易时,使得客户端可以从上述Nonce列表中为该多笔交易获取到分组标识相同的Nonce记录。
在示出的一种实施方式中,上述Nonce列表中的Nonce记录中的辅助参数,除了可以包括上述分组标识以外,还可以进一步包括上述Nonce记录的索引标识(比如索引编号)。其中,上述索引标识,具体用于表示Nonce记录在Nonce列表中的顺序以及位置。
例如,请参见图3,以上述Nonce列表中的Nonce记录中的辅助参数,同时包含上述分组标识和上述Nonce记录的索引标识为例,此时上述Nonce记录具体可以是一个Group ID(分组标识)、Index(索引标识)、Value(Nonce值)等字段组成的复合 结构。在这种情况下,在区块链中维护的Nonce列表集合,可以表示成如图3所示出的形式。
其中,上述Nonce记录以及上述Nonce记录中的Nonce值和上述辅助参数的具体的字节长度,在本说明书中不进行特别限定;在实际应用中,可以基于上述区块链的运营方的实际需求,进行灵活的设定(比如,运营方可以通过所占用的字节长度,来控制Nonce值以及辅助参数的具体取值范围);
例如,在一种实现方式中,上述Nonce记录具体可以是一个16字节组成的复合结构;其中,4字节表示Group ID(分组标识)、4字节表示Index(索引标识)、8字节表示Value(Nonce值)。
通过在Nonce值的基础上,扩展出多种参数进行组合来作为辅助参数,使得上述Nonce表中的Nonce记录能够涵盖丰富的取值字段,从而可以降低上述Nonce表中的多条Nonce记录由于取值相同发生冲突的概率;
例如,两条由Group ID(分组标识)和Value(Nonce值)构成的总长度为12字节的Nonce记录完全相同发生冲突的概率,会远低于,两条由Group ID(分组标识)、Index(索引标识)和Value(Nonce值)构成的总长度为16字节的Nonce记录完全相同发生冲突的概率。
请参见图4,当用户在客户端上调用客户端启用的多个线程,通过个人的用户账户发起需要并发执行的多笔交易后,客户端可以从区块链上维护的与该用户账户对应的上述Nonce列表中,为该多笔交易分别获取分组标识相同的可用Nonce记录(即为多笔交易添加相同的分组标识)。
由于上述Nonce列表中包括多条Nonce记录,使得客户端启动的多线程均能够从上述Nonce列表中为发起的交易获取到可用Nonce记录,进而用户可以使用个人的用户账户通过上述客户端同时发起多笔交易;因此,在本说明书中,上述Nonce列表中的Nonce记录的数量,实际上可以用于指示用户个人的用户账户的交易并发能力。比如,上述Nonce列表包括4条Nonce记录,那么用户可以通过用户账户同时发起4笔交易。
基于这一点,在实际应用中,区块链的运营方,可以基于客户端自身的性能,来灵活的为上述Nonce列表指定所包含的Nonce记录的数量;或者,客户端可以向区块链系统主动上报自身的性能,由区块链的运营方来灵活的指定上述Nonce列表所包含的Nonce记录的数量;
例如,假设客户端的性能决定,该客户端可以同时启动4个线程来发起交易,那么在为登录该客户端的用户账户创建上述Nonce列表时,可以为该Nonce列表添加4条可用Nonce记录。
在示出的一种实施方式中,客户端可以在初始化阶段,预先将区块链上维护的上述Nonce列表“下载”到本地进行维护;
例如,在实现时,客户端在启动运行,或者与区块链中的节点设备之间的连接断开需要重新进行连接时,通过都需要进行初始化操作。在这种情况下,当客户端收到用户触发的针对该客户端的初始化指令(比如启动指令、重连指令等)时,则可以响应该初始化指令,与区块链中的节点设备建立连接,并基于该连接访问区块链的分布式数据库,获取区块链中维护的上述Nonce列表,然后可以将获取到的上述Nonce列表本地进行存储和维护。
在这种情况下,当客户端需要为该多笔交易分别获取分组标识相同的可用Nonce记录时,可以直接从本地维护的上述Nonce列表中获取可用Nonce记录。
通过这种方式,可以避免与区块链上的节点设备进行数据交互,从区块链中维护的上述Nonce列表中读取数据,为该目标交易获取可用Nonce记录,可以提升客户端的处理性能。
其中,在实际应用中,用户通过用户账户发起的交易中,可能会存在所包含的多笔交易需要并发执行的多组交易,并且该多组交易之间,可能会保持一定的执行顺序;在这种情况下,如果用户通过用户账户发起的交易中,存在所包含的多笔交易需要并发执行的多组交易,此时客户端还可以进一步确认该多组交易的执行顺序;
其中,该多组交易的执行顺序,可以由用户进行人工定义,也可以由客户端基于实际的业务流程进行动态确认,在本说明书中不进行具体的限定。
进一步的,客户端在确定该多组交易的执行顺序之后,除了需要为该多组交易中所包含的多笔交易添加相同的分组标识以外,还需要确保为该多组交易中所包含的多笔交易添加的分组标识,能够指示该多组交易的执行顺序;
这种情况下,上述Nonce列表中则需要包括分组标识相同,并且不同的交易分组的分组标识在数值上也存在差异的多组Nonce记录;也即,同一交易分组中的交易的分组标识保持相同,而不同的交易分组中的交易分组标识在数值上要保持一定的差异;从而,确保能够从上述Nonce列表中,为上述多组交易中的交易,获取到分组标识相同, 并且所述分组标识指示所述多组交易的执行顺序的可用Nonce记录。其中,利用分组标识来指示多组交易的执行顺序,具体可以通过为该多组交易添加在数值上保持单调递增的分组标识的方式来实现;
例如,假设如果用户通过用户账户发起的交易中,存在所包含的交易需要并发执行的两组交易{A1,B1,C1}和{A2,B2,C2};在这种情况下,客户端可以从上述Nonce列表中为交易A1,B1,C1获取一条包含相同的分组标识1的可用Nonce记录,为交易A2,B2,C2获取一条包含相同的分组标识2的可用Nonce记录,利用分组标识数值上的递增,来表示交易分组{A1,B1,C1},需要先于交易分组{A2,B2,C2}执行。也即,交易分组的执行顺序,与被添加的交易标识的取值从小到大的顺序保持一致。
在示出的一种实施方式中,对于客户端在本地维护的上述Nonce列表,可以由客户端为该Nonce列表中的Nonce记录,均默认添加一个表示“可用”的标记。
例如,请参见图5,仍以上述Nonce记录为图4中示出的16字节组成的复合结构为例,可以为Nonce列表中的Nonce记录,扩展出一个1字节的Available字段;其中,当Available字段取值为T时,表示该条Nonce记录“可用”;当Available字段取值为F时,表示该条Nonce记录“不可用”。
一方面,当客户端上启用的线程,在从客户端本地维护的上述Nonce列表中为用户发起的多笔交易获取可用Nonce记录时,可以从上述Nonce列表中所有被标记为“可用”的Nonce记录来随机选择多笔分组标识相同的Nonce记录作为可用Nonce记录。
另一方面,当客户端上启用的线程,从客户端本地维护的上述Nonce列表中为用户发起的多笔交易获取到可用Nonce记录之后,可以对该可用Nonce记录携带的标记进行修改更新,为该可用Nonce记录重新添加一个表示“不可用”的标记,以将该可用Nonce记录标记为不可用。
在本说明书中,当客户端为用户发起的需要并发执行的多笔交易获取到可用Nonce记录之后,可以将获取到的可用Nonce记录添加至上述多笔交易中;
例如,请继续参见图4,客户端在为交易获取到可用Nonce记录之后,可以对交易的交易体,和上述可用Nonce记录进行打包,然后提示用户基于持有的私钥对打包后的[交易体,Nonce记录]进行整体签名,这样可以保障该笔交易中的Nonce记录无法被篡改。
进一步的,当客户端将获取到的可用Nonce记录添加至上述多笔交易之后,客 户端可以将上述多笔交易发布至区块链;
例如,将上述多笔交易发布至该客户端接入的节点设备,或者将该多笔交易在区块链中进行广播发布;其中,客户端将上述多笔交易发布至区块链的具体方式,通常取决于区块链所采用的共识机制,在本说明书中不进行特别限定。
而当区块链中的节点设备在收到客户端发布的交易之后,首先可以在区块链采用的共识算法,发起针对收到的交易的共识处理;
其中,区块链采用的共识算法,以及基于共识算法对上述目标交易的共识处理过程,在本说明书中不再进行详述,本领域技术人员在将本说明书记载的技术方案付诸实现时,可以参考相关技术中的记载。
当收到的交易共识通过后,此时上述区块链中的节点设备,可以进一步发起针对收到的交易的合法性检测。
其中,在本说明书中,针对交易的合法性检测至少可以包括,针对交易携带的签名的合法性检测、以及,针对交易的重放攻击检测。
在实现时,上述区块链中的节点设备首先可以基于与上述用户持有的私钥对应的公钥,对收到的交易的签名进行验证;如果交易的签名失败,可以认定交易为不合法的交易,上述节点设备可以直接通过客户端向用户返回交易执行失败的提示消息。
如果交易的签名验证通过,此时上述节点设备,可以进一步基于该目交易中携带的可用Nonce记录,和区块链中维护的与该用户个人的用户账户对应的Nonce列表,针对该交易进行重放攻击检测。
一方面,请继续参见图4,上述节点设备可以将交易中携带的Nonce记录,从区块链上维护的与该用户账户对应的Nonce列表中的Nonce记录逐一进行匹配;如果交易中携带的Nonce记录,与上述Nonce列表中的任一目标Nonce记录匹配,可以确定该交易通过重放攻击检测;在这种情况下,该节点设备可以受理该交易。
另一方面,当该交易被受理后,该节点设备可以基于预设幅度对上述目标Nonce记录中的Nonce值进行单调递增;其中,上述预设幅度可以基于实际需求进行自定义;
例如,上述预设幅度仍然可以是1,上述节点设备可以在该交易被受理后,将在上述Nonce列表中匹配到的上述目标Nonce记录中的Nonce值自增1。
通过这种方式,如果交易在被受理之后,又再次在区块链中进行了重复发布, 由于上述Nonce列表中与该交易携带的可用Nonce记录匹配的目标Nonce记录中的Nonce值,已经发生了更新,该重复发布的该交易在重放攻击检测阶段,将无法在上述Nonce列表中匹配到对应的Nonce记录;因此,该重复发布的交易将不会被再次受理,从而可以有效的避免通过在区块链中重复发布该交易进行重放攻击。
在示出的一种实施方式中,当交易被受理后,可以向上述客户端返回上述交易被受理的通知消息;而客户端在将用户通过个人的用户账户发起的交易发布至区块链后,可以确定是否接收到节点设备返回的交易被受理的通知消息。
如果确认收到交易被受理的通知消息:
一方面,可以基于预设幅度,对从客户端本地维护的上述Nonce列表中为发起的交易获取到的上述可用Nonce记录中的Nonce值进行单调递增;比如,将在上述可用Nonce记录中的Nonce值也自增1,以与区块链中维护的上述Nonce列表保持内容同步。
另一方面,由于此前该可用Nonce记录已经被标记为了“不可用”;因此,在基于预设幅度,对该可用Nonce记录中的Nonce值进行单调递增后,可以将该可用Nonce记录的Available字段的取值,置位为“T”。
在本说明中,当客户端发送的由用户发起的交易均被受理后,此时区块链中的节点设备,可以进一步确定客户端发送的已经被受理的交易中,是否存在分组标识相同的多笔交易;
如果已经被受理的交易中,存在分组标识相同的多笔交易,此时区块链中的节点设备,可以并发执行该多笔交易,并在该多笔交易执行完毕后,将该多笔交易以及该多笔交易的执行结果,在区块链的分布式数据库中进行存储。
相应的,如果客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易;并且,客户端为该多组交易添加的可用Nonce记录中的分组标识指示该多组交易的执行顺序;在这种情况下,区块链中的节点设备,在收到客户端发送的添加了分组标识的交易,并确定客户端发送的交易中,存在所包含的多笔交易的分组标识相同的多笔交易之后,还可以按照该多笔交易的交易标识所指示出的交易顺序,顺序的执行该多组交易。
例如,仍以用户通过用户账户发起的交易中,存在所包含的交易需要并发执行的两组交易{A1,B1,C1}和{A2,B2,C2};并且,客户端为交易A1,B1,C1添加了一条包含相同的分组标识1的可用Nonce记录,为交易A2,B2,C2添加了一条包含相同的分组标 识2的可用Nonce记录为例;在这种情况下,区块链中的节点设备,在以上交易A1,B1,C1,A2,B2,C2均被受理后,会先并发执行分组标识为1的交易分组中的交易A1,B1,C1,再并发执行分组标识为2的交易分组中的交易A2,B2,C2。
在以上方案中,通过将为多笔交易添加相同的分组标识,来触发区块链中的节点设备并发执行具有相同分组标识的多笔交易的技术方案,与针对交易的重放攻击检测进行结合,可以在避免针对交易的重放攻击的基础上,来进一步提升客户端上的单账户的交易并发能力。
与上述方法实施例相对应,本说明书还提供了一种基于区块链的交易处理装置的实施例。本说明书的基于区块链的交易处理装置的实施例可以应用在电子设备上。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在电子设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图6所示,为本说明书的基于区块链的交易处理装置所在电子设备的一种硬件结构图,除了图6所示的处理器、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的电子设备通常根据该电子设备的实际功能,还可以包括其他硬件,对此不再赘述。
图7是本说明书一示例性实施例示出的一种基于区块链的交易处理装置的框图。
请参考图7,所述基于区块链的交易处理装置70可以应用在前述图6所示的电子设备中,包括有:获取模块701、添加模块702和发布模块703。
获取模块701,从区块链中维护的与用户账户对应的Nonce列表中,为用户通过所述用户账户发起的需要并发执行的多笔交易,分别获取分组标识相同的可用Nonce记录;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
添加模块702,将获取到的可用Nonce记录分别添加至所述多笔交易;
发布模块703,将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。
在本实施例中,所述需要并发执行的多笔交易,包括交易类型相同的多笔交易。
在本实施例中,所述获取模块701进一步:
如果用户通过用户账户发起的交易中存在所包含的多笔交易需要并发执行的多组交易,确定所述多组交易的执行顺序;
从所述Nonce列表中为所述多组交易分别获取分组标识相同,并且所述分组标识指示所述多组交易的执行顺序的可用Nonce记录。
在本实施例中,所述获取模块701进一步:
在从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之前,响应于针对所述客户端的初始化指令,获取所述区块链中维护的所述Nonce列表,并将获取到的所述Nonce列表在所述客户端本地进行维护;
从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录。
在本实施例中,所述客户端本地维护的所述Nonce列表中的Nonce记录默认被标记为可用;
所述获取模块701:
从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之后,在所述Nonce列表中将所述可用Nonce记录标记为不可用。
在本实施例中,所述获取模块701进一步:
确定是否接收到所述节点设备返回的所述交易被受理的通知消息;
如果是,基于预设幅度对所述可用Nonce记录中的Nonce值进行单调递增,并在所述Nonce值单调递增之后,在所述Nonce列表中将所述可用Nonce记录重新标记为可用。
在本实施例中,所述客户端为多线程客户端;所述Nonce列表中的Nonce记录的数量,指示所述用户账户的交易并发能力。
在本实施例中,所述Nonce记录还包括:所述Nonce记录的索引标识。
图8是本说明书一示例性实施例示出的另一种基于区块链的交易处理装置的框图。
请参考图8,所述基于区块链的交易处理装置80也可以应用在前述图6所示的电子设备中,包括有:接收模块801、第二确定模块802和执行模块803。
接收模块801,接收客户端发送的用户通过用户账户发起的交易;其中,所述交易被添加了从所述区块链中维护的与所述用户账户对应的Nonce列表中获取到的可用Nonce记录;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
匹配模块802,将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;
执行模块803,如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
在本实施例中,所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易;所述客户端为所述多组交易添加的可用Nonce记录中的分组标识指示所述多组交易的执行顺序;
所述执行模块803进一步:
如果所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易,按照所述多组交易的分组标识所指示的执行顺序,顺序执行所述多组交易。
在本实施例中,所述执行模块803进一步:
如果所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配,基于预设幅度对所述目标Nonce记录的Nonce值进行单调递增;以及,
向所述客户端返回所述交易被受理的通知消息。
在本实施例中,所述Nonce记录还包括:所述Nonce记录的索引标识。
上述装置中各个模块的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以 根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
上述实施例阐明的系统、装置、模块或模块,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
与上述方法实施例相对应,本说明书还提供了一种电子设备的实施例。该电子设备包括:处理器以及用于存储机器可执行指令的存储器;其中,处理器和存储器通常通过内部总线相互连接。在其他可能的实现方式中,所述设备还可能包括外部接口,以能够与其他设备或者部件进行通信。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
从区块链中维护的与用户账户对应的Nonce列表中,为用户通过所述用户账户发起的需要并发执行的多笔交易,分别获取分组标识相同的可用Nonce记录;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
将获取到的可用Nonce记录分别添加至所述多笔交易;
将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
如果用户通过用户账户发起的交易中存在所包含的多笔交易需要并发执行的多组交易,确定所述多组交易的执行顺序;
从所述Nonce列表中为所述多组交易分别获取分组标识相同,并且所述分组标识指示所述多组交易的执行顺序的可用Nonce记录。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的交易处理的 控制逻辑对应的机器可执行指令,所述处理器被促使:
从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之前,响应于针对所述客户端的初始化指令,获取所述区块链中维护的所述Nonce列表,并将获取到的所述Nonce列表在所述客户端本地进行维护;
从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录
在本实施例中,所述客户端本地维护的所述Nonce列表中的Nonce记录默认被标记为可用;
通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之后,在所述Nonce列表中将所述可用Nonce记录标记为不可用。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
确定是否接收到所述节点设备返回的所述交易被受理的通知消息;
如果是,基于预设幅度对所述可用Nonce记录中的Nonce值进行单调递增,并在所述Nonce值单调递增之后,在所述Nonce列表中将所述可用Nonce记录重新标记为可用。
与上述方法实施例相对应,本说明书还提供了另一种电子设备的实施例。该电子设备包括:处理器以及用于存储机器可执行指令的存储器;其中,处理器和存储器通常通过内部总线相互连接。在其他可能的实现方式中,所述设备还可能包括外部接口,以能够与其他设备或者部件进行通信。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
接收客户端发送的用户通过用户账户发起的交易;其中,所述交易被添加了从所述区块链中维护的与所述用户账户对应的Nonce列表中获取到的可用Nonce记录;其 中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;
如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
在本实施例中,所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易;所述客户端为所述多组交易添加的可用Nonce记录中的分组标识指示所述多组交易的执行顺序;
通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
如果所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易,按照所述多组交易的分组标识所指示的执行顺序,顺序执行所述多组交易。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
如果所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配,基于预设幅度对所述目标Nonce记录的Nonce值进行单调递增;以及,
向所述客户端返回所述交易被受理的通知消息。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本说明书的其它实施方案。本说明书旨在涵盖本说明书的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本说明书的一般性原理并包括本说明书未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本说明书的真正范围和精神由下面的权利要求指出。
应当理解的是,本说明书并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本说明书的范围仅由所附的权利要求来限制。
以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。

Claims (26)

  1. 一种基于区块链的交易处理方法,应用于客户端,所述区块链中维护了与所述用户账户对应的Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:
    从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录;
    将获取到的可用Nonce记录分别添加至所述多笔交易;
    将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。
  2. 根据权利要求1所述的方法,所述需要并发执行的多笔交易,包括交易类型相同的多笔交易。
  3. 根据权利要求1所述的方法,还包括:
    如果用户通过用户账户发起的交易中存在所包含的多笔交易需要并发执行的多组交易,确定所述多组交易的执行顺序;
    从所述Nonce列表中为所述多组交易分别获取分组标识相同,并且所述分组标识指示所述多组交易的执行顺序的可用Nonce记录。
  4. 根据权利要求1所述的方法,从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之前,还包括:
    响应于针对所述客户端的初始化指令,获取所述区块链中维护的所述Nonce列表,并将获取到的所述Nonce列表在所述客户端本地进行维护;
    从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录,包括:
    从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录。
  5. 根据权利要求4所述的方法,所述客户端本地维护的所述Nonce列表中的Nonce记录默认被标记为可用;
    所述方法还包括:
    从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之后,在所述Nonce列表中将 所述可用Nonce记录标记为不可用。
  6. 根据权利要求5所述的方法,还包括:
    确定是否接收到所述节点设备返回的所述交易被受理的通知消息;
    如果是,基于预设幅度对所述可用Nonce记录中的Nonce值进行单调递增,并在所述Nonce值单调递增之后,在所述Nonce列表中将所述可用Nonce记录重新标记为可用。
  7. 根据权利要求1所述的方法,所述客户端为多线程客户端;所述Nonce列表中的Nonce记录的数量,指示所述用户账户的交易并发能力。
  8. 根据权利要求7所述的方法,所述Nonce记录还包括:所述Nonce记录的索引标识。
  9. 一种基于区块链的交易处理方法,应用于区块链中的节点设备,所述区块链维护了Nonce列表集合;所述Nonce列表集合包括与若干用户账户对应的Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:
    接收客户端发送的用户通过用户账户发起的交易;其中,所述交易被添加了从所述区块链中维护的与所述用户账户对应的Nonce列表中获取到的可用Nonce记录;
    将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;
    如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
  10. 根据权利要求9所述的方法,所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易;所述客户端为所述多组交易添加的可用Nonce记录中的分组标识指示所述多组交易的执行顺序;
    所述方法还包括:
    如果所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易,按照所述多组交易的分组标识所指示的执行顺序,顺序执行所述多组交易。
  11. 根据权利要求9所述的方法,还包括:
    如果所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配,基于预设幅度对所述目标Nonce记录的Nonce值进行单调递增;以及,
    向所述客户端返回所述交易被受理的通知消息。
  12. 根据权利要求11所述的方法,所述Nonce记录还包括:所述Nonce记录的索 引标识。
  13. 一种基于区块链的交易处理装置,应用于客户端,所述区块链中维护了与所述用户账户对应的Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:
    获取模块,从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录;
    添加模块,将获取到的可用Nonce记录分别添加至所述多笔交易;
    发布模块,将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。
  14. 根据权利要求13所述的装置,所述需要并发执行的多笔交易,包括交易类型相同的多笔交易。
  15. 根据权利要求13所述的装置,所述获取模块进一步:
    如果用户通过用户账户发起的交易中存在所包含的多笔交易需要并发执行的多组交易,确定所述多组交易的执行顺序;
    从所述Nonce列表中为所述多组交易分别获取分组标识相同,并且所述分组标识指示所述多组交易的执行顺序的可用Nonce记录。
  16. 根据权利要求13所述的装置,所述获取模块进一步:
    在从所述Nonce列表中为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之前,响应于针对所述客户端的初始化指令,获取所述区块链中维护的所述Nonce列表,并将获取到的所述Nonce列表在所述客户端本地进行维护;
    从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录。
  17. 根据权利要求16所述的装置,所述客户端本地维护的所述Nonce列表中的Nonce记录默认被标记为可用;
    所述获取模块:
    从所述客户端本地维护的所述Nonce列表中,为用户通过用户账户发起的需要并发执行的多笔交易分别获取分组标识相同的可用Nonce记录之后,在所述Nonce列表中将所述可用Nonce记录标记为不可用。
  18. 根据权利要求17所述的装置,所述获取模块进一步:
    确定是否接收到所述节点设备返回的所述交易被受理的通知消息;
    如果是,基于预设幅度对所述可用Nonce记录中的Nonce值进行单调递增,并在所述Nonce值单调递增之后,在所述Nonce列表中将所述可用Nonce记录重新标记为可用。
  19. 根据权利要求13所述的装置,所述客户端为多线程客户端;所述Nonce列表中的Nonce记录的数量,指示所述用户账户的交易并发能力。
  20. 根据权利要求19所述的装置,所述Nonce记录还包括:所述Nonce记录的索引标识。
  21. 一种基于区块链的交易处理装置,应用于区块链中的节点设备,所述区块链维护了Nonce列表集合;所述Nonce列表集合包括与若干用户账户对应的Nonce列表;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;所述方法包括:
    接收模块,接收客户端发送的用户通过用户账户发起的交易;其中,所述交易被添加了从所述区块链中维护的与所述用户账户对应的Nonce列表中获取到的可用Nonce记录;
    匹配模块,将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;
    执行模块,如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
  22. 根据权利要求21所述的装置,所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易;所述客户端为所述多组交易添加的可用Nonce记录中的分组标识指示所述多组交易的执行顺序;
    所述执行模块进一步:
    如果所述客户端发送的交易中存在所包含的多笔交易的分组标识相同的多组交易,按照所述多组交易的分组标识所指示的执行顺序,顺序执行所述多组交易。
  23. 根据权利要求21所述的装置,所述执行模块进一步:
    如果所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配,基于预设幅度对所述目标Nonce记录的Nonce值进行单调递增;以及,
    向所述客户端返回所述交易被受理的通知消息。
  24. 根据权利要求23所述的装置,所述Nonce记录还包括:所述Nonce记录的索 引标识。
  25. 一种电子设备,包括:
    处理器;
    用于存储机器可执行指令的存储器;
    其中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
    从区块链中维护的与用户账户对应的Nonce列表中,为用户通过所述用户账户发起的需要并发执行的多笔交易,分别获取分组标识相同的可用Nonce记录;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
    将获取到的可用Nonce记录分别添加至所述多笔交易;
    将所述多笔交易发布至所述区块链,以由所述区块链中的节点设备将所述客户端发布的交易中的可用Nonce记录与所述Nonce列表中的Nonce记录进行匹配,并在所述可用Nonce记录与所述Nonce列表中的任一目标Nonce记录匹配时,受理所述交易,以及并发执行已受理的交易中具有相同分组标识的多笔交易。
  26. 一种电子设备,包括:
    处理器;
    用于存储机器可执行指令的存储器;
    其中,通过读取并执行所述存储器存储的与基于区块链的交易处理的控制逻辑对应的机器可执行指令,所述处理器被促使:
    接收客户端发送的用户通过用户账户发起的交易;其中,所述交易被添加了从所述区块链中维护的与所述用户账户对应的Nonce列表中获取到的可用Nonce记录;其中,所述Nonce列表包括多条Nonce记录;所述Nonce记录包括分组标识和Nonce值;
    将接收到的交易中的可用Nonce记录,与所述区块链中维护的与所述用户账户对应的Nonce列表中的Nonce记录进行匹配;
    如果所述可用Nonce记录,与所述Nonce列表中的任一目标Nonce记录匹配,受理所述交易;以及,并发执行已受理的交易中具有相同分组标识的多笔交易。
PCT/CN2019/103238 2018-10-25 2019-08-29 基于区块链的交易处理方法及装置、电子设备 WO2020082893A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP19874820.4A EP3816910B1 (en) 2018-10-25 2019-08-29 Blockchain-based transaction processing method and apparatus, and electronic device
SG11202100309PA SG11202100309PA (en) 2018-10-25 2019-08-29 Blockchain-based transaction processing method and apparatus, and electronic device
US17/160,203 US11481765B2 (en) 2018-10-25 2021-01-27 Blockchain-based transaction processing method and apparatus and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811253444.0A CN109598504B (zh) 2018-10-25 2018-10-25 基于区块链的交易处理方法及装置、电子设备
CN201811253444.0 2018-10-25

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/160,203 Continuation US11481765B2 (en) 2018-10-25 2021-01-27 Blockchain-based transaction processing method and apparatus and electronic device

Publications (1)

Publication Number Publication Date
WO2020082893A1 true WO2020082893A1 (zh) 2020-04-30

Family

ID=65957010

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103238 WO2020082893A1 (zh) 2018-10-25 2019-08-29 基于区块链的交易处理方法及装置、电子设备

Country Status (6)

Country Link
US (1) US11481765B2 (zh)
EP (1) EP3816910B1 (zh)
CN (2) CN109598504B (zh)
SG (1) SG11202100309PA (zh)
TW (1) TWI706278B (zh)
WO (1) WO2020082893A1 (zh)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11416852B1 (en) * 2017-12-15 2022-08-16 Worldpay, Llc Systems and methods for generating and transmitting electronic transaction account information messages
CN109598504B (zh) 2018-10-25 2020-09-01 阿里巴巴集团控股有限公司 基于区块链的交易处理方法及装置、电子设备
CN110175831B (zh) * 2019-04-23 2023-09-29 创新先进技术有限公司 一种基于区块链的信用转移方法、装置及电子设备
CN110070445B (zh) * 2019-04-28 2024-03-01 深圳前海微众银行股份有限公司 一种基于区块链系统的交易处理方法及装置
CN110264348B (zh) * 2019-05-07 2021-08-20 北京奇艺世纪科技有限公司 一种交易上链的处理方法、装置及存储介质
US11108545B2 (en) 2019-05-31 2021-08-31 Advanced New Technologies Co., Ltd. Creating a blockchain account and verifying blockchain transactions
CN110264354B (zh) * 2019-05-31 2020-09-01 阿里巴巴集团控股有限公司 创建区块链账户及验证区块链交易的方法及装置
CN113421073A (zh) * 2019-08-30 2021-09-21 创新先进技术有限公司 在区块链中并发执行交易的方法和装置
CN110796545B (zh) * 2019-10-25 2024-03-29 杭州趣链科技有限公司 一种区块链交易的批处理方法、设备和存储介质
CN112202564B (zh) * 2020-09-14 2022-09-20 成都质数斯达克科技有限公司 交易传递方法、装置、电子设备及可读存储介质
CN113225368B (zh) * 2021-02-07 2022-04-19 武汉卓尔信息科技有限公司 一种区块链交易方法、装置、电子设备及存储介质
US11936794B2 (en) * 2021-09-16 2024-03-19 Masterard International Incorporated Method and system for parallel processing of smart contracts in permissioned blockchains
CN114493602B (zh) * 2022-04-08 2022-07-22 恒生电子股份有限公司 区块链交易的执行方法、装置、电子设备和存储介质
CN116634025B (zh) * 2023-07-25 2023-12-29 武汉趣链数字科技有限公司 一种确定交易顺序的方法、设备、系统和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815722A (zh) * 2016-12-22 2017-06-09 中钞信用卡产业发展有限公司北京智能卡技术研究院 基于区块链的信息处理方法和装置
US20170212781A1 (en) * 2016-01-26 2017-07-27 International Business Machines Corporation Parallel execution of blockchain transactions
CN107993147A (zh) * 2017-11-13 2018-05-04 中国银行股份有限公司 热点账户的余额控制方法及装置
CN108053211A (zh) * 2017-12-27 2018-05-18 北京欧链科技有限公司 基于区块链的交易处理方法及装置
CN109598504A (zh) * 2018-10-25 2019-04-09 阿里巴巴集团控股有限公司 基于区块链的交易处理方法及装置、电子设备

Family Cites Families (72)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7856660B2 (en) * 2001-08-21 2010-12-21 Telecommunication Systems, Inc. System for efficiently handling cryptographic messages containing nonce values
US7529371B2 (en) * 2004-04-22 2009-05-05 International Business Machines Corporation Replaceable sequenced one-time pads for detection of cloned service client
US7725927B2 (en) * 2005-10-28 2010-05-25 Yahoo! Inc. Low code-footprint security solution
US20080077795A1 (en) * 2006-09-25 2008-03-27 Macmillan David M Method and apparatus for two-way authentication without nonces
US20080148052A1 (en) * 2006-10-25 2008-06-19 Motorola, Inc. Method and system for authentication bonding two devices and sending authenticated events
EP2079201A1 (en) * 2006-11-02 2009-07-15 Panasonic Corporation Communication method, communication system, mobile node and communication node
US8850197B2 (en) * 2009-07-31 2014-09-30 Futurewei Technologies, Inc. Optical network terminal management control interface-based passive optical network security enhancement
US20140133656A1 (en) * 2012-02-22 2014-05-15 Qualcomm Incorporated Preserving Security by Synchronizing a Nonce or Counter Between Systems
TWI517069B (zh) * 2014-03-14 2016-01-11 謝宛霖 雲端即時租賃方法
US20170269186A1 (en) * 2014-08-22 2017-09-21 Philips Lighting Holding B.V. Localization system comprising multiple beacons and an assignment system
AU2016242888A1 (en) * 2015-03-31 2017-11-16 Nasdaq, Inc. Systems and methods of blockchain transaction recordation
EP3317775B1 (en) * 2015-07-02 2022-02-16 Nasdaq, Inc. Systems and methods of secure provenance for distributed transaction databases
US10339132B2 (en) * 2015-07-09 2019-07-02 Netapp, Inc. Flow control technique for EOS system
US20170228731A1 (en) * 2016-02-09 2017-08-10 Fmr Llc Computationally Efficient Transfer Processing and Auditing Apparatuses, Methods and Systems
US20180253702A1 (en) * 2015-11-24 2018-09-06 Gartland & Mellina Group Blockchain solutions for financial services and other transactions-based industries
US10230756B2 (en) * 2015-11-25 2019-03-12 International Business Machines Corporation Resisting replay attacks efficiently in a permissioned and privacy-preserving blockchain network
EP3403213A2 (fr) * 2016-01-15 2018-11-21 Enrico Maim Procédés et systèmes mis en oeuvre dans une architecture en réseau de noeuds susceptibles de réaliser des transactions basées sur messages
BR112018016805A2 (pt) * 2016-02-23 2018-12-26 Nchain Holdings Ltd método e sistema para transferência eficiente de criptomoeda associada com um pagamento em um blockchain que leva a um pagamento automatizado, método e sistema com base em contratos inteligentes
EP3860037A1 (en) * 2016-02-23 2021-08-04 Nchain Holdings Limited Cryptographic method and system for secure extraction of data from a blockchain
US10601859B2 (en) * 2016-02-25 2020-03-24 Trusona, Inc. Anti-replay systems and methods
GB201607476D0 (en) * 2016-04-29 2016-06-15 Eitc Holdings Ltd Operating system for blockchain IOT devices
US10333705B2 (en) * 2016-04-30 2019-06-25 Civic Technologies, Inc. Methods and apparatus for providing attestation of information using a centralized or distributed ledger
US11646808B2 (en) * 2016-05-09 2023-05-09 Strong Force Iot Portfolio 2016, Llc Methods and systems for adaption of data storage and communication in an internet of things downstream oil and gas environment
KR101781583B1 (ko) 2016-08-31 2017-09-27 서강대학교산학협력단 블록체인을 기반으로 한 파일 관리/검색 시스템 및 파일 관리/검색 방법
WO2018049234A1 (en) * 2016-09-09 2018-03-15 Trusona, Inc. Systems and methods for distribution of selected authentication information for a network of devices
CN106452785B (zh) * 2016-09-29 2019-05-17 财付通支付科技有限公司 区块链网络、分支节点及区块链网络应用方法
CN108075895B (zh) 2016-11-15 2020-03-24 深圳银链科技有限公司 一种基于区块链的节点许可方法和系统
CN110392888A (zh) * 2017-01-16 2019-10-29 E·马伊姆 用于在安全环境中执行智能合约的方法和系统
US11316868B2 (en) * 2017-02-24 2022-04-26 Nec Corporation Information verification system, information verification device, method and program
CN110603557B (zh) * 2017-03-16 2024-04-12 香港物流及供应链管理应用技术研发中心 控制交易账本的系统和方法
CN106991607B (zh) * 2017-03-29 2020-04-10 杭州溪塔科技有限公司 一种基于区块链账户模型的无序交易控制方法
EP3382629A1 (de) * 2017-03-31 2018-10-03 Siemens Aktiengesellschaft Verfahren und zeitgeber zum bereitstellen von sicherheitsgeschützten zeitangaben
EP3382616A1 (de) * 2017-03-31 2018-10-03 Siemens Aktiengesellschaft Verfahren und vorrichtung zum rechnergestützten bereitstellen eines sicherheitsgeschützten digitalen zwillings
US20180293547A1 (en) * 2017-04-06 2018-10-11 Jaspreet Randhawa Methods and systems for employment and education verification using blockchain
EP3388994A1 (de) * 2017-04-12 2018-10-17 Siemens Aktiengesellschaft Verfahren und vorrichtung zum rechnergestützten testen einer blockkette
US20180308094A1 (en) * 2017-04-19 2018-10-25 Baton Systems, Inc. Time stamping systems and methods
CN110709874A (zh) * 2017-06-07 2020-01-17 区块链控股有限公司 用于区块链网络的凭证生成与分发方法和系统
JP7053677B2 (ja) * 2017-06-07 2022-04-12 エヌチェーン ホールディングス リミテッド ブロックチェーン・ネットワークにおいてトランザクションを管理するためのコンピュータ実装システム及び方法
US10581613B2 (en) * 2017-06-09 2020-03-03 Ecole Polytechnique Federale De Lausanne (Epfl) Cryptographically verifiable data structure having multi-hop forward and backwards links and associated systems and methods
US11461310B2 (en) * 2017-07-17 2022-10-04 Rdx Works Ltd Distributed ledger technology
GB201711867D0 (en) * 2017-07-24 2017-09-06 Nchain Holdings Ltd Computer-implemented system and method
CN107688999B (zh) 2017-08-11 2020-11-13 杭州溪塔科技有限公司 一种基于区块链的并行交易执行方法
CN107678865A (zh) * 2017-09-20 2018-02-09 中国银行股份有限公司 基于交易分组的区块链的验证方法以及系统
GB201715423D0 (en) * 2017-09-22 2017-11-08 Nchain Holdings Ltd Computer-implemented system and method
EP3462313A1 (de) * 2017-09-27 2019-04-03 Siemens Aktiengesellschaft Verfahren und verteiltes datenbanksystem zum rechnergestützten ausführen eines programmcodes
US11316696B2 (en) * 2017-09-29 2022-04-26 R3 Ltd. Hash subtrees for grouping components by component type
GB2569278A (en) * 2017-10-23 2019-06-19 Cygnetise Ltd Methods and apparatus for verifying a user transaction
US11449864B2 (en) * 2017-10-31 2022-09-20 R3 Ltd. Reissuing obligations to preserve privacy
US11042934B2 (en) * 2017-11-13 2021-06-22 Bank Of America Corporation Crypto-machine learning enabled blockchain based profile pricer
CN107943976B (zh) * 2017-11-29 2022-02-25 中国银行股份有限公司 一种海量交易日志中基于账户的热点交易识别方法及系统
US20190164150A1 (en) * 2017-11-29 2019-05-30 Bank Of America Corporation Using Blockchain Ledger for Selectively Allocating Transactions to User Accounts
US10567156B2 (en) * 2017-11-30 2020-02-18 Bank Of America Corporation Blockchain-based unexpected data detection
US20190188086A1 (en) * 2017-12-14 2019-06-20 International Business Machines Corporation Redundancy reduction in blockchains
WO2019139633A1 (en) * 2018-01-11 2019-07-18 Lancium Llc Method and system for dynamic power delivery to a flexible growcenter using unutilized energy sources
JP6897973B2 (ja) * 2018-02-15 2021-07-07 株式会社アクセル サーバ装置、処理システム、処理方法及び処理プログラム
WO2019185148A1 (en) * 2018-03-29 2019-10-03 Telefonaktiebolaget Lm Ericsson (Publ) Technique for computing a block in a blockchain network
CN108282334B (zh) * 2018-04-13 2021-04-27 浪潮集团有限公司 一种基于区块链的多方密钥协商装置、方法及系统
US11005664B2 (en) * 2018-04-16 2021-05-11 R3 Ltd. Blockchain post-quantum signature scheme
CN108667632B (zh) 2018-04-19 2020-10-30 创新先进技术有限公司 基于区块链的信用记录共享方法及装置、电子设备
CN108805569A (zh) * 2018-05-29 2018-11-13 阿里巴巴集团控股有限公司 基于区块链的交易处理方法及装置、电子设备
US11556874B2 (en) * 2018-06-11 2023-01-17 International Business Machines Corporation Block creation based on transaction cost and size
US20200013050A1 (en) * 2018-07-06 2020-01-09 Keir Finlow-Bates Blockchain based payments for digital certificate provisioning of internet of things devices
US11204939B2 (en) * 2018-07-18 2021-12-21 Bank Of America Corporation Data manifest as a blockchain service
US10965466B2 (en) * 2018-08-03 2021-03-30 National Taiwan University Estimable proof-of-work for blockchain
US11159307B2 (en) * 2018-08-08 2021-10-26 International Business Machines Corporation Ad-hoc trusted groups on a blockchain
CN109242484A (zh) * 2018-08-09 2019-01-18 玄章技术有限公司 一种区块链的共识激励方法
US11063760B2 (en) * 2018-08-22 2021-07-13 Sasken Technologies Ltd Method for ensuring security of an internet of things network
IL261679A (en) * 2018-09-06 2018-10-31 Acuant Inc System and method for management of digital id
AU2019236667B2 (en) * 2018-09-28 2023-10-05 Infosys Limited System and method for decentralized identity management, authentication and authorization of applications
US10756912B2 (en) * 2018-10-12 2020-08-25 Avaya Inc. Distributed ledger and blockchain to confirm validity of call recordings
US20200119904A1 (en) * 2018-10-15 2020-04-16 Ca, Inc. Tamper-proof privileged user access system logs
US11133923B2 (en) * 2018-10-24 2021-09-28 Landis+Gyr Innovations, Inc. Cryptographic operations using internet of things device pool

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170212781A1 (en) * 2016-01-26 2017-07-27 International Business Machines Corporation Parallel execution of blockchain transactions
CN106815722A (zh) * 2016-12-22 2017-06-09 中钞信用卡产业发展有限公司北京智能卡技术研究院 基于区块链的信息处理方法和装置
CN107993147A (zh) * 2017-11-13 2018-05-04 中国银行股份有限公司 热点账户的余额控制方法及装置
CN108053211A (zh) * 2017-12-27 2018-05-18 北京欧链科技有限公司 基于区块链的交易处理方法及装置
CN109598504A (zh) * 2018-10-25 2019-04-09 阿里巴巴集团控股有限公司 基于区块链的交易处理方法及装置、电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3816910A4 *

Also Published As

Publication number Publication date
EP3816910B1 (en) 2022-12-28
CN109598504B (zh) 2020-09-01
US20210150519A1 (en) 2021-05-20
CN112232817A (zh) 2021-01-15
EP3816910A4 (en) 2021-09-15
US11481765B2 (en) 2022-10-25
EP3816910A1 (en) 2021-05-05
TWI706278B (zh) 2020-10-01
SG11202100309PA (en) 2021-02-25
CN109598504A (zh) 2019-04-09
TW202016787A (zh) 2020-05-01

Similar Documents

Publication Publication Date Title
WO2020082893A1 (zh) 基于区块链的交易处理方法及装置、电子设备
WO2020082892A1 (zh) 基于区块链的交易处理方法及装置、电子设备
TWI737977B (zh) 基於區塊鏈的交易處理方法及裝置、電子設備
TWI694390B (zh) 基於區塊鏈的交易處理方法及裝置、電子設備
CN108335206B (zh) 资产管理方法及装置、电子设备
CN108335207B (zh) 资产管理方法及装置、电子设备
CN108492180B (zh) 资产管理方法及装置、电子设备
WO2020082898A1 (zh) 基于区块链的交易处理方法及装置、电子设备
WO2019042101A1 (zh) 一种跨链交易方法及装置
TW201935384A (zh) 資產管理方法及裝置、電子設備
TW202001656A (zh) 基於區塊鏈的智能合約調用方法及裝置、電子設備
EP3971809B1 (en) Method and apparatus for starting smart contract, electronic device, and storage medium
EP3905172A1 (en) Blockchain-based invoice voiding method and apparatus, and electronic device

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: 19874820

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE