WO2023029743A1 - Block management - Google Patents

Block management Download PDF

Info

Publication number
WO2023029743A1
WO2023029743A1 PCT/CN2022/104315 CN2022104315W WO2023029743A1 WO 2023029743 A1 WO2023029743 A1 WO 2023029743A1 CN 2022104315 W CN2022104315 W CN 2022104315W WO 2023029743 A1 WO2023029743 A1 WO 2023029743A1
Authority
WO
WIPO (PCT)
Prior art keywords
management
blockchain
candidate block
node
block
Prior art date
Application number
PCT/CN2022/104315
Other languages
French (fr)
Chinese (zh)
Inventor
卓海振
张中文
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2023029743A1 publication Critical patent/WO2023029743A1/en

Links

Images

Classifications

    • 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
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2219Large Object storage; Management thereof
    • 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

Definitions

  • One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a block management method and device.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database. Since blockchain technology has the characteristics of decentralization, openness and transparency, each computing device can participate in database records, and data synchronization between computing devices can be quickly performed, blockchain technology is used to build a decentralized system, and Various execution programs are included in the distributed database of the blockchain for automatic execution, which has been widely used in many fields.
  • the blockchain nodes In the accounting process of the blockchain, it is usually necessary for the blockchain nodes to reach a consensus on the blockchain transactions that have passed the legality verification, and the accounting nodes determined by the consensus algorithm based on the blockchain will package the received transactions as Generate a candidate block, and send the generated candidate block or the block header of the candidate block to other node devices for consensus verification. Other blockchain nodes can directly execute the transactions contained in the block when there is no problem in verifying the received candidate block or the block header of the candidate block.
  • the data of the blockchain transaction will be stored on the blockchain. After the transaction is executed, the transaction certificate that cannot be tampered with and will not be lost is stored on the blockchain.
  • This non-tamperable feature of stored information can make the data on the chain more reliable and credible, effectively improving the security of blockchain transactions; but on the other hand, it will also make some data that does not meet the management requirements be stored on the chain. Cannot be deleted.
  • one or more embodiments of this specification provide a block management method and device.
  • a block management method is proposed, which is applied to a management node in a blockchain system, Including: receiving the candidate block sent by the bookkeeping node in the blockchain system, the candidate block is obtained by the bookkeeping node packaging a number of blockchain transactions that have passed the legality verification, and the candidate block The block has passed the consensus; the blockchain transactions contained in the candidate block are verified according to the predefined management rules; when it is confirmed that all the blockchain transactions contained in the candidate block comply with the management rules , trigger each bookkeeping node to record the candidate block as the latest block in the blockchain account book maintained by itself; after confirming that there is any blockchain transaction in the candidate block that does not comply with the management rules In this case, each accounting node is triggered to abandon the candidate block.
  • a block management device which is applied to a management node in a blockchain system, including: a receiving unit, configured to receive The candidate block sent by the accounting node, the candidate block is obtained by the accounting node by packaging a number of blockchain transactions that have passed the legality verification, and the candidate block has passed the consensus; the verification unit is used for Verify the blockchain transactions contained in the candidate block according to predefined management rules; the first trigger unit is used to confirm that all blockchain transactions contained in the candidate block comply with the management rules In this case, each accounting node is triggered to record the candidate block as the latest block in the blockchain account book maintained by itself; the second trigger unit is used to confirm that there is any block in the candidate block In the case that the chain transaction does not comply with the management rules, each bookkeeping node is triggered to abandon the candidate block.
  • an electronic device including: a processor; a memory for storing processor-executable instructions; wherein, the processor implements the above-mentioned first aspect by running the executable instructions The method described in the examples.
  • a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the above-mentioned embodiments of the first aspect are implemented.
  • Fig. 1 is a schematic diagram of a block management method provided by an exemplary embodiment
  • Fig. 2 is a schematic structural diagram of a block chain system provided by an exemplary embodiment
  • Fig. 3 is a structural flow diagram of another block chain system provided by an exemplary embodiment
  • Fig. 4 is a schematic diagram of an electronic device provided by an exemplary embodiment
  • Fig. 5 is a block diagram of a block management device provided by an exemplary embodiment.
  • the steps of the corresponding methods may not necessarily be performed in the order shown and described in this specification.
  • the method may include more or less steps than those described in this specification.
  • a single step described in this specification may be decomposed into multiple steps for description in other embodiments; multiple steps described in this specification may also be combined into a single step in other embodiments describe.
  • the data of the blockchain transaction will be stored on the blockchain. After the transaction is executed, the transaction certificate that cannot be tampered with and will not be lost is stored on the blockchain.
  • This non-tamperable feature of stored information can make the data on the chain more reliable and credible, effectively improving the security of blockchain transactions; but on the other hand, it will also make some data that does not meet the management requirements be stored on the chain. Cannot be deleted.
  • this specification proposes a block management method, which further verifies the block chain transactions to be executed on the basis of traditional legality verification and consensus verification, so as to avoid storing data that does not meet management requirements in the on the blockchain.
  • Fig. 1 is a flow chart of a block management method according to an exemplary embodiment of this specification. As shown in Figure 1, the method is applied to the management node in the blockchain system, and may include the following steps.
  • Step 102 Receive the candidate block sent by the bookkeeping node in the blockchain system, the candidate block is obtained by the bookkeeping node packaging a number of blockchain transactions that have passed the legality verification, and the candidate block The block has passed consensus.
  • the management node can be one or more blockchain nodes set in the blockchain system, and is used to verify the blockchain transactions on the blockchain system.
  • each management node can verify the blockchain transactions on the blockchain system according to the same management rules, and can also verify the blockchain transactions on the blockchain system according to different management rules.
  • the blockchain transactions on the blockchain system are verified, and this specification does not limit this.
  • a blockchain node In the block management process, after a blockchain node receives any blockchain transaction, it first needs to verify the validity of the received blockchain transaction.
  • the legality verification of blockchain transactions can usually be achieved by verifying the validity of signatures.
  • the applicable account of the blockchain usually corresponds to one or more sets of public key-private key pairs, and the above public keys can be recorded in the corresponding account status, or stored in other forms in the In the distributed database of the blockchain, it can be obtained by any node device in the blockchain system.
  • the private key corresponding to the above public key is stored in the account owner's local database or other hardware terminals for the account owner to perform digital signature or encryption and decryption operations.
  • the blockchain transaction initiated by the initiator includes not only the transaction content, but also the digital signature made by the initiator using the private key corresponding to the account for the transaction content.
  • the blockchain node After the blockchain node receives the blockchain transaction, it can verify the legality of the blockchain transaction based on the digital signature contained in the blockchain transaction. Legality verification may generally include: verifying whether the digital signature is obtained based on the transaction content of the blockchain transaction (also called integrity verification), etc. Through the integrity check, it can be ensured that the blockchain transaction is indeed initiated by the user corresponding to the public key, and that the transaction has not been tampered with during transmission.
  • the initiator's public key can also be carried in the CA certificate issued by the CA center to the initiator.
  • the CA certificate signed by the CA center's private key can be Send it to the blockchain node together, and the blockchain node will verify the signature of the CA certificate according to the public key of the CA center, and obtain the initiator public key carried in the CA certificate if the verification is successful.
  • the CA center is an authoritative organization that can be trusted by the blockchain nodes by default. Therefore, as long as the certificate is successfully verified with the public key of the CA center, it can be determined that the public key in the certificate is credible, so that the blockchain nodes can pass The public key verifies the legality of the digital signature contained in the received blockchain transaction. By verifying the legality of the received transaction, it can be determined that the received blockchain transaction has not been tampered with during transmission, which improves the security of the blockchain transaction.
  • the bookkeeping node in the blockchain system can package the blockchain transaction with other transactions that have passed the legality verification to generate a candidate block, and the generated candidate block or the candidate The block header of the block is sent to other node devices for consensus verification.
  • the consensus algorithms supported in the blockchain can include: the first type of consensus algorithm, that is, the consensus algorithm that node devices need to compete for the accounting rights of each round of accounting cycle; for example, proof of work (Proof of Work, POW), Consensus algorithms such as Proof of Stake (POS), Delegated Proof of Stake (DPOS) and other consensus algorithms; the second type of consensus algorithm is to pre-elect accounting nodes for each round of accounting cycle (no need to compete for accounting rights) consensus algorithm; for example, consensus algorithms such as Practical Byzantine Fault Tolerance (PBFT).
  • the blockchain node that receives the blockchain transaction broadcasts the blockchain transaction that passes the legality verification to other blockchain nodes in the blockchain system.
  • the node device competing for the bookkeeping right can execute the transaction after receiving the transaction, and the winning node device in the process of competing for the bookkeeping right in this round can serve as the bookkeeping node of the current round.
  • the accounting node packs the received transaction together with other transactions to generate a candidate block, and sends the generated candidate block or the block header of the candidate block to other node devices for consensus.
  • the node equipment with bookkeeping rights has been agreed before the current round of bookkeeping. If the blockchain node that receives the blockchain transaction is the bookkeeping node of the current round, it will directly pack the received transaction together with other transactions into the candidate block, and the generated candidate block or the The block header is sent to other node devices for consensus; if the blockchain node that receives the blockchain transaction is not the bookkeeping node of the current round, the blockchain transaction can be sent to the bookkeeping node of the current round, and the bookkeeper The ledger node packages the blockchain transaction together with other transactions to generate a candidate block, and sends the candidate block or the block header of the candidate block to other node devices for consensus.
  • Step 104 Verify the blockchain transactions included in the candidate block according to predefined management rules.
  • a blockchain node After a blockchain node receives a candidate block that has passed the consensus, it will default that there is no problem with the blockchain transactions contained in the candidate block, and the blockchain node can directly use the candidate block Append to the end of the blockchain maintained by itself as the latest block of the blockchain.
  • the management node in the blockchain system needs to further verify the candidate block according to the predefined management rules, and only when it passes After this further verification, the candidate block can be added as the latest block, so as to prevent the candidate block from containing risky blockchain transactions, and avoid data that does not comply with management rules from being saved on the blockchain.
  • the management node can verify and manage the blockchain transactions in the candidate block according to the predefined management rules when it is determined that the received candidate block has passed the consensus.
  • the specific content and specific logic of the management rules can be set by those skilled in the art according to actual needs.
  • the management rules can be set as whether the transaction content and/or the contract status value generated by the transaction contains preset sensitive words, etc. ; or for transfer transactions, the management rules can be set to whether the transaction amount exceeds the preset amount threshold, whether the transaction initiator account and/or the transaction counterparty account is a preset blacklist account, etc.; or for smart contract call transactions, management
  • management The rules can be set as whether the originator account has the contract calling authority, etc. This manual does not limit this.
  • the management node will call the management rules to analyze and obtain the initiator account of the transaction in the blockchain transaction after confirming that the candidate block consensus is passed.
  • the From field of the account address for example, "Bob(0xf5e...)”
  • compare the account address with the blacklist account in the predefined management rules if there is an account address in the blacklist account of the predefined management rules "Bob(0xf5e...)”
  • the blockchain transaction has not passed the verification of the management node, otherwise, it has passed the verification.
  • the management node can call the predefined management rules after confirming that the candidate block has passed the consensus, and analyze and obtain the block chain transaction indicating that the transaction initiator wants to transfer money to the transaction receiver.
  • the value field of the amount compares the transaction amount with the preset transaction amount threshold in the predefined management rules. If the transfer amount or transaction frequency exceeds the preset amount threshold in the predefined management rules, the blockchain transaction If the verification of the management node is not passed, otherwise, the verification is passed.
  • the management rules in this specification are not fixed. If necessary, they can be updated on the basis of the original management rules of the management contract, such as adding new management rules and deleting the original management rules. Part of the content, or the original management rules can be modified by modifying the preset parameters in the original management rules.
  • the management rules in the management contract are used to check whether the transaction amount of the transfer transaction is within the preset amount range And whether the transfer object account of the transaction is in the blacklist account, you can modify the value of the original preset amount range, delete some accounts in the original blacklist account, or add new inspection content by updating the management rules.
  • the predefined management rules in the management node can be maintained in the pre-deployed management contract.
  • the management node receives a candidate block that passes the consensus, it can invoke the management rules pre-deployed at the blockchain management node. Contract to verify the blockchain transactions contained in the candidate block through the predefined management rules in the management contract.
  • the management contract can be a genesis contract, that is, the management contract is deployed in the genesis block at the beginning of the creation of the blockchain system.
  • the management contract can also be a system contract, which needs to be deployed by an administrator. In some cases, the deployment can only be completed with the approval of more than a preset ratio of administrators.
  • the general node members of the blockchain system may deploy the management contract, that is, the management contract can be an ordinary contract that is different from the creation contract and the system contract. Since the blockchain node itself is a logical concept, by creating a node instance on the node device and running the above-mentioned blockchain platform chain code by the node instance, the node instance can become a blockchain node.
  • the blockchain platform chain code is the underlying logic that makes the node instance a blockchain node, and the management contract can be deployed in the blockchain platform code running on the blockchain management node, so that the blockchain node is running
  • the chain code of the blockchain platform can be directly executed, so that the blockchain node can actively trigger the call to the management contract through the predefined interface recorded in the chain code of the blockchain platform, without the need for blockchain transactions as in related technologies to call, thus simplifying the call logic of the management contract.
  • the management contract can be an on-chain contract deployed at each blockchain node in the blockchain system through a contract deployment transaction.
  • the blockchain system includes Node A, Node B, Blockchain nodes such as Node C and Node D have the same management contract deployed in each blockchain node.
  • any blockchain node can call the locally deployed management contract when receiving the candidate block sent by the bookkeeping node to manage the candidate block through the management rules associated with the contract examine.
  • this node can submit a contract deployment transaction for management rules in the blockchain system, so that each blockchain node in the blockchain system can reach a consensus on the transaction.
  • each blockchain node in the blockchain system executes the transaction respectively, so as to locally deploy the management contract corresponding to the management rules on each node.
  • the above-mentioned blockchain node Node A can be a management node or a non-management node in the blockchain system, and this specification does not limit it.
  • the management contract may also be a local contract that is only deployed on the management node, and the local contract is only deployed on the management node, and does not need to be deployed to other blockchain nodes in the blockchain system.
  • the blockchain system includes blockchain nodes such as Node A, Node B, Node C, and Node D.
  • Node A locally deploys a management contract
  • other nodes Node B, Node C, and /or Node D
  • any blockchain node other than Node A can be a management node, and of course it can also be a non-management node, which is not limited in this manual.
  • Node A can execute a contract deployment transaction to implement the deployment of the management contract, and the transaction can be a local blockchain transaction that does not require consensus. For example, after Node A receives a contract deployment transaction, it does not need to initiate a consensus on the transaction, but can directly execute the transaction to deploy the corresponding management contract locally. It can be seen that although the blockchain system contains multiple blockchain nodes, only the management nodes among them are locally deployed with the above-mentioned management contract, while the non-management nodes do not deploy the contract, so the deployment process is relatively simple. In addition, because the deployment process of the above-mentioned management contract does not require consensus, it can realize the rapid deployment of the management contract and facilitate the convenient update of the data management rules.
  • the blockchain nodes can update the management rules in different ways.
  • the blockchain node can execute a rule update transaction to deploy a new management contract, and the new management rules are recorded in the contract code or contract state of the new management contract.
  • the blockchain node can call the new management contract to perform management checks on the candidate blocks.
  • the management rules are maintained in the contract state of the management contract, if the management rules need to be updated, the blockchain node can initiate an update transaction for the management rules, and update the value of the contract state of the above management contract to the new management rules , without redeploying the management contract.
  • the update transaction of the management rules can only be initiated by the administrator of the blockchain system.
  • the administrator can be a member of the blockchain corresponding to the management node, and avoid opening the update authority of the management rules to ordinary users. , to prevent security issues caused by this.
  • the predefined management rules in the management node can also be maintained in the database, regardless of the management contract deployed on the blockchain. Then, when there is a management requirement, the management node can autonomously invoke the local management database to verify the received candidate blocks according to the predefined management rules in the management database.
  • the management rules in the above-mentioned management database can be updated through the database update technology in the related art; among them, the update operation of the management database can also be restricted by the identity of the operator, so as to ensure that only As mentioned above, the administrator can add, delete or modify the management rules in the management database.
  • the management rules may include valid management rules in a valid state and invalid management rules in an invalid state, which may be specifically determined according to status information of the management rules.
  • the management node verifies the blockchain transactions contained in the candidate block according to the management rules, it can select the effective management rules in the valid state for verification according to the state information of each management rule. Then, by configuring the status information of the management rules, the management rules that are expected to be used to verify the candidate blocks can be adjusted according to actual needs without frequent updates to the management rules, which helps to improve the verification efficiency. For example, a total of 100 management rules that may be used can be added in advance.
  • scenario 1 certain 10 management rules that need to be used can be set to valid status, and the rest of the management rules can be set to invalid status, so that they can be used in scenario 1. These 10 management rules are used to verify the candidate blocks.
  • scenario 2 if you need to replace 5 of the above 10 management rules with other management rules, you only need to set the original 5 management rules to an invalid state 1. Setting the other five management rules to the valid state can meet the verification requirements in Scenario 2 without repeatedly updating the management rules.
  • the state information corresponding to the management rule may include a valid time period and an invalid time period, so as to indicate whether the management rule is in a valid state or an invalid state by means of a time period.
  • the management node can determine the receiving time of the candidate block or read the time stamp contained in the candidate block, and match the above receiving time or time stamp with the valid time period corresponding to the management rule, if the above receiving time or the time stamp is within the effective time period of a certain management rule, it can be determined that the management rule is an effective management rule in an effective state, or, if the above-mentioned receiving time or time stamp is within the invalid time period of a certain management rule, Then it can be determined that the management rule is a failure management rule in a failure state.
  • the state information corresponding to the management rule may include a valid block height interval and an invalid block height interval, so as to indicate whether the management rule is in a valid state or an invalid state by means of the block height.
  • the management node can determine the block height of the candidate block, and match the above-mentioned block height with the effective height interval corresponding to the management rule. If the above-mentioned block height is within the effective height interval of a certain management rule, it can It is determined that the management rule is an effective management rule in an effective state, or, if the above-mentioned block height is within the invalid block height interval of a certain management rule, it can be determined that the management rule is an invalid management rule.
  • management rule A and management rule B are predefined in the management node.
  • Management rule A sets 1-10 as the effective block height interval
  • management rule B sets 11-20 as the effective block height interval.
  • the block height of the candidate block received by the management node is 15
  • the block height of the candidate block is within the effective block height interval of management rule B, but not within the effective block height interval of management rule A
  • management rule A is a management rule in an invalid state
  • the management node can select management rule B to verify the candidate block.
  • the management node can obtain the field values contained in the transactions that can be used for verification by parsing the blockchain transactions in the candidate blocks, so as to verify the field values according to the predefined management rules Verify.
  • Verify the field values contained in the transactions that can be used for verification by parsing the blockchain transactions in the candidate blocks.
  • the management rules for the specific manner of invoking the management rule, reference may be made to the relevant description above, which will not be repeated here.
  • the blockchain can be parsed transaction to extract the transaction content of its data field, and compare the extracted transaction content with each preset sensitive word in the management rules.
  • the blockchain can be determined If the transaction fails the verification, on the contrary, that is, when the transaction content does not match any preset sensitive words, it can be determined that the blockchain transaction has passed the verification of the management node.
  • the management rule is used to detect whether the to field of the blockchain transaction contains a predefined blacklist account
  • the blockchain transaction can be parsed to extract the transaction content of the to field, and the extracted transaction content can be compared with the management Each predefined blacklist account in the rules is compared.
  • the management node can also pre-execute the blockchain transaction in the candidate block, and verify the pre-execution result of the blockchain transaction, so that the block can be audited more strictly Content in the chain transaction that does not appear directly in the field value.
  • the management node when used to detect whether the contract state generated by the transaction contains preset sensitive words, it can pre-execute the blockchain transaction in the candidate block and read the execution result from the contract state maintained by the management node , compare the read execution result with each preset sensitive word in the management rules, and when the execution result does not match any sensitive word, it can be determined that the blockchain transaction has passed the verification of the management node.
  • the management node After the management node receives the candidate block that has passed the consensus, it can first analyze the blockchain transaction contained in the candidate block, and pre-verify the field values contained in the parsed transaction according to the predefined management rules, and then Pre-execute the blockchain transactions that pass the pre-verification, read the execution results from the contract state maintained by the management node, and verify the execution results according to the predefined management rules. For example, when the management rules are used to detect whether the transaction content of the blockchain transaction and the contract status value generated by the transaction contain preset sensitive words or not, the blockchain transaction can be first parsed to extract its data field transaction content, and compare the extracted transaction content with each preset sensitive word in the management rules.
  • Step 106 After confirming that all blockchain transactions contained in the candidate block comply with the management rules, trigger each bookkeeping node to record the candidate block as the blockchain account book maintained by itself of the latest block.
  • the management node when it determines that all the blockchain transactions in the received candidate block have passed the verification, it can send an uplink message to each accounting node in the blockchain system to which it belongs to indicate Each bookkeeping node records the candidate block as the latest block in the blockchain ledger maintained by itself.
  • the management node can transmit the above-mentioned uplink message through the consensus link established with each accounting node.
  • the "candidate block has passed the consensus" described in step 102 means that the consensus has been passed in the consensus algorithm such as the above, and the technical solution of this specification can be understood as based on these consensus algorithms
  • An additional verification process is added; or, it can also be understood as improving the consensus algorithm mentioned above, so that the improved consensus algorithm adds a verification process compared with the existing consensus algorithm.
  • the above-mentioned on-chain message can be regarded as a consensus message generated under the improved consensus algorithm.
  • the management node when the management node determines that all blockchain transactions in the received candidate block have passed the verification, it can use the private key corresponding to its account to sign the candidate block, and send the signed The candidate block is sent to each accounting node in the blockchain system to which it belongs. After each bookkeeping node receives the signed candidate block, it can verify the digital signature in the received candidate block according to the account public key corresponding to the management node.
  • the preset transaction execution conditions of each bookkeeping node If it is satisfied, the candidate block can be recorded as the latest block in the blockchain ledger maintained by itself. Among them, the transaction execution condition is pre-established by the blockchain system administrator according to the needs.
  • the transaction execution condition can be set to receive the candidate block signed by the management node ;
  • the transaction execution condition can be set to receive the number of candidate blocks signed by the management node is not less than the preset number, or receive the number of candidate blocks signed by the management node
  • the ratio of the number of candidate blocks to the total number of management nodes is not less than the preset ratio, etc., to avoid security risks that may arise when a single or a small number of management nodes are abnormal.
  • Step 108 When it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rules, trigger each bookkeeping node to abandon the candidate block.
  • the management node when it determines that there is a block chain transaction in the received candidate block that fails to pass the verification, it can send an abandonment message to each accounting node in the block chain system to which it belongs, to instruct each The accounting node abandons the candidate block.
  • the block abandonment message can be a block abandonment transaction sent on the chain, or a predefined message message sent off the chain, which is not limited in this manual.
  • the management node when the management node determines that there is a blockchain transaction in the received candidate block that fails to pass the verification, corresponding to the embodiment of sending the signed candidate block in step 106 above, the management node may not check the candidate block. Block any operation, avoid sending signed candidate blocks to each bookkeeping node, so that each bookkeeping node in the blockchain system cannot meet the preset transaction execution conditions, and still cannot satisfy the transaction after the preset time In the case of execution conditions, each bookkeeping node can give up the candidate block.
  • the management node when it determines that there are blockchain transactions that fail verification in the received candidate block, it can also re-submit the blockchain transactions that meet the management rules in the candidate block according to the verification result.
  • Package generate a new candidate block, and agree on it with other blockchain nodes in the blockchain system. For example, if the candidate block received by the management node includes transaction 1, transaction 2, and transaction 3, transaction 1 and transaction 2 have passed the verification management of the management node, but transaction 3 has not passed the verification management of the management node , then the management node can repackage transaction 1 and transaction 2 to generate a new candidate block. If the new candidate block passes the consensus, the management node can use the private key corresponding to its account to generate a new candidate block.
  • This manual sets up management nodes in the blockchain system, so that all candidate blocks packaged by accounting nodes must be verified by the management node before being recorded in the blockchain ledger. Only those that meet the preset management rules of the management node Candidate blocks can be recorded and executed by other blockchain nodes in the blockchain system, which can not only improve the security of blockchain transactions, but also effectively manage the data written on the chain to avoid non-compliance with management Required data is stored on-chain.
  • Fig. 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • the device includes a processor 402 , an internal bus 404 , a network interface 406 , a memory 408 and a non-volatile memory 410 , and of course may include hardware required by other services.
  • One or more embodiments of this specification may be implemented based on software, for example, the processor 402 reads a corresponding computer program from the non-volatile memory 410 into the memory 408 and executes it.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each A logic unit, which can also be a hardware or logic device.
  • the block management device can be applied to the device shown in FIG. 5 to realize the technical solution of this specification.
  • the block management device may include: a receiving unit 502 configured to receive the candidate block sent by the bookkeeping node in the blockchain system, and the candidate block is verified by the bookkeeping node for legality Several blockchain transactions are packaged, and the candidate block has passed the consensus.
  • the verification unit 504 is configured to verify the blockchain transactions included in the candidate block according to predefined management rules.
  • the first triggering unit 506 is configured to trigger each accounting node to record the candidate block as self-maintained in the case of confirming that all blockchain transactions contained in the candidate block comply with the management rules The latest block in the blockchain ledger.
  • the second triggering unit 508 is configured to trigger each accounting node to abandon the candidate block when it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rule.
  • the verifying the blockchain transactions contained in the candidate block according to the predefined management rules includes: calling the management contract pre-deployed at the management node of the blockchain to pass the management contract Governance rules predefined in verify the blockchain transactions contained in the candidate block.
  • the management contract includes a system contract deployed in the blockchain platform code running on the blockchain management node, and the calling of the management contract pre-deployed at the blockchain node includes: When the invocation conditions of the management contract are met, the management contract is invoked through a predefined interface recorded in the blockchain platform code; wherein, the invocation conditions of the management contract include: the candidate block passes the consensus .
  • the management rules are maintained in the contract code of the management contract, or in the contract state corresponding to the management contract.
  • the management contract is deployed at each blockchain node in the blockchain system through a contract deployment transaction; or, the management contract is a local contract deployed at the blockchain management node.
  • the management rules are maintained in the contract state corresponding to the management contract
  • the device further includes: an update unit 510 configured to call the management contract according to the received rule update transaction, so as to update the The value of the contract state is updated to the updated management rules carried in the rule update transaction.
  • the verifying the blockchain transaction included in the block according to the predefined management rules includes: calling the management database pre-deployed at the blockchain node to pass the pre-defined Define governance rules for validating blockchain transactions in said blocks.
  • the verifying the blockchain transactions contained in the candidate block according to the predefined management rules includes: parsing the blockchain transactions contained in the candidate blocks, and analyzing according to the predefined management rules to obtain Pre-check the field values contained in the transaction; and/or pre-execute the blockchain transaction, and verify the pre-execution result according to the predefined management rules.
  • the management rules are used to implement at least one of the following checks: whether the transaction content and/or the contract status value generated by the transaction contain preset sensitive words; whether the transaction amount exceeds the preset amount threshold; the transaction initiator Whether the account and/or the counterparty account is a preset blacklist account.
  • each bookkeeping node is triggered to record the candidate block as a block maintained by itself
  • the latest block in the chain ledger including: signing the candidate block after confirming that all blockchain transactions contained in the candidate block comply with the management rules;
  • the block is sent to each accounting node in the blockchain system, so that each accounting node records the candidate block as the latest in the blockchain ledger maintained by itself when the transaction execution conditions are met.
  • the transaction execution conditions include: the number of candidate blocks signed by the management node is not less than the preset number, or the number of candidate blocks signed by the management node is equal to the total number of management nodes The ratio is not less than the preset ratio.
  • triggering each bookkeeping node to abandon the candidate block includes: confirming that the candidate block If there is any blockchain transaction in the block that does not comply with the management rules, avoid sending signed candidate blocks to each accounting node.
  • each bookkeeping node is triggered to record the candidate block as a block maintained by itself The latest block in the chain account book, including: after confirming that all the blockchain transactions contained in the candidate block comply with the management rules, sending an upper Chain message, so that each bookkeeping node respectively records the candidate block as the latest block in the blockchain account book maintained by itself.
  • triggering each bookkeeping node to abandon the candidate block includes: confirming that the If there is any blockchain transaction in the candidate block that does not comply with the management rules, send an abandonment message to each accounting node in the blockchain system, so that each accounting node abandons the candidate area piece.
  • the device further includes: a packaging unit 512, configured to package the candidate block in compliance with the management rule if it is confirmed that there is any blockchain transaction in the candidate block All blockchain transactions governing rules to generate new candidate blocks.
  • a packaging unit 512 configured to package the candidate block in compliance with the management rule if it is confirmed that there is any blockchain transaction in the candidate block All blockchain transactions governing rules to generate new candidate blocks.
  • the sending unit 514 is configured to send the new candidate block to each bookkeeping node in the blockchain system, so that each bookkeeping node respectively records the new candidate block as a block maintained by itself The latest block in the ledger.
  • the device further includes: a consensus unit 516 configured to agree with each accounting node in the blockchain system on the new candidate block; wherein each accounting node determines the When the new candidate block passes the consensus, it is recorded as the latest block in the blockchain ledger maintained by itself.
  • a consensus unit 516 configured to agree with each accounting node in the blockchain system on the new candidate block; wherein each accounting node determines the When the new candidate block passes the consensus, it is recorded as the latest block in the blockchain ledger maintained by itself.
  • the verifying the blockchain transactions contained in the candidate block according to the predefined management rules includes: selecting an effective management rule in a valid state from the management rules according to the state information of each management rule ; Wherein, the state information includes a valid state and an invalid state; check the block chain transactions contained in the candidate block according to the effective management rules.
  • the any The management rule is determined to be in an effective state; and/or, at the current moment, it is in the invalidation period corresponding to any management rule, or the block height of the candidate block is in the invalidation block height corresponding to any management rule In the case of an interval, any one of the management rules is determined to be in an invalid state.
  • a typical implementing device is a computer, which may take the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, e-mail device, game control device, etc. desktops, tablets, wearables, or any combination of these.
  • a computer includes one or more processors (CPUs), input/output interfaces, network interfaces and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • Computer-readable media including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by computing devices.
  • computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may be used in one or more embodiments of the present specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of one or more embodiments of this specification, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word “if” as used herein may be interpreted as “at” or "when” or "in response to a determination.”

Abstract

One or more embodiments of the present description provide a block management method and apparatus, applied to a management node in a blockchain system. The method comprises: receiving a candidate block sent by an accounting node in a blockchain system, wherein the candidate block is obtained by packaging, by the accounting node, a plurality of blockchain transactions that have passed legitimacy verification, and the candidate block has passed consensus; checking the blockchain transactions comprised in the candidate block according to a predefined management rule; if it is determined that all blockchain transactions comprised in the candidate block meet the management rule, triggering each accounting node to respectively record the candidate block as a new block in a blockchain ledger maintained by the accounting node; and if it is determined that any blockchain transaction that does not meet the management rule is present in the candidate block, triggering each accounting node to abandon the candidate block.

Description

区块管理block management 技术领域technical field
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种区块管理方法及装置。One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a block management method and device.
背景技术Background technique
区块链技术,也被称之为分布式账本技术,是一种由若干台计算设备共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速地进行数据同步的特性,利用区块链技术来搭建去中心化系统,并在区块链的分布式数据库中收录各种执行程序进行自动执行,已在众多的领域中广泛地进行应用。Blockchain technology, also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database. Since blockchain technology has the characteristics of decentralization, openness and transparency, each computing device can participate in database records, and data synchronization between computing devices can be quickly performed, blockchain technology is used to build a decentralized system, and Various execution programs are included in the distributed database of the blockchain for automatic execution, which has been widely used in many fields.
在区块链的记账过程中,通常需要区块链节点对合法性验证通过的区块链交易进行共识,由基于区块链的共识算法所确定的记账节点将接收到的交易打包以生成候选区块,并将生成的候选区块或者该候选区块的区块头发送至其它节点设备进行共识验证。其它区块链节点在对接收到的候选区块或者该候选区块的区块头验证没有问题的情况下,可以直接执行该区块中的包含的交易。在区块链系统中,区块链交易的数据都会被保存在区块链上,当交易执行完毕后,区块链上就保存了无法篡改、不会丢失的交易凭证。这种存储信息不可篡改的特性,一方面可以使得链上数据更可靠可信,有效提高区块链交易的安全;但另一方面也会使得一些不符合管理需求的数据被存储在链上,无法被删除。In the accounting process of the blockchain, it is usually necessary for the blockchain nodes to reach a consensus on the blockchain transactions that have passed the legality verification, and the accounting nodes determined by the consensus algorithm based on the blockchain will package the received transactions as Generate a candidate block, and send the generated candidate block or the block header of the candidate block to other node devices for consensus verification. Other blockchain nodes can directly execute the transactions contained in the block when there is no problem in verifying the received candidate block or the block header of the candidate block. In the blockchain system, the data of the blockchain transaction will be stored on the blockchain. After the transaction is executed, the transaction certificate that cannot be tampered with and will not be lost is stored on the blockchain. This non-tamperable feature of stored information, on the one hand, can make the data on the chain more reliable and credible, effectively improving the security of blockchain transactions; but on the other hand, it will also make some data that does not meet the management requirements be stored on the chain. Cannot be deleted.
发明内容Contents of the invention
有鉴于此,本说明书一个或多个实施例提供一种区块管理方法及装置。In view of this, one or more embodiments of this specification provide a block management method and device.
具体的,本说明书一个或多个实施例提供技术方案如下:根据本说明书一个或多个实施例的第一方面,提出了一种区块管理方法,应用于区块链系统中的管理节点,包括:接收所述区块链系统中记账节点发送的候选区块,所述候选区块由所述记账节点对通过合法性验证的若干区块链交易进行打包得到,且所述候选区块已通过共识;根据预定义的管理规则校验所述候选区块中包含的区块链交易;在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块;在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块。Specifically, one or more embodiments of this specification provide the following technical solutions: According to the first aspect of one or more embodiments of this specification, a block management method is proposed, which is applied to a management node in a blockchain system, Including: receiving the candidate block sent by the bookkeeping node in the blockchain system, the candidate block is obtained by the bookkeeping node packaging a number of blockchain transactions that have passed the legality verification, and the candidate block The block has passed the consensus; the blockchain transactions contained in the candidate block are verified according to the predefined management rules; when it is confirmed that all the blockchain transactions contained in the candidate block comply with the management rules , trigger each bookkeeping node to record the candidate block as the latest block in the blockchain account book maintained by itself; after confirming that there is any blockchain transaction in the candidate block that does not comply with the management rules In this case, each accounting node is triggered to abandon the candidate block.
根据本说明书一个或多个实施例的第二方面,提出了一种区块管理装置,应用于区 块链系统中的管理节点,包括:接收单元,用于接收所述区块链系统中记账节点发送的候选区块,所述候选区块由所述记账节点对通过合法性验证的若干区块链交易进行打包得到,且所述候选区块已通过共识;校验单元,用于根据预定义的管理规则校验所述候选区块中包含的区块链交易;第一触发单元,用于在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块;第二触发单元,用于在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块。According to the second aspect of one or more embodiments of this specification, a block management device is proposed, which is applied to a management node in a blockchain system, including: a receiving unit, configured to receive The candidate block sent by the accounting node, the candidate block is obtained by the accounting node by packaging a number of blockchain transactions that have passed the legality verification, and the candidate block has passed the consensus; the verification unit is used for Verify the blockchain transactions contained in the candidate block according to predefined management rules; the first trigger unit is used to confirm that all blockchain transactions contained in the candidate block comply with the management rules In this case, each accounting node is triggered to record the candidate block as the latest block in the blockchain account book maintained by itself; the second trigger unit is used to confirm that there is any block in the candidate block In the case that the chain transaction does not comply with the management rules, each bookkeeping node is triggered to abandon the candidate block.
根据本说明书的第三方面,提供一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如上述第一方面的实施例中所述的方法。According to a third aspect of the present specification, there is provided an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein, the processor implements the above-mentioned first aspect by running the executable instructions The method described in the examples.
根据本说明书实施例的第四方面,提供一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如上述第一方面的实施例中所述方法的步骤。According to a fourth aspect of the embodiments of the present specification, there is provided a computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the above-mentioned embodiments of the first aspect are implemented.
由以上本说明书提供的技术方案可见,本说明书通过在区块链系统设置管理节点,使得记账节点打包的所有候选区块在被记录在区块链账本前都要经过管理节点的校验,只有符合管理节点的预设管理规则的候选区块才可以被区块链系统中的其他区块链节点记录并执行,从而不仅能够提高区块链交易的安全性,也能够对写入链上的数据进行有效管理,避免不符合管理需求的数据被存储在链上。It can be seen from the technical solutions provided in this manual above that by setting up management nodes in the blockchain system, all candidate blocks packaged by accounting nodes must be verified by management nodes before being recorded in the blockchain ledger. Only candidate blocks that meet the preset management rules of the management node can be recorded and executed by other blockchain nodes in the blockchain system, which can not only improve the security of blockchain transactions, but also be able to write to the chain Effectively manage the data to prevent data that does not meet the management requirements from being stored on the chain.
附图说明Description of drawings
图1是一示例性实施例提供的一种区块管理方法的示意图;Fig. 1 is a schematic diagram of a block management method provided by an exemplary embodiment;
图2是一示例性实施例提供的一种区块链系统的结构示意图;Fig. 2 is a schematic structural diagram of a block chain system provided by an exemplary embodiment;
图3是一示例性实施例提供的另一种区块链系统的结构流程图;Fig. 3 is a structural flow diagram of another block chain system provided by an exemplary embodiment;
图4是一示例性实施例提供的一种电子设备示意图;Fig. 4 is a schematic diagram of an electronic device provided by an exemplary embodiment;
图5是一示例性实施例提供的一种区块管理装置的框图。Fig. 5 is a block diagram of a block management device provided by an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. Implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with aspects of one or more embodiments of the present specification as recited in the appended claims.
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相 应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that in other embodiments, the steps of the corresponding methods may not necessarily be performed in the order shown and described in this specification. In some other embodiments, the method may include more or less steps than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; multiple steps described in this specification may also be combined into a single step in other embodiments describe.
在区块链系统中,区块链交易的数据都会被保存在区块链上,当交易执行完毕后,区块链上就保存了无法篡改、不会丢失的交易凭证。这种存储信息不可篡改的特性,一方面可以使得链上数据更可靠可信,有效提高区块链交易的安全;但另一方面也会使得一些不符合管理需求的数据被存储在链上,无法被删除。In the blockchain system, the data of the blockchain transaction will be stored on the blockchain. After the transaction is executed, the transaction certificate that cannot be tampered with and will not be lost is stored on the blockchain. This non-tamperable feature of stored information, on the one hand, can make the data on the chain more reliable and credible, effectively improving the security of blockchain transactions; but on the other hand, it will also make some data that does not meet the management requirements be stored on the chain. Cannot be deleted.
为了解决上述问题,本说明书提出了一种区块管理方法,在传统合法性验证以及共识验证的基础上进一步对待执行的区块链交易进行校验,以避免将不符合管理需求的数据存储到区块链上。In order to solve the above problems, this specification proposes a block management method, which further verifies the block chain transactions to be executed on the basis of traditional legality verification and consensus verification, so as to avoid storing data that does not meet management requirements in the on the blockchain.
图1为根据本说明书一示例性实施例示出的一种区块管理方法的流程图。如图1所示,该方法应用于区块链系统中的管理节点,可以包括如下步骤。Fig. 1 is a flow chart of a block management method according to an exemplary embodiment of this specification. As shown in Figure 1, the method is applied to the management node in the blockchain system, and may include the following steps.
步骤102:接收所述区块链系统中记账节点发送的候选区块,所述候选区块由所述记账节点对通过合法性验证的若干区块链交易进行打包得到,且所述候选区块已通过共识。Step 102: Receive the candidate block sent by the bookkeeping node in the blockchain system, the candidate block is obtained by the bookkeeping node packaging a number of blockchain transactions that have passed the legality verification, and the candidate block The block has passed consensus.
在本说明书的技术方案中,管理节点可以为设置在区块链系统中的一个或多个区块链节点,用于对该区块链系统上的区块链交易进行校验。在区块链系统同时具有多个管理节点的情况下,各个管理节点可以按照相同的管理规则对该区块链系统上的区块链交易进行校验,也可以按照不同的管理规则对该区块链系统上的区块链交易进行校验,本说明书对此不作限制。In the technical solution of this specification, the management node can be one or more blockchain nodes set in the blockchain system, and is used to verify the blockchain transactions on the blockchain system. In the case that the blockchain system has multiple management nodes at the same time, each management node can verify the blockchain transactions on the blockchain system according to the same management rules, and can also verify the blockchain transactions on the blockchain system according to different management rules. The blockchain transactions on the blockchain system are verified, and this specification does not limit this.
在区块管理过程中,区块链节点在接收到任一区块链交易后,首先需要对接收到区块链交易进行合法性验证。区块链交易的合法性验证通常可以通过验证签名有效性的方式来实现。当区块链采用账户模型时,该区块链所适用的账户通常对应有一组或多组公钥-私钥对,上述公钥可以被记录在相应的账户状态中,或以其他形式存储在区块链的分布式数据库中,且可被区块链系统中的任一节点设备获得。与上述公钥对应的私钥则保存在账户所有方的本地数据库或其他硬件终端中,以供账户所有方进行数字签名或加解密操作等。发起方所发起的区块链交易不仅包括交易内容,还包括该发起方采用其账户对应的私钥针对交易内容而作的数字签名。区块链节点在接收到区块链交易后,可以基于该区块链交易所含的数字签名对该区块链交易进行合法性验证。合法性验证通常可包括:验证数字签名是否基于该区块链交易的交易内容而获得(也称为完整性校验)等。 通过完整性校验,可以确保该区块链交易确实是由该公钥对应的用户所发起,且该交易在传输过程中未被篡改。在另一种情况下,发起方的公钥也可以被携带在CA中心向发起方颁发的CA证书中,当发起方发送区块链交易时,可以将通过CA中心私钥进行签名的CA证书一同发送给区块链节点,由区块链节点根据CA中心的公钥对CA证书的签名进行验证,在验证成功的情况下获取CA证书中所携带的发起方公钥。其中,CA中心为可以被区块链节点默认信任的权威机构,因而只要用CA中心的公钥成功对证书进行验签,即可确定证书中的公钥可信,使得区块链节点可以通过该公钥对接收到的区块链交易所含的数字签名进行合法性验证。通过对接收到的交易进行合法性验证,可以确定接收到的区块链交易在传输过程中没有被篡改,提高区块链交易的安全性。In the block management process, after a blockchain node receives any blockchain transaction, it first needs to verify the validity of the received blockchain transaction. The legality verification of blockchain transactions can usually be achieved by verifying the validity of signatures. When the blockchain adopts the account model, the applicable account of the blockchain usually corresponds to one or more sets of public key-private key pairs, and the above public keys can be recorded in the corresponding account status, or stored in other forms in the In the distributed database of the blockchain, it can be obtained by any node device in the blockchain system. The private key corresponding to the above public key is stored in the account owner's local database or other hardware terminals for the account owner to perform digital signature or encryption and decryption operations. The blockchain transaction initiated by the initiator includes not only the transaction content, but also the digital signature made by the initiator using the private key corresponding to the account for the transaction content. After the blockchain node receives the blockchain transaction, it can verify the legality of the blockchain transaction based on the digital signature contained in the blockchain transaction. Legality verification may generally include: verifying whether the digital signature is obtained based on the transaction content of the blockchain transaction (also called integrity verification), etc. Through the integrity check, it can be ensured that the blockchain transaction is indeed initiated by the user corresponding to the public key, and that the transaction has not been tampered with during transmission. In another case, the initiator's public key can also be carried in the CA certificate issued by the CA center to the initiator. When the initiator sends a blockchain transaction, the CA certificate signed by the CA center's private key can be Send it to the blockchain node together, and the blockchain node will verify the signature of the CA certificate according to the public key of the CA center, and obtain the initiator public key carried in the CA certificate if the verification is successful. Among them, the CA center is an authoritative organization that can be trusted by the blockchain nodes by default. Therefore, as long as the certificate is successfully verified with the public key of the CA center, it can be determined that the public key in the certificate is credible, so that the blockchain nodes can pass The public key verifies the legality of the digital signature contained in the received blockchain transaction. By verifying the legality of the received transaction, it can be determined that the received blockchain transaction has not been tampered with during transmission, which improves the security of the blockchain transaction.
在合法性验证通过的情况下,区块链系统中的记账节点可以将该区块链交易与其他合法性验证通过的交易打包以生成候选区块,并将生成的候选区块或者该候选区块的区块头发送至其它节点设备进行共识验证。区块链中支持的共识算法可以包括:第一类共识算法,即节点设备需要争夺每一轮的记账周期的记账权的共识算法;例如,工作量证明(Proof of Work,POW)、股权证明(Proof of Stake,POS)、委任权益证明(Delegated Proof of Stake,DPOS)等共识算法;第二类共识算法,即预先为每一轮记账周期选举记账节点(不需要争夺记账权)的共识算法;例如,实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)等共识算法。When the legality verification is passed, the bookkeeping node in the blockchain system can package the blockchain transaction with other transactions that have passed the legality verification to generate a candidate block, and the generated candidate block or the candidate The block header of the block is sent to other node devices for consensus verification. The consensus algorithms supported in the blockchain can include: the first type of consensus algorithm, that is, the consensus algorithm that node devices need to compete for the accounting rights of each round of accounting cycle; for example, proof of work (Proof of Work, POW), Consensus algorithms such as Proof of Stake (POS), Delegated Proof of Stake (DPOS) and other consensus algorithms; the second type of consensus algorithm is to pre-elect accounting nodes for each round of accounting cycle (no need to compete for accounting rights) consensus algorithm; for example, consensus algorithms such as Practical Byzantine Fault Tolerance (PBFT).
在采用第一类共识算法的区块链系统中,接收到区块链交易的区块链节点将合法性验证通过的区块链交易广播给区块链系统中的其他区块链节点。争夺记账权的节点设备可以在接收到交易后执行该笔交易,在本轮争夺记账权的过程中胜出的节点设备可以作为本轮的记账节点。由记账节点将接收到的交易与其它交易一起打包生成候选区块,并将生成的候选区块或者该候选区块的区块头发送至其它节点设备进行共识。In the blockchain system using the first type of consensus algorithm, the blockchain node that receives the blockchain transaction broadcasts the blockchain transaction that passes the legality verification to other blockchain nodes in the blockchain system. The node device competing for the bookkeeping right can execute the transaction after receiving the transaction, and the winning node device in the process of competing for the bookkeeping right in this round can serve as the bookkeeping node of the current round. The accounting node packs the received transaction together with other transactions to generate a candidate block, and sends the generated candidate block or the block header of the candidate block to other node devices for consensus.
在采用第二类共识算法的区块链系统中,具有记账权的节点设备在本轮记账前已经商定好。若接收到区块链交易的区块链节点为本轮的记账节点,则直接将接收到的交易与其他交易一起打包进候选区块,并将生成的候选区块或者该候选区块的区块头发送至其它节点设备进行共识;若接收到区块链交易的区块链节点自身不是本轮的记账节点,则可以将该区块链交易发送至本轮的记账节点,由记账节点将该区块链交易与其它交易一起打包生成候选区块,并将该候选区块或者该候选区块的区块头发送至其它节点设备进行共识。In the blockchain system that adopts the second type of consensus algorithm, the node equipment with bookkeeping rights has been agreed before the current round of bookkeeping. If the blockchain node that receives the blockchain transaction is the bookkeeping node of the current round, it will directly pack the received transaction together with other transactions into the candidate block, and the generated candidate block or the The block header is sent to other node devices for consensus; if the blockchain node that receives the blockchain transaction is not the bookkeeping node of the current round, the blockchain transaction can be sent to the bookkeeping node of the current round, and the bookkeeper The ledger node packages the blockchain transaction together with other transactions to generate a candidate block, and sends the candidate block or the block header of the candidate block to other node devices for consensus.
步骤104:根据预定义的管理规则校验所述候选区块中包含的区块链交易。Step 104: Verify the blockchain transactions included in the candidate block according to predefined management rules.
在相关技术中,区块链节点在接收到已通过共识的候选区块后,会默认该候选区块 中所包含的区块链交易不存在问题,区块链节点可以直接将该候选区块追加到自身维护的区块链的末端,以作为该区块链的最新区块。而在本说明书的技术方案中,候选区块在通过共识的基础上,还需要由区块链系统中的管理节点根据预定义的管理规则对该候选区块做进一步校验,并且只有当通过该进一步校验后该候选区块才能够被添加为最新区块,以防止该候选区块中包含存在风险的区块链交易,避免不符合管理规则的数据被保存到区块链上。In related technologies, after a blockchain node receives a candidate block that has passed the consensus, it will default that there is no problem with the blockchain transactions contained in the candidate block, and the blockchain node can directly use the candidate block Append to the end of the blockchain maintained by itself as the latest block of the blockchain. In the technical solution of this manual, on the basis of passing the consensus, the management node in the blockchain system needs to further verify the candidate block according to the predefined management rules, and only when it passes After this further verification, the candidate block can be added as the latest block, so as to prevent the candidate block from containing risky blockchain transactions, and avoid data that does not comply with management rules from being saved on the blockchain.
在本说明书的技术方案中,管理节点可以在确定接收到的候选区块通过共识的情况下,根据预定义的管理规则对该候选区块中的区块链交易进行校验管理。其中,管理规则的具体内容以及具体逻辑可以由本领域技术人员根据实际需要自行设置,举例而言,管理规则可以被设置为交易内容和/或交易产生的合约状态取值是否包含预设敏感词等;或者针对转账交易,管理规则可以被设置为交易数额是否超过预设数额阈值、交易发起方账户和/或交易对端账户是否为预设黑名单账户等;又或者针对智能合约调用交易,管理规则可以被设置为发起方账户是否具有合约调用权限等,本说明书对此不作限制。举例而言,若候选区块中的区块链交易为调用智能合约的交易,管理节点在确定该候选区块共识通过后调用管理规则解析得到该区块链交易中表示该交易的发起方账户的账户地址的From字段,例如为“Bob(0xf5e...)”,将该账户地址与预定义管理规则中的黑名单账户进行比对,若预定义管理规则的黑名单账户中存在账户地址“Bob(0xf5e...)”,则该区块链交易未通过该管理节点的校验,反之,则通过校验。又例如,若候选区块中的存在转账交易,管理节点在确定该候选区块共识通过后可以调用预定义管理规则,解析得到该区块链交易中表示交易发起者要向交易接收者转账的金额的value字段,将该交易金额与预定义管理规则中的预设交易金额阈值进行比对,若转账金额或者交易频率超过了预定义管理规则中的预设金额阈值,则该区块链交易未通过该管理节点的校验,反之,则通过校验。In the technical solution of this specification, the management node can verify and manage the blockchain transactions in the candidate block according to the predefined management rules when it is determined that the received candidate block has passed the consensus. Among them, the specific content and specific logic of the management rules can be set by those skilled in the art according to actual needs. For example, the management rules can be set as whether the transaction content and/or the contract status value generated by the transaction contains preset sensitive words, etc. ; or for transfer transactions, the management rules can be set to whether the transaction amount exceeds the preset amount threshold, whether the transaction initiator account and/or the transaction counterparty account is a preset blacklist account, etc.; or for smart contract call transactions, management The rules can be set as whether the originator account has the contract calling authority, etc. This manual does not limit this. For example, if the blockchain transaction in the candidate block is a transaction that invokes a smart contract, the management node will call the management rules to analyze and obtain the initiator account of the transaction in the blockchain transaction after confirming that the candidate block consensus is passed. The From field of the account address, for example, "Bob(0xf5e...)", compare the account address with the blacklist account in the predefined management rules, if there is an account address in the blacklist account of the predefined management rules "Bob(0xf5e...)", the blockchain transaction has not passed the verification of the management node, otherwise, it has passed the verification. For another example, if there is a transfer transaction in the candidate block, the management node can call the predefined management rules after confirming that the candidate block has passed the consensus, and analyze and obtain the block chain transaction indicating that the transaction initiator wants to transfer money to the transaction receiver. The value field of the amount compares the transaction amount with the preset transaction amount threshold in the predefined management rules. If the transfer amount or transaction frequency exceeds the preset amount threshold in the predefined management rules, the blockchain transaction If the verification of the management node is not passed, otherwise, the verification is passed.
进一步的,本说明书中的管理规则也并非固定不变,在有需要的情况下,可以在管理合约原有管理规则的基础上进行更新,比如增加新的管理规则、删除原有管理规则中的部分内容,或者也可以通过修改原有管理规则中的预设参数等方式修改原有的管理规则,举例而言,管理合约中的管理规则用于检查转账交易的交易金额是否处于预设金额范围以及交易的转账对象账户是否处于黑名单账户,可以通过更新该管理规则的方式,修改原有预设金额范围的取值、删除原有黑名单账户中的部分账户或者增加新的检查内容等。Furthermore, the management rules in this specification are not fixed. If necessary, they can be updated on the basis of the original management rules of the management contract, such as adding new management rules and deleting the original management rules. Part of the content, or the original management rules can be modified by modifying the preset parameters in the original management rules. For example, the management rules in the management contract are used to check whether the transaction amount of the transfer transaction is within the preset amount range And whether the transfer object account of the transaction is in the blacklist account, you can modify the value of the original preset amount range, delete some accounts in the original blacklist account, or add new inspection content by updating the management rules.
在本说明书中,管理节点中的预定义管理规则可以被维护在预先部署的管理合约中, 管理节点在接收到通过共识的候选区块时,可以调用预先部署在区块链管理节点处的管理合约,以通过管理合约中的预定义管理规则对候选区块中所包含的区块链交易进行校验。其中,管理合约可以为创世合约,即该管理合约在区块链系统的创建之初被部署在创世区块中。或者,该管理合约也可以为系统合约,需要由管理员进行部署,一些情况下可能需要超出预设比例的管理员的认可下才能够完成部署。当然,不排除一些情况下,可能由区块链系统的一般节点成员来部署管理合约,即管理合约可以为区别于创世合约与系统合约的普通合约。由于区块链节点本身是一种逻辑概念,通过在节点设备上创建一节点实例,并由该节点实例运行上述的区块链平台链代码,即可使得该节点实例成为一区块链节点。因此,区块链平台链代码是使得节点实例成为区块链节点的底层逻辑,管理合约可以部署于区块链管理节点上运行的区块链平台代码中,从而区块链节点在运行过程中可以直接执行区块链平台链代码,使得区块链节点可以通过区块链平台链代码中记录的预定义接口来主动触发对管理合约的调用,而无需像相关技术中那样由区块链交易来调用,从而简化管理合约的调用逻辑。In this specification, the predefined management rules in the management node can be maintained in the pre-deployed management contract. When the management node receives a candidate block that passes the consensus, it can invoke the management rules pre-deployed at the blockchain management node. Contract to verify the blockchain transactions contained in the candidate block through the predefined management rules in the management contract. Wherein, the management contract can be a genesis contract, that is, the management contract is deployed in the genesis block at the beginning of the creation of the blockchain system. Alternatively, the management contract can also be a system contract, which needs to be deployed by an administrator. In some cases, the deployment can only be completed with the approval of more than a preset ratio of administrators. Of course, it is not excluded that in some cases, the general node members of the blockchain system may deploy the management contract, that is, the management contract can be an ordinary contract that is different from the creation contract and the system contract. Since the blockchain node itself is a logical concept, by creating a node instance on the node device and running the above-mentioned blockchain platform chain code by the node instance, the node instance can become a blockchain node. Therefore, the blockchain platform chain code is the underlying logic that makes the node instance a blockchain node, and the management contract can be deployed in the blockchain platform code running on the blockchain management node, so that the blockchain node is running The chain code of the blockchain platform can be directly executed, so that the blockchain node can actively trigger the call to the management contract through the predefined interface recorded in the chain code of the blockchain platform, without the need for blockchain transactions as in related technologies to call, thus simplifying the call logic of the management contract.
在一实施例中,管理合约可以是被通过合约部署交易部署于区块链系统中的各区块链节点处的链上合约,如图2所示,区块链系统包括Node A、Node B、Node C和Node D等区块链节点,各个区块链节点中均部署有相同的管理合约。完成管理合约的部署后,任一区块链节点在接收到记账节点发送的候选区块时均可以调用本地部署的管理合约,以通过与该合约相关联的管理规则对候选区块进行管理检查。以图2所示的Node A为例,该节点可以在区块链系统中提交针对管理规则的合约部署交易,以由区块链系统中的各个区块链节点对该交易进行共识。在共识通过的情况下,由区块链系统中的各个区块链节点分别执行该交易,以在各个节点本地部署对应于管理规则的管理合约。上述区块链节点Node A可以为区块链系统中的管理节点或者非管理节点,本说明书并不对此进行限制。In one embodiment, the management contract can be an on-chain contract deployed at each blockchain node in the blockchain system through a contract deployment transaction. As shown in Figure 2, the blockchain system includes Node A, Node B, Blockchain nodes such as Node C and Node D have the same management contract deployed in each blockchain node. After the deployment of the management contract is completed, any blockchain node can call the locally deployed management contract when receiving the candidate block sent by the bookkeeping node to manage the candidate block through the management rules associated with the contract examine. Taking Node A shown in Figure 2 as an example, this node can submit a contract deployment transaction for management rules in the blockchain system, so that each blockchain node in the blockchain system can reach a consensus on the transaction. When the consensus is passed, each blockchain node in the blockchain system executes the transaction respectively, so as to locally deploy the management contract corresponding to the management rules on each node. The above-mentioned blockchain node Node A can be a management node or a non-management node in the blockchain system, and this specification does not limit it.
在另一实施例中,管理合约也可以是仅被部署于管理节点处的本地合约,该本地合约仅部署于管理节点处,而无需部署至区块链系统中的其他区块链节点处。如图3所示,区块链系统包括Node A、Node B、Node C和Node D等区块链节点,作为管理节点的Node A本地部署有管理合约,而其他节点(Node B、Node C和/或Node D)处并不部署管理合约。其中,除Node A之外的任一区块链节点可以为管理节点,当然也可以为非管理节点,本说明书并不对此进行限制。可以理解的是,Node A可以执行合约部署交易实现对管理合约的部署,该交易可以为无需共识的本地区块链交易。例如,Node A在接收到合约部署交易后,无需发起针对该交易的共识,而可以直接执行该交易以在本 地部署相应的管理合约。可见,虽然区块链系统中包含多个区块链节点,但是仅有其中的管理节点本地被部署有上述管理合约,而非管理节点并不部署该合约,所以部署过程较为简单。另外,因为上述管理合约的部署过程无需共识,所以能够实现对管理合约的快速部署,也便于实现对数据管理规则的便捷更新。In another embodiment, the management contract may also be a local contract that is only deployed on the management node, and the local contract is only deployed on the management node, and does not need to be deployed to other blockchain nodes in the blockchain system. As shown in Figure 3, the blockchain system includes blockchain nodes such as Node A, Node B, Node C, and Node D. As the management node, Node A locally deploys a management contract, while other nodes (Node B, Node C, and /or Node D) does not deploy the management contract. Among them, any blockchain node other than Node A can be a management node, and of course it can also be a non-management node, which is not limited in this manual. It is understandable that Node A can execute a contract deployment transaction to implement the deployment of the management contract, and the transaction can be a local blockchain transaction that does not require consensus. For example, after Node A receives a contract deployment transaction, it does not need to initiate a consensus on the transaction, but can directly execute the transaction to deploy the corresponding management contract locally. It can be seen that although the blockchain system contains multiple blockchain nodes, only the management nodes among them are locally deployed with the above-mentioned management contract, while the non-management nodes do not deploy the contract, so the deployment process is relatively simple. In addition, because the deployment process of the above-mentioned management contract does not require consensus, it can realize the rapid deployment of the management contract and facilitate the convenient update of the data management rules.
根据管理规则被记录的位置不同,区块链节点可以采用不同的方式更新管理规则。当管理规则被维护于管理合约的合约代码中时,区块链节点可以执行规则更新交易以部署新的管理合约,该新的管理合约的合约代码或者合约状态中记录有新的管理规则。在部署完成后,区块链节点处可以调用新管理合约对候选区块进行管理检查。当管理规则被维护于管理合约的合约状态时,如果需要对管理规则进行更新,区块链节点可以发起针对管理规则的更新交易,将上述管理合约的合约状态的取值更新为新的管理规则,而无需对管理合约进行重新部署。需要注意的是,管理规则的更新交易可以仅允许由区块链系统的管理员发起,譬如该管理员可以为管理节点对应的区块链成员,而避免将管理规则的更新权限开放给普通用户,以防止由此导致的安全性问题。According to the location where the management rules are recorded, the blockchain nodes can update the management rules in different ways. When the management rules are maintained in the contract code of the management contract, the blockchain node can execute a rule update transaction to deploy a new management contract, and the new management rules are recorded in the contract code or contract state of the new management contract. After the deployment is complete, the blockchain node can call the new management contract to perform management checks on the candidate blocks. When the management rules are maintained in the contract state of the management contract, if the management rules need to be updated, the blockchain node can initiate an update transaction for the management rules, and update the value of the contract state of the above management contract to the new management rules , without redeploying the management contract. It should be noted that the update transaction of the management rules can only be initiated by the administrator of the blockchain system. For example, the administrator can be a member of the blockchain corresponding to the management node, and avoid opening the update authority of the management rules to ordinary users. , to prevent security issues caused by this.
在本说明书中,管理节点中的预定义管理规则也可以被维护在数据库中,而与区块链上部署的管理合约无关。那么,当存在管理需求时,管理节点可以通过自主调用本地的管理数据库,以根据该管理数据库中的预定义管理规则校验接收到的候选区块。当管理规则需要更新时,可以通过相关技术中的数据库更新技术,对上述管理数据库中的管理规则进行更新;其中,对管理数据库的更新操作,同样可以通过对操作者进行身份限制,从而确保只有如前所述的管理员能够增加、删除或者修改管理数据库中的管理规则。In this specification, the predefined management rules in the management node can also be maintained in the database, regardless of the management contract deployed on the blockchain. Then, when there is a management requirement, the management node can autonomously invoke the local management database to verify the received candidate blocks according to the predefined management rules in the management database. When the management rules need to be updated, the management rules in the above-mentioned management database can be updated through the database update technology in the related art; among them, the update operation of the management database can also be restricted by the identity of the operator, so as to ensure that only As mentioned above, the administrator can add, delete or modify the management rules in the management database.
管理规则可以包括处于有效状态的有效管理规则和处于失效状态的失效管理规则,具体可以根据管理规则的状态信息进行判断。管理节点在根据管理规则校验候选区块中所包含的区块链交易时,可以根据各管理规则的状态信息,选取处于有效状态的有效管理规则进行校验。那么,通过对管理规则的状态信息进行配置,可以在不需要对管理规则进行频繁更新的情况下,根据实际需求调整希望用于校验候选区块的管理规则,有助于提升校验效率。譬如,可以预先添加所有可能使用到的管理规则共100条,在场景1下可以将需要使用的某10条管理规则设置为有效状态、其余管理规则设置为无效状态,使得在场景1下可以使用这10条管理规则来校验候选区块,而在场景2下如果需要将上述10条管理规则中的5条换成另外的管理规则,只需要将原有的5条管理规则设置为无效状态、将另外5条管理规则设置为有效状态,即可满足场景2下的校验需求,而无需反复更新管理规则。The management rules may include valid management rules in a valid state and invalid management rules in an invalid state, which may be specifically determined according to status information of the management rules. When the management node verifies the blockchain transactions contained in the candidate block according to the management rules, it can select the effective management rules in the valid state for verification according to the state information of each management rule. Then, by configuring the status information of the management rules, the management rules that are expected to be used to verify the candidate blocks can be adjusted according to actual needs without frequent updates to the management rules, which helps to improve the verification efficiency. For example, a total of 100 management rules that may be used can be added in advance. In scenario 1, certain 10 management rules that need to be used can be set to valid status, and the rest of the management rules can be set to invalid status, so that they can be used in scenario 1. These 10 management rules are used to verify the candidate blocks. In scenario 2, if you need to replace 5 of the above 10 management rules with other management rules, you only need to set the original 5 management rules to an invalid state 1. Setting the other five management rules to the valid state can meet the verification requirements in Scenario 2 without repeatedly updating the management rules.
例如,管理规则对应的状态信息可以包括有效时间段和失效时间段,从而通过时间 段的方式来表征管理规则处于有效状态或无效状态。管理节点可以确定对候选区块的接收时刻或者读取该候选区块所含的时间戳,并将上述的接收时刻或时间戳与管理规则所对应的有效时间段进行匹配,若上述的接收时刻或时间戳处于某一管理规则的有效时间段内,则可以确定该管理规则为处于有效状态的有效管理规则,或者,若上述的接收时刻或时间戳处于某一管理规则的失效时间段内,则可以确定该管理规则为处于失效状态的失效管理规则。For example, the state information corresponding to the management rule may include a valid time period and an invalid time period, so as to indicate whether the management rule is in a valid state or an invalid state by means of a time period. The management node can determine the receiving time of the candidate block or read the time stamp contained in the candidate block, and match the above receiving time or time stamp with the valid time period corresponding to the management rule, if the above receiving time or the time stamp is within the effective time period of a certain management rule, it can be determined that the management rule is an effective management rule in an effective state, or, if the above-mentioned receiving time or time stamp is within the invalid time period of a certain management rule, Then it can be determined that the management rule is a failure management rule in a failure state.
再例如,管理规则对应的状态信息可以包括有效区块高度区间和失效区块高度区间,从而通过区块高度的方式来表征管理规则处于有效状态或无效状态。管理节点可以确定候选区块的区块高度,并将上述的区块高度与管理规则所对应的有效高度区间进行匹配,若上述的区块高度处于某一管理规则的有效高度区间内,则可以确定该管理规则为处于有效状态的有效管理规则,或者,若上述的区块高度处于某一管理规则的失效区块高度区间内,则可以确定该管理规则为处于失效的失效管理规则。举例而言,管理节点中预定义有管理规则A和管理规则B,管理规则A将1~10设置为有效区块高度区间,管理规则B将11~20设置为有效区块高度区间。当管理节点接收到的候选区块的区块高度为15时,该候选区块的区块高度处于管理规则B的有效区块高度区间内,而未处于管理规则A的有效区块高度区间内,则可以确定管理规则B为处于有效状态的管理规则,而管理规则A为处于失效状态的管理规则,管理节点可以选择管理规则B对该候选区块进行校验。For another example, the state information corresponding to the management rule may include a valid block height interval and an invalid block height interval, so as to indicate whether the management rule is in a valid state or an invalid state by means of the block height. The management node can determine the block height of the candidate block, and match the above-mentioned block height with the effective height interval corresponding to the management rule. If the above-mentioned block height is within the effective height interval of a certain management rule, it can It is determined that the management rule is an effective management rule in an effective state, or, if the above-mentioned block height is within the invalid block height interval of a certain management rule, it can be determined that the management rule is an invalid management rule. For example, management rule A and management rule B are predefined in the management node. Management rule A sets 1-10 as the effective block height interval, and management rule B sets 11-20 as the effective block height interval. When the block height of the candidate block received by the management node is 15, the block height of the candidate block is within the effective block height interval of management rule B, but not within the effective block height interval of management rule A , it can be determined that management rule B is a management rule in a valid state, and management rule A is a management rule in an invalid state, and the management node can select management rule B to verify the candidate block.
在上述的校验过程中,管理节点可以通过解析候选区块中的区块链交易,获取交易中包含的能够用于进行校验的字段值,以根据预定义的管理规则对所述字段值进行校验。其中,调用管理规则的具体方式可以参考上述相关描述,此处不再赘述。通过将该待检测数据与管理规则中的预设数据进行比对,例如,当管理规则用于检测区块链交易的data字段包含的交易内容是否包含预设敏感词时,可以解析区块链交易以提取其data字段的交易内容,并将提取到的交易内容与管理规则中的各个预设敏感词进行比对,当交易内容匹配于任一预设敏感词时,可以判定该区块链交易未通过校验,反之,即交易内容不匹配于任何预设敏感词时,则可以判定该区块链交易通过了管理节点的校验。再例如,当管理规则用于检测区块链交易的to字段是否包含预定义的黑名单账户时,可以解析区块链交易以提取其to字段的交易内容,并将提取到的交易内容与管理规则中的各个预定义的黑名单账户进行比对,当交易内容匹配于任一预定义的黑名单账户时,可以判定该区块链交易未通过校验,反之,即交易内容不匹配于任一预定义的黑名单账户时,则可以判定该区块链交易通过了管理节点的校验。In the above verification process, the management node can obtain the field values contained in the transactions that can be used for verification by parsing the blockchain transactions in the candidate blocks, so as to verify the field values according to the predefined management rules Verify. Wherein, for the specific manner of invoking the management rule, reference may be made to the relevant description above, which will not be repeated here. By comparing the data to be detected with the preset data in the management rules, for example, when the management rules are used to detect whether the transaction content contained in the data field of the blockchain transaction contains preset sensitive words, the blockchain can be parsed transaction to extract the transaction content of its data field, and compare the extracted transaction content with each preset sensitive word in the management rules. When the transaction content matches any preset sensitive word, the blockchain can be determined If the transaction fails the verification, on the contrary, that is, when the transaction content does not match any preset sensitive words, it can be determined that the blockchain transaction has passed the verification of the management node. For another example, when the management rule is used to detect whether the to field of the blockchain transaction contains a predefined blacklist account, the blockchain transaction can be parsed to extract the transaction content of the to field, and the extracted transaction content can be compared with the management Each predefined blacklist account in the rules is compared. When the transaction content matches any predefined blacklist account, it can be determined that the blockchain transaction has not passed the verification, otherwise, the transaction content does not match any When there is a predefined blacklist account, it can be determined that the blockchain transaction has passed the verification of the management node.
除了对交易中包含的字段值进行校验外,管理节点也可以对候选区块中的区块链交易进行预执行,校验区块链交易的预执行结果,从而能够更加严格的审核区块链交易中未直接显示在字段值中的内容。举例而言,当管理节点用于检测交易产生的合约状态中是否包含预设敏感词时,可以预执行候选区块中的区块链交易,并从管理节点维护的合约状态中读取执行结果,将读取到的执行结果与管理规则中的各个预设敏感词进行比对,当执行结果不匹配于任一敏感词时,则可以判定该区块链交易通过了管理节点的校验。In addition to verifying the field values contained in the transaction, the management node can also pre-execute the blockchain transaction in the candidate block, and verify the pre-execution result of the blockchain transaction, so that the block can be audited more strictly Content in the chain transaction that does not appear directly in the field value. For example, when the management node is used to detect whether the contract state generated by the transaction contains preset sensitive words, it can pre-execute the blockchain transaction in the candidate block and read the execution result from the contract state maintained by the management node , compare the read execution result with each preset sensitive word in the management rules, and when the execution result does not match any sensitive word, it can be determined that the blockchain transaction has passed the verification of the management node.
进一步的,也可以将上述针对交易中所包含的字段值的校验与针对交易执行结果的校验相结合。管理节点在接收到共识通过的候选区块后,可以先解析该候选区块中包含的区块链交易,根据预定义的管理规则对解析得到的交易中包含的字段值进行预校验,再预执行预校验通过的区块链交易,从管理节点维护的合约状态中读取执行结果,并根据预定义的管理规则对所述执行结果进行校验。例如,当管理规则用于检测区块链交易的交易内容和交易产生的合约状态取值是否包含预设敏感词是否包含预设敏感词时,可以先解析区块链交易以提取其data字段的交易内容,并将提取到的交易内容与管理规则中的各个预设敏感词进行比对,当交易内容匹配于任一预设敏感词时,可以判定该区块链交易未通过校验,反之,即交易内容不匹配于任何预设敏感词时,则需要预执行该区块链交易以读取其执行结果,并将读取到的执行结果与管理规则中的各个预设敏感词进行比对,当执行结果匹配于任一预设敏感词时,可以判定该区块链交易未通过校验,反之,即执行结果不匹配于任何预设敏感词时,则可以判定该区块链交易通过了管理节点的校验。通过对候选区块中的区块链交易进行两步校验,可以在对区块链交易进行严格校验的同时,避免执行未通过预校验的区块链交易,从而减少计算资源的浪费,提高校验效率。Furthermore, the above verification of the field values contained in the transaction can also be combined with the verification of the transaction execution result. After the management node receives the candidate block that has passed the consensus, it can first analyze the blockchain transaction contained in the candidate block, and pre-verify the field values contained in the parsed transaction according to the predefined management rules, and then Pre-execute the blockchain transactions that pass the pre-verification, read the execution results from the contract state maintained by the management node, and verify the execution results according to the predefined management rules. For example, when the management rules are used to detect whether the transaction content of the blockchain transaction and the contract status value generated by the transaction contain preset sensitive words or not, the blockchain transaction can be first parsed to extract its data field transaction content, and compare the extracted transaction content with each preset sensitive word in the management rules. When the transaction content matches any preset sensitive word, it can be determined that the blockchain transaction has not passed the verification, otherwise , that is, when the transaction content does not match any preset sensitive words, it is necessary to pre-execute the blockchain transaction to read its execution result, and compare the read execution result with each preset sensitive word in the management rules Yes, when the execution result matches any of the preset sensitive words, it can be determined that the blockchain transaction has not passed the verification. Conversely, when the execution result does not match any of the preset sensitive words, it can be determined that the blockchain transaction Passed the verification of the management node. Through the two-step verification of the blockchain transactions in the candidate block, it is possible to strictly verify the blockchain transactions while avoiding the execution of blockchain transactions that have not passed the pre-verification, thereby reducing the waste of computing resources , improve the verification efficiency.
步骤106:在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块。Step 106: After confirming that all blockchain transactions contained in the candidate block comply with the management rules, trigger each bookkeeping node to record the candidate block as the blockchain account book maintained by itself of the latest block.
在一实施例中,当管理节点确定接收到的候选区块中的所有区块链交易均通过校验时,可以向其所属区块链系统中的各记账节点发送上链消息,以指示各记账节点分别将该候选区块记录为自身维护的区块链账本中的最新区块。管理节点可以通过与各记账节点之间建立的共识链路,对上述的上链消息进行传输。实际上,在步骤102中所描述的“候选区块已通过共识”是指已经在诸如前文所述的共识算法中通过了共识,而本说明书的技术方案可以理解为在这些共识算法的基础上额外增加了一个校验过程;或者,也可以理解为是对前文所述的共识算法进行改进,使得改进后的共识算法相比于现有的共识算法而言增加了一个校验过程,此时可以将上述的上链消息视为改进后的共识算法下 产生的共识消息。In one embodiment, when the management node determines that all the blockchain transactions in the received candidate block have passed the verification, it can send an uplink message to each accounting node in the blockchain system to which it belongs to indicate Each bookkeeping node records the candidate block as the latest block in the blockchain ledger maintained by itself. The management node can transmit the above-mentioned uplink message through the consensus link established with each accounting node. In fact, the "candidate block has passed the consensus" described in step 102 means that the consensus has been passed in the consensus algorithm such as the above, and the technical solution of this specification can be understood as based on these consensus algorithms An additional verification process is added; or, it can also be understood as improving the consensus algorithm mentioned above, so that the improved consensus algorithm adds a verification process compared with the existing consensus algorithm. At this time The above-mentioned on-chain message can be regarded as a consensus message generated under the improved consensus algorithm.
在一实施例中,当管理节点确定接收到的候选区块中的所有区块链交易均通过校验时,可以采用其账户对应的私钥对该候选区块进行签名,并将签名后的候选区块发送给所属区块链系统中的各记账节点。各记账节点在接收到签名后的候选区块后,可以根据该管理节点对应的账户公钥对接收到的候选区块中的数字签名进行验证,在各记账节点的预设交易执行条件被满足的情况下可以分别将所述候选区块记录为自身维护的区块链账本中的最新区块。其中,交易执行条件由区块链系统管理员根据需要预先建立,例如,当区块链系统中只有一个管理节点时,可以将交易执行条件设置为接收到由该管理节点签名后的候选区块;再例如,当区块链系统中有多个管理节点时,可以将交易执行条件设置为接收到由管理节点签名的候选区块的数量不少于预设数量,或接收到由管理节点签名的候选区块的数量与管理节点的总数量之比不小于预设比例等,以避免单个或少数管理节点发生异常的情况下可能产生的安全性风险。In one embodiment, when the management node determines that all blockchain transactions in the received candidate block have passed the verification, it can use the private key corresponding to its account to sign the candidate block, and send the signed The candidate block is sent to each accounting node in the blockchain system to which it belongs. After each bookkeeping node receives the signed candidate block, it can verify the digital signature in the received candidate block according to the account public key corresponding to the management node. The preset transaction execution conditions of each bookkeeping node If it is satisfied, the candidate block can be recorded as the latest block in the blockchain ledger maintained by itself. Among them, the transaction execution condition is pre-established by the blockchain system administrator according to the needs. For example, when there is only one management node in the blockchain system, the transaction execution condition can be set to receive the candidate block signed by the management node ;For another example, when there are multiple management nodes in the blockchain system, the transaction execution condition can be set to receive the number of candidate blocks signed by the management node is not less than the preset number, or receive the number of candidate blocks signed by the management node The ratio of the number of candidate blocks to the total number of management nodes is not less than the preset ratio, etc., to avoid security risks that may arise when a single or a small number of management nodes are abnormal.
步骤108:在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块。Step 108: When it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rules, trigger each bookkeeping node to abandon the candidate block.
在一实施例中,当管理节点确定接收到的候选区块中存在区块链交易未通过校验时,可以向其所属区块链系统中的各记账节点发送弃块消息,以指示各记账节点放弃该候选区块。其中,弃块消息可以是在链上发送的弃块交易,也可以是在链下发送的预定义消息报文,本说明书对此不作限制。In one embodiment, when the management node determines that there is a block chain transaction in the received candidate block that fails to pass the verification, it can send an abandonment message to each accounting node in the block chain system to which it belongs, to instruct each The accounting node abandons the candidate block. Among them, the block abandonment message can be a block abandonment transaction sent on the chain, or a predefined message message sent off the chain, which is not limited in this manual.
在一实施例中,当管理节点确定接收到的候选区块中存在区块链交易未通过校验时,对应于上述步骤106中发送签名后的候选区块的实施例,管理节点可以不对候选区块进行任何操作,避免向各记账节点发送经过签名的候选区块,使得区块链系统中的各记账节点无法满足预设的交易执行条件,在超过预设时长后仍无法满足交易执行条件的情况下,各个记账节点可以放弃该候选区块。In an embodiment, when the management node determines that there is a blockchain transaction in the received candidate block that fails to pass the verification, corresponding to the embodiment of sending the signed candidate block in step 106 above, the management node may not check the candidate block. Block any operation, avoid sending signed candidate blocks to each bookkeeping node, so that each bookkeeping node in the blockchain system cannot meet the preset transaction execution conditions, and still cannot satisfy the transaction after the preset time In the case of execution conditions, each bookkeeping node can give up the candidate block.
在一实施例中,当管理节点确定接收到的候选区块中存在未通过校验的区块链交易时,还可以根据校验结果,将候选区块中符合管理规则的区块链交易重新打包,生成新的候选区块,并与区块链系统中的其他区块链节点对其进行共识。举例而言,若管理节点接收到的候选区块中包含交易1、交易2、交易3,其中交易1与交易2通过了管理节点的校验管理,而交易3未通过管理节点的校验管理,则该管理节点可以将交易1与交易2重新打包,生成新的候选区块,在该新的候选区块通过共识的情况下,管理节点可以采用其账户对应的私钥对该候选区块进行签名,并将签名后的候选区块发送给所属区块链系统中的各记账节点,以使各记账节点在交易执行条件被满足的情况下分别将所述 候选区块记录为自身维护的区块链账本中的最新区块,其中对新的候选区块进行共识以及签名的具体步骤可以参考上述的相关描述,本说明书在此不作赘述。通过由管理节点重新打包生成新的候选区块,相比于由其他记账节点重新选取区块链交易、打包生成候选区块而言,可以具有更高的区块生成效率。In one embodiment, when the management node determines that there are blockchain transactions that fail verification in the received candidate block, it can also re-submit the blockchain transactions that meet the management rules in the candidate block according to the verification result. Package, generate a new candidate block, and agree on it with other blockchain nodes in the blockchain system. For example, if the candidate block received by the management node includes transaction 1, transaction 2, and transaction 3, transaction 1 and transaction 2 have passed the verification management of the management node, but transaction 3 has not passed the verification management of the management node , then the management node can repackage transaction 1 and transaction 2 to generate a new candidate block. If the new candidate block passes the consensus, the management node can use the private key corresponding to its account to generate a new candidate block. Sign, and send the signed candidate block to each bookkeeping node in the blockchain system to which it belongs, so that each bookkeeping node records the candidate block as its own when the transaction execution conditions are met For the latest block in the maintained blockchain ledger, the specific steps for consensus and signature of the new candidate block can refer to the relevant description above, and this manual will not repeat them here. By repackaging and generating new candidate blocks by the management node, compared with re-selecting blockchain transactions and packaging to generate candidate blocks by other bookkeeping nodes, it can have higher block generation efficiency.
本说明书通过在区块链系统设置管理节点,使得记账节点打包的所有候选区块在被记录在区块链账本前都要经过管理节点的校验,只有符合管理节点的预设管理规则的候选区块才可以被区块链系统中的其他区块链节点记录并执行,从而不仅能够提高区块链交易的安全性,也能够对写入链上的数据进行有效管理,避免不符合管理需求的数据被存储在链上。This manual sets up management nodes in the blockchain system, so that all candidate blocks packaged by accounting nodes must be verified by the management node before being recorded in the blockchain ledger. Only those that meet the preset management rules of the management node Candidate blocks can be recorded and executed by other blockchain nodes in the blockchain system, which can not only improve the security of blockchain transactions, but also effectively manage the data written on the chain to avoid non-compliance with management Required data is stored on-chain.
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他业务所需要的硬件。本说明书一个或多个实施例可以基于软件方式来实现,比如由处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Fig. 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 4 , at the hardware level, the device includes a processor 402 , an internal bus 404 , a network interface 406 , a memory 408 and a non-volatile memory 410 , and of course may include hardware required by other services. One or more embodiments of this specification may be implemented based on software, for example, the processor 402 reads a corresponding computer program from the non-volatile memory 410 into the memory 408 and executes it. Of course, in addition to software implementations, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each A logic unit, which can also be a hardware or logic device.
请参考图5,区块管理装置可以应用于如图5所示的设备中,以实现本说明书的技术方案。其中,该区块管理装置可以包括:接收单元502,被配置为接收所述区块链系统中记账节点发送的候选区块,所述候选区块由所述记账节点对通过合法性验证的若干区块链交易进行打包得到,且所述候选区块已通过共识。Please refer to FIG. 5 , the block management device can be applied to the device shown in FIG. 5 to realize the technical solution of this specification. Wherein, the block management device may include: a receiving unit 502 configured to receive the candidate block sent by the bookkeeping node in the blockchain system, and the candidate block is verified by the bookkeeping node for legality Several blockchain transactions are packaged, and the candidate block has passed the consensus.
校验单元504,被配置为根据预定义的管理规则校验所述候选区块中包含的区块链交易。The verification unit 504 is configured to verify the blockchain transactions included in the candidate block according to predefined management rules.
第一触发单元506,被配置为在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块。The first triggering unit 506 is configured to trigger each accounting node to record the candidate block as self-maintained in the case of confirming that all blockchain transactions contained in the candidate block comply with the management rules The latest block in the blockchain ledger.
第二触发单元508,被配置为在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块。The second triggering unit 508 is configured to trigger each accounting node to abandon the candidate block when it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rule.
可选的,所述根据预定义的管理规则校验所述候选区块中包含的区块链交易包括:调用预先部署在所述区块链管理节点处的管理合约,以通过所述管理合约中预定义的管理规则校验所述候选区块中包含的区块链交易。Optionally, the verifying the blockchain transactions contained in the candidate block according to the predefined management rules includes: calling the management contract pre-deployed at the management node of the blockchain to pass the management contract Governance rules predefined in verify the blockchain transactions contained in the candidate block.
可选的,所述管理合约包括部署于所述区块链管理节点上运行的区块链平台代码中 的系统合约,所述调用预先部署在所述区块链节点处的管理合约包括:在管理合约的调用条件被满足的情况下,通过记录于所述区块链平台代码中的预定义接口调用所述管理合约;其中,所述管理合约的调用条件包括:所述候选区块通过共识。Optionally, the management contract includes a system contract deployed in the blockchain platform code running on the blockchain management node, and the calling of the management contract pre-deployed at the blockchain node includes: When the invocation conditions of the management contract are met, the management contract is invoked through a predefined interface recorded in the blockchain platform code; wherein, the invocation conditions of the management contract include: the candidate block passes the consensus .
可选的,所述管理规则被维护于所述管理合约的合约代码中,或者所述管理合约对应的合约状态中。Optionally, the management rules are maintained in the contract code of the management contract, or in the contract state corresponding to the management contract.
可选的,所述管理合约被通过合约部署交易部署于所述区块链系统中的各区块链节点处;或者,所述管理合约为部署于所述区块链管理节点处的本地合约。Optionally, the management contract is deployed at each blockchain node in the blockchain system through a contract deployment transaction; or, the management contract is a local contract deployed at the blockchain management node.
可选的,所述管理规则被维护于所述管理合约对应的合约状态中,所述装置还包括:更新单元510,被配置为根据接收到的规则更新交易调用所述管理合约,以将所述合约状态的取值更新为所述规则更新交易携带的更新后的管理规则。Optionally, the management rules are maintained in the contract state corresponding to the management contract, and the device further includes: an update unit 510 configured to call the management contract according to the received rule update transaction, so as to update the The value of the contract state is updated to the updated management rules carried in the rule update transaction.
可选的,所述根据预定义管理规则校验所述区块中包含的区块链交易包括:调用预先部署在所述区块链节点处的管理数据库,以通过所述管理数据库中的预定义管理规则校验所述区块中的区块链交易。Optionally, the verifying the blockchain transaction included in the block according to the predefined management rules includes: calling the management database pre-deployed at the blockchain node to pass the pre-defined Define governance rules for validating blockchain transactions in said blocks.
可选的,所述根据预定义管理规则校验所述候选区块中包含的区块链交易包括:解析所述候选区块中包含的区块链交易,根据预定义的管理规则对解析得到的交易中包含的字段值进行预校验;和/或预执行所述区块链交易,并根据预定义的管理规则对预执行的结果进行校验。Optionally, the verifying the blockchain transactions contained in the candidate block according to the predefined management rules includes: parsing the blockchain transactions contained in the candidate blocks, and analyzing according to the predefined management rules to obtain Pre-check the field values contained in the transaction; and/or pre-execute the blockchain transaction, and verify the pre-execution result according to the predefined management rules.
可选的,所述管理规则用于实现下述检查中至少之一:交易内容和/或交易产生的合约状态取值是否包含预设敏感词;交易数额是否超过预设数额阈值;交易发起方账户和/或交易对端账户是否为预设黑名单账户。Optionally, the management rules are used to implement at least one of the following checks: whether the transaction content and/or the contract status value generated by the transaction contain preset sensitive words; whether the transaction amount exceeds the preset amount threshold; the transaction initiator Whether the account and/or the counterparty account is a preset blacklist account.
可选的,所述在确认所述后选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块,包括;在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,对所述候选区块进行签名;将经过签名的候选区块发送给所述区块链系统中的各记账节点,以使各记账节点在交易执行条件被满足的情况下分别将所述候选区块记录为自身维护的区块链账本中的最新区块;其中,所述交易执行条件包括:接收到由管理节点签名的候选区块的数量不少于预设数量,或接收到由管理节点签名的候选区块的数量与管理节点的总数量之比不小于预设比例。Optionally, after confirming that all blockchain transactions included in the candidate block comply with the management rules, each bookkeeping node is triggered to record the candidate block as a block maintained by itself The latest block in the chain ledger, including: signing the candidate block after confirming that all blockchain transactions contained in the candidate block comply with the management rules; The block is sent to each accounting node in the blockchain system, so that each accounting node records the candidate block as the latest in the blockchain ledger maintained by itself when the transaction execution conditions are met. block; wherein, the transaction execution conditions include: the number of candidate blocks signed by the management node is not less than the preset number, or the number of candidate blocks signed by the management node is equal to the total number of management nodes The ratio is not less than the preset ratio.
可选的,所述在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块包括:在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,避免向各记账节点发送经过签名的候选区块。Optionally, when it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rules, triggering each bookkeeping node to abandon the candidate block includes: confirming that the candidate block If there is any blockchain transaction in the block that does not comply with the management rules, avoid sending signed candidate blocks to each accounting node.
可选的,所述在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块,包括:在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,向所述区块链系统中的各记账节点发送上链消息,以使各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块。Optionally, after confirming that all blockchain transactions included in the candidate block comply with the management rules, each bookkeeping node is triggered to record the candidate block as a block maintained by itself The latest block in the chain account book, including: after confirming that all the blockchain transactions contained in the candidate block comply with the management rules, sending an upper Chain message, so that each bookkeeping node respectively records the candidate block as the latest block in the blockchain account book maintained by itself.
可选的,所述在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块包括:所述在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,向所述区块链系统中的各记账节点发送弃块消息,以使各记账节点放弃所述候选区块。Optionally, when it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rules, triggering each bookkeeping node to abandon the candidate block includes: confirming that the If there is any blockchain transaction in the candidate block that does not comply with the management rules, send an abandonment message to each accounting node in the blockchain system, so that each accounting node abandons the candidate area piece.
可选的,所述装置还包括:打包单元512,被配置为在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,打包所述候选区块中符合所述管理规则的所有区块链交易以生成新的候选区块。Optionally, the device further includes: a packaging unit 512, configured to package the candidate block in compliance with the management rule if it is confirmed that there is any blockchain transaction in the candidate block All blockchain transactions governing rules to generate new candidate blocks.
发送单元514,被配置为将新的候选区块发送给所述区块链系统中的各记账节点,以使各记账节点分别将所述新的候选区块记录为自身维护的区块链账本中的最新区块。The sending unit 514 is configured to send the new candidate block to each bookkeeping node in the blockchain system, so that each bookkeeping node respectively records the new candidate block as a block maintained by itself The latest block in the ledger.
可选的,所述装置还包括:共识单元516,被配置为与所述区块链系统中的各记账节点对所述新的候选区块进行共识;其中,各记账节点在确定所述新的候选区块通过共识的情况下将其记录为自身维护的区块链账本中的最新区块。Optionally, the device further includes: a consensus unit 516 configured to agree with each accounting node in the blockchain system on the new candidate block; wherein each accounting node determines the When the new candidate block passes the consensus, it is recorded as the latest block in the blockchain ledger maintained by itself.
可选的,所述根据预定义的管理规则校验所述候选区块中包含的区块链交易包括:根据各管理规则的状态信息,从所述管理规则中选取处于有效状态的有效管理规则;其中,所述状态信息包括有效状态和无效状态;根据所述有效管理规则校验所述候选区块中包含的区块链交易。Optionally, the verifying the blockchain transactions contained in the candidate block according to the predefined management rules includes: selecting an effective management rule in a valid state from the management rules according to the state information of each management rule ; Wherein, the state information includes a valid state and an invalid state; check the block chain transactions contained in the candidate block according to the effective management rules.
可选的,在当前时刻处于任一管理规则对应的有效时间段,或所述候选区块的区块高度处于所述任一管理规则对应的有效区块高度区间的情况下,所述任一管理规则被确定为处于有效状态;和/或,在当前时刻处于任一管理规则对应的失效时间段,或所述候选区块的区块高度处于所述任一管理规则对应的失效区块高度区间的情况下,所述任一管理规则被确定为处于失效状态。Optionally, when the current moment is within the effective time period corresponding to any management rule, or the block height of the candidate block is within the effective block height interval corresponding to any management rule, the any The management rule is determined to be in an effective state; and/or, at the current moment, it is in the invalidation period corresponding to any management rule, or the block height of the candidate block is in the invalidation block height corresponding to any management rule In the case of an interval, any one of the management rules is determined to be in an invalid state.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, devices, modules, or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementing device is a computer, which may take the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, e-mail device, game control device, etc. desktops, tablets, wearables, or any combination of these.
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer-readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by computing devices. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other implementations are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. Multitasking and parallel processing are also possible or may be advantageous in certain embodiments.
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。Terms used in one or more embodiments of the present specification are for the purpose of describing specific embodiments only, and are not intended to limit the one or more embodiments of the present specification. As used in one or more embodiments of this specification and the appended claims, the singular forms "a", "the", and "the" are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此 区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of one or more embodiments of this specification, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "at" or "when" or "in response to a determination."
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。The above descriptions are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. Within the spirit and principles of one or more embodiments of this specification, Any modification, equivalent replacement, improvement, etc. should be included in the scope of protection of one or more embodiments of this specification.

Claims (20)

  1. 一种区块管理方法,应用于区块链系统中的管理节点,所述方法包括:A block management method applied to a management node in a blockchain system, the method comprising:
    接收所述区块链系统中记账节点发送的候选区块,所述候选区块由所述记账节点对通过合法性验证的若干区块链交易进行打包得到,且所述候选区块已通过共识;Receive the candidate block sent by the bookkeeping node in the blockchain system, the candidate block is obtained by the bookkeeping node by packaging a number of blockchain transactions that have passed the legality verification, and the candidate block has been by consensus;
    根据预定义的管理规则校验所述候选区块中包含的区块链交易;verifying blockchain transactions contained in said candidate block according to predefined governing rules;
    在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块;After confirming that all the blockchain transactions contained in the candidate block comply with the management rules, each bookkeeping node is triggered to record the candidate block as the latest block in the blockchain account book maintained by itself. piece;
    在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块。When it is confirmed that there is any block chain transaction in the candidate block that does not comply with the management rules, each bookkeeping node is triggered to abandon the candidate block.
  2. 根据权利要求1所述方法,所述根据预定义的管理规则校验所述候选区块中包含的区块链交易包括:According to the method according to claim 1, said verifying the blockchain transactions contained in said candidate blocks according to predefined management rules comprises:
    调用预先部署在所述管理节点处的管理合约,以通过所述管理合约中预定义的管理规则校验所述候选区块中包含的区块链交易。Invoking the management contract pre-deployed at the management node to verify the blockchain transactions contained in the candidate block through the predefined management rules in the management contract.
  3. 根据权利要求2所述方法,所述管理合约包括部署于所述管理节点上运行的区块链平台代码中的系统合约,所述调用预先部署在所述管理节点处的管理合约包括:According to the method according to claim 2, the management contract includes a system contract deployed in the blockchain platform code running on the management node, and the calling of the management contract pre-deployed at the management node includes:
    在管理合约的调用条件被满足的情况下,通过记录于所述区块链平台代码中的预定义接口调用所述管理合约;其中,所述管理合约的调用条件包括:所述候选区块通过共识。When the invocation conditions of the management contract are met, the management contract is invoked through a predefined interface recorded in the blockchain platform code; wherein, the invocation conditions of the management contract include: the candidate block passes consensus.
  4. 根据权利要求2所述方法,所述管理合约被通过合约部署交易部署于所述区块链系统中的各区块链节点处;According to the method of claim 2, the management contract is deployed at each blockchain node in the blockchain system through a contract deployment transaction;
    或者,所述管理合约为部署于所述管理节点处的本地合约。Alternatively, the management contract is a local contract deployed on the management node.
  5. 根据权利要求2所述方法,所述管理规则被维护于所述管理合约对应的合约状态中,还包括:According to the method according to claim 2, the management rules are maintained in the contract state corresponding to the management contract, further comprising:
    根据接收到的规则更新交易调用所述管理合约,以将所述合约状态的取值更新为所述规则更新交易携带的更新后的管理规则。Call the management contract according to the received rule update transaction, so as to update the value of the contract state to the updated management rule carried by the rule update transaction.
  6. 根据权利要求2所述方法,所述管理规则被维护于所述管理合约的合约代码中,或者所述管理合约对应的合约状态中。According to the method of claim 2, the management rules are maintained in the contract code of the management contract, or in the contract state corresponding to the management contract.
  7. 根据权利要求1所述方法,所述根据预定义管理规则校验所述区块中包含的区块链交易包括:According to the method according to claim 1, said verifying the blockchain transactions contained in said blocks according to predefined management rules comprises:
    调用预先部署在所述管理节点处的管理数据库,以通过所述管理数据库中的预定义管理规则校验所述候选区块中的区块链交易。Invoking the management database pre-deployed at the management node to verify the blockchain transactions in the candidate block through the predefined management rules in the management database.
  8. 根据权利要求1所述方法,所述根据预定义管理规则校验所述候选区块中包含的区块链交易包括:According to the method according to claim 1, the verification of the blockchain transactions contained in the candidate block according to the predefined management rules comprises:
    解析所述候选区块中包含的区块链交易,根据预定义的管理规则对解析得到的交易中包含的字段值进行预校验;和/或Analyzing the blockchain transactions contained in the candidate block, and pre-verifying the field values contained in the parsed transactions according to predefined management rules; and/or
    预执行所述区块链交易,并根据预定义的管理规则对预执行的结果进行校验。The blockchain transaction is pre-executed, and the pre-executed result is verified according to predefined management rules.
  9. 根据权利要求1所述方法,所述管理规则用于实现下述检查中至少之一:According to the method according to claim 1, the management rules are used to implement at least one of the following checks:
    交易内容和/或交易产生的合约状态取值是否包含预设敏感词;Whether the transaction content and/or the contract status value generated by the transaction contain preset sensitive words;
    交易数额是否超过预设数额阈值;Whether the transaction amount exceeds the preset amount threshold;
    交易发起方账户和/或交易对端账户是否为预设黑名单账户。Whether the transaction initiator account and/or the transaction counterparty account is a preset blacklist account.
  10. 根据权利要求1所述方法,所述在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块,包括;According to the method according to claim 1, when it is confirmed that all blockchain transactions contained in the candidate block comply with the management rules, each bookkeeping node is triggered to record the candidate block as itself The latest block in the maintained blockchain ledger, including;
    在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,对所述候选区块进行签名;signing the candidate block after confirming that all blockchain transactions contained in the candidate block comply with the management rules;
    将经过签名的候选区块发送给所述区块链系统中的各记账节点,以使各记账节点在交易执行条件被满足的情况下分别将所述候选区块记录为自身维护的区块链账本中的最新区块;其中,所述交易执行条件包括:接收到由管理节点签名的候选区块的数量不少于预设数量,或接收到由管理节点签名的候选区块的数量与管理节点的总数量之比不小于预设比例。Send the signed candidate block to each bookkeeping node in the blockchain system, so that each bookkeeping node records the candidate block as the area maintained by itself when the transaction execution conditions are met. The latest block in the block chain account book; wherein, the transaction execution conditions include: the number of candidate blocks signed by the management node is not less than the preset number, or the number of candidate blocks signed by the management node is received The ratio to the total number of management nodes is not less than a preset ratio.
  11. 根据权利要求9所述方法,所述在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块包括:According to the method according to claim 9, when it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rules, triggering each accounting node to abandon the candidate block includes:
    在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,避免向各记账节点发送经过签名的候选区块。When it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rules, it is avoided to send the signed candidate block to each accounting node.
  12. 根据权利要求1所述方法,所述在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块,包括:According to the method according to claim 1, when it is confirmed that all blockchain transactions contained in the candidate block comply with the management rules, each bookkeeping node is triggered to record the candidate block as itself The latest block in the maintained blockchain ledger, including:
    在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,向所述区块链系统中的各记账节点发送上链消息,以使各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块。After confirming that all blockchain transactions contained in the candidate block comply with the management rules, send an uplink message to each bookkeeping node in the blockchain system, so that each bookkeeping node Record the candidate block as the latest block in the blockchain ledger maintained by itself.
  13. 根据权利要求1所述方法,所述在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块包括:According to the method according to claim 1, when it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rules, triggering each bookkeeping node to abandon the candidate block includes:
    所述在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,向所述区块链系统中的各记账节点发送弃块消息,以使各记账节点放弃所述候选区块。In the case of confirming that there is any blockchain transaction in the candidate block that does not comply with the management rules, send an abandonment message to each accounting node in the blockchain system, so that each accounting node The node discards the candidate block.
  14. 根据权利要求1所述方法,还包括:The method according to claim 1, further comprising:
    在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,打包所述候选区块中符合所述管理规则的所有区块链交易以生成新的候选区块;In the case of confirming that there is any blockchain transaction in the candidate block that does not comply with the management rules, pack all the blockchain transactions in the candidate block that meet the management rules to generate a new candidate block ;
    将新的候选区块发送给所述区块链系统中的各记账节点,以使各记账节点分别将所述新的候选区块记录为自身维护的区块链账本中的最新区块。Send the new candidate block to each bookkeeping node in the blockchain system, so that each bookkeeping node records the new candidate block as the latest block in the blockchain account book maintained by itself .
  15. 根据权利要求14所述方法,还包括:与所述区块链系统中的各记账节点对所述新的候选区块进行共识;其中,各记账节点在确定所述新的候选区块通过共识的情况下将其记录为自身维护的区块链账本中的最新区块。The method according to claim 14, further comprising: consensusing on the new candidate block with each bookkeeping node in the blockchain system; wherein each bookkeeping node is determining the new candidate block In the case of consensus, it is recorded as the latest block in the blockchain ledger maintained by itself.
  16. 根据权利要求1所述方法,所述根据预定义的管理规则校验所述候选区块中包含的区块链交易包括:According to the method according to claim 1, said verifying the blockchain transactions contained in said candidate blocks according to predefined management rules comprises:
    根据各管理规则的状态信息,从所述管理规则中选取处于有效状态的有效管理规则;其中,所述状态信息包括有效状态和无效状态;According to the status information of each management rule, select an effective management rule in an effective state from the management rules; wherein, the state information includes a valid state and an invalid state;
    根据所述有效管理规则校验所述候选区块中包含的区块链交易。The blockchain transactions contained in the candidate block are verified according to the valid management rules.
  17. 根据权利要求15所述方法,在当前时刻处于任一管理规则对应的有效时间段,或所述候选区块的区块高度处于所述任一管理规则对应的有效区块高度区间的情况下,所述任一管理规则被确定为处于有效状态;和/或,According to the method according to claim 15, when the current moment is in the effective time period corresponding to any management rule, or the block height of the candidate block is in the effective block height interval corresponding to the any management rule, any of said management rules is determined to be in an active state; and/or,
    在当前时刻处于任一管理规则对应的失效时间段,或所述候选区块的区块高度处于所述任一管理规则对应的失效区块高度区间的情况下,所述任一管理规则被确定为处于失效状态。In the case that the current moment is in the invalid time period corresponding to any management rule, or the block height of the candidate block is in the invalid block height interval corresponding to the any management rule, the any management rule is determined is in an invalid state.
  18. 一种区块管理装置,应用于区块链系统中的管理节点,所述装置包括:A block management device applied to a management node in a blockchain system, the device comprising:
    接收单元,用于接收所述区块链系统中记账节点发送的候选区块,所述候选区块由所述记账节点对通过合法性验证的若干区块链交易进行打包得到,且所述候选区块已通过共识;The receiving unit is used to receive the candidate block sent by the bookkeeping node in the blockchain system, the candidate block is obtained by the bookkeeping node by packaging several blockchain transactions that have passed the legality verification, and the The above candidate blocks have passed the consensus;
    校验单元,用于根据预定义的管理规则校验所述候选区块中包含的区块链交易;A verification unit, configured to verify the blockchain transactions contained in the candidate block according to predefined management rules;
    第一触发单元,用于在确认所述候选区块中包含的所有区块链交易均符合所述管理规则的情况下,触发各记账节点分别将所述候选区块记录为自身维护的区块链账本中的最新区块;The first triggering unit is configured to trigger each accounting node to record the candidate block as a zone maintained by itself when it is confirmed that all blockchain transactions contained in the candidate block comply with the management rules The latest block in the blockchain ledger;
    第二触发单元,用于在确认所述候选区块中存在任一区块链交易不符合所述管理规则的情况下,触发各记账节点放弃所述候选区块。The second trigger unit is configured to trigger each accounting node to abandon the candidate block when it is confirmed that there is any blockchain transaction in the candidate block that does not comply with the management rules.
  19. 一种电子设备,包括:An electronic device comprising:
    处理器;processor;
    用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-17中任一项所述的方法。Wherein, the processor implements the method according to any one of claims 1-17 by running the executable instructions.
  20. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-17中任一项所述方法的步骤。A computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1-17 are implemented.
PCT/CN2022/104315 2021-09-06 2022-07-07 Block management WO2023029743A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111040267.X 2021-09-06
CN202111040267.XA CN113495927B (en) 2021-09-06 2021-09-06 Block management method and device

Publications (1)

Publication Number Publication Date
WO2023029743A1 true WO2023029743A1 (en) 2023-03-09

Family

ID=77997063

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/104315 WO2023029743A1 (en) 2021-09-06 2022-07-07 Block management

Country Status (2)

Country Link
CN (2) CN113495927B (en)
WO (1) WO2023029743A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113495927B (en) * 2021-09-06 2022-02-25 支付宝(杭州)信息技术有限公司 Block management method and device
CN114861227A (en) * 2022-05-18 2022-08-05 华侨大学 Intelligent tourism data processing method and system based on metauniverse

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107124403A (en) * 2017-04-14 2017-09-01 朱清明 The generation method and computing device of common recognition block in block chain
CN110245506A (en) * 2019-05-30 2019-09-17 阿里巴巴集团控股有限公司 Intelligent contract administration method and device based on block chain, electronic equipment
CN111899006A (en) * 2018-05-29 2020-11-06 创新先进技术有限公司 Transaction processing method and device based on block chain and electronic equipment
CN112131478A (en) * 2020-09-28 2020-12-25 北京海益同展信息科技有限公司 Transaction detection method and device
US20210158347A1 (en) * 2018-10-31 2021-05-27 Advanced New Technologies Co., Ltd. Blockchain-based node management methods and apparatuses
CN113495927A (en) * 2021-09-06 2021-10-12 支付宝(杭州)信息技术有限公司 Block management method and device

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3649558B8 (en) * 2017-07-06 2024-04-17 Chromaway AB Method and system for a distributed computing system
KR102451115B1 (en) * 2018-04-19 2022-10-06 한국전자통신연구원 Method for selecting consensus node using nonse, method and apparatus for generating blockchain using the same
CN110875893B (en) * 2018-08-29 2022-03-08 深圳启元信息服务有限公司 Consensus verification method, check node and block chain system
KR102130062B1 (en) * 2018-09-18 2020-07-03 엔에이치엔 주식회사 A method for establishing agreement between nodes in a Blockchain network and a Blockchain system
WO2020069411A1 (en) * 2018-09-28 2020-04-02 Thunder Token Inc. High throughput blockchain consensus systems and methods with low finalization time
CN109481936B (en) * 2018-10-26 2022-04-29 咪咕文化科技有限公司 Block chain accounting node selection method and device and computer readable storage medium
KR102092757B1 (en) * 2018-12-24 2020-03-24 심왕섭 Accounting and management system using block chain
KR102139551B1 (en) * 2019-03-07 2020-07-29 넷마블 주식회사 Method and server for managing testament
CN110009494B (en) * 2019-03-18 2022-03-04 创新先进技术有限公司 Method and device for monitoring transaction content in block chain
CN110535836B (en) * 2019-08-12 2021-10-29 安徽师范大学 Trust block chain consensus method based on role classification
CN110517139B (en) * 2019-08-23 2021-12-28 电子科技大学 Voting mechanism-based alliance block chain power sharing consensus method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107124403A (en) * 2017-04-14 2017-09-01 朱清明 The generation method and computing device of common recognition block in block chain
CN111899006A (en) * 2018-05-29 2020-11-06 创新先进技术有限公司 Transaction processing method and device based on block chain and electronic equipment
US20210158347A1 (en) * 2018-10-31 2021-05-27 Advanced New Technologies Co., Ltd. Blockchain-based node management methods and apparatuses
CN110245506A (en) * 2019-05-30 2019-09-17 阿里巴巴集团控股有限公司 Intelligent contract administration method and device based on block chain, electronic equipment
CN112131478A (en) * 2020-09-28 2020-12-25 北京海益同展信息科技有限公司 Transaction detection method and device
CN113495927A (en) * 2021-09-06 2021-10-12 支付宝(杭州)信息技术有限公司 Block management method and device

Also Published As

Publication number Publication date
CN113495927A (en) 2021-10-12
CN113495927B (en) 2022-02-25
CN114817399A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
US11048825B2 (en) Managing a smart contract on a blockchain
WO2020238255A1 (en) Smart contract management method and apparatus based on blockchain, and electronic device
JP7019697B2 (en) Dynamic access control on the blockchain
WO2023029743A1 (en) Block management
CN111090876B (en) Contract calling method and device
EP3937424A1 (en) Blockchain data processing methods and apparatuses based on cloud computing
CN110580418B (en) Private data query method and device based on block chain account
WO2020098379A1 (en) Cross-chain data credible management method and apparatus, electronic device
Alblooshi et al. Blockchain-based ownership management for medical IoT (MIoT) devices
EP3961974B1 (en) Block content editing methods and apparatuses
CN110580245B (en) Private data sharing method and device
US8645967B2 (en) Efficient secure data marshaling through at least one untrusted intermediate process
CN111241557B (en) Service request method and device based on block chain
CN110580417B (en) Private data query method and device based on intelligent contract
CN110580411B (en) Permission query configuration method and device based on intelligent contract
CN111127021B (en) Service request method and device based on block chain
CN111523110A (en) Permission query configuration method and device based on chain codes
EP3961456A1 (en) Data authorization information acquisition methods, apparatuses, and devices
CN110086780B (en) Method and device for processing tampered transaction based on Ether house and storage medium
CN111770112B (en) Information sharing method, device and equipment
CN113114476A (en) Privacy evidence storing method and device based on contract
CN111245897A (en) Data processing method, device, system, storage medium and processor
CN113469811A (en) Block chain transaction processing method and device
CN114095177A (en) Information security processing method and device, electronic equipment and storage medium
CN111953773B (en) De-centralized address mapping method and device

Legal Events

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

Ref document number: 22862884

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE