CN117437052A - Transaction processing method, device, computer, storage medium and program product - Google Patents

Transaction processing method, device, computer, storage medium and program product Download PDF

Info

Publication number
CN117437052A
CN117437052A CN202311374237.1A CN202311374237A CN117437052A CN 117437052 A CN117437052 A CN 117437052A CN 202311374237 A CN202311374237 A CN 202311374237A CN 117437052 A CN117437052 A CN 117437052A
Authority
CN
China
Prior art keywords
node
random
transaction
data
verification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311374237.1A
Other languages
Chinese (zh)
Inventor
黄杨峻
王宗友
朱耿良
刘区城
时一防
廖志勇
刘汉卿
聂凯轩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311374237.1A priority Critical patent/CN117437052A/en
Publication of CN117437052A publication Critical patent/CN117437052A/en
Pending legal-status Critical Current

Links

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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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/3821Electronic credentials
    • G06Q20/38215Use of certificates or encrypted proofs of transaction rights
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Computing Systems (AREA)
  • Marketing (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a transaction processing method, a device, a computer, a storage medium and a program product, wherein the method comprises the following steps: transmitting the first transaction data to a blockchain node, and acquiring a first random certification and first random data of the blockchain node aiming at the first transaction data; the first random certification is obtained by carrying out hash processing on the first transaction data and the node private key; the first random data is obtained by hash processing of a first random proof; verifying the first random certification and the first random data, and if the first random certification and the first random data pass through verification, determining a first packing node and a first verification node from the blockchain nodes based on the first random certification; and sending the first transaction data and the first verification node list to a first packing node so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data. By adopting the method and the device, the resource consumption of transaction processing can be reduced.

Description

Transaction processing method, device, computer, storage medium and program product
Technical Field
The present invention relates to the field of computer technology, and in particular, to a transaction processing method, apparatus, computer, storage medium, and program product.
Background
With the development of the blockchain network, the blockchain network is increasingly widely applied, and in order to ensure the security and reliability of transaction data in the blockchain network, the consensus of the transaction data is an important part of the blockchain network. Currently, transaction data is commonly identified through an identification algorithm, such as Proof of Work (PoW), wherein the identification algorithm requires participants (i.e. packaging nodes, identification nodes, etc.) to create new blocks by solving a mathematical problem with a certain difficulty, and the process requires a great deal of computing power and energy consumption; or the Bayesian fault tolerance (Byzantine Fault Tolerance, BFT) algorithm needs to transmit information between all the block chain nodes in pairs, so that the communication complexity is high, the consensus time is long, and the communication resource loss is high.
Disclosure of Invention
The embodiment of the application provides a transaction processing method, a device, a computer, a storage medium and a program product, which can reduce the resource consumption of transaction processing and improve the transaction processing efficiency.
In one aspect, an embodiment of the present application provides a transaction processing method, including:
transmitting the first transaction data to a blockchain node, and acquiring a first random certification and first random data generated by the blockchain node aiming at the first transaction data; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key;
verifying the first random certification and the first random data, and if the first random certification and the first random data pass through verification, determining a first packing node and a first verification node from the blockchain nodes based on the first random certification;
the first transaction data and the first verification node list are sent to a first packing node, so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node.
In one aspect, an embodiment of the present application provides a transaction processing device, including:
the transaction sending module is used for sending the first transaction data to the blockchain node;
The random acquisition module is used for acquiring a first random certificate and first random data generated by the block link points aiming at the first transaction data; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key;
the random verification module is used for verifying the first random certification and the first random data;
the node determining module is used for determining a first packing node and a first verification node from the block chain nodes based on the first random certification if the first random certification and the first random data pass through verification;
the node feedback module is used for sending the first transaction data and the first verification node list to the first packing node so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node.
Wherein, this random verification module includes:
the verification unit is used for verifying the first random certificate by adopting the first random data and determining a verification result of the first random certificate;
The parameter processing unit is used for acquiring the node public key and the random parameter of the block chain node and generating a parameter to be verified based on the random parameter, the node public key and the first random data;
and the data verification unit is used for generating a linear parameter according to the random parameter, and if the parameter to be verified is the same as the linear parameter, the first random data is verified successfully.
Wherein the proof verification unit includes:
the data matching subunit is used for carrying out hash processing on the first random certification to obtain data to be verified, and if the data to be verified is the same as the first random data, the first random certification is confirmed to pass verification; or,
and the certification matching subunit is used for generating a to-be-verified certification based on the first random data, and if the to-be-verified certification is the same as the first random certification, the first random certification is confirmed to pass verification.
Wherein, this node determination module includes:
the packaging consensus unit is used for determining a first packaging node through the first random certification together with the blockchain node if the first random certification and the first random data are verified to pass;
and the verification determining unit is used for acquiring the node identity range, screening the blockchain node based on the node identity range and the first random certification, and determining a first verification node.
The number of the block chain nodes is N, and N is a positive integer;
the node determining module includes:
the identity acquisition unit is used for acquiring node identities sent by the link points of the N blocks if the first random certification and the first random data pass verification;
the legal screening unit is used for acquiring node identity ranges of node identities corresponding to the N block chain link points respectively, and determining the block chain node with the first random certification belonging to the corresponding node identity range as a legal node from the N block chain nodes;
the node determining unit is used for determining a first packet node and a first verification node in the legal nodes based on the node identities of the legal nodes.
Wherein, this node determination module includes:
the range acquisition unit is used for acquiring M node identity ranges if the first random certification and the first random data pass verification; m is a positive integer; the M node identity ranges comprise a first node identity range and a second node identity range;
the range dividing unit is used for determining the blockchain node of the first random certification belonging to the identity range of the first node as a first packing node, and determining the blockchain node of the first random certification belonging to the identity range of the second node as a first verification node.
The number of the first packet nodes is P, and P is a positive integer; the node feedback module comprises:
the operation acquisition unit is used for acquiring node operation information of the P first packet nodes and determining the first packet node corresponding to the optimal node operation node information in the P node operation information as a first target packet node;
and the node feedback unit is used for sending the first transaction data and the first verification node list to the first target packaging node.
The first verification node comprises a first transaction verification node and a first block verification node; the apparatus further comprises:
the transaction sending module is used for sending the first transaction data to the first transaction verification node if the first packet node is the node generating the first transaction data, so that the first transaction verification node verifies the transaction data;
the transaction packaging module is used for acquiring a transaction verification result sent by the first transaction verification node aiming at the first transaction data, and packaging the first transaction data to generate a first transaction block when the transaction verification result is a transaction verification success result;
the block transmitting module is used for transmitting the first transaction block to the first block verification node so that the first block verification node can carry out consensus on the first transaction block;
The block uplink module is used for acquiring a block verification result sent by the first block verification node aiming at the first transaction block, and performing uplink processing on the first transaction block when the block verification result is a block verification success result;
and the feedback calling module is used for executing the process of sending the first transaction data and the first verification node list to the first packing node if the first packing node is not the node generating the first transaction data.
Wherein the apparatus further comprises:
the certification generation module is used for receiving second transaction data sent by the second service node, acquiring random parameters, carrying out hash processing on the second transaction data and the private key of the first node by adopting the random parameters, and generating a second random certification for the second transaction data; the first node private key is a node private key of the first service node; the first service node is a node generating first transaction data;
the data generation module is used for carrying out hash processing on the second random certification to obtain second random data, and sending the second random certification and the second random data to the second service node so that the second service node determines a second packing node and a second verification node based on the second random certification and the second random data.
Wherein the apparatus further comprises:
the transaction verification module is used for receiving second transaction data sent by the second packaging node and verifying the second transaction data;
the transaction signature module is used for acquiring a first node private key if the second transaction data passes verification, signing the second transaction data by adopting the first node private key to acquire a first transaction signature, and sending the first transaction signature and a successful transaction verification result to the second packaging node;
and the failure feedback module is used for sending a transaction verification failure result to the second packaging node if the second transaction data is not verified.
Wherein the apparatus further comprises:
the block acquisition module is used for receiving a second transaction block sent by the second packaging node and acquiring a third transaction signature in the second transaction block;
the signature verification module is used for acquiring a first node public key of a second verification node corresponding to the third transaction signature, and performing signature verification processing on the third transaction signature by adopting the first node public key;
and the block consensus module is used for voting the second transaction block if the third transaction signature passes the verification, and sending a block verification result aiming at the second transaction block to the second packaging node.
In one aspect, a computer device is provided, including a processor, a memory, and an input/output interface;
the processor is respectively connected with the memory and the input/output interface, wherein the input/output interface is used for receiving data and outputting data, the memory is used for storing a computer program, and the processor is used for calling the computer program so as to enable the computer equipment containing the processor to execute the transaction processing method in the aspect of the embodiment of the application.
An aspect of the present application provides a computer readable storage medium storing a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the transaction processing method in an aspect of the present application.
In one aspect, the present application provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read from the computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the methods provided in the various alternatives in an aspect of the embodiments of the present application. In other words, the computer instructions, when executed by a processor, implement the methods provided in various alternatives in an aspect of the embodiments of the present application.
Implementation of the embodiment of the application has the following beneficial effects:
in the embodiment of the application, the first transaction data can be sent to the blockchain node, and the first random certification and the first random data generated by the blockchain node aiming at the first transaction data are obtained; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key; verifying the first random certification and the first random data, and if the first random certification and the first random data pass through verification, determining a first packing node and a first verification node from the blockchain nodes based on the first random certification; the first transaction data and the first verification node list are sent to a first packing node, so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node. In this way, when transaction data (such as first transaction data) is generated, each blockchain node only needs to perform random certification and random data generation on the transaction data, and mathematical problems with certain difficulty are not needed to be solved, and the blockchain node can determine the packaging node (such as the first packaging node) and the verification node (such as the first verification node) from the blockchain nodes, so that the calculation capacity and the energy consumption consumed in the transaction processing process are reduced, namely the resource consumption of the transaction processing is reduced. In addition, after the packing node and the verification node aiming at the transaction data are determined, the verification and the uplink of the transaction data can be realized directly based on the determined packing node and the verification node, under the condition of node determination, the corresponding data are sent to the determined nodes in each stage only when the transaction data are processed, for example, the transaction data can be sent to the packing node in the transaction packing stage, and the transaction data are sent to the verification node in the transaction verification stage, so that the verification and the uplink of the transaction data can be realized, the communication complexity among block chain nodes in the transaction processing process is greatly reduced, the transaction processing time is saved, the transaction processing efficiency and performance are improved, and the communication resource loss is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a network interaction architecture diagram for transaction processing provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a transaction processing scenario provided in an embodiment of the present application;
FIG. 3 is a flow chart of a method of transaction processing provided by an embodiment of the present application;
fig. 4 is a schematic diagram of a random processing scenario provided in an embodiment of the present application;
FIG. 5 is a flow chart of another method of transaction processing provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a transaction processing interaction flow provided in an embodiment of the present application;
FIG. 7 is a schematic diagram of a transaction processing device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
If data of an object (such as a user) needs to be collected in the application, before and during collection, a prompt interface or a popup window is displayed, and the prompt interface or the popup window is used for prompting the user to collect certain data currently, and only after the user sends confirmation operation to the prompt interface or the popup window, the relevant step of data acquisition is started, otherwise, the process is ended. The acquired user data is used in a reasonable and legal scene, application, or the like. Optionally, in some scenarios where user data is required but not authorized by the user, authorization may be requested from the user, and the user data may be reused when authorization passes. That is, the use of user data by the present application complies with relevant regulations of law and regulations, i.e. is reasonably legal for use of user data.
In this embodiment of the present application, please refer to fig. 1, fig. 1 is a network interaction architecture diagram of a transaction processing provided in this embodiment of the present application, as shown in fig. 1, the blockchain network 101 includes a plurality of blockchain nodes, such as a blockchain node 101a, a blockchain node 101b, and a blockchain node 101c, where each blockchain node may be used for different operations, such as a blockchain node generating transaction data, or when the transaction data is sent to other blockchain nodes, the blockchain node may be considered as a transaction sending node; if the blockchain node packages transaction data to generate a block, the blockchain node can be regarded as a packaging node; such as blockchain nodes, when validating transactions, may be considered transaction validation nodes; if a blockchain node verifies a block, the blockchain node may be considered a block verification node; such as when a blockchain node is not performing operations, the blockchain node may be considered a regular node, etc. That is, a blockchain node may exist in the blockchain network as any one of the identities. Alternatively, the packing node and the transaction transmitting node may be the same node, and the transaction verification node and the block verification node may also be the same node, which is not limited herein. That is, the processing procedure of one transaction may involve a plurality of kinds of blockchain nodes, or may involve only a transaction transmitting node, a packaging node, a verification node (the verification node may be regarded as a combination of a transaction verification node and a blockchain verification node), and the like, which is not limited herein.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
The blockchain bottom platform may include processing modules such as user management, basic services, intelligent contracts, operation detection, and the like. The user management module is responsible for identity information management of all blockchain participants, including maintenance of public and private key generation (account management), key management, maintenance of corresponding relation between the real identity of the user and the blockchain address (authority management) and the like, and under the condition of authorization, supervision and audit of transaction conditions of certain real identities, and provision of rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node devices, is used for verifying the validity of a service request, recording the service request on a storage after the effective request is identified, for a new service request, the basic service firstly analyzes interface adaptation and authenticates the interface adaptation, encrypts service information (identification management) through an identification algorithm, and transmits the encrypted service information to a shared account book (network communication) in a complete and consistent manner, and records and stores the service information; the intelligent contract module is responsible for registering and issuing contracts, triggering contracts and executing contracts, a developer can define contract logic through a certain programming language, issue the contract logic to a blockchain (contract registering), invoke keys or other event triggering execution according to the logic of contract clauses to complete the contract logic, and simultaneously provide a function of registering contract upgrading; the operation detection module is mainly responsible for deployment in the product release process, modification of configuration, contract setting, cloud adaptation and visual output of real-time states in product operation, for example: alarms, detecting network conditions, detecting node device health status, etc.
The platform product service layer provides basic capabilities and implementation frameworks of typical applications, and developers can complete the blockchain implementation of business logic based on the basic capabilities and the characteristics of the superposition business. The application service layer provides the application service based on the block chain scheme to the business participants for use.
Specifically, referring to fig. 2, fig. 2 is a schematic diagram of a transaction processing scenario provided in an embodiment of the present application. As shown in fig. 2, the first service node 201 may send the first transaction data to the blockchain node 202, where the number of blockchain nodes 202 is N, and N is a positive integer, and as shown in fig. 2, the N blockchain nodes include a blockchain node 2021, a blockchain node 2022, and a blockchain node 2023. The first service node 201 may be any one of the blockchain nodes in the blockchain network, that is, the first service node 201 may send the first transaction data to the other blockchain nodes. Further, the first random proof and the first random data generated by the blockchain node 202 for the first transaction data may be obtained, i.e., the first random proof and the first random data corresponding to the N blockchain nodes respectively; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by hashing the first transaction data with the node private key. The first service node 201 may verify the first random proof and the first random data, and if both the first random proof and the first random data pass the verification, determine a first packing node 203 and a first verification node from the blockchain node 202 based on the first random proof, for example, the first verification node may include a first transaction verification node 204 and a first block verification node 205. By the method, each block chain link point can divide the identity of each block chain node in the block chain network without solving the mathematical problem with certain difficulty, each block chain node can consume less computing power and resources when carrying out random certification and random data generation, the processing efficiency of transaction packing and uplink can be improved, and the resource loss of transaction processing is reduced. Further, the first service node 201 may send the first transaction data and a first verification node list to the first packing node 203, which is used to indicate the first verification node, directly based on the determined node identity of the blockchain node. The first packing node 203 may send the first transaction data to the first transaction verification node 204, receive a transaction verification result of the first transaction verification node 204 for the first transaction data, and after the first transaction verification node 204 verifies the first transaction data, pack the first transaction data to generate the first transaction block. Further, the first transaction block is sent to the first block verification node 205, a block verification result sent by the first block verification node 205 is obtained, and when the block verification result is a successful block verification result, uplink processing is performed on the first transaction block. Because the node identity of each blockchain node is already determined, when the transaction packing and the uplink processing are carried out, related data only need to be sent to the blockchain node corresponding to each transaction processing stage in each transaction processing stage, and communication between every two blockchain nodes is not needed, so that the communication complexity between every two blockchain nodes in the transaction packing and the uplink processing process can be greatly reduced, the transaction processing time is saved, the transaction processing efficiency and performance are improved, and the communication resource loss is reduced.
It is to be appreciated that the blockchain node referred to in the embodiments of the present application may be a computer device, including but not limited to a terminal device or a server. In other words, the computer device may be a server or a terminal device, or may be a system formed by the server and the terminal device. The above-mentioned terminal device may be an electronic device, including but not limited to a mobile phone, a tablet computer, a desktop computer, a notebook computer, a palm computer, a vehicle-mounted device, an augmented Reality/Virtual Reality (AR/VR) device, a head-mounted display, a smart television, a wearable device, a smart speaker, a digital camera, a camera, and other mobile internet devices (mobile internet device, MID) with network access capability, or a terminal device in a scene such as a train, a ship, or a flight. The servers mentioned above may be independent physical servers, or may be server clusters or distributed systems formed by a plurality of physical servers, or may be cloud servers that provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, vehicle-road collaboration, content distribution networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Alternatively, the data related to the embodiments of the present application may be stored in a computer device, or may be stored based on a cloud storage technology, which is not limited herein.
Further, referring to fig. 3, fig. 3 is a flowchart of a method for transaction processing according to an embodiment of the present application. As shown in fig. 3, the execution body is denoted as a first service node, which is any one of the blockchain nodes in the blockchain network. Specifically, in the embodiment of the method depicted in fig. 3, the transaction process includes the steps of:
step S301, the first transaction data is sent to the blockchain node, and the first random proof and the first random data generated by the blockchain node for the first transaction data are obtained.
In this embodiment of the present application, the first service node may send the first transaction data to a blockchain node, where the blockchain node refers to a node in the blockchain network other than the first service node, and the number of the blockchain node may be denoted as N, where N is a positive integer, and the first service node may be considered as a transaction sending node. Further, each blockchain node may perform proof generation with respect to the first transaction data and a node private key of the blockchain node to obtain a first random proof; the first transaction data and the node private key of the blockchain node may be hashed to obtain first random data. The first service node can acquire a first random certificate and first random data generated by the block chain link point aiming at the first transaction data, wherein the first random certificate is a certificate generated by the block chain node through a node private key of the first transaction data and the block chain node; the first random data is obtained by hashing the first transaction data with the node private key. The first random proof and the first random data can be considered to be generated by different hash functions, and result conversion can be performed between the two hash functions. For example, each blockchain node may perform hash processing on the first transaction data and the node private key of the blockchain node using a first hash function to obtain a first random proof; a second hash function may be employed to hash the first transaction data with the node private key of the blockchain node to obtain first random data. The second hash function can perform hash processing through the first hash function to realize result conversion, namely, after the obtained value of the first hash function is subjected to hash processing by adopting the same input data, the value of the second hash function can be obtained.
For example, referring to fig. 4, fig. 4 is a schematic view of a random processing scenario provided in an embodiment of the present application. As shown in fig. 4, taking a blockchain node as an example, the blockchain node may obtain first transaction data Mes, and hash the first transaction data and the node private key SK with a first hash function to obtain a first random Proof 401, which may be denoted as p=proof (SK, mes), where P represents the first random Proof 401, proof () represents the first hash function, and SK represents the node private key. The first transaction data and the node private key may be hashed using a second Hash function to obtain first random data 402, which may be denoted as r=hash (SK, mes), where Hash () represents the second Hash function. The blockchain node may send the first random proof 401 and the first random data 402 to the first service node 403.
Step S302, the first random certification and the first random data are verified, and if the first random certification and the first random data are verified, a first packing node and a first verification node are determined from the blockchain nodes based on the first random certification.
In the embodiment of the application, the first service node may verify the first random proof and the first random data. Specifically, the first random data may be used to verify the first random proof, and a verification result of the first random proof is determined. Specifically, the first random proof may be hashed to obtain data to be verified, if the data to be verified is the same as the first random data, it is determined that the first random proof is verified, as shown in fig. 4, the first random proof may be hashed to obtain data to be verified, denoted as R '=p2h (P), and if the data to be verified R' is the same as the first random data R, it is determined that the first random proof is verified. Alternatively, the proof to be verified may be generated based on the first random data, and if the proof to be verified is identical to the first random proof, it is determined that the verification of the first random proof is passed, see in particular the description related to step S601 shown in fig. 6 below.
Wherein the first random data may be verified. Specifically, the node public key and the first random certificate of the blockchain node may be obtained, and the seed relationship between the first random data and the first transaction data is verified by using the node public key and the first random certificate, as shown in fig. 4, which may be denoted as Verify (PK, mes, P), where PK is used to represent the node public key. If the first random data is generated by using the first transaction data as a seed, determining that the first random data passes verification. Specifically, a node public key and a random parameter of the blockchain node can be obtained, and parameters to be verified are generated based on the random parameter, the node public key and the first random data; and generating a linear parameter according to the random parameter, and if the parameter to be verified is the same as the linear parameter, indicating that the first random data is generated by taking the first transaction data as a seed, and determining that the first random data is successfully verified.
Further, if both the first random proof and the first random data are verified, a first packing node and a first verification node may be determined from the blockchain nodes based on the first random proof. Specifically, if the first random certification and the first random data are both verified, the first packet node is determined by the first random certification consensus with the blockchain node. And acquiring a node identity range, screening the blockchain node based on the node identity range and the first random certification, and determining a first verification node. Alternatively, the first verification node may be the verification node, or the first verification node may include a first transaction verification node, a first block verification node, and the like.
Specifically, the number of the blockchain nodes is N, where N is a positive integer. And if the first random certification and the first random data pass verification, acquiring node identities respectively sent by the N block link points. And acquiring node identity ranges of node identities corresponding to the N blockchain nodes respectively, determining the blockchain node with the first random proof belonging to the corresponding node identity range as a legal node from the N blockchain nodes, for example, if the first random proof provided by one blockchain node does not belong to the node identity range of the node identity provided by the blockchain node, then considering the blockchain node as not being the legal node. And determining a first packing node and a first verification node in the legal nodes based on the node identities of the legal nodes. Of course, when the first verification node includes the first transaction verification node and the first block verification node, the first packet node, the first transaction verification node and the first block verification node in the legal nodes may be determined based on the node identities of the legal nodes.
Or if the first random certification and the first random data are verified to pass, acquiring M node identity ranges; m is a positive integer; the M node identity ranges include a first node identity range and a second node identity range. And determining the blockchain node of the first random certification belonging to the identity range of the first node as a first packing node, and determining the blockchain node of the first random certification belonging to the identity range of the second node as a first verification node. For example, the second node identity range is " >NUM ", can obtain" NUM i >NUM' blockchain node, NUM i The first random proof representing the ith blockchain node may be directly "NUM" as follows i >The blockchain node of NUM "is determined to be the first verifying node. Optionally, when the first verification node includes a first transaction verification node and a first block verification node, the first verification node may be divided into the first transaction verification node and the first block verification node. Or the second node identity range comprises a second transaction node identity range and a second block node identity range, and the block chain node of which the first random certificate belongs to the second transaction node identity range can be determined to be a first transaction verification node; and determining the blockchain node of which the first random certificate belongs to the identity range of the second blocknode as a first blockverification node.
Alternatively, the first service node may determine the first packet node in common with the N block link points. Specifically, the first packet node may be determined by a first random proof corresponding to each of the N block link points. Optionally, the packing node in the blockchain network may also be updated periodically, specifically, the first service node may obtain a history packing node, where the history packing node is a packing node used last time, and may obtain a packing update period and a node use time of the history packing node; if the node using time is greater than or equal to the packing update period, the node can be commonly identified with N block chain link points to elect a first packing node; if the node usage time is less than the packing update period, the history packing node may be determined to be the first packing node. For example, the packing update period is 100 blocks, the node use time is 85 blocks, and then the history packing node can be directly determined as the first packing node. Optionally, the first service node may directly determine the local node (i.e. the first service node) as the first packet node, that is, the first service node packages the transaction data by itself; alternatively, the first service node may obtain a candidate node, determine a first packet node from the candidate nodes, where the candidate node refers to a blockchain node trusted by the first service node, and so on. Further, the first authentication node may be determined by using the node identity range described above.
Further, if the first packet node is a node generating the first transaction data (i.e., the first service node), the first transaction data may be packed to generate a first transaction block, the first transaction block is sent to the first verification node for consensus, and when the first verification node passes the first transaction block consensus, uplink processing is performed on the first transaction block. Alternatively, the first authentication node comprises a first transaction authentication node and a first block authentication node. Specifically, if the first packet node is a node generating first transaction data, the first transaction data is sent to a first transaction verification node, so that the first transaction verification node verifies the transaction data; acquiring a transaction verification result sent by a first transaction verification node aiming at first transaction data, and packaging the first transaction data to generate a first transaction block when the transaction verification result is a transaction verification success result; transmitting the first transaction block to a first block verification node so that the first block verification node performs consensus on the first transaction block; and acquiring a block verification result sent by the first block verification node aiming at the first transaction block, and performing uplink processing on the first transaction block when the block verification result is a block verification success result.
Optionally, if the first packet node is not the node generating the first transaction data, step S303 is executed to send the first transaction data and the first verification node list to the first packet node.
Step S303, the first transaction data and the first verification node list are sent to the first packing node.
In this embodiment of the present application, the first service node may send the first transaction data and the first verification node list to the first packet node, so that the first packet node performs packet and uplink on the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node.
Optionally, if the number of the first packet nodes is P, where P is a positive integer, the first service node may randomly determine a first target packet node from the P first packet nodes. Or, node operation information of P first packet nodes may be obtained, and the first packet node corresponding to the optimal node operation node information in the P node operation information is determined to be the first target packet node. Further, the first transaction data and the first list of verification nodes may be transmitted to the first target packaging node.
Further alternatively, referring to fig. 5, fig. 5 is a flowchart of another transaction processing method according to an embodiment of the present application. As shown in fig. 5, a first service node is described as an example of an authentication node. Assuming that the second service node generates second transaction data, the second service node may send the second transaction data to the blockchain node, taking the first service node as an example, in the method embodiment described in fig. 5, the transaction processing procedure includes the following steps:
step S501, receiving second transaction data sent by the second service node, and obtaining a random parameter.
In this embodiment of the present application, the first service node may receive the second transaction data sent by the second service node, and obtain a random parameter, where the random parameter is a parameter that is commonly identified in the blockchain network and is used to perform the certification processing.
Step S502, hash processing is carried out on the second transaction data and the first node private key by adopting random parameters, and a second random certification and second random data aiming at the second transaction data are generated.
In this embodiment of the present application, the first service node may perform hash processing on the second transaction data and the first node private key using the random parameter, to generate a second random proof for the second transaction data. The first node private key is a node private key of the first service node; the first service node is a node that generates first transaction data. For example, the second transaction data and the first node private key may be hashed using a first hash function to generate a second random attestation for the second transaction data. And carrying out hash processing on the second random certification to obtain second random data. Alternatively, the second transaction data and the first node private key may be hashed using a second hash function to generate second random data for the second transaction data.
Step S503, the second random certificate and the second random data are sent to the second service node.
In this embodiment of the present application, the first service node may send the second random proof and the second random data to the second service node, so that the second service node determines the second packing node and the second verification node based on the second random proof and the second random data. Optionally, the first service node may acquire M node identity ranges, acquire a target node identity range to which the second random certificate belongs in the M node identity ranges, determine a node identity corresponding to the target node identity range as a node identity to be verified, and send the second random certificate, the second random data and the node identity to be verified to the second service node, so that the second service node determines a second packaging node and a second verification node based on the second random certificate, the second random data and the node identity to be verified of each blockchain node (including the first service node), and optionally, the second verification node may include a second transaction verification node and a second block verification node. Specifically, the determining process of the second packing node and the second verification node may refer to the determining process of the first packing node and the first verification node in step S302 of fig. 3, which is not described herein.
Optionally, assuming that the first service node is determined to be a second transaction verification node, the first service node may receive second transaction data sent by the second packaging node, and verify the second transaction data. If the second transaction data passes verification, a first node private key is obtained, the second transaction data is signed by the first node private key, a first transaction signature is obtained, and the first transaction signature and a successful transaction verification result are sent to a second packaging node. And if the second transaction data is not verified, sending a transaction verification failure result to the second packaging node.
Optionally, assuming that the first service node is determined to be a second block verification node, at this time, the first service node may receive a second transaction block sent by the second packaging node, and obtain a third transaction signature in the second transaction block. And acquiring a first node public key of a second verification node corresponding to the third transaction signature, and performing signature verification processing on the third transaction signature by adopting the first node public key. If the third transaction signature passes the signature verification, voting is carried out on the second transaction block, and a block verification result aiming at the second transaction block is sent to the second packing node, so that the second packing node carries out uplink processing on the second transaction block when the received block verification result of each block chain node indicates that the second transaction block passes the signature verification.
Further, referring to fig. 6, fig. 6 is a schematic diagram of a transaction processing interaction flow provided in an embodiment of the present application. As shown in fig. 6, a process of transaction data is described, wherein the process of transaction data may be used in the process of the first transaction data or the second transaction data, and the transaction processing interaction method includes the following steps:
step S601, obtaining random evidence and random data sent by a blockchain node, and determining a packaging node and a verification node based on the random evidence.
In embodiments of the present application, a transaction transmitting node may transmit transaction data to a blockchain link point in a blockchain network. Any one blockchain node may generate a random proof P based on the transaction data and the node private key, the random proof P may be referred to in formula (1):
F sk (x)=e(g,g) 1/(x+SK)
as shown in formula (1), x represents transaction data, SK represents a node private key, e (a) 1 ,a 2 ) For representing bilinear maps, e.g. e (g, g) for representing bilinear maps of g-to-g composition, F sk (x) The value of (c) may be used to represent a random proof. Where g is a random parameter. Alternatively, the F sk (x) May be used to represent the first hash function. Further, the blockchain node may generate random data R based on the random proof. Alternatively, the transaction data may be hashed with the node private key to generate random data, which may be referred to in equation (2):
p sk (x)=g 1/(x+SK)
As shown in equation (2), g can be considered a random parameter for generating random attestation and random data, p sk (x) May be used to represent random data, optionally p sk (x) May be used to represent the second hash function. Alternatively, blockchain nodes may be based on random attestation and node identity rangeAnd determining the node identity of the user in the processing process of the transaction data, and transmitting the node identity, the random certification and the random data to the transaction transmitting node. Or, the blockchain node can determine its own node identity in the process of processing the transaction data based on the random proof and the node identity range, if the node identity is not the conventional node identity, then the blockchain node generates random data, and sends the node identity, the random proof and the random data to the transaction sending node. Alternatively, the blockchain node may send the random proof and random data directly to the transaction sending node. See in particular the description of the correlation in step S301 of fig. 3 above.
Wherein, the first random proof in fig. 3 and the second random proof in fig. 5 may be generated by the formula (1); the first random data in fig. 3 and the second random data in fig. 5 may be generated by the above formula (2).
Further, the transaction transmitting node may obtain the random certificate and the random data sent by the N block link points respectively. The random proof may be verified, which may be referred to as the verification process for the first random proof in step S302 of fig. 3. Alternatively, it can be verified whether the following formula (3) holds:
F sk (x)=={e(g,p sk (x))=F′ sk (x)} ③
f as shown in formula (3) sk (x) Can be used for representing random evidence, F' sk (x) May be used to represent the proof to be verified. Where "= =" is a relational operator for verifying whether values on both sides of the relational operator are the same.
Wherein the random data may be verified, the process may be referred to as the verification process for the first random data in step S302 of fig. 3. Alternatively, it can be verified whether the following formula (4) holds:
e(g x PK,p sk (x))==e(g,g) ④
as shown in the formula (4), e (g x PK,p sk (x) For representing the parameter to be verified, e (g, g) for representing the linear parameter. In the manner shown in the formula (4), can be according to the followingThe machine parameter, the transaction data and the node public key generate a first mapping parameter, the random data is used as a second mapping parameter, and the first mapping parameter and the second mapping parameter are mapped by adopting a bilinear mapping function to obtain a parameter to be verified.
Further, if the random proof and the random data are both verified, the packing node and the verification node are determined from the N blockchain nodes based on the random proof, specifically, refer to the determining process of the first packing node and the first verification node in step S302 in fig. 3. Further, step S602 may be performed.
Step S602, transmitting transaction data and verifying node list.
In an embodiment of the application, the transaction sending node may send the transaction data and the verification node list to the packaging node, where the verification node list is used to indicate the verification node. Optionally, the verification node may further include a transaction verification node and a block verification node.
Step S603, transmitting transaction data.
In an embodiment of the present application, the packaging node may determine a transaction verification node based on the verification node list, and send the transaction data to the transaction verification node.
Step S604, a transaction verification result is sent.
In this embodiment of the present application, the transaction verification node may verify the transaction data to obtain a transaction verification result, and send the transaction verification result to the packaging node, which may specifically refer to the verification process of the first service node on the second transaction data.
Step S605, package the transaction data to generate a transaction block.
In the embodiment of the application, the packaging node may package the transaction data to generate the transaction block.
Step S606, send transaction block.
In an embodiment of the present application, the packaging node may determine a block verification node based on the verification node list, and send the transaction block to the block verification node.
In step S607, the block verification result is sent.
In this embodiment of the present application, the block verification node may verify the transaction block to obtain a block verification result, and send the block verification result to the packaging node, which may refer to the verification process of the first service node on the second transaction block. Further, when the block verification result indicates that the transaction block consensus is passed, the packing node may perform step S608.
Alternatively, when the verification node does not divide the transaction verification node and the block verification node, the step S603 and the step S606 may be transmitted to the verification node, and the step S604 and the step S607 are executed by the verification node. Alternatively, after step S602, the packaging node may package the transaction data to generate a transaction block, send the transaction block to the verification node indicated by the verification node list, and when the verification node has a common knowledge of the transaction block, the packaging node may perform step S608.
In step S608, when the block verification result is the block verification passing result, the transaction block is broadcasted to the blockchain network.
In this embodiment of the present application, when the block verification result is a block verification passing result, that is, when the block verification result indicates that the transaction block is commonly passed, the packaging node broadcasts the transaction block to the blockchain nodes in the blockchain network, including but not limited to conventional nodes, so as to implement uplink processing on the transaction block.
In the embodiment of the application, the first transaction data can be sent to the blockchain node, and the first random certification and the first random data generated by the blockchain node aiming at the first transaction data are obtained; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key; verifying the first random certification and the first random data, and if the first random certification and the first random data pass through verification, determining a first packing node and a first verification node from the blockchain nodes based on the first random certification; the first transaction data and the first verification node list are sent to a first packing node, so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node. In this way, when transaction data (such as first transaction data) is generated, each blockchain node only needs to perform random certification and random data generation on the transaction data, and mathematical problems with certain difficulty are not needed to be solved, and the blockchain node can determine the packaging node (such as the first packaging node) and the verification node (such as the first verification node) from the blockchain nodes, so that the calculation capacity and the energy consumption consumed in the transaction processing process are reduced, namely the resource consumption of the transaction processing is reduced. In addition, after the packing node and the verification node aiming at the transaction data are determined, the verification and the uplink of the transaction data can be realized directly based on the determined packing node and the verification node, under the condition of node determination, the corresponding data are sent to the determined nodes in each stage only when the transaction data are processed, for example, the transaction data can be sent to the packing node in the transaction packing stage, and the transaction data are sent to the verification node in the transaction verification stage, so that the verification and the uplink of the transaction data can be realized, the communication complexity among block chain nodes in the transaction processing process is greatly reduced, the transaction processing time is saved, the transaction processing efficiency and performance are improved, and the communication resource loss is reduced.
Further, referring to fig. 7, fig. 7 is a schematic diagram of a transaction processing device according to an embodiment of the present application. The transaction processing means may be a computer program (including program code etc.) running in a computer device, for example the transaction processing means may be an application software; the device can be used for executing corresponding steps in the method provided by the embodiment of the application. As shown in fig. 7, the transaction processing device 700 may be used in the blockchain node in the embodiment corresponding to fig. 3, and specifically, the device may include: the system comprises a transaction sending module 11, a random acquisition module 12, a random verification module 13, a node determination module 14 and a node feedback module 15.
A transaction transmitting module 11, configured to transmit the first transaction data to the blockchain node;
a random acquisition module 12, configured to acquire a first random proof and first random data generated by the block link point for the first transaction data; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key;
a random verification module 13, configured to verify the first random proof and the first random data;
A node determining module 14, configured to determine a first packet node and a first verification node from the blockchain nodes based on the first random proof if both the first random proof and the first random data are verified;
the node feedback module 15 is configured to send the first transaction data and the first verification node list to a first packing node, so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node.
Wherein the random authentication module 13 comprises:
a proof verification unit 131, configured to verify the first random proof using the first random data, and determine a verification result of the first random proof;
a parameter processing unit 132, configured to obtain a node public key of the blockchain node and a random parameter, and generate a parameter to be verified based on the random parameter, the node public key and the first random data;
the data verification unit 133 is configured to generate a linear parameter according to the random parameter, and determine that the first random data is successfully verified if the parameter to be verified is the same as the linear parameter.
Wherein the proof verification unit 131 includes:
The data matching subunit 1311 is configured to perform hash processing on the first random proof to obtain data to be verified, and determine that the first random proof is verified if the data to be verified is the same as the first random data; or,
the proof matching subunit 1312 is configured to generate a proof to be verified based on the first random data, and determine that the first random proof is verified if the proof to be verified is identical to the first random proof.
Wherein the node determination module 14 comprises:
the packaging consensus unit 141 is configured to determine, if the first random proof and the first random data are both verified, a first packaging node through the first random proof and the first random proof together with the blockchain node;
the verification determining unit 142 is configured to obtain a node identity range, screen the blockchain node based on the node identity range and the first random proof, and determine a first verification node.
The number of the block chain nodes is N, and N is a positive integer;
the node determination module 14 includes:
the identity obtaining unit 143 is configured to obtain node identities sent by the N block link points respectively if the first random proof and the first random data pass verification;
the legal screening unit 144 is configured to obtain node identity ranges of node identities corresponding to the N block link points, and determine, from the N block chain nodes, a block chain node whose first random proof belongs to the corresponding node identity range as a legal node;
The node determining unit 145 is configured to determine a first packet node and a first verification node in the legal nodes based on the node identities of the legal nodes.
Wherein the node determination module 14 comprises:
a range obtaining unit 146, configured to obtain M node identity ranges if the first random proof and the first random data are both verified; m is a positive integer; the M node identity ranges comprise a first node identity range and a second node identity range;
the scope dividing unit 147 is configured to determine, as the first packet node, the blockchain node of the first random proof belonging to the first node identity scope, and determine, as the first verification node, the blockchain node of the first random proof belonging to the second node identity scope.
The number of the first packet nodes is P, and P is a positive integer; the node feedback module 15 includes:
an operation obtaining unit 151, configured to obtain node operation information of P first packet nodes, and determine a first packet node corresponding to optimal node operation node information in the P node operation information as a first target packet node;
the node feedback unit 152 is configured to send the first transaction data and the first verification node list to the first target packaging node.
The first verification node comprises a first transaction verification node and a first block verification node; the apparatus 700 further comprises:
the transaction sending module 16 is configured to send the first transaction data to the first transaction verification node if the first packet node is a node generating the first transaction data, so that the first transaction verification node verifies the transaction data;
the transaction packaging module 17 is configured to obtain a transaction verification result sent by the first transaction verification node for the first transaction data, and package the first transaction data to generate a first transaction block when the transaction verification result is a successful transaction verification result;
a block transmitting module 18, configured to transmit the first transaction block to a first block verification node, so that the first block verification node performs consensus on the first transaction block;
the block uplink module 19 is configured to obtain a block verification result sent by the first block verification node for the first transaction block, and perform uplink processing on the first transaction block when the block verification result is a block verification success result;
the feedback calling module 20 is configured to execute a process of sending the first transaction data and the first verification node list to the first packing node if the first packing node is not the node generating the first transaction data.
Wherein the apparatus 700 further comprises:
the proof generating module 21 is configured to receive second transaction data sent by the second service node, obtain a random parameter, and hash the second transaction data and the first node private key with the random parameter to generate a second random proof for the second transaction data; the first node private key is a node private key of the first service node; the first service node is a node generating first transaction data;
the data generating module 22 is configured to hash the second random proof to obtain second random data, and send the second random proof and the second random data to the second service node, so that the second service node determines the second packing node and the second verification node based on the second random proof and the second random data.
Wherein the apparatus 700 further comprises:
the transaction verification module 23 is configured to receive the second transaction data sent by the second packaging node, and verify the second transaction data;
the transaction signature module 24 is configured to obtain a first node private key if the second transaction data passes verification, sign the second transaction data with the first node private key to obtain a first transaction signature, and send the first transaction signature and a successful transaction verification result to the second packaging node;
And the failure feedback module 25 is configured to send a transaction verification failure result to the second packaging node if the verification of the second transaction data is not passed.
Wherein the apparatus 700 further comprises:
a block obtaining module 26, configured to receive a second transaction block sent by the second packaging node, and obtain a third transaction signature in the second transaction block;
the signature verification module 27 is configured to obtain a first node public key of a second verification node corresponding to the third transaction signature, and perform signature verification processing on the third transaction signature by using the first node public key;
the block consensus module 28 is configured to vote on the second transaction block if the third transaction signature passes the verification, and send a block verification result for the second transaction block to the second packaging node.
The embodiment of the application provides a transaction processing device which can be operated in any blockchain node, and is used for sending first transaction data to the blockchain node to obtain first random evidence and first random data generated by the blockchain node aiming at the first transaction data; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key; verifying the first random certification and the first random data, and if the first random certification and the first random data pass through verification, determining a first packing node and a first verification node from the blockchain nodes based on the first random certification; the first transaction data and the first verification node list are sent to a first packing node, so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node. In this way, when transaction data (such as first transaction data) is generated, each blockchain node only needs to perform random certification and random data generation on the transaction data, and mathematical problems with certain difficulty are not needed to be solved, and the blockchain node can determine the packaging node (such as the first packaging node) and the verification node (such as the first verification node) from the blockchain nodes, so that the calculation capacity and the energy consumption consumed in the transaction processing process are reduced, namely the resource consumption of the transaction processing is reduced. In addition, after the packing node and the verification node aiming at the transaction data are determined, the verification and the uplink of the transaction data can be realized directly based on the determined packing node and the verification node, under the condition of node determination, the corresponding data are sent to the determined nodes in each stage only when the transaction data are processed, for example, the transaction data can be sent to the packing node in the transaction packing stage, and the transaction data are sent to the verification node in the transaction verification stage, so that the verification and the uplink of the transaction data can be realized, the communication complexity among block chain nodes in the transaction processing process is greatly reduced, the transaction processing time is saved, the transaction processing efficiency and performance are improved, and the communication resource loss is reduced.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 8, the computer device in the embodiment of the present application may include: one or more processors 801, memory 802, and input-output interfaces 803. The processor 801, memory 802, and input-output interface 803 are connected via a bus 804. The memory 802 is used for storing a computer program comprising program instructions, the input output interface 803 is used for receiving data and outputting data, such as for data interaction between blockchain nodes; the processor 801 is configured to execute program instructions stored in the memory 802.
The processor 801 may perform the following operations, among others:
transmitting the first transaction data to a blockchain node, and acquiring a first random certification and first random data generated by the blockchain node aiming at the first transaction data; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key;
verifying the first random certification and the first random data, and if the first random certification and the first random data pass through verification, determining a first packing node and a first verification node from the blockchain nodes based on the first random certification;
The first transaction data and the first verification node list are sent to a first packing node, so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node.
In some possible implementations, the processor 801 may be a central processing unit (centralprocessing unit, CPU), which may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 802 may include read only memory and random access memory, and provides instructions and data to the processor 801 and the input output interface 803. A portion of memory 802 may also include non-volatile random access memory. For example, the memory 802 may also store information of device type.
In a specific implementation, the computer device may execute, through each functional module built in the computer device, an implementation manner provided by each step in fig. 3 or fig. 5, and specifically, the implementation manner provided by each step in fig. 3 or fig. 5 may be referred to, which is not described herein again.
Embodiments of the present application provide a computer device, comprising: the processor, the input/output interface and the memory are used for acquiring the computer program in the memory through the processor, executing the steps of the method shown in fig. 3 and performing transaction processing operation. The embodiment of the application realizes that the first transaction data is sent to the block chain node, and the first random certification and the first random data generated by the block chain node aiming at the first transaction data are obtained; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key; verifying the first random certification and the first random data, and if the first random certification and the first random data pass through verification, determining a first packing node and a first verification node from the blockchain nodes based on the first random certification; the first transaction data and the first verification node list are sent to a first packing node, so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is for indicating a first authentication node for the first packetizing node. In this way, when transaction data (such as first transaction data) is generated, each blockchain node only needs to perform random certification and random data generation on the transaction data, and mathematical problems with certain difficulty are not needed to be solved, and the blockchain node can determine the packaging node (such as the first packaging node) and the verification node (such as the first verification node) from the blockchain nodes, so that the calculation capacity and the energy consumption consumed in the transaction processing process are reduced, namely the resource consumption of the transaction processing is reduced. In addition, after the packing node and the verification node aiming at the transaction data are determined, the verification and the uplink of the transaction data can be realized directly based on the determined packing node and the verification node, under the condition of node determination, the corresponding data are sent to the determined nodes in each stage only when the transaction data are processed, for example, the transaction data can be sent to the packing node in the transaction packing stage, and the transaction data are sent to the verification node in the transaction verification stage, so that the verification and the uplink of the transaction data can be realized, the communication complexity among block chain nodes in the transaction processing process is greatly reduced, the transaction processing time is saved, the transaction processing efficiency and performance are improved, and the communication resource loss is reduced.
The embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program is adapted to be loaded by the processor and execute the transaction processing method provided by each step in fig. 3 or fig. 5, and specifically refer to an implementation manner provided by each step in fig. 3 or fig. 5, which is not described herein again. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application. As an example, a computer program may be deployed to be executed on one computer device or on multiple computer devices at one site or distributed across multiple sites and interconnected by a communication network.
The computer readable storage medium may be the transaction processing apparatus provided in any of the foregoing embodiments or an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the computer device. Further, the computer-readable storage medium may also include both internal storage units and external storage devices of the computer device. 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 may also be used to temporarily store data that has been output or is to be output.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the various alternative modes in fig. 3 or fig. 5, thereby realizing that when generating transaction data (such as first transaction data), each blockchain node only needs to perform random certification and random data generation on the transaction data, without solving a mathematical problem with a certain difficulty, the blockchain node can determine the packaging node (such as the first packaging node) and the verification node (such as the first verification node), so as to reduce the calculation capacity and the energy consumption consumed in the transaction processing process, that is, reduce the resource consumption of the transaction processing. In addition, after the packing node and the verification node aiming at the transaction data are determined, the verification and the uplink of the transaction data can be realized directly based on the determined packing node and the verification node, under the condition of node determination, the corresponding data are sent to the determined nodes in each stage only when the transaction data are processed, for example, the transaction data can be sent to the packing node in the transaction packing stage, and the transaction data are sent to the verification node in the transaction verification stage, so that the verification and the uplink of the transaction data can be realized, the communication complexity among block chain nodes in the transaction processing process is greatly reduced, the transaction processing time is saved, the transaction processing efficiency and performance are improved, and the communication resource loss is reduced.
The terms first, second and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or modules but may, in the alternative, include other steps or modules not listed or inherent to such process, method, apparatus, article, or device.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in this description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The methods and related devices provided in the embodiments of the present application are described with reference to the method flowcharts and/or structure diagrams provided in the embodiments of the present application, and each flowchart and/or block of the method flowcharts and/or structure diagrams may be implemented by computer program instructions, and combinations of flowcharts and/or blocks in the flowchart and/or block diagrams. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable transaction processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable transaction processing device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable transaction processing device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or structural diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable transaction processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or structures.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (15)

1. A method of transaction processing, the method comprising:
transmitting first transaction data to a blockchain node, and acquiring a first random certification and first random data generated by the blockchain node aiming at the first transaction data; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key;
verifying the first random proof and the first random data, and if the first random proof and the first random data pass through verification, determining a first packing node and a first verification node from the blockchain nodes based on the first random proof;
The first transaction data and a first verification node list are sent to the first packing node, so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is configured to indicate the first authentication node for the first packet node.
2. The method of claim 1, wherein verifying the first random attestation and the first random data comprises:
verifying the first random certification by adopting the first random data, and determining a verification result of the first random certification;
acquiring a node public key and a random parameter of the blockchain node, and generating a parameter to be verified based on the random parameter, the node public key and the first random data;
and generating a linear parameter according to the random parameter, and if the parameter to be verified is the same as the linear parameter, determining that the first random data is successfully verified.
3. The method of claim 2, wherein the validating the first random attestation using the first random data, determining a validation result of the first random attestation, comprises:
Carrying out hash processing on the first random certification to obtain data to be verified, and if the data to be verified is the same as the first random data, determining that the first random certification is verified; or,
and generating a to-be-verified certificate based on the first random data, and if the to-be-verified certificate is identical to the first random certificate, determining that the first random certificate is verified.
4. The method of claim 1, wherein the determining a first packing node and a first verification node from the blockchain nodes based on the first random proof if both the first random proof and the first random data are verified, comprises:
if the first random certification and the first random data are both verified, determining a first packing node through the first random certification together with the blockchain node;
and acquiring a node identity range, screening the block chain link points based on the node identity range and the first random certification, and determining a first verification node.
5. The method of claim 1, wherein the number of blockchain nodes is N, N being a positive integer;
If the first random proof and the first random data are both verified, determining a first packing node and a first verification node from the blockchain nodes based on the first random proof, including:
if the first random certification and the first random data are verified to pass, node identities sent by N block chain link points respectively are obtained;
acquiring node identity ranges of node identities corresponding to the N blockchain nodes respectively, and determining the blockchain node with the first random certification belonging to the corresponding node identity range from the N blockchain nodes as a legal node;
and determining a first packing node and a first verification node in the legal nodes based on the node identities of the legal nodes.
6. The method of claim 1, wherein the determining a first packing node and a first verification node from the blockchain nodes based on the first random proof if both the first random proof and the first random data are verified, comprises:
if the first random certificate and the first random data are verified to pass, M node identity ranges are obtained; m is a positive integer; the M node identity ranges comprise a first node identity range and a second node identity range;
And determining the blockchain node of the first random certification belonging to the identity range of the first node as a first packing node, and determining the blockchain node of the first random certification belonging to the identity range of the second node as a first verification node.
7. The method of claim 1, wherein the number of first packet nodes is P, P being a positive integer; the sending the first transaction data and the first verification node list to the first packing node includes:
acquiring node operation information of P first packet nodes, and determining a first packet node corresponding to the optimal node operation node information in the P node operation information as a first target packet node;
and sending the first transaction data and a first verification node list to the first target packaging node.
8. The method of claim 1, wherein the first authentication node comprises a first transaction authentication node and a first block authentication node; the method further comprises the steps of:
if the first packet node is a node generating the first transaction data, the first transaction data is sent to the first transaction verification node so that the first transaction verification node verifies the transaction data;
Acquiring a transaction verification result sent by the first transaction verification node aiming at the first transaction data, and packaging the first transaction data to generate a first transaction block when the transaction verification result is a transaction verification success result;
transmitting the first transaction block to the first block verification node so that the first block verification node performs consensus on the first transaction block;
acquiring a block verification result sent by the first block verification node aiming at the first transaction block, and performing uplink processing on the first transaction block when the block verification result is a block verification success result;
and if the first packing node is not the node generating the first transaction data, executing the process of sending the first transaction data and a first verification node list to the first packing node.
9. The method of claim 1, wherein the method further comprises:
receiving second transaction data sent by a second service node, acquiring random parameters, carrying out hash processing on the second transaction data and a first node private key by adopting the random parameters, and generating a second random proof for the second transaction data; the first node private key is a node private key of the first service node; the first service node is a node generating the first transaction data;
And carrying out hash processing on the second random certification to obtain second random data, and sending the second random certification and the second random data to the second service node so that the second service node determines a second packing node and a second verification node based on the second random certification and the second random data.
10. The room of claim 9, wherein said method further comprises:
receiving the second transaction data sent by the second packaging node, and verifying the second transaction data;
if the second transaction data passes verification, acquiring the first node private key, signing the second transaction data by adopting the first node private key to obtain a first transaction signature, and sending the first transaction signature and a successful transaction verification result to the second packaging node;
and if the second transaction data is not verified, sending a transaction verification failure result to the second packaging node.
11. The method of claim 9, wherein the method further comprises:
receiving a second transaction block sent by the second packaging node, and acquiring a third transaction signature in the second transaction block;
Acquiring a first node public key of a second verification node corresponding to the third transaction signature, and adopting the first node public key to carry out signature verification processing on the third transaction signature;
and if the third transaction signature passes the verification, voting the second transaction block, and sending a block verification result aiming at the second transaction block to the second packaging node.
12. A transaction processing device, the device comprising:
the transaction sending module is used for sending the first transaction data to the blockchain node;
the random acquisition module is used for acquiring a first random evidence and first random data generated by the block link point aiming at the first transaction data; the first random attestation is an attestation generated by the blockchain node through a node private key of the blockchain node to the first transaction data; the first random data is obtained by carrying out hash processing on the first transaction data and the node private key;
the random verification module is used for verifying the first random certification and the first random data;
the node determining module is used for determining a first packing node and a first verification node from the blockchain nodes based on the first random certification if the first random certification and the first random data are verified to pass;
The node feedback module is used for sending the first transaction data and a first verification node list to the first packing node so that the first packing node packs and links the first transaction data after the first verification node verifies the first transaction data; the first list of authentication nodes is configured to indicate the first authentication node for the first packet node.
13. A computer device, comprising a processor, a memory, and an input-output interface;
the processor is connected to the memory and the input/output interface, respectively, wherein the input/output interface is used for receiving data and outputting data, the memory is used for storing a computer program, and the processor is used for calling the computer program to enable the computer device to execute the method of any one of claims 1-11.
14. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-11.
15. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of any of claims 1-11.
CN202311374237.1A 2023-10-20 2023-10-20 Transaction processing method, device, computer, storage medium and program product Pending CN117437052A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311374237.1A CN117437052A (en) 2023-10-20 2023-10-20 Transaction processing method, device, computer, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311374237.1A CN117437052A (en) 2023-10-20 2023-10-20 Transaction processing method, device, computer, storage medium and program product

Publications (1)

Publication Number Publication Date
CN117437052A true CN117437052A (en) 2024-01-23

Family

ID=89552694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311374237.1A Pending CN117437052A (en) 2023-10-20 2023-10-20 Transaction processing method, device, computer, storage medium and program product

Country Status (1)

Country Link
CN (1) CN117437052A (en)

Similar Documents

Publication Publication Date Title
CN111681003B (en) Resource cross-chain transfer method and device, computer equipment and storage medium
CN111427957B (en) Block chain voting information verification method, device, equipment and storage medium
CN111737724B (en) Data processing method and device, intelligent equipment and storage medium
CN111445333B (en) Block generation method, device, computer equipment and storage medium
CN109889497B (en) Distrust-removing data integrity verification method
CN111444211B (en) Block chain consensus node checking method, device, equipment and storage medium
EP4216077A1 (en) Blockchain network-based method and apparatus for data processing, and computer device
CN111311211A (en) Data processing method and device based on block chain
CN112507369B (en) Service processing method and device based on block chain, readable medium and electronic equipment
CN110866265A (en) Data storage method, device and storage medium based on block chain
CN111416709A (en) Voting method, device, equipment and storage medium based on block chain system
CN111385096A (en) Block chain network, signature processing method, terminal and storage medium
CN115701078B (en) Cross-chain transaction processing method, device, electronic equipment and storage medium
CN111654375A (en) Block chain-based edge calculation security encryption method, device and system
CN117251889B (en) Block chain consensus method, related device and medium
KR101120059B1 (en) Billing verifying apparatus, billing apparatus and method for cloud computing environment
WO2023098824A1 (en) Vehicle data management method and apparatus, and server and storage medium
CN115664714B (en) Anonymous selection committee method, system and medium based on TEE (terminal equipment) on blockchain
CN117437052A (en) Transaction processing method, device, computer, storage medium and program product
EP3200388B1 (en) User permission check system
CN113572616B (en) Authentication method and device based on distributed bidding platform and related equipment
CN118133306B (en) Judicial data processing method based on block chain
CN113542251B (en) Data reporting method and device
CN117411639A (en) Block chain voting method, apparatus, computer, storage medium and program product
CN117609361A (en) Block chain transaction packaging method, device, equipment, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication