WO2023011019A1 - 基于区块链的数据处理方法、装置、设备、可读存储介质及计算机程序产品 - Google Patents

基于区块链的数据处理方法、装置、设备、可读存储介质及计算机程序产品 Download PDF

Info

Publication number
WO2023011019A1
WO2023011019A1 PCT/CN2022/099549 CN2022099549W WO2023011019A1 WO 2023011019 A1 WO2023011019 A1 WO 2023011019A1 CN 2022099549 W CN2022099549 W CN 2022099549W WO 2023011019 A1 WO2023011019 A1 WO 2023011019A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
group
transaction data
data
execution
Prior art date
Application number
PCT/CN2022/099549
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 JP2023558388A priority Critical patent/JP2024515022A/ja
Publication of WO2023011019A1 publication Critical patent/WO2023011019A1/zh
Priority to US18/137,336 priority patent/US20230259938A1/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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • 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
    • 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/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • 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/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • 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

Definitions

  • the present application relates to the field of computer technology, and in particular to a blockchain-based data processing method, device, equipment, readable storage medium, and computer program product.
  • Blockchain is a new application model that integrates computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. It is mainly used to organize data in chronological order and encrypt them into ledgers so that the data cannot be tampered with. and forgery, while data verification, storage and updating can be performed. Blockchain can also perform encrypted data transmission, node identification and secure access, and is an advanced distributed infrastructure. At present, because of the immutability and authenticity of the blockchain, there are more and more applications for the blockchain.
  • a transaction is the smallest request unit in the blockchain system.
  • a transaction can be regarded as an operation request to the blockchain server, which authorizes the blockchain system to perform some transaction operations.
  • a transaction only involves an individual or two parties. In a multi-party collaboration scenario, multiple transactions are often generated. These transactions should be executed simultaneously to ensure the success or failure of all parties involved.
  • Embodiments of the present application provide a block chain-based data processing method, device, device, readable storage medium, and computer program product, which can improve the accuracy of block chain transaction data.
  • the embodiment of the present application provides a blockchain-based data processing method, which is applied to computer equipment, and the computer equipment is mapped as a consensus node in the blockchain network, and the method includes:
  • the consensus node determines multiple transaction data with the same group ID in the transaction pool as group transaction data
  • the transaction execution results corresponding to each of the group transaction data are updated to the transaction execution failure results, and according to each of the group transaction data corresponding The transaction execution failure result updates the proposed block to obtain the target proposed block;
  • the embodiment of the present application provides a blockchain-based data processing method, which is applied to computer equipment, and the computer equipment is mapped as a service node in the blockchain network, and the method includes:
  • the service node receives a transaction request for a multi-party cooperative transaction sent by the terminal device;
  • the transaction data is used for the consensus node to determine as group transaction data, and the consensus node is used to package each of the group transaction data
  • the consensus node is used to package each of the group transaction data
  • execute each of the group transaction data in the proposed block to obtain the executed transaction execution result; the consensus node is also used in the executed transaction execution result
  • the transaction execution result corresponding to each group of transaction data is updated to the transaction execution failure result.
  • the embodiment of the present application provides a block chain-based data processing device, including:
  • the group determination module is configured to determine multiple transaction data having the same group identifier in the transaction pool as group transaction data;
  • a packaging module configured to package each of the group transaction data into a proposed block
  • the block execution module is configured to pack each of the group transaction data into a proposed block, execute each of the group transaction data in the proposed block, and obtain a transaction execution result that has been executed;
  • the result update module is configured to update the transaction execution result corresponding to each group transaction data to the transaction execution failure result when the completed transaction execution result includes a transaction execution failure result;
  • a block update module configured to update the proposed block according to the transaction execution failure result corresponding to each of the group transaction data, to obtain a target proposed block
  • the accounting module is configured to perform accounting processing on the target proposed block and the transaction execution failure results corresponding to each of the group transaction data when the consensus of the target proposed block is passed.
  • the embodiment of the present application provides a block chain-based data processing device, including:
  • the request receiving module is configured to receive the transaction request sent by the terminal device for the multi-party cooperative transaction
  • An identification determination module configured to determine the group identification corresponding to the multi-party collaborative transaction according to the transaction request
  • a data adding module configured to generate transaction data with a group identifier according to the group identifier corresponding to the multi-party collaborative transaction and the transaction request, and add the transaction data to the transaction pool;
  • the transaction data is used for the consensus node to determine as group transaction data, and the consensus node is used to package each of the group transaction data
  • the consensus node is used to package each of the group transaction data
  • execute each of the group transaction data in the proposed block to obtain the executed transaction execution result; the consensus node is also used in the executed transaction execution result
  • the transaction execution result corresponding to each group of transaction data is updated to the transaction execution failure result.
  • An embodiment of the present application provides a computer device, including: a processor, a memory, and a network interface;
  • the above-mentioned processor is connected to the above-mentioned memory and the above-mentioned network interface, wherein the above-mentioned network interface is used to provide data communication network elements, the above-mentioned memory is used to store computer programs, and the above-mentioned processor is used to call the above-mentioned computer programs to execute the method.
  • An embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is adapted to be loaded by a processor and execute the method in the embodiment of the present application.
  • An embodiment of the present application provides a computer program product or computer program, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium, and the processor of the computer device reads the computer-readable storage medium from the computer-readable storage medium.
  • the computer instruction is fetched, and the processor executes the computer instruction, so that the computer device executes the method in the embodiment of the present application.
  • group transaction data with the same group ID can be packaged into the same proposed block, and as long as one group transaction data fails to be executed, all group transaction data will be confirmed to fail to execute, so it is possible to avoid multi-party After some of the group transaction data generated under collaborative transactions fail to execute, some of the group transaction data with successful transactions will be written into the blockchain. Therefore, in the embodiment of this application, only when all group transaction data are successfully executed can the blockchain-based The multi-party collaborative transaction is successful to improve the accuracy of the blockchain transaction data.
  • FIG. 1 is a schematic diagram of a network architecture provided by an embodiment of the present application.
  • Figure 2a- Figure 2b is a schematic diagram of a blockchain-based data processing scenario provided by the embodiment of the present application.
  • Fig. 3 is a schematic flow diagram of a blockchain-based data processing method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flow diagram of a blockchain-based data processing method provided by an embodiment of the present application.
  • Fig. 5 is a schematic flowchart of a method for executing group transaction data provided by an embodiment of the present application
  • Fig. 6 is a schematic diagram of a scenario for realizing a transaction group provided by an embodiment of the present application.
  • Fig. 7 is a schematic flow diagram of a transaction group implementation provided by the embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a blockchain-based data processing device provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of another blockchain-based data processing device provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of another computer device provided by an embodiment of the present application.
  • the transactions involved in this embodiment of the application are also called transaction requests, and the transactions include operations that need to be submitted to the blockchain network for execution and corresponding transaction results.
  • the transactions involved in the embodiments of the present application are not limited to transactions in a business context, that is, transaction data is not limited to related data such as digital currency.
  • the transaction can be a deployment (Deploy) transaction, a call (Invoke) transaction, the deployment transaction is used to deploy the smart contract to the node of the blockchain network, and is ready to be called; the call transaction is used for the state database in the ledger Perform query operations (ie, read operations) or update operations (ie, write operations, including addition, deletion, and modification).
  • FIG. 1 is a schematic diagram of a network architecture provided by an embodiment of the present application.
  • Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism and encryption algorithm. It is mainly used to organize data in chronological order and encrypt them into ledgers so that they cannot be tampered with or forged. , and data verification, storage and update can be performed at the same time.
  • the blockchain is essentially a decentralized database, each node in the database stores the same blockchain, and the nodes in the blockchain network include consensus nodes (such as the consensus node 1000a shown in Figure 1) And service nodes (such as the service node 100a shown in Figure 1), wherein the consensus node is used for the consensus of the entire blockchain network, and the service node is used to process the transaction request sent by the terminal device (running the client).
  • consensus nodes such as the consensus node 1000a shown in Figure 1
  • service nodes such as the service node 100a shown in Figure 1
  • the process of writing transaction data into the ledger in the blockchain network can be as follows: the client sends the transaction data to the business node, and then the transaction data is passed between the business nodes in the blockchain network in the form of a baton until the consensus node After receiving the transaction data, the consensus node will package the transaction data into a block and carry out consensus with other consensus nodes. After the consensus is passed, the block carrying the transaction data will be written into the ledger.
  • a block is a data packet that carries transaction data (that is, transaction business) on the blockchain network, and is a kind of data that is marked with a timestamp and the hash value of the previous block Structure, the block is verified by the consensus mechanism of the network to determine the transactions in the block.
  • the hash (hash) value is also called information characteristic value or characteristic value.
  • the hash value is generated by converting input data of any length into a password through a hash algorithm and performing fixed output. The original input data is retrieved by decrypting the hash value, which is a one-way encryption function.
  • each block (except the initial block) contains the hash value of the previous block, which is called the parent block of the current block.
  • Hash value is the core foundation and most important part of blockchain technology, which can ensure the authenticity of recorded data and view data, as well as the integrity of blockchain as a whole.
  • the blockchain system may include a smart contract, which can be understood as a code that can be understood and executed by each node of the blockchain (including the consensus node) in the blockchain system, Arbitrary logic can be executed and a result obtained.
  • the user can initiate a transaction service request through the client to call the smart contract that has been deployed on the blockchain, and then the business node on the blockchain can send the transaction service request to the consensus node, and the blockchain on the blockchain Each consensus node can run the smart contract separately.
  • one or more smart contracts can be included in the blockchain, and these smart contracts can be distinguished by identification number (ID, Identity document) or name, and the transaction service request initiated by the client can also carry the smart contract The identification number or name of the , which specifies the smart contract that the blockchain needs to run. And if the smart contract specified by the client is a contract that needs to read data, each consensus node will access the local ledger to read the data, and finally each consensus node will verify whether the execution results are consistent with each other (that is, consensus), If they are consistent, the execution results can be stored in their respective local ledgers, and the execution results will be returned to the client.
  • ID identification number
  • Identity document the transaction service request initiated by the client can also carry the smart contract The identification number or name of the , which specifies the smart contract that the blockchain needs to run.
  • each consensus node will access the local ledger to read the data, and finally each consensus node will verify whether the execution results are consistent with each other (that is, consensus), If they are consistent, the execution results can be stored in their
  • the network architecture can include a consensus node cluster 1000, a service node cluster 100, and a terminal device (running a client) cluster 10, the consensus node cluster 1000 can include at least two consensus nodes, and the service node cluster 100 can be Including at least two service nodes.
  • the consensus node cluster 1000 may include a consensus node 1000a, a consensus node 1000b, ..., a consensus node 1000n
  • the service node cluster 100 may specifically include a service node 100a, a service node 100b, ..., a service node 100n
  • the The terminal device cluster 10 may specifically include a terminal device 10a, a terminal device 10b, ..., a terminal device 10n.
  • terminal equipment 10a, terminal equipment 10b, ..., terminal equipment 10n can carry out network connection with service node 100a, service node 100b, ..., service node 100n respectively, so that the terminal equipment can connect with the business through this network Nodes perform data interaction; business nodes 100a, business nodes 100b, ..., business nodes 100n can respectively connect to consensus nodes 1000a, consensus nodes 1000b, ..., consensus nodes 1000n through the network, so that business nodes can connect to consensus nodes through the network Perform data interaction; business nodes 100a, business nodes 100b, ..., and business nodes 100n are connected to each other to facilitate data interaction between business nodes. Consensus nodes 1000a, consensus nodes 1000b, ..., and consensus nodes 1000n are connected to each other to facilitate consensus Data exchange is possible between nodes.
  • data or block transmission can be performed between blockchain nodes (which may be the above-mentioned service nodes or consensus nodes) through the above-mentioned data connection.
  • the blockchain network can realize the data connection between the blockchain nodes based on the node identification.
  • each blockchain node in the blockchain network it has its corresponding node identification, and each of the above blockchain nodes has It can store the node IDs of other blockchain nodes that are connected to itself, so that the acquired data or generated blocks can be broadcast to other blockchain nodes, such as business nodes, based on the node IDs of other blockchain nodes
  • a node identification list as shown in Table 1 can be maintained in 100a, which stores the node names and node identifications of other blockchain nodes:
  • the node identification can be the protocol (IP, Internet Protocol) address of the interconnection between the networks and any other information that can be used to identify the blockchain nodes in the blockchain network.
  • IP Internet Protocol
  • Table 1 only the IP address is taken as an example. illustrate.
  • the service node 100a can send information (for example, transaction data) to the consensus node 1000a through the node identifier 117.116.189.145, and the consensus node 1000a can determine that the information is sent by the service node 100a through the node identifier 117.114.151.174.
  • connection method it can be directly or indirectly connected by wired communication method, it can also be directly or indirectly connected by wireless communication method, and it can also be connected by other connection methods. No restrictions.
  • the block chain-based data processing method provided by the embodiment of the present application can be executed by computer equipment, which includes but is not limited to the above-mentioned consensus node or service node (which can be a terminal or a server).
  • the above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, Cloud servers for basic cloud computing services such as middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
  • the above-mentioned terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc., but is not limited thereto.
  • any consensus node in the consensus node cluster 1000 can act as a block producing node, obtain multiple transaction data with the same group ID from the transaction pool, and determine each transaction data as group transaction data.
  • the transaction pool is a temporary list that each blockchain node in the blockchain network needs to maintain to store transaction data. Transaction data in the blockchain.
  • the block producing node can pack each group transaction data into the proposed block (the block used to store the group transaction data in the blockchain), and execute each group transaction in the proposed block in sequence data to obtain the executed transaction execution results; if the executed transaction execution results include the transaction execution failure results, the transaction execution results corresponding to each group transaction data are updated to the transaction execution failure results, according to each The transaction execution failure results corresponding to the group transaction data update the proposal block to obtain the target proposal block, and then when the target proposal block consensus is passed, the target proposal block and the transaction execution failure results corresponding to each group transaction data are processed. Bookkeeping.
  • the process of updating the proposed block according to the transaction execution failure result corresponding to each group transaction data to obtain the target proposal block can be: generating a result Merkle tree according to the transaction execution failure result corresponding to each group transaction data , and then add the root hash value of the resulting Merkle tree to the block header of the proposed block to obtain the target proposed block.
  • the bookkeeping process refers to writing the target proposal block and the transaction execution failure results corresponding to each group transaction data into the blockchain ledger for storage.
  • the result Merkle tree is generated directly according to the execution result of the completed transaction, and the root hash value of the Merkle tree of the result is added to the proposal block, get the updated proposed block, and then perform accounting processing on the updated proposed block and the executed transaction execution results.
  • the transaction data in the above-mentioned transaction pool can be sent by any service node in the service node cluster 100, as shown in Figure 1, any service node in the service node cluster 100 can receive the The transaction requests for multi-party cooperative transactions, wherein the number of transaction requests is multiple, and when the number of transaction requests is multiple, they may be sent by the same terminal device or different terminal devices, which is not limited here.
  • multi-party cooperative transaction refers to the scenario where multiple participating objects conduct transactions together, and often one or more transactions may be generated. These transactions should be executed successfully at the same time, and then be written into the blockchain ledger together.
  • any service node in the service node cluster 100 can determine the group identifier corresponding to the multi-party cooperative transaction according to the transaction request, and then generate transaction data with the group identifier according to the group identifier and the transaction request corresponding to the multi-party cooperative transaction, and then Add the transaction data with the group ID into the transaction pool, and wait for the above-mentioned block producers to process it.
  • the terminal devices in the terminal device cluster 10 can directly obtain the group identifier corresponding to the multi-party cooperative transaction, and then generate a transaction request for the multi-party cooperative transaction based on the group identifier, and then send the transaction request carrying the group identifier to the business
  • the service node can directly generate transaction data with the group identifier, and then add the transaction data carrying the group identifier into the transaction pool.
  • Fig. 2a-Fig. 2b are schematic diagrams of a blockchain-based data processing scenario provided by the embodiment of the present application.
  • the terminal device 20a corresponding to user A, the terminal device 20b corresponding to user B, and the terminal device 20c corresponding to user C may be any terminal device in the terminal device cluster 10 in FIG. 1 above,
  • the terminal device 20a can be the terminal device 10a
  • the terminal device 20b can be the terminal device 10b
  • the terminal device 20c can be the terminal device 10n
  • the business node can be a business node 100b; the consensus node 201 shown in Figure 2b can be any business node in the consensus node cluster 1000 in Figure 1 above, for example, the consensus node can be Consensus node 1000a.
  • user A, user B, user C, and user D are participating in a multi-party cooperative transaction f.
  • user A needs to transfer 100 yuan to user B, and user B It is necessary to transfer 60 yuan to user C, and user C needs to transfer 30 yuan to user D. Therefore, user A initiates a transaction request 1 for "transfer 100 yuan from user A to user B" through terminal device 20a, and user B initiates transaction request 1 through terminal device 20b.
  • user C initiates the transaction request 3 of "user C transfers 30 yuan to user D" through the terminal device 20c.
  • user A, user B, and user C are performing federated learning tasks for the item recommendation model.
  • User A has the first part of training data for the item recommendation model
  • user B has the second part of training data for the item recommendation model.
  • Data user C has the third part of training data for the item recommendation model, wherein the first part of training data, the second part of training data and the third part of training data constitute the complete training data for training the item recommendation model.
  • user A initiates a transaction request 1 for "training the item recommendation model through the first part of training data" through the terminal device 20a
  • user B initiates a transaction request 2 for "training the item recommendation model through the second part of training data” through the terminal device 20b
  • the user C initiates a transaction request 3 for "training the item recommendation model through the third part of training data” through the terminal device 20c.
  • the execution of transaction request 2 fails, the execution of transaction request 1 and transaction request 3 succeeds, that is, the item recommendation model is successfully trained through the first part of training data, and the item recommendation model is successfully trained through the third part of training data, but the second part of training The data training item recommendation model fails.
  • the item recommendation model lacks the training of the second part of the training data, which leads to the failure of the item recommendation model training.
  • the transaction data of the training item recommendation model cannot guarantee the success of the multi-party collaborative transaction based on the blockchain, that is, the success of the item recommendation model, as long as the transactions are executed successfully, the success of the multi-party collaborative transaction based on the blockchain is guaranteed to improve the blockchain.
  • the accuracy of the transaction data, and based on the data privacy protection characteristics of federated learning, independently train the model through the respective training data to improve the security of the blockchain transaction data.
  • user A, user B, and user C are conducting collaborative development tasks for the target code.
  • User A needs to develop the first part of the target code
  • user B needs to develop the second part of the target code
  • the user C needs to develop the third part of the object code, wherein the first part of the code, the second part of the code and the third part of the code constitute the complete object code. Therefore, user A initiates transaction request 1 of "development task for the first part of code" through terminal device 20a
  • user B initiates transaction request 2 of "development task for second part of code” through terminal device 20b
  • user C initiates transaction request 2 of "development task for the second part of code” through terminal device 20a.
  • 20c initiates a transaction request 3 of "development task for the third part of code”.
  • the service node 200 After the service node 200 receives transaction request 1, transaction request 2, and transaction request 3, it will determine the group ID corresponding to the multi-party collaborative transaction f, assuming it is the group ID F, and then the service node will The group identifier and transaction request corresponding to the collaborative transaction generate transaction data with the group identifier, that is, as shown in Figure 2a, the service node 200 generates transaction data 1 according to the transaction request 1 and the group identifier F, and the service node 200 generates transaction data 1 according to the transaction request 2 and the group identifier F to generate transaction data 2, and the service node 200 generates transaction data 3 according to the transaction request 3 and the group identifier F.
  • the transaction data 1 , transaction data 2 and transaction data 3 all carry the group identifier F, and then the service node 200 will add the transaction data 1 , transaction data 2 and transaction data 3 into the transaction pool 202 .
  • the transaction pool 202 is a temporary list maintained by each of the blockchain nodes for storing transaction data.
  • the transaction data with the group ID enters the transaction pool, it waits to be packaged into the proposed block by the block producing node.
  • the block producing node is the consensus node 201
  • the consensus node 201 can extract transaction data from the transaction pool 202, package it into a proposed block, and broadcast it to the blockchain network for consensus bookkeeping.
  • the consensus node 201 will determine the transaction data 1, transaction data 2 and transaction data 3 with the group identifier F from the transaction pool as the group transaction data of the same group 2011, and then the group Each group transaction data in 2011 is packaged into the proposed block 2015.
  • the proposed block includes a block header and a block body.
  • Basic data such as version number, time stamp and difficulty value are stored in the block header, and other relevant data can also be stored.
  • the block body is used to store the Transaction data per group. It is understandable that in the proposed block, group transaction data corresponding to multiple groups can be stored, and among the transaction execution results corresponding to the group transaction data corresponding to the same group, one transaction execution result is transaction execution failure As a result, the transaction execution results corresponding to all group transaction data in the group will be updated as transaction execution failure results; the transaction execution results corresponding to group transaction data corresponding to different groups do not affect each other, assuming that the proposed block includes For the group transaction data corresponding to group A and group B respectively, if the execution of group transaction data a in group A fails, the execution result of the transaction corresponding to the group transaction data in group B will not be affected.
  • the consensus node 201 will sequentially execute each group transaction data in the proposed block, that is, sequentially execute group transaction data 2012, group transaction data 2013, and group transaction data 2014, and obtain Assuming that the transaction execution result 2016 corresponding to the group transaction data 2012 is the successful transaction execution result, the transaction execution result 2017 corresponding to the group transaction data 2013 is the successful transaction execution result, and the transaction execution result corresponding to the group transaction data 2014 2018 is the transaction execution failure result, that is, the transaction execution result that has been executed includes the transaction execution failure result, then the consensus node 201 will update the transaction execution result, that is, the transaction execution result corresponding to each group transaction data will be updated as transaction execution failure As a result, after the update is completed, the transaction execution result 2016 corresponding to the group transaction data 2012 is the transaction execution failure result, the transaction execution result 2017 corresponding to the group transaction data 2013 is the transaction execution failure result, and the transaction execution result corresponding to the group transaction data 2014 is 2018 is the result of transaction execution failure.
  • the consensus node 201 will update the proposed block according to the transaction execution failure result corresponding to each group transaction data, obtain the target proposed block, and then perform consensus accounting processing on the target proposed block, that is, through the consensus node cluster in the blockchain After the consensus (which may be the consensus node cluster 1000 shown in FIG. 1 ), the consensus node 201 can perform accounting processing on the target proposed block and the transaction execution failure results corresponding to each group transaction data.
  • Figure 3 is a schematic flowchart of a blockchain-based data processing method provided by the embodiment of the present application.
  • the method can be executed by a consensus node (for example, the consensus node in the above-mentioned FIG. 1 ), or by a service node, a consensus node (for example, the consensus node in the embodiment corresponding to the above-mentioned FIG.
  • the terminal device in the above-mentioned embodiment corresponding to FIG. 1) executes together.
  • the following will take this method executed by a consensus node as an example, wherein the blockchain-based data processing method may at least include the following steps S101-step S104:
  • step S101 the consensus node determines multiple transaction data with the same group ID in the transaction pool as group transaction data.
  • the group identifier is used to identify the transaction group to which the transaction data belongs.
  • the transaction data contained in the same transaction group has the same group identifier.
  • the group identifier is unique, that is, different transaction groups correspond to The group identifiers of different transaction groups correspond to different group identifiers.
  • the transaction group in the embodiment of this application is to Multiple related transactions in the blockchain are added to the same transaction group, and the transaction group has the following characteristics: all transactions in the transaction group are executed successfully, or all of them fail to be executed.
  • the business node After the business node generates the transaction data, it will add the transaction data to the transaction pool, and then wait for the consensus node with block generation function (that is, the block generation node) to take the transaction data out of the transaction pool and pack it into the proposed block middle.
  • the transaction data corresponding to the transactions added to the same transaction group will carry the group identifier, and the consensus node will determine multiple transaction data with the same group identifier in the transaction pool as the group transaction data.
  • the process for the consensus node to determine the group transaction data may be: the consensus node may obtain the transaction data from the transaction pool.
  • the transaction data includes a group identifier and a group transaction quantity.
  • the group transaction quantity refers to the quantity of transactions included in the transaction group corresponding to the group identifier.
  • the consensus node can add the transaction data to the group cache queue corresponding to the group ID to obtain the updated group cache queue; when the number of transaction data in the updated group cache queue is equal to the number of group transactions, the updated The transaction data in the group cache queue is determined as group transaction data; when the amount of transaction data in the updated group cache queue is less than the group transaction quantity, continue to obtain transaction data including the group identifier from the transaction pool.
  • the group cache queue is used to temporarily store the transaction data corresponding to some transactions in the transaction group that the consensus node has obtained. Created after the transaction data in the group cache queue, when the transaction data in the group cache queue is packaged into the blockchain, the transaction data in the group cache queue will be empty, and the resources occupied by the group cache queue will also be released , that is, the consensus node will delete the group cache queue.
  • the consensus node obtains transaction data A, which contains the group identifier m and the number of group transactions, where the number of group transactions is 3, and then the consensus node will add transaction data A to the group In the group cache queue corresponding to the identifier m, the update cache queue is obtained. It should be noted that if the consensus node does not find the group cache queue corresponding to the group identifier m, the consensus node will first create a cache queue corresponding to the group identifier m The group cache queue, and then add transaction data A to the group cache queue. For example, the size of the group cache queue can be dynamically adjusted according to the number of group transactions to avoid occupying too much memory resources.
  • the consensus node will determine the number of transaction data in the update cache queue. Assuming that the group cache queue contains the previously added transaction data B, then the number of transaction data in the update cache queue is 2, which is less than the number of group transactions.
  • the consensus The node will continue to obtain new transaction data from the transaction pool, determine the group ID corresponding to the new transaction data, add the new transaction data to the group cache queue corresponding to the group ID m, and then repeat the above process. Until the group identifier corresponding to the new transaction data C obtained by the consensus node is the group identifier m, the consensus node will add the transaction data C to the update group cache queue to obtain a new update group cache queue.
  • the new update group cache queue contains transaction data A, transaction data B and transaction data C. The number of transaction data is 3, which is equal to the number of group transactions.
  • the consensus node will transfer transaction data A, transaction data B and transaction data C is determined to be the group transaction data corresponding to the same transaction group.
  • the process of continuing to obtain the transaction data containing the target group identifier from the transaction pool can be: when the update group When the amount of transaction data in the group cache queue is less than the number of group transactions, and the current time is within the cache time period, continue to obtain transaction data including the group identifier from the transaction pool.
  • the transaction data in the update group cache queue will be put back into the transaction pool, and the update group cache will be cleared queue.
  • the group identifiers of different transaction groups correspond to different group cache queues. If the consensus node has not obtained all the transaction data belonging to the same transaction group, the group cache queue will always occupy the consensus node memory resources, thus wasting a lot of memory resources, so you can set the cache time period, that is, the maximum time period that a group cache queue can exist from the creation, if the group cache queue exists for longer than the cache time period, it will be The transaction data in the group cache queue is put back into the transaction pool, and the group cache queue is cleared to prevent the group cache queue from occupying the memory resources of the consensus nodes, thereby saving memory resources.
  • Step S102 pack the transaction data of each group into the proposed block, execute the transaction data of each group in the proposed block, and obtain the executed transaction execution result.
  • the group transaction data may include an execution sequence identifier, which refers to the execution order of the transactions in the transaction group, and the process of packaging each group transaction data into the proposed block can be It is: according to the execution sequence identification contained in each group transaction data, sort each group transaction data to obtain the sorted group transaction data; then pack the sorted group transaction data into the proposed block . Subsequently, the consensus node will sequentially execute each group transaction data in the proposed block according to the packaging order of the group transaction data, and obtain the executed transaction execution results.
  • an execution sequence identifier refers to the execution order of the transactions in the transaction group
  • each group transaction data in the proposed block may be executed according to the order in which the group transaction data is packaged.
  • each group transaction data in the proposed block can also be executed randomly.
  • the process of executing each group transaction data in the proposed block to obtain the execution result of the executed transaction can be To: obtain the kth group transaction data in the proposed block, execute the kth group transaction data, and obtain the transaction execution result corresponding to the kth group transaction data.
  • k is a positive integer that increases sequentially, and k is smaller than S.
  • the transaction execution result corresponding to the kth group transaction data is a successful transaction execution result, continue to execute the k+1th group transaction data in the proposed block; when the transaction execution result corresponding to the kth group transaction data If it is a transaction execution failure result, the transaction execution results corresponding to the k+1th group transaction data to the Sth group transaction data in the proposed block are all determined as the transaction execution failure result, and each group transaction The transaction execution results corresponding to the data are regarded as the executed transaction execution results.
  • the consensus node when the consensus node sequentially executes the transaction data of each group in the proposed block, when the transaction execution result of a group transaction data is the result of transaction execution failure, it can The transaction execution results of other group transaction data ranked after the group transaction data are directly determined as transaction execution failure results, no further calculation is required, and computing resources can be saved.
  • the proposed block contains group transaction data a, group transaction data b, group transaction data c, and group transaction data d, then the consensus node executes the group transaction data first when executing the proposed block Transaction Data a. Assuming that the transaction execution result corresponding to the group transaction data a is a successful transaction execution result, continue to execute the group transaction data b.
  • the consensus node does not need to execute group transaction data c and group transaction data d, and can directly convert group transaction data c and group transaction data d respectively
  • the corresponding transaction execution result is determined as a transaction execution failure result.
  • the transaction execution results that have been executed at this time are: the transaction execution success result corresponding to the group transaction data a, the transaction execution failure result corresponding to the group transaction data b, the transaction execution failure result corresponding to the group transaction data c, the group transaction execution failure result The transaction execution failure result corresponding to data d.
  • the process of executing the kth group transaction data may be: call the transaction execution function in the smart contract used to execute the group transaction data; obtain the transaction data for the kth group according to the transaction execution function The historical transaction data, determine the historical transaction data as the read data; then execute the transaction execution function according to the read data and the group transaction data, and obtain the transaction execution result of the group transaction data.
  • the group transaction data corresponding to the kth transaction is that Party A transfers 10 yuan to Party B through its own account
  • the transaction execution function k corresponding to the kth group transaction data is the transfer execution function
  • the kth group transaction data The corresponding historical transaction data k is the remaining 20 yuan in Party A’s account
  • Step S103 when the completed transaction execution results include transaction execution failure results, update the transaction execution results corresponding to each group transaction data to the transaction execution failure results, and execute according to the transaction execution results corresponding to each group transaction data If it fails, update the proposal block and get the target proposal block.
  • the consensus node will to update the proposed block.
  • the consensus node will update the transaction execution result corresponding to each group transaction data to the transaction execution failure result, and then according to each group transaction data
  • the corresponding transaction execution failure result updates the proposed block to obtain the target proposed block.
  • the completed transaction execution results obtained in the above step S102 are: the transaction execution success result corresponding to group transaction data a, the transaction execution failure result corresponding to group transaction data b, and the transaction execution failure result corresponding to group transaction data c
  • the execution of the transaction corresponding to the group transaction data d fails.
  • the consensus node will update the transaction execution success result corresponding to the group transaction data a to the transaction execution failure result.
  • the transaction execution results corresponding to each group transaction data are all transaction execution failure results.
  • the proposed block is updated according to the transaction execution failure result corresponding to each group transaction data, and the target proposal block is obtained, including: generating the result Merkel according to the transaction execution failure result corresponding to each group transaction data tree, wherein the resulting Merkle tree includes the tree root hash value, and then adds the tree root hash value to the block header of the proposed block to obtain the target proposed block.
  • the resulting Merkle tree is a Merkle tree (also known as a hash tree), and the Merkle tree is a data structure, that is, a binary tree.
  • a Merkle tree consists of a root, branches (non-leaf nodes in the middle), and leaf nodes. All nodes store the hash value of related data (rather than the related data itself). For example, the root node stores the hash value of the tree root, not the data of the tree root itself.
  • Step S104 when the consensus of the target proposed block is passed, the transaction execution failure results corresponding to the target proposed block and each group transaction data are accounted for.
  • bookkeeping refers to adding group transaction data in the target proposal block and transaction execution failure results corresponding to each group transaction data to the blockchain ledger for storage.
  • the consensus node can broadcast the proposed block to the communicable consensus node in the consensus network, and the communicable consensus node is used to execute each group transaction data in the proposed block, and then according to each group transaction The transaction execution result corresponding to the data updates the proposed block to obtain a communicable target proposed block.
  • the consensus node receives the block hash value of the communicable target proposed block sent by the communicable consensus node, and at the same time, can also broadcast the block hash value of the target proposed block to the communicable consensus nodes in the consensus network.
  • the consensus node determines the block hash value of the communicable target proposed block as the hash value of the block to be matched; then compares the hash value of the block to be matched with the block hash value of the target proposed block. When the number of block hash values to be matched that are the same as the block hash value of the target proposed block is greater than the consensus number threshold, it is determined that the consensus of the target proposed block is passed.
  • multiple transaction data with the same group ID in the transaction pool can be determined as group transaction data; then each group transaction data is packaged into the proposal block, and the proposal block is executed For each group transaction data in the block, the executed transaction execution result is obtained; if the executed transaction execution result contains the transaction execution failure result, the transaction execution result corresponding to each group transaction data is updated as Transaction execution failure results, update the proposed block according to the transaction execution failure results corresponding to each group transaction data, and obtain the target proposed block; finally, when the target proposed block consensus is passed, the target proposed block and each group transaction The transaction execution failure results corresponding to the data are accounted for.
  • the transaction execution results of each group transaction data are bound to ensure that multiple transactions generated under multi-party collaborative transactions are all successfully executed or all executed fail, It can avoid the execution failure of some group transaction data generated under multi-party collaborative transactions, and write the group transaction data of some successful transactions into the blockchain. Therefore, only when all group transaction data are successfully executed can the blockchain-based Multi-party collaborative transactions are successful, thereby improving the accuracy of blockchain transaction data.
  • FIG. 4 is a schematic flowchart of a blockchain-based data processing method provided by an embodiment of the present application.
  • the method may be executed by a service node (for example, the service node in the above-mentioned embodiment corresponding to FIG. 1 ), or by a service node, a consensus node (for example, the consensus node in the above-mentioned embodiment corresponding to FIG. 1 ), a terminal
  • the devices for example, the terminal device in the above embodiment corresponding to FIG. 1 ) execute together.
  • the following will take this method executed by a service node as an example, wherein the blockchain-based data processing method may at least include the following steps S201-step S203:
  • step S201 the service node receives a transaction request for a multi-party cooperative transaction sent by a terminal device.
  • a multi-party cooperative transaction refers to a transaction that multiple participants participate in and complete, and a multi-party cooperative transaction generates multiple transaction requests. These transaction requests can be initiated through the same terminal device or through different terminal devices. It should be noted that the transaction requests generated by multi-party collaborative transactions can also be sent to different business nodes. For ease of understanding, the subsequent steps will only be described by taking the transaction requests sent to the same business node as an example.
  • Step S202 Determine the group ID corresponding to the multi-party collaborative transaction according to the transaction request.
  • the process of determining the group identifier corresponding to the multi-party collaborative transaction according to the transaction request may be: when the execution sequence is obtained When identifying the transaction request whose sequence priority is the highest priority, determine the transaction request with the highest priority as the group identification request; then perform hash processing on the group identification request to obtain the request hash Value, determine the request hash value as the group ID corresponding to the multi-party collaborative transaction.
  • the execution order identifier is used to indicate the order in which the transaction requests are executed, and the transaction request with the highest priority refers to the first executed transaction request indicated by the execution order identifier.
  • the process of determining the group identifier corresponding to the multi-party collaborative transaction according to the transaction request may also be: obtaining the collaborative transaction initiation object from the transaction request; Then, in the identity identification database, the identity identification corresponding to the object initiating the collaborative transaction is searched; and the group identification corresponding to the multi-party cooperative transaction is generated according to the identification identification.
  • the initiating object of the collaborative transaction may refer to the initiating object of the multi-party collaborative transaction, for example, Party A when a two-person transaction signs a contract.
  • the identity identification library is used to store the identity identification of each transaction object (that is, the initiator of the multi-party collaborative transaction).
  • the transaction object refers to the object that can initiate a transaction request, and any transaction object can be used as a collaborative transaction initiation object, and invite other transaction objects to participate in multi-party collaborative transactions.
  • the identity is unique, that is, one transaction object corresponds to one identity, and different transaction objects correspond to different identities.
  • the process of generating the group identifier corresponding to the multi-party collaborative transaction according to the identity identifier can be as follows: the business node obtains the current timestamp, and then adds the current timestamp after the identity identifier to obtain a unique identifier, which can be used as a multi-party The group ID corresponding to the collaborative transaction.
  • a terminal device before a terminal device initiates a transaction request for a multi-party cooperative transaction, it may first apply for a corresponding group identifier for the multi-party cooperative transaction, and then when the terminal device initiates a transaction request for a multi-party cooperative transaction, it may directly Carry the group ID of the application.
  • the specific implementation process of the group identification application can be as follows: the service node obtains the identification acquisition request for the multi-party collaborative transaction initiated by the collaborative transaction initiation object, wherein the identification acquisition request includes the transaction object participating in the multi-party collaborative transaction.
  • the business node can generate an available group ID for multi-party collaborative transactions according to the ID acquisition request, and then send the available group ID to the terminal device corresponding to the transaction object, so that the terminal device corresponding to the transaction object can generate a transaction containing the available group ID ask.
  • the process of determining the group identifier corresponding to the multi-party cooperative transaction according to the transaction request may be: determining the available group identifier in the transaction request as the group identifier corresponding to the multi-party cooperative transaction.
  • the terminal device can also directly send a group identification application request (i.e. identification acquisition request) to the service node, and then receive the QR code image issued by the service node, obtain the group ID by scanning the QR code image, and then obtain the group ID according to The group ID generates a transaction request containing the available group IDs.
  • a group identification application request i.e. identification acquisition request
  • the transaction request usually carries signature data, wherein the signature data is obtained after the terminal device signs the transaction request with a private key.
  • the service node will obtain the public key corresponding to the terminal device, and then use the public key to verify the signature data to obtain the signature verification result; when the signature verification result is the result of the signature verification, it is determined that the transaction request is legal, and then continue to determine the The group ID corresponding to the collaborative transaction.
  • Step S203 generating transaction data with the group ID according to the group ID corresponding to the multi-party collaborative transaction and the transaction request, and adding the transaction data to the transaction pool.
  • multiple transaction data with the same group ID in the transaction pool will be determined by the consensus node as group transaction data.
  • the consensus node packs the transaction data of each group into the proposed block, executes the transaction data of each group in the proposed block in sequence, and obtains the executed transaction execution result; when the executed transaction execution result contains When the transaction execution fails, the consensus node will update the transaction execution result corresponding to each group transaction data to the transaction execution failure result.
  • a unique group identifier for a multi-party collaborative transaction can be generated, and the transaction data generated based on the transaction request generated during the multi-party collaborative transaction process will carry the group identifier and be sent to
  • multiple transaction data with the same group ID in the transaction pool will be determined by the consensus node as group transaction data, and the transaction execution results of each group transaction data are related, as long as there is a group transaction If the transaction execution result of the data is the transaction execution failure result, the transaction execution results of the rest of the group transaction data will be updated as the transaction execution failure result, so as to ensure that all the multiple transactions generated under the multi-party collaborative transaction are all successfully executed or all executed fail.
  • FIG. 5 is a schematic flowchart of a group transaction data execution method provided by the embodiment of the present application. This method can be implemented by any node in the blockchain network (which can be the The business node shown can also be executed as the consensus node shown in Figure 1 above).
  • the group transaction data execution method may include the following steps S1-step S5:
  • Step S1 the remote procedure call (RPC, Remote Procedure Call) layer in each node obtains the transaction request.
  • RPC Remote Procedure Call
  • the transaction request may carry a group identifier, and may also carry basic information of a multi-party cooperative transaction, so that the node can obtain the group identifier for the transaction request.
  • Step S2 each node broadcasts transactions to each other, and one of the nodes acts as a block producing node to package several transactions into a block and broadcast it to other nodes.
  • the selection of block producing nodes varies according to the consensus algorithm, and can include leader (leader) producing blocks, taking turns to produce blocks, computing power competition to produce blocks, etc.
  • the nodes that obtain the transaction request through the RPC layer will generate transaction data (that is, transaction data) with a group identifier, then broadcast it to each other, and add it to the transaction pool.
  • transaction data that is, transaction data
  • the block producing node packs several transactions into a block, it will use the transaction data with the same group ID as the group transaction data of the same group.
  • Step S3 After each node receives the block, it starts to execute the transaction in the block for logic calculation.
  • the transaction parameters are parsed and the contract is executed.
  • node 1 in FIG. 5 reads historical transaction data from the storage space.
  • each node when each node executes the transaction in the block, it will take the group transaction data of the same group as a whole, execute each group transaction data in the group in sequence, and obtain the executed If the executed transaction execution results include transaction execution failure results, the transaction execution results corresponding to each group transaction data in the group will be updated to the transaction execution failure results to ensure that the group The group transaction data in is either all executed successfully, or all executed failed.
  • Step S4 after the execution of the contract is completed, each node checks the execution result (that is, the transaction execution result corresponding to each group transaction data mentioned above) with each other.
  • the verification method can be to organize the execution results or changes to the storage into a result merkle tree, put the result tree root (that is, the result root hash) into the block header, and finally verify that the block hashes of each node are consistent.
  • Step S5. After the consensus is successful, each node writes the data related to this block into the storage space.
  • relevant data include block header, all transactions contained in the block, contract execution results, etc.
  • step S1-step S5 For the detailed process of the above step S1-step S5, reference may be made to the embodiment corresponding to FIG. 3 and the embodiment corresponding to FIG. 4, and details will not be repeated here.
  • FIG. 6 is a schematic diagram of a transaction group realization scenario provided by an embodiment of the present application. Assume that there are participant A, participant B and participant C participating in a multi-party collaborative transaction. Participant A generates transaction a, participant B generates transaction b, and participant C generates transaction c. In the method provided in the embodiment of this application, these three transactions can be added to the same transaction group.
  • the transaction group is regarded as the smallest execution unit, and all transactions in a transaction group must be successful at the same time, so as to ensure that the three parties of participant A, participant B, and participant C all receive There is a mutual transfer; or both fail, the money is returned to the original owner, and no one suffers a loss.
  • the group number field can be added to the transaction request corresponding to the transaction.
  • the group number field in the transaction request 61 corresponding to transaction a is "group ID: 5, execution sequence ID: 1, group Number of transactions: 3", which means that the group ID of the transaction group to which the transaction request 61 belongs is 5.
  • This transaction group contains three transactions, and the transaction a corresponding to the transaction request 61 is the first in the transaction group a deal.
  • the group number field in the transaction request 62 corresponding to transaction b is "group ID: 5, execution sequence ID: 2, group transaction quantity: 3", which represents the group of the transaction group to which the transaction request 62 belongs.
  • the group ID is 5, the transaction group contains three transactions, and the transaction b corresponding to the transaction request 62 is the second transaction in the transaction group; the group number field in the transaction request 63 corresponding to the transaction c is "Group ID: 5, Execution Sequence ID: 3, Group Transaction Quantity: 3", which means that the group ID of the transaction group to which the transaction request 63 belongs is 5, which contains three transactions, and The transaction c corresponding to the transaction request 63 is the third transaction in the transaction group.
  • the execution order identification may be jointly decided by the three participants in advance, or may be determined according to the initiation time of the transaction request, which is not limited here. Participant A, participant B, and participant C can obtain the group identifier for this multi-party collaborative transaction through various methods, such as the method for obtaining the group identifier described in step S202 in the embodiment corresponding to Figure 4 above .
  • each participant sends out its own transaction request and signs it with its own private key to obtain the signature data, and then sends the transaction request and signature data to the blockchain system together.
  • the blockchain system verifies the received transaction request through the signature data, it will generate corresponding transaction data, and then package the transaction data with the same group ID as group transaction data into the same proposed block, which is understandable , if the transaction data in a transaction group is not collected, the blockchain system will wait for a certain period of time. Then, the blockchain system executes the proposed block and executes transactions in units of transaction groups. If any transaction in the transaction group fails to execute, it can be considered that the transaction group has failed.
  • the transaction execution results of the group transaction data corresponding to each transaction will be updated with the transaction failure result. Finally, the blockchain system will consensus and store the executed proposed block. It should be noted that the acquisition of the group ID can also be completed through the blockchain system, that is, the participants in the multi-party collaborative transaction do not need to obtain the group ID, but only need to send the transaction request to the blockchain system, and the blockchain system will It assigns a group ID.
  • FIG. 7 is a schematic flowchart of a transaction group implementation provided by an embodiment of the present application.
  • the transaction data corresponding to the transactions generated by the terminal device 71 and the terminal device 72 can be put into the transaction pool, waiting to be packaged into the proposed block by the consensus node 73 as the block producing node.
  • Consensus node 73 generates blocks according to the consensus algorithm, during which the transaction data with the same group ID will be put into the group cache queue for caching, until the transactions corresponding to all the transactions in the transaction group corresponding to the group ID are obtained data, and then pack all the transaction data in the complete group as group transaction data into the proposed block, and then the consensus node 73 will broadcast the proposed block to other consensus nodes in the blockchain system.
  • the consensus node 73 executes the group transaction data corresponding to each transaction group in the proposed block. For the specific execution process, please refer to the description of the embodiment corresponding to FIG. 3 above, which will not be repeated here. After the consensus node 73 executes the proposed block and reaches a consensus on the proposed block with other consensus nodes, it will notify the terminal device 71 and the terminal device 72 of the result.
  • FIG. 8 is a schematic structural diagram of a blockchain-based data processing device provided by an embodiment of the present application.
  • the data processing device may be a computer program (including program code) running on a computer device, for example, the data processing device is an application software; the device may be used to execute the corresponding steps in the data processing method provided by the embodiment of the present application.
  • the data processing device 1 may include: a group determination module 11 , a packaging module 12 , a block execution module 13 , a result update module 14 , a block update module 15 and an accounting module 16 .
  • the group determination module 11 is configured to determine a plurality of transaction data having the same group identifier in the transaction pool as group transaction data;
  • Packing module 12 configured to pack each of the group transaction data into a proposed block
  • the block execution module 13 is configured to pack each of the group transaction data into a proposed block, execute each of the group transaction data in the proposed block, and obtain an executed transaction execution result;
  • the result update module 14 is configured to update the transaction execution result corresponding to each of the group transaction data to the transaction execution failure result when the completed transaction execution result includes a transaction execution failure result;
  • the block update module 15 is configured to update the proposed block according to the transaction execution failure result corresponding to each of the group transaction data to obtain the target proposed block;
  • the accounting module 16 is configured to perform accounting processing on the target proposed block and the transaction execution failure results corresponding to each of the group transaction data when the consensus of the target proposed block is passed.
  • step S101 in the above-mentioned embodiment corresponding to FIG. 3 -
  • step S104 The description of step S104 will not be repeated here.
  • the group determination module 11 may include: an acquisition unit 111 , a data addition unit 112 , a first determination unit 113 and a second determination unit 114 .
  • the obtaining unit 111 is configured to obtain the transaction data from a transaction pool, wherein the transaction data includes a group identifier and a group transaction quantity; a data adding unit 112 is configured to add the transaction data to the group Identify the corresponding group cache queue to obtain an updated group cache queue; the first determination unit 113 is configured to, when the amount of transaction data in the updated group cache queue is equal to the group transaction amount, set the Update the transaction data in the group cache queue, and determine it as group transaction data; the second determination unit 114 is configured to, when the amount of transaction data in the update group cache queue is less than the group transaction amount, from the continue to obtain the transaction data including the group identifier from the transaction pool.
  • the specific implementation manners of the obtaining unit 111, the data adding unit 112, the first determining unit 113 and the second determining unit 114 can refer to the description of step S101 in the embodiment corresponding to FIG. 3 above, and will not be repeated here.
  • the second determining unit 114 may include: a first judging subunit 1141 and a second judging subunit 1142 .
  • the first judging subunit 1141 is configured to, when the number of transaction data in the update group cache queue is less than the number of group transactions, and the current time is within the cache time period, continue to obtain from the transaction pool The transaction data identified by the group; the second judging subunit 1142, configured to update the transaction data in the group cache queue when the quantity is less than the group transaction quantity and the current time exceeds the cache time period , putting the transaction data in the update group cache queue back into the transaction pool, and emptying the update group cache queue.
  • step S101 for the specific implementation manners of the first judging subunit 1141 and the second judging subunit 1142, reference may be made to the description of step S101 in the above embodiment corresponding to FIG. 3 , which will not be repeated here.
  • each group transaction data includes an execution sequence identifier; please refer to FIG. 8 , the packing module 12 may include: a sorting unit 121 and a packing unit 122 .
  • the sorting unit 121 is configured to sort each of the group transaction data according to the execution order identifier contained in each of the group transaction data, and obtain the sorted group transaction data; the packaging unit 122 is configured to To pack the sorted group transaction data into the proposed block.
  • step S102 for the specific implementation manners of the sorting unit 121 and the packaging unit 122, reference may be made to the description of step S102 in the above embodiment corresponding to FIG. 3 , which will not be repeated here.
  • the quantity of the group transaction data is S, and S is a positive integer greater than 1; please refer to FIG. Unit 133.
  • the transaction execution unit 131 is configured to acquire the kth group transaction data in the proposed block, execute the kth group transaction data, and obtain the transaction execution result corresponding to the kth group transaction data, wherein , k is a sequentially increasing positive integer, and k is less than S; the first result determining unit 132 is configured to continue to execute the proposal when the transaction execution result corresponding to the kth group transaction data is a successful transaction execution result The k+1th group transaction data in the block; the second result determination unit 133 is configured to: when the transaction execution result corresponding to the kth group transaction data is a transaction execution failure result, the proposed block Among them, the transaction execution results corresponding to the k+1th group transaction data to the Sth group transaction data are all determined as the transaction execution failure results.
  • step S102 for the specific implementation of the transaction execution unit 131 , the first result determination unit 132 and the second result determination unit 133 , please refer to the description of step S102 in the above embodiment corresponding to FIG. 3 , which will not be repeated here.
  • the block updating module 15 may include: a tree generating unit 151 and a tree adding unit 152 .
  • the tree generating unit 151 is configured to generate a result Merkle tree according to the transaction execution failure result corresponding to each of the group transaction data, wherein the result Merkle tree includes a tree root hash value; the tree adding unit 152 , configured to add the tree root hash value to the block header of the proposed block to obtain the target proposed block.
  • step S103 For the specific implementation manners of the tree generating unit 151 and the tree adding unit 152, reference may be made to the description of step S103 in the above embodiment corresponding to FIG. 3 , which will not be repeated here.
  • the data processing device 1 may further include: a broadcast module 17 , a hash value processing module 18 and a consensus module 19 .
  • the broadcast module 17 is configured to broadcast the proposed block to a communicable consensus node in the consensus network, wherein the communicable consensus node is used to execute each of the group transaction data in the proposed block, Update the proposed block according to the transaction execution result corresponding to each of the group transaction data to obtain a communicable target proposed block;
  • the hash value processing module 18 is configured to receive the communicable consensus node sent Communicating the block hash value of the target proposed block, determining the block hash value of the communicable target proposed block as the hash value of the block to be matched;
  • the consensus module 19 is configured to When the number of block hash values to be matched with the same block hash value is greater than the consensus number threshold, it is determined that the consensus of the target proposed block is passed.
  • the specific implementation manners of the broadcast module 17, the hash value processing module 18 and the consensus module 19 can refer to the description of step S104 in the above embodiment corresponding to FIG. 3, and will not be repeated here.
  • FIG. 9 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the data processing apparatus 1 in the embodiment corresponding to the above-mentioned FIG. 9000 also includes: a user interface 9003, and at least one communication bus 9002.
  • the communication bus 9002 is used to realize connection and communication between these components.
  • the user interface 9003 may include a display screen (Display) and a keyboard (Keyboard), and the optional user interface 9003 may also include a standard wired interface and a wireless interface.
  • the network interface 9004 may include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 9005 can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory.
  • the memory 9005 may also be at least one storage device located away from the aforementioned processor 9001 .
  • the memory 9005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
  • the network interface 9004 can provide a network communication function;
  • the user interface 9003 is mainly used to provide an input interface for the user; and
  • the processor 9001 can be used to call the device control application stored in the memory 9005 program to achieve:
  • the transaction execution results corresponding to each of the group transaction data are updated to the transaction execution failure results, and according to each of the group transaction data corresponding The transaction execution failure result updates the proposed block to obtain the target proposed block;
  • the computer device 1000 described in the embodiment of the present application can execute the description of the data processing method in the previous embodiments, and can also execute the description of the data processing device 1 in the embodiment corresponding to FIG. 8 above. This will not be repeated here. In addition, the description of the beneficial effect of adopting the same method will not be repeated here.
  • the embodiment of the present application also provides a computer-readable storage medium, and the above-mentioned computer-readable storage medium stores the computer program executed by the aforementioned data processing device 1, when the above-mentioned processing
  • the computer loads and executes the above-mentioned computer program
  • it can execute the description of the above-mentioned data processing method in any of the above-mentioned embodiments, so details will not be repeated here.
  • the description of the beneficial effect of adopting the same method will not be repeated here.
  • FIG. 10 is a schematic structural diagram of another blockchain-based data processing device provided by an embodiment of the present application.
  • the above-mentioned data processing device may be a computer program (including program code) running in a computer device, for example, the data processing device is an application software; the data processing device may be used to execute the corresponding steps in the method provided by the embodiment of the present application .
  • the data processing device 2 may include: a request receiving module 21 , an identifier determining module 22 and a data adding module 23 .
  • the request receiving module 21 is configured to receive a transaction request sent by a terminal device for a multi-party cooperative transaction
  • the identification determination module 22 is configured to determine the group identification corresponding to the multi-party collaborative transaction according to the transaction request;
  • the data adding module 23 is configured to generate transaction data with a group identifier according to the group identifier corresponding to the multi-party collaborative transaction and the transaction request, and add the transaction data to the transaction pool;
  • the transaction data is used for the consensus node to determine as group transaction data, and the consensus node is used to package each of the group transaction data
  • the consensus node is used to package each of the group transaction data
  • execute each of the group transaction data in the proposed block to obtain the executed transaction execution result; the consensus node is also used in the executed transaction execution result
  • the transaction execution result corresponding to each group of transaction data is updated to the transaction execution failure result.
  • the request receiving module 21 the identifier determining module 22 and the data adding module 23 , refer to the description of steps S201 - S203 in the above embodiment corresponding to FIG. 4 , which will not be repeated here.
  • the transaction request carries signature data
  • the signature data is obtained after the terminal device signs the transaction request through a private key
  • the data processing device 2 may also include: a signature module twenty four.
  • the signature module 24 is configured to obtain the public key corresponding to the terminal device; the signature module 24 is also configured to perform signature verification processing on the signature data through the public key to obtain a signature verification result; the signature module 24 is also configured to When the signature verification result is a successful signature verification result, the notification identifier determining module 22 determines the group identifier corresponding to the multi-party cooperative transaction according to the transaction request.
  • step S202 for the specific implementation manner of the signature module 24, reference may be made to the description of step S202 in the above embodiment corresponding to FIG. 4 , which will not be repeated here.
  • the identifier determination module 22 may include: a first identifier determination unit 221 .
  • the first identifier determination unit 221 is configured to determine the transaction request whose order priority is the highest priority as a group identifier request when obtaining the transaction request whose order priority indicated by the execution order identifier is the highest priority
  • the first identifier determining unit 221 is further configured to perform hash processing on the group identifier request to obtain a request hash value, and determine the request hash value as the group identifier corresponding to the multi-party collaborative transaction.
  • step S202 for a specific implementation manner of the first identifier determining unit 221, reference may be made to the description of step S202 in the above embodiment corresponding to FIG. 4 , which will not be repeated here.
  • the transaction request includes a collaborative transaction initiation object that initiates a multi-party cooperative transaction; referring to FIG. 10 , the identification determination module 22 may include: a second identification determination unit 222 .
  • the second identifier determining unit 222 is configured to obtain the collaborative transaction initiation object from the transaction request; the second identifier determination unit 222 is also configured to search for the identity identifier corresponding to the collaborative transaction initiation object in the identity identifier database The second identifier determining unit 222 is further configured to generate a group identifier corresponding to the multi-party collaborative transaction according to the identifier.
  • step S202 for a specific implementation manner of the second identifier determining unit 222, reference may be made to the description of step S202 in the above-mentioned embodiment corresponding to FIG. 4 , which will not be repeated here.
  • the data processing device 2 may further include: an identifier generation module 25 .
  • the identification generation module 25 is configured to obtain an identification acquisition request for a multi-party cooperative transaction initiated by the cooperative transaction initiation object, wherein the identification acquisition request includes the transaction object participating in the multi-party cooperative transaction; the identification generation module 25 is also configured To generate an available group identifier for the multi-party collaborative transaction according to the identifier acquisition request; the identifier generation module 25 is further configured to send the available group identifier to the terminal device corresponding to the transaction object, wherein the The terminal device corresponding to the transaction object generates a transaction request including the available group identifier.
  • the identity determining module 22 may include: a third identity determining unit 223 .
  • the third identifier determining unit 223 is configured to determine the available group identifier in the transaction request as the group identifier corresponding to the multi-party collaborative transaction.
  • step S202 for specific implementation manners of the identifier generating module 25 and the third identifier determining unit 223, reference may be made to the description of step S202 in the above embodiment corresponding to FIG. 4 , which will not be repeated here.
  • FIG. 11 is a schematic structural diagram of another computer device provided by an embodiment of the present application.
  • the data processing apparatus 2 in the above-mentioned embodiment corresponding to Figure 10 can be applied to the above-mentioned computer equipment 2000, and the above-mentioned computer equipment 2000 can include: a processor 2001, a network interface 2004 and a memory 2005, in addition, the above-mentioned computer equipment 2000 also includes: a user interface 2003 , and at least one communication bus 2002 .
  • the communication bus 2002 is used to realize connection and communication between these components.
  • the user interface 2003 may include a display screen (Display) and a keyboard (Keyboard), and the optional user interface 2003 may also include a standard wired interface and a wireless interface.
  • the network interface 2004 may include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 2005 can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory.
  • the memory 2005 may also be at least one storage device located away from the aforementioned processor 2001 .
  • the memory 2005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
  • the network interface 2004 can provide a network communication function;
  • the user interface 2003 is mainly used to provide an input interface for the user;
  • the processor 2001 can be used to call the device control application stored in the memory 2005 program to achieve:
  • the transaction data is used for the consensus node to determine as group transaction data, and the consensus node is used to package each of the group transaction data
  • the consensus node is used to package each of the group transaction data
  • execute each of the group transaction data in the proposed block to obtain the executed transaction execution result; the consensus node is also used in the executed transaction execution result
  • the transaction execution result corresponding to each group of transaction data is updated to the transaction execution failure result.
  • the computer device 2000 described in the embodiment of the present application can execute the description of the access control method in the previous embodiments, and can also execute the description of the data processing device 2 in the embodiment corresponding to FIG. 10 above. This will not be repeated here. In addition, the description of the beneficial effect of adopting the same method will not be repeated here.
  • the embodiment of the present application also provides a computer-readable storage medium, and the above-mentioned computer-readable storage medium stores the computer program executed by the aforementioned data processing device 2, when the above-mentioned processing
  • the computer loads and executes the above-mentioned computer program, it can execute the description of the above-mentioned access control method in any of the above-mentioned embodiments, so details will not be repeated here.
  • the description of the beneficial effect of adopting the same method will not be repeated here.
  • the above-mentioned computer-readable storage medium may be the data processing apparatus provided in any one of the foregoing embodiments or an internal storage unit of the above-mentioned computer equipment, such as a hard disk or memory of the computer equipment.
  • the computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (SMC, Smart Media Card), a secure digital (SD, Secure Digital) card, Flash card (flash card), etc.
  • the computer readable storage medium may also include both internal storage units of the computer device and external storage devices.
  • the computer-readable storage medium is used to store the computer program and other programs and data required by the computer device.
  • the computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
  • the embodiment of the present application also provides a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided by any one of the above corresponding embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种基于区块链的数据处理方法、装置、设备、可读存储介质及计算机程序产品,该方法包括:共识节点将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据;将每个群组交易数据打包至提议区块中,执行提议区块中的每个群组交易数据,得到已执行完的交易执行结果;当已执行完的交易执行结果中包含交易执行失败结果时,将每个群组交易数据对应的交易执行结果均更新为交易执行失败结果,根据每个群组交易数据对应的交易执行失败结果更新提议区块,得到目标提议区块;当目标提议区块共识通过时,对目标提议区块以及每个群组交易数据对应的交易执行失败结果进行记账处理。

Description

基于区块链的数据处理方法、装置、设备、可读存储介质及计算机程序产品
相关申请的交叉引用
本申请实施例基于申请号为202110901263.X、申请日为2021年08月06日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请实施例作为参考。
技术领域
本申请涉及计算机技术领域,尤其涉及一种基于区块链的数据处理方法、装置、设备及、可读存储介质及计算机程序产品。
背景技术
区块链是一种融合有分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式,主要用于对数据按时间顺序进行整理,并加密成账本,使数据不可被篡改和伪造,同时可进行数据的验证、存储和更新。区块链还可以进行数据加密传输、节点识别和安全访问,是一种先进的分布式基础架构。目前,因为区块链的不可篡改性与真实性,对于区块链的应用也越来越多。
交易是区块链系统中的最小请求单元,一个交易可以视为对区块链服务端的一次操作请求,该操作请求授权区块链系统执行一些交易操作。但是一个交易只涉及个人或者双方,在多方协作的场景下,往往就会产生多个交易,这些交易理应同时执行成功或者失败,才能保证所有参与方的利益。
然而,相关技术的区块链系统中,不同交易之间在区块链上是相互独立和隔离的,多方协作的场景下产生的多个交易,如果部分交易执行失败,已经执行成功的交易仍然会被写入区块链账本中,交易成功的一方不针对交易失败的一方重新发起新的交易,则区块链账本中无法存储完整的多方协作的交易,导致基于区块链的多方协作交易失败,降低区块链的交易数据的准确性。
发明内容
本申请实施例提供了一种基于区块链的数据处理方法、装置、设备、可读存储介质及计算机程序产品,可以提高区块链的交易数据的准确性。
本申请实施例提供了一种基于区块链的数据处理方法,应用于计算机设备,所述计算机设备在区块链网络中映射为共识节点,所述方法包括:
所述共识节点将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据;
将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;
当所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果,根据每个所述群组交易数据对应的交易执行失败结果更新所述提议区块,得到目标提议区块;
当所述目标提议区块共识通过时,对所述目标提议区块以及每个所述群组交易数据对应的交易执行失败结果进行记账处理。
本申请实施例提供了一种基于区块链的数据处理方法,应用于计算机设备,所述计 算机设备在区块链网络中映射为业务节点,所述方法包括:
所述业务节点接收终端设备发送的针对多方协作交易的交易请求;
根据所述交易请求确定所述多方协作交易对应的群组标识;
根据所述多方协作交易对应的群组标识和所述交易请求生成具有群组标识的交易数据,将所述交易数据添加至交易池中;
其中,所述交易池中具有相同群组标识的多个交易数据,所述交易数据用于供共识节点确定为群组交易数据,所述共识节点用于将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;所述共识节点还用于在所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果。
本申请实施例提供了一种基于区块链的数据处理装置,包括:
群组确定模块,配置为将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据;
打包模块,配置为将每个所述群组交易数据打包至提议区块中;
区块执行模块,配置为将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;
结果更新模块,配置为当所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果;
区块更新模块,配置为根据每个所述群组交易数据对应的交易执行失败结果更新所述提议区块,得到目标提议区块;
记账模块,配置为当所述目标提议区块共识通过时,对所述目标提议区块以及每个所述群组交易数据对应的交易执行失败结果进行记账处理。
本申请实施例提供了一种基于区块链的数据处理装置,包括:
请求接收模块,配置为接收终端设备发送的针对多方协作交易的交易请求;
标识确定模块,配置为根据所述交易请求确定所述多方协作交易对应的群组标识;
数据添加模块,配置为根据所述多方协作交易对应的群组标识和所述交易请求生成具有群组标识的交易数据,将所述交易数据添加至交易池中;
其中,所述交易池中具有相同群组标识的多个交易数据,所述交易数据用于供共识节点确定为群组交易数据,所述共识节点用于将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;所述共识节点还用于在所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果。
本申请实施例提供了一种计算机设备,包括:处理器、存储器、网络接口;
上述处理器与上述存储器、上述网络接口相连,其中,上述网络接口用于提供数据通信网元,上述存储器用于存储计算机程序,上述处理器用于调用上述计算机程序,以执行本申请实施例中的方法。
本申请实施例提供了一种计算机可读存储介质,上述计算机可读存储介质中存储有计算机程序,上述计算机程序适于由处理器加载并执行本申请实施例中的方法。
本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中,计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行本申请实施例中的方法。
本申请实施例中可以将具有同一群组标识的群组交易数据打包到同一提议区块中,且只要有一个群组交易数据执行失败,所有群组交易数据都确认执行失败,因此可以避 免多方协作交易下产生的部分群组交易数据执行失败后,将部分交易成功的群组交易数据写入区块链,因此本申请实施例只有所有群组交易数据都执行成功,才保证基于区块链的多方协作交易成功,以提高区块链的交易数据的准确性。
附图说明
图1是本申请实施例提供的一种网络架构示意图;
图2a-图2b是本申请实施例提供的一种基于区块链的数据处理的场景示意图;
图3是本申请实施例提供的一种基于区块链的数据处理方法的流程示意图;
图4是本申请实施例提供的一种基于区块链的数据处理方法的流程示意图;
图5是本申请实施例提供的一种群组交易数据执行方法的流程示意图;
图6是本申请实施例提供的一种交易群组实现的场景示意图;
图7是本申请实施例提供的一种交易群组实现的流程示意图;
图8是本申请实施例提供的一种基于区块链的数据处理装置的结构示意图;
图9是本申请实施例提供的一种计算机设备的结构示意图;
图10是本申请实施例提供的另一种基于区块链的数据处理装置的结构示意图;
图11是本申请实施例提供的另一种计算机设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,本申请实施例涉及的交易,又称交易请求,交易包括了需要提交到区块链网络执行的操作以及对应的交易结果。本申请实施例涉及的交易并不局限于商业语境中的交易,即交易数据并不局限于数字货币等相关数据。例如,交易可以是部署(Deploy)交易、调用(Invoke)交易,部署交易用于将智能合约部署至区块链网络的节点中,并准备好被调用;调用交易用于对账本中的状态数据库进行查询操作(即读操作)或更新操作(即写操作,包括增加、删除和修改)。
请参见图1,图1是本申请实施例提供的一种网络架构示意图。区块链是一种分布式数据存储、点对点传输、共识机制以及加密算法等计算机技术的新型应用模式,主要用于对数据按时间顺序进行整理,并加密成账本,使其不可被篡改和伪造,同时可进行数据的验证、存储和更新。区块链本质上是一个去中心化的数据库,该数据库中的每个节点均存储一条相同的区块链,区块链网络中的节点包括共识节点(例如图1所示的共识节点1000a)和业务节点(例如图1所示的业务节点100a),其中共识节点用于区块链全网的共识,业务节点用于处理终端设备(运行有客户端)发送的交易请求。对于区块链网络中交易数据被写入账本的过程可以为:客户端发送交易数据至业务节点,随后该交易数据以接力棒的方式在区块链网络中的业务节点之间传递,直到共识节点收到该交易数据,共识节点再将该交易数据打包进区块,与其他共识节点之间进行共识,在共识通过后,将携带该交易数据的区块写入账本。
其中,可以理解的是,区块(Block)是在区块链网络上承载交易数据(即交易业务)的数据包,是一种被标记上时间戳和之前一个区块的哈希值的数据结构,区块经过网络的共识机制验证以确定区块中的交易。
其中,可以理解的是,哈希(hash)值,也称作信息特征值或特征值,哈希值是通 过哈希算法将任意长度的输入数据转换为密码并进行固定输出而生成的,不能通过解密哈希值来检索原始输入数据,哈希算法是一个单向的加密函数。在区块链中,每个区块(除了初始区块)都包含前继区块的哈希值,前继区块被称为当前区块的父区块。哈希值是区块链技术中的核心基础和最重要的部分,能够确保记录数据和查看数据的真实性,以及区块链作为一个整体的完整性。
其中,可以理解的是,区块链系统中可以包括有智能合约,该智能合约在区块链系统中可以理解为是一种区块链各节点(包括共识节点)可以理解并执行的代码,可以执行任意逻辑并得到结果。用户可以通过客户端发起一个交易业务请求的方式,调用区块链上已经部署的智能合约,随后,区块链上的业务节点可以将该交易业务请求发送至共识节点,而区块链上的各个共识节点可以分别运行该智能合约。应当理解,区块链中可以包括一个或多个智能合约,这些智能合约可以通过标识号(ID,Identity document)或名称来进行区分,而客户端发起的交易业务请求中,也可以携带智能合约的标识号或名称,以此指定区块链需要运行的智能合约。而若客户端所指定的智能合约为需要读取数据的合约,则各个共识节点会访问本地账本来进行数据的读取,最后各个共识节点会互相验证执行结果是否一致(也就是进行共识),若一致则可以将执行结果存入各自的本地账本中,并将执行结果返回至客户端。
如图1所示,该网络架构可以包括共识节点集群1000、业务节点集群100以及终端设备(运行有客户端)集群10,该共识节点集群1000可以包括至少两个共识节点,业务节点集群100可以包括至少两个业务节点。如图1所示,该共识节点集群1000可以包括共识节点1000a、共识节点1000b、…、共识节点1000n,该业务节点集群100具体可以包括业务节点100a、业务节点100b、…、业务节点100n,该终端设备集群10具体可以包括终端设备10a、终端设备10b、…、终端设备10n。
如图1所示,终端设备10a、终端设备10b、…、终端设备10n可以分别与业务节点100a、业务节点100b、…、业务节点100n进行网络连接,以便于终端设备可以通过该网络连接与业务节点进行数据交互;业务节点100a、业务节点100b、…、业务节点100n可以分别与共识节点1000a、共识节点1000b、…、共识节点1000n进行网络连接,以便于业务节点可以通过该网络连接与共识节点进行数据交互;业务节点100a、业务节点100b、…、业务节点100n互相连接,以便于业务节点之间可以进行数据交互,共识节点1000a、共识节点1000b、…、共识节点1000n互相连接,以便于共识节点之间可以进行数据交互。
可以理解的是,区块链节点(可以是上述业务节点或者共识节点)之间可以通过上述数据连接进行数据或者区块传输。区块链网络可以基于节点标识实现区块链节点之间的数据连接,对于区块链网络中的每个区块链节点,均具有与其对应的节点标识,而且上述每个区块链节点均可以存储与自身有相连关系的其他区块链节点的节点标识,以便后续根据其他区块链节点的节点标识,将获取到的数据或生成的区块广播至其他区块链节点,例如业务节点100a中可以维护一个如表1所示的节点标识列表,该节点标识列表保存着其他区块链节点的节点名称和节点标识:
表1
节点名称 节点标识
业务节点100a 117.114.151.174
共识节点1000a 117.116.189.145
业务节点100b 117.114.151.183
共识节点1000b 117.117.125.169
共识节点1000n 117.116.189.125
其中,节点标识可为网络之间互联的协议(IP,Internet Protocol)地址以及其他任意一种能够用于标识区块链网络中区块链节点的信息,表1中仅以IP地址为例进行说明。例如,业务节点100a可以通过节点标识117.116.189.145向共识节点1000a发送信息(例如,交易数据),且共识节点1000a可以通过节点标识117.114.151.174确定该信息是由业务节点100a发送的。
可以理解的是,上述的数据连接不限定连接方式,可以通过有线通信方式进行直接或间接地连接,也可以通过无线通信方式进行直接或间接地连接,还可以通过其他连接方式,本申请在此不做限制。
可以理解的是,本申请实施例所提供的基于区块链的数据处理方法可以由计算机设备执行,计算机设备包括但不限于上述共识节点或者业务节点(可以为终端或服务器)。上述服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN、以及大数据和人工智能平台等基础云计算服务的云服务器。上述终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表、车载终端等,但并不局限于此。
如图1所示,共识节点集群1000中的任一共识节点可以作为出块节点,从交易池中获取具有相同群组标识的多个交易数据,将每个交易数据确定为群组交易数据。其中,交易池是区块链网络中每个区块链节点都需要维护的一个用于存储交易数据的临时列表,区块链节点通过交易池来暂存区块链网络中已知但尚未包含在区块链中的交易数据。然后,该出块节点可以将每个群组交易数据打包进提议区块(区块链中用于存储群组交易数据的区块)中,按序执行提议区块中的每个群组交易数据,得到已执行完的交易执行结果;若已执行完的交易执行结果中包含交易执行失败结果,则将每个群组交易数据对应的交易执行结果均更新为交易执行失败结果,根据每个群组交易数据对应的交易执行失败结果更新提议区块,得到目标提议区块,然后在目标提议区块共识通过时,将目标提议区块以及每个群组交易数据对应的交易执行失败结果进行记账处理。其中,根据每个群组交易数据对应的交易执行失败结果更新提议区块,得到目标提议区块的过程,可以为:根据每个群组交易数据对应的交易执行失败结果生成结果默克尔树,然后将结果默尔克树的树根哈希值添加进提议区块的区块头中,得到目标提议区块。其中,记账处理是指将目标提议区块以及每个群组交易数据对应的交易执行失败结果写入区块链账本中进行存储。当已执行完的交易执行结果中不包含交易执行失败结果时,则直接根据已执行完的交易执行结果生成结果默克尔树,将该结果默克尔树的树根哈希值添加进提议区块,得到更新后的提议区块,然后对更新后的提议区块和已执行完的交易执行结果进行记账处理。
上述交易池中的交易数据可以是由业务节点集群100中的任一业务节点发送的,如图1所示,业务节点集群100中的任一业务节点可以接收终端设备集群10中的终端设备发送的针对多方协作交易的交易请求,其中,交易请求的数量为多个,交易请求的数量为多个时,可以是同一终端设备发送的,也可以是不同终端设备发送的,这里不作限制。其中,多方协作交易指的是多个参与对象共同进行交易的场景,往往可能产生一个或多个交易,这些交易理应同时执行成功,然后一起被写入区块链账本中。然后,业务节点集群100中的任一业务节点可以根据交易请求确定多方协作交易对应的群组标识,然后根据该多方协作交易对应的群组标识和交易请求生成具有群组标识的交易数据,然后将具有该群组标识的交易数据添加进交易池中,等待上述出块节点进行处理。例如,终端设备集群10中的终端设备可以直接获取多方协作交易对应的群组标识,然后基于 该群组标识生成针对多方协作交易的交易请求,再将携带该群组标识的交易请求发送到业务节点集群100中的任一业务节点,业务节点接收到携带群组标识的交易请求后,可以直接生成具有群组标识的交易数据,然后将携带群组标识的交易数据添加进交易池中。
为便于理解,请参见图2a-图2b,是本申请实施例提供的一种基于区块链的数据处理的场景示意图。其中,如图2a所示的用户A对应的终端设备20a、用户B对应的终端设备20b以及用户C对应的终端设备20c均可以为上述图1中的终端设备集群10中的任一终端设备,如终端设备20a可以为终端设备10a,终端设备20b可以为终端设备10b,终端设备20c可以为终端设备10n;如图2a所示的业务节点200可以为上述图1中的业务节点集群100中的任一业务节点,如,该业务节点可以为业务节点100b;如图2b所示的共识节点201可以为上述图1中的共识节点集群1000中的任一业务节点,如,该共识节点可以为共识节点1000a。
如图2a所示,用户A、用户B、用户C以及用户D(图中未画出)正在参加一场多方协作交易f,按照四人约定,用户A需要给用户B转账100元,用户B需要给用户C转账60元,用户C需要给用户D转账30元,因此,用户A通过终端设备20a发起针对“用户A给用户B转账100元”的交易请求1,用户B通过终端设备20b发起针对“用户B给用户C转账60元”的交易请求2,用户C通过终端设备20c发起针对“用户C给用户D转账30元”的交易请求3。可以理解,倘若交易请求2执行失败,交易请求1和交易请求3执行成功,即用户A成功向用户B转账,用户C成功向用户D转账,但是用户B却没能成功向用户C转账,此时用户B就多收入了60元,此时如果用户B拒绝退还用户A的转账,也拒绝再次向用户C转账60元,则用户A和用户C的利益都可能受到损失,无法保证基于区块链的多方协作交易成功以及区块链的交易数据的准确性。在本申请实施例中,可以将多方协作交易下产生的多个交易作为同一个群组的群组交易,同一个群组中的任意一个群组交易执行失败,均认为所有群组交易执行失败,从而保证基于区块链的多方协作交易成功,从而提高区块链的交易数据的准确性。
如图2a所示,用户A、用户B、用户C正在进行针对物品推荐模型的联邦学习任务,用户A拥有针对物品推荐模型的第一部分训练数据,用户B拥有针对物品推荐模型的第二部分训练数据,用户C拥有针对物品推荐模型的第三部分训练数据,其中,第一部分训练数据、第二训练部分数据以及第三部分训练数据构成用于训练物品推荐模型的完整训练数据。因此,用户A通过终端设备20a发起针对“通过第一部分训练数据训练物品推荐模型”的交易请求1,用户B通过终端设备20b发起针对“通过第二部分训练数据训练物品推荐模型”的交易请求2,用户C通过终端设备20c发起针对“通过第三部分训练数据训练物品推荐模型”的交易请求3。可以理解,倘若交易请求2执行失败,交易请求1和交易请求3执行成功,即通过第一部分训练数据训练物品推荐模型成功,通过第三部分训练数据训练物品推荐模型成功,但是通过第二部分训练数据训练物品推荐模型失败,此时物品推荐模型由于缺乏第二部分训练数据的训练,导致物品推荐模型训练失败,即使存储通过第一部分训练数据训练物品推荐模型的交易数据、通过第三部分训练数据训练物品推荐模型的交易数据,也无法保证基于区块链的多方协作交易成功,即物品推荐模型成功,只要交易都执行成功,才保证基于区块链的多方协作交易成功,以提高区块链的交易数据的准确性,并且基于联邦学习的数据隐私保护的特性,通过各自的训练数据独立训练模型,提高区块链的交易数据的安全性。
如图2a所示,用户A、用户B、用户C正在进行针对目标代码的协同开发任务,用户A需要针对目标代码的第一部分代码进行开发,用户B需要针对目标代码的第二部分代码进行开发,用户C需要针对目标代码的第三部分代码进行开发,其中,第一部分代码、第二部分代码以及第三部分代码构成完整的目标代码。因此,用户A通过终端 设备20a发起“针对第一部分代码的开发任务”的交易请求1,用户B通过终端设备20b发起“针对第二部分代码的开发任务”的交易请求2,用户C通过终端设备20c发起“针对第三部分代码的开发任务”的交易请求3。可以理解,倘若交易请求2执行失败,交易请求1和交易请求3执行成功,即第一部分代码开发成功,第三部分代码开发成功,但是通过第二部分代码开发失败,此时由于缺乏第二部分代码,导致目标代码开发失败,无法保证基于区块链的多方协作交易成功,只要交易都执行成功,才保证基于区块链的多方协作交易成功,以提高区块链的交易数据的准确性以及完整性,并且通过多方代码协作开发,提高区块链的交易数据(即开发的代码)的开发效率。
如图2a所示,业务节点200接收到交易请求1、交易请求2以及交易请求3之后,会确定多方协作交易f对应的群组标识,假设为群组标识F,然后,业务节点会根据多方协作交易对应的群组标识和交易请求生成具有群组标识的交易数据,即如图2a所示,业务节点200根据交易请求1和群组标识F生成交易数据1,业务节点200根据交易请求2和群组标识F生成交易数据2,业务节点200根据交易请求3和群组标识F生成交易数据3。交易数据1、交易数据2以及交易数据3中均携带有群组标识F,然后,业务节点200会将交易数据1、交易数据2以及交易数据3均添加进交易池202中。上述可知,交易池202是区块链节点中每个区块链节点均会维护的一个用于存储交易数据的临时列表。
例如,具有群组标识的交易数据进入交易池后,等待被出块节点打包进提议区块中。假设出块节点为共识节点201,则共识节点201可以从交易池202中提取交易数据,打包到提议区块,并广播到区块链网络中进行共识记账处理。如图2b所示,共识节点201会从交易池中将具有群组标识F的交易数据1、交易数据2以及交易数据3确定为同一个群组2011的群组交易数据,然后将该群组2011中的每个群组交易数据,打包进提议区块2015中。其中,提议区块包括区块头和区块体,区块头中存储有版本号、时间戳和难度值等基本数据,还可以存储有其他相关数据,区块体则用于存储群组2011中的每个群组交易数据。可以理解的是,在提议区块中,可以存储有多个群组对应的群组交易数据,同一群组对应的群组交易数据对应的交易执行结果中,有一个交易执行结果为交易执行失败结果,则该群组中所有群组交易数据对应的交易执行结果均会被更新为交易执行失败结果;不同群组对应的群组交易数据对应的交易执行结果互不影响,假设提议区块包括群组A和群组B分别对应的群组交易数据,群组A中的群组交易数据a执行失败,群组B中的群组交易数据对应的交易执行结果不会受到影响。
如图2b所示,共识节点201会按序执行提议区块中的每个群组交易数据,即依次执行群组交易数据2012、群组交易数据2013以及群组交易数据2014,得到已执行完的交易执行结果,假设群组交易数据2012对应的交易执行结果2016为交易执行成功结果,群组交易数据2013对应的交易执行结果2017为交易执行成功结果,群组交易数据2014对应的交易执行结果2018为交易执行失败结果,即已执行完的交易执行结果中包含交易执行失败结果,则共识节点201会更新交易执行结果,即将每个群组交易数据对应的交易执行结果均更新为交易执行失败结果,更新完成后,群组交易数据2012对应的交易执行结果2016为交易执行失败结果,群组交易数据2013对应的交易执行结果2017为交易执行失败结果,群组交易数据2014对应的交易执行结果2018为交易执行失败结果。共识节点201会根据每个群组交易数据对应的交易执行失败结果更新提议区块,得到目标提议区块,然后对目标提议区块进行共识记账处理,即通过区块链中的共识节点集群(可以为上述图1所示的共识节点集群1000)的共识后,共识节点201可以对目标提议区块以及每个群组交易数据对应的交易执行失败结果进行记账处理。
请参见图3,图3是本申请实施例提供的一种基于区块链的数据处理方法的流程示 意图。其中,该方法可以由共识节点(例如,上述图1中的共识节点)执行,也可以由业务节点、共识节点(例如,上述图1所对应实施例中的共识节点)、终端设备(例如,上述图1所对应实施例中的终端设备)共同执行。以下将以本方法由共识节点执行为例进行说明,其中,该基于区块链的数据处理方法至少可以包括以下步骤S101-步骤S104:
步骤S101,共识节点将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据。
例如,群组标识用于标识交易数据所属的交易群组,换言之,同一个交易群组中包含的交易数据具有同一群组标识,可以理解,群组标识具有唯一性,即不同交易群组对应的群组标识不同,属于不同交易群组的交易数据对应的群组标识不同。相关技术的区块链系统中,区块链上的交易之间是相互独立、隔离的,一个交易执行成功或者失败均不会对其他交易造成影响,而本申请实施例的交易群组是将区块链中多个具有关联关系的交易加入同一个交易群组中,交易群组具有以下特性:交易群组中的交易全部被执行成功,或者全部被执行失败。
例如,业务节点在生成交易数据后,会将交易数据添加进交易池中,然后等待具备出块功能的共识节点(即出块节点)将交易数据从交易池中取出,并打包进提议区块中。对于被添加进同一个交易群组的交易对应的交易数据中,会携带有群组标识,共识节点会将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据。
在一些实施例中,共识节点确定群组交易数据的过程,可以为:共识节点可以从交易池中获取交易数据。其中,交易数据包含群组标识和群组交易数量。其中,群组交易数量是指群组标识对应的交易群组中包含的交易的数量。然后,共识节点可以将交易数据添加至群组标识对应的群组缓存队列中,得到更新群组缓存队列;当更新群组缓存队列中的交易数据的数量等于群组交易数量时,则将更新群组缓存队列中的交易数据,确定为群组交易数据;当更新群组缓存队列中的交易数据的数量小于群组交易数量时,则从交易池中继续获取包含群组标识的交易数据。
其中,群组缓存队列用于暂时存储共识节点已经获取到的交易群组中的部分交易对应的交易数据,群组标识对应的群组缓存队列是共识节点在获取到第一个携带群组标识的交易数据后创建的,当群组缓存队列中的交易数据均被打包进区块链中,群组缓存队列中的交易数据会被情空,该群组缓存队列占用的资源也会被释放,即共识节点会删除该群组缓存队列。
为便于理解,假设共识节点获取到交易数据A,交易数据A中包含群组标识m和群组交易数量,其中,群组交易数量为3,然后,共识节点会将交易数据A添加进群组标识m对应的群组缓存队列中,得到更新缓存队列,需要说明的是,倘若共识节点未查询到群组标识m对应的群组缓存队列,共识节点会先创建一个与该群组标识m对应的群组缓存队列,然后将交易数据A添加进该群组缓存队列中。例如,群组缓存队列的大小可以根据群组交易数量来动态调整,避免占用过多的内存资源。然后,共识节点会确定更新缓存队列中交易数据的数量,假设群组缓存队列中包含之前添加的交易数据B,则此时更新缓存队列中交易数据的数量为2,小于群组交易数量,共识节点会继续从交易池中获取新的交易数据,确定新的交易数据对应的群组标识,将该新的交易数据添加进群组标识m对应的群组缓存队列中,然后重复上述过程。直到共识节点获取到的新的交易数据C对应的群组标识为群组标识m,共识节点会将该交易数据C添加至更新群组缓存队列中,得到新的更新群组缓存队列,此时新的更新群组缓存队列中包含交易数据A、交易数据B和交易数据C,其交易数据的数量为3,等于群组交易数量,则共识节点会将交易数据A、交易数据B和交易数据C确定为同一交易群组对应的群组交易数据。
在一些实施例中,上述若更新群组缓存队列中的交易数据的数量小于目标群组交易数量,则从交易池中继续获取包含目标群组标识的交易数据的过程,可以为:当更新群组缓存队列中的交易数据的数量小于群组交易数量时,且当前时间处于缓存时间段内,则从交易池中继续获取包含群组标识的交易数据。当更新群组缓存队列中的交易数据的数量小于群组交易数量,且当前时间超出缓存时间段时,则将更新群组缓存队列中的交易数据重新放入交易池中,清空更新群组缓存队列。
需要说明的是,不同交易群组的群组标识对应有不同的群组缓存队列,倘若共识节点迟迟未获取到属于同一交易群组的所有交易数据,群组缓存队列会一直占用着共识节点的内存资源,从而浪费大量的内存资源,因此可以设定缓存时间段,即一个群组缓存队列从创建开始可以存在的最长时间段,如果群组缓存队列的存在时长超出缓存时间段,即将群组缓存队列中的交易数据重新放入交易池中,清空群组缓存队列,避免群组缓存队列占用共识节点的内存资源,从而节约内存资源。
步骤S102,将每个群组交易数据打包至提议区块中,执行提议区块中的每个群组交易数据,得到已执行完的交易执行结果。
在一些实施例中,群组交易数据可以包含执行顺序标识,执行顺序标识是指在交易群组中,交易的执行顺序,则将每个群组交易数据打包至提议区块中的过程,可以为:根据每个群组交易数据包含的执行顺序标识,对每个群组交易数据进行排序处理,得到排序后的群组交易数据;然后将排序后的群组交易数据打包至提议区块中。随后,共识节点会按照群组交易数据的打包顺序,按序执行提议区块中的每个群组交易数据,得到已执行完的交易执行结果。
需要说明的是,本申请实施例可以按照群组交易数据的打包顺序执行提议区块中的每个群组交易数据。当然,本申请实施例还可以随机执行提议区块中的每个群组交易数据。
在一些实施例中,假设群组交易数据的数量为S,S为大于1的正整数,则执行提议区块中的每个群组交易数据,得到已执行完的交易执行结果的过程,可以为:获取提议区块中第k个群组交易数据,执行第k个群组交易数据,得到第k个群组交易数据对应的交易执行结果。其中,k为依次递增的正整数,且k小于S。当第k个群组交易数据对应的交易执行结果为交易执行成功结果时,则继续执行提议区块中第k+1个群组交易数据;当第k个群组交易数据对应的交易执行结果为交易执行失败结果,则将提议区块中第k+1个群组交易数据至第S个群组交易数据分别对应的交易执行结果,均确定为交易执行失败结果,将每个群组交易数据分别对应的交易执行结果作为已执行完的交易执行结果。
简言之,为了提高区块链系统的工作效率,共识节点顺序执行提议区块中每个群组交易数据的过程中,当一个群组交易数据的交易执行结果为交易执行失败结果后,可以直接将排在该群组交易数据之后的其他群组交易数据的交易执行结果均确定为交易执行失败结果,无需再进行计算,可以节省计算资源。比如,按照打包顺序,提议区块中包含有群组交易数据a、群组交易数据b、群组交易数据c以及群组交易数据d,则共识节点在执行提议区块时,先执行群组交易数据a。假设群组交易数据a对应的交易执行结果为交易执行成功结果,则继续执行群组交易数据b。假设群组交易数据b对应的交易执行结果为交易执行失败结果,则共识节点无需再执行群组交易数据c和群组交易数据d,可以直接将群组交易数据c和群组交易数据d分别对应的交易执行结果确定为交易执行失败结果。此时已执行完的交易执行结果为:群组交易数据a对应的交易执行成功结果,群组交易数据b对应的交易执行失败结果,群组交易数据c对应的交易执行失败结果,群组交易数据d对应的交易执行失败结果。
在一些实施例中,执行第k个群组交易数据的过程,可以为:调用用于执行群组交易数据的智能合约中的交易执行函数;根据交易执行函数获取针对第k个群组交易数据的历史交易数据,将历史交易数据确定为读取数据;然后根据读取数据以及群组交易数据执行交易执行函数,得到群组交易数据的交易执行结果。例如,第k个交易对应的群组交易数据为甲方通过自己的账户向乙方转账10元,第k个群组交易数据对应的交易执行函数k为转移执行函数,第k个群组交易数据对应的历史交易数据k为甲方账户上剩余20元,针对第k个群组交易数据的交易执行结果k可以为20-10=10元,即执行交易k后,甲方的账户上剩余10元。
步骤S103,当已执行完的交易执行结果中包含交易执行失败结果时,将每个群组交易数据对应的交易执行结果均更新为交易执行失败结果,根据每个群组交易数据对应的交易执行失败结果更新提议区块,得到目标提议区块。
例如,属于同一交易群组中的交易,理应同时成功或者同时失败,因此,只有当已执行完的交易执行结果中不包含交易执行失败结果时,共识节点才会根据已执行完的交易执行结果来更新提议区块。当已执行完的交易执行结果中包含一个或多个交易执行结果,则共识节点会将每个群组交易数据对应的交易执行结果均更新为交易执行失败结果,然后根据每个群组交易数据对应的交易执行失败结果更新提议区块,得到目标提议区块。比如上述步骤S102中得到的已执行完的交易执行结果为:群组交易数据a对应的交易执行成功结果,群组交易数据b对应的交易执行失败结果,群组交易数据c对应的交易执行失败结果,群组交易数据d对应的交易执行失败结果。此时,共识节点会将群组交易数据a对应的交易执行成功结果,更新为交易执行失败结果。此时,每个群组交易数据对应的交易执行结果均为交易执行失败结果。
在一些实施例中,根据每个群组交易数据对应的交易执行失败结果更新提议区块,得到目标提议区块,包括:根据每个群组交易数据对应的交易执行失败结果生成结果默克尔树,其中,结果默克尔树中包括树根哈希值,然后将树根哈希值添加至提议区块的区块头,得到目标提议区块。
需要说明的是,结果默克尔树是一种默克尔树(又称哈希树),默克尔树是一种数据结构,即二叉树。默克尔树包括根、分支(中间的非叶节点)、叶节点组成。所有节点存储的是相关数据的哈希值(而不是相关数据本身),例如根节点存储是树根哈希值,而不是树根自身的数据。
步骤S104,当目标提议区块共识通过时,对目标提议区块以及每个群组交易数据对应的交易执行失败结果进行记账处理。
例如,记账处理是指将目标提议区块中的群组交易数据以及每个群组交易数据对应的交易执行失败结果添加至区块链账本中进行存储。
在一些实施例中,共识节点可以将提议区块广播至共识网络中的可通信共识节点,可通信共识节点用于执行提议区块中的每个群组交易数据,然后根据每个群组交易数据对应的交易执行结果更新提议区块,得到可通信目标提议区块。共识节点接收可通信共识节点发送的可通信目标提议区块的区块哈希值,同时,还可以将目标提议区块的区块哈希值广播至共识网络中的可通信共识节点。共识节点将可通信目标提议区块的区块哈希值确定为待匹配区块哈希值;然后比较待匹配区块哈希值和目标提议区块的区块哈希值。当与目标提议区块的区块哈希值相同的待匹配区块哈希值的数量大于共识数量阈值时,则确定目标提议区块共识通过。
采用本申请实施例提供的方法,可以将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据;然后将每个群组交易数据打包进提议区块中,执行提议区块中的每个群组交易数据,得到已执行完的交易执行结果;若已执行完的交易执行结果中包含 交易执行失败结果,则将每个群组交易数据对应的交易执行结果均更新为交易执行失败结果,根据每个群组交易数据对应的交易执行失败结果更新提议区块,得到目标提议区块;最后在目标提议区块共识通过时,对目标提议区块以及每个群组交易数据对应的交易执行失败结果进行记账处理。通过将具有同一群组标识的交易数据作为群组交易数据,将每个群组交易数据的交易执行结果进行绑定,从而保证多方协作交易下产生的多个交易全部执行成功或者全部执行失败,可以避免多方协作交易下产生的部分群组交易数据执行失败后,将部分交易成功的群组交易数据写入区块链,因此只有所有群组交易数据都执行成功,才保证基于区块链的多方协作交易成功,从而提高区块链的交易数据的准确性。
请参见图4,图4是本申请实施例提供的一种基于区块链的数据处理方法的流程示意图。其中,该方法可以由业务节点(例如,上述图1所对应实施例中的业务节点)执行,也可以由业务节点、共识节点(例如,上述图1所对应实施例中的共识节点)、终端设备(例如,上述图1所对应实施例中的终端设备)共同执行。以下将以本方法由业务节点执行为例进行说明,其中,该基于区块链的数据处理方法至少可以包括以下步骤S201-步骤S203:
步骤S201,业务节点接收终端设备发送的针对多方协作交易的交易请求。
在一些实施例中,多方协作交易是指多个参与方共同参加并完成的交易,多方协作交易产生多个交易请求。这些交易请求可以通过同一终端设备发起,也可以通过不同终端设备发起。需要说明的是,多方协作交易产生的交易请求,也可以被发送到不同的业务节点,为便于理解,后续步骤仅以交易请求发送至同一业务节点为例进行说明。
步骤S202,根据交易请求确定多方协作交易对应的群组标识。
在一些实施例中,当交易请求的数量为多个,且每个交易请求均包含执行顺序标识时,根据交易请求确定多方协作交易对应的群组标识的过程,可以为:当获取到执行顺序标识所指示的顺序优先级为最高优先级的交易请求时,将顺序优先级为最高优先级的交易请求,确定为群组标识请求;然后对群组标识请求进行哈希处理,得到请求哈希值,将请求哈希值确定为多方协作交易对应的群组标识。
例如,执行顺序标识用于指示交易请求被执行时的顺序,最高优先级的交易请求是指执行顺序标识所指示的最先被执行的交易请求。
在一些实施例中,当交易请求包含发起多方协作交易的协作交易发起对象时,根据交易请求确定多方协作交易对应的群组标识的过程,还可以为:从交易请求中获取协作交易发起对象;然后在身份标识库中,查找协作交易发起对象对应的身份标识;根据身份标识生成多方协作交易对应的群组标识。
其中,协作交易发起对象可以指多方协作交易的发起对象,例如双人交易签订合同时的甲方。其中,身份标识库用于存储每个交易对象(即多方协作交易的发起对象)的身份标识,交易对象的身份标识可以是交易对象在发起交易请求之前,向业务节点发起身份标识获取请求后,由业务节点分配的身份标识。其中,交易对象是指可以发起交易请求的对象,任一交易对象都可以作为协作交易发起对象,并邀请其他交易对象参与多方协作交易。身份标识具有唯一性,即一个交易对象对应一个身份标识,不同交易对象对应的身份标识不同。其中,根据身份标识生成多方协作交易对应的群组标识的过程,可以为:业务节点获取当前时间戳,然后在身份标识后添加当前时间戳,就得到一个唯一的标识,可以将该标识作为多方协作交易对应的群组标识。
在一些实施例中,终端设备在发起针对多方协作交易的交易请求之前,可以先为该多方协作交易申请一个对应的群组标识,然后终端设备在发起针对多方协作交易的交易请求时,可以直接携带该申请的群组标识。群组标识申请的具体实现过程可以为:业务 节点获取协作交易发起对象发起的针对多方协作交易的标识获取请求,其中,标识获取请求中包含参与多方协作交易的交易对象。然后业务节点可以根据标识获取请求生成针对多方协作交易的可用群组标识,然后将可用群组标识发送至交易对象对应的终端设备,以使交易对象对应的终端设备生成包含可用群组标识的交易请求。此时,根据交易请求确定多方协作交易对应的群组标识的过程,可以为:将交易请求中的可用群组标识,确定为多方协作交易对应的群组标识。
例如,终端设备也可以直接向业务节点发送群组标识申请请求(即标识获取请求),然后接收业务节点下发的二维码图像,通过扫描该二维码图像,得到群组标识,然后根据该群组标识生成包含可用群组标识的交易请求。
例如,在确定多方协作交易对应的群组标识之前,可以先验证交易请求的合法性。交易请求中通常会携带有签名数据,其中,签名数据是终端设备通过私钥对交易请求进行签名处理后得到的。业务节点会获取终端设备对应的公钥,然后通过公钥对签名数据进行验签处理,得到验签结果;当验签结果为验签通过结果时,则确定该交易请求合法,进而继续确定多方协作交易对应的群组标识。
步骤S203,根据多方协作交易对应的群组标识和交易请求生成具有群组标识的交易数据,将交易数据添加至交易池中。
在一些实施例中,交易池中具有相同群组标识的多个交易数据会被共识节点确定为群组交易数据。共识节点将每个群组交易数据打包至提议区块中,按序执行提议区块中的每个群组交易数据,得到已执行完的交易执行结果;当已执行完的交易执行结果中包含交易执行失败结果时,则共识节点会将每个群组交易数据对应的交易执行结果均更新为交易执行失败结果。
采用本申请实施例提供的方法,可以生成多方协作交易的唯一群组标识,基于在该多方协作交易过程中产生的交易请求生成的交易数据中,均会携带该群组标识,并被送进交易池中,交易池中具有相同群组标识的多个交易数据会被共识节点确定为群组交易数据,每个群组交易数据的交易执行结果之间具有关联关系,只要有一个群组交易数据的交易执行结果为交易执行失败结果,则其余群组交易数据的交易执行结果会被更新为交易执行失败结果,从而保证多方协作交易下产生的多个交易全部执行成功或者全部执行失败,可以避免多方协作交易下产生的部分群组交易数据执行失败后,将部分交易成功的群组交易数据写入区块链,因此只有所有群组交易数据都执行成功,才保证基于区块链的多方协作交易成功,从而提高区块链的交易数据的准确性。
上述过程还可一并参见图5,图5是本申请实施例提供的一种群组交易数据执行方法的流程示意图,该方法可以由区块链网络中的任一节点(可以为上述图1所示的业务节点,也可以为上述图1所示的共识节点)执行。
如图5所示,该群组交易数据执行方法可以包括如下步骤S1-步骤S5:
步骤S1、各节点中的远程过程调用(RPC,Remote Procedure Call)层获取交易请求。
在一些实施例中,交易请求中可以携带有群组标识,也可以携带多方协作交易的基本信息,便于节点为该交易请求获取群组标识。
步骤S2、各节点间相互广播交易,并由其中某一节点作为出块节点将若干交易打包成一个区块,并广播给其它节点。
其中,出块节点的选择,因共识算法而异,可以包括领导者(leader)出块,轮流出块,算力竞争出块等。
在一些实施例中,通过RPC层获取到交易请求的节点,会生成具有群组标识的交易数据(即交易的数据),然后相互广播,并将其添加进交易池中。出块节点在将若干 交易打包成一个区块时,会将具有相同群组标识的交易数据作为同一个群组的群组交易数据。
步骤S3、各节点都收到区块之后,开始执行区块里的交易进行逻辑计算。在逻辑计算层,解析交易参数,并执行合约。
执行过程中可能会需要读取存储空间中的数据(即读取数据),如图5中示例的节点1从存储空间中读取历史交易数据。
在一些实施例中,各节点执行区块里的交易时,会将同一个群组的群组交易数据作为一个整体,按序执行该群组中的每个群组交易数据,得到已执行完的交易执行结果,若已执行完的交易执行结果中包含交易执行失败结果,就将该群组中每个群组交易数据对应的交易执行结果均更新为交易执行失败结果,来保证该群组中的群组交易数据要么全部执行成功,要么全部执行失败。
步骤S4、合约执行完毕后,各节点对执行结果(即上述的每个群组交易数据对应的交易执行结果)进行互相校验。校验方法可以为将执行结果或对存储的变更组织成结果merkle树,将结果树根(即结果根哈希)放入区块头中,最终校验各节点区块hash一致即可。
步骤S5、共识成功后,各节点将本区块相关的数据写入存储空间。
其中,相关的数据包括区块头、区块包含的所有交易、合约执行结果等。
上述步骤S1-步骤S5的详细过程可以参见图3所对应的实施例和图4所对应的实施例,此处就不再展开赘述。
请参见图6,图6是本申请实施例提供的一种交易群组实现的场景示意图。假设参与多方协作交易的有参与方A、参与方B以及参与方C,参与方A生成了交易a,参与方B生成了交易b,参与方C生成了交易c。在本申请实施例提供的方法中,可以将这三个交易加入同一个交易群组中。区块链系统在执行交易和共识时,将交易群组当作最小执行单元,一个交易群组里的所有交易要么同时成功,以保证参与方A、参与方B、以及参与方C三方都收到了彼此的转帐;要么同时失败,金钱物归原主,没有一方遭受损失。
如图6所示,可以在交易对应的交易请求中增加群组编号字段,如交易a对应的交易请求61中的群组编号字段为“群组标识:5,执行顺序标识:1,群组交易数量:3”,代表了该交易请求61所属交易群组的群组标识为5,该交易群组中包含了三个交易,而交易请求61对应的交易a是该交易群组中的第一个交易。同理,交易b对应的交易请求62中的群组编号字段为“群组标识:5,执行顺序标识:2,群组交易数量:3”,代表了该交易请求62所属交易群组的群组标识为5,该交易群组中包含了三个交易,而交易请求62对应的交易b是该交易群组中的第二个交易;交易c对应的交易请求63中的群组编号字段为“群组标识:5,执行顺序标识:3,群组交易数量:3”,代表了该交易请求63所属交易群组的群组标识为5,该交易群组中包含了三个交易,而交易请求63对应的交易c是该交易群组中的第三个交易。其中,执行顺序标识可以是三个参与方事先共同决定的,也可以是根据交易请求的发起时间决定的,这里不做限制。参与方A、参与方B以及参与方C可以通过多种方法来获取针对本次多方协作交易的群组标识,比如上述图4所对应实施例中步骤S202中所描述的获取群组标识的方法。
如图6所示,各个参与方在获取群组标识后,发出各自的交易请求,并用自己的私钥签名,得到签名数据,然后将交易请求和签名数据一并发送到区块链系统中。区块链系统通过签名数据对接收到的交易请求进行验证后,会生成相应的交易数据,然后将具有相同群组标识的交易数据作为群组交易数据打包到同一个提议区块中,可以理解,如果未收集完成一个交易群组中的交易数据,区块链系统会等待一定时间。然后,区块链 系统执行提议区块,以交易群组为单位执行交易,交易群组内任何一个交易执行失败可认为此交易群组失败,每个交易对应的群组交易数据的交易执行结果均会被更新为交易失败结果。最后,区块链系统会对执行后的提议区块进行共识和存储。需要说明的是,群组标识的获取也可以通过区块链系统完成,即多方协作交易的参与方无需获取群组标识,只需将交易请求发送至区块链系统,由区块链系统为其分配群组标识。
为更好的理解交易群组实现过程,参见图7,图7是本申请实施例提供的一种交易群组实现的流程示意图。如图7所示,终端设备71和终端设备72产生的交易对应的交易数据均可以被放入交易池中,等待被作为出块节点的共识节点73打包至提议区块。共识节点73按照共识算法进行出块,期间会将具有同一群组标识的交易数据放进群组缓存队列中进行缓存,直到获取到该群组标识对应的交易群组中的所有交易对应的交易数据,然后将完整群组中的所有交易数据作为群组交易数据打包进提议区块中,然后共识节点73会广播该提议区块至区块链系统中的其他共识节点。共识节点73执行提议区块中的各个交易群组对应的群组交易数据,具体执行过程可以参见上述图3所对应实施例的描述,这里不再进行赘述。共识节点73执行完提议区块,并与其他共识节点达成对该提议区块的共识后,会将结果通知到终端设备71和终端设备72。
请参见图8,是本申请实施例提供的一种基于区块链的数据处理装置的结构示意图。该数据处理装置可以是运行于计算机设备的一个计算机程序(包括程序代码),例如该数据处理装置为一个应用软件;该装置可以用于执行本申请实施例提供的数据处理方法中的相应步骤。如图8所示,该数据处理装置1可以包括:群组确定模块11、打包模块12、区块执行模块13、结果更新模块14、区块更新模块15以及记账模块16。
群组确定模块11,配置为将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据;
打包模块12,配置为将每个所述群组交易数据打包至提议区块中;
区块执行模块13,配置为将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;
结果更新模块14,配置为当所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果;
区块更新模块15,配置为根据每个所述群组交易数据对应的交易执行失败结果更新所述提议区块,得到目标提议区块;
记账模块16,配置为当所述目标提议区块共识通过时,对所述目标提议区块以及每个所述群组交易数据对应的交易执行失败结果进行记账处理。
其中,群组确定模块11、打包模块12、区块执行模块13、结果更新模块14、区块更新模块15以及记账模块16的具体实现方式,可以参见上述图3所对应实施例中步骤S101-步骤S104的描述,这里将不再进行赘述。
请参见图8,群组确定模块11可以包括:获取单元111、数据添加单元112、第一确定单元113以及第二确定单元114。
获取单元111,配置为从交易池中获取所述交易数据,其中,所述交易数据包含群组标识和群组交易数量;数据添加单元112,配置为将所述交易数据添加至所述群组标识对应的群组缓存队列中,得到更新群组缓存队列;第一确定单元113,配置为当所述更新群组缓存队列中的交易数据的数量等于所述群组交易数量时,将所述更新群组缓存队列中的交易数据,确定为群组交易数据;第二确定单元114,配置为当所述更新群组缓存队列中的交易数据的数量小于所述群组交易数量时,从所述交易池中继续获取包含所述群组标识的交易数据。
其中,获取单元111、数据添加单元112、第一确定单元113以及第二确定单元114 的具体实现方式,可以参见上述图3所对应实施例中步骤S101的描述,这里将不再进行赘述。
请参见图8,第二确定单元114可以包括:第一判断子单元1141以及第二判断子单元1142。
第一判断子单元1141,配置为当所述更新群组缓存队列中的交易数据的数量小于所述群组交易数量、且当前时间处于缓存时间段内时,从所述交易池中继续获取包含所述群组标识的交易数据;第二判断子单元1142,配置为当所述更新群组缓存队列中的交易数据的数量小于所述群组交易数量、且当前时间超出所述缓存时间段时,将所述更新群组缓存队列中的交易数据重新放入所述交易池中,清空所述更新群组缓存队列。
其中,第一判断子单元1141以及第二判断子单元1142的具体实现方式,可以参见上述图3所对应实施例中步骤S101的描述,这里将不再进行赘述。
其中,每个群组交易数据中均包含执行顺序标识;请参见图8,打包模块12可以包括:排序单元121以及打包单元122。
排序单元121,配置为根据每个所述群组交易数据包含的执行顺序标识,对每个所述群组交易数据进行排序处理,得到排序后的所述群组交易数据;打包单元122,配置为将排序后的所述群组交易数据打包至提议区块中。
其中,排序单元121以及打包单元122的具体实现方式,可以参见上述图3所对应实施例中步骤S102的描述,这里将不再进行赘述。
其中,所述群组交易数据的数量为S,S为大于1的正整数;请参见图8,区块执行模块13可以包括:交易执行单元131、第一结果确定单元132以及第二结果确定单元133。
交易执行单元131,配置为获取所述提议区块中第k个群组交易数据,执行所述第k个群组交易数据,得到所述第k个群组交易数据对应的交易执行结果,其中,k为依次递增的正整数,且k小于S;第一结果确定单元132,配置为当所述第k个群组交易数据对应的交易执行结果为交易执行成功结果时,继续执行所述提议区块中第k+1个群组交易数据;第二结果确定单元133,配置为当所述第k个群组交易数据对应的交易执行结果为交易执行失败结果时,将所述提议区块中第k+1个群组交易数据至第S个群组交易数据分别对应的交易执行结果,均确定为交易执行失败结果。
其中,交易执行单元131、第一结果确定单元132以及第二结果确定单元133的具体实现方式,可以参见上述图3所对应实施例中步骤S102的描述,这里将不再进行赘述。
请参见图8,区块更新模块15可以包括:树生成单元151以及树添加单元152。
树生成单元151,配置为根据每个所述群组交易数据对应的交易执行失败结果生成结果默克尔树,其中,所述结果默克尔树中包括树根哈希值;树添加单元152,配置为将所述树根哈希值添加至所述提议区块的区块头,得到目标提议区块。
其中,树生成单元151以及树添加单元152的具体实现方式,可以参见上述图3所对应实施例中步骤S103的描述,这里将不再进行赘述。
请参见图8,数据处理装置1还可以包括:广播模块17、哈希值处理模块18以及共识模块19。
广播模块17,配置为将所述提议区块广播至共识网络中的可通信共识节点,其中,所述可通信共识节点用于执行所述提议区块中的每个所述群组交易数据,根据每个所述群组交易数据对应的交易执行结果更新所述提议区块,得到可通信目标提议区块;哈希值处理模块18,配置为接收所述可通信共识节点发送的所述可通信目标提议区块的区块哈希值,将所述可通信目标提议区块的区块哈希值确定为待匹配区块哈希值;共识模块 19,配置为当与所述目标提议区块的区块哈希值相同的待匹配区块哈希值的数量大于共识数量阈值时,确定所述目标提议区块共识通过。
其中,广播模块17、哈希值处理模块18以及共识模块19的具体实现方式,可以参见上述图3所对应实施例中步骤S104的描述,这里将不再进行赘述。
请参见图9,图9是本申请实施例提供的一种计算机设备的结构示意图。如图9所示,上述图8所对应实施例中的数据处理装置1可以应用于上述计算机设备9000,上述计算机设备9000可以包括:处理器9001,网络接口9004和存储器9005,此外,上述计算机设备9000还包括:用户接口9003,和至少一个通信总线9002。其中,通信总线9002用于实现这些组件之间的连接通信。其中,用户接口9003可以包括显示屏(Display)、键盘(Keyboard),可选用户接口9003还可以包括标准的有线接口、无线接口。网络接口9004可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器9005可以是高速RAM存储器,也可以是非不稳定的存储器(Non-Volatile Memory),例如至少一个磁盘存储器。存储器9005还可以是至少一个位于远离前述处理器9001的存储装置。如图9所示,作为一种计算机可读存储介质的存储器9005中可以包括操作系统、网络通信模块、用户接口模块以及设备控制应用程序。
在图9所示的计算机设备9000中,网络接口9004可提供网络通讯功能;而用户接口9003主要用于为用户提供输入的接口;而处理器9001可以用于调用存储器9005中存储的设备控制应用程序,以实现:
将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据;
将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;
当所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果,根据每个所述群组交易数据对应的交易执行失败结果更新所述提议区块,得到目标提议区块;
当所述目标提议区块共识通过时,对所述目标提议区块以及每个所述群组交易数据对应的交易执行失败结果进行记账处理。
应当理解,本申请实施例中所描述的计算机设备1000可执行前文各个实施例中对该数据处理方法的描述,也可执行前文图8所对应实施例中对该数据处理装置1的描述,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
此外,这里需要指出的是:本申请实施例还提供了一种计算机可读存储介质,且上述计算机可读存储介质中存储有前文提及的数据处理装置1所执行的计算机程序,当上述处理器加载并执行上述计算机程序时,能够执行前文任一实施例对上述数据处理方法的描述,因此,这里将不再进行赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。对于本申请所涉及的计算机可读存储介质实施例中未披露的技术细节,请参照本申请方法实施例的描述。
请参见图10,图10是本申请实施例提供的另一种基于区块链的数据处理装置的结构示意图。上述数据处理装置可以是运行于计算机设备中的一个计算机程序(包括程序代码),例如该数据处理装置为一个应用软件;该数据处理装置可以用于执行本申请实施例提供的方法中的相应步骤。如图10所示,该数据处理装置2可以包括:请求接收模块21、标识确定模块22以及数据添加模块23。
请求接收模块21,配置为接收终端设备发送的针对多方协作交易的交易请求;
标识确定模块22,配置为根据所述交易请求确定所述多方协作交易对应的群组标识;
数据添加模块23,配置为根据所述多方协作交易对应的群组标识和所述交易请求生成具有群组标识的交易数据,将所述交易数据添加至交易池中;
其中,所述交易池中具有相同群组标识的多个交易数据,所述交易数据用于供共识节点确定为群组交易数据,所述共识节点用于将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;所述共识节点还用于在所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果。
其中,请求接收模块21、标识确定模块22以及数据添加模块23的具体实现方式,可以参见上述图4所对应实施例中步骤S201-步骤S203的描述,这里将不再进行赘述。
其中,所述交易请求携带有签名数据,所述签名数据是所述终端设备通过私钥对所述交易请求进行签名处理后得到的;请参见图10,数据处理装置2还可以包括:签名模块24。
签名模块24,配置为获取所述终端设备对应的公钥;签名模块24,还配置为通过所述公钥对所述签名数据进行验签处理,得到验签结果;签名模块24,还配置为当所述验签结果为验签通过结果时,则通知标识确定模块22根据交易请求确定多方协作交易对应的群组标识。
其中,签名模块24的具体实现方式,可以参见上述图4所对应实施例中步骤S202的描述,这里将不再进行赘述。
其中,所述交易请求的数量为多个,每个所述交易请求包含执行顺序标识;请参见图10,标识确定模块22可以包括:第一标识确定单元221。
第一标识确定单元221,配置为当获取到执行顺序标识所指示的顺序优先级为最高优先级的交易请求时,将所述顺序优先级为最高优先级的交易请求,确定为群组标识请求;第一标识确定单元221,还配置为对所述群组标识请求进行哈希处理,得到请求哈希值,将所述请求哈希值确定为所述多方协作交易对应的群组标识。
其中,第一标识确定单元221的具体实现方式,可以参见上述图4所对应实施例中步骤S202的描述,这里将不再进行赘述。
其中,交易请求包含发起多方协作交易的协作交易发起对象;请参见图10,标识确定模块22可以包括:第二标识确定单元222。
第二标识确定单元222,配置为从所述交易请求中获取所述协作交易发起对象;第二标识确定单元222,还配置为在身份标识库中,查找所述协作交易发起对象对应的身份标识;第二标识确定单元222,还配置为根据所述身份标识生成所述多方协作交易对应的群组标识。
其中,第二标识确定单元222的具体实现方式,可以参见上述图4所对应实施例中步骤S202的描述,这里将不再进行赘述。
请参见图10,数据处理装置2还可以包括:标识生成模块25。
标识生成模块25,配置为获取由协作交易发起对象发起的针对多方协作交易的标识获取请求,其中,所述标识获取请求中包含参与所述多方协作交易的交易对象;标识生成模块25,还配置为根据所述标识获取请求生成针对所述多方协作交易的可用群组标识;标识生成模块25,还配置为将所述可用群组标识发送至所述交易对象对应的终端设备,其中,所述交易对象对应的终端设备生成包含所述可用群组标识的交易请求。
标识确定模块22可以包括:第三标识确定单元223。
第三标识确定单元223,配置为将所述交易请求中的所述可用群组标识,确定为所述多方协作交易对应的群组标识。
其中,标识生成模块25以及第三标识确定单元223的具体实现方式,可以参见上述图4所对应实施例中步骤S202的描述,这里将不再进行赘述。
请参见图11,图11是本申请实施例提供的另一种计算机设备的结构示意图。如图 11所示,上述图10所对应实施例中的数据处理装置2可以应用于上述计算机设备2000,上述计算机设备2000可以包括:处理器2001,网络接口2004和存储器2005,此外,上述计算机设备2000还包括:用户接口2003,和至少一个通信总线2002。其中,通信总线2002用于实现这些组件之间的连接通信。其中,用户接口2003可以包括显示屏(Display)、键盘(Keyboard),可选用户接口2003还可以包括标准的有线接口、无线接口。网络接口2004可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器2005可以是高速RAM存储器,也可以是非不稳定的存储器(Non-Volatile Memory),例如至少一个磁盘存储器。存储器2005还可以是至少一个位于远离前述处理器2001的存储装置。如图11所示,作为一种计算机可读存储介质的存储器2005中可以包括操作系统、网络通信模块、用户接口模块以及设备控制应用程序。
在图11所示的计算机设备2000中,网络接口2004可提供网络通讯功能;而用户接口2003主要用于为用户提供输入的接口;而处理器2001可以用于调用存储器2005中存储的设备控制应用程序,以实现:
接收终端设备发送的针对多方协作交易的交易请求;
根据所述交易请求确定所述多方协作交易对应的群组标识;
根据所述多方协作交易对应的群组标识和所述交易请求生成具有群组标识的交易数据,将所述交易数据添加至交易池中;
其中,所述交易池中具有相同群组标识的多个交易数据,所述交易数据用于供共识节点确定为群组交易数据,所述共识节点用于将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;所述共识节点还用于在所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果。
应当理解,本申请实施例中所描述的计算机设备2000可执行前文各个实施例中对该访问控制方法的描述,也可执行前文图10所对应实施例中对该数据处理装置2的描述,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
此外,这里需要指出的是:本申请实施例还提供了一种计算机可读存储介质,且上述计算机可读存储介质中存储有前文提及的数据处理装置2所执行的计算机程序,当上述处理器加载并执行上述计算机程序时,能够执行前文任一实施例对上述访问控制方法的描述,因此,这里将不再进行赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。对于本申请所涉及的计算机可读存储介质实施例中未披露的技术细节,请参照本申请方法实施例的描述。
上述计算机可读存储介质可以是前述任一实施例提供的数据处理装置或者上述计算机设备的内部存储单元,例如计算机设备的硬盘或内存。该计算机可读存储介质也可以是该计算机设备的外部存储设备,例如该计算机设备上配备的插接式硬盘,智能存储卡(SMC,Smart Media Card),安全数字(SD,Secure Digital)卡,闪存卡(flash card)等。该计算机可读存储介质还可以既包括该计算机设备的内部存储单元也包括外部存储设备。该计算机可读存储介质用于存储该计算机程序以及该计算机设备所需的其他程序和数据。该计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。
此外,这里需要指出的是:本申请实施例还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行前文任一个所对应实施例提供的方法。
本申请实施例的说明书和权利要求书及附图中的术语“第一”、“第二”等是用于区别不同对象,而非用于描述特定顺序。此外,术语“包括”以及它们任何变形,意图在于覆 盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、装置、产品或设备没有限定于已列出的步骤或模块,而是可选地还包括没有列出的步骤或模块,或可选地还包括对于这些过程、方法、装置、产品或设备固有的其他步骤单元。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照网元一般性地描述了各示例的组成及步骤。这些网元究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的网元,但是这种实现不应认为超出本申请的范围。
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

Claims (17)

  1. 一种基于区块链的数据处理方法,应用于计算机设备,所述计算机设备在区块链网络中映射为共识节点,所述方法包括:
    所述共识节点将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据;
    将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;
    当所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果,根据每个所述群组交易数据对应的交易执行失败结果更新所述提议区块,得到目标提议区块;
    当所述目标提议区块共识通过时,对所述目标提议区块以及每个所述群组交易数据对应的交易执行失败结果进行记账处理。
  2. 根据权利要求1所述的方法,其中,所述共识节点将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据,包括:
    共识节点从交易池中获取所述交易数据,其中,所述交易数据包含群组标识和群组交易数量;
    将所述交易数据添加至所述群组标识对应的群组缓存队列中,得到更新群组缓存队列;
    当所述更新群组缓存队列中的交易数据的数量等于所述群组交易数量时,将所述更新群组缓存队列中的交易数据,确定为群组交易数据;
    当所述更新群组缓存队列中的交易数据的数量小于所述群组交易数量时,从所述交易池中继续获取包含所述群组标识的交易数据。
  3. 根据权利要求2所述的方法,其中,所述当所述更新群组缓存队列中的交易数据的数量小于所述群组交易数量时,从所述交易池中继续获取包含所述群组标识的交易数据,包括:
    当所述更新群组缓存队列中的交易数据的数量小于所述群组交易数量、且当前时间处于缓存时间段内时,从所述交易池中继续获取包含所述群组标识的交易数据;
    所述方法还包括:
    当所述更新群组缓存队列中的交易数据的数量小于所述群组交易数量、且当前时间超出所述缓存时间段时,将所述更新群组缓存队列中的交易数据重新放入所述交易池中,清空所述更新群组缓存队列。
  4. 根据权利要求1所述的方法,其中,
    每个所述群组交易数据均包含执行顺序标识;
    所述将每个所述群组交易数据打包至提议区块中,包括:
    根据每个所述群组交易数据包含的执行顺序标识,对每个所述群组交易数据进行排序处理,得到排序后的所述群组交易数据;
    将排序后的所述群组交易数据打包至提议区块中。
  5. 根据权利要求1所述的方法,其中,
    所述群组交易数据的数量为S,S为大于1的正整数;
    所述执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果,包括:
    获取所述提议区块中第k个群组交易数据,执行所述第k个群组交易数据,得到所述第k个群组交易数据对应的交易执行结果,其中,k为依次递增的正整数,且k小于S;
    当所述第k个群组交易数据对应的交易执行结果为交易执行成功结果时,继续执行 所述提议区块中第k+1个群组交易数据;
    当所述第k个群组交易数据对应的交易执行结果为交易执行失败结果时,将所述提议区块中第k+1个群组交易数据至第S个群组交易数据分别对应的交易执行结果,均确定为交易执行失败结果;
    将每个所述群组交易数据分别对应的交易执行结果作为已执行完的交易执行结果。
  6. 根据权利要求1所述的方法,其中,所述根据每个所述群组交易数据对应的交易执行失败结果更新所述提议区块,得到目标提议区块,包括:
    根据每个所述群组交易数据对应的交易执行失败结果生成结果默克尔树,其中,所述结果默克尔树中包括树根哈希值;
    将所述树根哈希值添加至所述提议区块的区块头,得到目标提议区块。
  7. 根据权利要求1所述的方法,其中,所述还包括:
    将所述提议区块广播至共识网络中的可通信共识节点,其中,所述可通信共识节点用于执行所述提议区块中的每个所述群组交易数据,根据每个所述群组交易数据对应的交易执行结果更新所述提议区块,得到可通信目标提议区块;
    接收所述可通信共识节点发送的所述可通信目标提议区块的区块哈希值,将所述可通信目标提议区块的区块哈希值确定为待匹配区块哈希值;
    当与所述目标提议区块的区块哈希值相同的待匹配区块哈希值的数量大于共识数量阈值时,确定所述目标提议区块共识通过。
  8. 一种基于区块链的数据处理方法,应用于计算机设备,所述计算机设备在区块链网络中映射为业务节点,所述方法包括:
    所述业务节点接收终端设备发送的针对多方协作交易的交易请求;
    根据所述交易请求确定所述多方协作交易对应的群组标识;
    根据所述多方协作交易对应的群组标识和所述交易请求生成具有群组标识的交易数据,将所述交易数据添加至交易池中;
    其中,所述交易池中具有相同群组标识的多个交易数据,所述交易数据用于供共识节点确定为群组交易数据,所述共识节点用于将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;所述共识节点还用于在所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果。
  9. 根据权利要求8所述的方法,其中,
    所述交易请求携带有签名数据,所述签名数据是所述终端设备通过私钥对所述交易请求进行签名处理后得到的;
    所述方法还包括:
    获取所述终端设备对应的公钥;
    通过所述公钥对所述签名数据进行验签处理,得到验签结果;
    当所述验签结果为验签通过结果时,执行根据所述交易请求确定所述多方协作交易对应的群组标识的步骤。
  10. 根据权利要求8所述的方法,其中,
    所述交易请求的数量为多个,每个所述交易请求包含执行顺序标识;
    所述根据所述交易请求确定所述多方协作交易对应的群组标识,包括:
    当获取到执行顺序标识所指示的顺序优先级为最高优先级的交易请求时,将所述顺序优先级为最高优先级的交易请求,确定为群组标识请求;
    对所述群组标识请求进行哈希处理,得到请求哈希值,将所述请求哈希值确定为所述多方协作交易对应的群组标识。
  11. 根据权利要求8所述的方法,其中,
    所述交易请求包含发起所述多方协作交易的协作交易发起对象;
    所述根据所述交易请求确定所述多方协作交易对应的群组标识,包括:
    从所述交易请求中获取所述协作交易发起对象;
    在身份标识库中,查找所述协作交易发起对象对应的身份标识;
    根据所述身份标识生成所述多方协作交易对应的群组标识。
  12. 根据权利要求8所述的方法,其中,所述方法还包括:
    获取由协作交易发起对象发起的针对多方协作交易的标识获取请求,其中,所述标识获取请求中包含参与所述多方协作交易的交易对象;
    根据所述标识获取请求生成针对所述多方协作交易的可用群组标识;
    将所述可用群组标识发送至所述交易对象对应的终端设备,其中,所述交易对象对应的终端设备生成包含所述可用群组标识的交易请求;
    所述根据所述交易请求确定所述多方协作交易对应的群组标识,包括:
    将所述交易请求中的所述可用群组标识,确定为所述多方协作交易对应的群组标识。
  13. 一种基于区块链的数据处理装置,包括:
    群组确定模块,配置为将交易池中具有相同群组标识的多个交易数据,确定为群组交易数据;
    打包模块,配置为将每个所述群组交易数据打包至提议区块中;
    区块执行模块,配置为将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;
    结果更新模块,配置为当所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果;
    区块更新模块,配置为根据每个所述群组交易数据对应的交易执行失败结果更新所述提议区块,得到目标提议区块;
    记账模块,配置为当所述目标提议区块共识通过时,对所述目标提议区块以及每个所述群组交易数据对应的交易执行失败结果进行记账处理。
  14. 一种基于区块链的数据处理装置,包括:
    请求接收模块,配置为接收终端设备发送的针对多方协作交易的交易请求;
    标识确定模块,配置为根据所述交易请求确定所述多方协作交易对应的群组标识;
    数据添加模块,配置为根据所述多方协作交易对应的群组标识和所述交易请求生成具有群组标识的交易数据,将所述交易数据添加至交易池中;
    其中,所述交易池中具有相同群组标识的多个交易数据,所述交易数据用于供共识节点确定为群组交易数据,所述共识节点用于将每个所述群组交易数据打包至提议区块中,执行所述提议区块中的每个所述群组交易数据,得到已执行完的交易执行结果;所述共识节点还用于在所述已执行完的交易执行结果中包含交易执行失败结果时,将每个所述群组交易数据对应的交易执行结果均更新为交易执行失败结果。
  15. 一种计算机设备,包括:处理器、存储器以及网络接口;
    所述处理器与所述存储器、所述网络接口相连,其中,所述网络接口用于提供数据通信功能,所述存储器用于存储程序代码,所述处理器用于调用所述程序代码,以执行权利要求1-12任一项所述的方法。
  16. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序适于由处理器加载并执行权利要求1-12任一项所述的方法。
  17. 一种计算机程序产品,包括计算机指令,处理器执行所述计算机指令,以执行权利要求1-12任一项所述的方法。
PCT/CN2022/099549 2021-08-06 2022-06-17 基于区块链的数据处理方法、装置、设备、可读存储介质及计算机程序产品 WO2023011019A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2023558388A JP2024515022A (ja) 2021-08-06 2022-06-17 ブロックチェーンに基づくデータ処理方法、装置、機器及びコンピュータプログラム
US18/137,336 US20230259938A1 (en) 2021-08-06 2023-04-20 Blockchain-based data processing method and apparatus, device, readable storage medium and computer program product

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110901263.XA CN113342838B (zh) 2021-08-06 2021-08-06 基于区块链的数据处理方法、装置、设备及可读存储介质
CN202110901263.X 2021-08-06

Publications (1)

Publication Number Publication Date
WO2023011019A1 true WO2023011019A1 (zh) 2023-02-09

Family

ID=77480912

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099549 WO2023011019A1 (zh) 2021-08-06 2022-06-17 基于区块链的数据处理方法、装置、设备、可读存储介质及计算机程序产品

Country Status (4)

Country Link
US (1) US20230259938A1 (zh)
JP (1) JP2024515022A (zh)
CN (1) CN113342838B (zh)
WO (1) WO2023011019A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342838B (zh) * 2021-08-06 2021-11-09 腾讯科技(深圳)有限公司 基于区块链的数据处理方法、装置、设备及可读存储介质
CN115829731A (zh) * 2021-09-15 2023-03-21 华为技术有限公司 一种交易信息处理方法及装置
CN115633008A (zh) * 2022-10-31 2023-01-20 中国农业银行股份有限公司 基于区块链的群待办功能实现方法、装置、设备及介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680363A (zh) * 2013-11-26 2015-06-03 国际商业机器公司 用于同步分离付款交易管理的方法及系统
CN108769173A (zh) * 2018-05-21 2018-11-06 阿里体育有限公司 运行智能合约的区块链实现方法及设备
CN109995850A (zh) * 2019-03-05 2019-07-09 深圳前海微众银行股份有限公司 一种区块链系统及区块链系统的交易处理方法
CN110415117A (zh) * 2019-06-28 2019-11-05 阿里巴巴集团控股有限公司 基于区块链的交易处理方法、装置和电子设备
US20200344070A1 (en) * 2019-04-29 2020-10-29 Alibaba Group Holding Limited Methods and devices for validating transaction in blockchain system
CN112685796A (zh) * 2021-03-12 2021-04-20 腾讯科技(深圳)有限公司 一种基于区块链的区块共识方法以及相关设备
CN113342838A (zh) * 2021-08-06 2021-09-03 腾讯科技(深圳)有限公司 基于区块链的数据处理方法、装置、设备及可读存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130080236A1 (en) * 2011-09-26 2013-03-28 First Data Corporation Systems and Methods for Enrolling Consumers in Loyalty Programs
CN111967862A (zh) * 2020-08-28 2020-11-20 华中科技大学 基于区块链智能合约的数字货币共同支付方法及系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680363A (zh) * 2013-11-26 2015-06-03 国际商业机器公司 用于同步分离付款交易管理的方法及系统
CN108769173A (zh) * 2018-05-21 2018-11-06 阿里体育有限公司 运行智能合约的区块链实现方法及设备
CN109995850A (zh) * 2019-03-05 2019-07-09 深圳前海微众银行股份有限公司 一种区块链系统及区块链系统的交易处理方法
US20200344070A1 (en) * 2019-04-29 2020-10-29 Alibaba Group Holding Limited Methods and devices for validating transaction in blockchain system
CN110415117A (zh) * 2019-06-28 2019-11-05 阿里巴巴集团控股有限公司 基于区块链的交易处理方法、装置和电子设备
CN112685796A (zh) * 2021-03-12 2021-04-20 腾讯科技(深圳)有限公司 一种基于区块链的区块共识方法以及相关设备
CN113342838A (zh) * 2021-08-06 2021-09-03 腾讯科技(深圳)有限公司 基于区块链的数据处理方法、装置、设备及可读存储介质

Also Published As

Publication number Publication date
CN113342838B (zh) 2021-11-09
US20230259938A1 (en) 2023-08-17
CN113342838A (zh) 2021-09-03
JP2024515022A (ja) 2024-04-04

Similar Documents

Publication Publication Date Title
WO2023011019A1 (zh) 基于区块链的数据处理方法、装置、设备、可读存储介质及计算机程序产品
CN112685796B (zh) 一种基于区块链的区块共识方法以及相关设备
WO2023045620A1 (zh) 一种交易数据处理方法、装置、计算机设备以及存储介质
US20230074102A1 (en) Method and apparatus for processing data based on block chain, device and readable storage medium
CN112287034B (zh) 一种数据同步方法、设备以及计算机可读存储介质
US20230289782A1 (en) Smart contract-based data processing
CN112883117B (zh) 一种数据同步方法、设备以及计算机可读存储介质
CN111885133A (zh) 基于区块链的数据处理方法、装置及计算机存储介质
CN109936620B (zh) 基于区块链的存储方法及装置、系统与存储介质
CN113255014B (zh) 一种基于区块链的数据处理方法以及相关设备
WO2023020242A1 (zh) 基于区块链的数据处理方法、装置、计算机设备、计算机可读存储介质及计算机程序产品
US20230325833A1 (en) Blockchain-based data processing method and apparatus, device, storage medium, and program product
CN117010889A (zh) 数据处理方法、装置及设备、介质、产品
WO2024066974A1 (zh) 基于区块链的数据处理方法、设备以及可读存储介质
US20240163118A1 (en) Blockchain-based data processing method, device, and readable storage medium
WO2024007856A1 (zh) 数据处理方法、装置及设备、介质、产品
WO2024037117A1 (zh) 一种基于区块链的数据处理方法、设备、介质和程序产品
US20230334726A1 (en) Blockchain-based data processing method and apparatus, device, storage medium, and program product
WO2024103998A1 (zh) 基于区块链的数据处理方法、装置、电子设备、计算机可读存储介质及计算机程序产品
CN117176737A (zh) 基于区块链的数据处理方法、装置、设备及可读存储介质
CN116506294A (zh) 共识网络优化方法、装置、计算机设备和存储介质
CN117255130A (zh) 一种基于区块链的数据处理方法、装置、设备及介质
CN118074931A (zh) 一种基于区块链的数据处理方法以及相关设备
CN114117545A (zh) 一种防篡改的电子证明系统及其实现方法
CN117411858A (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: 22851735

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023558388

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 2301006739

Country of ref document: TH

WWE Wipo information: entry into national phase

Ref document number: 11202306833Q

Country of ref document: SG

NENP Non-entry into the national phase

Ref country code: DE