A consensus processing method based on a blockchain network and related devices
Patent Information
- Application Number
- CN202210480672.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-05
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-05-05
AI Technical Summary
[0059]若识别投票结果指示目标交易数据识别不通过,则生成目标反馈信息,目标反馈信息用于指示:目标交易数据识别不通过的原因;
Smart Images

Figure CN117061538B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to the field of blockchain technology, and in particular to a consensus processing method based on a blockchain network, a consensus processing device based on a blockchain network, a blockchain device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] With the rapid development of computer technology, blockchain technology has gradually gained widespread attention, and more and more data is being stored on the blockchain to prevent data tampering. Consensus is the foundation of blockchain technology. Consensus refers to the process by which nodes in the blockchain network verify newly generated blocks through a consensus algorithm. If the consensus verification is successful, the block is added to the blockchain, thus storing the block data; if the consensus verification fails, the new block cannot be added to the blockchain. Therefore, the consensus process before blocks are added to the blockchain plays a crucial role in maintaining data security within the blockchain network. Summary of the Invention
[0003] This application provides a consensus processing method and related apparatus based on a blockchain network, which can achieve consensus and identification of transaction data in the consensus process, and ensure the legality and security of transaction data stored on the blockchain.
[0004] On one hand, embodiments of this application provide a consensus processing method based on a blockchain network. The blockchain network includes at least one consensus node and at least one identification node. Each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type. The method is executed by a target consensus node, which is any one of the at least one consensus node. The method includes:
[0005] Acquire target transaction data, which falls under the target identification type;
[0006] Package the target transaction data to generate the target block;
[0007] The target block is broadcast in the blockchain network, so that the consensus nodes in the blockchain network can reach a consensus on the target block, and the target identification nodes corresponding to the target identification type can identify and process the target transaction data in the target block.
[0008] Receive the target consensus result and target identification result of the target block; and,
[0009] Based on the target consensus results and target identification results, the target block is processed and added to the blockchain.
[0010] In this embodiment of the application, during the consensus process for the target block generated by packaging the target transaction data, a target identification node corresponding to the target identification type to which the target transaction data belongs is introduced to identify the target transaction data in the target block. This adds a check on the legality of the content of the target transaction data itself in the consensus process, thereby ensuring that the target block that can be uploaded to the chain is not only successfully verified by consensus, but also that the target transaction data in the target block is successfully identified. This improves the legality of the target transaction data uploaded to the chain, and thus improves the security of the data stored in the blockchain network.
[0011] On the other hand, embodiments of this application provide a consensus processing method based on a blockchain network. The blockchain network includes at least one consensus node and at least one identification node. Each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type. The method is executed by the target identification node corresponding to the target identification type. The method includes:
[0012] Receive the target block broadcast by the target consensus node in the blockchain network; the target consensus node is any one of at least one consensus node included in the blockchain network; the target block is obtained by the target consensus node based on the target transaction data; the target transaction data belongs to the target identification type;
[0013] The target transaction data in the target block is identified and processed to obtain the identification voting results;
[0014] The identification voting result is returned to the target consensus node so that the target consensus node can obtain the target identification result of the target block based on the identification voting result, and then process the target block on the chain based on the target identification result and the target consensus result; the target consensus result is generated by the target consensus node based on the consensus vote, which is obtained by the consensus nodes in the blockchain network to reach a consensus on the target block.
[0015] In this embodiment, during the consensus process for the target block, the target identification node can identify the target transaction data in the broadcast target block, such as whether the target transaction data meets business requirements (e.g., whether the identification type of the transaction data matches the target identification type corresponding to the target identification node), to check the legality of the target transaction data; and send the identification voting results to the target consensus node so that the target consensus node will only upload the target block to the chain if it determines that the consensus on the target block is successful and the identification of the target transaction data is successful; this not only ensures the security of the target block through the consensus verification of the consensus node, but also ensures the legality of the target transaction data through the identification processing of the target identification node.
[0016] On the other hand, embodiments of this application provide a consensus processing device based on a blockchain network. The blockchain network includes at least one consensus node and at least one identification node. Each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type. The device is mounted on a target consensus node, which is any one of the at least one consensus node. The device includes:
[0017] The acquisition unit is used to acquire target transaction data, which belongs to the target identification type.
[0018] The processing unit is used to package and process the target transaction data to generate the target block;
[0019] The processing unit is also used to broadcast the target block in the blockchain network, so that the consensus nodes in the blockchain network can reach a consensus on the target block, and to enable the target identification node corresponding to the target identification type to identify and process the target transaction data in the target block.
[0020] The processing unit is also used to receive the target consensus result and target identification result of the target block; and,
[0021] The processing unit is also used to process the target block on the blockchain based on the target consensus result and the target identification result.
[0022] In one implementation, each node in the blockchain network deploys a target configuration contract, which includes: the identification type corresponding to each identification node and the identification type to which the transaction data belongs.
[0023] In one implementation, when the processing unit performs on-chain processing on the target block based on the target consensus result and the target identification result, it specifically performs the following:
[0024] If the target consensus result indicates that the target block consensus is successful, and the target identification result indicates that the target transaction data in the target block is successfully identified, then the target block will be stored on the blockchain in the blockchain network.
[0025] In one implementation, when the processing unit receives the target consensus result of the target block, it specifically performs the following functions:
[0026] Receive the consensus voting results for the target block returned by each consensus node in the blockchain network;
[0027] The statistics indicate the first vote count for the consensus vote on the success of the target block consensus, and the target consensus result is generated based on the first vote count;
[0028] If the number of first votes is greater than the first quantity threshold, then the target consensus result indicates that the target block consensus is successful.
[0029] In one implementation, the number of target identification types is 1. When the processing unit receives the target identification result of the target block, it is specifically used for:
[0030] Receive the voting results of the target transaction data in the target block returned by each target identification node corresponding to the target identification type;
[0031] The statistics indicate the second vote count of the identification voting results for the target transaction data, and generate the target identification result based on the second vote count;
[0032] If the second number of votes is greater than the second quantity threshold, then the target identification result indicates that the target transaction data in the target block has been successfully identified.
[0033] In one implementation, the target identification type includes a first target identification type and a second target identification type. When the processing unit receives the target identification result of the target block, it is specifically used for:
[0034] Receive the first identification voting results returned by each target identification node corresponding to the first target identification type;
[0035] The statistical indicator counts the first identification votes for the first identification voting results that have passed the identification of the target transaction data, and generates a first identification result based on the first identification vote count; and,
[0036] Receive the second identification voting results returned by each target identification node corresponding to the second target identification type;
[0037] The statistics indicate the number of second identification votes for the second identification voting results that have passed the identification of the target transaction data, and generate a second identification result based on the number of second identification votes;
[0038] Target identification results are generated based on the first and second identification results;
[0039] Specifically, if the number of first identification votes is greater than the third quantity threshold, the first identification result indicates that the target transaction data in the target block has been successfully identified; if the number of second identification votes is greater than the fourth quantity threshold, the second identification result indicates that the target transaction data in the target block has been successfully identified; if both the first and second identification results indicate successful identification, the target identification result indicates that the target transaction data in the target block has been successfully identified.
[0040] In one implementation, the processing unit is further used for:
[0041] If the target identification result indicates that the target transaction data in the target block has failed to be identified, then the target feedback information sent by each target identification node, which indicates that the target transaction data has failed to be identified, is received. The target feedback information is used to indicate the reason why the target identification node failed to identify the target transaction data.
[0042] Send the target feedback information to the party that submitted the target transaction data.
[0043] In one implementation, the target configuration contract also includes a node identifier for each identified node, and the processing unit is further used for:
[0044] Obtain the target node identifier of the target recognition node corresponding to the target recognition type;
[0045] If a communication connection is successfully established between the target node identifier and the target identification node, the step of packaging the target transaction data and generating the target block is triggered.
[0046] In one implementation, the processing unit is further used for:
[0047] If a communication connection with the target identification node is detected to be broken during the packaging process of the target transaction data, the packaging process of the target transaction data will be paused.
[0048] When the communication connection with the target identification node is restored, the target transaction data continues to be packaged and processed.
[0049] In this embodiment of the application, during the consensus process for the target block generated by packaging the target transaction data, a target identification node corresponding to the target identification type to which the target transaction data belongs is introduced to identify the target transaction data in the target block. This adds a check on the legality of the content of the target transaction data itself in the consensus process, thereby ensuring that the target block that can be uploaded to the chain is not only successfully verified by consensus, but also that the target transaction data in the target block is successfully identified. This improves the legality of the target transaction data uploaded to the chain, and thus improves the security of the data stored in the blockchain network.
[0050] On the other hand, embodiments of this application provide a consensus processing device based on a blockchain network. The blockchain network includes at least one consensus node and at least one identification node. Each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type. The device is mounted on the target identification node corresponding to the target identification type. The device includes:
[0051] The receiving unit is used to receive the target block broadcast by the target consensus node in the blockchain network; the target consensus node is any one of at least one consensus node included in the blockchain network; the target block is obtained by the target consensus node through packaging and processing based on the target transaction data; the target transaction data belongs to the target identification type;
[0052] The processing unit is used to identify and process the target transaction data in the target block to obtain the identification voting results;
[0053] The processing unit is also used to return the identification voting results to the target consensus node, so that the target consensus node can obtain the target identification result of the target block based on the identification voting results, and perform on-chain processing on the target block based on the target identification result and the target consensus result; the target consensus result is generated by the target consensus node based on the consensus vote, which is obtained by the consensus nodes in the blockchain network to reach a consensus on the target block.
[0054] In one implementation, the processing unit is used to identify and process the target transaction data in the target block. When obtaining the identification voting result, it is specifically used for:
[0055] Obtain the identification rules corresponding to the target transaction data; the identification rules are provided by the identification party.
[0056] The target transaction data is identified and processed according to the identification rules to obtain the identification voting results;
[0057] The identification rules are used to identify the correctness of the transaction information contained in the target transaction data; when the identification voting result indicates that the target transaction data has passed the identification, it is determined that the transaction information contained in the target transaction data is correct.
[0058] In one implementation, the processing unit is further used for:
[0059] If the voting results indicate that the target transaction data identification fails, target feedback information is generated to indicate the reason why the target transaction data identification failed.
[0060] The target feedback information is sent to the target consensus node so that when the target consensus node detects that the target identification result indicates that the target block identification has failed, it sends the target feedback information to the submitter of the target transaction data.
[0061] In this embodiment, during the consensus process for the target block, the target identification node can perform identification processing on the target transaction data in the broadcast target block, such as identifying whether the target transaction data meets business requirements (e.g., whether the data type of the target transaction data matches the target identification type corresponding to the target identification node), to check the legality of the target transaction data; and send the identification voting results to the target consensus node, so that the target consensus node will only process the target block on the chain if it determines that the consensus on the target block is successful and the identification of the target transaction data is successful; this not only ensures the security of the target block through the consensus verification of the consensus node, but also ensures the legality of the target transaction data through the identification processing of the target identification node.
[0062] On the other hand, this application provides a blockchain node device, which includes:
[0063] A processor is used to load and execute computer programs;
[0064] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned consensus processing method based on a blockchain network.
[0065] On the other hand, this application provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed by the consensus processing method described above.
[0066] On the other hand, this application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. The processor of a blockchain node device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the blockchain node device to perform the aforementioned consensus processing method based on a blockchain network. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1a This application illustrates an exemplary embodiment of a data sharing system architecture.
[0069] Figure 1bA schematic diagram of a blockchain provided by an exemplary embodiment of this application is shown;
[0070] Figure 1c A schematic diagram of the architecture of a blockchain network provided in an exemplary embodiment of this application is shown;
[0071] Figure 1d A flowchart illustrating a consensus processing scheme provided in an exemplary embodiment of this application is shown.
[0072] Figure 2 This illustration shows a flowchart of a consensus processing method based on a blockchain network provided in an exemplary embodiment of this application;
[0073] Figure 3a This illustration shows a schematic diagram of a broadcast target block provided in an exemplary embodiment of this application;
[0074] Figure 3b This illustration shows a schematic diagram of a broadcast target block provided in an exemplary embodiment of this application;
[0075] Figure 4a This illustration shows a schematic diagram of generating target recognition results according to an exemplary embodiment of this application;
[0076] Figure 4b This illustration shows a schematic diagram of generating target recognition results according to an exemplary embodiment of this application;
[0077] Figure 5 This illustration shows a schematic diagram of an exemplary embodiment of the present application for determining whether a target block is on the blockchain;
[0078] Figure 6 This illustration shows a flowchart of a consensus processing method based on a blockchain network provided in an exemplary embodiment of this application;
[0079] Figure 7a This illustration shows a schematic diagram of a target identification node identifying target transaction data according to an exemplary embodiment of this application;
[0080] Figure 7b This illustration shows a schematic diagram of a target identification node identifying target transaction data according to an exemplary embodiment of this application;
[0081] Figure 8 This illustration shows a schematic diagram of a method for providing target feedback information to the submitter, provided by an exemplary embodiment of this application.
[0082] Figure 9 This illustration shows a schematic diagram of the architecture of a two-layer blockchain network provided in an exemplary embodiment of this application;
[0083] Figure 10 This illustration shows a schematic diagram of the architecture of a two-layer blockchain network provided in an exemplary embodiment of this application;
[0084] Figure 11a This illustration shows a schematic diagram of the architecture of a two-layer blockchain network provided in an exemplary embodiment of this application;
[0085] Figure 11b This illustration shows a flowchart of a consensus processing method based on a blockchain network provided in an exemplary embodiment of this application;
[0086] Figure 12 This illustration shows a schematic diagram of the structure of a consensus processing device based on a blockchain network, provided in an exemplary embodiment of this application.
[0087] Figure 13 This illustration shows a schematic diagram of the structure of a consensus processing device based on a blockchain network, provided in an exemplary embodiment of this application.
[0088] Figure 14 A schematic diagram of the structure of a blockchain node device provided in an exemplary embodiment of this application is shown. Detailed Implementation
[0089] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0090] This application relates to blockchain, which is the foundation of blockchain technology. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. A blockchain consists of multiple blocks; a structural diagram of one type of block can be found here. Figure 1a ,like Figure 1aAs shown, the genesis block of a blockchain includes a block header and a block body. The block header stores input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values of the current block, the block header feature values of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block is associated with the block data stored in the parent block, guaranteeing the security of the input information in the blocks. A blockchain can be maintained by blockchain nodes within a blockchain network. A blockchain network can be understood as a data sharing system, referring to a system used for data sharing between blockchain nodes. An exemplary structure of this data sharing system can be found in [reference needed]. Figure 1b ;like Figure 1b As shown, the data sharing system may include multiple blockchain nodes 101. Each blockchain node 101 can be a server connected to the blockchain network or a terminal (such as a client running on the terminal) connected to the blockchain network. The specific form of the blockchain node 101 is not limited here.
[0091] Specifically, once any blockchain node (such as a consensus node with consensus functionality) wins the right to propose a block, it can retrieve transaction data from the transaction pool and package it to generate a new block. Then, each blockchain node can use a consensus algorithm to verify the generated block. Only after successful consensus verification is the block stored on the blockchain for maintenance (such as updates). By performing consensus verification on the blocks generated based on the transaction data before putting them on the chain, it ensures that the transaction data uploaded to the chain is tamper-proof.
[0092] Therefore, the consensus process is crucial in the entire process of uploading transaction data to the blockchain, as it directly impacts the data security of the entire blockchain network. Currently, in the consensus verification process for blocks generated based on transaction data, consensus nodes can employ consensus algorithms to verify the block and store it on the blockchain after successful verification, ensuring the legitimacy of the transaction data within the blockchain. These consensus algorithms can include, but are not limited to, Proof-of-Work, Proof-of-Stake, and Delegated Proof-of-Stake, etc. The consensus algorithms used vary depending on the specific business scenario, and this application does not limit the type of consensus algorithm used.
[0093] Practice has shown that the consensus verification process for blocks by consensus nodes mainly involves verifying the consistency of the blocks. When a block satisfies consistency, the consensus verification for that block is considered successful; when a block does not satisfy consistency, the consensus verification for that block is considered a failure. Consistency can be simply understood as the consensus node's verification of the source of the received block. For example, when consensus node A sends a block to consensus node B for consensus verification, consensus node B's consistency verification includes: verifying whether the block received by consensus node B is the same as the block sent by consensus node A to consensus node B; if the block received by consensus node B is the same as the block sent by consensus node A to consensus node B, then the block satisfies consistency, indicating that the block has not been tampered with during its transmission from consensus node A to consensus node B; if the block received by consensus node B is different from the block sent by consensus node A to consensus node B, then the block does not satisfy consistency, indicating that the block has been tampered with during its transmission from consensus node A to consensus node B.
[0094] To further enhance the identification of the correctness of the content of transaction data itself, so as to improve the legitimacy of transaction data in the blockchain network; the legitimacy of transaction data can refer to the correctness of the information contained in the transaction data; for example, if the transaction data is a value-added tax invoice, then the legitimacy of the value-added tax invoice can refer to the fact that the amount contained in the value-added tax invoice is correct or meets the amount requirements. This application proposes a consensus scheme (or consensus processing scheme) that verifies the correctness of transaction data before it is uploaded to the blockchain network. This scheme adds one or more identification nodes to the blockchain network, each corresponding to one or more identification types. In the consensus verification process where consensus nodes in the blockchain network verify a target block (e.g., a block generated based on packaged target transaction data), the target identification node corresponding to the target identification type of the target transaction data can be used to identify the content of the target transaction data itself. This not only verifies the security of the target block (e.g., whether it has been tampered with) through the consensus nodes in the blockchain network, but also identifies (or checks) the legality of the information contained in the target transaction data (e.g., whether the information is correct), enabling timely interception of illegal data and thus improving the legality and security of data storage in the blockchain network.
[0095] To facilitate understanding of the consensus processing schemes mentioned above, the following will combine... Figure 1c This application provides a detailed description of the blockchain network (or blockchain system) comprising consensus nodes and identification nodes involved in its embodiments. For example... Figure 1cAs shown, the blockchain network may include multiple blockchain nodes; a blockchain node can refer to a computer device or an application running on a computer device (hereinafter referred to as an application). Computer devices may include, but are not limited to, smart devices such as smartphones, tablets, laptops, mobile internet devices, smart TVs, or head-mounted displays; applications running on computer devices can refer to computer programs designed to perform one or more specific functions, and may include, but are not limited to, clients installed on computer devices, small programs that can be used without downloading and installation, web applications opened through a browser, etc.
[0096] Each blockchain node in the blockchain network deploys a target configuration contract, which serves as the foundational contract at the system level. This target configuration contract can include the identification type corresponding to each identification node and the identification type to which the transaction data belongs. More specifically, the target configuration contract can be used to manage: the node type of the blockchain nodes in the blockchain network, the identification type corresponding to each identification node, the node identifier corresponding to each identification node, and at least one business contract that records the identification type to which the transaction data belongs. The following section describes the specific information regarding the management of the target configuration contract:
[0097] 1) The identity and address of consensus nodes and identification nodes. Specifically, the target configuration contract records the node type and node address of each blockchain node in the blockchain network; the node type of any blockchain node is used to indicate whether the blockchain node is used as a consensus node or an identification node in the blockchain network; the node address of any blockchain node can be used to uniquely identify the blockchain node in the blockchain network, and other blockchain nodes in the blockchain network can communicate with the blockchain node based on the node address of the blockchain node.
[0098] 2) Identification type corresponding to the identification node. Identification types in the blockchain network may include, but are not limited to, one or more of the following: financial identification type, educational identification type, or transportation identification type. An identification node corresponding to any identification type can be used to process transaction data under that type to verify the correctness of the information contained in the transaction data itself. It is worth noting that each identification node can correspond to one or more identification types. See also... Figure 1cThe blockchain network includes node cluster 2 corresponding to identification type 1, node cluster 3 corresponding to identification type 2, and node cluster 4 corresponding to identification type 3. Identification nodes registered as identification type 1 can include identification node a and identification node b; identification nodes registered as identification type 2 can include identification node b, identification node c, and identification node d; and identification nodes registered as identification type 3 can include identification node e. Therefore, identification node b corresponds to two identification types: identification type 1 and identification type 2. Furthermore, identification nodes within the same identification type node cluster are equivalent and can be substituted for each other; in other words, the functions of each identification node within the same identification type node cluster are identical. This is hereby stated.
[0099] 3) At least one business contract. Each business contract records the identification type to which the transaction data belongs. That is, the business contract records which identification nodes corresponding to which identification type need to process each type of transaction data. When the target transaction data (such as any transaction data) is broadcast to the blockchain network in the form of a block, the identification nodes in the blockchain network will determine the identification type to which the target transaction data belongs based on the target business contract. When it is detected that the target transaction data belongs to one or more target identification types, the target identification node corresponding to each of the one or more target identification types in the blockchain network will process the target transaction data. This design supports the use of target identification nodes with the ability to process transaction data under target identification types. Compared to using a single comprehensive identification node to identify transaction data under all identification types, this design can achieve more effective and accurate identification of target transaction data, improving the professionalism of target transaction data identification.
[0100] Based on the above description, blockchain nodes in a blockchain network can be specifically divided into: at least one consensus node and at least one identification node. According to the different node types corresponding to the blockchain nodes (such as consensus nodes and identification nodes), the blockchain nodes included in the blockchain network can be divided into different node clusters; namely: node cluster 102 corresponding to consensus type, node cluster 103 corresponding to identification type 1, node cluster 104 corresponding to identification type 2, node cluster 105 corresponding to identification type 3, and so on. Each node cluster includes one or more blockchain nodes corresponding to the cluster type of that node cluster. The following provides a more detailed description of the consensus type node clusters and any identification type node clusters included in the blockchain network; wherein:
[0101] For example, node cluster 102 corresponding to the consensus type includes one or more consensus nodes with consensus functionality, supporting consensus verification of blocks according to the consensus algorithm. Each consensus node in the consensus cluster supports bidding for the right to propose blocks in the blockchain network; when any consensus node wins the right to propose a block, it can package the transaction data to generate a new block and broadcast the new block to the blockchain network, so that the other consensus nodes in the consensus cluster in the blockchain network can perform consensus verification of the new block; after the consensus verification of the new block is successful, each of the other consensus blocks connects the new blockchain to its own maintained blockchain to achieve distributed storage of the transaction data contained in the new block.
[0102] For example, node cluster 103 corresponding to identification type 1 includes one or more identification nodes corresponding to identification type 1. Each identification node only supports receiving blocks broadcast by consensus nodes and voting on blocks; it does not support the right to propose bidding blocks, nor does it support actively packaging blocks. Furthermore, identification nodes do not store detailed block data, only the block verification data; for example, they do not store the complete block (including the block header and block body), only the verification data, which may include, but is not limited to, the block header and Merkle root data. Of course, identification nodes can also store transaction data related to the identification node in the blockchain according to the business needs of the identification party; the specific transaction data to be synchronized is determined by the identification party's own needs. In one implementation, the block headers in the light node are not connected to form a blockchain, meaning the light node does not contain a blockchain. In another implementation, the block headers in the light node can still be connected to form a blockchain, and some blocks in the blockchain have empty block bodies (e.g., they do not contain input information), while some blocks have non-empty block bodies (e.g., they contain transaction data related to the light node).
[0103] It is worth noting that, such as Figure 1c For details regarding the node clusters corresponding to other identification types in the blockchain network shown, please refer to the above description of the relevant content of node cluster 103 corresponding to identification type 1, which will not be repeated here. Furthermore, the types and number of identification types included in the blockchain network can be customized according to business needs; this application embodiment does not limit the types and number of identification types in the blockchain network.
[0104] based on Figure 1c The diagram shows the architecture of the blockchain system. An exemplary flow of the consensus processing scheme provided in this application embodiment can be found in [reference needed]. Figure 1d The flowchart shown is as follows. Figure 1dAs shown, the general process of this consensus processing scheme can include: First, after the target consensus node (such as any consensus node) in the node cluster (or consensus cluster) corresponding to the consensus type wins the proposal permission in the blockchain network, the target consensus node can package the target transaction data in the transaction set to generate a target block; and broadcast the target block to the blockchain network. Then, other consensus nodes in the blockchain network, except for the target consensus node, can perform consensus verification on the target block according to the consensus algorithm, obtain consensus votes, and return the consensus votes to the target consensus node. At the same time, each identification node in the node cluster corresponding to each identification type in the blockchain network can receive the broadcast target block; then, each identification node determines whether it has the ability or permission to identify the target transaction data in the target block according to the target business contract in the target configuration contract. If the target business contract records target transaction data belonging to a target identification type, and the target identification node corresponds to the target identification type, then the target identification node is determined to have the authority to identify the target transaction data. The target identification node can then process the target transaction data, obtain an identification voting result, and return this result to the target consensus node. This identification voting result indicates whether the target identification node successfully or failed to identify the information contained in the target transaction data. Finally, the target consensus node can determine the target consensus node based on the received consensus vote, and determine the target identification result based on the received identification voting result; and based on the target consensus result and the target identification result, the target block is added to the blockchain.
[0105] Therefore, in the consensus-building process for the target block generated from packaged target transaction data, this application embodiment supports not only consensus-building by consensus nodes in the blockchain network, but also target identification nodes corresponding to the target identification type of the target transaction data, which perform identification processing on the content of the target transaction data itself. Furthermore, the target block is only uploaded to the blockchain after successful consensus-building and successful identification of the target transaction data. Through this scheme, not only can the security of the target block be ensured through consensus verification by consensus nodes, but the legitimacy of the target transaction data can also be ensured through identification by target identification nodes, thus enabling timely interception of illegitimate data.
[0106] It should be noted that when the embodiments of this application are applied to specific products or technologies, such as when the target consensus node obtains the target transaction data, it needs to obtain the permission or consent of the submitter of the target transaction data; and the collection, use and processing of related data need to comply with the relevant laws, regulations and standards of the relevant countries and regions, such as the data types stored in the blockchain network need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0107] Based on the consensus processing scheme based on the blockchain network described above, this application proposes a more detailed consensus processing method based on the blockchain network. The consensus processing method based on the blockchain network proposed in this application will be described in detail below with reference to the accompanying drawings.
[0108] Figure 2 This illustration shows a flowchart of a consensus processing method based on a blockchain network, provided by an exemplary embodiment of this application. This consensus processing method can be executed by a target consensus node (such as any consensus node in a consensus cluster) with consensus functionality. The consensus processing method may include, but is not limited to, steps S201-S204.
[0109] S201: Obtain the target transaction data, package the target transaction data, and generate the target block.
[0110] The target transaction data includes transaction information; for example, if the target transaction data is invoice data, then the transaction information contained in the target transaction dataset may include, but is not limited to, one or more of the following: the invoice issuer's identifier, the invoice recipient's identifier, the invoice type, the invoice issuance time, the invoice validity period, or the invoice amount; among which, the invoice issuer's identifier (or the invoice recipient's identifier) is an identity identifier used to represent the identity of the invoice issuer; the identity identifier may be a string composed of multiple characters, and the characters may include at least one of the following: Chinese characters (i.e., Chinese characters), English characters (i.e., letters), numbers, and punctuation marks (such as commas ",", periods ".", square brackets "【】").
[0111] In practice, the target transaction data can be stored in a transaction pool within the blockchain network. This transaction pool can be understood as storage space used to cache transaction data received in the blockchain network; specifically, it refers to the storage space allocated to the target consensus node for storing transaction data to be uploaded to the blockchain. The transaction data in the transaction pool is submitted by the data submitter, and this transaction data varies depending on the business type, such as invoice data or educational data. When the target consensus node wins the right to propose a block in the blockchain network, it can pull one or more transaction data items to be uploaded to the blockchain from the transaction pool, including the target transaction data. Then, the one or more transaction data items are packaged to generate the target block to be uploaded to the blockchain.
[0112] The target consensus node can use a hash algorithm to package one or more transaction data to construct a target block. Specifically, a hash algorithm is used to generate a digital signature for the target block. This digital signature is a string of numbers that only the sender of the information (i.e., the target consensus node) can generate and that cannot be forged by others. This string of numbers also serves as valid proof of the authenticity of the information sent by the sender (such as the target transaction data). When other consensus nodes subsequently verify the target block, they can verify the identity of the sender by checking the digital signature, thereby ensuring that the target block has not been tampered with during transmission. The hash algorithm may include, but is not limited to, MD4 (MessageDigest4), MD5 (MessageDigest5), SHA1 (Secure Hash Algorithm1), etc. For the same hash algorithm, the same input will always produce the same output, and different inputs will always produce different outputs. Specifically, the transaction data in the target block (such as the target transaction data) is used as input to the hash algorithm, and the output is the digital signature of the target block. This application does not limit the specific hash algorithm used.
[0113] S202: Broadcast the target block across the blockchain network.
[0114] After successfully packaging the target transaction data into a target block, the target consensus node can broadcast the target block to the blockchain network so that every blockchain node in the network can receive the target block. As described above, each blockchain node in the blockchain network maintains a list of node identifiers. The target consensus node can then use this list to find the node identifiers (or node addresses, used to uniquely identify blockchain nodes) of other blockchain nodes in the network. Based on these node identifiers, the target block is then sent to the corresponding blockchain node, thus achieving the broadcasting of the target block.
[0115] Optionally, the target consensus node can send the target block to each blockchain node based on the node identifier of each blockchain node (such as the consensus node and the identification node); an exemplary implementation of this broadcast method can be found in [reference needed]. Figure 3a As shown, assuming the blockchain network includes target consensus node 301, consensus node 302, consensus node 303, identification node 304, and target identification node 305, then target consensus node 301 can send the target block to each of consensus node 302, consensus node 303, identification node 304, and target identification node 305 according to the node identifiers of each blockchain node recorded in the node identifier list, so as to broadcast the target block in the blockchain network.
[0116] Optionally, the target consensus node may also send the target block to some blockchain nodes in the blockchain network according to broadcast rules, so that these blockchain nodes can continue to forward the received target block to other blockchain nodes that have not received the target block. The broadcast rules may include, but are not limited to: the target consensus node sending the target block to some blockchain nodes that are less than a distance threshold, so that these blockchain nodes forward the target block; or, the target consensus node randomly sending the target block to some blockchain nodes, so that these blockchain nodes forward the target block; etc. This application embodiment does not limit the specific implementation of the broadcast rules.
[0117] Taking the broadcast rule, which includes: the target consensus node sending the target block to some blockchain nodes whose distance is less than a distance threshold, as an example, combined with... Figure 3b An exemplary process for broadcasting the target block under this broadcast rule is given. For example... Figure 3b As shown, assuming the blockchain network includes target consensus node 301, consensus node 302, consensus node 303, identification node 304, and target identification node 305, with a distance threshold of 70 meters; and the distance between target consensus node 301 and consensus node 302 is 30 meters, the distance between target consensus node 301 and consensus node 303 is 100 meters, the distance between target consensus node and identification node 304 is 50 meters, and the distance between target consensus node and target identification node 304 is 80 meters; then target consensus node 301 can determine the node identifier of consensus node 302 and the node identifier of identification node 304 from its maintained node identifier list, and send the target block to consensus node 302 and identification node 304. Furthermore, if the distance between consensus node 302 and consensus node 303 is 200 meters, the distance between identification node 304 and consensus node 303 is 60 meters, and the distance between consensus node 302 and target identification node 305 is 200 meters, and the distance between identification node 304 and target identification node 305 is 60 meters, then it is determined that the distance of 60 meters between identification node 304 and consensus node 303 is less than the distance threshold of 70 meters, and the distance of 60 meters between identification node 304 and target identification node 305 is less than the distance threshold of 70 meters. Therefore, identification node 304 can forward the received target block to consensus node 303 and target identification node 305.
[0118] It should be noted that the above are only two exemplary implementation processes for broadcasting target blocks in a blockchain network; in practical applications, the broadcasting process for target blocks can also vary, and the specific implementation process of the broadcasting process is not limited in this application embodiment; for example, depending on the identification type, the target consensus node can send the target block to any identification node in the node cluster corresponding to each identification type, so that any identification node can broadcast the target block to other identification nodes within its cluster. For ease of explanation, the following explanation will use the example of the target consensus node sending the target block to each blockchain node separately.
[0119] Furthermore, before packaging the target transaction data into a target block, this embodiment of the application also supports checking whether the target identification node is available. The packaging process for the target transaction data is only executed when the target identification node is available. This ensures that each packaged target block can be identified by the target identification node, thus ensuring that each target block is a successfully identified block. The availability of the target identification node can be manifested as the target consensus node successfully establishing a communication connection with the target identification node. In other words, before the target consensus node packages the target transaction data, the communication connection between the target consensus node and the target identification node must be checked. Only after a successful communication connection is established is the communication connection between the target consensus node and the target identification node checked. Reasons for the target identification node being unavailable may include, but are not limited to, target identification node downtime, network unreachability, and target identification node inaccessibility. This embodiment of the application does not limit the specific reasons for the target identification node being unavailable.
[0120] In the specific implementation, before packaging the target transaction data, the target node identifier of the target identification node corresponding to the target identification type can be obtained first, where the target transaction data to be packaged belongs to the target identification type. If the target consensus node successfully establishes a communication connection with the target identification node based on the target node identifier, the target consensus node begins the implementation process of packaging the target transaction data. If the target consensus node cannot establish a communication connection with the target identification node based on the target node identifier, it is determined that the target identification node is unavailable, and the packaging process of the target transaction data is not executed first; instead, the packaging process of other transaction data (other than the target transaction data belonging to the target identification type) can be executed first. Furthermore, if the target consensus node detects that the communication connection with the target identification node is broken during the packaging process of the target transaction data, it indicates that the target identification node is unavailable at this time, and the packaging process of the target transaction data (or block production) can be paused; when the communication connection with the target identification node is subsequently restored, the packaging process of the target transaction data can continue, generating the target block.
[0121] Therefore, the method provided in this application, which only performs the packaging of target transaction data into a block when the target identification node is detected as an available node, can avoid the failure to identify the target transaction data or the direct skipping of the identification of the target transaction data due to the unavailability of the target identification node when the block is successfully produced, thus ensuring that the target block of each block can be identified by the target identification node.
[0122] S203: Receive the target consensus result and target identification result of the target block.
[0123] S204: Based on the target consensus results and target identification results, the target block is processed for on-chain processing.
[0124] In steps S203-S204, after the target consensus node broadcasts the target block to the blockchain network, it can also receive voting results returned by various blockchain nodes. In this embodiment, the voting results may include: ① Consensus voting results generated by nodes performing consensus verification on the target block. The consensus voting result generated by any consensus node performing consensus verification on the target block indicates whether the consensus verification of the target block by any consensus node is successful or unsuccessful. Wherein: successful consensus verification indicates that the consensus node determines that the target block was sent by the target consensus node, i.e., that the target block has not been tampered with during transmission; unsuccessful consensus verification indicates that the consensus node determines that the target block was not sent by the target consensus node, and that the target block may have been tampered with during transmission. ② Identification voting results generated by the target identification node performing identification processing on the target transaction data in the target block. The identification voting result indicates whether the target identification node successfully identified the target transaction data or failed to identify the target transaction data. Successful identification of target transaction data can be used to indicate that the target identification node determines that the transaction information contained in the target transaction data is correct, such as the transaction information matching the target identification type corresponding to the target identification node, or the specific content of the transaction information meeting ethical requirements.
[0125] In specific implementation, the process of the target consensus node generating the target consensus result and the target identification result, and then processing the target block on the chain based on the target consensus result and the target identification result, may include steps s11-s13, wherein:
[0126] S11: The target consensus node receives consensus voting results for the target block returned by various consensus nodes in the blockchain network. Then, it counts the first votes indicating successful consensus for the target block and generates the target consensus node based on these first votes. Specifically, if the first vote count is greater than a first threshold, the target consensus result indicates successful consensus for the target block; conversely, if the first vote count is less than or equal to the first threshold, the target consensus result indicates failed consensus for the target block. For example, assuming the first threshold is 60, and the blockchain network includes 100 consensus nodes besides the target consensus node, the target consensus node, after broadcasting the target block to the blockchain network, can receive 100 consensus voting results. If 80 of these 100 consensus votes indicate successful consensus for the target block, then the target consensus result is generated based on these first votes, indicating successful consensus for the target block. Any consensus node can invoke a consensus algorithm to verify the target block, and can also invoke a consensus algorithm to verify the consensus of pre-transfer blocks. Several exemplary consensus algorithms are given below:
[0127] 1) Pow (Proof-of-Work) refers to a measurement method set up by a system (such as the aforementioned data sharing system) to achieve a certain goal. Simply put, it's a proof used to confirm workload. Essentially, whoever does more work has a greater chance of receiving additional rewards.
[0128] 2) Proof-of-Stake (PoS) is a consensus mechanism within Proof-of-Work (PoW). Specifically, the longer a node holds electronic resources (holding time = quantity of electronic resources * holding time), the greater its chance of acquiring the right to record blocks. Electronic resources refer to resources stored electronically in electronic accounts and tradable via the internet. The consensus verification difficulty is proportionally reduced based on the proportion and duration of each node's electronic resources, thus accelerating the search for random numbers. While PoS shortens the consensus time to some extent, it still requires consensus verification.
[0129] 3) PBFT (Practical Byzantine Fault Tolerance) is a message-passing-based consensus algorithm. It achieves consensus through three phases, which may be repeated if failures occur. Specifically, assuming a total of 3f+1 nodes, where f represents the Byzantine faulty node, first, when a node discovers that the leader (e.g., a representative node, ledger node, or supernode) is acting maliciously, it elects another replica node as the new leader. Second, the leader broadcasts its chosen value to the other replica nodes via a pre-prepare message. Other replica nodes send a prepare message if they accept it, otherwise they do not. Third, once 2f nodes accept the prepare message, the node sends a commit message. Finally, when 2f+1 nodes accept the commit message, the value is considered finalized. The above process enables the PBFT Byzantine Fault Tolerance algorithm to reach a consensus that each node is composed of any party in the business, and the security and stability are guaranteed by the business stakeholders; moreover, the consensus latency is about 2 to 5 seconds, which basically meets the requirements of commercial real-time processing, improves consensus efficiency, and can meet the needs of high-frequency trading volume.
[0130] 4) Paxos (a distributed algorithm) is a two-phase algorithm with three main roles: proposer, acceptor, and learner. The proposer proposes a proposal, the acceptor agrees or rejects, and the learner obtains the final value after consensus is reached. The Paxos algorithm consists of two phases: ① Preparation phase: The proposer selects a proposal number n and sends a prepare request to a majority of acceptors; after receiving the prepare request, if the acceptor's proposal number is greater than all prepare requests it has already responded to, the acceptor replies to the proposer with the proposal it previously accepted and promises not to respond to proposals less than n. ② Approval Phase: Once a proposer receives responses from a majority of acceptors to the prepare request, it enters the approval phase. It sends an accept request to the acceptors who responded to the prepare request, including the number n and the value (if there is no value that has already been accepted, it can freely decide the value). Without violating its commitments to other proposers, the acceptor accepts the request upon receiving it.
[0131] 5) The Raft algorithm (a distributed consensus algorithm) includes three roles: follower, candidate, and leader. A node can only be in one of these three states at any given time, and these roles can transform into each other over time and under changing conditions. All nodes initially start as followers. Followers that do not receive a heartbeat within a timeout period become candidates and broadcast a vote request. The node that receives a majority of votes becomes the leader. In this round of voting, whoever sends the request first has the advantage, and each node only gives one vote. The leader node periodically sends heartbeats to other nodes. Leader node failure will trigger a new round of voting.
[0132] This application does not limit which consensus algorithm or one consensus algorithm is used in the embodiments, which is not specified here.
[0133] s12: The target consensus node also receives the identification voting results returned by the target identification node and generates a target identification result based on the identification voting results. This target identification result is used to indicate whether the target transaction data in the target block has been successfully identified, or whether the target transaction data in the target block has failed to be identified. The process of receiving the identification voting results from the target consensus node and generating the target identification result based on the identification voting results differs depending on the number of identification types to which the target transaction data belongs in the target business contract. The following details the specific implementation process of generating the target identification result based on the identification voting results, assuming the number of target identification types to which the target transaction data belongs is 1, and the number of target identification types is 2, such as the target identification types including a first target identification type and a second target identification type.
[0134] In one implementation, the number of target identification types is 1. Specifically, the target consensus node receives the identification voting results for the target transaction data in the target block, returned by each target identification result corresponding to the target identification type; then, it counts the second votes indicating that the target transaction data identification has passed, and generates a target identification result based on the second vote count. If the second vote count is greater than a second threshold, the target identification result indicates that the target transaction data in the target block has been successfully identified; conversely, if the second vote count is less than or equal to the second threshold, the target identification result indicates that the target transaction data in the target block has failed to be identified. For example, such as... Figure 4aAs shown, if the second quantity threshold is 2, the number of target identification nodes corresponding to the target identification type is 5; then after the target consensus node broadcasts the target block, it can receive 5 identification voting results; if 3 of the 5 identification voting results indicate that the target transaction data has been successfully identified, then the target identification result generated based on the second vote indicates that the target transaction data has been successfully identified.
[0135] In other implementations, the number of target identification types is two. Specifically, assuming the target identification types include a first target identification type and a second target identification type, after the target consensus node broadcasts the target block to the blockchain network, it can receive the first identification voting results returned by each target identification node corresponding to the first target identification type. Then, it counts the number of first identification votes indicating that the target transaction data has been identified, and generates a first identification result based on the number of first identification votes. It can also receive the second identification voting results returned by each target identification node corresponding to the second target identification type. Then, it counts the number of second identification votes indicating that the target transaction data has been identified, and generates a second identification result based on the number of second identification votes. Finally, it generates a target identification result based on the first and second identification results.
[0136] Specifically, if the first number of identification votes is greater than the third threshold, then the first identification result generated based on the first number of identification votes indicates that the target transaction data in the target block has been successfully identified. If the second number of identification votes is greater than the fourth threshold, then the second identification result generated based on the first number of identification votes indicates that the target transaction data in the target block has been successfully identified. Furthermore, if both the first identification result and the second identification result indicate that the target transaction data has been successfully identified, then the target identification result generated based on the first and second identification results indicates that the target transaction data in the target block has been successfully identified.
[0137] For example, such as Figure 4bAs shown, if the third and fourth quantity thresholds are both 2, the number of target identification nodes corresponding to the first target identification type is 4, and the number of target identification nodes corresponding to the second target identification type is 3. Then, after broadcasting the target block, the target consensus node can receive 4 first identification votes sent by the target identification nodes corresponding to the first target identification type. If 3 out of the 4 first identification votes indicate successful identification of the target transaction data, then the first identification result generated based on the first identification vote count indicates successful identification of the target transaction data. Then, if 3 out of the 3 second identification votes received from the target identification results corresponding to the second target identification type indicate successful identification of the target transaction data, then the second identification result generated based on the second identification vote count indicates successful identification of the target transaction data. Furthermore, based on both the first and second identification results indicating successful identification of the target transaction data, the generated target identification result indicates successful identification of the target transaction data. In addition, if the first identification result is that the target transaction data identification fails, or the second identification result is that the target transaction data identification fails, or both the first identification result and the second identification result are that the target transaction data identification fails, then the target identification result generated based on the first identification result and the second identification result is determined to be that the target transaction data identification fails. This will not be described in detail here.
[0138] S13: Process the target block based on the target consensus result and the target identification result. Specifically, if the target consensus result indicates that the target block consensus is successful, and the target identification result indicates that the target transaction data in the target block is successfully identified, then the target block is stored on the blockchain in the blockchain network to achieve distributed storage of the target transaction data in the blockchain network. Conversely, if the target consensus result indicates that the target block consensus fails, or the target identification result indicates that the target transaction data in the target block fails to be identified, or both the target consensus result and the target identification result indicate identification failure, then the target transaction data is removed, and the transaction data contained in the target block other than the target transaction data is returned to the transaction pool to await packaging in the next block production.
[0139] like Figure 5As shown, after the target consensus node broadcasts the target block in the blockchain network, it can receive consensus voting results returned by other consensus nodes in the blockchain network, and determine the target consensus result based on the consensus voting results. Similarly, it receives the identification voting results returned by the target identification node and generates the target identification result based on the identification voting results. The specific implementation process of determining the target consensus result based on the consensus voting results and generating the target identification result based on the identification voting results can be found in the aforementioned descriptions and will not be repeated here. Furthermore, if the target consensus result indicates that the target block consensus is successful, and the target identification result indicates that the target transaction data is successfully identified, the target consensus node stores the target block on the blockchain in the blockchain network, specifically on the blockchain maintained by the target consensus node, and synchronously stores the target block through other consensus nodes in the blockchain network to achieve distributed storage of the target block. Conversely, if the target consensus result indicates that the target block consensus fails, and / or the target identification result indicates that the target transaction data identification fails, the target transaction data can be deleted, and the other transaction data included in the target block can be returned to the transaction pool to await the next block production.
[0140] In this embodiment of the application, during the consensus process for the target block generated by packaging the target transaction data, a target identification node corresponding to the target identification type to which the target transaction data belongs is introduced to identify and process the target transaction data in the target block. This enables timely interception of illegal data, thereby ensuring that the target block that can be uploaded to the chain is not only successfully verified through consensus, but also that the target transaction data in the target block is successfully identified. This improves the legitimacy of the target transaction data uploaded to the chain, and thus enhances the security of the data stored in the blockchain network.
[0141] Figure 6 This illustration shows a flowchart of a consensus processing method based on a blockchain network, provided by an exemplary embodiment of this application. This consensus processing method can be executed by a target identification node. The consensus processing method may include, but is not limited to, steps S601-S603:
[0142] S601: Receive the target block broadcast by the target consensus node in the blockchain network.
[0143] S602: Identify and process the target transaction data in the target block to obtain the identification voting results.
[0144] In steps S601-S602, after receiving the target block broadcast by the target consensus node, the target identification node can obtain the identification rules corresponding to the target transaction data in the target block. Then, the target identification node performs identification processing on the target transaction data according to the identification rules to obtain an identification voting result. This identification voting result indicates that the target transaction data has passed the identification according to the identification rules, which means that the target transaction data meets the identification rules. Alternatively, the identification voting result indicates that the target transaction data has failed the identification according to the identification rules, which means that the target transaction data does not meet the identification rules. The identification rules obtained by the target identification node are provided by the identification party and are used to identify the correctness of the transaction information contained in the target transaction data. When the identification voting result indicates that the target transaction data has passed the identification, it is determined that the transaction information contained in the target transaction data is correct.
[0145] It is particularly noteworthy that the identification rules acquired by the target identification node differ depending on the identifying party corresponding to it. This means that different target identification nodes perform different types of identification on the target transaction data, not only satisfying the need for different identifying parties to simultaneously process the target transaction data, but also enabling multi-dimensional identification of the target transaction data and ensuring its legality. For example, such as... Figure 7a As shown, assuming the target transaction data belongs to both financial identification type and traffic identification type, and the target identification node a corresponding to the financial identification type includes the computer equipment used by the finance department, and the target identification node b corresponding to the traffic identification type includes the computer equipment used by the entertainment company; then, after receiving the target block, target identification node a can obtain the first identification rule formulated by the finance department and use the first identification rule to identify the target transaction data in the target block; similarly, after receiving the target block, target identification node b can obtain the second identification rule formulated by the entertainment company and use the second identification rule to identify the target transaction data in the target block.
[0146] It should also be noted that the identification rules provided by the same identification party may differ at different times; this satisfies the identification party's need to customize identification rules according to business requirements, thereby improving the identification capability of the target identification node. For example, such as Figure 7bAs shown, assuming the target transaction data belongs to the financial identification type, and the target identification node corresponding to the financial identification type includes the computer equipment used by the finance department; if the finance department provides a third identification rule when the target identification node receives the target block at the first moment, then the target identification node will identify and process the transaction data contained in the target block according to the third identification rule; if the finance department provides a fourth identification rule when the target identification node receives the target block at the second moment, then the target identification node can identify and process the transaction data contained in the target block according to the fourth identification rule; where the first moment and the second moment are different, the first identification rule and the second identification rule are different.
[0147] S603: Return the identified voting results to the target consensus node.
[0148] After identifying the target transaction data, the target identification node can return the identification voting result to the target consensus node based on the node identifier of the target consensus node. This allows the target consensus node to obtain the target identification result of the target block based on the identification voting result, and then process the target block for on-chain processing based on the target identification result and the target consensus result. The target consensus result is generated by the target consensus node based on the consensus voting result, which is obtained through consensus among the consensus nodes in the blockchain network. For details on how the target consensus node determines the target identification result and the target consensus node, as well as the specific implementation process of on-chaining the target block, please refer to [link to relevant documentation]. Figure 2 The specific implementation process shown will not be elaborated upon here.
[0149] Furthermore, if the target identification node fails to identify the target transaction data in the target block, this embodiment also supports the target identification node returning the reason for the failure to the target consensus node. This allows the target consensus node to relay the reason for the failure to the submitter of the target transaction data, enabling the submitter to understand the reason for the failure and make timely adjustments. Specifically, if the identification voting result indicates that the target transaction data identification fails, target feedback information is generated. This feedback information indicates the reason for the failure. For example, if the target transaction data is invoice data, incorrect invoice information may include incorrect invoice issuer, incorrect invoice issuance time, or incorrect invoice amount, etc. This embodiment does not limit this. Based on the reason for the incorrect invoice information, corresponding target feedback information can be generated. For example, if the reason for incorrect invoice information includes an incorrect invoice issuer, the generated target feedback information could be "Invoice data upload failed, reason: Invoice issuer error!". Then, the target identification node sends the generated target feedback information to the target consensus node; thus, when the target consensus node detects that the target identification result indicates that the target block identification has failed, it can receive the target feedback information and send it to the submitter of the target transaction data. A schematic diagram of sending target feedback information to the submitter can be found here. Figure 8 .
[0150] It should be understood that when two or more target identification nodes fail to identify the target transaction data, each failed target identification node can return its generated target feedback information to the target consensus node. In this case, the target consensus node can directly forward the received multiple target feedback messages to the submitter of the target transaction data. Optionally, the target consensus node can also integrate the received multiple target feedback messages and then send the integrated feedback information to the submitter of the target transaction data. This application embodiment does not limit this.
[0151] In this embodiment, during the consensus process for the target block, the target identification node can identify the target transaction data in the broadcast target block, such as whether the target transaction data meets business requirements (e.g., whether the data type of the target transaction data matches the target identification type corresponding to the target identification node), to detect the legality of the target transaction data; and send the identification voting results to the target consensus node, so that the target consensus node will only upload the target block to the chain if it determines that the consensus on the target block is successful and the identification of the target transaction data is successful; this not only ensures the security of the target block through the consensus verification of the consensus node, but also ensures the legality of the target transaction data through the identification of the target identification node.
[0152] It is worth noting that the blockchain network involved in this application embodiment may include a single-layer, two-layer, or multi-layer network. Here, "layer" refers to the number of sub-networks contained in the blockchain network. The division of sub-networks may be based on considerations such as business needs, communication connections, and security. Inter-access between blockchain nodes belonging to the same sub-network is guaranteed by a consensus mechanism, while inter-access between blockchain nodes in different sub-networks requires additional identity management and / or network control. For example, Figure 1a The illustrated blockchain network is a single-layer blockchain network, in which secure access and data synchronization between blockchain nodes can be achieved through a consensus mechanism. In one implementation, the cross-blockchain processing method proposed in this application embodiment is applied to... Figure 1a In the single-layer blockchain network shown, under this implementation, the consensus node and identification node mentioned in the embodiments of this application belong to the blockchain nodes in the single-layer blockchain network.
[0153] In other implementations, the consensus processing method proposed in this application can be applied not only to the single-layer blockchain network described in the foregoing embodiments (such as a blockchain network containing only one element), but also to more complex two-layer or multi-layer blockchain networks. For example, when blockchain is applied in certain scenarios, such as bill business scenarios, data storage scenarios for government or commercial institutions, etc., not all nodes in the blockchain network have sufficient resources and necessity to become nodes with block consensus capabilities. Furthermore, for data security considerations, the common data peer-to-peer blockchain deployment method is not suitable when dealing with data with high security requirements within the blockchain system. To adapt to business needs (such as separation of internal and external networks, business networks, and office networks), and to further improve data security and confidentiality, this application provides a two-layer chain, forming a two-layer network architecture of "witness sub-network - consensus sub-network" through a P2P (Peer to Peer) network. Here, the P2P network is a peer-to-peer connection network, and the nodes connected in a peer-to-peer manner are called peer nodes. P2P networks are based on a specific network protocol that eliminates the need for a central node to maintain the network state. Each node maintains the overall network state and its connection status with neighboring nodes through broadcast interactions with neighboring nodes.
[0154] Figure 9 This application illustrates an exemplary embodiment of an architecture diagram of a two-layer blockchain network; as shown... Figure 9As shown, the blockchain network includes a witness subnetwork and a consensus subnetwork. Specifically: ① The witness subnetwork includes one or more business nodes, meaning these business nodes are deployed in the public witness subnetwork. These business nodes primarily execute business logic, do not participate in accounting consensus, and obtain block header data and partially authorized visible block data from the consensus subnetwork through identity authentication. ② The consensus subnetwork is the core network of the blockchain network, used for accounting consensus. It includes one or more consensus nodes (or accounting nodes), or as described above... Figure 1c The consensus subnetwork shown contains one or more node clusters, where consensus nodes or auditing nodes that run the blockchain consensus protocol are deployed. Therefore, the consensus verification of the aforementioned consensus nodes and the identification processing of the identification nodes are both performed in the consensus subnetwork within the two-layer network architecture. Typically, the witness subnetwork and the consensus subnetwork exist in different network environments: the witness subnetwork is in a public network, while the consensus subnetwork is in a private network. Since the consensus subnetwork is in a relatively secure private network, its mutual access is inherently secure due to the consensus mechanism, requiring no additional identity management or network control. However, business nodes are in a public network and may be accessed by other uncertain network terminals; therefore, the access of business nodes and other potential nodes to the consensus subnetwork needs to be strictly controlled.
[0155] Furthermore, the aforementioned witness sub-network and consensus sub-network can interact through a routing proxy network (or routing boundary network) between them. Specifically, the routing proxy network belongs to the blockchain network and is used to isolate the witness sub-network and consensus sub-network. The routing proxy network contains one or more routing proxy nodes, which can forward transaction data sent by business nodes in the witness sub-network to consensus nodes in the consensus sub-network, thereby improving the security of transaction data in the consensus sub-network. For a more detailed architectural diagram of the two-layer blockchain network provided in this embodiment, please refer to [link to relevant documentation]. Figure 10 .
[0156] like Figure 10As shown, the blockchain network includes a business layer, a routing proxy layer, and a core consensus network layer. These three layers constitute the complete blockchain business system. Specifically: ① The business layer is located in the witness sub-network and includes at least one business node, which can be an SPV node. The SPV node maintains a normal unstructured P2P network and can handle business such as taxation (local tax bureau), invoicing (corporate invoicing), and payment (corporate cash flow). ② The core consensus network layer is located in the consensus sub-network and includes multiple consensus nodes with consensus functions, such as consensus node 1001, consensus node 1002, consensus node 1003, etc. This core consensus network layer also includes identification nodes of different or the same identification type, added in this embodiment. ③ The routing proxy layer includes at least one proxy node, which can provide routing services, authentication services, certificate caching services, peer-to-peer (P2P) services, etc. The business layer and the core consensus network layer exchange information through the routing proxy layer. That is, the business layer submits business operation interactions to the core consensus network layer through the routing proxy layer. In this way, the routing proxy layer plays a role in isolating the business layer and the core consensus network layer.
[0157] The following is combined with Figure 11a A simple description of the two-layer network architecture is provided; such as Figure 11a As shown, the blockchain network includes a witness subnetwork, a routing proxy network, and a consensus subnetwork. ① Business nodes (such as SPV nodes) in the witness subnetwork can receive transaction data submitted by off-chain data submitters to be uploaded to the blockchain, as well as the data needed for synchronization from the core consensus subnetwork. ② The consensus subnetwork includes consensus nodes and identification nodes, used for consensus and identification of transaction data to be uploaded to the blockchain. ③ The routing proxy network records the node information of consensus nodes in the consensus subnetwork. Node information may include node identifiers, the chain identifier of the stored blockchain (such as the main business chain or a business branch chain), etc. When a routing proxy node in the routing proxy network encounters transaction data to be sent to a consensus node, it can forward the transaction data to the corresponding consensus node based on the node identifier, thereby realizing the transmission of transaction data from the witness subnetwork to the consensus subnetwork.
[0158] based on Figure 11a The description of the two-layer network architecture shown below, combined with... Figure 11a and Figure 11b The specific implementation of the consensus processing method proposed in this application embodiment under a two-layer network architecture is briefly described, wherein the consensus processing method may include steps s20-s29:
[0159] s20: The submitter can submit the target transaction data to the business node in the witness sub-network, so that the business node in the witness sub-network can generate a data submission request based on the target transaction data, which carries the target transaction data submitted by the submitter; then, the business node can send the data submission request to the routing agent network.
[0160] s21: The routing proxy network forwards the data submission request to the consensus subnetwork. In one implementation, if a service node in the witness subnetwork specifies a consensus node to receive the data submission request when sending it to the routing proxy network, the routing proxy node can directly send the data submission request to the specified consensus node (i.e., the target consensus node) in the consensus subnetwork, based on the specified recipient. One way to specify the consensus node to receive the data submission request is to include the node identifier of the consensus node in the data submission request. In another implementation, the routing proxy node can also randomly forward the data submission request to any consensus node in the consensus subnetwork, or forward the data submission request to the nearest consensus node.
[0161] It should be noted that this application embodiment does not limit the specific sending method used by the routing proxy network to forward data submission requests, which will not be explained here. Furthermore, based on security considerations for the consensus subnetwork, this application embodiment introduces a routing proxy network to isolate the witness subnetwork and the consensus subnetwork. However, in practical applications, the witness subnetwork and the consensus subnetwork can communicate directly, meaning that communication between the witness subnetwork and the consensus subnetwork does not need to be implemented by the routing proxy network.
[0162] s22: The target consensus node receives the data submission request sent by the routing proxy network, and performs block production processing based on the target transaction data carried in the data submission request to generate the target block.
[0163] s23: The target consensus node broadcasts the target block throughout the blockchain network so that every blockchain node in the network receives the broadcast target block. The blockchain nodes may include consensus nodes and identification nodes.
[0164] s24: After receiving the target block, other consensus nodes in the consensus sub-network perform consensus verification on the target block and generate a consensus vote result. This consensus vote result indicates whether the consensus verification of the target block passed or failed. Then, the other consensus node can return the consensus vote result to the target consensus node.
[0165] s25: The target identification node corresponding to the target identification type to which the target transaction data belongs identifies the target transaction data and generates an identification vote result; this identification vote result indicates whether the target transaction data is identified successfully or unsuccessfully. Then, the target identification node can return the identification vote result to the target consensus node.
[0166] The implementation of this application does not limit the execution order of steps s24 and s25, which is not specified here.
[0167] s26: The target consensus node receives the consensus voting results returned by the consensus node and the identification voting results returned by the target identification node; it generates the target consensus result based on the consensus voting results and the target identification result based on the identification voting results; then, if the target consensus result indicates successful consensus for the target block and the target identification result indicates successful identification of the target transaction data, the target block is stored on the blockchain to achieve distributed storage of the target transaction data. Conversely, if the target consensus result indicates failed consensus for the target block and / or the target identification result indicates failed identification of the target transaction data, the target transaction data is removed, and the other transaction data included in the target block is returned to the transaction pool to await the next block production. Further, step s27 can also be executed.
[0168] s27: If the target identification result indicates that the target transaction data identification has failed, the target identification node that indicates that the target transaction data identification has failed can also generate target feedback information and send the target feedback information to the target consensus node; the target feedback information is used to indicate the reason why the target identification node failed to identify the target transaction data.
[0169] s28: The target consensus node receives the target feedback information sent by each target identification node if the target transaction data identification fails, indicating that the identification of the target transaction data has failed; and sends the target feedback information to the routing proxy network.
[0170] s29: The routing agent network receives the target feedback information sent by the target consensus node in the consensus subnetwork and forwards the target feedback information to the business node in the witness subnetwork. This allows the business node to return the target feedback information to the submitter of the target transaction data, which helps the submitter understand the reason why the target transaction data failed to be identified and adjust the target transaction data in a timely manner.
[0171] It should be noted that the specific implementation process shown in steps s20-s29 above can be found in the aforementioned... Figure 2 as well as Figure 6 The specific implementation process described in the illustrated embodiments will not be repeated here.
[0172] In summary, on the one hand, the two-layer network architecture proposed in this application isolates the witness subnetwork and the consensus subnetwork through a routing proxy network, thereby improving the security of business data stored in the consensus subnetwork to a certain extent. On the other hand, in the consensus process for the target block generated based on the target transaction data, not only are consensus nodes in the blockchain network supported in reaching consensus on the target block, but also target identification nodes corresponding to the target identification type of the target transaction data are supported in identifying and processing the content of the target transaction data itself. Furthermore, the target block is only uploaded to the blockchain after both consensus on the target block and the target transaction data identification are successful. Through the above scheme, not only can the security of the target block be ensured through consensus verification by consensus nodes, but also the legality of the target transaction data can be ensured through identification by target identification nodes, thereby achieving timely interception of illegal data.
[0173] The methods of the embodiments of this application have been described in detail above. In order to facilitate better implementation of the methods of the embodiments of this application, the apparatus of the embodiments of this application is provided below.
[0174] Figure 12 This illustration shows a schematic diagram of a consensus processing device based on a blockchain network, provided in an exemplary embodiment of this application. The consensus processing device can be a computer program (including program code) running on a target consensus node (such as any consensus node); the consensus processing device can be used to execute... Figure 2 as well as Figure 11b The method embodiments shown include some or all of the steps. The blockchain network includes at least one consensus node and at least one identification node, each identification node corresponding to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type; the device is mounted on a target consensus node, which is any one of the at least one consensus node; the device includes the following units:
[0175] Acquisition unit 1201 is used to acquire target transaction data, which belongs to the target identification type.
[0176] Processing unit 1202 is used to package the target transaction data and generate the target block;
[0177] The processing unit 1202 is also used to broadcast the target block in the blockchain network, so that the consensus nodes in the blockchain network can reach a consensus on the target block, and to enable the target identification node corresponding to the target identification type to identify and process the target transaction data in the target block.
[0178] Processing unit 1202 is also configured to receive the target consensus result and target identification result of the target block; and,
[0179] The processing unit 1202 is also used to perform on-chain processing of the target block based on the target consensus result and the target identification result.
[0180] In one implementation, each node in the blockchain network deploys a target configuration contract, which includes: the identification type corresponding to each identification node and the identification type to which the transaction data belongs.
[0181] In one implementation, when processing unit 1202 performs on-chain processing on the target block based on the target consensus result and the target identification result, it is specifically used for:
[0182] If the target consensus result indicates that the target block consensus is successful, and the target identification result indicates that the target transaction data in the target block is successfully identified, then the target block will be stored on the blockchain in the blockchain network.
[0183] In one implementation, when the processing unit 1202 receives the target consensus result of the target block, it is specifically used for:
[0184] Receive the consensus voting results for the target block returned by each consensus node in the blockchain network;
[0185] The statistics indicate the first vote count for the consensus vote on the success of the target block consensus, and the target consensus result is generated based on the first vote count;
[0186] If the number of first votes is greater than the first quantity threshold, then the target consensus result indicates that the target block consensus is successful.
[0187] In one implementation, the number of target identification types is 1, and when the processing unit 1202 receives the target identification result of the target block, it is specifically used for:
[0188] Receive the voting results of the target transaction data in the target block returned by each target identification node corresponding to the target identification type;
[0189] The statistics indicate the second vote count of the identification voting results for the target transaction data, and generate the target identification result based on the second vote count;
[0190] If the second number of votes is greater than the second quantity threshold, then the target identification result indicates that the target transaction data in the target block has been successfully identified.
[0191] In one implementation, the target identification type includes a first target identification type and a second target identification type. When the processing unit 1202 receives the target identification result of the target block, it is specifically used for:
[0192] Receive the first identification voting results returned by each target identification node corresponding to the first target identification type;
[0193] The statistical indicator counts the first identification votes for the first identification voting results that have passed the identification of the target transaction data, and generates a first identification result based on the first identification vote count; and,
[0194] Receive the second identification voting results returned by each target identification node corresponding to the second target identification type;
[0195] The statistics indicate the number of second identification votes for the second identification voting results that have passed the identification of the target transaction data, and generate a second identification result based on the number of second identification votes;
[0196] Target identification results are generated based on the first and second identification results;
[0197] Specifically, if the number of first identification votes is greater than the third quantity threshold, the first identification result indicates that the target transaction data in the target block has been successfully identified; if the number of second identification votes is greater than the fourth quantity threshold, the second identification result indicates that the target transaction data in the target block has been successfully identified; if both the first and second identification results indicate successful identification, the target identification result indicates that the target transaction data in the target block has been successfully identified.
[0198] In one implementation, the processing unit 1202 is further configured to:
[0199] If the target identification result indicates that the target transaction data in the target block has failed to be identified, then the target feedback information sent by each target identification node, which indicates that the target transaction data has failed to be identified, is received. The target feedback information is used to indicate the reason why the target identification node failed to identify the target transaction data.
[0200] Send the target feedback information to the party that submitted the target transaction data.
[0201] In one implementation, the target configuration contract also includes a node identifier for each identified node, and the processing unit 1202 is further used for:
[0202] Obtain the target node identifier of the target recognition node corresponding to the target recognition type;
[0203] If a communication connection is successfully established between the target node identifier and the target identification node, the step of packaging the target transaction data and generating the target block is triggered.
[0204] In one implementation, the processing unit 1202 is further configured to:
[0205] If a communication connection with the target identification node is detected to be broken during the packaging process of the target transaction data, the packaging process of the target transaction data will be paused.
[0206] When the communication connection with the target identification node is restored, the target transaction data continues to be packaged and processed.
[0207] According to one embodiment of this application, Figure 12 The consensus processing device based on the blockchain network shown can be composed of various units, either individually or entirely, combined into one or more other units. Alternatively, some units can be further divided into functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the consensus processing device based on the blockchain network may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units. According to another embodiment of this application, the device can be configured to perform functions such as those described above by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 2 as well as Figure 11b The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 12 The diagram illustrates a consensus processing apparatus based on a blockchain network, and a consensus processing method based on a blockchain network for implementing embodiments of this application. The computer program may be recorded on, for example, a computer-readable recording medium, loaded onto the aforementioned computing device via the computer-readable recording medium, and run therein.
[0208] In this embodiment, during the consensus process for the target block generated by packaging target transaction data, not only are consensus nodes in the blockchain network supported in reaching a consensus on the target block, but also target identification nodes corresponding to the target identification type of the target transaction data are supported in identifying and processing the content of the target transaction data itself. Furthermore, the target block is only uploaded to the blockchain after both consensus on the target block and successful identification of the target transaction data. Through this scheme, not only can the security of the target block be ensured through consensus verification by consensus nodes, but the legitimacy of the target transaction data can also be ensured through identification by target identification nodes.
[0209] Figure 13This illustration shows a schematic diagram of a consensus processing device based on a blockchain network, provided in an exemplary embodiment of this application. The consensus processing device can be a computer program (including program code) running on a target audit node (such as any audit node); the consensus processing device can be used to execute... Figure 6 as well as Figure 11b The method embodiments shown include some or all of the steps. The blockchain network includes at least one consensus node and at least one identification node, each identification node corresponding to one or more identification types, and each identification node is used to identify transaction data under the corresponding identification type; the device is mounted on the target identification node corresponding to the target identification type; the device includes the following units:
[0210] The receiving unit 1301 is used to receive the target block broadcast by the target consensus node in the blockchain network; the target consensus node is any one of at least one consensus node included in the blockchain network; the target block is obtained by the target consensus node based on the target transaction data; the target transaction data belongs to the target identification type;
[0211] Processing unit 1302 is used to identify and process target transaction data in the target block to obtain identification voting results;
[0212] The processing unit 1302 is also used to return the identification voting result to the target consensus node, so that the target consensus node can vote to obtain the target identification result of the target block based on the identification voting result, and perform on-chain processing on the target block based on the target identification result and the target consensus result; the target consensus result is generated by the target consensus node based on the consensus vote, and the consensus vote is obtained by the consensus nodes in the blockchain network to reach a consensus on the target block.
[0213] In one implementation, the processing unit 1302 is used to identify target transaction data in the target block, and when obtaining the identification voting result, it is specifically used for:
[0214] Obtain the identification rules corresponding to the target transaction data; the identification rules are provided by the identification party.
[0215] The target transaction data is identified and processed according to the identification rules to obtain the identification voting results;
[0216] The identification rules are used to identify the correctness of the transaction information contained in the target transaction data; when the identification voting result indicates that the target transaction data has passed the identification, it is determined that the transaction information contained in the target transaction data is correct.
[0217] In one implementation, the processing unit 1302 is further configured to:
[0218] If the voting results indicate that the target transaction data identification fails, target feedback information is generated to indicate the reason why the target transaction data identification failed.
[0219] The target feedback information is sent to the target consensus node so that when the target consensus node detects that the target identification result indicates that the target block identification has failed, it sends the target feedback information to the submitter of the target transaction data.
[0220] According to one embodiment of this application, Figure 13 The consensus processing device based on the blockchain network shown can be composed of various units, either individually or entirely, combined into one or more other units. Alternatively, some units can be further divided into functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the consensus processing device based on the blockchain network may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units. According to another embodiment of this application, the device can be configured to perform functions such as those described above by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 6 as well as Figure 11b The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 13 The diagram illustrates a consensus processing apparatus based on a blockchain network, and a consensus processing method based on a blockchain network for implementing embodiments of this application. The computer program may be recorded on, for example, a computer-readable recording medium, loaded onto the aforementioned computing device via the computer-readable recording medium, and run therein.
[0221] In this embodiment, during the consensus process for the target block, the target identification node can identify the target transaction data in the broadcast target block, such as whether the target transaction data meets business requirements (e.g., whether the data type of the target transaction data matches the target identification type corresponding to the target identification node), to detect the legality of the target transaction data; and send the identification voting results to the target consensus node, so that the target consensus node will only upload the target block to the chain if it determines that the consensus on the target block is successful and the identification of the target transaction data is successful; this not only ensures the security of the target block through the consensus verification of the consensus node, but also ensures the legality of the target transaction data through the identification of the target identification node.
[0222] Figure 14 This application shows a schematic diagram of the structure of a blockchain node device provided in an exemplary embodiment; please refer to [link to relevant documentation]. Figure 14 The blockchain node device includes at least a processor 1401, a communication interface 1402, and a computer-readable storage medium 1403. The terminal includes a processor 1401, a communication interface 1402, and a computer-readable storage medium 1403. The processor 1401, communication interface 1402, and computer-readable storage medium 1403 can be connected via a bus or other means. The communication interface 1402 is used to receive and send data. The computer-readable storage medium 1403 can be stored in the memory of the blockchain node device. The computer-readable storage medium 1403 stores computer programs, including program instructions. The processor 1401 executes the program instructions stored in the computer-readable storage medium 1403. The processor 1401 (or CPU (Central Processing Unit)) is the computing and control core of the blockchain node device, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve corresponding methods or functions.
[0223] This application embodiment also provides a computer-readable storage medium (Memory), which is a memory device in a blockchain node device for storing programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the blockchain node device and extended storage media supported by the blockchain node device. The computer-readable storage medium provides storage space that stores the processing system of the blockchain node device. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by the processor 1401, which can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM memory or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer-readable storage medium located remotely from the aforementioned processor.
[0224] In one embodiment, the computer-readable storage medium stores one or more instructions; the processor 1401 loads and executes one or more instructions stored in the computer-readable storage medium to implement the corresponding steps in the above-described consensus processing method embodiment; specifically, the blockchain network includes at least one consensus node and at least one identification node, each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type; the device is mounted on a target consensus node, which is any one of the at least one consensus node; the one or more instructions in the computer-readable storage medium are loaded by the processor 1401 and executed in the following steps:
[0225] Acquire target transaction data, which falls under the target identification type;
[0226] Package the target transaction data to generate the target block;
[0227] The target block is broadcast in the blockchain network, so that the consensus nodes in the blockchain network can reach a consensus on the target block, and the target identification nodes corresponding to the target identification type can identify and process the target transaction data in the target block.
[0228] Receive the target consensus result and target identification result of the target block; and,
[0229] Based on the target consensus results and target identification results, the target block is processed and added to the blockchain.
[0230] In one implementation, each node in the blockchain network deploys a target configuration contract, which includes: the identification type corresponding to each identification node and the identification type to which the transaction data belongs.
[0231] In one implementation, when one or more instructions in the computer-readable storage medium are loaded by the processor 1401 and executed to process the target block on the blockchain based on the target consensus result and the target identification result, the following steps are specifically performed:
[0232] If the target consensus result indicates that the target block consensus is successful, and the target identification result indicates that the target transaction data in the target block is successfully identified, then the target block will be stored on the blockchain in the blockchain network.
[0233] In one implementation, one or more instructions in the computer-readable storage medium are loaded by the processor 1401 and, when executing the target consensus result for receiving the target block, specifically perform the following steps:
[0234] Receive the consensus voting results for the target block returned by each consensus node in the blockchain network;
[0235] The statistics indicate the first vote count for the consensus vote on the success of the target block consensus, and the target consensus result is generated based on the first vote count;
[0236] If the number of first votes is greater than the first quantity threshold, then the target consensus result indicates that the target block consensus is successful.
[0237] In one implementation, the number of target identification types is 1. When one or more instructions in the computer-readable storage medium are loaded by the processor 1401 and executed to receive the target identification result of the target block, the following steps are specifically performed:
[0238] Receive the voting results of the target transaction data in the target block returned by each target identification node corresponding to the target identification type;
[0239] The statistics indicate the second vote count of the identification voting results for the target transaction data, and generate the target identification result based on the second vote count;
[0240] If the second number of votes is greater than the second quantity threshold, then the target identification result indicates that the target transaction data in the target block has been successfully identified.
[0241] In one implementation, the target identification type includes a first target identification type and a second target identification type. When one or more instructions in the computer-readable storage medium are loaded by the processor 1401 and executed to receive the target identification result of the target block, the following steps are specifically performed:
[0242] Receive the first identification voting results returned by each target identification node corresponding to the first target identification type;
[0243] The statistical indicator counts the first identification votes for the first identification voting results that have passed the identification of the target transaction data, and generates a first identification result based on the first identification vote count; and,
[0244] Receive the second identification voting results returned by each target identification node corresponding to the second target identification type;
[0245] The statistics indicate the number of second identification votes for the second identification voting results that have passed the identification of the target transaction data, and generate a second identification result based on the number of second identification votes;
[0246] Target identification results are generated based on the first and second identification results;
[0247] Specifically, if the number of first identification votes is greater than the third quantity threshold, the first identification result indicates that the target transaction data in the target block has been successfully identified; if the number of second identification votes is greater than the fourth quantity threshold, the second identification result indicates that the target transaction data in the target block has been successfully identified; if both the first and second identification results indicate successful identification, the target identification result indicates that the target transaction data in the target block has been successfully identified.
[0248] In one implementation, the processing unit is further configured to load one or more instructions from a computer-readable storage medium by the processor 1401 and further execute the following steps:
[0249] If the target identification result indicates that the target transaction data in the target block has failed to be identified, then the target feedback information sent by each target identification node, which indicates that the target transaction data has failed to be identified, is received. The target feedback information is used to indicate the reason why the target identification node failed to identify the target transaction data.
[0250] Send the target feedback information to the party that submitted the target transaction data.
[0251] In one implementation, the target configuration contract also includes a node identifier for each identified node, and one or more instructions in a computer-readable storage medium are loaded by the processor 1401 and further executed as follows:
[0252] Obtain the target node identifier of the target recognition node corresponding to the target recognition type;
[0253] If a communication connection is successfully established between the target node identifier and the target identification node, the step of packaging the target transaction data and generating the target block is triggered.
[0254] In one implementation, one or more instructions in a computer-readable storage medium are loaded by processor 1401 and the following steps are also executed:
[0255] If a communication connection with the target identification node is detected to be broken during the packaging process of the target transaction data, the packaging process of the target transaction data will be paused.
[0256] When the communication connection with the target identification node is restored, the target transaction data continues to be packaged and processed.
[0257] In another embodiment, the computer-readable storage medium stores one or more instructions; the processor 1401 loads and executes one or more instructions stored in the computer-readable storage medium to implement the corresponding steps in the above-described consensus processing method embodiment; specifically, the blockchain network includes at least one consensus node and at least one identification node, each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type; the device is mounted on the target identification node corresponding to the target identification type; one or more instructions in the computer-readable storage medium are loaded by the processor 1401 and executed in the following steps:
[0258] Receive the target block broadcast by the target consensus node in the blockchain network; the target consensus node is any one of at least one consensus node included in the blockchain network; the target block is obtained by the target consensus node based on the target transaction data; the target transaction data belongs to the target identification type;
[0259] The target transaction data in the target block is identified and processed to obtain the identification voting results;
[0260] The identification voting result is returned to the target consensus node so that the target consensus node can obtain the target identification result of the target block based on the identification voting result, and then process the target block on the chain based on the target identification result and the target consensus result; the target consensus result is generated by the target consensus node based on the consensus vote, which is obtained by the consensus nodes in the blockchain network to reach a consensus on the target block.
[0261] In one implementation, when one or more instructions in the computer-readable storage medium are loaded by the processor 1401 and executed to identify target transaction data in the target block and obtain the identification voting result, the following steps are specifically performed:
[0262] Obtain the identification rules corresponding to the target transaction data; the identification rules are provided by the identification party.
[0263] The target transaction data is identified and processed according to the identification rules to obtain the identification voting results;
[0264] The identification rules are used to identify the correctness of the transaction information contained in the target transaction data; when the identification voting result indicates that the target transaction data has passed the identification, it is determined that the transaction information contained in the target transaction data is correct.
[0265] In one implementation, one or more instructions in a computer-readable storage medium are loaded by processor 1401 and the following steps are also performed:
[0266] If the voting results indicate that the target transaction data identification fails, target feedback information is generated to indicate the reason why the target transaction data identification failed.
[0267] The target feedback information is sent to the target consensus node so that when the target consensus node detects that the target identification result indicates that the target block identification has failed, it sends the target feedback information to the submitter of the target transaction data.
[0268] Based on the same inventive concept, the principle and beneficial effects of the blockchain node device provided in the embodiments of this application in solving the problem are similar to the principle and beneficial effects of the consensus processing method based on the blockchain network in the method embodiments of this application. For details, please refer to the principle and beneficial effects of the method implementation. For the sake of brevity, they will not be repeated here.
[0269] This application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of a blockchain node device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the blockchain node device to perform the aforementioned consensus processing method based on a blockchain network.
[0270] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0271] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0272] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this invention should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A consensus processing method based on a blockchain network, characterized in that, The blockchain network includes at least one consensus node and at least one identification node. Each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type. The method is executed by a target consensus node, which is any one of the at least one consensus node; the method includes: Acquire target transaction data, wherein the target transaction data belongs to the target identification type; The target transaction data is packaged to generate a target block; The target block is broadcast in the blockchain network, enabling other consensus nodes in the blockchain network, excluding the target consensus node, to verify the target block according to the consensus algorithm and obtain a consensus voting result. Simultaneously, each identification node in the node cluster corresponding to each identification type in the blockchain network determines whether it has the authority to identify the target transaction data in the target block based on the target business contract in the target configuration contract. When the target identification node has the authority to identify the target transaction data, it performs identification processing on the target transaction data and obtains an identification voting result. The identification voting result indicates whether the target identification node successfully or failed to identify the information contained in the target transaction data. Receive the target consensus result and target identification result of the target block; the target consensus result is obtained based on the consensus voting results returned by the other consensus nodes; the target identification result is obtained based on the identification voting results returned by the target identification node; and, Based on the target consensus result and the target identification result, the target block is processed for on-chain processing.
2. The method as described in claim 1, characterized in that, Each node in the blockchain network is deployed with a target configuration contract, which includes: the identification type corresponding to each identification node and the identification type to which the transaction data belongs.
3. The method as described in claim 1 or 2, characterized in that, The step of uploading the target block to the blockchain based on the target consensus result and the target identification result includes: If the target consensus result indicates that the target block consensus is successful, and the target identification result indicates that the target transaction data in the target block is successfully identified, then the target block is stored on the blockchain in the blockchain network.
4. The method as described in claim 3, characterized in that, Receiving the target consensus result of the target block includes: Receive the consensus voting results for the target block returned by each consensus node in the blockchain network; The statistics indicate the first number of votes for the consensus vote on the success of the target block consensus, and the target consensus result is generated based on the first number of votes; If the first number of votes is greater than the first quantity threshold, then the target consensus result indicates that the target block consensus is successful.
5. The method as described in claim 3, characterized in that, The number of target identification types is 1, and the target identification result of the target block is received, including: Receive the identification voting results of the target transaction data in the target block returned by each target identification node corresponding to the target identification type; The statistics indicate the second number of votes for the identification voting results that have passed the identification of the target transaction data, and generate the target identification result based on the second number of votes; If the second number of votes is greater than the second quantity threshold, then the target identification result indicates that the target transaction data in the target block has been successfully identified.
6. The method as described in claim 3, characterized in that, The target identification type includes a first target identification type and a second target identification type. Receiving the target identification result of the target block includes: Receive the first identification voting results returned by each target identification node corresponding to the first target identification type; The statistics indicate the first number of identification votes for the first identification voting result that has passed the identification of the target transaction data, and generate a first identification result based on the first number of identification votes; and, Receive the second identification voting results returned by each target identification node corresponding to the second target identification type; The statistics indicate the number of second identification votes for the second identification voting results that have passed the identification of the target transaction data, and generate a second identification result based on the number of second identification votes; Generate target identification results based on the first identification result and the second identification result; Specifically, if the first identification vote count is greater than the third quantity threshold, then the first identification result indicates that the target transaction data in the target block has been successfully identified; if the second identification vote count is greater than the fourth quantity threshold, then the second identification result indicates that the target transaction data in the target block has been successfully identified; if both the first identification result and the second identification result indicate successful identification, then the target identification result indicates that the target transaction data in the target block has been successfully identified.
7. The method as described in claim 5 or 6, characterized in that, The method further includes: If the target identification result indicates that the target transaction data in the target block has failed to be identified, then the target feedback information sent by each target identification node that indicates the target transaction data has failed to be identified is received; the target feedback information is used to indicate the reason why the target identification node failed to identify the target transaction data. The target feedback information is sent to the party that submitted the target transaction data.
8. The method as described in claim 2, characterized in that, The target configuration contract also includes a node identifier for each identified node. Before packaging the target transaction data to generate the target block, the process further includes: Obtain the target node identifier of the target identification node corresponding to the target identification type; If a communication connection is successfully established between the target node identifier and the target identification node, the step of packaging the target transaction data and generating the target block is triggered.
9. The method as described in claim 8, characterized in that, The method further includes: If, during the packaging process of the target transaction data, a communication connection with the target identification node is detected to be broken, the packaging process of the target transaction data is paused. When the communication connection with the target identification node is restored, the target transaction data continues to be packaged.
10. A consensus processing method based on a blockchain network, characterized in that, The blockchain network includes at least one consensus node and at least one identification node. Each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type. The method is executed by a target recognition node corresponding to the target recognition type; the method includes: The system receives a target block broadcast by a target consensus node in the blockchain network; the target consensus node is any one of at least one consensus node included in the blockchain network; the target block is obtained by the target consensus node through packaging and processing of target transaction data; the target transaction data belongs to the target identification type. The target block is broadcast in the blockchain network, enabling other consensus nodes in the blockchain network, except for the target consensus node, to verify the target block according to the consensus algorithm and obtain the consensus voting result; at the same time, each identification node in the node cluster corresponding to each identification type in the blockchain network determines whether it has the authority to identify the target transaction data in the target block according to the target business contract in the target configuration contract. When the target identification node has the authority to identify the target transaction data, it performs identification processing on the target transaction data in the target block to obtain an identification voting result; the identification voting result is used to indicate whether the target identification node has successfully or failed to identify the information contained in the target transaction data. The identification voting result is returned to the target consensus node, so that the target consensus node obtains the target identification result of the target block based on the identification voting result, and performs on-chain processing on the target block based on the target identification result and the target consensus result; the target consensus result is obtained based on the consensus voting result returned by the other consensus nodes, and the target identification result is obtained based on the identification voting result returned by the target identification node; the consensus voting result is obtained by the consensus nodes in the blockchain network reaching a consensus on the target block.
11. The method as described in claim 10, characterized in that, The process of identifying and processing the target transaction data in the target block to obtain the identification voting results includes: Obtain the identification rules corresponding to the target transaction data, wherein the identification rules are provided by the identification party; The target transaction data is processed according to the identification rules to obtain the identification voting results; The identification rules are used to identify the correctness of the transaction information contained in the target transaction data; the identification voting result indicates that when the target transaction data passes the identification, the transaction information contained in the target transaction data is determined to be correct.
12. The method as described in claim 10, characterized in that, The method further includes: If the identification voting result indicates that the target transaction data identification fails, target feedback information is generated, which indicates the reason why the target transaction data identification fails. The target feedback information is sent to the target consensus node, so that when the target consensus node detects that the target identification result indicates that the target block identification has failed, the target feedback information is sent to the submitter of the target transaction data.
13. A consensus processing device based on a blockchain network, characterized in that, The device is used to implement the method as described in claim 1; the blockchain network includes at least one consensus node and at least one identification node, each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type; The consensus device is mounted on a target consensus node, which is any one of the at least one consensus node; The consensus processing device includes: An acquisition unit is used to acquire target transaction data, wherein the target transaction data belongs to the target identification type; The processing unit is used to package the target transaction data and generate a target block; The processing unit is further configured to broadcast the target block in the blockchain network, so that the consensus nodes in the blockchain network can reach a consensus on the target block, and to enable the target identification node corresponding to the target identification type to identify and process the target transaction data in the target block. The processing unit is further configured to receive the target consensus result and target identification result of the target block; and, The processing unit is further configured to perform on-chain processing on the target block based on the target consensus result and the target identification result.
14. A consensus processing device based on a blockchain network, characterized in that, The device is used to implement the method as described in claim 10; the blockchain network includes at least one consensus node and at least one identification node, each identification node corresponds to one or more identification types, and each identification node is used to identify and process transaction data under the corresponding identification type; The consensus processing device is mounted on the target identification node corresponding to the target identification type; The consensus processing device includes: A receiving unit is configured to receive a target block broadcast by a target consensus node in the blockchain network; the target consensus node is any one of at least one consensus node included in the blockchain network; the target block is obtained by the target consensus node through packaging and processing of target transaction data; the target transaction data belongs to the target identification type; The processing unit is used to identify and process the target transaction data in the target block to obtain the identification voting results; The processing unit is further configured to return the identification voting result to the target consensus node, so that the target consensus node obtains the target identification result of the target block based on the identification voting result, and performs on-chain processing on the target block based on the target identification result and the target consensus result; the target consensus result is generated by the target consensus node based on the consensus vote, and the consensus vote is obtained by the consensus nodes in the blockchain network reaching a consensus on the target block.
15. A blockchain device, characterized in that, include: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the consensus processing method based on a blockchain network as described in any one of claims 1-9, or implements the consensus processing method based on a blockchain network as described in any one of claims 10-12.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and execute the consensus processing method based on a blockchain network as described in any one of claims 1-9, or to implement the consensus processing method based on a blockchain network as described in any one of claims 10-12.
17. A computer program product, characterized in that, The computer program product includes computer instructions, which, when executed by a processor, implement the consensus processing method based on a blockchain network as described in any one of claims 1-9, or implement the consensus processing method based on a blockchain network as described in any one of claims 10-12.
Citation Information
Patent Citations
Block chain generation method and device, computer equipment and storage medium
CN108768665A
Consensus method and device of block chain, electronic equipment and readable storage medium
CN112418859A
Blockchain node data consistency consensus method and device, equipment and storage medium
CN113489681A