CN111814204A - Block chain-based data consensus method, related equipment and storage medium - Google Patents

Block chain-based data consensus method, related equipment and storage medium Download PDF

Info

Publication number
CN111814204A
CN111814204A CN202010942122.8A CN202010942122A CN111814204A CN 111814204 A CN111814204 A CN 111814204A CN 202010942122 A CN202010942122 A CN 202010942122A CN 111814204 A CN111814204 A CN 111814204A
Authority
CN
China
Prior art keywords
consensus
voting
consensus node
node
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010942122.8A
Other languages
Chinese (zh)
Other versions
CN111814204B (en
Inventor
朱耿良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202010942122.8A priority Critical patent/CN111814204B/en
Publication of CN111814204A publication Critical patent/CN111814204A/en
Application granted granted Critical
Publication of CN111814204B publication Critical patent/CN111814204B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The embodiment of the invention discloses a data consensus method based on a block chain, related equipment and a storage medium, wherein the method comprises the following steps: detecting a consensus triggering event aiming at target data, and acquiring signature information of each consensus node in a plurality of consensus nodes; determining the voting weight of consensus voting of each consensus node on the target data based on the signature information of each consensus node; in the plurality of consensus nodes, the voting weight corresponding to the consensus node which carries out signature processing in the trusted computing environment is greater than the voting weight corresponding to the consensus node which carries out signature processing outside the trusted computing environment; the voting result of the target data is counted according to the voting weight of each consensus node, and the consensus result of the target data is determined according to the counting result, so that the accuracy of the consensus result obtained by performing consensus processing on the target data (transaction data) can be improved.

Description

Block chain-based data consensus method, related equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a block chain-based data consensus method, related devices, and a storage medium.
Background
With the continuous and deep development of the blockchain technology, more and more transaction data are stored depending on the blockchain network, so as to ensure the safety and accuracy of the stored transaction data, when transaction data is currently submitted to a blockchain network for storage, a commonly used method is to consensus vote on the transaction data by a consensus node in the blockchain network, therefore, the consensus process of the transaction data can be completed by counting the consensus voting result of each consensus node on the transaction data, but if the consensus node in the blockchain network is monitored locally, there may be a possibility that the corresponding node private key is stolen, after the node private key of the consensus node is stolen, the problem of tampering the consensus voting result of the transaction data may occur, therefore, how to improve the accuracy of the consensus result obtained by performing consensus processing on the transaction data by the consensus node becomes a current research hotspot.
Disclosure of Invention
The embodiment of the invention provides a block chain-based data consensus method, related equipment and a storage medium, which can improve the accuracy of a consensus result obtained by performing consensus processing on target data (transaction data).
In one aspect, an embodiment of the present invention provides a data consensus method based on a blockchain, where the data consensus method is performed by a target consensus node of a blockchain network, where the target consensus node is any one of multiple consensus nodes included in the blockchain network, and the method includes:
detecting a consensus triggering event aiming at target data, and acquiring signature information of each consensus node in the multiple consensus nodes, wherein the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node;
determining the voting weight of consensus voting of each consensus node on the target data based on the signature information of each consensus node; in the plurality of consensus nodes, the voting weight corresponding to the consensus node which carries out signature processing in the trusted computing environment is greater than the voting weight corresponding to the consensus node which carries out signature processing outside the trusted computing environment;
and counting the voting result of the target data according to the voting weight of each consensus node, and determining the consensus result of the target data according to the counting result.
In one aspect, an embodiment of the present invention provides a data consensus device based on a blockchain, where the data consensus device is built in a target consensus node of a blockchain network, and the target consensus node is any one of a plurality of consensus nodes included in the blockchain network, and the data consensus device includes:
an obtaining unit, configured to detect a consensus triggering event for target data, and obtain signature information of each consensus node in the multiple consensus nodes, where the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node;
a determining unit, configured to determine, based on the signature information of each consensus node, a voting weight for the consensus voting of each consensus node on the target data; in the plurality of consensus nodes, the voting weight corresponding to the consensus node which carries out signature processing in the trusted computing environment is greater than the voting weight corresponding to the consensus node which carries out signature processing outside the trusted computing environment;
the statistic unit is used for counting the voting result of the target data according to the voting weight of each consensus node;
the determining unit is further configured to determine a consensus result of the target data according to a statistical result.
In one aspect, an embodiment of the present invention provides a target consensus node, including a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, where the memory is used to store a computer program that supports a terminal to execute the foregoing method, where the computer program includes program instructions, and the processor is configured to call the program instructions to perform the following steps:
detecting a consensus triggering event aiming at target data, and acquiring signature information of each consensus node in the multiple consensus nodes, wherein the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node;
determining the voting weight of consensus voting of each consensus node on the target data based on the signature information of each consensus node; in the plurality of consensus nodes, the voting weight corresponding to the consensus node which carries out signature processing in the trusted computing environment is greater than the voting weight corresponding to the consensus node which carries out signature processing outside the trusted computing environment;
and counting the voting result of the target data according to the voting weight of each consensus node, and determining the consensus result of the target data according to the counting result.
In one aspect, an embodiment of the present invention provides a computer-readable storage medium, where program instructions are stored, and when the program instructions are executed by a processor, the computer-readable storage medium is configured to perform the method for block chain based data consensus as described in the first aspect.
In the embodiment of the invention, after the target consensus node detects the consensus triggering event aiming at the target data, signature information obtained by signature processing of each consensus node in the block chain network on the voting result of the target data can be obtained, and further, the target consensus node may be determined by determining whether the signature information is based on a trusted computing environment, thereby determining the voting weight of the consensus voting of each consensus node on the target data, counting the voting results of the target data based on the voting weight, thereby determining consensus results for the target data, counting voting results for the target data based on the voting weights, the malicious problem of the tampered common identification node in the block chain network can be effectively prevented, and therefore the accuracy of the common identification result obtained by voting common identification on the target data is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a block chain network according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a block chain-based data consensus method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of signature processing performed on voting results of target data according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a block chain-based data consensus method according to an embodiment of the present invention;
FIG. 5a is a diagram illustrating a target consensus node registering a trusted computing environment with a blockchain network, according to an embodiment of the present invention;
FIG. 5b is a diagram illustrating a trusted computing environment in which a target consensus node is registered, according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating a consensus process performed on target data according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of a block chain-based data consensus apparatus according to an embodiment of the present invention;
fig. 8 is a schematic block diagram of a target consensus node according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a block chain-based data consensus method, which enables a target consensus node to determine whether a second signature information obtained by performing signature processing on a voting result based on a Trusted Execution Environment (TEE) when the voting result is signed by each consensus node when counting the voting result of consensus voting on target data by each consensus node in a block chain network, and further determines the voting weight of consensus voting on the target data by each consensus node. In one embodiment, the trusted computing environment may also be referred to as a trusted execution environment, and the trusted computing environment may provide a more secure and reliable execution space compared to the central processing unit for transaction data (such as the target data) in a consensus node (such as the target consensus node), so that the reliability and integrity of the transaction data or program code executed in the trusted computing environment can be ensured, the problem of the consensus node being malicious due to leakage of related data in the consensus node in the blockchain network can be prevented, and the accuracy of data processing by the consensus node can be improved.
In one embodiment, Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. The blockchain is essentially a decentralized database, which is a string of data blocks associated by cryptographic methods, each data block containing a batch of transaction data for verifying the validity of its information (anti-counterfeiting) and generating the next block. In one embodiment, the trusted computing environment may be an independent area partitioned from a Central Processing Unit (CPU) of the consensus node, and it is understood that the consensus node executes the program code or processes the transaction data in the partitioned independent area, that is, executes the program code or processes the transaction data in the trusted computing environment, wherein after the trusted computing environment is partitioned from the Central Processing Unit, the trusted computing environment can still obtain the data from the Central Processing Unit, and the Central Processing Unit cannot obtain the data from the trusted computing environment, so that the security of executing the program code and Processing the transaction data in the trusted computing environment is ensured. Alternatively, the trusted computing environment may be a node (e.g., a trusted node) that is independent from the consensus node, that is, the consensus node may acquire the corresponding trusted computing environment by associating with the trusted node, and when the consensus node needs to execute the program code or process the transaction data using the trusted computing environment, the program code or the transaction data to be executed may be sent to the trusted node associated with the consensus node, and the trusted node executes the corresponding program code or the transaction data, so as to ensure reliability of the executed program code or the transaction data.
Based on the security of processing transaction data in the trusted computing environment, when the target consensus node counts the voting results corresponding to the consensus vote for the target data to determine the consensus result of the target data, the target consensus node may determine whether the signature processing performed on the voting result by each consensus node is performed on the basis of the trusted computing environment of the corresponding consensus node, and determine a larger voting weight for the consensus node that performs the signature processing on the voting result of the target data in the trusted computing environment, and determine a smaller voting weight for the consensus node that does not perform the signature processing on the voting result of the target data in the trusted computing environment, so that the voting weight of the consensus node that performs the signature processing on the voting result of the target data on the basis of the trusted computing environment is greater than the voting weight of the consensus node that does not perform the signature processing on the voting result of the target data in the trusted computing environment, therefore, the voting results of the target data can be counted based on different voting weights, and the accuracy and the reliability of consensus processing on the target data are improved. In a specific implementation, when detecting a consensus trigger event for target data, a target consensus node may first obtain signature information of each consensus node in the blockchain network, where the target consensus node may be any one of a plurality of consensus nodes included in the blockchain network, and the consensus trigger event for the target data may be, for example, a trigger event for sending the target data to the blockchain network for storage, or the consensus trigger event may also be a consensus trigger operation initiated by a manager for the target data.
In an embodiment, the blockchain network may be as shown in fig. 1, the blockchain network includes a plurality of nodes, and a plurality of common nodes are included in the plurality of nodes, and the included plurality of common nodes may be, for example, the common nodes 1 to 5 shown in fig. 1, where each node in the blockchain network establishes a connection relationship with any other node, that is, a connection relationship is established between any two common nodes in the common nodes 1 to 5 in the blockchain network, it should be noted that the connection relationship between the common nodes shown in fig. 1 is only an exemplary illustration, and the connection relationship between each common node and other common nodes is not shown in fig. 1 in its entirety. In an embodiment, the consensus node in the blockchain network is configured to perform consensus voting on transaction data (such as the target data described above) and sign the result of the consensus voting to obtain signature information of the consensus result, and the target consensus node provided by the present invention may count the result of the consensus voting on the target data by each consensus node in the blockchain network and determine the consensus result of the target data, where the target consensus node may be any one of the consensus nodes 1 to 5, for example, the consensus node 1.
In one embodiment, when the target consensus node counts the consensus result of the target data, the target consensus node performs statistics based on the signature information of each consensus node in the block chain network, in a specific implementation, the target consensus node may determine whether the signature information is signed in the trusted computing environment of the corresponding consensus node based on the signature information of each consensus node, and it is understood that the signature processing performed by the consensus node in the trusted computing environment includes the signature identifier of the trusted computing environment, that is, the target consensus node may determine an execution environment for each consensus node to perform the signature processing by detecting whether the signature information of each consensus node includes the signature identifier signed based on the trusted computing environment. Further, the target consensus node may be a consensus node performing signature processing based on the trusted computing environment and a consensus node not performing signature processing based on the trusted computing environment, and the respective voting weights are respectively assigned to the consensus node not performing signature processing based on the trusted computing environment.
After the voting weight of each consensus node is determined by the target consensus node, the voting result of each target data can be counted based on the voting weight of each consensus node, and then the consensus result of the target data is determined according to the counting result, wherein the voting result obtained by the consensus voting of each consensus node on the target data comprises a result supporting the passing of consensus and a result resisting the passing of consensus, therefore, if the target consensus node counts the voting results of the target data and the obtained statistical result is that the vote corresponding to the result of passing consensus is greater than the vote against the result of passing consensus, the target consensus node determines that the consensus result aiming at the target data is a consensus, and if the statistical result is that the number of votes corresponding to the result of the anti-passing consensus is greater than or equal to the number of votes supporting the result of the passing consensus, the target consensus node determines that the consensus result for the target data is a failed consensus. In one embodiment, after determining the consensus result for the target data, the target consensus node may store the target data in the blockchain network if the consensus result indicates that the target data passes the consensus, or directly discard the target data if the consensus result indicates that the target data does not pass the consensus.
Referring to fig. 2, which is a schematic flow chart of a data consensus method based on a blockchain according to an embodiment of the present invention, the method may be performed by the target consensus node, where the target consensus node is any one of a plurality of consensus nodes included in a blockchain network, as shown in fig. 2, the method may include:
s201, detecting a consensus triggering event for target data, and acquiring signature information of each consensus node in the multiple consensus nodes, where the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node.
In one embodiment, the target consensus node may determine that a consensus trigger for the target data is detected when a trigger for uploading the target data to the blockchain network for storage is detected, or the target consensus node may determine that a consensus trigger for the target data is detected when a consensus request for the target data is detected, where the target data may be any transaction data to be stored in the blockchain network, and the consensus request for the target data may be initiated by a manager managing the target data. In one embodiment, after the target consensus node detects a consensus trigger event for the target data, signature information corresponding to a voting result of consensus voting performed by each consensus node included in the blockchain network for the target data may be acquired.
In one embodiment, each consensus node included in the blockchain network may first verify the correctness and integrity of the target data when performing consensus processing on the target data, when the target data passes the correctness and integrity check of the target data by the corresponding consensus node, determine that a voting result obtained by the corresponding consensus node performing consensus voting on the target data is a result supporting passing consensus, and if the target data fails the correctness or integrity check of the consensus node, determine that a voting result obtained by the consensus node performing consensus voting on the target data is a result resisting passing consensus. In an embodiment, after performing consensus voting on target data by each consensus node in the block chain network and obtaining a corresponding voting result, a node private key corresponding to each consensus node may be used to sign the voting result, where signature information obtained by performing signature processing on the voting result by each consensus node using a corresponding node private key may be first signature information, and if the consensus node further includes a trusted computing environment, after the node private key signs the voting result, the consensus node may further use an equipment private key of the trusted computing environment to sign the voting result, so as to obtain second signature information of the consensus node for the target data. It can be understood that the signature information obtained by the consensus node in the blockchain network in the process of signing the voting result of the target data at least includes: the node private key based on the consensus node signs the voting result to obtain first signature information, and for the consensus node comprising the trusted computing environment, the node private key based on the consensus node signs the voting result to obtain signature information, and the node private key based on the trusted computing environment signs the voting result to obtain second signature information besides the first signature information.
In an embodiment, a process of signing, by a consensus node including a trusted computing environment, a voting result of target data may be as shown in fig. 3, after the consensus node including the trusted computing environment acquires the target data, a node private key of the consensus node may be used to sign the voting result of the target data to obtain signed target data, where the signed target data is the target data including first signature information signed based on the node private key. Further, when the consensus node has a trusted computing environment, the consensus node may further perform signature processing on the consensus node of the target data by using a device private key of the trusted computing environment to obtain second signature information, so that the signature information of the consensus node for the target data simultaneously includes first signature information obtained by signature processing based on the node private key and second signature information obtained by signature processing based on the device private key, and after the target node device obtains the signature information of the node device, a voting result of the consensus node for the target data and a vote count of votes voted by the consensus node may be determined based on the signature information obtained by signature processing twice.
In an embodiment, the target consensus node obtains signature information of each consensus node, including the signature information of the target consensus node and signature information of other consensus nodes except the target consensus node in the blockchain network, where the target consensus node performs consensus voting on the target data and performs signature processing on a voting result to obtain corresponding signature information, and then the signature information may be cached, so that the signature information of the target consensus node may be obtained from a local cache when the consensus triggering event is detected, or the target consensus node may also send the signature information to the blockchain network after the signature information is obtained, so that the target consensus node may also obtain the signature information of the target consensus node from the blockchain network when the consensus triggering event is detected. In an embodiment, the target consensus node obtains the signature information of other consensus nodes in the blockchain network, and further, after obtaining the signature information of each consensus node in the blockchain network, the target consensus node may determine a voting weight for performing consensus voting on the target data based on the signature information, that is, the target consensus node may proceed to perform step S202.
And S202, determining the voting weight of the consensus voting of each consensus node on the target data based on the signature information of each consensus node.
In one embodiment, when determining the voting weight of the consensus voting of each consensus node for the target data based on the signature information of each consensus node, the target consensus node determines whether the signature information of each consensus node is obtained by signature processing based on a trusted computing environment, specifically, the target consensus node may determine the target signature information from the signature information of each consensus node, the target signature information is obtained by signature processing based on a trusted computing environment, and further the target consensus node may determine that the voting weight of the consensus node obtaining the target signature information is a first voting weight, and set the voting weight of the consensus node obtaining the signature information except the target signature information in the obtained signature information of each consensus node as a second voting weight, in order to ensure the accuracy of the voting of the result of the target data, the first voting weight set by the target consensus node for the consensus node performing signature processing based on the trusted computing environment is greater than the second voting weight of the consensus node performing signature processing outside the trusted computing environment.
In one embodiment, when each consensus node in the block chain network performs consensus voting on the target data and performs signature processing on a voting result to obtain signature information, after performing signature processing on the voting result by using a node private key to generate signature information, the consensus node with a trusted computing environment may further add a signature identifier of the trusted computing environment to the signature information generated by performing signature processing on the trusted computing environment, and correspondingly, when determining a voting weight of each consensus node performing consensus voting on the target data based on the device information of each node, the target consensus node may determine target signature information including the signature identifier from the signature information of each consensus node based on the signature identifier of the trusted computing environment and set a first voting weight for the consensus node corresponding to the target signature information including the signature identifier, and setting a second voting weight for the consensus node corresponding to the signature information without the signature identifier, so as to determine a voting weight for performing consensus voting on the target data by each consensus node in the block chain network, and further, after determining the voting weight for performing consensus voting on the target data by each consensus node, counting the voting result of the target data according to the voting weight of each consensus node, that is, turning to execute step S203.
S203, counting the voting result of the target data according to the voting weight of each consensus node, and determining the consensus result of the target data according to the counting result.
In one embodiment, when the target consensus node counts the voting result of the target data based on the voting weight of each consensus node, the target consensus node may first determine that the voting result for the target data is the number of consensus nodes corresponding to the result of supporting passing consensus, so that the voting result may be determined to be the first number of votes corresponding to the result of supporting passing consensus based on the voting weight of each consensus node, for example, if the consensus nodes included in the blockchain network are the consensus nodes 1-5 shown in fig. 1, while the consensus nodes with trusted computing environments are assumed to be the consensus node 1, the consensus node 2 and the consensus node 3, the consensus nodes without trusted computing environments are assumed to be the consensus node 4 and the consensus node 5, and if the target consensus node is assumed to be the consensus node with trusted computing environments, the first voting weight set for the consensus node with trusted computing environments is 2, and the second voting weight set for the consensus node without trusted computing environments is 1, if the target consensus node determines that the consensus node corresponding to the result of supporting passing consensus comprises a consensus node 1, a consensus node 2, a consensus node 4 and three consensus nodes, and the voting weights corresponding to the consensus node 1 and the consensus node 2 are 2, the votes of the result of supporting passing consensus, which are obtained by performing consensus voting on the target data by the consensus node 1 and the consensus node 2, are both 1 × 2=2 votes. Further, the target consensus node may determine that the voting result is a first vote supporting the result of passing consensus, which corresponds to 2+2+1=5 votes, and correspondingly, the target consensus node may determine that the consensus result is a second vote resisting the result of passing consensus, which is 2+1=3 votes in the above example.
After the target consensus node respectively determines that the voting result is a first number of votes corresponding to the result of passing consensus and the voting result is a second number of votes corresponding to the result of resisting passing consensus, the first number of votes and the second number of votes can be further compared, if the first number of votes is greater than the second number of votes, the result of passing consensus of the target data is indicated, and if not, the result of consensus of the target data is indicated as failing consensus. In one embodiment, the target consensus node sends the target data to the blockchain network for storage when the consensus result indicates that the target data passes consensus, and the target consensus node may directly delete or discard the target data when the consensus result indicates that the target data does not pass consensus, based on the consensus result for the target data.
In the embodiment of the invention, after the target consensus node detects the consensus triggering event aiming at the target data, signature information obtained by signature processing of each consensus node in the block chain network on the voting result of the target data can be obtained, and further, the target consensus node may be determined by determining whether the signature information is based on a trusted computing environment, thereby determining the voting weight of the consensus voting of each consensus node on the target data, counting the voting results of the target data based on the voting weight, thereby determining consensus results for the target data, counting voting results for the target data based on the voting weights, the malicious problem of the tampered common identification node in the block chain network can be effectively prevented, and therefore the accuracy of the common identification result obtained by voting common identification on the target data is improved.
Referring to fig. 4, which is a schematic flowchart of a data consensus method based on a blockchain according to an embodiment of the present invention, the method may also be applied to the target consensus node, where the target consensus node is any one of the consensus nodes in the blockchain network, as shown in fig. 4, the method may include:
s401, detecting a consensus triggering event aiming at target data, and acquiring signature information of each consensus node in the multiple consensus nodes, wherein the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node.
In one embodiment, if the target consensus node is a first type of consensus node, that is, the target consensus node is a consensus node including a trusted computing environment, the obtaining of the signature information of the target consensus node comprises: and obtaining a target voting result obtained by the target consensus node performing consensus voting on the target data, so that the target voting result can be signed by using a node private key of the target consensus node to obtain first signature information of the target consensus node, and the target voting result can be signed by using an equipment private key in a trusted computing environment of the target consensus node to obtain second signature information of the target consensus node, and further, the first signature information of the target consensus node and the second signature information of the target consensus node can be used as the signature information of the target consensus node. In one embodiment, the trusted computing environment in the target consensus node is registered with the blockchain network in advance, specifically, as shown in fig. 5a, the target consensus node may, upon joining the blockchain network, first send a registration request to the blockchain network to register the trusted computing environment, wherein, the registration request comprises the target device information of the target consensus node, the existing consensus self node in the block chain network can carry out security verification on the target consensus node based on the target device information of the target consensus node, after passing the security verification, the target node may obtain registration feedback information based on the registration request sent by the blockchain network, where the obtained registration feedback information includes a device private key allocated to the trusted computing environment of the target consensus node, so that the target consensus node may perform signature processing by using the device private key.
In an embodiment, after the block chain network requests the trusted computing environment through the target consensus node for registration, the block chain network distributes a corresponding device private key to the trusted computing environment of the target consensus node, and broadcasts a device public key corresponding to the device private key to the block chain network, so that any consensus node in the block chain network can obtain the device private key, and the device private key is used to decode second signature information obtained by the target consensus node through signature processing based on the device private key of the trusted computing environment. When registering the trusted computing environment with the blockchain network, the target consensus node may be a partial area directly partitioned from a CPU device of the target consensus node as the trusted computing environment, or alternatively, when registering the trusted computing environment associated with the target consensus node as the trusted computing environment, the trusted computing environment registered by the target consensus node may be the trusted computing environment as shown in fig. 5 b.
In an embodiment, before the target consensus node signs the target voting result by using a device private key of the trusted computing environment, the number of nodes of the plurality of consensus nodes included in the blockchain network may be obtained, and the number of nodes is compared with a number threshold; if the number of the nodes is determined to be less than or equal to the number threshold according to the comparison result, the block chain network is indicated to have a small number of the consensus nodes, and even if the number of the consensus nodes is small, even if the leakage of the node private key of a small number of the consensus nodes may cause serious misunderstanding of the consensus nodes, it can be understood that, if the number of the consensus nodes in the block chain network is small, the leakage of the node private key of a small number of the consensus nodes may cause falsification of the consensus result for the target data, so that the accuracy of the consensus result for performing consensus voting on the target data is low, and in order to effectively ensure the consensus result for the target data, the target consensus node may trigger to perform signature processing on the target voting result by using the device private key in a trusted computing environment of the target consensus node under the condition that the number of the nodes in the block chain network is small, and obtaining second signature information of the target consensus node so as to ensure the accuracy of the consensus result of the target data.
In an embodiment, if the target consensus node determines that the number of nodes is greater than the number threshold according to the comparison result, since the possibility that the consensus result of the target data is falsified is low after a small number of node private keys of the consensus node are leaked and the difficulty that a large number of node private keys of the consensus node are leaked is high in the case that the number of nodes of the consensus node is large, the target consensus node may directly use the first signature information of the target consensus node as the signature information of the target consensus node when the number of the consensus nodes included in the blockchain network is greater than the number threshold, thereby improving the signature processing efficiency of the target data.
S402, dividing the plurality of consensus nodes into a first type of consensus node and a second type of consensus node according to the signature information of each consensus node.
And S403, respectively determining a first voting weight of the first-class consensus node and a second voting weight of the second-class consensus node, wherein the first voting weight is greater than the second voting weight.
In steps S402 and S403, signature information of a voting result obtained by performing consensus voting on target data by each consensus node included in the blockchain network certainly includes first signature information, where the first signature information is obtained by performing signature processing on the voting result by each consensus node using a corresponding node private key, and after the target consensus node obtains the signature information of each consensus node, when determining a voting weight of the target data by each consensus node based on the signature information, the target consensus node may first divide the plurality of consensus nodes into a first class of consensus nodes and a second class of consensus nodes according to the signature information of each consensus node, where the first class of consensus nodes are consensus nodes including both first signature information and second signature information, and the second signature information is information obtained by performing signature processing on the voting result by using a device private key of a trusted computing environment, the second type of consensus node refers to a consensus node only including the first signature information. Specifically, since the second signature information is generated by performing signature processing based on the trusted computing environment, when the target consensus node performs class classification on the consensus nodes, whether the composition of the signature information of each consensus node includes the second signature information may be detected, wherein the target consensus node may determine that the composition of the corresponding signature information includes the second signature information by detecting whether each signature information includes a signature identifier that is performed by performing signature processing based on the trusted computing environment and when the signature identifier is detected. Or, when detecting whether the composition of the signature information of each consensus node includes the second signature information, the target consensus node may further obtain a device public key of the published trusted computing environment from the blockchain network, and decrypt the signature information of each consensus node respectively by using the device public key, if decryption by using the device public key is successful, it is determined that the composition of the corresponding signature information includes the second signature information, otherwise, it is determined that the composition of the corresponding signature information does not include the second signature information.
In one embodiment, the target consensus node may use the consensus node including the second signature information as a first type of consensus node and the consensus node not including the second signature information as a second type of consensus node based on the composition of the signature information of each consensus node, so as to determine a first voting weight corresponding to the first type of consensus node and a second voting weight corresponding to the second type of consensus node, respectively. In the specific implementation, the number of the first type of consensus nodes and the number of the second type of consensus nodes determined by the target consensus node are one or more, when the target consensus node determines a first voting weight corresponding to each consensus node in the first class of consensus nodes and a second voting weight corresponding to each consensus node in the second class of consensus nodes, the same voting weight can be set for each of the first-type consensus nodes as the first voting weight of each of the first-type consensus nodes, and setting the same voting weight for each of the second type of consensus nodes as a second voting weight for each of the second type of consensus nodes, in one embodiment, the target consensus node may first obtain a first preset weight and a second preset weight, respectively, where the first preset weight is greater than the second preset weight; the first preset weight can be used as a first voting weight of each of the plurality of first-class consensus nodes, and the second preset weight can be used as a second voting weight of each of the plurality of second-class consensus nodes. For example, if the first type of consensus node determined by the target consensus node includes the consensus node 1, the consensus node 2, and the consensus node 3 shown in fig. 1, and the second type of consensus node includes the consensus node 4 and the consensus node 5 shown in fig. 1, if the first preset weight obtained by the target consensus node is 3 and the second preset weight is 1, the first preset weight 3 may be respectively used as the first voting weight of the consensus node 1, the consensus node 2, and the consensus node 3, and the second preset weight 1 may be respectively used as the second voting weight of the consensus node 4 and the consensus node 5.
In an embodiment, when determining the first voting weight of the first type of consensus node, the target consensus node may further set a different first voting weight for each of the first type of consensus nodes based on the device information of the trusted computing environment in each of the first type of consensus nodes, and in a specific implementation, the target consensus node may first obtain the device information of the trusted computing environment included in each of the first type of consensus nodes, and then the target consensus node may verify the security of the trusted computing environment included in each of the first type of consensus nodes based on the device information. Wherein the device information is sent to the target consensus node when each of the first type of consensus nodes sends a registration request for a trusted computing environment to the blockchain network, and the verifying of the security comprises: after the target consensus node verifies the security of the trusted computing environment in each consensus node in the first class of consensus nodes based on the device information, the security score of each trusted computing environment can be obtained according to the verification of the security of each trusted computing environment, so that the first voting weight corresponding to each consensus node in the first class of consensus nodes can be determined according to the security score. For example, if the plurality of first-type consensus nodes determined by the target consensus node are the consensus node 1 and the consensus node 2 shown in fig. 1, based on the verification of the security of the trusted computing environments in the consensus node 1 and the consensus node 2, respectively, if the security score of the consensus node 1 is determined to be greater than the security score of the consensus node 2, the first voting weight set by the target consensus node for the consensus node 1 is greater than the first voting weight set by the consensus node 2, and if the first voting weight set by the target consensus node for the consensus node 1 is 3, the first voting weight set by the consensus node 2 is 2.
In an embodiment, when determining the second voting weight of the second-type consensus node, the target consensus node may directly use a preset weight, such as the second preset weight described above, as the second voting weight of each of the second-type consensus nodes, or may randomly set a different second voting weight for each of the second-type consensus nodes, but the maximum value of the different second voting weights set for each of the second-type consensus nodes by the target consensus node should be smaller than the minimum value of the different first voting weights set for each of the first-type consensus nodes by the target consensus node. In one embodiment, after determining the voting weight of the consensus voting for the target data by each consensus node, the target consensus node may count the voting results of the target data based on the voting weight, that is, instead, perform step S404.
S404, counting the voting result of the target data according to the voting weight of each consensus node, and determining the consensus result of the target data according to the counting result.
In one embodiment, the voting results comprise results that support passing consensus and results that object to passing consensus; the target consensus node may first determine, from the plurality of consensus nodes, that the voting result is a consensus node supporting a result of passing consensus when the voting results of the target data are counted based on the voting weights, and counts the voting results into a first number of consensus nodes supporting the result of consensus according to the corresponding first voting weights, and, the target consensus node can also determine that the voting result is a consensus node against the result of passing consensus from the plurality of consensus nodes, and a second number of consensus nodes whose voting results are against passing the consensus result is counted according to the corresponding second voting weight, and further, the target consensus node may use the first number as a first vote for the voting result to support a result of consensus, and the second number is used as a second vote against the result of the consensus as a result of the voting. For example, if the target consensus node determines, from the plurality of consensus nodes shown in fig. 1, the consensus node whose voting result is a result of passing consensus to include the consensus node 1, the consensus node 2, and the consensus node 3, and the corresponding first voting weights are 3, 2, and 2.5, the consensus node whose voting result is a result of resisting passing consensus to include the consensus node 4 and the consensus node 5, and the corresponding second voting weights are all 1, the first number of the consensus nodes whose voting result is a result of resisting passing consensus is 3+2+2.5=8.5, and the second number of the consensus nodes whose voting result is a result of resisting passing consensus is 1+1= 2.
In an embodiment, as shown in fig. 6, after acquiring the signature information sent by each consensus node, the target consensus node may determine whether each signature information is obtained by signature processing based on a trusted computing environment, and further, the target consensus node adds a first voting weight to the consensus node which performs signature processing based on the trusted computing environment and determines a second voting weight corresponding to the consensus node which does not perform signature processing based on the trusted computing environment, so that voting results may be counted according to the voting weight of each consensus node in the block chain network, thereby obtaining a consensus result for the target data, and when the consensus result indicates that consensus is passed, the target data is stored in the block chain network, and when the consensus result indicates that consensus is not passed, the target data is deleted or discarded.
In the embodiment of the present invention, when detecting a consensus triggering event for target data, a target consensus node may obtain signature information of each consensus node in a block chain network, so as to detect whether the signature information of each consensus node includes second signature information obtained by performing signature processing based on a trusted computing environment, thereby determining a first voting weight of each consensus node in a first class of consensus nodes and a second voting weight of each consensus node in a second class of consensus nodes, respectively, and further, according to the voting weight (being the first voting weight or the second voting weight) of each consensus node, the target consensus node may count voting results for the target data and determine a consensus result for the target data, vote based on different weights corresponding to the determined consensus nodes with different security performances, the problem that the common identification node is bad after the node private key of the common identification node in the blockchain network is leaked can be effectively prevented, the accuracy of the result of the common identification processing on the target data can be effectively improved, and the accuracy and the safety of the target data stored in the blockchain are guaranteed.
Based on the description of the above embodiment of the data consensus method based on the block chain, an embodiment of the present invention further provides a data consensus apparatus based on the block chain, where the data consensus apparatus based on the block chain may be a computer program (including a program code) running in the target consensus node. The target consensus node is any one of a plurality of consensus nodes included in the blockchain network, and the blockchain-based data consensus apparatus can be used to perform the blockchain-based data consensus method as shown in fig. 2 and 4, please refer to fig. 7, and the blockchain-based data consensus apparatus includes: an acquisition unit 701, a determination unit 702 and a statistic unit 703.
An obtaining unit 701, configured to detect a consensus triggering event for target data, and obtain signature information of each consensus node in the multiple consensus nodes, where the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node;
a determining unit 702, configured to determine, based on the signature information of each consensus node, a voting weight for the consensus voting performed on the target data by each consensus node; in the plurality of consensus nodes, the voting weight corresponding to the consensus node which carries out signature processing in the trusted computing environment is greater than the voting weight corresponding to the consensus node which carries out signature processing outside the trusted computing environment;
a counting unit 703, configured to count the voting result of the target data according to the voting weight of each consensus node;
the determining unit 702 is further configured to determine a consensus result of the target data according to a statistical result.
In an embodiment, the determining unit 702 is specifically configured to:
dividing the plurality of common nodes into a first type of common nodes and a second type of common nodes according to the signature information of each common node; the first-class consensus node is a consensus node which simultaneously comprises first signature information and second signature information, the first signature information is information obtained by signature processing of a voting result by using a node private key, the second signature information is information obtained by signature processing of a voting result by using an equipment private key of a trusted computing environment, and the second-class consensus node is a consensus node which only comprises the first signature information;
and respectively determining a first voting weight of the first type consensus node and a second voting weight of the second type consensus node, wherein the first voting weight is greater than the second voting weight.
In an embodiment, the determining unit 702 is specifically configured to:
acquiring a first preset weight and a second preset weight, wherein the first preset weight is greater than the second preset weight;
and taking the first preset weight as a first voting weight of each consensus node in a plurality of first-class consensus nodes, and taking the second preset weight as a second voting weight of each consensus node in a plurality of second-class consensus nodes.
In an embodiment, the determining unit 702 is specifically configured to:
acquiring equipment information of a trusted computing environment included by each common node in the first type of common nodes, and verifying the security of the trusted computing environment included by each common node in the first type of common nodes based on the equipment information;
according to the verification of the safety of each common node in the first type of common nodes, obtaining a safety score of a trusted computing environment included in each common node in the first type of common nodes;
and determining a first voting weight corresponding to each consensus node in the first type of consensus nodes according to the safety score.
In one embodiment, the device information is sent to the target consensus node when each of the first type of consensus nodes sends a registration request for a trusted computing environment to the blockchain network;
the verification of the security comprises: one or both of a reliability verification and a completeness verification.
In one embodiment, the voting results comprise results that support passing consensus and results that object to passing consensus; the statistical unit 703 is specifically configured to:
determining the voting result as a consensus node supporting the result of passing consensus from the plurality of consensus nodes, and counting the first number of the voting result as the consensus node supporting the result of passing consensus according to the corresponding voting weight;
determining the consensus nodes with the voting results being the results of resisting passing consensus from the plurality of consensus nodes, and counting a second number of the consensus nodes with the voting results being the results of resisting passing consensus according to the corresponding voting weights;
the first number is used as a first vote number for the voting result to support the result of passing consensus, and the second number is used as a second vote number for the voting result to resist the result of passing consensus.
In one embodiment, if the target consensus node is a first type of consensus node; the obtaining unit 701 is specifically configured to:
obtaining a target voting result obtained by carrying out consensus voting on the target data by the target consensus node;
signing the target voting result by using a node private key of the target consensus node to obtain first signature information of the target consensus node, and signing the target voting result by using an equipment private key in a trusted computing environment of the target consensus node to obtain second signature information of the target consensus node;
and taking the first signature information of the target consensus node and the second signature information of the target consensus node as the signature information of the target consensus node.
In an embodiment, the obtaining unit 701 is further configured to obtain a node number of a plurality of common nodes included in the blockchain network, and compare the node number with a number threshold;
the determining unit 702 is further configured to trigger execution of a step of performing signature processing on the target voting result by using an equipment private key in a trusted computing environment of the target consensus node to obtain second signature information of the target consensus node if it is determined that the number of nodes is smaller than or equal to the number threshold according to the comparison result.
In an embodiment, the determining unit 702 is further configured to, if it is determined that the number of nodes is greater than the number threshold according to the comparison result, use the first signature information of the target consensus node as the signature information of the target consensus node.
In this embodiment of the present invention, after the obtaining unit 701 detects the consensus triggering event for the target data, signature information obtained by signing the voting result of the target data by each consensus node in the blockchain network can be acquired, and further, the determining unit 702 can determine whether the signature information is obtained by signing based on a trusted computing environment, so that the determining unit 702 can determine the voting weight of the consensus vote of each consensus node on the target data, the counting unit 703 counts the voting results of the target data based on the voting weight, the determination unit 702 thus determines the consensus result for the target data, counts the voting results for the target data based on the voting weights, the malicious problem of the tampered common identification node in the block chain network can be effectively prevented, and therefore the accuracy of the common identification result obtained by voting common identification on the target data is improved.
Please refer to fig. 8, which is a schematic block diagram illustrating a structure of a target consensus node according to an embodiment of the present invention, where the target consensus node is any one of a plurality of consensus nodes included in the blockchain network, and the target consensus node may be a terminal device, or may also be a server device, where the server may be an independent physical server, or may also be a server cluster or a distributed system formed by a plurality of physical servers, or may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The target consensus node in the present embodiment as shown in fig. 8 may include: one or more processors 801; one or more input devices 802, one or more output devices 803, and memory 804. The processor 801, the input device 802, the output device 803, and the memory 804 described above are connected by a bus 805. The memory 804 is used for storing a computer program comprising program instructions, and the processor 801 is used for executing the program instructions stored by the memory 804.
The memory 804 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 804 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a solid-state drive (SSD), etc.; the memory 804 may also comprise a combination of the above-described types of memory.
The processor 801 may be a Central Processing Unit (CPU). The processor 801 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or the like. The PLD may be a field-programmable gate array (FPGA), a General Array Logic (GAL), or the like. The processor 801 may also be a combination of the above structures.
In the embodiment of the present invention, the memory 804 is used for storing a computer program, the computer program includes program instructions, and the processor 801 is used for executing the program instructions stored in the memory 804, so as to implement the steps of the corresponding methods as described above in fig. 2 and fig. 4.
In one embodiment, the processor 801 is configured to call the program instructions for performing:
detecting a consensus triggering event aiming at target data, and acquiring signature information of each consensus node in the multiple consensus nodes, wherein the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node;
determining the voting weight of consensus voting of each consensus node on the target data based on the signature information of each consensus node; in the plurality of consensus nodes, the voting weight corresponding to the consensus node which carries out signature processing in the trusted computing environment is greater than the voting weight corresponding to the consensus node which carries out signature processing outside the trusted computing environment;
and counting the voting result of the target data according to the voting weight of each consensus node, and determining the consensus result of the target data according to the counting result.
In one embodiment, the processor 801 is configured to call the program instructions for performing:
dividing the plurality of common nodes into a first type of common nodes and a second type of common nodes according to the signature information of each common node; the first-class consensus node is a consensus node which simultaneously comprises first signature information and second signature information, the first signature information is information obtained by signature processing of a voting result by using a node private key, the second signature information is information obtained by signature processing of a voting result by using an equipment private key of a trusted computing environment, and the second-class consensus node is a consensus node which only comprises the first signature information;
and respectively determining a first voting weight of the first type consensus node and a second voting weight of the second type consensus node, wherein the first voting weight is greater than the second voting weight.
In one embodiment, the processor 801 is configured to call the program instructions for performing:
acquiring a first preset weight and a second preset weight, wherein the first preset weight is greater than the second preset weight;
and taking the first preset weight as a first voting weight of each consensus node in a plurality of first-class consensus nodes, and taking the second preset weight as a second voting weight of each consensus node in a plurality of second-class consensus nodes.
In one embodiment, the processor 801 is configured to call the program instructions for performing:
acquiring equipment information of a trusted computing environment included by each common node in the first type of common nodes, and verifying the security of the trusted computing environment included by each common node in the first type of common nodes based on the equipment information;
according to the verification of the safety of each common node in the first type of common nodes, obtaining a safety score of a trusted computing environment included in each common node in the first type of common nodes;
and determining a first voting weight corresponding to each consensus node in the first type of consensus nodes according to the safety score.
In one embodiment, the device information is sent to the target consensus node when each of the first type of consensus nodes sends a registration request for a trusted computing environment to the blockchain network;
the verification of the security comprises: one or both of a reliability verification and a completeness verification.
In one embodiment, the voting results comprise results that support passing consensus and results that object to passing consensus; the processor 801 is configured to call the program instructions for performing:
determining the voting result as a consensus node supporting the result of passing consensus from the plurality of consensus nodes, and counting the first number of the voting result as the consensus node supporting the result of passing consensus according to the corresponding voting weight;
determining the consensus nodes with the voting results being the results of resisting passing consensus from the plurality of consensus nodes, and counting a second number of the consensus nodes with the voting results being the results of resisting passing consensus according to the corresponding voting weights;
the first number is used as a first vote number for the voting result to support the result of passing consensus, and the second number is used as a second vote number for the voting result to resist the result of passing consensus.
In one embodiment, if the target consensus node is a first type of consensus node; the processor 801 is configured to call the program instructions for performing:
obtaining a target voting result obtained by carrying out consensus voting on the target data by the target consensus node;
signing the target voting result by using a node private key of the target consensus node to obtain first signature information of the target consensus node, and signing the target voting result by using an equipment private key in a trusted computing environment of the target consensus node to obtain second signature information of the target consensus node;
and taking the first signature information of the target consensus node and the second signature information of the target consensus node as the signature information of the target consensus node.
In one embodiment, the processor 801 is configured to call the program instructions for performing:
acquiring the number of nodes of a plurality of common nodes included in the blockchain network, and comparing the number of the nodes with a number threshold;
and if the number of the nodes is determined to be less than or equal to the number threshold according to the comparison result, triggering and executing the step of signing the target voting result by adopting an equipment private key in the trusted computing environment of the target consensus node to obtain second signature information of the target consensus node.
In one embodiment, the processor 801 is configured to call the program instructions for performing:
and if the number of the nodes is determined to be larger than the number threshold according to the comparison result, taking the first signature information of the target consensus node as the signature information of the target consensus node.
Embodiments of the present invention 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 to cause the computer device to perform the method embodiments as shown in fig. 2 or fig. 3. The computer-readable storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a particular embodiment, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. A blockchain-based data consensus method performed by a target consensus node of a blockchain network, the target consensus node being any one of a plurality of consensus nodes comprised by the blockchain network, the method comprising:
detecting a consensus triggering event aiming at target data, and acquiring signature information of each consensus node in the multiple consensus nodes, wherein the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node;
determining the voting weight of consensus voting of each consensus node on the target data based on the signature information of each consensus node; in the plurality of consensus nodes, the voting weight corresponding to the consensus node which carries out signature processing in the trusted computing environment is greater than the voting weight corresponding to the consensus node which carries out signature processing outside the trusted computing environment;
and counting the voting result of the target data according to the voting weight of each consensus node, and determining the consensus result of the target data according to the counting result.
2. The method of claim 1, wherein the determining the voting weight for the consensus voting of the each consensus node on the target data based on the signature information of the each consensus node comprises:
dividing the plurality of common nodes into a first type of common nodes and a second type of common nodes according to the signature information of each common node; the first-class consensus node is a consensus node which simultaneously comprises first signature information and second signature information, the first signature information is information obtained by signature processing of a voting result by using a node private key, the second signature information is information obtained by signature processing of a voting result by using an equipment private key of a trusted computing environment, and the second-class consensus node is a consensus node which only comprises the first signature information;
and respectively determining a first voting weight of the first type consensus node and a second voting weight of the second type consensus node, wherein the first voting weight is greater than the second voting weight.
3. The method of claim 2, wherein the determining the first voting weight for the first type of consensus node and the second voting weight for the second type of consensus node comprises:
acquiring a first preset weight and a second preset weight, wherein the first preset weight is greater than the second preset weight;
and taking the first preset weight as a first voting weight of each consensus node in a plurality of first-class consensus nodes, and taking the second preset weight as a second voting weight of each consensus node in a plurality of second-class consensus nodes.
4. The method of claim 2, wherein determining the first voting weight for the first type of consensus node comprises:
acquiring equipment information of a trusted computing environment included by each common node in the first type of common nodes, and verifying the security of the trusted computing environment included by each common node in the first type of common nodes based on the equipment information;
according to the verification of the safety of each common node in the first type of common nodes, obtaining a safety score of a trusted computing environment included in each common node in the first type of common nodes;
and determining a first voting weight corresponding to each consensus node in the first type of consensus nodes according to the safety score.
5. The method of claim 4, wherein the device information is sent to the target consensus node when each of the first class of consensus nodes sends a registration request for a trusted computing environment to the blockchain network;
the verification of the security comprises: one or both of a reliability verification and a completeness verification.
6. The method of claim 1, wherein the voting results comprise a result that supports passing consensus and a result that opposes passing consensus; the counting the voting result of the target data according to the voting weight of each consensus node comprises:
determining the voting result as a consensus node supporting the result of passing consensus from the plurality of consensus nodes, and counting the first number of the voting result as the consensus node supporting the result of passing consensus according to the corresponding voting weight;
determining the consensus nodes with the voting results being the results of resisting passing consensus from the plurality of consensus nodes, and counting a second number of the consensus nodes with the voting results being the results of resisting passing consensus according to the corresponding voting weights;
the first number is used as a first vote number for the voting result to support the result of passing consensus, and the second number is used as a second vote number for the voting result to resist the result of passing consensus.
7. The method of claim 1, wherein if the target consensus node is a first type of consensus node; the obtaining method of the signature information of the target consensus node includes:
obtaining a target voting result obtained by carrying out consensus voting on the target data by the target consensus node;
signing the target voting result by using a node private key of the target consensus node to obtain first signature information of the target consensus node, and signing the target voting result by using an equipment private key in a trusted computing environment of the target consensus node to obtain second signature information of the target consensus node;
and taking the first signature information of the target consensus node and the second signature information of the target consensus node as the signature information of the target consensus node.
8. The method of claim 7, wherein before signing the target voting result with a device private key in the trusted computing environment of the target consensus node to obtain the second signature information of the target consensus node, the method further comprises:
acquiring the number of nodes of a plurality of common nodes included in the blockchain network, and comparing the number of the nodes with a number threshold;
and if the number of the nodes is determined to be less than or equal to the number threshold according to the comparison result, triggering and executing the step of signing the target voting result by adopting an equipment private key in the trusted computing environment of the target consensus node to obtain second signature information of the target consensus node.
9. The method of claim 8, further comprising:
and if the number of the nodes is determined to be larger than the number threshold according to the comparison result, taking the first signature information of the target consensus node as the signature information of the target consensus node.
10. A data consensus device based on a blockchain, the data consensus device being built in a target consensus node of a blockchain network, the target consensus node being any one of a plurality of consensus nodes included in the blockchain network, the device comprising:
an obtaining unit, configured to detect a consensus triggering event for target data, and obtain signature information of each consensus node in the multiple consensus nodes, where the signature information is obtained by performing signature processing on a voting result obtained by performing consensus voting on the target data by each consensus node;
a determining unit, configured to determine, based on the signature information of each consensus node, a voting weight for the consensus voting of each consensus node on the target data; in the plurality of consensus nodes, the voting weight corresponding to the consensus node which carries out signature processing in the trusted computing environment is greater than the voting weight corresponding to the consensus node which carries out signature processing outside the trusted computing environment;
the statistic unit is used for counting the voting result of the target data according to the voting weight of each consensus node;
the determining unit is further configured to determine a consensus result of the target data according to a statistical result.
11. A target consensus node comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to carry out the method according to any one of claims 1 to 9.
CN202010942122.8A 2020-09-09 2020-09-09 Block chain-based data consensus method, related equipment and storage medium Active CN111814204B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010942122.8A CN111814204B (en) 2020-09-09 2020-09-09 Block chain-based data consensus method, related equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010942122.8A CN111814204B (en) 2020-09-09 2020-09-09 Block chain-based data consensus method, related equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111814204A true CN111814204A (en) 2020-10-23
CN111814204B CN111814204B (en) 2020-12-15

Family

ID=72860112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010942122.8A Active CN111814204B (en) 2020-09-09 2020-09-09 Block chain-based data consensus method, related equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111814204B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312640A (en) * 2021-05-31 2021-08-27 天津理工大学 Software data integrity multi-party consensus method based on trusted computing

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108184233A (en) * 2017-12-01 2018-06-19 中国联合网络通信集团有限公司 A kind of number carrying method and system
CN109559120A (en) * 2018-12-03 2019-04-02 国网电子商务有限公司 Block chain common recognition method, system, storage medium and electronic equipment based on weight
CN109949034A (en) * 2019-03-06 2019-06-28 北京工业大学 Block chain common recognition method based on Credibility Assessment
US20190354723A1 (en) * 2018-05-16 2019-11-21 Ebay, Inc. Weighted source data secured on blockchains
CN110659988A (en) * 2019-09-10 2020-01-07 杭州秘猿科技有限公司 Parallel processing method and device for block chain consensus and execution and electronic equipment
US20200186509A1 (en) * 2018-12-06 2020-06-11 Bank Of America Corporation System and method for hierarchical decisioning within a hybrid blockchain
CN111506901A (en) * 2020-04-16 2020-08-07 腾讯科技(深圳)有限公司 Data processing method based on block chain, terminal and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108184233A (en) * 2017-12-01 2018-06-19 中国联合网络通信集团有限公司 A kind of number carrying method and system
US20190354723A1 (en) * 2018-05-16 2019-11-21 Ebay, Inc. Weighted source data secured on blockchains
CN109559120A (en) * 2018-12-03 2019-04-02 国网电子商务有限公司 Block chain common recognition method, system, storage medium and electronic equipment based on weight
US20200186509A1 (en) * 2018-12-06 2020-06-11 Bank Of America Corporation System and method for hierarchical decisioning within a hybrid blockchain
CN109949034A (en) * 2019-03-06 2019-06-28 北京工业大学 Block chain common recognition method based on Credibility Assessment
CN110659988A (en) * 2019-09-10 2020-01-07 杭州秘猿科技有限公司 Parallel processing method and device for block chain consensus and execution and electronic equipment
CN111506901A (en) * 2020-04-16 2020-08-07 腾讯科技(深圳)有限公司 Data processing method based on block chain, terminal and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312640A (en) * 2021-05-31 2021-08-27 天津理工大学 Software data integrity multi-party consensus method based on trusted computing
CN113312640B (en) * 2021-05-31 2022-05-24 天津理工大学 Software data integrity multi-party consensus method based on trusted computing

Also Published As

Publication number Publication date
CN111814204B (en) 2020-12-15

Similar Documents

Publication Publication Date Title
US11019050B2 (en) Authentication method and device, and blockchain-based authentication data processing method and device
US10680812B2 (en) Event attestation for an electronic device
US10073916B2 (en) Method and system for facilitating terminal identifiers
US9342683B2 (en) Stateless attestation system
CN111163182B (en) Block chain-based device registration method and apparatus, electronic device, and storage medium
CN111383021B (en) Node management method, device, equipment and medium based on block chain network
US11611439B2 (en) Tree structure for byzantine fault tolerance
CN111523890A (en) Data processing method and device based on block chain, storage medium and equipment
US11362836B2 (en) Consensus protocol for permissioned ledgers
WO2022179115A1 (en) User authentication method and apparatus, server and storage medium
EP3598333B1 (en) Electronic device update management
CN111881481B (en) Medical data processing method, device, equipment and storage medium based on blockchain
CN109684878B (en) Privacy information tamper-proofing method and system based on block chain technology
CN113822675A (en) Block chain based message processing method, device, equipment and storage medium
CN111431908B (en) Access processing method and device, management server and readable storage medium
CN111224782B (en) Data verification method based on digital signature, intelligent device and storage medium
CN111814204B (en) Block chain-based data consensus method, related equipment and storage medium
CN114547701A (en) Block chain-based tamper-proof identification chip information trusted storage system
CN111680282B (en) Node management method, device, equipment and medium based on block chain network
CN109951527B (en) Virtualization system-oriented hypervisor integrity detection method
CN114697132B (en) Method, device, equipment and storage medium for intercepting repeated access request attack
CN112132588B (en) Data processing method and device based on block chain, routing equipment and storage medium
CN113901519A (en) Data processing method, device, equipment and medium based on block chain
CN112765588A (en) Identity recognition method and device, electronic equipment and storage medium
Kong et al. A reconfigurable byzantine quorum approach for the agile store

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40031362

Country of ref document: HK